diff mbox series

[10/10] stm32mp: stm32prog: handle dfu error

Message ID 20210518151206.10.I77bcf66a0048289b8a5139cf59266a564d6400ac@changeid
State Accepted
Commit 1f2e3d5599704ea927453ac76a8675b607f32304
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
Handle DFU stack error in STM32CubeProgrammer protocol.

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

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

Comments

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

On 5/18/21 3:12 PM, Patrick Delaunay wrote:
> Handle DFU stack error in STM32CubeProgrammer protocol.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> index ab687c272d..f7c93a1298 100644
> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
> @@ -1783,3 +1783,17 @@ void dfu_initiated_callback(struct dfu_entity *dfu)
>  		log_debug("dfu offset = 0x%llx\n", dfu->offset);
>  	}
>  }
> +
> +void dfu_error_callback(struct dfu_entity *dfu, const char *msg)
> +{
> +	struct stm32prog_data *data = stm32prog_data;
> +
> +	if (!stm32prog_data)
> +		return;
> +
> +	if (!stm32prog_data->cur_part)
> +		return;
> +
> +	if (dfu->alt == stm32prog_data->cur_part->alt_id)
> +		stm32prog_err(msg);
> +}
> 

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

Thanks
Patrice
Patrice CHOTARD June 18, 2021, 7:56 a.m. UTC | #2
Hi Patrick

On 5/28/21 2:54 PM, Patrice CHOTARD wrote:
> Hi Patrick
> 
> On 5/18/21 3:12 PM, Patrick Delaunay wrote:
>> Handle DFU stack error in STM32CubeProgrammer protocol.
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
>> ---
>>
>>  arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
>> index ab687c272d..f7c93a1298 100644
>> --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
>> +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
>> @@ -1783,3 +1783,17 @@ void dfu_initiated_callback(struct dfu_entity *dfu)
>>  		log_debug("dfu offset = 0x%llx\n", dfu->offset);
>>  	}
>>  }
>> +
>> +void dfu_error_callback(struct dfu_entity *dfu, const char *msg)
>> +{
>> +	struct stm32prog_data *data = stm32prog_data;
>> +
>> +	if (!stm32prog_data)
>> +		return;
>> +
>> +	if (!stm32prog_data->cur_part)
>> +		return;
>> +
>> +	if (dfu->alt == stm32prog_data->cur_part->alt_id)
>> +		stm32prog_err(msg);
>> +}
>>
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> 
> Thanks
> Patrice
> 
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 ab687c272d..f7c93a1298 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
@@ -1783,3 +1783,17 @@  void dfu_initiated_callback(struct dfu_entity *dfu)
 		log_debug("dfu offset = 0x%llx\n", dfu->offset);
 	}
 }
+
+void dfu_error_callback(struct dfu_entity *dfu, const char *msg)
+{
+	struct stm32prog_data *data = stm32prog_data;
+
+	if (!stm32prog_data)
+		return;
+
+	if (!stm32prog_data->cur_part)
+		return;
+
+	if (dfu->alt == stm32prog_data->cur_part->alt_id)
+		stm32prog_err(msg);
+}