Skip to content
Commit b05bf6c7 authored by Andreas Färber's avatar Andreas Färber Committed by Simon Glass
Browse files

cmd/fdt: Make fdt get value endian-safe for single-cell properties

On a Raspberry Pi 2 disagreements on cell endianness can be observed:

  U-Boot> fdt print /soc/gpio@7e200000 phandle
  phandle = <0x0000000d>
  U-Boot> fdt get value myvar /soc/gpio@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: bc80295b

 ("fdt: Add get commands to fdt")
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Gerald Van Baren <gvb@unssw.com>
Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
Acked-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
parent 082b1414
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment