aboutsummaryrefslogtreecommitdiff
path: root/arch/sh/lib/bootm.c
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2022-07-08 23:50:43 +0200
committerSimon Glass <sjg@chromium.org>2022-09-21 10:37:46 +0200
commit13982ced2ccce0838afb6db87f05b2cd74355b56 (patch)
tree11c0694bfce26db823bcaf258b62eb825a981379 /arch/sh/lib/bootm.c
parent12ed6d4911ced1df099a365e0a994b54211b60f3 (diff)
cmd: fdt: Add support for reading stringlist property values
The fdt command currently handles stringlists as strings in 'fdt get value' subcommand. Since strings in FDT stringlists are separated by '\0', only the first value gets inserted into the environment variable passed to the 'fdt get value' command. Example, consider the following DT snippet: / { compatible = "foo", "bar" }; The following command only reports the first string in stringlist: => fdt get value var / compatible ; print var foo It is not possible to assign list of null-terminated strings into U-Boot environment variable. Add optional 'index' parameter to the subcommand 'fdt get value <var> <path> <prop> [<index>]' which lets user specify which string within the stringlist should be assigned into the 'var' variable. The default value of 'index' is 0 in case it is not present. This way the 'fdt' command API does not change and existing scripts are not broken. The following command now reports the Nth string in stringlist, counting from zero: => fdt get value var / compatible 1 ; print var bar Signed-off-by: Marek Vasut <marex@denx.de> Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/sh/lib/bootm.c')
0 files changed, 0 insertions, 0 deletions