[PATCH v1 3/6] arm: stm32mp: stm32prog: update multiplier is part-size is above SZ_1G
Patrick DELAUNAY
patrick.delaunay at foss.st.com
Wed Jan 8 19:49:08 CET 2025
Hi
On 11/29/24 13:27, Patrice Chotard wrote:
> Set multiplier to 'G' if part->size if above SZ_1G.
>
> Signed-off-by: Patrice Chotard <patrice.chotard at foss.st.com>
> ---
>
> arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> index f0e019e8da1..353aecc09de 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> @@ -1229,7 +1229,10 @@ static int stm32prog_alt_add(struct stm32prog_data *data,
> char multiplier, type;
>
> /* max 3 digit for sector size */
> - if (part->size > SZ_1M) {
> + if (part->size > SZ_1G) {
> + size = (u32)(part->size / SZ_1G);
> + multiplier = 'G';
> + } else if (part->size > SZ_1M) {
> size = (u32)(part->size / SZ_1M);
> multiplier = 'M';
> } else if (part->size > SZ_1K) {
Reviewed-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
Thanks
Patrick
More information about the U-Boot
mailing list