From 02a53fd809b46ef60555c55d550e6754c46c4c69 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Sat, 13 Jun 2009 23:52:13 +0000 Subject: Sansa AMS: add a comment in sdram_init(), and use inline asm to set the SDRAM mode register git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21282 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/system-as3525.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'firmware/target/arm/as3525/system-as3525.c') diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 60fe7032e6..ecb9736f78 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c @@ -209,9 +209,11 @@ static void sdram_init(void) MPMC_DYNAMIC_CONTROL = 0x82; /* SDRAM MODE, MPMCCLKOUT runs continuously */ - /* this part is required, if you know why please explain */ - unsigned int tmp = *(volatile unsigned int*)(0x30000000+0x2300*MEM); - (void)tmp; /* we just need to read from this location */ + /* program the SDRAM mode register */ + /* FIXME: details the exact settings of mode register */ + asm volatile( + "ldr r4, [%0]\n" + : : "p"(0x30000000+0x2300*MEM) : "r4"); MPMC_DYNAMIC_CONTROL = 0x2; /* SDRAM NORMAL, MPMCCLKOUT runs continuously */ -- cgit v1.2.3