All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] check u-boot SPL size to avoid producing non-working images
@ 2016-05-28  8:55 Pavel Machek
  2016-05-28 11:55 ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2016-05-28  8:55 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] check u-boot SPL size to avoid producing non-working images
  2016-05-28  8:55 [U-Boot] [PATCH] check u-boot SPL size to avoid producing non-working images Pavel Machek
@ 2016-05-28 11:55 ` Marek Vasut
  2016-05-28 19:41   ` [U-Boot] [PATCHv2] " Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2016-05-28 11:55 UTC (permalink / raw)
  To: u-boot

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 <pavel@denx.de>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCHv2] check u-boot SPL size to avoid producing non-working images
  2016-05-28 11:55 ` Marek Vasut
@ 2016-05-28 19:41   ` Pavel Machek
  2016-05-30 20:10     ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2016-05-28 19:41 UTC (permalink / raw)
  To: u-boot

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>

---

> Please use CONFIG_SPL_MAX_*

Ok, that's simple enough. It computes the size different way, thus the
different number.

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index f657766..c82da96 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -323,7 +332,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_RAM_DEVICE
 #define CONFIG_SPL_TEXT_BASE		CONFIG_SYS_INIT_RAM_ADDR
-#define CONFIG_SPL_MAX_SIZE		(64 * 1024)
+#define CONFIG_SPL_MAX_SIZE		(48 * 1024)
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_MALLOC_SIMPLE
 #endif

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCHv2] check u-boot SPL size to avoid producing non-working images
  2016-05-28 19:41   ` [U-Boot] [PATCHv2] " Pavel Machek
@ 2016-05-30 20:10     ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2016-05-30 20:10 UTC (permalink / raw)
  To: u-boot

Dear Pavel,

In message <20160528194124.GA27144@amd> you 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).

Can you please make clear in the subject (or at least in the commit
message) that this change is only related to SoCFPGA systems? Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Beware of the Turing Tar-pit in  which  everything  is  possible  but
nothing of interest is easy.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-30 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-28  8:55 [U-Boot] [PATCH] check u-boot SPL size to avoid producing non-working images Pavel Machek
2016-05-28 11:55 ` Marek Vasut
2016-05-28 19:41   ` [U-Boot] [PATCHv2] " Pavel Machek
2016-05-30 20:10     ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.