]> git.sur5r.net Git - u-boot/commitdiff
dfu: mmc: change offset base handling
authorMateusz Zalega <m.zalega@samsung.com>
Mon, 28 Apr 2014 19:13:25 +0000 (21:13 +0200)
committerLukasz Majewski <l.majewski@samsung.com>
Mon, 5 May 2014 06:20:56 +0000 (08:20 +0200)
Previously offsets handled by dfu_fill_entity_mmc(), defined in boards'
CONFIG_DFU_ALT were treated as hexadecimal regardless of their prefix,
which sometimes led to confusion. This patch forces usage of explicit
numerical base prefixes.

Signed-off-by: Mateusz Zalega <m.zalega@samsung.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Tom Rini <trini@ti.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
drivers/dfu/dfu_mmc.c
include/configs/am335x_evm.h
include/configs/trats.h
include/configs/trats2.h

index b41785dfc7132742903864adf39824a54b871ce1..5e10ea7e66478a7308039e066989c6547d19a565 100644 (file)
@@ -215,8 +215,12 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s)
        }
 
        entity_type = argv[0];
-       second_arg = simple_strtoul(argv[1], NULL, 16);
-       third_arg = simple_strtoul(argv[2], NULL, 16);
+       /*
+        * Base 0 means we'll accept (prefixed with 0x or 0) base 16, 8,
+        * with default 10.
+        */
+       second_arg = simple_strtoul(argv[1], NULL, 0);
+       third_arg = simple_strtoul(argv[2], NULL, 0);
 
        mmc = find_mmc_device(dfu->dev_num);
        if (mmc == NULL) {
index ea9e758a6966faaa5476e7ee5e2ec1b47d68fbe5..4147f9f369145c83270bda64f53e837295ade1f3 100644 (file)
        "boot part 0 1;" \
        "rootfs part 0 2;" \
        "MLO fat 0 1;" \
-       "MLO.raw mmc 100 100;" \
-       "u-boot.img.raw mmc 300 400;" \
-       "spl-os-args.raw mmc 80 80;" \
-       "spl-os-image.raw mmc 900 2000;" \
+       "MLO.raw mmc 0x100 0x100;" \
+       "u-boot.img.raw mmc 0x300 0x400;" \
+       "spl-os-args.raw mmc 0x80 0x80;" \
+       "spl-os-image.raw mmc 0x900 0x2000;" \
        "spl-os-args fat 0 1;" \
        "spl-os-image fat 0 1;" \
        "u-boot.img fat 0 1;" \
index 5d8bd605836be277cc1a0f2e8068fb29dfb3279d..c4afecf3dab86a5e391059b87eecd11b4000f0cc 100644 (file)
        "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \
 
 #define CONFIG_DFU_ALT \
-       "u-boot mmc 80 400;" \
+       "u-boot raw 0x80 0x400;" \
        "uImage ext4 0 2;" \
        "modem.bin ext4 0 2;" \
        "exynos4210-trats.dtb ext4 0 2;" \
        ""PARTS_ROOT" part 0 5;" \
        ""PARTS_DATA" part 0 6;" \
        ""PARTS_UMS" part 0 7;" \
-       "params.bin mmc 0x38 0x8\0"
+       "params.bin raw 0x38 0x8\0"
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "bootk=" \
index 53d449c291a05d4c105387d6a54b6645438365bf..14def7d16e8f2bbcd79532178f46c41addd5a23b 100644 (file)
@@ -91,7 +91,7 @@
        "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \
 
 #define CONFIG_DFU_ALT \
-       "u-boot mmc 80 800;" \
+       "u-boot raw 0x80 0x800;" \
        "uImage ext4 0 2;" \
        "modem.bin ext4 0 2;" \
        "exynos4412-trats2.dtb ext4 0 2;" \
        ""PARTS_ROOT" part 0 5;" \
        ""PARTS_DATA" part 0 6;" \
        ""PARTS_UMS" part 0 7;" \
-       "params.bin mmc 0x38 0x8\0"
+       "params.bin raw 0x38 0x8\0"
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "bootk=" \