]> git.baikalelectronics.ru Git - uboot.git/commit
arm: stm32mp: stm32prog: always flush DFU on start command for uart
authorPatrick Delaunay <patrick.delaunay@st.com>
Fri, 11 Dec 2020 12:36:18 +0000 (13:36 +0100)
committerPatrick Delaunay <patrick.delaunay@foss.st.com>
Wed, 13 Jan 2021 08:52:58 +0000 (09:52 +0100)
commit94e7ec5f7d817177dcc88b7b6e1c360bab798022
tree6da61de1e8facf73252c05a066a5a1713c24403a
parentdc68c5dce3ec1b12ab81358cf5d6814e873989c6
arm: stm32mp: stm32prog: always flush DFU on start command for uart

Remove the test on data->dfu_seq, because dfu_seq=0 not only when
the DFU is not started (mask with 0xffff). This flush is mandatory
as the final treatment, common with USB, is done in DFU callback.

This patch avoids issue if the received length is a multiple of
the DFU packet.

For example if size of bootfs partition is egual to 0x4000000,
data->dfu_seq=0 at the end of the partition, the flush it not
requested and the phase is not increased in the callback.
U-Boot continue to request the bootfs in the next GetPhase command.

Fixes: 06d2b86c8e5e ("stm32mp: stm32prog: add serial link support")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c