[PATCH 5/5] stm32mp1: stm32prog: remove stm32prog_get_tee_partitions with FIP

Patrice CHOTARD patrice.chotard at foss.st.com
Fri Jul 9 14:43:15 CEST 2021


Hi Patrick

On 7/8/21 11:17 AM, Patrick Delaunay wrote:
> The MTD tee partitions used to save the OP-TEE binary are needed when
> TF-A doesn't use the FIP container to load binaries.
> 
> This patch puts under CONFIG_STM32MP15x_STM32IMAGE flag the associated
> code in U-Boot binary and prepare the code cleanup when
> CONFIG_STM32MP15x_STM32IMAGE support will be removed after TF-A migration
> to FIP support.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
> ---
> 
>  arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c | 2 ++
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c     | 4 ++++
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h     | 2 ++
>  arch/arm/mach-stm32mp/include/mach/stm32prog.h      | 2 ++
>  4 files changed, 10 insertions(+)
> 
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
> index e36501a86b..821c174bbe 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
> @@ -175,6 +175,7 @@ U_BOOT_CMD(stm32prog, 5, 0, do_stm32prog,
>  	   "<size> = size of flashlayout\n"
>  );
>  
> +#ifdef CONFIG_STM32MP15x_STM32IMAGE
>  bool stm32prog_get_tee_partitions(void)
>  {
>  	if (stm32prog_data)
> @@ -182,6 +183,7 @@ bool stm32prog_get_tee_partitions(void)
>  
>  	return false;
>  }
> +#endif
>  
>  bool stm32prog_get_fsbl_nor(void)
>  {
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> index 4c4d8a7a69..2fb1f1f24a 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> @@ -823,7 +823,9 @@ static int treat_partition_list(struct stm32prog_data *data)
>  		INIT_LIST_HEAD(&data->dev[j].part_list);
>  	}
>  
> +#ifdef CONFIG_STM32MP15x_STM32IMAGE
>  	data->tee_detected = false;
> +#endif
>  	data->fsbl_nor_detected = false;
>  	for (i = 0; i < data->part_nb; i++) {
>  		part = &data->part_array[i];
> @@ -877,10 +879,12 @@ static int treat_partition_list(struct stm32prog_data *data)
>  			/* fallthrough */
>  		case STM32PROG_NAND:
>  		case STM32PROG_SPI_NAND:
> +#ifdef CONFIG_STM32MP15x_STM32IMAGE
>  			if (!data->tee_detected &&
>  			    !strncmp(part->name, "tee", 3))
>  				data->tee_detected = true;
>  			break;
> +#endif
>  		default:
>  			break;
>  		}
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> index 581b10d0ac..5b18f2fd4f 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
> @@ -121,7 +121,9 @@ 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 */
> +#ifdef CONFIG_STM32MP15x_STM32IMAGE
>  	bool			tee_detected;
> +#endif
>  	bool			fsbl_nor_detected;
>  
>  	/* command internal information */
> diff --git a/arch/arm/mach-stm32mp/include/mach/stm32prog.h b/arch/arm/mach-stm32mp/include/mach/stm32prog.h
> index c080b9cc42..99be4e1d65 100644
> --- a/arch/arm/mach-stm32mp/include/mach/stm32prog.h
> +++ b/arch/arm/mach-stm32mp/include/mach/stm32prog.h
> @@ -11,6 +11,8 @@ 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);
>  
> +#ifdef CONFIG_STM32MP15x_STM32IMAGE
>  bool stm32prog_get_tee_partitions(void);
> +#endif
>  
>  bool stm32prog_get_fsbl_nor(void);
> 
Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>

Thanks
Patrice


More information about the U-Boot mailing list