summaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2022-03-28 19:25:29 +0200
committerPatrice Chotard <patrice.chotard@foss.st.com>2022-05-10 10:56:39 +0200
commit49d0ecb1231dd7f8558ede64cb724e43189cfcd3 (patch)
tree48dc90dd6547e336f75377140f6b36229dfc5b64 /arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
parente82ab4c8906fc2e1e42065e4207ff0c36f343553 (diff)
stm32mp: stm32prog: add support of STM32IMAGE version 2
Add support of new header for the STM32IMAGE version V2 in command stm32prog command for STM32MP13x family. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Diffstat (limited to 'arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h')
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h35
1 files changed, 27 insertions, 8 deletions
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
index 928b7b3a0e2..90cdc2ba476 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
@@ -42,6 +42,7 @@ enum stm32prog_link_t {
enum stm32prog_header_t {
HEADER_NONE,
HEADER_STM32IMAGE,
+ HEADER_STM32IMAGE_V2,
HEADER_FIP,
};
@@ -49,11 +50,12 @@ struct image_header_s {
enum stm32prog_header_t type;
u32 image_checksum;
u32 image_length;
+ u32 length;
};
-struct raw_header_s {
+struct stm32_header_v1 {
u32 magic_number;
- u32 image_signature[64 / 4];
+ u8 image_signature[64];
u32 image_checksum;
u32 header_version;
u32 image_length;
@@ -64,12 +66,30 @@ struct raw_header_s {
u32 version_number;
u32 option_flags;
u32 ecdsa_algorithm;
- u32 ecdsa_public_key[64 / 4];
- u32 padding[83 / 4];
- u32 binary_type;
+ u8 ecdsa_public_key[64];
+ u8 padding[83];
+ u8 binary_type;
};
-#define BL_HEADER_SIZE sizeof(struct raw_header_s)
+struct stm32_header_v2 {
+ u32 magic_number;
+ u8 image_signature[64];
+ u32 image_checksum;
+ u32 header_version;
+ u32 image_length;
+ u32 image_entry_point;
+ u32 reserved1;
+ u32 load_address;
+ u32 reserved2;
+ u32 version_number;
+ u32 extension_flags;
+ u32 extension_headers_length;
+ u32 binary_type;
+ u8 padding[16];
+ u32 extension_header_type;
+ u32 extension_header_length;
+ u8 extension_padding[376];
+};
/* partition type in flashlayout file */
enum stm32prog_part_type {
@@ -171,8 +191,7 @@ int stm32prog_pmic_read(struct stm32prog_data *data, u32 offset,
int stm32prog_pmic_start(struct stm32prog_data *data);
/* generic part*/
-void stm32prog_header_check(struct raw_header_s *raw_header,
- struct image_header_s *header);
+void stm32prog_header_check(uintptr_t raw_header, struct image_header_s *header);
int stm32prog_dfu_init(struct stm32prog_data *data);
void stm32prog_next_phase(struct stm32prog_data *data);
void stm32prog_do_reset(struct stm32prog_data *data);