Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 May 2015 08:27:30 +0300
From:      Daniel Braniss <danny@cs.huji.ac.il>
To:        Ian Lepore <ian@FreeBSD.org>
Cc:        hackers@freebsd.org, current@freebsd.org
Subject:   Re: OF_getprop weirdness - raspberry pi
Message-ID:  <288BCD94-70F2-46B1-80F8-9755678E3D3F@cs.huji.ac.il>
In-Reply-To: <1432218339.1208.1.camel@freebsd.org>
References:  <D0B40E58-32EB-4CFE-950E-78EAA05E9018@cs.huji.ac.il> <1432218339.1208.1.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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

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

	danny

> -- Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?288BCD94-70F2-46B1-80F8-9755678E3D3F>