Re: OF_getprop weirdness - raspberry pi

From: Daniel Braniss <danny_at_cs.huji.ac.il>
Date: Fri, 22 May 2015 08:27:30 +0300
> On May 21, 2015, at 5:25 PM, Ian Lepore <ian_at_FreeBSD.org> wrote:
> 
> On Thu, 2015-05-21 at 09:41 +0300, Daniel Braniss wrote:
>> Hi,
>> I’m running current as of last week on a raspberry pi B.
>> 
>> i don’t know if this only related to arm, but this is what I have in my rpi-b.dts:
>> 	….
>> 		spi0 {
>> 		     rfid0 {
>> 		     	   compatible = "rfid,mfrc5";
>> 			   spi-chipselect = <0>;
>> 			   reset {
>> 			   	 compatible = "pcd-reset";
>> 				 gpios = <&gpio 6 2>;
>> 			   };
>> 			   lock {
>> 			   	compatible = "lock-1";
>> 				gpios = <&gpio 13 2>;
>> 			   };
>> 			   sense {
>> 			   	 compatible = "sense-1";
>> 				 gpios = <&gpio 19 1>;
>> 			   }; 
>> 		     };
>> …
>> and a call to
>> 	uint32_t data[3];
>> 	
>> 	OF_getprop(node, “gpios”, data, sizeof(data)); // node is ‘pcd-reset'
>> 	returns:
>> 		data[0]: 0x03000000
>> 		data[1]: 0x06000000
>> 		data[2]: 0x02000000
>> 
>> which looks to me that it’s in the wrong endian?
>> 
>> cheers,
>> 	danny
> 
> FDT data is always big-endian, use OF_getencprop() to unpack it to host
> format.
> 

thanks!
is there (apart from the source), some man pages, doc? so far I found outdated,
or incomplete info.

	danny

> -- Ian
Received on Fri May 22 2015 - 03:27:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:57 UTC