summaryrefslogtreecommitdiff
path: root/tools/rkspi.c
diff options
context:
space:
mode:
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-04-17 17:48:00 +0200
committerSimon Glass <sjg@chromium.org>2017-05-10 13:37:21 -0600
commit798c93faf3b86f0eee542fbe8698618e05b48a09 (patch)
tree2eac9422694876c67e6c2a5e50461dc35e649a39 /tools/rkspi.c
parent3e75c07ddbf8c6bfa86ec7f29a30f274db435a13 (diff)
downloadu-boot-798c93faf3b86f0eee542fbe8698618e05b48a09.tar.gz
rockchip: mkimage: rkspi: include the header sector in the SPI size calculation
Our earlier change broke the generation of SPI images, by excluding the 2K used for header0 from the size-calculation. This commit makes sure that these are included before calculating the required total size (including the padding from the 2K-from-every-4K conversion). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/rkspi.c')
-rw-r--r--tools/rkspi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/rkspi.c b/tools/rkspi.c
index d2d3fdda42..0a152293aa 100644
--- a/tools/rkspi.c
+++ b/tools/rkspi.c
@@ -79,12 +79,12 @@ static int rkspi_vrec_header(struct image_tool_params *params,
rkcommon_vrec_header(params, tparams);
- pad_size = (rkcommon_get_spl_size(params) + 0x7ff) / 0x800 * 0x800;
+ pad_size = ROUND(rkcommon_get_spl_size(params), 0x800);
params->orig_file_size = pad_size;
/* We will double the image size due to the SPI format */
- pad_size *= 2;
pad_size += RK_SPL_HDR_START;
+ pad_size *= 2;
debug("pad_size %x\n", pad_size);
return pad_size - params->file_size - tparams->header_size;