diff options
author | Jeffy Chen <jeffy.chen@rock-chips.com> | 2019-12-27 11:24:41 +0800 |
---|---|---|
committer | Kever Yang <kever.yang@rock-chips.com> | 2019-12-27 15:17:07 +0800 |
commit | eea6cd8d7c41df5f7118ac4fb1e9e375eb04c4eb (patch) | |
tree | 20705ff63626513ce8f4765aefbc527982f34e2f /tools/rkcommon.h | |
parent | dcdea292d9f3434bf5940338cfacc64cd5bd4444 (diff) | |
download | u-boot-eea6cd8d7c41df5f7118ac4fb1e9e375eb04c4eb.tar.gz |
rockchip: mkimage: support packing optional second level boot-loader
Support packing optional second level boot-loader:
$ ./tools/mkimage -n rk3399 -T rksd -d \
rk3399_ddr_800MHz_v1.24.bin:rk3399_miniloader_v1.19.bin out -v
Adding Image rk3399_ddr_800MHz_v1.24.bin
Size 116492(pad to 116736)
Adding Image rk3399_miniloader_v1.19.bin
Size 88060(pad to 88064)
Image Type: Rockchip RK33 (SD/MMC) boot image
Init Data Size: 116736 bytes
Boot Data Size: 88064 bytes
Mainly parse init file and boot file from datafile option, copy them to
the image with 2KB alignment.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'tools/rkcommon.h')
-rw-r--r-- | tools/rkcommon.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/tools/rkcommon.h b/tools/rkcommon.h index 47f47a52aa..93518824a5 100644 --- a/tools/rkcommon.h +++ b/tools/rkcommon.h @@ -9,13 +9,11 @@ enum { RK_BLK_SIZE = 512, - RK_INIT_SIZE_ALIGN = 2048, + RK_SIZE_ALIGN = 2048, RK_INIT_OFFSET = 4, RK_MAX_BOOT_SIZE = 512 << 10, RK_SPL_HDR_START = RK_INIT_OFFSET * RK_BLK_SIZE, RK_SPL_HDR_SIZE = 4, - RK_SPL_START = RK_SPL_HDR_START + RK_SPL_HDR_SIZE, - RK_IMAGE_HEADER_LEN = RK_SPL_START, }; /** @@ -49,11 +47,9 @@ int rkcommon_get_spl_size(struct image_tool_params *params); * This sets up a 2KB header which can be interpreted by the Rockchip boot ROM. * * @buf: Pointer to header place (must be at least 2KB in size) - * @file_size: Size of the file we want the boot ROM to load, in bytes - * @return 0 if OK, -ENOSPC if too large */ -int rkcommon_set_header(void *buf, uint file_size, - struct image_tool_params *params); +void rkcommon_set_header(void *buf, struct stat *sbuf, int ifd, + struct image_tool_params *params); /** * rkcommon_verify_header() - verify the header for a Rockchip boot image @@ -102,14 +98,10 @@ void rkcommon_rc4_encode_spl(void *buf, unsigned int offset, unsigned int size); * @params: Pointer to the tool params structure * @tparams: Pointer tot the image type structure (for setting * the header and header_size) - * @alignment: Alignment (a power of two) that the image should be - * padded to (e.g. 512 if we want to align with SD/MMC - * blocksizes or 2048 for the SPI format) * - * @return bytes of padding required/added (does not include the header_size) + * @return 0 (always) */ int rkcommon_vrec_header(struct image_tool_params *params, - struct image_type_params *tparams, - unsigned int alignment); + struct image_type_params *tparams); #endif |