On Thu, Aug 14, 2025 at 9:52 AM Mark Kettenis <mark.kette...@xs4all.nl> wrote:
> Not without removing the 2nd pci_init_r() that is conditionalized on > !CONFIG_IS_ENABLED(SYS_EARLY_PCI_INIT). > > That would require some thorough testing though; I certainly wouldn't > be sure calling pci_init_r() is safe at that point on the boards I > maintain. You're right. Maybe we could solve it with two patches: 1. Convert EARLY_PCI_INIT to a Kconfig symbol: diff --git a/common/Kconfig b/common/Kconfig index a2f653f7e722..9119a1c0869f 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -824,6 +824,13 @@ config SYS_I2C_EEPROM_NXID endchoice +config EARLY_PCI_INIT + bool "Enumerate PCI buses early during init" + depends on PCI + help + Do early PCI configuration _before_ the flash gets initialised, + because PCU resources are crucial for flash access on some boards. + config PCI_INIT_R bool "Enumerate PCI buses during init" depends on PCI 2. Select CONFIG_EARLY_PCI_INIT in the defconfig diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig index d5890bf87fb3..a0d03dc19d0b 100644 --- a/configs/qemu_arm_defconfig +++ b/configs/qemu_arm_defconfig @@ -28,6 +28,7 @@ CONFIG_USE_PREBOOT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set # CONFIG_BOARD_INIT is not set +CONFIG_EARLY_PCI_INIT=y CONFIG_PCI_INIT_R=y CONFIG_CMD_BOOTEFI_SELFTEST=y CONFIG_CMD_NVEDIT_EFI=y