[PATCH v3 08/16] pci: coreboot: Don't read regions when booting

Simon Glass sjg at chromium.org
Mon Mar 27 06:15:42 CEST 2023

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 at chromium.org>
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>

(no changes since v1)

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

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 9343cfc62a96..8d27e40338cf 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__);

More information about the U-Boot mailing list