[U-Boot] [PATCH 1/3] arm64: mvebu: Trigger PCI devices scan at early init stage

kostap at marvell.com kostap at marvell.com
Tue Mar 28 15:36:33 UTC 2017


From: Konstantin Porotchkin <kostap at marvell.com>

Add PCIe initialization at early init stage.
This operation has a side effect of detecting all PCIe
plug-in cards, so the operator is not obligated to issue
"pci enum" command though CLI for this purpose.
Also convert the SATA first device scan to a walk through
all availabel SATA devices.

Signed-off-by: Konstantin Porotchkin <kostap at marvell.com>
Cc: Stefan Roese <sr at denx.de>
Cc: Igal Liberman <igall at marvell.com>
Cc: Nadav Haklai <nadavh at marvell.com>
---
 arch/arm/mach-mvebu/arm64-common.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-mvebu/arm64-common.c b/arch/arm/mach-mvebu/arm64-common.c
index 8f02655..ff28750 100644
--- a/arch/arm/mach-mvebu/arm64-common.c
+++ b/arch/arm/mach-mvebu/arm64-common.c
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <fdtdec.h>
 #include <libfdt.h>
+#include <pci.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/arch/cpu.h>
@@ -142,8 +143,16 @@ int arch_early_init_r(void)
 			break;
 	}
 
-	/* Cause the SATA device to do its early init */
-	uclass_first_device(UCLASS_AHCI, &dev);
+	/* Cause the SATA devices to do their early init */
+	for (uclass_first_device(UCLASS_AHCI, &dev);
+	     dev;
+	     uclass_next_device(&dev))
+		;
+
+#ifdef CONFIG_DM_PCI
+	/* Trigger PCIe devices detection */
+	pci_init();
+#endif
 
 	return 0;
 }
-- 
2.7.4



More information about the U-Boot mailing list