[U-Boot] [PATCH 8/8] net: Probe PCI before looking for ethernet devices

Bin Meng bmeng.cn at gmail.com
Mon Jan 18 05:41:18 CET 2016


Hi Simon,

On Mon, Jan 18, 2016 at 5:52 AM, Simon Glass <sjg at chromium.org> wrote:
> Some ethernet devices may be on a PCI bus. Probe the first PCI controller to
> find these, so that ethernet init will complete correctly.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  net/eth-uclass.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/net/eth-uclass.c b/net/eth-uclass.c
> index a356a08..817c6e0 100644
> --- a/net/eth-uclass.c
> +++ b/net/eth-uclass.c
> @@ -383,7 +383,12 @@ int eth_initialize(void)
>  {
>         int num_devices = 0;
>         struct udevice *dev;
> +#ifdef CONFIG_DM_PCI
> +       struct udevice *pci_dev;
>
> +       /* Start PCI since it may have a network interface */
> +       uclass_first_device(UCLASS_PCI, &pci_dev);
> +#endif

Why do we need this? With driver model, the PCI will be automatically
started, see eth_designware.c which supports both PCI and non-PCI
variants.

>         eth_common_init();
>
>         /*
> --

Regards,
Bin


More information about the U-Boot mailing list