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

Stelian Pop stelian at popies.net
Thu May 8 22:52:27 CEST 2008


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.

Signed-off-by: Stelian Pop <stelian at popies.net>
---
 include/asm-arm/u-boot.h |    3 +++
 lib_arm/board.c          |    6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/asm-arm/u-boot.h b/include/asm-arm/u-boot.h
index c120312..1a74b7a 100644
--- a/include/asm-arm/u-boot.h
+++ b/include/asm-arm/u-boot.h
@@ -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;
 
 #define bi_env_data bi_env->data
diff --git a/lib_arm/board.c b/lib_arm/board.c
index 67506b3..5ee5bd4 100644
--- 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
 
 #if defined(CONFIG_CMD_ONENAND)
@@ -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
 #if defined(CONFIG_VFD) || defined(CONFIG_LCD)
@@ -340,7 +340,7 @@ void start_armboot (void)
 
 #if defined(CONFIG_CMD_NAND)
 	puts ("NAND:  ");
-	nand_init();		/* go init the NAND */
+	gd->bd->bi_nand_size = nand_init();	/* go init the NAND */
 #endif
 
 #if defined(CONFIG_CMD_ONENAND)
-- 
1.5.3.3





More information about the U-Boot mailing list