aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-05-04 16:55:01 -0600
committerBin Meng <bmeng@tinylab.org>2023-05-11 10:25:29 +0800
commitdd0f7bcf3b29a0b6095622b7dd83279b0a3dbfe4 (patch)
tree3f6906b349265f1ec8564b1fb3d68ec695e4eddc /drivers
parentb29dbf98baa35441ad01957bb2317cb4f70f390f (diff)
downloadu-boot-dd0f7bcf3b29a0b6095622b7dd83279b0a3dbfe4.tar.gz
pci: coreboot: Don't read regions when booting
When U-Boot is the second-stage bootloader, PCI is already set up. We cannot read the regions from the device tree. There is no point anyway, since PCI devices have already been allocated according to the regions and it is not safe for U-Boot to make any changes. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Fixes: f2ebaaa9f38d ("pci: Handle failed calloc in decode_regions()") Tested-by: Christian Gmeiner <christian.gmeiner@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/pci-uclass.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 9343cfc62a9..8d27e40338c 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -973,6 +973,10 @@ static int decode_regions(struct pci_controller *hose, ofnode parent_node,
int len;
int i;
+ /* handle booting from coreboot, etc. */
+ if (!ll_boot_init())
+ return 0;
+
prop = ofnode_get_property(node, "ranges", &len);
if (!prop) {
debug("%s: Cannot decode regions\n", __func__);