[U-Boot] [PATCH v3] add nand spl boot for qi_lb60 board

Tom Rini trini at ti.com
Tue Oct 9 18:37:35 CEST 2012


On Tue, Oct 09, 2012 at 04:28:05PM +0800, xiangfu at openmobilefree.net wrote:

> From: Xiangfu Liu <xiangfu at openmobilefree.net>
> 
>  * After create u-boot-spl.bin. it needs those 4 commands create final image for jz4740 cpu.
>   ~~~~
>   dd if=spl/u-boot-spl.bin of=u-boot-nand.bin conv=sync bs=8192 count=1
>   dd if=spl/u-boot-spl.bin of=u-boot-nand.bin conv=sync,notrunc oflag=append bs=8192 count=1
>   tr '\0' '\377' < /dev/zero | dd of=u-boot-nand.bin conv=sync,notrunc oflag=append bs=16384 count=1
>   cat u-boot-nand.bin u-boot.bin > u-boot-nand-final.bin
>   ~~~~
>   The JZ4740 CPU can load 8KB from two different addresses:
>    1. the normal area up to 8KB starting from NAND flash address 0x00000000
>    2. the backup area up to 8KB starting from NAND flash address 0x00002000
> 
> 
>  * Add software usbboot mode
>    Downloads user program from the USB port to internal
>    SRAM and branches to the internal SRAM to execute the program.
>    (JZ4740 CPU have a internal ROM have such kind of code, that make 
>     JZ4740 can boot from USB)
> ---
> v3:
>   * add simpile string.c to mips/lib
>   * some cleanup on jz4740.c
>   * move to new spl/ structure 
>   * support software usbboot mode

I'm happy you've moved to the new SPL infrastructure.  A few comments:

In general, please check for checkpatch.pl issues, I spotted a few.
Also, don't use // comments in asm, everything else in MIPS uses '#' or
'/* ... */'.  Please use 'puts' rather than 'serial_puts' directly.

[snip]
> diff --git a/arch/mips/lib/string.c b/arch/mips/lib/string.c
> new file mode 100644
> index 0000000..d59f44a
> --- /dev/null
> +++ b/arch/mips/lib/string.c
> @@ -0,0 +1,32 @@

Can you try just enabling CONFIG_SPL_LIBGENERIC_SUPPORT ?  You should
have the unused functions garbage collected automatically.

> diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c
> index 3ec34f3..4ab2229 100644
> --- a/drivers/mtd/nand/jz4740_nand.c
> +++ b/drivers/mtd/nand/jz4740_nand.c
> @@ -15,6 +15,9 @@
>  #include <asm/io.h>
>  #include <asm/jz4740.h>
>  
> +#ifdef CONFIG_SPL_BUILD
> +#define printf(arg...) do {} while (0)
> +#endif

In this case you should just switch to puts.

And a non-blocking question, have you looked at the CONFIG_SPL_FRAMEWORK
code in common/spl/ now?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121009/a1930fa2/attachment.pgp>


More information about the U-Boot mailing list