[U-Boot-Users] [PATCH 19/26] Remember the detected NAND size for later display

Scott Wood scottwood at freescale.com
Fri May 9 17:00:35 CEST 2008


On Thu, May 08, 2008 at 10:52:27PM +0200, Stelian Pop wrote:
> This patch adds a field in 'struct bd_info' for saving the detected
> NAND size (result of nand_init() routine). This field can be used later
> (for example in the lcd driver) to print out detailed information about
> the board memories.

Why would an LCD driver care about NAND?  If we want to make the NAND
size printable after boot, how about doing so in the nand info command?

> @@ -52,6 +52,9 @@ typedef struct bd_info {
>      /* second onboard ethernet port */
>      unsigned char   bi_enet1addr[6];
>  #endif
> +#ifdef CONFIG_CMD_NAND
> +    ulong		bi_nand_size;
> +#endif
>  } bd_t;

#ifdefs in bd_t are a nightmare to synchronize between u-boot and the
client; please don't add more.

Is the total size of NAND, rather than the size of any given NAND device,
really useful for the u-boot client?

> --- a/lib_arm/board.c
> +++ b/lib_arm/board.c
> @@ -56,7 +56,7 @@
>  DECLARE_GLOBAL_DATA_PTR;
>  
>  #if defined(CONFIG_CMD_NAND)
> -void nand_init (void);
> +ulong nand_init (void);
>  #endif

Include nand.h rather than redeclaring this.

> @@ -279,7 +279,7 @@ void start_armboot (void)
>  {
>  	init_fnc_t **init_fnc_ptr;
>  	char *s;
> -#ifndef CFG_NO_FLASH
> +#if !defined(CFG_NO_FLASH) || defined (CONFIG_VFD) || defined(CONFIG_LCD)
>  	ulong size;
>  #endif

This patch doesn't seem to introduce new uses of "size" for CONFIG_VFD or
CONFIG_LCD...  perhaps this was meant to be in another patch?

-Scott




More information about the U-Boot mailing list