forked from len0rd/rockbox
Finally get packed samples to work in a nice way on H10 in IIS mode. Add some more register defs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15026 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1de497228a
commit
4512f1a14f
3 changed files with 22 additions and 14 deletions
|
@ -307,8 +307,11 @@
|
|||
|
||||
#define INIT_USB 0x80000000
|
||||
|
||||
|
||||
/* IIS */
|
||||
#define IISDIV (*(volatile unsigned long*)(0x60006080))
|
||||
#define IISCONFIG (*(volatile unsigned long*)(0x70002800))
|
||||
#define IISCLK (*(volatile unsigned long*)(0x70002808))
|
||||
#define IISFIFO_CFG (*(volatile unsigned long*)(0x7000280c))
|
||||
#define IISFIFO_WR (*(volatile unsigned long*)(0x70002840))
|
||||
#define IISFIFO_WRH (*(volatile unsigned short*)(0x70002840))
|
||||
|
@ -358,10 +361,14 @@
|
|||
* I forgot which is which size but did test them. */
|
||||
#define IIS_FIFO_FORMAT_1 (0x1 << 4)
|
||||
#define IIS_FIFO_FORMAT_2 (0x2 << 4)
|
||||
/* 32bit-MSB-little endian */
|
||||
/* 32bit-MSB-little endian */
|
||||
#define IIS_FIFO_FORMAT_LE32 (0x3 << 4)
|
||||
/* 16bit-MSB-little endian */
|
||||
/* 16bit-MSB-little endian */
|
||||
#define IIS_FIFO_FORMAT_LE16 (0x4 << 4)
|
||||
#define IIS_FIFO_FORMAT_5 (0x5 << 4)
|
||||
#define IIS_FIFO_FORMAT_6 (0x6 << 4)
|
||||
/* A second one like IIS_FIFO_FORMAT_LE16? PP5020 only? */
|
||||
#define IIS_FIFO_FORMAT_LE16_2 (0x7 << 4)
|
||||
|
||||
/* FIFO formats 0x5 and above seem equivalent to 0x4 ?? */
|
||||
|
||||
|
|
|
@ -57,9 +57,9 @@ void i2s_reset(void)
|
|||
IISCONFIG &= ~IIS_RESET;
|
||||
|
||||
/* BIT.FORMAT */
|
||||
IISCONFIG = ((IISCONFIG & ~IIS_SIZE_MASK) | IIS_SIZE_16BIT);
|
||||
/* BIT.SIZE */
|
||||
IISCONFIG = ((IISCONFIG & ~IIS_FORMAT_MASK) | IIS_FORMAT_IIS);
|
||||
/* BIT.SIZE */
|
||||
IISCONFIG = ((IISCONFIG & ~IIS_SIZE_MASK) | IIS_SIZE_16BIT);
|
||||
|
||||
/* FIFO.FORMAT */
|
||||
/* If BIT.SIZE < FIFO.FORMAT low bits will be 0 */
|
||||
|
@ -67,11 +67,11 @@ void i2s_reset(void)
|
|||
/* AS3514 can only operate as I2S Slave */
|
||||
IISCONFIG |= IIS_MASTER;
|
||||
/* Set I2S to 44.1kHz */
|
||||
outl((inl(0x70002808) & ~(0x1ff)) | 33, 0x70002808);
|
||||
outl(7, 0x60006080);
|
||||
IISCLK = (IISCLK & ~0x1ff) | 33;
|
||||
IISDIV = 7;
|
||||
IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE16);
|
||||
#elif defined (IRIVER_H10) || defined (IRIVER_H10_5GB)
|
||||
IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE_HALFWORD);
|
||||
IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE16_2);
|
||||
#else
|
||||
IISCONFIG = ((IISCONFIG & ~IIS_FIFO_FORMAT_MASK) | IIS_FIFO_FORMAT_LE32);
|
||||
#endif
|
||||
|
|
|
@ -29,11 +29,12 @@
|
|||
of working settings. DMA-compatible settings should be found for here, i2s,
|
||||
and codec setup using "arithmetic" the hardware supports like halfword
|
||||
swapping. Try to use 32-bit packed in IIS modes if possible. */
|
||||
#if defined(SANSA_C200) || defined(SANSA_E200)
|
||||
#if defined(SANSA_C200) || defined(SANSA_E200) \
|
||||
|| defined(IRIVER_H10) || defined(IRIVER_H10_5GB)
|
||||
/* 16-bit, L-R packed into 32 bits with left in the least significant halfword */
|
||||
#define SAMPLE_SIZE 16
|
||||
#define TRANSFER_SIZE 32
|
||||
#elif defined(IRIVER_H10) || defined(IRIVER_H10_5GB)
|
||||
#elif 0
|
||||
/* 16-bit, one left 16-bit sample followed by one right 16-bit sample */
|
||||
#define SAMPLE_SIZE 16
|
||||
#define TRANSFER_SIZE 16
|
||||
|
@ -294,8 +295,8 @@ static void play_stop_pcm(void)
|
|||
|
||||
void pcm_play_dma_start(const void *addr, size_t size)
|
||||
{
|
||||
dma_play_data.p = (void *)addr;
|
||||
dma_play_data.size = size;
|
||||
dma_play_data.p = (void *)(((uintptr_t)addr + 2) & ~3);
|
||||
dma_play_data.size = (size & ~3);
|
||||
|
||||
#if NUM_CORES > 1
|
||||
/* This will become more important later - and different ! */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue