diff mbox series

[06/10] stm32mp: stm32prog: correctly handle DM_PMIC

Message ID 20210518151206.6.Id5ec1c084e307f296256a9764772f23492ee4766@changeid
State Accepted
Commit b57efb24c9d05c04732f96b1330b2229769114e4
Delegated to: Patrice Chotard
Headers show
Series stm32mp: stm32prog: several features and fixes | expand

Commit Message

Patrick DELAUNAY May 18, 2021, 1:12 p.m. UTC
Correctly handle number of alternate when DM_PMIC is not activated.
This patch remove the last UNKNOWN partition in this case.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

 arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Patrice CHOTARD May 28, 2021, 12:54 p.m. UTC | #1
Hi Patrick

On 5/18/21 3:12 PM, Patrick Delaunay wrote:
> Correctly handle number of alternate when DM_PMIC is not activated.
> This patch remove the last UNKNOWN partition in this case.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@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 ea69d5dd16..ab687c272d 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> @@ -1150,7 +1150,10 @@ static int dfu_init_entities(struct stm32prog_data *data)
>  	struct dfu_entity *dfu;
>  	int alt_nb;
>  
> -	alt_nb = 3; /* number of virtual = CMD, OTP, PMIC*/
> +	alt_nb = 2; /* number of virtual = CMD, OTP*/
> +	if (CONFIG_IS_ENABLED(DM_PMIC))
> +		alt_nb++; /* PMIC NVMEM*/
> +
>  	if (data->part_nb == 0)
>  		alt_nb++;  /* +1 for FlashLayout */
>  	else
> 

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice
Jaehoon Chung May 30, 2021, 9:44 p.m. UTC | #2
On 5/28/21 9:54 PM, Patrice CHOTARD wrote:
> Hi Patrick
> 
> On 5/18/21 3:12 PM, Patrick Delaunay wrote:
>> Correctly handle number of alternate when DM_PMIC is not activated.
>> This patch remove the last UNKNOWN partition in this case.
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@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 ea69d5dd16..ab687c272d 100644
>> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
>> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
>> @@ -1150,7 +1150,10 @@ static int dfu_init_entities(struct stm32prog_data *data)
>>  	struct dfu_entity *dfu;
>>  	int alt_nb;
>>  
>> -	alt_nb = 3; /* number of virtual = CMD, OTP, PMIC*/
>> +	alt_nb = 2; /* number of virtual = CMD, OTP*/
>> +	if (CONFIG_IS_ENABLED(DM_PMIC))
>> +		alt_nb++; /* PMIC NVMEM*/
>> +
>>  	if (data->part_nb == 0)
>>  		alt_nb++;  /* +1 for FlashLayout */
>>  	else
>>
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Acked-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> 
> Thanks
> Patrice
>
Patrice CHOTARD June 18, 2021, 7:57 a.m. UTC | #3
On 5/28/21 2:54 PM, Patrice CHOTARD wrote:
> Hi Patrick
> 
> On 5/18/21 3:12 PM, Patrick Delaunay wrote:
>> Correctly handle number of alternate when DM_PMIC is not activated.
>> This patch remove the last UNKNOWN partition in this case.
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@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 ea69d5dd16..ab687c272d 100644
>> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
>> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
>> @@ -1150,7 +1150,10 @@ static int dfu_init_entities(struct stm32prog_data *data)
>>  	struct dfu_entity *dfu;
>>  	int alt_nb;
>>  
>> -	alt_nb = 3; /* number of virtual = CMD, OTP, PMIC*/
>> +	alt_nb = 2; /* number of virtual = CMD, OTP*/
>> +	if (CONFIG_IS_ENABLED(DM_PMIC))
>> +		alt_nb++; /* PMIC NVMEM*/
>> +
>>  	if (data->part_nb == 0)
>>  		alt_nb++;  /* +1 for FlashLayout */
>>  	else
>>
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> 
> Thanks
> Patrice
> _______________________________________________
> Uboot-stm32 mailing list
> Uboot-stm32@st-md-mailman.stormreply.com
> https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32
> 
Applied on u-boot-stm32/next

Thanks
diff mbox series

Patch

diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
index ea69d5dd16..ab687c272d 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
@@ -1150,7 +1150,10 @@  static int dfu_init_entities(struct stm32prog_data *data)
 	struct dfu_entity *dfu;
 	int alt_nb;
 
-	alt_nb = 3; /* number of virtual = CMD, OTP, PMIC*/
+	alt_nb = 2; /* number of virtual = CMD, OTP*/
+	if (CONFIG_IS_ENABLED(DM_PMIC))
+		alt_nb++; /* PMIC NVMEM*/
+
 	if (data->part_nb == 0)
 		alt_nb++;  /* +1 for FlashLayout */
 	else