uboot/common
Zubair Lutfullah Kakakhel ba07984068 bootm: fix passing argc to standalone apps
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>
2016-10-01 20:04:37 -04:00
..
eeprom cmd: eeprom: add support for layout aware commands 2016-05-20 17:02:07 -04:00
init bootstage: call show_boot_progress also in SPL 2016-06-09 13:53:08 -04:00
spl dra7x: boot: add dfu bootmode support 2016-09-27 23:30:20 +02:00
Kconfig Kconfig: Move config IDENT_STRING to Kconfig 2016-09-20 09:30:23 -04:00
Makefile common: dfu: saperate the dfu common functionality 2016-09-27 23:30:18 +02:00
autoboot.c autoboot: move bootdelay >= 0 check to abortboot() 2016-07-01 17:42:56 -04:00
bedbug.c
board_f.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
board_info.c
board_r.c dm: scsi: Rename CONFIG_CMD_SCSI to CONFIG_SCSI 2016-05-17 09:54:43 -06:00
bootm.c bootm: fix passing argc to standalone apps 2016-10-01 20:04:37 -04:00
bootm_os.c sandbox: Don't exit when bootm completes 2016-07-14 18:22:32 -04:00
bootretry.c
bootstage.c
bouncebuf.c
cli.c hush: complete renaming CONFIG_SYS_HUSH_PARSER to CONFIG_HUSH_PARSER 2016-06-24 17:24:34 -04:00
cli_hush.c
cli_readline.c common: cli_readline: Improve command line editing 2016-08-20 14:03:24 -04:00
cli_simple.c
command.c
console.c
cros_ec.c
ddr_spd.c
dfu.c cmd: dfu: Add error handling for failed registration 2016-09-27 23:30:22 +02:00
dlmalloc.c malloc: improve memalign fragmentation fix 2016-05-23 11:50:17 -04:00
dlmalloc.src
edid.c
env_attr.c
env_callback.c
env_common.c Various, unrelated tree-wide typo fixes. 2016-07-16 09:43:12 -04:00
env_dataflash.c
env_eeprom.c
env_embedded.c
env_ext4.c common: Fix support for environment file in EXT4 2016-06-24 17:24:35 -04:00
env_fat.c
env_flags.c
env_flash.c
env_mmc.c dm: env: mmc: Convert env_mmc to support CONFIG_BLK 2016-05-27 10:23:08 -06:00
env_nand.c common: env_nand: Ensure that we have nand_info[0] prior to use 2016-08-15 18:46:41 -04:00
env_nowhere.c
env_nvram.c
env_onenand.c
env_remote.c
env_sata.c
env_sf.c dm: spi: Read default speed and mode values from DT 2016-07-09 20:16:34 +05:30
env_ubi.c common: env_ubi: Clear environment buffer before reading 2016-06-13 06:41:20 +02:00
exports.c
fb_mmc.c common: block: fix compiler error with CONFIG_FASTBOOT_FLASH_MMC_DEV 2016-07-11 14:06:44 -06:00
fb_nand.c fastboot: sparse: implement reserve() 2016-06-27 16:37:39 -04:00
fdt_support.c fdt_support: fdt_translate_address() blob const correctness 2016-08-12 09:20:27 -06:00
flash.c
hash.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
hwconfig.c
ide.c dm: ide: Add support for driver-model block devices 2016-05-17 09:54:43 -06:00
image-android.c common: image: minimal android image iminfo support 2016-06-24 17:23:07 -04:00
image-fdt.c image-fit: Fix fit_get_node_from_config semantics 2016-09-22 11:34:58 -04:00
image-fit.c image-fit: Fix fit_get_node_from_config semantics 2016-09-22 11:34:58 -04:00
image-sig.c
image-sparse.c fastboot: sparse: improve CHUNK_TYPE_FILL write performance 2016-06-27 16:37:39 -04:00
image.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
iomux.c
iotrace.c
kallsyms.c
kgdb.c Fix spelling of "occurred". 2016-05-02 18:37:09 -04:00
kgdb_stubs.c
lcd.c
lcd_console.c
lcd_console_rotation.c
lcd_simplefb.c
lynxkdi.c
main.c Drop use of CONFIG_SYS_GENERIC_BOARD in U-Boot 2016-05-27 15:39:54 -04:00
malloc_simple.c
memsize.c
menu.c
miiphyutil.c net: mii: check phy advertising register when geting link status 2016-08-22 14:21:23 -05:00
s_record.c
sata.c dm: sata: Add support for driver-model block devices 2016-05-17 09:54:43 -06:00
scsi.c dm: scsi: if_typename should be scsi 2016-06-06 13:39:12 -04:00
splash.c splash: Introduce default_splash_locations 2016-07-26 08:47:37 +02:00
splash_source.c splash: Accommodate DM_USB in splash_init_usb() 2016-07-25 22:42:10 +02:00
stdio.c
system_map.c
update.c
usb.c usb: squash lines for immediate return 2016-09-23 17:53:48 -04:00
usb_hub.c dm: Use dm_scan_fdt_dev() directly where possible 2016-07-27 14:15:54 -06:00
usb_kbd.c usb: squash lines for immediate return 2016-09-23 17:53:48 -04:00
usb_storage.c usb: squash lines for immediate return 2016-09-23 17:53:48 -04:00
xyzModem.c