[U-Boot] Feedback: Device probe during boot

Simon Glass sjg at google.com
Sat Nov 3 06:08:34 UTC 2018


Hi Vabhav,

On 2 November 2018 at 02:28, Vabhav Sharma <vabhav.sharma at nxp.com> wrote:
> Hello Maintainer/Owners,
>
> Please provide your valuable input
>
>
>
> Referring ‘[PATCH] drivers: serial: probe all serial devices’ email
> regarding unified way to probe device during boot using DM model
>
> I would like to take this thread forward and request your time to help
> identify the design framework
>
> In dm_init(),
>
> Identify the class of devices to be probed
> Call dm_set_uclass_autoprobe(enum uclass_id, bool)
>
> In core file on every device class
>
> uclass_next_device() to iterate through next device
>
>
>
> There would be config option to choose probe all devices or not
>
> Let me know your time if I can schedule skype session for further discussion

I think here you are referring to things like PCI, where we must probe
the buses to discover devices that would otherwise not even be
visible, and that could not be used or even probed? E.g. some x86
boards need PCI even just to get a serial UART.

I think PCI is the main example I can think of. But there might be
other buses on some systems which are known to hold core devices.

As Wolfgang says, this is not something we should enable by default,
or use for all uclasses. But some boards / archs do need this, I
think. For example see this line:

arch/x86/cpu/ivybridge/cpu.c:     ret = uclass_get_device(UCLASS_PCI, 0, &bus);

This probes PCI so that other devices become visible. We could use
your feature instead, and in fact enable it for all x86 boards.

So I think the function you describe seems reasonable. It could be
called in the board_init() function perhaps? If you add it, please do
add documentation too.

[...]

Regards,
Simon


More information about the U-Boot mailing list