Skip to content

powerpc/pci: Cleanup unused code and enable 256 PCI buses

Pali Rohár linux-pci linuxppc-dev lkml 1 version Applied

Status from this message: Applied to powerpc/next.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5powerpc/pci: Hide pci_device_from_OF_node() for non-powermac codearch/powerpc/include/asm/pci-bridge.h arch/powerpc/kernel/pci_32.c arch/powerpc/kernel/pci_64.c+6 -01 reply
2/5powerpc/pci: Make pcibios_make_OF_bus_map() staticarch/powerpc/kernel/pci_32.c+1 -30 replies
3/5powerpc/pci: Hide pci_create_OF_bus_map() for non-chrp codearch/powerpc/include/asm/pci-bridge.h arch/powerpc/kernel/pci_32.c+4 -00 replies
4/5powerpc/pci: Disable filling pci-OF-bus-map for non-chrp/powermacarch/powerpc/kernel/pci_32.c+10 -30 replies
5/5powerpc/pci: Add config option for using all 256 PCI busesarch/powerpc/Kconfig arch/powerpc/kernel/pci_32.c+17 -04 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] powerpc/pci: Cleanup unused code and enable 256 PCI buses

This patch series cleanup unused code by eliminating it at compile time and then enable usage of all 256 PCI buses per every PCI domain as currently PCI bus numbers have to be unique across all PCI domains. So first bus number of each PCI domain would be zero and not the bus number of the previous domain plus one. As such bus assignment changes BDF address of every PCI device on multi-domain system, this new "feature" is configurable by config option to prevent regressions.

Tested on Freescale P2020 board. Before this patch lspci reports:

8000:00:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21)
8000:01:00.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller (rev 02) 9000:02:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21)
9000:03:00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network Adapter (rev 01) a000:04:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21)
a000:05:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter

With these patches and enabled config option it reports:

8000:00:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21)
8000:01:00.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller (rev 02) 9000:00:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21)
9000:01:00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network Adapter (rev 01) a000:00:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21)
a000:01:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter

Now every PCIe Root Port is on bus zero and theoretically with enough multiport PCIe switches connected to every PCIe Root Port, it should be possible to have 256 PCI buses on every PCIe controller (as each is in own PCI domain) and therefore connect more PCIe cards as without these patches.

Pali Rohár (5):
powerpc/pci: Hide pci_device_from_OF_node() for non-powermac code powerpc/pci: Make pcibios_make_OF_bus_map() static powerpc/pci: Hide pci_create_OF_bus_map() for non-chrp code powerpc/pci: Disable filling pci-OF-bus-map for non-chrp/powermac powerpc/pci: Add config option for using all 256 PCI buses

 arch/powerpc/Kconfig                  | 11 +++++++++++
 arch/powerpc/include/asm/pci-bridge.h |  4 ++++
 arch/powerpc/kernel/pci_32.c          | 27 +++++++++++++++++++++------
 arch/powerpc/kernel/pci_64.c          |  2 ++
 4 files changed, 38 insertions(+), 6 deletions(-)
Signature · 1 line
2.20.1