All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] spl: spl_nand.c: Add NAND loading message
@ 2019-03-19 15:55 Stefan Roese
  2019-03-20 13:45 ` Tom Rini
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Roese @ 2019-03-19 15:55 UTC (permalink / raw)
  To: u-boot

This patch adds a short message to the SPL NAND loader, which displays
the source and destinations addresses including the size of the
loaded image, like this:

U-Boot SPL 2019.04-rc3-00113-g486efd8aaf (Mar 15 2019 - 14:18:02 +0100)
Trying to boot from NAND
Loading U-Boot from 0x00040000 (size 0x000a0000) to 0x22900000

I find this message quite helpful - hopefully others do so as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@konsulko.com>
---
 common/spl/spl_nand.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index 6eb190f1ea..47eaddc002 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -17,6 +17,11 @@ static int spl_nand_load_image(struct spl_image_info *spl_image,
 {
 	nand_init();
 
+#if defined(CONFIG_SPL_SERIAL_SUPPORT)
+	printf("Loading U-Boot from 0x%08x (size 0x%08x) to 0x%08x\n",
+	       CONFIG_SYS_NAND_U_BOOT_OFFS, CONFIG_SYS_NAND_U_BOOT_SIZE,
+	       CONFIG_SYS_NAND_U_BOOT_DST);
+#endif
 	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
 			    CONFIG_SYS_NAND_U_BOOT_SIZE,
 			    (void *)CONFIG_SYS_NAND_U_BOOT_DST);
-- 
2.21.0

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

* [U-Boot] [PATCH] spl: spl_nand.c: Add NAND loading message
  2019-03-19 15:55 [U-Boot] [PATCH] spl: spl_nand.c: Add NAND loading message Stefan Roese
@ 2019-03-20 13:45 ` Tom Rini
  2019-03-21  7:16   ` Stefan Roese
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Rini @ 2019-03-20 13:45 UTC (permalink / raw)
  To: u-boot

On Tue, Mar 19, 2019 at 04:55:40PM +0100, Stefan Roese wrote:

> This patch adds a short message to the SPL NAND loader, which displays
> the source and destinations addresses including the size of the
> loaded image, like this:
> 
> U-Boot SPL 2019.04-rc3-00113-g486efd8aaf (Mar 15 2019 - 14:18:02 +0100)
> Trying to boot from NAND
> Loading U-Boot from 0x00040000 (size 0x000a0000) to 0x22900000
> 
> I find this message quite helpful - hopefully others do so as well.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Tom Rini <trini@konsulko.com>
> ---
>  common/spl/spl_nand.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
> index 6eb190f1ea..47eaddc002 100644
> --- a/common/spl/spl_nand.c
> +++ b/common/spl/spl_nand.c
> @@ -17,6 +17,11 @@ static int spl_nand_load_image(struct spl_image_info *spl_image,
>  {
>  	nand_init();
>  
> +#if defined(CONFIG_SPL_SERIAL_SUPPORT)
> +	printf("Loading U-Boot from 0x%08x (size 0x%08x) to 0x%08x\n",
> +	       CONFIG_SYS_NAND_U_BOOT_OFFS, CONFIG_SYS_NAND_U_BOOT_SIZE,
> +	       CONFIG_SYS_NAND_U_BOOT_DST);
> +#endif
>  	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
>  			    CONFIG_SYS_NAND_U_BOOT_SIZE,
>  			    (void *)CONFIG_SYS_NAND_U_BOOT_DST);

Can we do it as debug() ?  We're always super sensitive to size growth
in SPL.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190320/5e3dc339/attachment.sig>

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

* [U-Boot] [PATCH] spl: spl_nand.c: Add NAND loading message
  2019-03-20 13:45 ` Tom Rini
@ 2019-03-21  7:16   ` Stefan Roese
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2019-03-21  7:16 UTC (permalink / raw)
  To: u-boot

On 20.03.19 14:45, Tom Rini wrote:
> On Tue, Mar 19, 2019 at 04:55:40PM +0100, Stefan Roese wrote:
> 
>> This patch adds a short message to the SPL NAND loader, which displays
>> the source and destinations addresses including the size of the
>> loaded image, like this:
>>
>> U-Boot SPL 2019.04-rc3-00113-g486efd8aaf (Mar 15 2019 - 14:18:02 +0100)
>> Trying to boot from NAND
>> Loading U-Boot from 0x00040000 (size 0x000a0000) to 0x22900000
>>
>> I find this message quite helpful - hopefully others do so as well.
>>
>> Signed-off-by: Stefan Roese <sr@denx.de>
>> Cc: Heiko Schocher <hs@denx.de>
>> Cc: Tom Rini <trini@konsulko.com>
>> ---
>>   common/spl/spl_nand.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
>> index 6eb190f1ea..47eaddc002 100644
>> --- a/common/spl/spl_nand.c
>> +++ b/common/spl/spl_nand.c
>> @@ -17,6 +17,11 @@ static int spl_nand_load_image(struct spl_image_info *spl_image,
>>   {
>>   	nand_init();
>>   
>> +#if defined(CONFIG_SPL_SERIAL_SUPPORT)
>> +	printf("Loading U-Boot from 0x%08x (size 0x%08x) to 0x%08x\n",
>> +	       CONFIG_SYS_NAND_U_BOOT_OFFS, CONFIG_SYS_NAND_U_BOOT_SIZE,
>> +	       CONFIG_SYS_NAND_U_BOOT_DST);
>> +#endif
>>   	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
>>   			    CONFIG_SYS_NAND_U_BOOT_SIZE,
>>   			    (void *)CONFIG_SYS_NAND_U_BOOT_DST);
> 
> Can we do it as debug() ?  We're always super sensitive to size growth
> in SPL.

I know that we have pretty tight constraints here in SPL. But I really
think that SPL does not need to be "that silent" without printing
any infos about the status (whats loaded to where etc). I'm using
this right now on an AT91SAM platform with 32KiB of internal SRAM.
On such platforms these few bytes should be okay. Thats definitely
different on 4KiB SRAM platforms. Here SPL_SERIAL_SUPPORT will be
disabled most likely. So all SPL printf's will be removed from the
image.

In summary: I would like to keep it as a normal printf since a debug
will usually not be enabled and therefore not visible to the user.

BTW: I'll send a v2 of this patch soon, which will remove the #if
completely. As mentioned above, with CONFIG_SPL_SERIAL_SUPPORT disabled
all printf's are removed automatically.

Thanks,
Stefan

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

end of thread, other threads:[~2019-03-21  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 15:55 [U-Boot] [PATCH] spl: spl_nand.c: Add NAND loading message Stefan Roese
2019-03-20 13:45 ` Tom Rini
2019-03-21  7:16   ` Stefan Roese

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.