[U-Boot] [PATCH] nds32: fix code/data will be corrupted on ram in rum time

Andes uboot at andestech.com
Thu Feb 6 09:38:48 CET 2014


From: rick <rick at andestech.com>

can not execute get_ram_size(), because the
text/data will be corrupted by itself
in specific case.

Signed-off-by: rick <rick at andestech.com>
Cc: Andes <uboot at andestech.com>
---
 board/AndesTech/adp-ag101p/adp-ag101p.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/board/AndesTech/adp-ag101p/adp-ag101p.c b/board/AndesTech/adp-ag101p/adp-ag101p.c
index dd8a6653..9866431 100644
--- a/board/AndesTech/adp-ag101p/adp-ag101p.c
+++ b/board/AndesTech/adp-ag101p/adp-ag101p.c
@@ -34,18 +34,14 @@ int board_init(void)
 
 int dram_init(void)
 {
-	unsigned long sdram_base = PHYS_SDRAM_0;
-	unsigned long expected_size = PHYS_SDRAM_0_SIZE + PHYS_SDRAM_1_SIZE;
-	unsigned long actual_size;
-
-	actual_size = get_ram_size((void *)sdram_base, expected_size);
-
-	gd->ram_size = actual_size;
+	/*
+	 * can not execute get_ram_size(), because the
+	 * text will be corrupted by itself
+	 * in specific case
+	 */
 
-	if (expected_size != actual_size) {
-		printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
-				actual_size >> 20, expected_size >> 20);
-	}
+	unsigned long expected_size = PHYS_SDRAM_0_SIZE + PHYS_SDRAM_1_SIZE;
+	gd->ram_size = expected_size;
 
 	return 0;
 }
-- 
1.7.6



More information about the U-Boot mailing list