PCI wiki

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
8infy
Member
Member
Posts: 185
Joined: Sun Apr 05, 2020 1:01 pm

PCI wiki

Post by 8infy »

Hi, I have a few questions about PCI and the wiki article about it.

1. The wiki says
If it is a multifunction device, then bus 0, device 0, function 0 will be the PCI host controller responsible for bus 0; bus 0, device 0, function 1 will be the PCI host controller
responsible for bus 1, etc (up to the number of functions supported).
Does this imply there can only be at most 8 host controllers? Since there can only be 8 functions. Or is this completely wrong?

2. Have you ever seen a computer where there's multiple host controllers?
3. Let's imagine we have host controller function 0 and host controller function 1, (so bus 0 and 1) and we do recursive scan on both. Is it possible
that we would find a pci-to-pci bridge that leads to one of the busses already covered by a different host controller? In other words can we
encounter the same bus twice?
4. For PCIe, could different segment groups also have multiple host controllers? How bad can it get?

I tried downloading the official PCI/PCIe spec but it's behind a paywall :(

Thanks :D
wxwisiasdf
Member
Member
Posts: 34
Joined: Sat Sep 07, 2019 5:17 pm
Libera.chat IRC: Superleaf1995

Re: PCI wiki

Post by wxwisiasdf »

Yes, as im aware, a multifunction root device: each functions represents a bus; same with bridges.

Yes those computers exist, mostly servers.

PCIe: I have personally not messed with x86 but i can assume that each segment can have multiple multifunction root devices.

If you need the spec it's here https://web.archive.org/web/20180517113 ... on_3.0.pdf

Edit: each segment can have it's own root device
:-)
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: PCI wiki

Post by nullplan »

8infy wrote:How bad can it get?
Every combination of segment, bus, device, and function can have a device attached. You get the valid segments and valid root buses from ACPI, and can find more buses by enumerating bridges. You have to search through the devices, though, and the functions, too, should a device claim to be multifunction. I would counsel against initializing PCI bridges: BIOS must already do this, and do this correctly, so no need for you to get involved. You just read the bus numbers from their configuration. Unless you have need of the VGA compatibility mode, you have little reason to actually keep track of the topology. The only thing that should matter to you is what address to reach the actually important devices under.
Carpe diem!
User avatar
eekee
Member
Member
Posts: 891
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: PCI wiki

Post by eekee »

8infy wrote:2. Have you ever seen a computer where there's multiple host controllers?
Yes. In the dim and distant past, the vast majority of PCs had at least 2: one for the AGP port (remember that?) and one for the regular PCI bus. (The AGP port appeared to software to be a PCI bus.)
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
8infy
Member
Member
Posts: 185
Joined: Sun Apr 05, 2020 1:01 pm

Re: PCI wiki

Post by 8infy »

Thanks for the answers everyone!
8infy
Member
Member
Posts: 185
Joined: Sun Apr 05, 2020 1:01 pm

Re: PCI wiki

Post by 8infy »

eekee wrote:
8infy wrote:2. Have you ever seen a computer where there's multiple host controllers?
Yes. In the dim and distant past, the vast majority of PCs had at least 2: one for the AGP port (remember that?) and one for the regular PCI bus. (The AGP port appeared to software to be a PCI bus.)
Good to know, thanks! Did it actually appear under bus 0 device 0 function 1? Was bus 0 connected to it (or maybe vise versa)?
User avatar
eekee
Member
Member
Posts: 891
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: PCI wiki

Post by eekee »

I can't remember which was which now, and the hardware is long since gone. Sorry!
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Post Reply