No more need to test if a fsbl partition is present on NOR when booting from serial or USB. Now MTD devices are automatically populated with partition information found in DT. Remove fsbl_nor_detected boolean from stm32prog_data struct and all code using it.
Signed-off-by: Patrice Chotard <[email protected]> --- arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c | 8 -------- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 10 ---------- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h | 1 - arch/arm/mach-stm32mp/include/mach/stm32prog.h | 2 -- 4 files changed, 21 deletions(-) diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c index 506ecac2ef0..24503bbe58c 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c @@ -187,11 +187,3 @@ U_BOOT_CMD(stm32prog, 5, 0, do_stm32prog, " <addr> = address of flashlayout\n" " <size> = size of flashlayout (optional for image with STM32 header)\n" ); - -bool stm32prog_get_fsbl_nor(void) -{ - if (stm32prog_data) - return stm32prog_data->fsbl_nor_detected; - - return false; -} diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c index 9acbc0689a9..835eaf48dfa 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c @@ -1010,7 +1010,6 @@ static int treat_partition_list(struct stm32prog_data *data) INIT_LIST_HEAD(&data->dev[j].part_list); } - data->fsbl_nor_detected = false; for (i = 0; i < data->part_nb; i++) { part = &data->part_array[i]; part->alt_id = -1; @@ -1055,15 +1054,6 @@ static int treat_partition_list(struct stm32prog_data *data) stm32prog_err("Layout: too many device"); return -EINVAL; } - switch (part->target) { - case STM32PROG_NOR: - if (!data->fsbl_nor_detected && - !strncmp(part->name, "fsbl", 4)) - data->fsbl_nor_detected = true; - /* fallthrough */ - default: - break; - } part->dev = &data->dev[j]; if (!IS_SELECT(part)) part->dev->full_update = false; diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h index bf184c8a884..929e38700e1 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h @@ -167,7 +167,6 @@ struct stm32prog_data { struct stm32prog_dev_t dev[STM32PROG_MAX_DEV]; /* array of device */ int part_nb; /* nb of partition */ struct stm32prog_part_t *part_array; /* array of partition */ - bool fsbl_nor_detected; /* command internal information */ unsigned int phase; diff --git a/arch/arm/mach-stm32mp/include/mach/stm32prog.h b/arch/arm/mach-stm32mp/include/mach/stm32prog.h index 23d1adfbad9..c10bff09c84 100644 --- a/arch/arm/mach-stm32mp/include/mach/stm32prog.h +++ b/arch/arm/mach-stm32mp/include/mach/stm32prog.h @@ -10,5 +10,3 @@ int stm32prog_write_medium_virt(struct dfu_entity *dfu, u64 offset, int stm32prog_read_medium_virt(struct dfu_entity *dfu, u64 offset, void *buf, long *len); int stm32prog_get_medium_size_virt(struct dfu_entity *dfu, u64 *size); - -bool stm32prog_get_fsbl_nor(void); --- base-commit: 1de103fc29761fa729dffaa15d0cfb2766be05e4 change-id: 20260205-upstream_stm32prog-2683672562b9 Best regards, -- Patrice Chotard <[email protected]>

