diff options
author | Patrice Chotard <patrice.chotard@foss.st.com> | 2024-11-29 13:27:11 +0100 |
---|---|---|
committer | Patrice Chotard <patrice.chotard@foss.st.com> | 2025-01-31 10:13:10 +0100 |
commit | f05e4ec4a4d6850e174af3192291d9c11a49c062 (patch) | |
tree | 3657aa7bc51eb0c9de753685a0b66c034913b4ac /arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c | |
parent | 1ddd8e5d9bc0c13baaeaf87590bc0f54d5774992 (diff) |
configs: stm32mp25: 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>
Diffstat (limited to 'arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c')
0 files changed, 0 insertions, 0 deletions