Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-19 Thread Viresh Kumar
On 19 November 2012 21:58, Stephen Warren wrote: > Support for byte- and word- properties is relatively recent I believe > (or at least, the /bits/ syntax is). Which dtc version are you using? Ok, i was on a older version. I just saw this patch now: commit

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-19 Thread Stephen Warren
On 11/18/2012 11:41 PM, Viresh Kumar wrote: > On 19 November 2012 12:05, Rajanikanth HV wrote: >> On 19 November 2012 12:00, Viresh Kumar wrote: >>> Firstly you tried square braces [ ], I am not sure if that is allowed. >>> Can you point me to the specification? >>

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-19 Thread Stephen Warren
On 11/18/2012 11:41 PM, Viresh Kumar wrote: On 19 November 2012 12:05, Rajanikanth HV rajanikanth...@linaro.org wrote: On 19 November 2012 12:00, Viresh Kumar viresh.ku...@linaro.org wrote: Firstly you tried square braces [ ], I am not sure if that is allowed. Can you point me to the

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-19 Thread Viresh Kumar
On 19 November 2012 21:58, Stephen Warren swar...@wwwdotorg.org wrote: Support for byte- and word- properties is relatively recent I believe (or at least, the /bits/ syntax is). Which dtc version are you using? Ok, i was on a older version. I just saw this patch now: commit

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-18 Thread Viresh Kumar
On 19 November 2012 12:05, Rajanikanth HV wrote: > On 19 November 2012 12:00, Viresh Kumar wrote: >> Firstly you tried square braces [ ], I am not sure if that is allowed. >> Can you point me to the specification? > http://www.devicetree.org/Device_Tree_Usage > " > a-byte-data-property = [0x01

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-18 Thread Rajanikanth HV
On 19 November 2012 12:00, Viresh Kumar wrote: > Firstly you tried square braces [ ], I am not sure if that is allowed. > Can you point me to the specification? http://www.devicetree.org/Device_Tree_Usage " a-byte-data-property = [0x01 0x23 0x34 0x56]; " > > And simply passing 0x50, 0x60 etc..

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-18 Thread Viresh Kumar
On 19 November 2012 11:54, Rajanikanth HV wrote: >> data1 = /bits/ 8 <0x50 0x60 0x70>; > as per spec, format for data byte defines will be: > data1 = [ 0x50 0x60 0x70 ]; > however, i see a parse error from device tree compiler when i tried. Firstly you tried square braces [ ], I am not sure if

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-18 Thread Rajanikanth HV
On 19 November 2012 09:24, Viresh Kumar wrote: > On 12 November 2012 09:03, Viresh Kumar wrote: >> On 12 November 2012 01:12, Rob Herring wrote: >>> I don't think the size is stored in the dtb. It is only in the dts. You >>> need to define the size in the binding definitions and use '/bits/'

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-18 Thread Viresh Kumar
On 12 November 2012 09:03, Viresh Kumar wrote: > On 12 November 2012 01:12, Rob Herring wrote: >> I don't think the size is stored in the dtb. It is only in the dts. You >> need to define the size in the binding definitions and use '/bits/' >> annotation. With this the data is packed. Then the

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-18 Thread Viresh Kumar
On 12 November 2012 09:03, Viresh Kumar viresh.ku...@linaro.org wrote: On 12 November 2012 01:12, Rob Herring robherri...@gmail.com wrote: I don't think the size is stored in the dtb. It is only in the dts. You need to define the size in the binding definitions and use '/bits/' annotation.

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-18 Thread Rajanikanth HV
On 19 November 2012 09:24, Viresh Kumar viresh.ku...@linaro.org wrote: On 12 November 2012 09:03, Viresh Kumar viresh.ku...@linaro.org wrote: On 12 November 2012 01:12, Rob Herring robherri...@gmail.com wrote: I don't think the size is stored in the dtb. It is only in the dts. You need to

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-18 Thread Viresh Kumar
On 19 November 2012 11:54, Rajanikanth HV rajanikanth...@linaro.org wrote: data1 = /bits/ 8 0x50 0x60 0x70; as per spec, format for data byte defines will be: data1 = [ 0x50 0x60 0x70 ]; however, i see a parse error from device tree compiler when i tried. Firstly you tried square braces [ ],

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-18 Thread Rajanikanth HV
On 19 November 2012 12:00, Viresh Kumar viresh.ku...@linaro.org wrote: Firstly you tried square braces [ ], I am not sure if that is allowed. Can you point me to the specification? http://www.devicetree.org/Device_Tree_Usage a-byte-data-property = [0x01 0x23 0x34 0x56]; And simply passing

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-18 Thread Viresh Kumar
On 19 November 2012 12:05, Rajanikanth HV rajanikanth...@linaro.org wrote: On 19 November 2012 12:00, Viresh Kumar viresh.ku...@linaro.org wrote: Firstly you tried square braces [ ], I am not sure if that is allowed. Can you point me to the specification?

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-11 Thread Viresh Kumar
On 12 November 2012 01:12, Rob Herring wrote: > On 11/11/2012 11:27 AM, Viresh Kumar wrote: >> On 11 November 2012 19:42, Rob Herring wrote: >>> On 11/06/2012 10:22 PM, viresh kumar wrote: >> cluster0: cluster@0 { + data1 = <0x50 0x60 0x70>; +

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-11 Thread Rob Herring
On 11/11/2012 11:27 AM, Viresh Kumar wrote: > On 11 November 2012 19:42, Rob Herring wrote: >> On 11/06/2012 10:22 PM, viresh kumar wrote: > >>> cluster0: cluster@0 { >>> + data1 = <0x50 0x60 0x70>; >>> + data2 = <0x5000 0x6000 0x7000>;

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-11 Thread Viresh Kumar
On 11 November 2012 19:42, Rob Herring wrote: > On 11/06/2012 10:22 PM, viresh kumar wrote: >> cluster0: cluster@0 { >> + data1 = <0x50 0x60 0x70>; >> + data2 = <0x5000 0x6000 0x7000>; >> + data3 = <0x5000

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-11 Thread Rob Herring
On 11/06/2012 10:22 PM, viresh kumar wrote: > On Tue, Nov 6, 2012 at 7:48 PM, Rob Herring wrote: >>> +#define of_property_read_array(_np, _pname, _out, _sz) >>> \ > >>> + while (_sz--) \ >>> + *_out++ =

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-11 Thread Rob Herring
On 11/06/2012 10:22 PM, viresh kumar wrote: On Tue, Nov 6, 2012 at 7:48 PM, Rob Herring robherri...@gmail.com wrote: +#define of_property_read_array(_np, _pname, _out, _sz) \ + while (_sz--) \ + *_out++

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-11 Thread Viresh Kumar
On 11 November 2012 19:42, Rob Herring robherri...@gmail.com wrote: On 11/06/2012 10:22 PM, viresh kumar wrote: cluster0: cluster@0 { + data1 = 0x50 0x60 0x70; + data2 = 0x5000 0x6000 0x7000; + data3 =

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-11 Thread Rob Herring
On 11/11/2012 11:27 AM, Viresh Kumar wrote: On 11 November 2012 19:42, Rob Herring robherri...@gmail.com wrote: On 11/06/2012 10:22 PM, viresh kumar wrote: cluster0: cluster@0 { + data1 = 0x50 0x60 0x70; + data2 = 0x5000 0x6000

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-11 Thread Viresh Kumar
On 12 November 2012 01:12, Rob Herring robherri...@gmail.com wrote: On 11/11/2012 11:27 AM, Viresh Kumar wrote: On 11 November 2012 19:42, Rob Herring robherri...@gmail.com wrote: On 11/06/2012 10:22 PM, viresh kumar wrote: cluster0: cluster@0 { + data1

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-10 Thread Viresh Kumar
Ping!! On 7 November 2012 09:52, viresh kumar wrote: > On Tue, Nov 6, 2012 at 7:48 PM, Rob Herring wrote: >>> +#define of_property_read_array(_np, _pname, _out, _sz) >>> \ > >>> + while (_sz--) \ >>> +

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-10 Thread Viresh Kumar
Ping!! On 7 November 2012 09:52, viresh kumar viresh.ku...@linaro.org wrote: On Tue, Nov 6, 2012 at 7:48 PM, Rob Herring robherri...@gmail.com wrote: +#define of_property_read_array(_np, _pname, _out, _sz) \ + while (_sz--)

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-06 Thread viresh kumar
On Tue, Nov 6, 2012 at 7:48 PM, Rob Herring wrote: >> +#define of_property_read_array(_np, _pname, _out, _sz) >> \ >> + while (_sz--) \ >> + *_out++ = (typeof(*_out))be32_to_cpup(_val++); \ > This

Re: [PATCH Resend V2] dt: add helper function to read u8 & u16 variables & arrays

2012-11-06 Thread Rob Herring
On 10/25/2012 11:20 PM, Viresh Kumar wrote: > This adds following helper routines: > - of_property_read_u8_array() > - of_property_read_u16_array() > - of_property_read_u8() > - of_property_read_u16() > > First two actually share most of the code with of_property_read_u32_array(), > so > the

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-06 Thread Rob Herring
On 10/25/2012 11:20 PM, Viresh Kumar wrote: This adds following helper routines: - of_property_read_u8_array() - of_property_read_u16_array() - of_property_read_u8() - of_property_read_u16() First two actually share most of the code with of_property_read_u32_array(), so the common part

Re: [PATCH Resend V2] dt: add helper function to read u8 u16 variables arrays

2012-11-06 Thread viresh kumar
On Tue, Nov 6, 2012 at 7:48 PM, Rob Herring robherri...@gmail.com wrote: +#define of_property_read_array(_np, _pname, _out, _sz) \ + while (_sz--) \ + *_out++ = (typeof(*_out))be32_to_cpup(_val++);