summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/backlight.c9
-rw-r--r--firmware/drivers/ata.c8
-rw-r--r--firmware/drivers/i2c-coldfire.c3
-rw-r--r--firmware/drivers/power.c14
-rw-r--r--firmware/export/config-h100.h2
-rw-r--r--firmware/export/config-h120.h2
-rw-r--r--firmware/pcm_playback.c8
7 files changed, 10 insertions, 36 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 26d0362c27..fa6a42be44 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -456,14 +456,7 @@ void backlight_init(void)
456 456
457#else /* no backlight, empty dummy functions */ 457#else /* no backlight, empty dummy functions */
458 458
459void backlight_init(void) 459void backlight_init(void) {}
460{
461#if defined(IRIVER_H300_SERIES) && defined(BOOTLOADER)
462 or_l(0x00020000, &GPIO1_OUT);
463 or_l(0x00020000, &GPIO1_ENABLE);
464 or_l(0x00020000, &GPIO1_FUNCTION);
465#endif
466}
467void backlight_on(void) {} 460void backlight_on(void) {}
468void backlight_off(void) {} 461void backlight_off(void) {}
469void backlight_tick(void) {} 462void backlight_tick(void) {}
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index c0799f30e4..9cc49c1731 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -1413,20 +1413,16 @@ 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
1417 /* Enable disk LED & ISD chip power control */ 1416 /* Enable disk LED & ISD chip power control */
1418 and_l(~0x0000240, &GPIO_OUT); 1417 and_l(~0x0000240, &GPIO_OUT);
1419 or_l(0x00000240, &GPIO_ENABLE); 1418 or_l(0x00000240, &GPIO_ENABLE);
1420 or_l(0x00000200, &GPIO_FUNCTION); 1419 or_l(0x00000200, &GPIO_FUNCTION);
1421#endif
1422 1420
1423 /* ATA reset */ 1421 /* ATA reset */
1424 and_l(~0x00080000, &GPIO_OUT); 1422 or_l(0x00080000, &GPIO_OUT);
1425 or_l(0x00080000, &GPIO_ENABLE); 1423 or_l(0x00080000, &GPIO_ENABLE);
1426 or_l(0x00080000, &GPIO_FUNCTION); 1424 or_l(0x00080000, &GPIO_FUNCTION);
1427 sleep(10); 1425
1428 or_l(0x00080000, &GPIO_OUT);
1429
1430 /* FYI: The IDECONFIGx registers are set by set_cpu_frequency() */ 1426 /* FYI: The IDECONFIGx registers are set by set_cpu_frequency() */
1431#elif CONFIG_CPU == PP5020 1427#elif CONFIG_CPU == PP5020
1432 /* From ipod-ide.c:ipod_ide_register() */ 1428 /* From ipod-ide.c:ipod_ide_register() */
diff --git a/firmware/drivers/i2c-coldfire.c b/firmware/drivers/i2c-coldfire.c
index 0c83c1cb1a..aecd3a3b3b 100644
--- a/firmware/drivers/i2c-coldfire.c
+++ b/firmware/drivers/i2c-coldfire.c
@@ -37,7 +37,6 @@ 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
41 /* The FM chip has no pullup for SCL, so we have to bit-bang the 40 /* The FM chip has no pullup for SCL, so we have to bit-bang the
42 I2C for that one. */ 41 I2C for that one. */
43 or_l(0x00800000, &GPIO1_OUT); 42 or_l(0x00800000, &GPIO1_OUT);
@@ -46,7 +45,7 @@ void i2c_init(void)
46 or_l(0x00000008, &GPIO_ENABLE); 45 or_l(0x00000008, &GPIO_ENABLE);
47 or_l(0x00800000, &GPIO1_FUNCTION); 46 or_l(0x00800000, &GPIO1_FUNCTION);
48 or_l(0x00000008, &GPIO_FUNCTION); 47 or_l(0x00000008, &GPIO_FUNCTION);
49#endif 48
50 /* I2C Clock divisor = 576 => 119.952 MHz / 2 / 576 = 104.125 kHz */ 49 /* I2C Clock divisor = 576 => 119.952 MHz / 2 / 576 = 104.125 kHz */
51 MFDR = 0x14; 50 MFDR = 0x14;
52 51
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index 2547c11cb0..4e5d347d54 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -62,25 +62,23 @@ 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 defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) 65#if IRIVER_H100_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);
75 or_l(0x80000000, &GPIO_ENABLE); 74 or_l(0x80000000, &GPIO_ENABLE);
76 or_l(0x80000000, &GPIO_FUNCTION); 75 or_l(0x80000000, &GPIO_FUNCTION);
77#ifdef HAVE_SPDIF_POWER 76#ifdef HAVE_SPDIF_POWER
78 spdif_power_enable(false); 77 spdif_power_enable(false);
79#endif 78#endif
80#ifdef IRIVER_H300_SERIES 79#elif defined(IRIVER_H300_SERIES)
81 pcf50606_init(); 80 pcf50606_init();
82#endif 81#endif
83#endif
84#elif CONFIG_CPU == PP5020 82#elif CONFIG_CPU == PP5020
85 /* TODO: Implement power_init() */ 83 /* TODO: Implement power_init() */
86#else 84#else
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 35b35e0f27..19bb99bc04 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -91,8 +91,6 @@
91 91
92#define USB_IRIVERSTYLE 92#define USB_IRIVERSTYLE
93 93
94#define HAVE_ATA_LED_CTRL
95
96/* Define this if you have adjustable CPU frequency */ 94/* Define this if you have adjustable CPU frequency */
97#define HAVE_ADJUSTABLE_CPU_FREQ 95#define HAVE_ADJUSTABLE_CPU_FREQ
98 96
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index e6c829a2a5..b2c34c5a55 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -88,8 +88,6 @@
88 88
89#define USB_IRIVERSTYLE 89#define USB_IRIVERSTYLE
90 90
91#define HAVE_ATA_LED_CTRL
92
93/* Define this if you have adjustable CPU frequency */ 91/* Define this if you have adjustable CPU frequency */
94#define HAVE_ADJUSTABLE_CPU_FREQ 92#define HAVE_ADJUSTABLE_CPU_FREQ
95 93
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c
index 5f87917844..05c5447ff8 100644
--- a/firmware/pcm_playback.c
+++ b/firmware/pcm_playback.c
@@ -77,10 +77,8 @@ static void dma_start(const void *addr, long size)
77 77
78 /* Enable the FIFO and force one write to it */ 78 /* Enable the FIFO and force one write to it */
79 IIS2CONFIG = IIS_DEFPARM(pcm_freq); 79 IIS2CONFIG = IIS_DEFPARM(pcm_freq);
80#ifdef HAVE_SPDIF_OUT
81 /* Also send the audio to S/PDIF */ 80 /* Also send the audio to S/PDIF */
82 EBU1CONFIG = EBU_DEFPARM; 81 EBU1CONFIG = EBU_DEFPARM;
83#endif
84 DCR0 = DMA_INT | DMA_EEXT | DMA_CS | DMA_SINC | DMA_START; 82 DCR0 = DMA_INT | DMA_EEXT | DMA_CS | DMA_SINC | DMA_START;
85} 83}
86 84
@@ -92,9 +90,7 @@ static void dma_stop(void)
92 DCR0 = 0; 90 DCR0 = 0;
93 /* Reset the FIFO */ 91 /* Reset the FIFO */
94 IIS2CONFIG = IIS_RESET | IIS_DEFPARM(pcm_freq); 92 IIS2CONFIG = IIS_RESET | IIS_DEFPARM(pcm_freq);
95#ifdef HAVE_SPDIF_OUT
96 EBU1CONFIG = IIS_RESET; 93 EBU1CONFIG = IIS_RESET;
97#endif
98 94
99 next_start = NULL; 95 next_start = NULL;
100 next_size = 0; 96 next_size = 0;
@@ -224,9 +220,7 @@ void pcm_play_pause(bool play)
224 //BCR0 = next_size; 220 //BCR0 = next_size;
225 /* Enable the FIFO and force one write to it */ 221 /* Enable the FIFO and force one write to it */
226 IIS2CONFIG = IIS_DEFPARM(pcm_freq); 222 IIS2CONFIG = IIS_DEFPARM(pcm_freq);
227#ifdef HAVE_SPDIF_OUT
228 EBU1CONFIG = EBU_DEFPARM; 223 EBU1CONFIG = EBU_DEFPARM;
229#endif
230 DCR0 |= DMA_EEXT | DMA_START; 224 DCR0 |= DMA_EEXT | DMA_START;
231 } 225 }
232 else if(!pcm_paused && !play) 226 else if(!pcm_paused && !play)
@@ -236,9 +230,7 @@ void pcm_play_pause(bool play)
236 /* Disable DMA peripheral request. */ 230 /* Disable DMA peripheral request. */
237 DCR0 &= ~DMA_EEXT; 231 DCR0 &= ~DMA_EEXT;
238 IIS2CONFIG = IIS_RESET | IIS_DEFPARM(pcm_freq); 232 IIS2CONFIG = IIS_RESET | IIS_DEFPARM(pcm_freq);
239#ifdef HAVE_SPDIF_OUT
240 EBU1CONFIG = IIS_RESET; 233 EBU1CONFIG = IIS_RESET;
241#endif
242 } 234 }
243 pcm_paused = !play; 235 pcm_paused = !play;
244} 236}