diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/ipod/power-ipod.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/firmware/target/arm/ipod/power-ipod.c b/firmware/target/arm/ipod/power-ipod.c index 14c8bf21e1..4266aad896 100644 --- a/firmware/target/arm/ipod/power-ipod.c +++ b/firmware/target/arm/ipod/power-ipod.c | |||
@@ -29,9 +29,6 @@ | |||
29 | #include "usb.h" | 29 | #include "usb.h" |
30 | #include "lcd.h" | 30 | #include "lcd.h" |
31 | #include "string.h" | 31 | #include "string.h" |
32 | #if CONFIG_CPU == PP5022 || CONFIG_CPU == PP5020 | ||
33 | #include "rtc.h" | ||
34 | #endif | ||
35 | 32 | ||
36 | void power_init(void) | 33 | void power_init(void) |
37 | { | 34 | { |
@@ -167,26 +164,20 @@ void power_off(void) | |||
167 | #endif | 164 | #endif |
168 | 165 | ||
169 | #ifndef BOOTLOADER | 166 | #ifndef BOOTLOADER |
170 | #if CONFIG_CPU == PP5022 || CONFIG_CPU == PP5020 | 167 | #ifdef IPOD_1G2G |
171 | /* When shut down by OF, wakeup via alarm is enabled. This resets the | ||
172 | alarm time so an unintended wakeup does not occur. */ | ||
173 | if (!(pcf50605_wakeup_flags & 0x10)) | ||
174 | rtc_enable_alarm(false); | ||
175 | #endif | ||
176 | #if defined(IPOD_1G2G) | ||
177 | /* we cannot turn off the 1st gen/ 2nd gen yet. Need to figure out sleep mode. */ | 168 | /* we cannot turn off the 1st gen/ 2nd gen yet. Need to figure out sleep mode. */ |
178 | system_reboot(); | 169 | system_reboot(); |
179 | #elif CONFIG_CPU == PP5022 | ||
180 | /* The OF in flash assumes boot failed because the battery is low. | ||
181 | If there is no charger connected, this leads to a shutdown. | ||
182 | */ | ||
183 | memcpy((void *)(0x4001ff00+8), "booting!", 8); | ||
184 | system_reboot(); | ||
185 | #elif CONFIG_CPU == PP5020 | ||
186 | memcpy((void *)(0x40017f00+8), "booting!", 8); | ||
187 | system_reboot(); | ||
188 | #else | 170 | #else |
189 | /* We don't turn off the ipod, we put it in a deep sleep */ | 171 | /* We don't turn off the ipod, we put it in a deep sleep */ |
172 | /* Clear latter part of iram (the part used by plugins/codecs) to ensure | ||
173 | * that the OF behaves properly on boot. There is some kind of boot | ||
174 | * failure flag there which otherwise may not be cleared. | ||
175 | */ | ||
176 | #if CONFIG_CPU == PP5022 | ||
177 | memset((void*)0x4000c000, 0, 0x14000); | ||
178 | #elif CONFIG_CPU == PP5020 | ||
179 | memset((void*)0x4000c000, 0, 0xc000); | ||
180 | #endif | ||
190 | pcf50605_standby_mode(); | 181 | pcf50605_standby_mode(); |
191 | #endif | 182 | #endif |
192 | #endif | 183 | #endif |