On 03/30/2017 04:31 PM, Stefan Roese wrote:
(adding Simon to Cc for PCI related question)

On 28.03.2017 17:36, [email protected] wrote:
From: Konstantin Porotchkin <[email protected]>

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.

I'm not sure, if this should be handled this way. Simon, how
is such a default PCI scan with DM supposed to get done? Is
there a way do do this automatically without the need that
the user has to issue "pci enum" manually?
I was not sure either, but did not see any other way of doing so.
I asked to add this change by our Robot/Jenkins automation test team.

Also convert the SATA first device scan to a walk through
all availabel SATA devices.

This should be done in a separate patch. But seeing this,
won't this SATA / AHCI code be gone completely from this
file, once this is converted into a "real" DM AHCI / SCSI
driver (please look at my preliminary patch for this).
Will check your patch, thank you.
Maybe this change has to be completely removed if Simon guide me to the right solution for automatic PCIe enumeration.


Signed-off-by: Konstantin Porotchkin <[email protected]>
Cc: Stefan Roese <[email protected]>
Cc: Igal Liberman <[email protected]>
Cc: Nadav Haklai <[email protected]>
---
 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;
 }


Thanks,
Stefan
_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

Reply via email to