diff options
author | Michael Sparmann <theseven@rockbox.org> | 2011-02-09 21:45:57 +0000 |
---|---|---|
committer | Michael Sparmann <theseven@rockbox.org> | 2011-02-09 21:45:57 +0000 |
commit | 44870b7415e8fbe4aa52e55e499a6d774cc721cf (patch) | |
tree | 80d1931d8d8cbdeadf07ac17a9817caa05adb5a5 | |
parent | acf54bed55752c1d2af6e9067e84b43d278cf01a (diff) |
iPod Classic: Enable boosting by switching the CPU between 1x and 2x AHB clock
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29265 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/export/config/ipod6g.h | 5 | ||||
-rw-r--r-- | firmware/export/s5l8702.h | 20 | ||||
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/cscodec-ipod6g.c | 8 | ||||
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c | 1 | ||||
-rw-r--r-- | firmware/target/arm/s5l8702/system-s5l8702.c | 7 | ||||
-rw-r--r-- | firmware/target/arm/s5l8702/system-target.h | 5 |
6 files changed, 30 insertions, 16 deletions
diff --git a/firmware/export/config/ipod6g.h b/firmware/export/config/ipod6g.h index 16cf9afcef..6ab89e5869 100644 --- a/firmware/export/config/ipod6g.h +++ b/firmware/export/config/ipod6g.h @@ -168,10 +168,9 @@ #define HAVE_USB_CHARGING_ENABLE
/* The size of the flash ROM */
-#define FLASH_SIZE 0x400000
+#define FLASH_SIZE 0x1000000
/* Define this to the CPU frequency */
-//TODO: Figure out exact value
#define CPU_FREQ 216000000
/* define this if the hardware can be powered off while charging */
@@ -195,7 +194,7 @@ #define MAX_PHYS_SECTOR_SIZE 4096
/* Define this if you have adjustable CPU frequency */
-//TODO: #define HAVE_ADJUSTABLE_CPU_FREQ
+#define HAVE_ADJUSTABLE_CPU_FREQ
#define BOOTFILE_EXT "ipod"
#define BOOTFILE "rockbox." BOOTFILE_EXT
diff --git a/firmware/export/s5l8702.h b/firmware/export/s5l8702.h index bb3553ed14..076e661fa4 100644 --- a/firmware/export/s5l8702.h +++ b/firmware/export/s5l8702.h @@ -28,8 +28,7 @@ #define REG16_PTR_T volatile uint16_t *
#define REG32_PTR_T volatile uint32_t *
-//TODO: Figure out exact value
-#define TIMER_FREQ 216000000
+#define TIMER_FREQ 54000000
#define CACHEALIGN_BITS (4) /* 2^4 = 16 bytes */
@@ -42,8 +41,21 @@ #define TTB_SIZE 0x4000
#define TTB_BASE_ADDR (DRAM_ORIG + DRAM_SIZE - TTB_SIZE)
-/////SYSCON/////
-#define CLKCON0C (*((uint32_t volatile*)(0x3C50000C)))
+/////SYSTEM CONTROLLER/////
+#define CLKCON0 (*((volatile uint32_t*)(0x3C500000)))
+#define CLKCON1 (*((volatile uint32_t*)(0x3C500004)))
+#define CLKCON2 (*((volatile uint32_t*)(0x3C500008)))
+#define CLKCON3 (*((volatile uint32_t*)(0x3C50000C)))
+#define CLKCON4 (*((volatile uint32_t*)(0x3C500010)))
+#define CLKCON5 (*((volatile uint32_t*)(0x3C500014)))
+#define PLL0PMS (*((volatile uint32_t*)(0x3C500020)))
+#define PLL1PMS (*((volatile uint32_t*)(0x3C500024)))
+#define PLL2PMS (*((volatile uint32_t*)(0x3C500028)))
+#define PLL0LCNT (*((volatile uint32_t*)(0x3C500030)))
+#define PLL1LCNT (*((volatile uint32_t*)(0x3C500034)))
+#define PLL2LCNT (*((volatile uint32_t*)(0x3C500038)))
+#define PLLLOCK (*((volatile uint32_t*)(0x3C500040)))
+#define PLLMODE (*((volatile uint32_t*)(0x3C500044)))
#define PWRCON(i) (*((uint32_t volatile*)(0x3C500000 \
+ ((i) == 4 ? 0x6C : \
((i) == 3 ? 0x68 : \
diff --git a/firmware/target/arm/s5l8702/ipod6g/cscodec-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/cscodec-ipod6g.c index 460b254730..41531de4e3 100644 --- a/firmware/target/arm/s5l8702/ipod6g/cscodec-ipod6g.c +++ b/firmware/target/arm/s5l8702/ipod6g/cscodec-ipod6g.c @@ -53,12 +53,12 @@ void cscodec_power(bool state) void cscodec_reset(bool state) { - if (state) PDAT(3) &= ~8;
- else PDAT(3) |= 8;
+ if (state) PDAT(3) &= ~8; + else PDAT(3) |= 8; } void cscodec_clock(bool state) { - if (state) CLKCON0C &= ~0xffff;
- else CLKCON0C |= 0x8000;
+ if (state) CLKCON3 &= ~0xffff; + else CLKCON3 |= 0x8000; } diff --git a/firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c index 73d8f98083..c11c0ad416 100644 --- a/firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c +++ b/firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c @@ -79,6 +79,7 @@ int pmu_read_battery_voltage(void) /* milliamps */ int pmu_read_battery_current(void) { +//TODO: Figure out how to read the battery current // return pmu_read_adc(2); return 0; } diff --git a/firmware/target/arm/s5l8702/system-s5l8702.c b/firmware/target/arm/s5l8702/system-s5l8702.c index 6973738790..a4e82feef9 100644 --- a/firmware/target/arm/s5l8702/system-s5l8702.c +++ b/firmware/target/arm/s5l8702/system-s5l8702.c @@ -253,13 +253,16 @@ void set_cpu_frequency(long frequency) if (cpu_frequency == frequency) return; + //TODO: Need to understand this better if (frequency == CPUFREQ_MAX) { - //TODO: Figure out and implement + CLKCON0 = 0x3011; + CLKCON1 = 0x4001; } else { - //TODO: Figure out and implement + CLKCON1 = 0x404101; + CLKCON0 = 0x3000; } cpu_frequency = frequency; diff --git a/firmware/target/arm/s5l8702/system-target.h b/firmware/target/arm/s5l8702/system-target.h index ed48eba6c4..30e53ad6ea 100644 --- a/firmware/target/arm/s5l8702/system-target.h +++ b/firmware/target/arm/s5l8702/system-target.h @@ -24,11 +24,10 @@ #include "system-arm.h"
#include "mmu-arm.h"
-//TODO: Figure out exact values
#define CPUFREQ_SLEEP 32768
#define CPUFREQ_MAX 216000000
-#define CPUFREQ_DEFAULT 216000000
-#define CPUFREQ_NORMAL 216000000
+#define CPUFREQ_DEFAULT 108000000
+#define CPUFREQ_NORMAL 108000000
#define STORAGE_WANTS_ALIGN
|