[U-Boot] [PATCH v3 008/108] dm: pci: Delay auto-config until after relocation
Bin Meng
bmeng.cn at gmail.com
Mon Oct 28 04:45:20 UTC 2019
Hi Simon,
On Mon, Oct 21, 2019 at 11:33 AM Simon Glass <sjg at chromium.org> wrote:
>
> 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 <sjg at chromium.org>
> ---
>
> 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)) {
This breaks boards that use PCI before relocation, eg: PCI UART.
> + 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)
> /*
> --
Regards,
Bin
More information about the U-Boot
mailing list