[U-Boot-Users] [PATCH] mips: Call 'nand_init()' in generic board initialization when CONFIG_CMD_NAND is set

Shinya Kuribayashi skuribay at ruby.dti.ne.jp
Fri May 16 18:26:27 CEST 2008


Hi Jason,

Jason McMullan wrote:
> diff --git a/lib_mips/board.c b/lib_mips/board.c
> index 1645f2c..e33070d 100644
> --- a/lib_mips/board.c
> +++ b/lib_mips/board.c
> @@ -28,6 +28,7 @@
>  #include <version.h>
>  #include <net.h>
>  #include <environment.h>
> +#include <nand.h>

This will break build. According to the blackfin, we can't even include
<nand.h> if it's not configured.

http://git.denx.de/?p=u-boot.git;a=blob;f=lib_blackfin/board.c;h=43d8be8e21f25e37e7ade0eea86549b125775152;hb=a38dc3ea8614f8b0c41e432b445a9959b9711295#l25

# by the way, all ARCHs which need nand_init() should include <nand.h>
  in the same way as blackfin, shouldn't they?

>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -416,6 +417,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
>  	}
>  #endif
>  
> +#ifdef CONFIG_CMD_NAND
> +	puts("NAND:  ");
> +	nand_init();		/* go init the NAND */
> +#endif
> +
>  #if defined(CONFIG_MISC_INIT_R)
>  	/* miscellaneous platform dependent initialisations */
>  	misc_init_r ();

I'm not familiar with NAND, so don't know that above is a good timing to
call nand_init(). If this works for you, I'm fine ATM.

Thanks!

  Shinya




More information about the U-Boot mailing list