From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 14/15] ARM omap spi image: relax size constrains
Date: Fri, 26 Oct 2012 08:59:07 +0200 [thread overview]
Message-ID: <1351234748-24994-15-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1351234748-24994-1-git-send-email-s.hauer@pengutronix.de>
The omap spi utility requires the image size to be a multiple of four
bytes. This seems unnecessary, we can just pad with a few bytes to
get the required alignment.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
scripts/mk-am35xx-spi-image.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/scripts/mk-am35xx-spi-image.c b/scripts/mk-am35xx-spi-image.c
index ec311fd..1372fbd 100644
--- a/scripts/mk-am35xx-spi-image.c
+++ b/scripts/mk-am35xx-spi-image.c
@@ -95,10 +95,6 @@ int main(int argc, char *argv[])
perror("ftello");
exit(EXIT_FAILURE);
}
- if (pos % 4) {
- printf("error: image size must be a multiple of 4 bytes\n");
- exit(EXIT_FAILURE);
- }
if (pos > 0x100000) {
printf("error: image should be smaller than 1 MiB\n");
exit(EXIT_FAILURE);
@@ -109,6 +105,8 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
+ pos = (pos + 3) & ~3;
+
/* image size */
temp = htobe32((uint32_t)pos);
fwrite(&temp, sizeof(uint32_t), 1, stdout);
@@ -121,7 +119,7 @@ int main(int argc, char *argv[])
size = fread(&temp, 1, sizeof(uint32_t), input);
if (!size)
break;
- if (size != 4) {
+ if (size < 4 && !feof(input)) {
perror("fread");
exit(EXIT_FAILURE);
}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-10-26 6:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-26 6:58 [PATCH] random compile fixes Sascha Hauer
2012-10-26 6:58 ` [PATCH 01/15] pbl: Add missing FORCE Sascha Hauer
2012-10-26 6:58 ` [PATCH 02/15] wd: Provide default value for watchdog timeout Sascha Hauer
2012-10-26 6:58 ` [PATCH 03/15] mtd: fix mtdraw_write/mtdraw_erase arguments Sascha Hauer
2012-10-26 6:58 ` [PATCH 04/15] ARM: let THUMB2 select EABI Sascha Hauer
2012-10-26 6:58 ` [PATCH 05/15] ARM Samsung: fix pbl build for tiny210 board Sascha Hauer
2012-10-26 6:58 ` [PATCH 06/15] ARM omap: pbl fixes Sascha Hauer
2012-10-26 6:59 ` [PATCH 07/15] ARM Samsung: Let Nand boot depend on ARCH_S3C24xx Sascha Hauer
2012-10-26 6:59 ` [PATCH 08/15] mfd stmpe: Add missing semicolons at end of EXPORT_SYMBOL Sascha Hauer
2012-10-26 6:59 ` [PATCH 09/15] misc JTAG: Let Jtag driver depend on GENERIC_GPIO Sascha Hauer
2012-10-26 6:59 ` [PATCH 10/15] mtd mxs nand: select NAND_BBT Sascha Hauer
2012-10-26 6:59 ` [PATCH 11/15] mtd nand i.MX: fix compilation for unsupported SoC Sascha Hauer
2012-10-26 6:59 ` [PATCH 12/15] of gpio: Build gpio helper only when gpiolib is selected Sascha Hauer
2012-10-26 6:59 ` [PATCH 13/15] pbl: provide hang() function for the pbl Sascha Hauer
2012-10-26 6:59 ` Sascha Hauer [this message]
2012-10-26 6:59 ` [PATCH 15/15] ARM omap spi image: print error to stderr Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1351234748-24994-15-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox