summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/i2s-pp.c10
-rw-r--r--firmware/target/arm/pcm-pp.c15
2 files changed, 13 insertions, 12 deletions
diff --git a/firmware/target/arm/i2s-pp.c b/firmware/target/arm/i2s-pp.c
index 09170c818b..0c33fbce28 100644
--- a/firmware/target/arm/i2s-pp.c
+++ b/firmware/target/arm/i2s-pp.c
@@ -57,9 +57,9 @@ void i2s_reset(void)
57 IISCONFIG &= ~IIS_RESET; 57 IISCONFIG &= ~IIS_RESET;
58 58
59 /* BIT.FORMAT */ 59 /* BIT.FORMAT */
60 IISCONFIG = ((IISCONFIG & ~IIS_SIZE_MASK) | IIS_SIZE_16BIT);
61 /* BIT.SIZE */
62 IISCONFIG = ((IISCONFIG & ~IIS_FORMAT_MASK) | IIS_FORMAT_IIS); 60 IISCONFIG = ((IISCONFIG & ~IIS_FORMAT_MASK) | IIS_FORMAT_IIS);
61 /* BIT.SIZE */
62 IISCONFIG = ((IISCONFIG & ~IIS_SIZE_MASK) | IIS_SIZE_16BIT);
63 63
64 /* FIFO.FORMAT */ 64 /* FIFO.FORMAT */
65 /* If BIT.SIZE < FIFO.FORMAT low bits will be 0 */ 65 /* If BIT.SIZE < FIFO.FORMAT low bits will be 0 */
@@ -67,11 +67,11 @@ void i2s_reset(void)
67 /* AS3514 can only operate as I2S Slave */ 67 /* AS3514 can only operate as I2S Slave */
68 IISCONFIG |= IIS_MASTER; 68 IISCONFIG |= IIS_MASTER;
69 /* Set I2S to 44.1kHz */ 69 /* Set I2S to 44.1kHz */
70 outl((inl(0x70002808) & ~(0x1ff)) | 33, 0x70002808); 70 IISCLK = (IISCLK & ~0x1ff) | 33;
71 outl(7, 0x60006080); 71 IISDIV = 7;
72 IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE16); 72 IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE16);
73#elif defined (IRIVER_H10) || defined (IRIVER_H10_5GB) 73#elif defined (IRIVER_H10) || defined (IRIVER_H10_5GB)
74 IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE_HALFWORD); 74 IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE16_2);
75#else 75#else
76 IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE32); 76 IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE32);
77#endif 77#endif
diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c
index 119c54d71b..ba2b6e5ada 100644
--- a/firmware/target/arm/pcm-pp.c
+++ b/firmware/target/arm/pcm-pp.c
@@ -29,11 +29,12 @@
29 of working settings. DMA-compatible settings should be found for here, i2s, 29 of working settings. DMA-compatible settings should be found for here, i2s,
30 and codec setup using "arithmetic" the hardware supports like halfword 30 and codec setup using "arithmetic" the hardware supports like halfword
31 swapping. Try to use 32-bit packed in IIS modes if possible. */ 31 swapping. Try to use 32-bit packed in IIS modes if possible. */
32#if defined(SANSA_C200) || defined(SANSA_E200) 32#if defined(SANSA_C200) || defined(SANSA_E200) \
33 || defined(IRIVER_H10) || defined(IRIVER_H10_5GB)
33/* 16-bit, L-R packed into 32 bits with left in the least significant halfword */ 34/* 16-bit, L-R packed into 32 bits with left in the least significant halfword */
34#define SAMPLE_SIZE 16 35#define SAMPLE_SIZE 16
35#define TRANSFER_SIZE 32 36#define TRANSFER_SIZE 32
36#elif defined(IRIVER_H10) || defined(IRIVER_H10_5GB) 37#elif 0
37/* 16-bit, one left 16-bit sample followed by one right 16-bit sample */ 38/* 16-bit, one left 16-bit sample followed by one right 16-bit sample */
38#define SAMPLE_SIZE 16 39#define SAMPLE_SIZE 16
39#define TRANSFER_SIZE 16 40#define TRANSFER_SIZE 16
@@ -204,10 +205,10 @@ void fiq_playback(void)
204 } 205 }
205#if SAMPLE_SIZE == 16 206#if SAMPLE_SIZE == 16
206#if TRANSFER_SIZE == 16 207#if TRANSFER_SIZE == 16
207 IISFIFO_WRH = *dma_play_data.p++; 208 IISFIFO_WRH = *dma_play_data.p++;
208 IISFIFO_WRH = *dma_play_data.p++; 209 IISFIFO_WRH = *dma_play_data.p++;
209#elif TRANSFER_SIZE == 32 210#elif TRANSFER_SIZE == 32
210 IISFIFO_WR = *dma_play_data.p++; 211 IISFIFO_WR = *dma_play_data.p++;
211#endif 212#endif
212#elif SAMPLE_SIZE == 32 213#elif SAMPLE_SIZE == 32
213 IISFIFO_WR = *dma_play_data.p++ << 16; 214 IISFIFO_WR = *dma_play_data.p++ << 16;
@@ -294,8 +295,8 @@ static void play_stop_pcm(void)
294 295
295void pcm_play_dma_start(const void *addr, size_t size) 296void pcm_play_dma_start(const void *addr, size_t size)
296{ 297{
297 dma_play_data.p = (void *)addr; 298 dma_play_data.p = (void *)(((uintptr_t)addr + 2) & ~3);
298 dma_play_data.size = size; 299 dma_play_data.size = (size & ~3);
299 300
300#if NUM_CORES > 1 301#if NUM_CORES > 1
301 /* This will become more important later - and different ! */ 302 /* This will become more important later - and different ! */