Commit b7d4259af298402b7d65c876d8e39e5b9e6c8934
Committed by
Lukasz Majewski
1 parent
711b931f90
Exists in
v2017.01-smarct4x
and in
40 other branches
dfu: mmc: change offset base handling
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>
Showing 4 changed files with 14 additions and 10 deletions Side-by-side Diff
drivers/dfu/dfu_mmc.c
... | ... | @@ -215,8 +215,12 @@ |
215 | 215 | } |
216 | 216 | |
217 | 217 | entity_type = argv[0]; |
218 | - second_arg = simple_strtoul(argv[1], NULL, 16); | |
219 | - third_arg = simple_strtoul(argv[2], NULL, 16); | |
218 | + /* | |
219 | + * Base 0 means we'll accept (prefixed with 0x or 0) base 16, 8, | |
220 | + * with default 10. | |
221 | + */ | |
222 | + second_arg = simple_strtoul(argv[1], NULL, 0); | |
223 | + third_arg = simple_strtoul(argv[2], NULL, 0); | |
220 | 224 | |
221 | 225 | mmc = find_mmc_device(dfu->dev_num); |
222 | 226 | if (mmc == NULL) { |
include/configs/am335x_evm.h
... | ... | @@ -320,10 +320,10 @@ |
320 | 320 | "boot part 0 1;" \ |
321 | 321 | "rootfs part 0 2;" \ |
322 | 322 | "MLO fat 0 1;" \ |
323 | - "MLO.raw mmc 100 100;" \ | |
324 | - "u-boot.img.raw mmc 300 400;" \ | |
325 | - "spl-os-args.raw mmc 80 80;" \ | |
326 | - "spl-os-image.raw mmc 900 2000;" \ | |
323 | + "MLO.raw mmc 0x100 0x100;" \ | |
324 | + "u-boot.img.raw mmc 0x300 0x400;" \ | |
325 | + "spl-os-args.raw mmc 0x80 0x80;" \ | |
326 | + "spl-os-image.raw mmc 0x900 0x2000;" \ | |
327 | 327 | "spl-os-args fat 0 1;" \ |
328 | 328 | "spl-os-image fat 0 1;" \ |
329 | 329 | "u-boot.img fat 0 1;" \ |
include/configs/trats.h
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 | "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \ |
102 | 102 | |
103 | 103 | #define CONFIG_DFU_ALT \ |
104 | - "u-boot mmc 80 400;" \ | |
104 | + "u-boot raw 0x80 0x400;" \ | |
105 | 105 | "uImage ext4 0 2;" \ |
106 | 106 | "modem.bin ext4 0 2;" \ |
107 | 107 | "exynos4210-trats.dtb ext4 0 2;" \ |
... | ... | @@ -112,7 +112,7 @@ |
112 | 112 | ""PARTS_ROOT" part 0 5;" \ |
113 | 113 | ""PARTS_DATA" part 0 6;" \ |
114 | 114 | ""PARTS_UMS" part 0 7;" \ |
115 | - "params.bin mmc 0x38 0x8 0x38 0x8\0"" | |
115 | + "params.bin raw 0x38 0x8 0x38 0x8\0"" | |
116 | 116 | |
117 | 117 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
118 | 118 | "bootk=" \ |
include/configs/trats2.h
... | ... | @@ -91,7 +91,7 @@ |
91 | 91 | "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \ |
92 | 92 | |
93 | 93 | #define CONFIG_DFU_ALT \ |
94 | - "u-boot mmc 80 800;" \ | |
94 | + "u-boot raw 0x80 0x800;" \ | |
95 | 95 | "uImage ext4 0 2;" \ |
96 | 96 | "modem.bin ext4 0 2;" \ |
97 | 97 | "exynos4412-trats2.dtb ext4 0 2;" \ |
... | ... | @@ -102,7 +102,7 @@ |
102 | 102 | ""PARTS_ROOT" part 0 5;" \ |
103 | 103 | ""PARTS_DATA" part 0 6;" \ |
104 | 104 | ""PARTS_UMS" part 0 7;" \ |
105 | - "params.bin mmc 0x38 0x8 0x38 0x8\0"" | |
105 | + "params.bin raw 0x38 0x8 0x38 0x8\0"" | |
106 | 106 | |
107 | 107 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
108 | 108 | "bootk=" \ |