[U-Boot] [RFC PATCH 16/22] dm: Add a way to indicate a preferred device within a uclass

Simon Glass sjg at chromium.org
Fri May 30 16:43:33 CEST 2014


Hi Jon,

On 27 May 2014 09:42, Jon Loeliger <loeliger at gmail.com> wrote:
>> The preferred device can be specified with a DM_FLAG_PREFER flag or a
>> 'dm,prefer' property in the device tree node.
>>
>> It is possible that a better approach will come to light in the future, but
>> this gets around the problem as it currently stands.
>
> Here's your clue that something isn't quite right here.  Again, this looks like
> the us of a DTS property to describe a SW functionality rather than describe
> the HW itself.
>
>
> I'm not sure what needs to be done here either, but maybe it centers on
> a better understanding of *why* something is being preferred?  And what
> if it is "preferred", then what does that really mean?  And what if two devices
> are labelled as "preferred" -- Is that OK?  Who checks and enforces it?
>
> Sure, this may be a hack for now, but it needs more thought.

Agreed, but I've done all the thinking I can so far, and this is the result.

Another way of doing this would be to designate the platform data
device as a 'backup' device, only to be used if we don't get a similar
device from the device tree. But I'm not sure that it would be better
that way.

This is not intended to be a widely-used mechanism - it just deals
with the issue of device tree vs. not.

My preference would be to require that all devices be represented by a
device tree with driver model. However, I think that would discourage
adoption in the short term. Also for sandbox we really do want to test
all the code, and so always having a device tree would reduce test
coverage.

Regards,
Simon


More information about the U-Boot mailing list