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

2014-08-01 Thread Stephen Warren

On 08/01/2014 03:40 PM, Simon Glass wrote:

Hi Stephen,

On 1 August 2014 00:09, Stephen Warren  wrote:

On 07/31/2014 04:13 PM, Simon Glass wrote:


Hi Stephen,

On 31 July 2014 21:20, Stephen Warren  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;



...

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


I think that sounds right yes.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-08-01 Thread Simon Glass
Hi Stephen,

On 1 August 2014 00:09, Stephen Warren  wrote:
> On 07/31/2014 04:13 PM, Simon Glass wrote:
>>
>> Hi Stephen,
>>
>> On 31 July 2014 21:20, Stephen Warren  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
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-08-01 Thread Simon Glass
Hi,

On 1 August 2014 17:53, Tom Rini  wrote:
> On Fri, Aug 01, 2014 at 10:46:31AM -0500, Jon Loeliger wrote:
>>  +   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.
>>
>> Right.  And I've arguing that U-Boot should use exactly the same
>> descriptions that are in the Kernel even.  Those DTS descriptions should
>> be common, applicable to both or neither, exactly because they do
>> describe the HW and are agnostic WRT the SW that is using them.
>
> I also agree with this.  We'll have to sort out the fall-out.

As mentioned I think I have found a way (with serial at least) to work
around this - when the serial probe files, this series has code which
forces binding of the node referenced by the 'console' alias. It's a
bit of a hack but it might be good enough...

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-08-01 Thread Tom Rini
On Fri, Aug 01, 2014 at 10:46:31AM -0500, Jon Loeliger wrote:
>  +   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.
> 
> Right.  And I've arguing that U-Boot should use exactly the same
> descriptions that are in the Kernel even.  Those DTS descriptions should
> be common, applicable to both or neither, exactly because they do
> describe the HW and are agnostic WRT the SW that is using them.

I also agree with this.  We'll have to sort out the fall-out.

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-08-01 Thread Jon Loeliger
 +   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.

Right.  And I've arguing that U-Boot should use exactly the same
descriptions that are in the Kernel even.  Those DTS descriptions should
be common, applicable to both or neither, exactly because they do
describe the HW and are agnostic WRT the SW that is using them.

HTH,
jdl
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-07-31 Thread Stephen Warren

On 07/31/2014 04:13 PM, Simon Glass wrote:

Hi Stephen,

On 31 July 2014 21:20, Stephen Warren  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.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-07-31 Thread Simon Glass
Hi Stephen,

On 31 July 2014 21:20, Stephen Warren  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.

>
>> +   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'?

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-07-31 Thread Stephen Warren

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.



+   text-colour = "cyan";


That's property should likely have a uboot, prefix, since it's non-standard.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-07-30 Thread Simon Glass
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.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Change pre-reloc fdt property to 'u-boot,dm-pre-reloc'

Changes in v2: None

 arch/sandbox/dts/sandbox.dts | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
index efffacb..fd2b44b 100644
--- a/arch/sandbox/dts/sandbox.dts
+++ b/arch/sandbox/dts/sandbox.dts
@@ -1,6 +1,16 @@
 /dts-v1/;
 
 / {
+   aliases {
+   console = "/serial";
+   };
+
+   uart0: serial {
+   compatible = "sandbox,serial";
+   u-boot,dm-pre-reloc;
+   text-colour = "cyan";
+   };
+
triangle {
compatible = "demo-shape";
colour = "cyan";
-- 
2.0.0.526.g5318336

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot