* [U-Boot] [PATCH] ti_armv7_common: enable setexpr
@ 2015-08-06 14:48 Nishanth Menon
2015-08-06 15:04 ` Tom Rini
0 siblings, 1 reply; 5+ messages in thread
From: Nishanth Menon @ 2015-08-06 14:48 UTC (permalink / raw)
To: u-boot
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
Reported-by: Vitaly Andrianov <vitalya@ti.com>
Suggested-by: Tom Rini <trini@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
include/configs/ti_armv7_common.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
index 5a4fd2d5552f..d9cd90002ca7 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -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
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] ti_armv7_common: enable setexpr
2015-08-06 14:48 [U-Boot] [PATCH] ti_armv7_common: enable setexpr Nishanth Menon
@ 2015-08-06 15:04 ` Tom Rini
2015-08-06 15:08 ` Nishanth Menon
0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2015-08-06 15:04 UTC (permalink / raw)
To: u-boot
On Thu, Aug 06, 2015 at 09:48:27AM -0500, Nishanth Menon wrote:
> 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
>
> Reported-by: Vitaly Andrianov <vitalya@ti.com>
> Suggested-by: Tom Rini <trini@ti.com>
> Signed-off-by: Nishanth Menon <nm@ti.com>
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 :)
--
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>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] ti_armv7_common: enable setexpr
2015-08-06 15:04 ` Tom Rini
@ 2015-08-06 15:08 ` Nishanth Menon
2015-08-06 15:31 ` Tom Rini
0 siblings, 1 reply; 5+ messages in thread
From: Nishanth Menon @ 2015-08-06 15:08 UTC (permalink / raw)
To: u-boot
On 08/06/2015 10:04 AM, Tom Rini wrote:
> On Thu, Aug 06, 2015 at 09:48:27AM -0500, Nishanth Menon wrote:
>
>> 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
>>
>> Reported-by: Vitaly Andrianov <vitalya@ti.com>
>> Suggested-by: Tom Rini <trini@ti.com>
>> Signed-off-by: Nishanth Menon <nm@ti.com>
>
> 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 :)
>
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?
--
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] ti_armv7_common: enable setexpr
2015-08-06 15:08 ` Nishanth Menon
@ 2015-08-06 15:31 ` Tom Rini
2015-08-06 16:35 ` Vitaly Andrianov
0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2015-08-06 15:31 UTC (permalink / raw)
To: u-boot
On Thu, Aug 06, 2015 at 10:08:59AM -0500, Nishanth Menon wrote:
> On 08/06/2015 10:04 AM, Tom Rini wrote:
> > On Thu, Aug 06, 2015 at 09:48:27AM -0500, Nishanth Menon wrote:
> >
> >> 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
> >>
> >> Reported-by: Vitaly Andrianov <vitalya@ti.com>
> >> Suggested-by: Tom Rini <trini@ti.com>
> >> Signed-off-by: Nishanth Menon <nm@ti.com>
> >
> > 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 :)
> >
> 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.
--
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>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] ti_armv7_common: enable setexpr
2015-08-06 15:31 ` Tom Rini
@ 2015-08-06 16:35 ` Vitaly Andrianov
0 siblings, 0 replies; 5+ messages in thread
From: Vitaly Andrianov @ 2015-08-06 16:35 UTC (permalink / raw)
To: u-boot
On 08/06/2015 11:31 AM, Tom Rini wrote:
> On Thu, Aug 06, 2015 at 10:08:59AM -0500, Nishanth Menon wrote:
>> On 08/06/2015 10:04 AM, Tom Rini wrote:
>>> On Thu, Aug 06, 2015 at 09:48:27AM -0500, Nishanth Menon wrote:
>>>
>>>> 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
>>>>
>>>> Reported-by: Vitaly Andrianov <vitalya@ti.com>
>>>> Suggested-by: Tom Rini <trini@ti.com>
>>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>>
>>> 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 :)
>>>
>> 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.
>
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?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-06 16:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-06 14:48 [U-Boot] [PATCH] ti_armv7_common: enable setexpr Nishanth Menon
2015-08-06 15:04 ` Tom Rini
2015-08-06 15:08 ` Nishanth Menon
2015-08-06 15:31 ` Tom Rini
2015-08-06 16:35 ` Vitaly Andrianov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox