nds32: fix code/data will be corrupted on ram in rum time
PATCH 1/1 nds32: fix code/data will be corrupted on ram in rum time
From: rick <[email protected]>
can not execute get_ram_size(), because the
text/data will be corrupted by itself
in specific case.
Signed-off-by rick <[email protected]>
Cc Andes <[email protected]>
--- board/AndesTech/adp-ag101p/adp-ag101p.c | 18 +++++++----------- 1 files changed, 7 insertions(+), 11 deletions(-)
board/AndesTech/adp-ag101p/adp-ag101p.c +7 -11
@@ -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 ; }
Signature · 1 line
1.7.6
PATCH 1/1 nds32: fix code/data will be corrupted on ram in rum time
Dear Andes,
Quoted 5 lines · In message <[email protected]> you wrote:
From: rick <[email protected]>
can not execute
get_ram_size(), because the
text/data will be corrupted by itself
in specific case.
You must be doing something wrong then. Of course you have to run get_ram_size() _before_ relocation to RAM. You cannot test the memory you are executing from.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Q: How do you spell "onomatopoeia"? A: The way it sounds.