diff mbox series

[v4,4/9] pci: Avoid auto-config when chain loading

Message ID 20200426091237.v4.4.Idfdc61ea876ea7aeafb2370394ac2c922344f9b4@changeid
State Superseded
Headers show
Series x86: Improve support for chain-loading U-Boot | expand

Commit Message

Simon Glass April 26, 2020, 3:12 p.m. UTC
When U-Boot is not the first-stage bootloader we don't want to
re-configure the PCI devices, since this has already been done. Add a
check to avoid this.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Drop patch 'dm: Avoid initing built-in devices when chain loading'

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

Comments

Bin Meng April 30, 2020, 9:32 a.m. UTC | #1
On Sun, Apr 26, 2020 at 11:13 PM Simon Glass <sjg at chromium.org> wrote:
>
> When U-Boot is not the first-stage bootloader we don't want to
> re-configure the PCI devices, since this has already been done. Add a
> check to avoid this.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v4: None
> Changes in v3: None
> Changes in v2:
> - Drop patch 'dm: Avoid initing built-in devices when chain loading'
>
>  drivers/pci/pci-uclass.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index d2e10d6868..7f46e901fb 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -1009,7 +1009,7 @@  static int pci_uclass_post_probe(struct udevice *bus)
 	if (ret)
 		return ret;
 
-	if (CONFIG_IS_ENABLED(PCI_PNP) &&
+	if (CONFIG_IS_ENABLED(PCI_PNP) && ll_boot_init() &&
 	    (!hose->skip_auto_config_until_reloc ||
 	     (gd->flags & GD_FLG_RELOC))) {
 		ret = pci_auto_config_devices(bus);
@@ -1031,7 +1031,7 @@  static int pci_uclass_post_probe(struct udevice *bus)
 	 * Note we only call this 1) after U-Boot is relocated, and 2)
 	 * root bus has finished probing.
 	 */
-	if ((gd->flags & GD_FLG_RELOC) && (bus->seq == 0)) {
+	if ((gd->flags & GD_FLG_RELOC) && bus->seq == 0 && ll_boot_init()) {
 		ret = fsp_init_phase_pci();
 		if (ret)
 			return ret;