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/system-pp502x.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'firmware/target/arm/system-pp502x.c') diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c index 9bedb0e42c..700686b427 100644 --- a/firmware/target/arm/system-pp502x.c +++ b/firmware/target/arm/system-pp502x.c @@ -42,6 +42,10 @@ extern void SERIAL0(void); static struct corelock cpufreq_cl SHAREDBSS_ATTR; #endif +#if defined(IPOD_VIDEO) && !defined(BOOTLOADER) +unsigned char probed_ramsize; +#endif + void __attribute__((interrupt("IRQ"))) irq_handler(void) { if(CURRENT_CORE == CPU) @@ -518,6 +522,13 @@ void system_init(void) #else pp_set_cpu_frequency(CPUFREQ_MAX); #endif + +#if defined(IPOD_VIDEO) + /* crt0-pp.S wrote the ram size to the last byte of the first 32MB + ram bank. See the comment there for how we determine it. */ + volatile unsigned char *end32 = (volatile unsigned char *)0x01ffffff; + probed_ramsize = *end32; +#endif } init_cache(); -- cgit v1.2.3