public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] check u-boot SPL size to avoid producing non-working images
Date: Sat, 28 May 2016 10:55:59 +0200	[thread overview]
Message-ID: <20160528085559.GA8195@amd> (raw)

Debugging SPL is hard, and if SPL is too big, it tends to crash in
mysterious ways.

(I'm not sure what the exact threshold is, 49762 bytes works, 52426
bytes does not, so 50000 should be good value).

Signed-off-by: Pavel Machek <pavel@denx.de>

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 6d2017d..504f0d2 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -237,6 +237,7 @@ endif
 
 MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage
 $(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE
+	@if test `stat -c%s $(obj)/$(SPL_BIN).bin` -gt 50000; then echo `stat -c%s $(obj)/$(SPL_BIN).bin` is too big, it probably will not work; exit 1; fi
 	$(call if_changed,mkimage)
 
 quiet_cmd_mksunxiboot = MKSUNXI $@


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

             reply	other threads:[~2016-05-28  8:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-28  8:55 Pavel Machek [this message]
2016-05-28 11:55 ` [U-Boot] [PATCH] check u-boot SPL size to avoid producing non-working images Marek Vasut
2016-05-28 19:41   ` [U-Boot] [PATCHv2] " Pavel Machek
2016-05-30 20:10     ` Wolfgang Denk

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=20160528085559.GA8195@amd \
    --to=pavel@denx.de \
    --cc=u-boot@lists.denx.de \
    /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