[U-Boot] [PATCH v3 07/16] sandbox: dts: Add a serial console node

Stephen Warren swarren at wwwdotorg.org
Fri Aug 1 01:09:44 CEST 2014


On 07/31/2014 04:13 PM, Simon Glass wrote:
> Hi Stephen,
>
> On 31 July 2014 21:20, Stephen Warren <swarren at wwwdotorg.org> wrote:
>> On 07/30/2014 03:49 AM, Simon Glass wrote:
>>>
>>> If the sandbox device tree is provided to U-Boot (with the -d flag) then
>>> it
>>> will use the device tree version in preference to the built-in device. The
>>> only difference is the colour.
>>
>>
>>> diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
>>
>>
>>> +       uart0: serial {
>>> +               compatible = "sandbox,serial";
>>> +               u-boot,dm-pre-reloc;
>>
>>
>> Shouldn't that be handled by the driver. It's certainly something that's
>> only relevant to the internals of U-Boot, and hence inappropriate to put
>> into DT.
>
> Hence the u-boot prefix. This is described in the driver model docs. I
> have found a work-around (which forces a driver to be inited pre-reloc
> if none is found) but I'm not 100% happy with it.

I'm arguing that the property shouldn't exist in DT at all. DT is 
supposed to be a pure description of the HW, and not encode details that 
are specific to the implementation of particular SW. The fact that 
U-Boot performs relocation of its code during boot is completely 
irrelevant to a HW description.

As such, the issue isn't whether there is a u-boot, prefix on that 
property, but whether it's there at all.

>>> +               text-colour = "cyan";
>>
>>
>> That's property should likely have a uboot, prefix, since it's non-standard.
>
> Can I not just declare a binding for 'sandbox,serial'?

Properties that are relevant only to a particular binding, rather than 
being something quite generic an applicable to a whole class of devices, 
typically have a vendor prefix.

A binding should/must exist for every node or compatible value. So, 
whether you actually write the binding document or not makes no 
difference to the names or vendor prefixes of the properties the binding 
uses.


More information about the U-Boot mailing list