[U-Boot-Users] [PATCH 13/21] Remeber the RAM and NAND detected sizes for later display

Stelian Pop stelian at popies.net
Tue May 6 17:33:35 CEST 2008


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

diff --git a/include/asm-arm/u-boot.h b/include/asm-arm/u-boot.h
index c120312..dbfe2cf 100644
--- a/include/asm-arm/u-boot.h
+++ b/include/asm-arm/u-boot.h
@@ -48,10 +48,14 @@ typedef struct bd_info {
 	ulong start;
 	ulong size;
     } 			bi_dram[CONFIG_NR_DRAM_BANKS];
+    ulong		bi_dram_size;
 #ifdef CONFIG_HAS_ETH1
     /* 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..0752877 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)
@@ -187,21 +187,23 @@ static int display_dram_config (void)
 {
 	int i;
 
+	gd->bd->bi_dram_size = 0;
+
 #ifdef DEBUG
 	puts ("RAM Configuration:\n");
 
 	for(i=0; i<CONFIG_NR_DRAM_BANKS; i++) {
 		printf ("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start);
 		print_size (gd->bd->bi_dram[i].size, "\n");
+		gd->bd->bi_dram_size += gd->bd->bi_dram[i].size;
 	}
 #else
-	ulong size = 0;
 
 	for (i=0; i<CONFIG_NR_DRAM_BANKS; i++) {
-		size += gd->bd->bi_dram[i].size;
+		gd->bd->bi_dram_size += gd->bd->bi_dram[i].size;
 	}
 	puts("DRAM:  ");
-	print_size(size, "\n");
+	print_size(gd->bd->bi_dram_size, "\n");
 #endif
 
 	return (0);
@@ -279,7 +281,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 +342,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