Marcel Apfelbaum
2015-06-02 15:04:43 UTC
Hi,
The following series:
- [Qemu-devel] [PATCH V8 00/17] hw/pc: implement multiple primary busses for pc machines
- https://www.mail-archive.com/qemu-***@nongnu.org/msg300089.html
adds a PCI Expander Device to QEMU that exposes a new PCI root bus.
The PXB is a "light-weight" host bridge whose purpose is to enable
the main host bridge to support multiple PCI root buses.
It does not have its own registers for configuration cycles, but is snoops
on main host bridge registers and it lives on the same PCI segment.
The device receives from the command line the bus number and expects the
firmware (bios/UEFI) to probe the bus for devices behind it and
configure them.
My question is how can it be supported in edk2? Are there any architecture
limitations that will prevent it to work?
My edk2/UEFI knowledge is rather limited, but I did see in the spec
that there is support for this kind of device:
13.1.1 PCI Root Bridge I/O Overview
...
Depending on the chipset, a single EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL may abstract a portion of a PCI
Segment, or an entire PCI Segment. A PCI Host Bridge may produce one or more PCI Root
Bridges. When a PCI Host Bridge produces multiple PCI Root Bridges, it is possible to have
more than one PCI Segment.
...
It seems that multiple EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instances for the same
PCI Host Bridge mapped into the same PCI Segment is the answer. First instance
belongs to the "main" host bridge and the other to the PXBs.
The open questions are of course how to assign resources (bus numbers/IO/MEM)
to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instances.
For the bus numbers I think that the PCI Host Bridge can scan the 0x0 - 0xff range
and build incrementally the bus ranges.
Regarding IO/MEM ranges I am still not sure.
The way it is done in SeaBIOS is that all devices behind PXB root bus are
"considered" as being behind bus 0 for resources allocation.
Once the resources allocation is done, each EFI_PCI_ROOT_BRIDGE
gets the list of MEM/IO ranges corresponding with the devices behind them.
Any comments and suggestions would be greatly appreciated.
Thank you in advance,
Marcel
------------------------------------------------------------------------------
The following series:
- [Qemu-devel] [PATCH V8 00/17] hw/pc: implement multiple primary busses for pc machines
- https://www.mail-archive.com/qemu-***@nongnu.org/msg300089.html
adds a PCI Expander Device to QEMU that exposes a new PCI root bus.
The PXB is a "light-weight" host bridge whose purpose is to enable
the main host bridge to support multiple PCI root buses.
It does not have its own registers for configuration cycles, but is snoops
on main host bridge registers and it lives on the same PCI segment.
The device receives from the command line the bus number and expects the
firmware (bios/UEFI) to probe the bus for devices behind it and
configure them.
My question is how can it be supported in edk2? Are there any architecture
limitations that will prevent it to work?
My edk2/UEFI knowledge is rather limited, but I did see in the spec
that there is support for this kind of device:
13.1.1 PCI Root Bridge I/O Overview
...
Depending on the chipset, a single EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL may abstract a portion of a PCI
Segment, or an entire PCI Segment. A PCI Host Bridge may produce one or more PCI Root
Bridges. When a PCI Host Bridge produces multiple PCI Root Bridges, it is possible to have
more than one PCI Segment.
...
It seems that multiple EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instances for the same
PCI Host Bridge mapped into the same PCI Segment is the answer. First instance
belongs to the "main" host bridge and the other to the PXBs.
The open questions are of course how to assign resources (bus numbers/IO/MEM)
to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instances.
For the bus numbers I think that the PCI Host Bridge can scan the 0x0 - 0xff range
and build incrementally the bus ranges.
Regarding IO/MEM ranges I am still not sure.
The way it is done in SeaBIOS is that all devices behind PXB root bus are
"considered" as being behind bus 0 for resources allocation.
Once the resources allocation is done, each EFI_PCI_ROOT_BRIDGE
gets the list of MEM/IO ranges corresponding with the devices behind them.
Any comments and suggestions would be greatly appreciated.
Thank you in advance,
Marcel
------------------------------------------------------------------------------