summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2019-11-09 15:28:24 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-11 09:15:55 +0100
commitb6d3e1fa56f365796b40d86e9195f882f0690952 (patch)
treec5a82dc93e46aa995bf939c2f0767fe04f5391e9
parent24fce509d00474d5978dc38828b39154431c8a49 (diff)
downloadbarebox-b6d3e1fa56f365796b40d86e9195f882f0690952.tar.gz
ARM: zynq: add size check in zynq_mkimage
Currently Barebox does not support 2 stage loading on Zynq, so the image must fit into the free OCRAM area. Add a check to the mkimage tool to validate this. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--scripts/zynq_mkimage.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/zynq_mkimage.c b/scripts/zynq_mkimage.c
index bf214ca..0a1c069 100644
--- a/scripts/zynq_mkimage.c
+++ b/scripts/zynq_mkimage.c
@@ -283,6 +283,11 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
+ if (st.st_size > 192 * 1024) {
+ fprintf(stderr, "Image too big, will not fit in OCRAM!\n");
+ exit(EXIT_FAILURE);
+ }
+
buf = calloc(st.st_size + IMAGE_OFFSET, sizeof(char));
if (!buf) {
fprintf(stderr, "Unable to allocate buffer\n");