From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 12 Jan 2017 19:19:35 -0700 Subject: [U-Boot] [PATCH v2] cmd/fdt: Make fdt get value endian-safe for single-cell properties In-Reply-To: <20170109150803.6582-1-afaerber@suse.de> References: <20170109150803.6582-1-afaerber@suse.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 9 January 2017 at 08:08, Andreas F?rber wrote: > On a Raspberry Pi 2 disagreements on cell endianness can be observed: > > U-Boot> fdt print /soc/gpio at 7e200000 phandle > phandle = <0x0000000d> > U-Boot> fdt get value myvar /soc/gpio at 7e200000 phandle; printenv myvar > myvar=0x0D000000 > > Fix this by always treating the pointer as BE and converting it in > fdt_value_setenv(), like its counterpart fdt_parse_prop() already does. > > Consistently use fdt32_t, fdt32_to_cpu() and cpu_to_fdt32(). > > Fixes: bc80295 ("fdt: Add get commands to fdt") > Cc: Joe Hershberger > Cc: Gerald Van Baren > Signed-off-by: Andreas F?rber > --- > cmd/fdt.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Acked-by: Simon Glass