diff mbox series

[07/13] pci: coreboot: Don't read regions when booting

Message ID 20230220194927.476708-8-sjg@chromium.org
State Superseded
Delegated to: Bin Meng
Headers show
Series x86: Various minor enhancements for coreboot | expand

Commit Message

Simon Glass Feb. 20, 2023, 7:49 p.m. UTC
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>
---

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

Comments

Bin Meng March 20, 2023, 7:58 a.m. UTC | #1
On Tue, Feb 21, 2023 at 3:49 AM Simon Glass <sjg@chromium.org> wrote:
>
> 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>
> ---
>
>  drivers/pci/pci-uclass.c | 4 ++++
>  1 file changed, 4 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Christian Gmeiner March 22, 2023, 3:54 p.m. UTC | #2
> > 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>
> > ---
> >
> >  drivers/pci/pci-uclass.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
>

Tested-by: Christian Gmeiner <christian.gmeiner@gmail.com>
diff mbox series

Patch

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__);