diff options
-rw-r--r-- | firmware/drivers/ata.c | 16 | ||||
-rw-r--r-- | firmware/drivers/power.c | 14 |
2 files changed, 23 insertions, 7 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 5c1a19ea8e..3c79c1be8f 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | #define SECTOR_SIZE (512) | 33 | #define SECTOR_SIZE (512) |
34 | 34 | ||
35 | #if CONFIG_CPU == MCF5249 | 35 | #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250) |
36 | 36 | ||
37 | /* don't use sh7034 assembler routines */ | 37 | /* don't use sh7034 assembler routines */ |
38 | #define PREFER_C_READING | 38 | #define PREFER_C_READING |
@@ -1098,12 +1098,14 @@ int ata_hard_reset(void) | |||
1098 | /* state HRR1 */ | 1098 | /* state HRR1 */ |
1099 | or_b(0x02, &PADRH); /* negate _RESET */ | 1099 | or_b(0x02, &PADRH); /* negate _RESET */ |
1100 | sleep(1); /* > 2ms */ | 1100 | sleep(1); /* > 2ms */ |
1101 | #elif CONFIG_CPU == MCF5249 | 1101 | #elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) |
1102 | and_l(~0x00080000, &GPIO_OUT); | 1102 | and_l(~0x00080000, &GPIO_OUT); |
1103 | sleep(1); /* > 25us */ | 1103 | sleep(1); /* > 25us */ |
1104 | 1104 | ||
1105 | or_l(0x00080000, &GPIO_OUT); | 1105 | or_l(0x00080000, &GPIO_OUT); |
1106 | sleep(1); /* > 25us */ | 1106 | sleep(1); /* > 25us */ |
1107 | #elif defined(IAUDIO_X5) | ||
1108 | /* X5 TODO */ | ||
1107 | #elif CONFIG_CPU == TCC730 | 1109 | #elif CONFIG_CPU == TCC730 |
1108 | 1110 | ||
1109 | P6 &= ~0x40; | 1111 | P6 &= ~0x40; |
@@ -1239,7 +1241,7 @@ void ata_enable(bool on) | |||
1239 | or_b(0x80, &PADRL); /* disable ATA */ | 1241 | or_b(0x80, &PADRL); /* disable ATA */ |
1240 | 1242 | ||
1241 | or_b(0x80, &PAIORL); | 1243 | or_b(0x80, &PAIORL); |
1242 | #elif CONFIG_CPU == MCF5249 | 1244 | #elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) |
1243 | if(on) | 1245 | if(on) |
1244 | and_l(~0x0040000, &GPIO_OUT); | 1246 | and_l(~0x0040000, &GPIO_OUT); |
1245 | else | 1247 | else |
@@ -1247,6 +1249,9 @@ void ata_enable(bool on) | |||
1247 | 1249 | ||
1248 | or_l(0x00040000, &GPIO_ENABLE); | 1250 | or_l(0x00040000, &GPIO_ENABLE); |
1249 | or_l(0x00040000, &GPIO_FUNCTION); | 1251 | or_l(0x00040000, &GPIO_FUNCTION); |
1252 | #elif defined(IAUDIO_X5) | ||
1253 | /* X5 TODO */ | ||
1254 | (void)on; | ||
1250 | #elif CONFIG_CPU == TCC730 | 1255 | #elif CONFIG_CPU == TCC730 |
1251 | 1256 | ||
1252 | #elif CONFIG_CPU == PP5020 | 1257 | #elif CONFIG_CPU == PP5020 |
@@ -1400,8 +1405,11 @@ int ata_init(void) | |||
1400 | int rc; | 1405 | int rc; |
1401 | #if CONFIG_CPU == TCC730 | 1406 | #if CONFIG_CPU == TCC730 |
1402 | bool coldstart = (P1 & 0x80) == 0; | 1407 | bool coldstart = (P1 & 0x80) == 0; |
1403 | #elif CONFIG_CPU == MCF5249 | 1408 | #elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) |
1404 | bool coldstart = (GPIO_FUNCTION & 0x00080000) == 0; | 1409 | bool coldstart = (GPIO_FUNCTION & 0x00080000) == 0; |
1410 | #elif defined(IAUDIO_X5) | ||
1411 | /* X5 TODO */ | ||
1412 | bool coldstart = true; | ||
1405 | #elif CONFIG_CPU == PP5020 | 1413 | #elif CONFIG_CPU == PP5020 |
1406 | bool coldstart = false; | 1414 | bool coldstart = false; |
1407 | /* TODO: Implement coldstart variable */ | 1415 | /* TODO: Implement coldstart variable */ |
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c index eda9d17796..e91d8a25cc 100644 --- a/firmware/drivers/power.c +++ b/firmware/drivers/power.c | |||
@@ -114,6 +114,8 @@ bool charger_inserted(void) | |||
114 | return (GPIO1_READ & 0x00400000) || usb_powered(); | 114 | return (GPIO1_READ & 0x00400000) || usb_powered(); |
115 | #elif defined(GMINI_ARCH) | 115 | #elif defined(GMINI_ARCH) |
116 | return (P7 & 0x80) == 0; | 116 | return (P7 & 0x80) == 0; |
117 | #elif defined(IAUDIO_X5) | ||
118 | return (GPIO1_READ & 0x01000000)?true:false; | ||
117 | #elif defined(HAVE_CHARGE_CTRL) | 119 | #elif defined(HAVE_CHARGE_CTRL) |
118 | /* Recorder */ | 120 | /* Recorder */ |
119 | return adc_read(ADC_EXT_POWER) > 0x100; | 121 | return adc_read(ADC_EXT_POWER) > 0x100; |
@@ -172,11 +174,13 @@ void ide_power_enable(bool on) | |||
172 | { | 174 | { |
173 | (void)on; | 175 | (void)on; |
174 | 176 | ||
175 | #if CONFIG_CPU == MCF5249 | 177 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) |
176 | if(on) | 178 | if(on) |
177 | and_l(~0x80000000, &GPIO_OUT); | 179 | and_l(~0x80000000, &GPIO_OUT); |
178 | else | 180 | else |
179 | or_l(0x80000000, &GPIO_OUT); | 181 | or_l(0x80000000, &GPIO_OUT); |
182 | #elif defined(IAUDIO_X5) | ||
183 | /* X5 TODO */ | ||
180 | #elif CONFIG_CPU == PP5020 | 184 | #elif CONFIG_CPU == PP5020 |
181 | /* We do nothing on the iPod */ | 185 | /* We do nothing on the iPod */ |
182 | #elif defined(GMINI_ARCH) | 186 | #elif defined(GMINI_ARCH) |
@@ -229,8 +233,10 @@ void ide_power_enable(bool on) | |||
229 | 233 | ||
230 | bool ide_powered(void) | 234 | bool ide_powered(void) |
231 | { | 235 | { |
232 | #if CONFIG_CPU == MCF5249 | 236 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) |
233 | return (GPIO_OUT & 0x80000000)?false:true; | 237 | return (GPIO_OUT & 0x80000000)?false:true; |
238 | #elif defined(IAUDIO_X5) | ||
239 | return false; /* X5 TODO */ | ||
234 | #elif CONFIG_CPU == PP5020 | 240 | #elif CONFIG_CPU == PP5020 |
235 | /* pretend we are always powered - we don't turn it off on the ipod */ | 241 | /* pretend we are always powered - we don't turn it off on the ipod */ |
236 | return true; | 242 | return true; |
@@ -263,8 +269,10 @@ bool ide_powered(void) | |||
263 | void power_off(void) | 269 | void power_off(void) |
264 | { | 270 | { |
265 | set_irq_level(HIGHEST_IRQ_LEVEL); | 271 | set_irq_level(HIGHEST_IRQ_LEVEL); |
266 | #if CONFIG_CPU == MCF5249 | 272 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) |
267 | and_l(~0x00080000, &GPIO1_OUT); | 273 | and_l(~0x00080000, &GPIO1_OUT); |
274 | #elif defined(IAUDIO_X5) | ||
275 | and_l(~0x00000008, &GPIO_OUT); | ||
268 | #elif CONFIG_CPU == PP5020 | 276 | #elif CONFIG_CPU == PP5020 |
269 | #ifndef BOOTLOADER | 277 | #ifndef BOOTLOADER |
270 | /* We don't turn off the ipod, we put it in a deep sleep */ | 278 | /* We don't turn off the ipod, we put it in a deep sleep */ |