summaryrefslogtreecommitdiff
path: root/firmware/target/arm/pcm-pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/pcm-pp.c')
-rw-r--r--firmware/target/arm/pcm-pp.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c
index 0608c208eb..35bcd343cb 100644
--- a/firmware/target/arm/pcm-pp.c
+++ b/firmware/target/arm/pcm-pp.c
@@ -30,7 +30,7 @@ static int rec_peak_left, rec_peak_right;
30#endif 30#endif
31 31
32/** DMA **/ 32/** DMA **/
33#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 33#ifdef CPU_PP502x
34#define FIFO_FREE_COUNT ((IISFIFO_CFG & 0x3f000000) >> 24) 34#define FIFO_FREE_COUNT ((IISFIFO_CFG & 0x3f000000) >> 24)
35#elif CONFIG_CPU == PP5002 35#elif CONFIG_CPU == PP5002
36#define FIFO_FREE_COUNT ((IISFIFO_CFG & 0x7800000) >> 23) 36#define FIFO_FREE_COUNT ((IISFIFO_CFG & 0x7800000) >> 23)
@@ -52,7 +52,7 @@ size_t p_size IBSS_ATTR;
52 actually needs to do so when calling pcm_callback_for_more. C version is 52 actually needs to do so when calling pcm_callback_for_more. C version is
53 still included below for reference. 53 still included below for reference.
54 */ 54 */
55#ifdef CPU_PP 55#if 1
56void fiq(void) ICODE_ATTR __attribute__((naked)); 56void fiq(void) ICODE_ATTR __attribute__((naked));
57void fiq(void) 57void fiq(void)
58{ 58{
@@ -154,12 +154,12 @@ void fiq(void)
154 "b .exit \n\t" 154 "b .exit \n\t"
155 ); 155 );
156} 156}
157#else /* !(CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002) */ 157#else /* C version for reference */
158void fiq(void) ICODE_ATTR __attribute__ ((interrupt ("FIQ"))); 158void fiq(void) ICODE_ATTR __attribute__ ((interrupt ("FIQ")));
159void fiq(void) 159void fiq(void)
160{ 160{
161 /* Clear interrupt */ 161 /* Clear interrupt */
162#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 162#ifdef CPU_PP502x
163 IISCONFIG &= ~(1 << 1); 163 IISCONFIG &= ~(1 << 1);
164#elif CONFIG_CPU == PP5002 164#elif CONFIG_CPU == PP5002
165 inl(0xcf001040); 165 inl(0xcf001040);
@@ -170,7 +170,7 @@ void fiq(void)
170 while (p_size) { 170 while (p_size) {
171 if (FIFO_FREE_COUNT < 2) { 171 if (FIFO_FREE_COUNT < 2) {
172 /* Enable interrupt */ 172 /* Enable interrupt */
173#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 173#ifdef CPU_PP502x
174 IISCONFIG |= (1 << 1); 174 IISCONFIG |= (1 << 1);
175#elif CONFIG_CPU == PP5002 175#elif CONFIG_CPU == PP5002
176 IISFIFO_CFG |= (1<<9); 176 IISFIFO_CFG |= (1<<9);
@@ -197,7 +197,7 @@ void fiq(void)
197 /* No more data, so disable the FIFO/FIQ */ 197 /* No more data, so disable the FIFO/FIQ */
198 pcm_play_dma_stop(); 198 pcm_play_dma_stop();
199} 199}
200#endif /* CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 */ 200#endif /* ASM / C selection */
201 201
202void pcm_play_dma_start(const void *addr, size_t size) 202void pcm_play_dma_start(const void *addr, size_t size)
203{ 203{
@@ -206,7 +206,7 @@ void pcm_play_dma_start(const void *addr, size_t size)
206 206
207 pcm_playing = true; 207 pcm_playing = true;
208 208
209#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 209#ifdef CPU_PP502x
210 CPU_INT_PRIORITY |= I2S_MASK; /* FIQ priority for I2S */ 210 CPU_INT_PRIORITY |= I2S_MASK; /* FIQ priority for I2S */
211 CPU_INT_EN = I2S_MASK; /* Enable I2S interrupt */ 211 CPU_INT_EN = I2S_MASK; /* Enable I2S interrupt */
212#else 212#else
@@ -220,7 +220,7 @@ void pcm_play_dma_start(const void *addr, size_t size)
220 enable_fiq(); 220 enable_fiq();
221 221
222 /* Enable playback FIFO */ 222 /* Enable playback FIFO */
223#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 223#ifdef CPU_PP502x
224 IISCONFIG |= (1 << 29); 224 IISCONFIG |= (1 << 29);
225#elif CONFIG_CPU == PP5002 225#elif CONFIG_CPU == PP5002
226 IISCONFIG |= 0x4; 226 IISCONFIG |= 0x4;
@@ -231,7 +231,7 @@ void pcm_play_dma_start(const void *addr, size_t size)
231 while (p_size > 0) { 231 while (p_size > 0) {
232 if (FIFO_FREE_COUNT < 2) { 232 if (FIFO_FREE_COUNT < 2) {
233 /* Enable interrupt */ 233 /* Enable interrupt */
234#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 234#ifdef CPU_PP502x
235 IISCONFIG |= (1 << 1); 235 IISCONFIG |= (1 << 1);
236#elif CONFIG_CPU == PP5002 236#elif CONFIG_CPU == PP5002
237 IISFIFO_CFG |= (1<<9); 237 IISFIFO_CFG |= (1<<9);
@@ -256,7 +256,7 @@ void pcm_play_dma_stop(void)
256 pcm_playing = false; 256 pcm_playing = false;
257 pcm_paused = false; 257 pcm_paused = false;
258 258
259#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 259#ifdef CPU_PP502x
260 /* Disable playback FIFO and interrupt */ 260 /* Disable playback FIFO and interrupt */
261 IISCONFIG &= ~((1 << 29) | (1 << 1)); 261 IISCONFIG &= ~((1 << 29) | (1 << 1));
262#elif CONFIG_CPU == PP5002 262#elif CONFIG_CPU == PP5002
@@ -273,7 +273,7 @@ void pcm_play_dma_stop(void)
273 273
274void pcm_play_pause_pause(void) 274void pcm_play_pause_pause(void)
275{ 275{
276#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 276#ifdef CPU_PP502x
277 /* Disable playback FIFO and interrupt */ 277 /* Disable playback FIFO and interrupt */
278 IISCONFIG &= ~((1 << 29) | (1 << 1)); 278 IISCONFIG &= ~((1 << 29) | (1 << 1));
279#elif CONFIG_CPU == PP5002 279#elif CONFIG_CPU == PP5002
@@ -293,7 +293,7 @@ void pcm_play_pause_unpause(void)
293 enable_fiq(); 293 enable_fiq();
294 294
295 /* Enable playback FIFO */ 295 /* Enable playback FIFO */
296#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 296#ifdef CPU_PP502x
297 IISCONFIG |= (1 << 29); 297 IISCONFIG |= (1 << 29);
298#elif CONFIG_CPU == PP5002 298#elif CONFIG_CPU == PP5002
299 IISCONFIG |= 0x4; 299 IISCONFIG |= 0x4;
@@ -304,7 +304,7 @@ void pcm_play_pause_unpause(void)
304 while (p_size > 0) { 304 while (p_size > 0) {
305 if (FIFO_FREE_COUNT < 2) { 305 if (FIFO_FREE_COUNT < 2) {
306 /* Enable interrupt */ 306 /* Enable interrupt */
307#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 307#ifdef CPU_PP502x
308 IISCONFIG |= (1 << 1); 308 IISCONFIG |= (1 << 1);
309#elif CONFIG_CPU == PP5002 309#elif CONFIG_CPU == PP5002
310 IISFIFO_CFG |= (1<<9); 310 IISFIFO_CFG |= (1<<9);
@@ -445,7 +445,7 @@ void fiq_record(void)
445 int status = 0; 445 int status = 0;
446 446
447 /* Clear interrupt */ 447 /* Clear interrupt */
448#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 448#ifdef CPU_PP502x
449 IISCONFIG &= ~(1 << 0); 449 IISCONFIG &= ~(1 << 0);
450#elif CONFIG_CPU == PP5002 450#elif CONFIG_CPU == PP5002
451 /* TODO */ 451 /* TODO */
@@ -454,7 +454,7 @@ void fiq_record(void)
454 while (p_size > 0) { 454 while (p_size > 0) {
455 if (FIFO_FREE_COUNT < 2) { 455 if (FIFO_FREE_COUNT < 2) {
456 /* enable interrupt */ 456 /* enable interrupt */
457#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 457#ifdef CPU_PP502x
458 IISCONFIG |= (1 << 0); 458 IISCONFIG |= (1 << 0);
459#elif CONFIG_CPU == PP5002 459#elif CONFIG_CPU == PP5002
460 /* TODO */ 460 /* TODO */
@@ -499,7 +499,7 @@ void pcm_record_more(void *start, size_t size)
499 rec_peak_addr = start; /* Start peaking at dest */ 499 rec_peak_addr = start; /* Start peaking at dest */
500 p = start; /* Start of RX buffer */ 500 p = start; /* Start of RX buffer */
501 p_size = size; /* Bytes to transfer */ 501 p_size = size; /* Bytes to transfer */
502#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024 502#ifdef CPU_PP502x
503 IISCONFIG |= (1 << 0); 503 IISCONFIG |= (1 << 0);
504#elif CONFIG_CPU == PP5002 504#elif CONFIG_CPU == PP5002
505 /* TODO */ 505 /* TODO */
@@ -558,7 +558,7 @@ void pcm_init_recording(void)
558 pcm_recording = false; 558 pcm_recording = false;
559 pcm_callback_more_ready = NULL; 559 pcm_callback_more_ready = NULL;
560 560
561#if (CONFIG_CPU == PP5020 || CONFIG_CPU == PP5024) 561#ifdef CPU_PP502x
562#if defined(IPOD_COLOR) || defined (IPOD_4G) 562#if defined(IPOD_COLOR) || defined (IPOD_4G)
563 /* The usual magic from IPL - I'm guessing this configures the headphone 563 /* The usual magic from IPL - I'm guessing this configures the headphone
564 socket to be input or output - in this case, input. */ 564 socket to be input or output - in this case, input. */