[U-Boot] [PATCH v2] common: Remove invalid endianess conversion

Rommel G Custodio sessyargc+u-boot at gmail.com
Fri Feb 7 07:25:49 CET 2014


Dear Christian Eggers

Christian Eggers <ceggers <at> gmx.de> writes:

> 
> do_bootm_standanlone() calls ntohl(images->ep) which is wrong because
> endianess conversion has already been done:
> 
> do_bootm()
> \-do_bootm_states()
>   +-bootm_find_os()
>   | \-images.ep = image_get_ep();
>   |   \-uimage_to_cpu(hdr->ih_ep);
>   \-boot_selected_os()
>     \-do_bootm_standanlone()
> 
> Without this conversion the code works correctly at least on ARM9. 

What is the endian of your ARM9 testbed?

I've tested the hello_world standalone image with and without your patch on 
a T5040 (BE). Behaviour of "bootm" does not change. So I am not sure what 
problem this patch fixes on PowerPC, if any. The patch might be applicable 
only to certain archs so you should test it on other archs as well 
(otherwise this patch might break them).


As a reference, the standalone image was created using the commandline:
../../tools/mkimage -A powerpc -O u-boot -T standalone -C none -a 0x10040000 
-e 0x10040000 -n test -d hello_world.bin hello_world.img

(Yes, I modified CONFIG_STANDALONE_LOAD_ADDR for this test.)
(Yes, hello_world was modified to not return for this test.)


And executed, on the board:
tftp 100000 hello_world.img
bootm 0x100000


> Addtionally "appl" need not be dereferenced with the "*" operator.

-snipped-


>  common/cmd_bootm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
> index a59ee95..c507e1d 100644
> --- a/common/cmd_bootm.c
> +++ b/common/cmd_bootm.c

Also, your patch does not apply on master.

-snipped-

All the best,
Rommel






More information about the U-Boot mailing list