ti_armv7_common: enable setexpr
PATCH 1/1 ti_armv7_common: enable setexpr
This allows us to do basic math in hush shell. For example:
U-Boot# r1=10
U-Boot# r2=20
U-Boot# setexpr.l r3 $r1 + $r2
U-Boot# echo $r3
30
--- include/configs/ti_armv7_common.h | 1 + 1 file changed, 1 insertion(+)
include/configs/ti_armv7_common.h +1 -0
@@ -115,6 +115,7 @@#define CONFIG_SYS_MALLOC_LEN (16 << 20)#endif #define CONFIG_SYS_HUSH_PARSER +#define CONFIG_CMD_SETEXPR #define CONFIG_SYS_PROMPT "U-Boot# "#define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_BAUDRATE 115200
Signature · 1 line
2.1.4
PATCH 1/1 ti_armv7_common: enable setexpr
Quoted 10 lines · Nishanth Menon
This allows us to do basic math in hush shell. For example:
U-Boot# r1=10
U-Boot# r2=20
U-Boot# setexpr.l r3 $r1 + $r2
U-Boot# echo $r3
30Reported-by Vitaly Andrianov <[email protected]>Suggested-by Tom Rini <[email protected]>Signed-off-by Nishanth Menon <[email protected]>
This needs to be done in the configs/ files now instead as we have CMD_EXPR there. In fact I'm not sure right now which would win, the define here or the disable currently in the config files :)
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150806/65427f62/attachment.sig>
PATCH 1/1 ti_armv7_common: enable setexpr
Quoted 9 lines · Tom Rini
Quoted 7 lines · Nishanth Menon
This allows us to do basic math in hush shell. For example:
U-Boot# r1=10
U-Boot# r2=20
U-Boot# setexpr.l r3 $r1 + $r2
U-Boot# echo $r3
30
Quoted 8 lines
Quoted 3 lines
Reported-by Vitaly Andrianov <[email protected]>Suggested-by Tom Rini <[email protected]>Signed-off-by Nishanth Menon <[email protected]>This needs to be done in the configs/ files now instead as we have
CMD_EXPRthere. In fact I'm not sure right now which would win, the define here or the disable currently in the config files :)
yeah, I do many defconfigs define CONFIG_CMD_SETEXPR..
We dont have a common config file there(similar to ti_armv7_common) .. we'd have to introduce this for every board config then... is'nt that in-efficient?
Signature · 2 lines
Regards, Nishanth Menon
PATCH 1/1 ti_armv7_common: enable setexpr
Quoted 18 lines · Nishanth Menon
Quoted 9 lines · Tom Rini
Quoted 7 lines · Nishanth Menon
This allows us to do basic math in hush shell. For example:
U-Boot# r1=10
U-Boot# r2=20
U-Boot# setexpr.l r3 $r1 + $r2
U-Boot# echo $r3
30Quoted 8 lines
Quoted 3 lines
Reported-by Vitaly Andrianov <[email protected]>Suggested-by Tom Rini <[email protected]>Signed-off-by Nishanth Menon <[email protected]>This needs to be done in the configs/ files now instead as we have
CMD_EXPRthere. In fact I'm not sure right now which would win, the define here or the disable currently in the config files :)
Quoted 5 lines
yeah, I do many defconfigs define
CONFIG_CMD_SETEXPR..We dont have a common config file
there(similar to ti_armv7_common).. we'd have to introduce this for every board config then... is'nt that in-efficient?
Much like the kernel we try and pick sensible defaults. In this case you'd be removing a line from the defconfig files.
But you're not the first to suggest that something better could be done here and maybe further down the line we'll play with the upstream tools for merging defconfig snippets so that we could have some common ones pulled together.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150806/f65ed9b8/attachment.sig>
PATCH 1/1 ti_armv7_common: enable setexpr
Quoted 25 lines · Tom Rini
Quoted 18 lines · Nishanth Menon
Quoted 9 lines · Tom Rini
Quoted 7 lines · Nishanth Menon
This allows us to do basic math in hush shell. For example:
U-Boot# r1=10
U-Boot# r2=20
U-Boot# setexpr.l r3 $r1 + $r2
U-Boot# echo $r3
30Quoted 8 lines
Quoted 3 lines
Reported-by Vitaly Andrianov <[email protected]>Suggested-by Tom Rini <[email protected]>Signed-off-by Nishanth Menon <[email protected]>This needs to be done in the configs/ files now instead as we have
CMD_EXPRthere. In fact I'm not sure right now which would win, the define here or the disable currently in the config files :)Quoted 5 lines
yeah, I do many defconfigs define
CONFIG_CMD_SETEXPR..We dont have a common config file
there(similar to ti_armv7_common).. we'd have to introduce this for every board config then... is'nt that in-efficient?
Quoted 8 lines
Much like the kernel we try and pick sensible defaults. In this case you'd be removing a line from the defconfig files.
But you're not the first to suggest that something better could be done here and maybe further down the line we'll play with the upstream tools for merging defconfig snippets so that we could have some common ones pulled together.
I just curious whether setexpr.l will work with 64bit variable, which required to represent initrd address with LPAE enabled. Does the setexpr have uint_64_t version?