[U-Boot] [PATCH v11 5/9] nds32/lib: add generic funcs in NDS32 lib

Mike Frysinger vapier at gentoo.org
Thu Sep 1 16:28:17 CEST 2011


On Thursday, September 01, 2011 01:52:46 Macpaul Lin wrote:
> --- /dev/null
> +++ b/arch/nds32/config.mk
>
> +LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds

the top level logic tries hard to find a good LDSCRIPT default.  do you need 
to set this yourself anymore ?

> --- /dev/null
> +++ b/arch/nds32/lib/board.c
>
> +extern ulong __bss_end;

if this is coming from the linker script, then it should be:
extern char __bss_end[];

> +#ifndef CONFIG_IDENT_STRING
> +#define CONFIG_IDENT_STRING ""
> +#endif
> +
> +const char version_string[] =
> +	U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;

pretty sure you dont need this anymore as common/cmd_version.c takes care of 
it.  so just delete this code.

> +void board_init_f(ulong bootflag)
> +{
> ...
> +	/* Pointer is writable since we allocated a register for it */
> +	gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR) & ~0x07);
> +
> +	/* compiler optimization barrier needed for GCC >= 3.4 */
> +	__asm__ __volatile__("" : : : "memory");
> +
> +	memset((void *)gd, 0, sizeof(gd_t));

err, is that barrier really needed ?  sounds like a bug in your compiler.

as for the memset, it should be:
memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);

> +	addr_sp -= sizeof(bd_t);

sizeof(bd_t) -> GENERATED_BD_INFO_SIZE

this shows up multiple times

also, did i miss something, or do you not zero out your board info ?

> +	addr_sp -= sizeof(gd_t);

sizeof(gd_t) -> GENERATED_GBL_DATA_SIZE

this shows up multiple times
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110901/a9507364/attachment.pgp 


More information about the U-Boot mailing list