summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2009-10-21 18:52:09 +0000
committerMichael Sparmann <theseven@rockbox.org>2009-10-21 18:52:09 +0000
commit7bff585d83444dba96c952578a265a5537fec459 (patch)
tree5352fab86af60ba482ed3ee72d8ee0cd3a480756
parent0c89c0ef7cd2439fe74ef57ac408733aef8fd313 (diff)
downloadrockbox-7bff585d83444dba96c952578a265a5537fec459.tar.gz
rockbox-7bff585d83444dba96c952578a265a5537fec459.zip
iPod Nano 2G: "Fix" the latest PCM issues, channel swap and vinyl popping. The latter is a revert of the cache coherency patch for now, we need to find a better solution in the long term...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23308 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config-ipodnano2g.h4
-rw-r--r--firmware/target/arm/s5l8700/pcm-s5l8700.c15
2 files changed, 11 insertions, 8 deletions
diff --git a/firmware/export/config-ipodnano2g.h b/firmware/export/config-ipodnano2g.h
index 3b50238c02..d325dd7223 100644
--- a/firmware/export/config-ipodnano2g.h
+++ b/firmware/export/config-ipodnano2g.h
@@ -105,6 +105,8 @@
105/* Define the type of audio codec */ 105/* Define the type of audio codec */
106#define HAVE_WM8975 106#define HAVE_WM8975
107 107
108#define HAVE_PCM_DMA_ADDRESS
109
108/* Define this for LCD backlight available */ 110/* Define this for LCD backlight available */
109#define HAVE_BACKLIGHT 111#define HAVE_BACKLIGHT
110#define HAVE_BACKLIGHT_BRIGHTNESS 112#define HAVE_BACKLIGHT_BRIGHTNESS
@@ -205,5 +207,5 @@
205#define USB_VENDOR_ID 0x05AC 207#define USB_VENDOR_ID 0x05AC
206#define USB_PRODUCT_ID 0x1260 208#define USB_PRODUCT_ID 0x1260
207#define USB_NUM_ENDPOINTS 5 209#define USB_NUM_ENDPOINTS 5
208/* #define USE_ROCKBOX_USB - needs testing */ 210#define USE_ROCKBOX_USB
209#define USB_DEVBSS_ATTR __attribute__((aligned(16))) 211#define USB_DEVBSS_ATTR __attribute__((aligned(16)))
diff --git a/firmware/target/arm/s5l8700/pcm-s5l8700.c b/firmware/target/arm/s5l8700/pcm-s5l8700.c
index fd41da1432..219f682e2d 100644
--- a/firmware/target/arm/s5l8700/pcm-s5l8700.c
+++ b/firmware/target/arm/s5l8700/pcm-s5l8700.c
@@ -105,7 +105,7 @@ static void play_next(void *addr, size_t size)
105 dma_callback); 105 dma_callback);
106 106
107 /* DMA channel on */ 107 /* DMA channel on */
108 clean_dcache(); 108// clean_dcache();
109 dma_enable_channel(DMA_IISOUT_CHANNEL); 109 dma_enable_channel(DMA_IISOUT_CHANNEL);
110} 110}
111 111
@@ -139,7 +139,8 @@ void pcm_play_dma_start(const void *addr, size_t size)
139 PCON5 = (PCON5 & ~(0xFFFF0000)) | 0x77720000; 139 PCON5 = (PCON5 & ~(0xFFFF0000)) | 0x77720000;
140 PCON6 = (PCON6 & ~(0x0F000000)) | 0x02000000; 140 PCON6 = (PCON6 & ~(0x0F000000)) | 0x02000000;
141 141
142 I2STXCON = (0x10 << 16) | /* burst length */ 142 I2STXCON = (1 << 20) | /* undocumented */
143 (DMA_IISOUT_BLEN << 16) | /* burst length */
143 (0 << 15) | /* 0 = falling edge */ 144 (0 << 15) | /* 0 = falling edge */
144 (0 << 13) | /* 0 = basic I2S format */ 145 (0 << 13) | /* 0 = basic I2S format */
145 (0 << 12) | /* 0 = MSB first */ 146 (0 << 12) | /* 0 = MSB first */
@@ -162,7 +163,7 @@ void pcm_play_dma_start(const void *addr, size_t size)
162#endif 163#endif
163 164
164 /* S3: DMA channel 0 on */ 165 /* S3: DMA channel 0 on */
165 clean_dcache(); 166// clean_dcache();
166 dma_enable_channel(DMA_IISOUT_CHANNEL); 167 dma_enable_channel(DMA_IISOUT_CHANNEL);
167 168
168 /* S4: IIS Tx clock on */ 169 /* S4: IIS Tx clock on */
@@ -190,14 +191,14 @@ void pcm_play_dma_stop(void)
190 (0 << 0); /* 0 = LRCK on */ 191 (0 << 0); /* 0 = LRCK on */
191} 192}
192 193
193/* pause playback by disabling further DMA requests */ 194/* pause playback by disabling the I2S interface */
194void pcm_play_dma_pause(bool pause) 195void pcm_play_dma_pause(bool pause)
195{ 196{
196 if (pause) { 197 if (pause) {
197 I2STXCOM &= ~(1 << 1); /* DMA request enable */ 198 I2STXCOM |= (1 << 0); /* LRCK off */
198 } 199 }
199 else { 200 else {
200 I2STXCOM |= (1 << 1); /* DMA request enable */ 201 I2STXCOM &= ~(1 << 0); /* LRCK on */
201 } 202 }
202} 203}
203 204
@@ -267,7 +268,7 @@ const void * pcm_play_dma_get_peak_buffer(int *count)
267void * pcm_dma_addr(void *addr) 268void * pcm_dma_addr(void *addr)
268{ 269{
269 if (addr != NULL) 270 if (addr != NULL)
270 addr = UNCACHED_ADDR(addr); 271 addr = (void*)((uintptr_t)addr | 0x40000000);
271 return addr; 272 return addr;
272} 273}
273#endif 274#endif