summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/ata.c8
-rw-r--r--firmware/drivers/i2c-coldfire.c3
-rw-r--r--firmware/drivers/power.c14
3 files changed, 16 insertions, 9 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 9cc49c1731..c0799f30e4 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -1413,16 +1413,20 @@ int ata_init(void)
1413 or_b(0x02, &PADRH); /* release ATA reset */ 1413 or_b(0x02, &PADRH); /* release ATA reset */
1414 PACR2 &= 0xBFFF; /* GPIO function for PA7 (IDE enable) */ 1414 PACR2 &= 0xBFFF; /* GPIO function for PA7 (IDE enable) */
1415#elif CONFIG_CPU == MCF5249 1415#elif CONFIG_CPU == MCF5249
1416#ifdef HAVE_ATA_LED_CTRL
1416 /* Enable disk LED & ISD chip power control */ 1417 /* Enable disk LED & ISD chip power control */
1417 and_l(~0x0000240, &GPIO_OUT); 1418 and_l(~0x0000240, &GPIO_OUT);
1418 or_l(0x00000240, &GPIO_ENABLE); 1419 or_l(0x00000240, &GPIO_ENABLE);
1419 or_l(0x00000200, &GPIO_FUNCTION); 1420 or_l(0x00000200, &GPIO_FUNCTION);
1421#endif
1420 1422
1421 /* ATA reset */ 1423 /* ATA reset */
1422 or_l(0x00080000, &GPIO_OUT); 1424 and_l(~0x00080000, &GPIO_OUT);
1423 or_l(0x00080000, &GPIO_ENABLE); 1425 or_l(0x00080000, &GPIO_ENABLE);
1424 or_l(0x00080000, &GPIO_FUNCTION); 1426 or_l(0x00080000, &GPIO_FUNCTION);
1425 1427 sleep(10);
1428 or_l(0x00080000, &GPIO_OUT);
1429
1426 /* FYI: The IDECONFIGx registers are set by set_cpu_frequency() */ 1430 /* FYI: The IDECONFIGx registers are set by set_cpu_frequency() */
1427#elif CONFIG_CPU == PP5020 1431#elif CONFIG_CPU == PP5020
1428 /* From ipod-ide.c:ipod_ide_register() */ 1432 /* From ipod-ide.c:ipod_ide_register() */
diff --git a/firmware/drivers/i2c-coldfire.c b/firmware/drivers/i2c-coldfire.c
index aecd3a3b3b..0c83c1cb1a 100644
--- a/firmware/drivers/i2c-coldfire.c
+++ b/firmware/drivers/i2c-coldfire.c
@@ -37,6 +37,7 @@ static volatile unsigned char *i2c_get_addr(int device);
37 37
38void i2c_init(void) 38void i2c_init(void)
39{ 39{
40#ifdef IRIVER_H100_SERIES
40 /* The FM chip has no pullup for SCL, so we have to bit-bang the 41 /* The FM chip has no pullup for SCL, so we have to bit-bang the
41 I2C for that one. */ 42 I2C for that one. */
42 or_l(0x00800000, &GPIO1_OUT); 43 or_l(0x00800000, &GPIO1_OUT);
@@ -45,7 +46,7 @@ void i2c_init(void)
45 or_l(0x00000008, &GPIO_ENABLE); 46 or_l(0x00000008, &GPIO_ENABLE);
46 or_l(0x00800000, &GPIO1_FUNCTION); 47 or_l(0x00800000, &GPIO1_FUNCTION);
47 or_l(0x00000008, &GPIO_FUNCTION); 48 or_l(0x00000008, &GPIO_FUNCTION);
48 49#endif
49 /* I2C Clock divisor = 576 => 119.952 MHz / 2 / 576 = 104.125 kHz */ 50 /* I2C Clock divisor = 576 => 119.952 MHz / 2 / 576 = 104.125 kHz */
50 MFDR = 0x14; 51 MFDR = 0x14;
51 52
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index 4e5d347d54..2547c11cb0 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -62,23 +62,25 @@ int radio_get_status(void)
62void power_init(void) 62void power_init(void)
63{ 63{
64#if CONFIG_CPU == MCF5249 64#if CONFIG_CPU == MCF5249
65#if IRIVER_H100_SERIES 65#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)
66 or_l(0x00080000, &GPIO1_OUT); 66// or_l(0x00080000, &GPIO1_OUT);
67 or_l(0x00080000, &GPIO1_ENABLE); 67// or_l(0x00080000, &GPIO1_ENABLE);
68 or_l(0x00080000, &GPIO1_FUNCTION); 68// or_l(0x00080000, &GPIO1_FUNCTION);
69 69
70#ifndef BOOTLOADER 70#ifndef BOOTLOADER
71 /* The boot loader controls the power */ 71 /* The boot loader controls the power */
72 ide_power_enable(true); 72// ide_power_enable(true);
73#endif 73#endif
74 or_l(0x80000000, &GPIO_OUT);
74 or_l(0x80000000, &GPIO_ENABLE); 75 or_l(0x80000000, &GPIO_ENABLE);
75 or_l(0x80000000, &GPIO_FUNCTION); 76 or_l(0x80000000, &GPIO_FUNCTION);
76#ifdef HAVE_SPDIF_POWER 77#ifdef HAVE_SPDIF_POWER
77 spdif_power_enable(false); 78 spdif_power_enable(false);
78#endif 79#endif
79#elif defined(IRIVER_H300_SERIES) 80#ifdef IRIVER_H300_SERIES
80 pcf50606_init(); 81 pcf50606_init();
81#endif 82#endif
83#endif
82#elif CONFIG_CPU == PP5020 84#elif CONFIG_CPU == PP5020
83 /* TODO: Implement power_init() */ 85 /* TODO: Implement power_init() */
84#else 86#else