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

Simon Glass sjg at chromium.org
Fri Aug 1 23:40:13 CEST 2014


Hi Stephen,

On 1 August 2014 00:09, Stephen Warren <swarren at wwwdotorg.org> wrote:
> 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.

I completely agree in theory, although in practice this can become a
huge pain. I'm open to suggestions. On the other hand as you well know
I'm more inclined to use a convenient solution and iterate/improve
later than sit on my hands and fret :-) Please check the dm README for
the issue involved.

>
>
>>>> +               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.

So here you are saying it should be:

   sandbox,text-colour = "cyan";

Is that right?

Regards,
Simon


More information about the U-Boot mailing list