From 8aa175bc1fd303bccd491fc92689f29bdf439094 Mon Sep 17 00:00:00 2001 From: Torne Wuff Date: Sun, 29 Aug 2010 13:20:16 +0000 Subject: ipodvideo: detect ram size at boot (doesn't actually get USED yet) This is the first step to allowing a single build which will work on any ipodvideo. A global variable, probed_ramsize, is initialised to either 32 or 64 early in boot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27937 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/crt0-pp.S | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'firmware/target/arm/crt0-pp.S') diff --git a/firmware/target/arm/crt0-pp.S b/firmware/target/arm/crt0-pp.S index ee95ac8899..585455f821 100644 --- a/firmware/target/arm/crt0-pp.S +++ b/firmware/target/arm/crt0-pp.S @@ -137,6 +137,24 @@ pad_skip: mov r1, #0 str r1, [r2] +#if defined(IPOD_VIDEO) + /* detect 32mb vs 64mb model */ + /* we do this here because after SDRAM is remapped, we already assumed */ + /* its size to be whatever we were compiled for. */ + + mov r2, #0x12000000 + mov r3, #64 + strb r3, [r2, #-1] /* first write 64 to last byte of first 32MB bank */ + + mov r2, #0x14000000 + mov r3, #32 + strb r3, [r2, #-1] /* now write 32 to last byte of second 32MB bank */ + + /* now the last word of the first 32MB bank tells you the RAM size */ + /* since on a 32MB model both writes will touch the same actual location */ + /* this is read later on in boot */ +#endif + mov r2, #0x40000000 ldr r3, =remap_start ldr r4, =remap_end -- cgit