diff options
author | Pali Rohár <pali@kernel.org> | 2021-07-23 12:14:11 +0300 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2021-07-31 10:49:31 +0300 |
commit | 02ba70ad6822a3d0b42fef3ab48c13b9495ecd6d (patch) | |
tree | 55d1a544e8b72e4979efe89eefc3091be32604f1 /tools/kwbimage.h | |
parent | c9b2134b6f475dfde89012d6ce0bf7e4bdee5888 (diff) | |
download | u-boot-02ba70ad6822a3d0b42fef3ab48c13b9495ecd6d.tar.xz |
tools: kwbimage: Add support for DATA command also for v1 images
The DATA command is already supported by mkimage for v0 images, but not
for v1 images.
BootROM code which executes v1 images also supports DATA command via an
optional extended v1 header OPT_HDR_V1_REGISTER_TYPE.
Implement support for DATA command for v1 images.
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Chris Packham <judge.packham@gmail.com>
Diffstat (limited to 'tools/kwbimage.h')
-rw-r--r-- | tools/kwbimage.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/kwbimage.h b/tools/kwbimage.h index cab3d95d13..9f86da46e8 100644 --- a/tools/kwbimage.h +++ b/tools/kwbimage.h @@ -149,6 +149,33 @@ struct secure_hdr_v1 { }; /* + * Structure of register set + */ +struct register_set_hdr_v1 { + uint8_t headertype; /* 0x0 */ + uint8_t headersz_msb; /* 0x1 */ + uint16_t headersz_lsb; /* 0x2 - 0x3 */ + union { + struct { + uint32_t address; /* 0x4+8*N - 0x7+8*N */ + uint32_t value; /* 0x8+8*N - 0xB+8*N */ + } entry; + struct { + uint8_t next; /* 0xC+8*N */ + uint8_t delay; /* 0xD+8*N */ + uint16_t reserved; /* 0xE+8*N - 0xF+8*N */ + } last_entry; + } data[]; +}; + +/* + * Value 0 in register_set_hdr_v1 delay field is special. + * Instead of delay it setup SDRAM Controller. + */ +#define REGISTER_SET_HDR_OPT_DELAY_SDRAM_SETUP 0 +#define REGISTER_SET_HDR_OPT_DELAY_MS(val) ((val) ?: 1) + +/* * Various values for the opt_hdr_v1->headertype field, describing the * different types of optional headers. The "secure" header contains * informations related to secure boot (encryption keys, etc.). The |