aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2023-04-27 15:36:37 +0200
committerPatrice Chotard <patrice.chotard@foss.st.com>2023-06-16 11:16:31 +0200
commitbd087f62c9f56bb6610706aeea0825fd55c393e9 (patch)
treef97be2e61efa4751c3e0b38195dc5323ad283118
parent09f50c75a18da5a6d949b8bc5510f8ec5693a5b0 (diff)
downloadu-boot-bd087f62c9f56bb6610706aeea0825fd55c393e9.zip
u-boot-bd087f62c9f56bb6610706aeea0825fd55c393e9.tar.gz
u-boot-bd087f62c9f56bb6610706aeea0825fd55c393e9.tar.bz2
stm32mp: stm32prog: use the decimal format by default for offset parsing
Change the default base for offset parsing with simple_strtoull(), so offset in flashlayout is coded in base 10 by default, even if string start with '0'. The Octal encoding is not supported. The base 16 is still supported when the '0x' header is detected. This patch solves an unexpected parsing result when the address, provided by decimal value is starting by 0, for example 0x4400 = 00017408 is a invalid with current code. ... P 0x04 fsbl1 Binary mmc0 00017408 tf-a.stm32 .... Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
index 1e40bdf..9ba94be 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
@@ -521,7 +521,7 @@ static int parse_offset(struct stm32prog_data *data,
stm32prog_err("Layout line %d: invalid part '%s'",
i, p);
} else {
- part->addr = simple_strtoull(p, &tail, 0);
+ part->addr = simple_strtoull(p, &tail, 10);
if (tail == p || *tail != '\0') {
stm32prog_err("Layout line %d: invalid offset '%s'",
i, p);