summaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2021-05-18 15:12:04 +0200
committerPatrice Chotard <patrice.chotard@foss.st.com>2021-06-18 10:09:41 +0200
commit5f14e2fe9d70afac8aa6e87319e826c7b9daa489 (patch)
tree5647cd98c24654898fd1212c7da0d6234ad7fbf0 /arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
parent486808e354fc0e1982950817d6d54a601463f82e (diff)
stm32mp: stm32prog: remove all the header check for UART download
This patch removes the header check for UART download; the check of checksum is not mandatory with even parity and chuck checksum for each 256 received bytes and it is only done for STM32 image (FSBL = TF-A BL2), not for FIT image. This patch solve issue of duplicated 0x100 byte written with FIP header. Fixes: 4fb7b3e10891 ("stm32mp: stm32prog: add FIP header support") 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/cmd_stm32prog/stm32prog.c')
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
index 4c4d8a7a69..84b880261a 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
@@ -369,23 +369,24 @@ static int parse_flash_layout(struct stm32prog_data *data,
bool end_of_line, eof;
char *p, *start, *last, *col;
struct stm32prog_part_t *part;
+ struct image_header_s header;
int part_list_size;
int i;
data->part_nb = 0;
/* check if STM32image is detected */
- stm32prog_header_check((struct raw_header_s *)addr, &data->header);
- if (data->header.type == HEADER_STM32IMAGE) {
+ stm32prog_header_check((struct raw_header_s *)addr, &header);
+ if (header.type == HEADER_STM32IMAGE) {
u32 checksum;
addr = addr + BL_HEADER_SIZE;
- size = data->header.image_length;
+ size = header.image_length;
- checksum = stm32prog_header_checksum(addr, &data->header);
- if (checksum != data->header.image_checksum) {
+ checksum = stm32prog_header_checksum(addr, &header);
+ if (checksum != header.image_checksum) {
stm32prog_err("Layout: invalid checksum : 0x%x expected 0x%x",
- checksum, data->header.image_checksum);
+ checksum, header.image_checksum);
return -EIO;
}
}
@@ -1727,7 +1728,6 @@ void stm32prog_clean(struct stm32prog_data *data)
free(data->part_array);
free(data->otp_part);
free(data->buffer);
- free(data->header_data);
}
/* DFU callback: used after serial and direct DFU USB access */