summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@foss.st.com>2024-11-29 13:27:09 +0100
committerPatrice Chotard <patrice.chotard@foss.st.com>2025-01-31 10:13:10 +0100
commitd429595f4dd9a29f3944d006cf82e2f8a1b08177 (patch)
treed85c40171bf3e2c6ddabe9521f9d947004436c44
parent2d774c19f23f2d8e698307d8ec136fbff6919eaf (diff)
configs: stm32mp13: enable CONFIG_SYS_64BIT_LBA
In arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c, in init_device(), in case of RAW_IMAGE, part->size = block_dev->lba * block_dev->blksz. _ part->size is declared as u64. _ block_dev->lba is declared as lbaint_t which is uint64_t if CONFIG_SYS_64BIT_LBA is enable, otherwise ulong. _ block_dev->blksz is declared as unsigned long. For example, in case block_dev->lba = 0x1dacc00, block_dev->blksz = 0x200 then part->size 0x5980000 which is incorrect as both are declared as ulong. To fix this overflow issue, enable CONFIG_SYS_64BIT_LBA, block_dev->lba is then declared as uint64_t and part->size get the correct value 0x3b5980000. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
-rw-r--r--configs/stm32mp13_defconfig1
1 files changed, 1 insertions, 0 deletions
diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig
index 7f705808089..0acd1487c9a 100644
--- a/configs/stm32mp13_defconfig
+++ b/configs/stm32mp13_defconfig
@@ -52,6 +52,7 @@ CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SYS_MMC_ENV_DEV=-1
CONFIG_ENV_MMC_USE_DT=y
+CONFIG_SYS_64BIT_LBA=y
CONFIG_BUTTON=y
CONFIG_BUTTON_GPIO=y
CONFIG_CLK_SCMI=y