CONFIG_SYS_EARLY_PCI_INIT for PCI-attached eMMC

Fabio Estevam festevam at gmail.com
Thu Aug 14 14:22:57 CEST 2025


On Thu, Aug 14, 2025 at 6:11 AM Jan Kiszka <jan.kiszka at siemens.com> wrote:
>
> Hi all,
>
> I'm currently playing with eMMC emulation for qemu-system-aarch64 -M
> virt and will likely propose upstream to allow user-instantiate emmc
> devices (-> -device sdhci-pci -device emmc).
>
> To make U-Boot recognize such a setup, I currently need this:
>
> diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h
> index e296f398798..4e22aa36fa6 100644
> --- a/include/configs/qemu-arm.h
> +++ b/include/configs/qemu-arm.h
> @@ -11,4 +11,6 @@
>
>  /* For timer, QEMU emulates an ARMv7/ARMv8 architected timer */
>
> +#define CONFIG_SYS_EARLY_PCI_INIT      1
> +
>  #endif /* __CONFIG_H */
>
> Is this the right way to achieve? Then a patch for U-Boot would follow
> as well.

CONFIG_SYS_EARLY_PCI_INIT is not defined anywhere as a Kconfig symbol.

I'm wondering if we should change it like this instead:

diff --git a/common/board_r.c b/common/board_r.c
index 143d51d06330..3da749b05fcc 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -685,7 +685,7 @@ static void initcall_run_r(void)
        INITCALL(post_output_backlog);
 #endif
        WATCHDOG_RESET();
-#if CONFIG_IS_ENABLED(PCI_INIT_R) && CONFIG_IS_ENABLED(SYS_EARLY_PCI_INIT)
+#if CONFIG_IS_ENABLED(PCI_INIT_R)
        /*
         * Do early PCI configuration _before_ the flash gets initialised,
         * because PCU resources are crucial for flash access on some boards.


More information about the U-Boot mailing list