diff options
author | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2017-04-16 19:27:13 +0200 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2017-05-09 12:41:40 +0200 |
commit | 1d970ed5004250f612b7dd56fce9e29322278fbb (patch) | |
tree | 72d1ab2c5f15720f8e8bd0d30cf1c18119cc302e | |
parent | 901daf7df491527c2cac0fc3f587931913e5e5d0 (diff) |
rockchip: mkimage: rksd: pad SD/MMC images to a full blocksize
While not required for correctness, we pad the SD/MMC images to a full
blocksize (i.e. 512 bytes). This is to keep things consistent with all
operations being performed on blocksize units.
Note that a case could be made to choose a 2K alignment (as init_size
needs to be a multiple of 4 blocks) and to keep even closer to rkspi,
but the 512 byte choice felt more natural as it's also the natural
blocksize of SD/MMC devices.
Series-changes: 2
- added missing commit message (with a bit of background to the
in-line comment in the code).
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | tools/rksd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/rksd.c b/tools/rksd.c index 6dafedf282..8627b6d31b 100644 --- a/tools/rksd.c +++ b/tools/rksd.c @@ -62,8 +62,11 @@ static int rksd_check_image_type(uint8_t type) static int rksd_vrec_header(struct image_tool_params *params, struct image_type_params *tparams) { - /* We don't add any additional padding after the end of the image */ - return rkcommon_vrec_header(params, tparams, 1); + /* + * Pad to the RK_BLK_SIZE (512 bytes) to be consistent with init_size + * being encoded in RK_BLK_SIZE units in header0 (see rkcommon.c). + */ + return rkcommon_vrec_header(params, tparams, RK_BLK_SIZE); } /* |