From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 28 May 2016 13:55:30 +0200 Subject: [U-Boot] [PATCH] check u-boot SPL size to avoid producing non-working images In-Reply-To: <20160528085559.GA8195@amd> References: <20160528085559.GA8195@amd> Message-ID: <57498732.9000106@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/28/2016 10:55 AM, Pavel Machek wrote: > 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 Please use CONFIG_SPL_MAX_* > 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 $@ > > -- Best regards, Marek Vasut