At present PCI auto-configuration happens in U-Boot both before and after
relocation. This is a waste of time and may mess up static addresses used
in board_init_f(). Adjust the code to do auto-configuration once, after
relocation.

Signed-off-by: Simon Glass <[email protected]>
---

Changes in v3: None
Changes in v2: None

 drivers/pci/pci-uclass.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 896cb6b23a1..e77445cea33 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -983,11 +983,11 @@ static int pci_uclass_post_probe(struct udevice *bus)
        if (ret)
                return ret;
 
-#if CONFIG_IS_ENABLED(PCI_PNP)
-       ret = pci_auto_config_devices(bus);
-       if (ret < 0)
-               return ret;
-#endif
+       if (CONFIG_IS_ENABLED(PCI_PNP) && (gd->flags & GD_FLG_RELOC)) {
+               ret = pci_auto_config_devices(bus);
+               if (ret < 0)
+                       return log_msg_ret("pci auto-config", ret);
+       }
 
 #if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP)
        /*
-- 
2.23.0.866.gb869b98d4c-goog

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

Reply via email to