* [U-Boot] [RFC v2] bootm: fix passing argc to standalone apps
@ 2016-09-09 8:18 Zubair Lutfullah Kakakhel
2016-09-19 0:57 ` Simon Glass
2016-10-03 13:36 ` [U-Boot] [U-Boot, RFC, " Tom Rini
0 siblings, 2 replies; 5+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2016-09-09 8:18 UTC (permalink / raw)
To: u-boot
This bug appears in b6396403 which makes u-boot unable to pass
arguments via bootm to a standalone application without this patch.
Steps to reproduce.
Compile a u-boot. Use mkimage to package the standalone hello_world.bin
file.
e.g. For the MIPS Boston platform
mkimage -n "hello" -A mips -O u-boot -C none -T standalone \
-a 0xffffffff80200000 -d hello_world.bin \
-ep 0xffffffff80200000 hello_out
Then tftp hello_out and run it using
boston # dhcp 192.168.154.45:hello_out
...
boston # bootm $loadaddr 123 321
Without the patch the following output is observed.
boston # bootm $loadaddr 123 321
Image Name: hello
Image Type: MIPS U-Boot Standalone Program (uncompressed)
Data Size: 1240 Bytes = 1.2 KiB
Load Address: 80200000
Entry Point: 80200000
Verifying Checksum ... OK
Loading Standalone Program ... OK
Example expects ABI version 8
Actual U-Boot ABI version 8
Hello World
argc = 0
argv[0] = "0xffffffff88000000"
With the patch, you see the following.
boston # bootm $loadaddr 123 321
Image Name: hello
Image Type: MIPS U-Boot Standalone Program (uncompressed)
Data Size: 1240 Bytes = 1.2 KiB
Load Address: 80200000
Entry Point: 80200000
Verifying Checksum ... OK
Loading Standalone Program ... OK
Example expects ABI version 8
Actual U-Boot ABI version 8
Hello World
argc = 3
argv[0] = "0xffffffff88000000"
argv[1] = "123"
argv[2] = "321"
argv[3] = "<NULL>"
Without the patch, the go command at the entry point seems to work.
boston # go 0xffffffff80200000 123 321
Example expects ABI version 8
Actual U-Boot ABI version 8
Hello World
argc = 3
argv[0] = "0xffffffff80200000"
argv[1] = "123"
argv[2] = "321"
argv[3] = "<NULL>"
Hit any key to exit ...
Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
Tested on the MIPS Boston platform.
---
common/bootm.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/common/bootm.c b/common/bootm.c
index e6da551..a26ada4 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -602,10 +602,8 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
if (!ret && (states & BOOTM_STATE_FINDOS))
ret = bootm_find_os(cmdtp, flag, argc, argv);
- if (!ret && (states & BOOTM_STATE_FINDOTHER)) {
+ if (!ret && (states & BOOTM_STATE_FINDOTHER))
ret = bootm_find_other(cmdtp, flag, argc, argv);
- argc = 0; /* consume the args */
- }
/* Load the OS */
if (!ret && (states & BOOTM_STATE_LOADOS)) {
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [RFC v2] bootm: fix passing argc to standalone apps
2016-09-09 8:18 [U-Boot] [RFC v2] bootm: fix passing argc to standalone apps Zubair Lutfullah Kakakhel
@ 2016-09-19 0:57 ` Simon Glass
2016-09-23 10:17 ` Zubair Lutfullah Kakakhel
2016-10-03 13:36 ` [U-Boot] [U-Boot, RFC, " Tom Rini
1 sibling, 1 reply; 5+ messages in thread
From: Simon Glass @ 2016-09-19 0:57 UTC (permalink / raw)
To: u-boot
On 9 September 2016 at 02:18, Zubair Lutfullah Kakakhel
<Zubair.Kakakhel@imgtec.com> wrote:
> This bug appears in b6396403 which makes u-boot unable to pass
> arguments via bootm to a standalone application without this patch.
>
> Steps to reproduce.
>
> Compile a u-boot. Use mkimage to package the standalone hello_world.bin
> file.
>
> e.g. For the MIPS Boston platform
>
> mkimage -n "hello" -A mips -O u-boot -C none -T standalone \
> -a 0xffffffff80200000 -d hello_world.bin \
> -ep 0xffffffff80200000 hello_out
>
> Then tftp hello_out and run it using
>
> boston # dhcp 192.168.154.45:hello_out
> ...
> boston # bootm $loadaddr 123 321
>
> Without the patch the following output is observed.
>
> boston # bootm $loadaddr 123 321
> Image Name: hello
> Image Type: MIPS U-Boot Standalone Program (uncompressed)
> Data Size: 1240 Bytes = 1.2 KiB
> Load Address: 80200000
> Entry Point: 80200000
> Verifying Checksum ... OK
> Loading Standalone Program ... OK
> Example expects ABI version 8
> Actual U-Boot ABI version 8
> Hello World
> argc = 0
> argv[0] = "0xffffffff88000000"
>
> With the patch, you see the following.
>
> boston # bootm $loadaddr 123 321
> Image Name: hello
> Image Type: MIPS U-Boot Standalone Program (uncompressed)
> Data Size: 1240 Bytes = 1.2 KiB
> Load Address: 80200000
> Entry Point: 80200000
> Verifying Checksum ... OK
> Loading Standalone Program ... OK
> Example expects ABI version 8
> Actual U-Boot ABI version 8
> Hello World
> argc = 3
> argv[0] = "0xffffffff88000000"
> argv[1] = "123"
> argv[2] = "321"
> argv[3] = "<NULL>"
>
> Without the patch, the go command at the entry point seems to work.
>
> boston # go 0xffffffff80200000 123 321
> Example expects ABI version 8
> Actual U-Boot ABI version 8
> Hello World
> argc = 3
> argv[0] = "0xffffffff80200000"
> argv[1] = "123"
> argv[2] = "321"
> argv[3] = "<NULL>"
> Hit any key to exit ...
>
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
>
> ---
>
> Tested on the MIPS Boston platform.
> ---
> common/bootm.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/common/bootm.c b/common/bootm.c
> index e6da551..a26ada4 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -602,10 +602,8 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
> if (!ret && (states & BOOTM_STATE_FINDOS))
> ret = bootm_find_os(cmdtp, flag, argc, argv);
>
> - if (!ret && (states & BOOTM_STATE_FINDOTHER)) {
> + if (!ret && (states & BOOTM_STATE_FINDOTHER))
> ret = bootm_find_other(cmdtp, flag, argc, argv);
> - argc = 0; /* consume the args */
> - }
>
> /* Load the OS */
> if (!ret && (states & BOOTM_STATE_LOADOS)) {
> --
> 1.9.1
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [RFC v2] bootm: fix passing argc to standalone apps
2016-09-19 0:57 ` Simon Glass
@ 2016-09-23 10:17 ` Zubair Lutfullah Kakakhel
2016-09-28 17:51 ` Simon Glass
0 siblings, 1 reply; 5+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2016-09-23 10:17 UTC (permalink / raw)
To: u-boot
Hi,
comments at end
On 09/19/2016 01:57 AM, Simon Glass wrote:
> On 9 September 2016 at 02:18, Zubair Lutfullah Kakakhel
> <Zubair.Kakakhel@imgtec.com> wrote:
>> This bug appears in b6396403 which makes u-boot unable to pass
>> arguments via bootm to a standalone application without this patch.
>>
>> Steps to reproduce.
>>
>> Compile a u-boot. Use mkimage to package the standalone hello_world.bin
>> file.
>>
>> e.g. For the MIPS Boston platform
>>
>> mkimage -n "hello" -A mips -O u-boot -C none -T standalone \
>> -a 0xffffffff80200000 -d hello_world.bin \
>> -ep 0xffffffff80200000 hello_out
>>
>> Then tftp hello_out and run it using
>>
>> boston # dhcp 192.168.154.45:hello_out
>> ...
>> boston # bootm $loadaddr 123 321
>>
>> Without the patch the following output is observed.
>>
>> boston # bootm $loadaddr 123 321
>> Image Name: hello
>> Image Type: MIPS U-Boot Standalone Program (uncompressed)
>> Data Size: 1240 Bytes = 1.2 KiB
>> Load Address: 80200000
>> Entry Point: 80200000
>> Verifying Checksum ... OK
>> Loading Standalone Program ... OK
>> Example expects ABI version 8
>> Actual U-Boot ABI version 8
>> Hello World
>> argc = 0
>> argv[0] = "0xffffffff88000000"
>>
>> With the patch, you see the following.
>>
>> boston # bootm $loadaddr 123 321
>> Image Name: hello
>> Image Type: MIPS U-Boot Standalone Program (uncompressed)
>> Data Size: 1240 Bytes = 1.2 KiB
>> Load Address: 80200000
>> Entry Point: 80200000
>> Verifying Checksum ... OK
>> Loading Standalone Program ... OK
>> Example expects ABI version 8
>> Actual U-Boot ABI version 8
>> Hello World
>> argc = 3
>> argv[0] = "0xffffffff88000000"
>> argv[1] = "123"
>> argv[2] = "321"
>> argv[3] = "<NULL>"
>>
>> Without the patch, the go command at the entry point seems to work.
>>
>> boston # go 0xffffffff80200000 123 321
>> Example expects ABI version 8
>> Actual U-Boot ABI version 8
>> Hello World
>> argc = 3
>> argv[0] = "0xffffffff80200000"
>> argv[1] = "123"
>> argv[2] = "321"
>> argv[3] = "<NULL>"
>> Hit any key to exit ...
>>
>> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
>>
>> ---
>>
>> Tested on the MIPS Boston platform.
>> ---
>> common/bootm.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/common/bootm.c b/common/bootm.c
>> index e6da551..a26ada4 100644
>> --- a/common/bootm.c
>> +++ b/common/bootm.c
>> @@ -602,10 +602,8 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
>> if (!ret && (states & BOOTM_STATE_FINDOS))
>> ret = bootm_find_os(cmdtp, flag, argc, argv);
>>
>> - if (!ret && (states & BOOTM_STATE_FINDOTHER)) {
>> + if (!ret && (states & BOOTM_STATE_FINDOTHER))
>> ret = bootm_find_other(cmdtp, flag, argc, argv);
>> - argc = 0; /* consume the args */
>> - }
>>
>> /* Load the OS */
>> if (!ret && (states & BOOTM_STATE_LOADOS)) {
>> --
>> 1.9.1
>>
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
Thanks for the review.
Can this be applied as is or do I need to send it again without the RFC
and as a Patch?
Regards,
ZubairLK
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [RFC v2] bootm: fix passing argc to standalone apps
2016-09-23 10:17 ` Zubair Lutfullah Kakakhel
@ 2016-09-28 17:51 ` Simon Glass
0 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2016-09-28 17:51 UTC (permalink / raw)
To: u-boot
Hi,
On 23 September 2016 at 04:17, Zubair Lutfullah Kakakhel
<Zubair.Kakakhel@imgtec.com> wrote:
> Hi,
>
> comments at end
>
>
> On 09/19/2016 01:57 AM, Simon Glass wrote:
>>
>> On 9 September 2016 at 02:18, Zubair Lutfullah Kakakhel
>> <Zubair.Kakakhel@imgtec.com> wrote:
>>>
>>> This bug appears in b6396403 which makes u-boot unable to pass
>>> arguments via bootm to a standalone application without this patch.
>>>
>>> Steps to reproduce.
>>>
>>> Compile a u-boot. Use mkimage to package the standalone hello_world.bin
>>> file.
>>>
>>> e.g. For the MIPS Boston platform
>>>
>>> mkimage -n "hello" -A mips -O u-boot -C none -T standalone \
>>> -a 0xffffffff80200000 -d hello_world.bin \
>>> -ep 0xffffffff80200000 hello_out
>>>
>>> Then tftp hello_out and run it using
>>>
>>> boston # dhcp 192.168.154.45:hello_out
>>> ...
>>> boston # bootm $loadaddr 123 321
>>>
>>> Without the patch the following output is observed.
>>>
>>> boston # bootm $loadaddr 123 321
>>> Image Name: hello
>>> Image Type: MIPS U-Boot Standalone Program (uncompressed)
>>> Data Size: 1240 Bytes = 1.2 KiB
>>> Load Address: 80200000
>>> Entry Point: 80200000
>>> Verifying Checksum ... OK
>>> Loading Standalone Program ... OK
>>> Example expects ABI version 8
>>> Actual U-Boot ABI version 8
>>> Hello World
>>> argc = 0
>>> argv[0] = "0xffffffff88000000"
>>>
>>> With the patch, you see the following.
>>>
>>> boston # bootm $loadaddr 123 321
>>> Image Name: hello
>>> Image Type: MIPS U-Boot Standalone Program (uncompressed)
>>> Data Size: 1240 Bytes = 1.2 KiB
>>> Load Address: 80200000
>>> Entry Point: 80200000
>>> Verifying Checksum ... OK
>>> Loading Standalone Program ... OK
>>> Example expects ABI version 8
>>> Actual U-Boot ABI version 8
>>> Hello World
>>> argc = 3
>>> argv[0] = "0xffffffff88000000"
>>> argv[1] = "123"
>>> argv[2] = "321"
>>> argv[3] = "<NULL>"
>>>
>>> Without the patch, the go command at the entry point seems to work.
>>>
>>> boston # go 0xffffffff80200000 123 321
>>> Example expects ABI version 8
>>> Actual U-Boot ABI version 8
>>> Hello World
>>> argc = 3
>>> argv[0] = "0xffffffff80200000"
>>> argv[1] = "123"
>>> argv[2] = "321"
>>> argv[3] = "<NULL>"
>>> Hit any key to exit ...
>>>
>>> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
>>>
>>> ---
>>>
>>> Tested on the MIPS Boston platform.
>>> ---
>>> common/bootm.c | 4 +---
>>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>>
>>> diff --git a/common/bootm.c b/common/bootm.c
>>> index e6da551..a26ada4 100644
>>> --- a/common/bootm.c
>>> +++ b/common/bootm.c
>>> @@ -602,10 +602,8 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int
>>> argc, char * const argv[],
>>> if (!ret && (states & BOOTM_STATE_FINDOS))
>>> ret = bootm_find_os(cmdtp, flag, argc, argv);
>>>
>>> - if (!ret && (states & BOOTM_STATE_FINDOTHER)) {
>>> + if (!ret && (states & BOOTM_STATE_FINDOTHER))
>>> ret = bootm_find_other(cmdtp, flag, argc, argv);
>>> - argc = 0; /* consume the args */
>>> - }
>>>
>>> /* Load the OS */
>>> if (!ret && (states & BOOTM_STATE_LOADOS)) {
>>> --
>>> 1.9.1
>>>
>>
>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>
>
> Thanks for the review.
>
> Can this be applied as is or do I need to send it again without the RFC
> and as a Patch?
I think it is fine as is.
Regards,
Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [U-Boot, RFC, v2] bootm: fix passing argc to standalone apps
2016-09-09 8:18 [U-Boot] [RFC v2] bootm: fix passing argc to standalone apps Zubair Lutfullah Kakakhel
2016-09-19 0:57 ` Simon Glass
@ 2016-10-03 13:36 ` Tom Rini
1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2016-10-03 13:36 UTC (permalink / raw)
To: u-boot
On Fri, Sep 09, 2016 at 09:18:58AM +0100, Zubair Lutfullah Kakakhel wrote:
> This bug appears in b6396403 which makes u-boot unable to pass
> arguments via bootm to a standalone application without this patch.
>
> Steps to reproduce.
>
> Compile a u-boot. Use mkimage to package the standalone hello_world.bin
> file.
>
> e.g. For the MIPS Boston platform
>
> mkimage -n "hello" -A mips -O u-boot -C none -T standalone \
> -a 0xffffffff80200000 -d hello_world.bin \
> -ep 0xffffffff80200000 hello_out
>
> Then tftp hello_out and run it using
>
> boston # dhcp 192.168.154.45:hello_out
> ...
> boston # bootm $loadaddr 123 321
>
> Without the patch the following output is observed.
>
> boston # bootm $loadaddr 123 321
> Image Name: hello
> Image Type: MIPS U-Boot Standalone Program (uncompressed)
> Data Size: 1240 Bytes = 1.2 KiB
> Load Address: 80200000
> Entry Point: 80200000
> Verifying Checksum ... OK
> Loading Standalone Program ... OK
> Example expects ABI version 8
> Actual U-Boot ABI version 8
> Hello World
> argc = 0
> argv[0] = "0xffffffff88000000"
>
> With the patch, you see the following.
>
> boston # bootm $loadaddr 123 321
> Image Name: hello
> Image Type: MIPS U-Boot Standalone Program (uncompressed)
> Data Size: 1240 Bytes = 1.2 KiB
> Load Address: 80200000
> Entry Point: 80200000
> Verifying Checksum ... OK
> Loading Standalone Program ... OK
> Example expects ABI version 8
> Actual U-Boot ABI version 8
> Hello World
> argc = 3
> argv[0] = "0xffffffff88000000"
> argv[1] = "123"
> argv[2] = "321"
> argv[3] = "<NULL>"
>
> Without the patch, the go command at the entry point seems to work.
>
> boston # go 0xffffffff80200000 123 321
> Example expects ABI version 8
> Actual U-Boot ABI version 8
> Hello World
> argc = 3
> argv[0] = "0xffffffff80200000"
> argv[1] = "123"
> argv[2] = "321"
> argv[3] = "<NULL>"
> Hit any key to exit ...
>
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161003/f165e93d/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-10-03 13:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-09 8:18 [U-Boot] [RFC v2] bootm: fix passing argc to standalone apps Zubair Lutfullah Kakakhel
2016-09-19 0:57 ` Simon Glass
2016-09-23 10:17 ` Zubair Lutfullah Kakakhel
2016-09-28 17:51 ` Simon Glass
2016-10-03 13:36 ` [U-Boot] [U-Boot, RFC, " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.