summaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2021-05-18 15:12:13 +0200
committerPatrice Chotard <patrice.chotard@foss.st.com>2021-06-18 10:09:41 +0200
commit1f2e3d5599704ea927453ac76a8675b607f32304 (patch)
tree17fca289d37924ab0d194ba1195bb4e484fa7953 /arch/arm/mach-stm32mp
parentd4710326c814ffbf84eab87dce8f8fd789b0da18 (diff)
downloadu-boot-1f2e3d5599704ea927453ac76a8675b607f32304.tar.gz
u-boot-1f2e3d5599704ea927453ac76a8675b607f32304.tar.bz2
u-boot-1f2e3d5599704ea927453ac76a8675b607f32304.zip
stm32mp: stm32prog: handle dfu error
Handle DFU stack error in STM32CubeProgrammer protocol. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Diffstat (limited to 'arch/arm/mach-stm32mp')
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c14
1 files changed, 14 insertions, 0 deletions
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);
+}