diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2006-02-02 23:07:11 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2006-02-02 23:07:11 +0000 |
commit | 9b0822d76a6f2f2dd1e28cef4a525d0fb752278e (patch) | |
tree | 6d6a4c7dd049256f645184ae3f1f3842b9b1f867 /firmware/drivers | |
parent | 3495e757194dfefaf56325365004193289be2224 (diff) |
Make it compile on iAudio X5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8543 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-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 @@ #define SECTOR_SIZE (512) -#if CONFIG_CPU == MCF5249 +#if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250) /* don't use sh7034 assembler routines */ #define PREFER_C_READING @@ -1098,12 +1098,14 @@ int ata_hard_reset(void) /* state HRR1 */ or_b(0x02, &PADRH); /* negate _RESET */ sleep(1); /* > 2ms */ -#elif CONFIG_CPU == MCF5249 +#elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) and_l(~0x00080000, &GPIO_OUT); sleep(1); /* > 25us */ or_l(0x00080000, &GPIO_OUT); sleep(1); /* > 25us */ +#elif defined(IAUDIO_X5) + /* X5 TODO */ #elif CONFIG_CPU == TCC730 P6 &= ~0x40; @@ -1239,7 +1241,7 @@ void ata_enable(bool on) or_b(0x80, &PADRL); /* disable ATA */ or_b(0x80, &PAIORL); -#elif CONFIG_CPU == MCF5249 +#elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) if(on) and_l(~0x0040000, &GPIO_OUT); else @@ -1247,6 +1249,9 @@ void ata_enable(bool on) or_l(0x00040000, &GPIO_ENABLE); or_l(0x00040000, &GPIO_FUNCTION); +#elif defined(IAUDIO_X5) + /* X5 TODO */ + (void)on; #elif CONFIG_CPU == TCC730 #elif CONFIG_CPU == PP5020 @@ -1400,8 +1405,11 @@ int ata_init(void) int rc; #if CONFIG_CPU == TCC730 bool coldstart = (P1 & 0x80) == 0; -#elif CONFIG_CPU == MCF5249 +#elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) bool coldstart = (GPIO_FUNCTION & 0x00080000) == 0; +#elif defined(IAUDIO_X5) + /* X5 TODO */ + bool coldstart = true; #elif CONFIG_CPU == PP5020 bool coldstart = false; /* 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) return (GPIO1_READ & 0x00400000) || usb_powered(); #elif defined(GMINI_ARCH) return (P7 & 0x80) == 0; +#elif defined(IAUDIO_X5) + return (GPIO1_READ & 0x01000000)?true:false; #elif defined(HAVE_CHARGE_CTRL) /* Recorder */ return adc_read(ADC_EXT_POWER) > 0x100; @@ -172,11 +174,13 @@ void ide_power_enable(bool on) { (void)on; -#if CONFIG_CPU == MCF5249 +#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) if(on) and_l(~0x80000000, &GPIO_OUT); else or_l(0x80000000, &GPIO_OUT); +#elif defined(IAUDIO_X5) + /* X5 TODO */ #elif CONFIG_CPU == PP5020 /* We do nothing on the iPod */ #elif defined(GMINI_ARCH) @@ -229,8 +233,10 @@ void ide_power_enable(bool on) bool ide_powered(void) { -#if CONFIG_CPU == MCF5249 +#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) return (GPIO_OUT & 0x80000000)?false:true; +#elif defined(IAUDIO_X5) + return false; /* X5 TODO */ #elif CONFIG_CPU == PP5020 /* pretend we are always powered - we don't turn it off on the ipod */ return true; @@ -263,8 +269,10 @@ bool ide_powered(void) void power_off(void) { set_irq_level(HIGHEST_IRQ_LEVEL); -#if CONFIG_CPU == MCF5249 +#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) and_l(~0x00080000, &GPIO1_OUT); +#elif defined(IAUDIO_X5) + and_l(~0x00000008, &GPIO_OUT); #elif CONFIG_CPU == PP5020 #ifndef BOOTLOADER /* We don't turn off the ipod, we put it in a deep sleep */ |