Skip to contentSkip to conversation

pci: add ECAM generic controller support

PATCH In review Ahmad Fatoum 3 participants 3 messages Nov 15, 2021 – Nov 17, 2021 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci: add ECAM generic controller support

This has been tested with QEMU AArch64 Virt. The default (-M virt,highmem=on) will have two ranges specified in the device trees for memory bars. One 32-bit and the other 64-bit. As barebox can't yet handle 64-bit BARs, the driver will prefer the 32-bit memory region if available. If none is available, consider using -M virt,highmem=off or fixing 64-bit support.

---
 drivers/pci/Kconfig            |   8 ++
 drivers/pci/Makefile           |   1 +
 drivers/pci/pci-ecam-generic.c | 207 +++++++++++++++++++++++++++++++++
 3 files changed, 216 insertions(+)
 create mode 100644 drivers/pci/pci-ecam-generic.c
drivers/pci/Kconfig +8 -0
index 60e8e93a0739..e847e8e1a3a2 100644
@@ -60,6 +60,14 @@ config PCI_EFI
 	depends on EFI_BOOTUP
 	select PCI
 
+config PCI_ECAM_GENERIC
+	bool "Generic ECAM-based PCI host controller support"
+	select OF_PCI
+	select PCI
+	help
+	  Say Y here if you want to enable support for generic ECAM-based
+	  PCI host controllers, such as the one emulated by QEMU.
+
 endmenu
 
 endif
drivers/pci/Makefile +1 -0
index 60e1439ec7b2..b8a5c6392ad6 100644
@@ -12,3 +12,4 @@ obj-$(CONFIG_PCIE_DW) += pcie-designware.o pcie-designware-host.o
 obj-$(CONFIG_PCI_IMX6) += pci-imx6.o
 obj-$(CONFIG_PCI_LAYERSCAPE) += pci-layerscape.o
 obj-$(CONFIG_PCI_EFI) += pci-efi.o
+obj-$(CONFIG_PCI_ECAM_GENERIC) += pci-ecam-generic.o
drivers/pci/pci-ecam-generic.c new file +207 -0

207 lines not on this page · raw message

Signature · 7 lines
2.33.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw
Quoted 6 lines · Ahmad Fatoum

This has been tested with QEMU AArch64 Virt. The default (-M virt,highmem=on) will have two ranges specified in the device trees for memory bars. One 32-bit and the other 64-bit. As barebox can't yet handle 64-bit BARs, the driver will prefer the 32-bit memory region if available. If none is available, consider using -M virt,highmem=off or fixing 64-bit support.

Looks straight forward. What can I do with it?

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Hi,

Quoted 9 lines · Sascha Hauer
Quoted 6 lines · Ahmad Fatoum

This has been tested with QEMU AArch64 Virt. The default (-M virt,highmem=on) will have two ranges specified in the device trees for memory bars. One 32-bit and the other 64-bit. As barebox can't yet handle 64-bit BARs, the driver will prefer the 32-bit memory region if available. If none is available, consider using -M virt,highmem=off or fixing 64-bit support.

Looks straight forward. What can I do with it?

I wanted video output with qemu-system-aarch64 for my EFI loader work. The Bochs PCI driver is the only driver I tested so far:

test/emulate.pl qemu_virt64_defconfig -- -device VGA

You'll need some config changes. See the series, I just sent out.

Cheers,
Ahmad

Quoted 3 lines

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox