diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2021-04-23 11:31:58 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-04-26 07:42:58 -0400 |
commit | 7d0d32dbc65a8332a49aeed3a97e24cb109958b2 (patch) | |
tree | 36ce03b1b8564bedfd8e3df0ec088a0fc6bdc06f /firmware/target/arm/pnx0101/pcm-pnx0101.c | |
parent | 3ba2f6e5c7383c5d7a6f8a1c38b6b5403a8a5dcb (diff) | |
download | rockbox-7d0d32dbc65a8332a49aeed3a97e24cb109958b2.tar.gz rockbox-7d0d32dbc65a8332a49aeed3a97e24cb109958b2.zip |
Nuke the never-functional iriver ifp-7xx port
It never worked, and hasn't compiled in something like a decade, Given
the HW capabilities (limited onboard flash, no expandability) there's
really no point in trying to fix/complete it.
Change-Id: I7d175089840396f8891645bd10010d730dd5bfdc
Diffstat (limited to 'firmware/target/arm/pnx0101/pcm-pnx0101.c')
-rw-r--r-- | firmware/target/arm/pnx0101/pcm-pnx0101.c | 207 |
1 files changed, 0 insertions, 207 deletions
diff --git a/firmware/target/arm/pnx0101/pcm-pnx0101.c b/firmware/target/arm/pnx0101/pcm-pnx0101.c deleted file mode 100644 index 6099dcb7ef..0000000000 --- a/firmware/target/arm/pnx0101/pcm-pnx0101.c +++ /dev/null | |||
@@ -1,207 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Tomek Malesinski | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "system.h" | ||
22 | #include "audio.h" | ||
23 | #include "string.h" | ||
24 | #include "pcm-internal.h" | ||
25 | |||
26 | #define DMA_BUF_SAMPLES 0x100 | ||
27 | |||
28 | short __attribute__((section(".dmabuf"))) dma_buf_left[DMA_BUF_SAMPLES]; | ||
29 | short __attribute__((section(".dmabuf"))) dma_buf_right[DMA_BUF_SAMPLES]; | ||
30 | |||
31 | const int16_t* p IBSS_ATTR; | ||
32 | size_t p_size IBSS_ATTR; | ||
33 | |||
34 | void pcm_play_lock(void) | ||
35 | { | ||
36 | } | ||
37 | |||
38 | void pcm_play_unlock(void) | ||
39 | { | ||
40 | } | ||
41 | |||
42 | void pcm_play_dma_start(const void *addr, size_t size) | ||
43 | { | ||
44 | p = addr; | ||
45 | p_size = size; | ||
46 | } | ||
47 | |||
48 | void pcm_play_dma_stop(void) | ||
49 | { | ||
50 | } | ||
51 | |||
52 | static inline void fill_dma_buf(int offset) | ||
53 | { | ||
54 | short *l, *r, *lend; | ||
55 | |||
56 | l = dma_buf_left + offset; | ||
57 | lend = l + DMA_BUF_SAMPLES / 2; | ||
58 | r = dma_buf_right + offset; | ||
59 | |||
60 | if (pcm_playing) | ||
61 | { | ||
62 | bool new_buffer =false; | ||
63 | |||
64 | do | ||
65 | { | ||
66 | int count; | ||
67 | const int16_t *tmp_p; | ||
68 | count = MIN(p_size / 4, (size_t)(lend - l)); | ||
69 | tmp_p = p; | ||
70 | p_size -= count * 4; | ||
71 | |||
72 | if ((int)l & 3) | ||
73 | { | ||
74 | *l++ = *tmp_p++; | ||
75 | *r++ = *tmp_p++; | ||
76 | count--; | ||
77 | } | ||
78 | while (count >= 4) | ||
79 | { | ||
80 | asm("ldmia %0!, {r0, r1, r2, r3}\n\t" | ||
81 | "and r4, r0, %3\n\t" | ||
82 | "orr r4, r4, r1, lsl #16\n\t" | ||
83 | "and r5, r2, %3\n\t" | ||
84 | "orr r5, r5, r3, lsl #16\n\t" | ||
85 | "stmia %1!, {r4, r5}\n\t" | ||
86 | "bic r4, r1, %3\n\t" | ||
87 | "orr r4, r4, r0, lsr #16\n\t" | ||
88 | "bic r5, r3, %3\n\t" | ||
89 | "orr r5, r5, r2, lsr #16\n\t" | ||
90 | "stmia %2!, {r4, r5}" | ||
91 | : "+r" (tmp_p), "+r" (l), "+r" (r) | ||
92 | : "r" (0xffff) | ||
93 | : "r0", "r1", "r2", "r3", "r4", "r5", "memory"); | ||
94 | count -= 4; | ||
95 | } | ||
96 | while (count > 0) | ||
97 | { | ||
98 | *l++ = *tmp_p++; | ||
99 | *r++ = *tmp_p++; | ||
100 | count--; | ||
101 | } | ||
102 | p = tmp_p; | ||
103 | |||
104 | if (new_buffer) | ||
105 | { | ||
106 | new_buffer = false; | ||
107 | pcm_play_dma_status_callback(PCM_DMAST_STARTED); | ||
108 | } | ||
109 | |||
110 | if (l >= lend) | ||
111 | return; | ||
112 | |||
113 | new_buffer = pcm_play_dma_complete_callback(PCM_DMAST_OK, | ||
114 | &p, &p_size); | ||
115 | } | ||
116 | while (p_size); | ||
117 | } | ||
118 | |||
119 | if (l < lend) | ||
120 | { | ||
121 | memset(l, 0, sizeof(short) * (lend - l)); | ||
122 | memset(r, 0, sizeof(short) * (lend - l)); | ||
123 | } | ||
124 | } | ||
125 | |||
126 | static void audio_irq(void) | ||
127 | { | ||
128 | unsigned long st = DMAINTSTAT & ~DMAINTEN; | ||
129 | int i; | ||
130 | for (i = 0; i < 2; i++) | ||
131 | if (st & (1 << i)) | ||
132 | { | ||
133 | fill_dma_buf((i == 1) ? 0 : DMA_BUF_SAMPLES / 2); | ||
134 | DMAINTSTAT = 1 << i; | ||
135 | } | ||
136 | } | ||
137 | |||
138 | unsigned long physical_address(void *p) | ||
139 | { | ||
140 | unsigned long adr = (unsigned long)p; | ||
141 | return (MMUBLOCK((adr >> 21) & 0xf) << 21) | (adr & ((1 << 21) - 1)); | ||
142 | } | ||
143 | |||
144 | void pcm_init(void) | ||
145 | { | ||
146 | int i; | ||
147 | |||
148 | memset(dma_buf_left, 0, sizeof(dma_buf_left)); | ||
149 | memset(dma_buf_right, 0, sizeof(dma_buf_right)); | ||
150 | |||
151 | for (i = 0; i < 8; i++) | ||
152 | { | ||
153 | DMASRC(i) = 0; | ||
154 | DMADEST(i) = 0; | ||
155 | DMALEN(i) = 0x1ffff; | ||
156 | DMAR0C(i) = 0; | ||
157 | DMAR10(i) = 0; | ||
158 | DMAR1C(i) = 0; | ||
159 | } | ||
160 | |||
161 | DMAINTSTAT = 0xc000ffff; | ||
162 | DMAINTEN = 0xc000ffff; | ||
163 | |||
164 | DMASRC(0) = physical_address(dma_buf_left); | ||
165 | DMADEST(0) = 0x80200280; | ||
166 | DMALEN(0) = 0xff; | ||
167 | DMAR1C(0) = 0; | ||
168 | DMAR0C(0) = 0x40408; | ||
169 | |||
170 | DMASRC(1) = physical_address(dma_buf_right); | ||
171 | DMADEST(1) = 0x80200284; | ||
172 | DMALEN(1) = 0xff; | ||
173 | DMAR1C(1) = 0; | ||
174 | DMAR0C(1) = 0x40409; | ||
175 | |||
176 | irq_set_int_handler(0x1b, audio_irq); | ||
177 | irq_enable_int(0x1b); | ||
178 | |||
179 | DMAINTSTAT = 1; | ||
180 | DMAINTSTAT = 2; | ||
181 | DMAINTEN &= ~3; | ||
182 | DMAR10(0) |= 1; | ||
183 | DMAR10(1) |= 1; | ||
184 | } | ||
185 | |||
186 | void pcm_play_dma_postinit(void) | ||
187 | { | ||
188 | audiohw_postinit(); | ||
189 | } | ||
190 | |||
191 | void pcm_dma_apply_settings(void) | ||
192 | { | ||
193 | } | ||
194 | |||
195 | const void * pcm_play_dma_get_peak_buffer(int *count) | ||
196 | { | ||
197 | unsigned long addr = (unsigned long)p; | ||
198 | size_t cnt = p_size; | ||
199 | *count = cnt >> 2; | ||
200 | return (void *)((addr + 2) & ~3); | ||
201 | } | ||
202 | |||
203 | void audiohw_set_volume(int value) | ||
204 | { | ||
205 | int tmp = (60 - value * 4) & 0xff; | ||
206 | CODECVOL = tmp | (tmp << 8); | ||
207 | } | ||