diff options
author | Rob Purchase <shotofadds@rockbox.org> | 2008-04-21 20:16:18 +0000 |
---|---|---|
committer | Rob Purchase <shotofadds@rockbox.org> | 2008-04-21 20:16:18 +0000 |
commit | fd773cbda68fe0f0edc89507a57ddb6f500fd681 (patch) | |
tree | b24d89d188c88c92bd1dae536f86d6eb0f10fe62 | |
parent | 5d7d410a47f0c046a8250e4f64a61e80b2af87c2 (diff) |
A few preparations for the D2 PCM driver: move driver up to TCC780x level, move FIQ handler into PCM driver, add some new register defines, and remove those goddamn warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17209 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/SOURCES | 2 | ||||
-rw-r--r-- | firmware/export/tcc780x.h | 17 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/pcm-tcc780x.c (renamed from firmware/target/arm/tcc780x/cowond2/pcm-cowond2.c) | 22 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/system-tcc780x.c | 9 | ||||
-rw-r--r-- | firmware/target/arm/wmcodec-telechips.c | 1 |
5 files changed, 30 insertions, 21 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 6acf81d76b..bf4fb86af4 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -925,7 +925,7 @@ target/arm/tcc780x/kernel-tcc780x.c target/arm/tcc780x/timer-tcc780x.c target/arm/wmcodec-telechips.c target/arm/tcc780x/debug-tcc780x.c -target/arm/tcc780x/cowond2/pcm-cowond2.c +target/arm/tcc780x/pcm-tcc780x.c #endif /* BOOTLOADER */ #endif /* SIMULATOR */ #endif /* COWON_D2 */ diff --git a/firmware/export/tcc780x.h b/firmware/export/tcc780x.h index cff0a2e576..d88d05c417 100644 --- a/firmware/export/tcc780x.h +++ b/firmware/export/tcc780x.h @@ -73,7 +73,7 @@ #define PCLKCFG10 (*(volatile unsigned long *)0xF3000048) #define PCLKCFG11 (*(volatile unsigned long *)0xF300004C) #define PCLK_ADC (*(volatile unsigned long *)0xF3000050) -#define PCLKCFG13 (*(volatile unsigned long *)0xF3000054) +#define PCLK_DAI (*(volatile unsigned long *)0xF3000054) #define PCLKCFG14 (*(volatile unsigned long *)0xF3000058) #define PCLK_RFREQ (*(volatile unsigned long *)0xF300005C) #define PCLKCFG16 (*(volatile unsigned long *)0xF3000060) @@ -171,6 +171,21 @@ #define SDCFG1 (*(volatile unsigned long *)0xF1001000) #define MCFG1 (*(volatile unsigned long *)0xF1001008) +/* DAI */ + +#define DADO_L0 (*(volatile unsigned long *)0xF0059020) +#define DADO_R0 (*(volatile unsigned long *)0xF0059024) +#define DADO_L1 (*(volatile unsigned long *)0xF0059028) +#define DADO_R1 (*(volatile unsigned long *)0xF005902c) +#define DADO_L2 (*(volatile unsigned long *)0xF0059030) +#define DADO_R2 (*(volatile unsigned long *)0xF0059034) +#define DADO_L3 (*(volatile unsigned long *)0xF0059038) +#define DADO_R3 (*(volatile unsigned long *)0xF005903c) +#define DADO_L(_x_) (*(volatile unsigned int *)(0xF0059020+8*(_x_))) +#define DADO_R(_x_) (*(volatile unsigned int *)(0xF0059024+8*(_x_))) +#define DAMR (*(volatile unsigned long *)0xF0059040) +#define DAVC (*(volatile unsigned long *)0xF0059044) + /* Misc */ #define ECFG0 (*(volatile unsigned long *)0xF300500C) diff --git a/firmware/target/arm/tcc780x/cowond2/pcm-cowond2.c b/firmware/target/arm/tcc780x/pcm-tcc780x.c index 2d50f042d9..a9312749c8 100644 --- a/firmware/target/arm/tcc780x/cowond2/pcm-cowond2.c +++ b/firmware/target/arm/tcc780x/pcm-tcc780x.c @@ -25,62 +25,62 @@ void pcm_postinit(void) { - #warning function not implemented } const void * pcm_play_dma_get_peak_buffer(int *count) { - #warning function not implemented (void) count; return 0; } void pcm_play_dma_init(void) { - #warning function not implemented } void pcm_apply_settings(void) { - #warning function not implemented } void pcm_set_frequency(unsigned int frequency) { - #warning function not implemented (void) frequency; } void pcm_play_dma_start(const void *addr, size_t size) { - #warning function not implemented (void) addr; (void) size; } void pcm_play_dma_stop(void) { - #warning function not implemented } void pcm_play_lock(void) { - #warning function not implemented } void pcm_play_unlock(void) { - #warning function not implemented } void pcm_play_dma_pause(bool pause) { - #warning function not implemented (void) pause; } size_t pcm_get_bytes_waiting(void) { - #warning function not implemented return 0; } + +void fiq_handler(void) +{ + /* Clear FIQ status */ + CREQ = DAI_TX_IRQ_MASK | DAI_RX_IRQ_MASK; + + /* Return from FIQ */ + asm volatile ( + "subs pc, lr, #4 \r\n" + ); +} diff --git a/firmware/target/arm/tcc780x/system-tcc780x.c b/firmware/target/arm/tcc780x/system-tcc780x.c index c109b8ddda..54cd3ffcb6 100644 --- a/firmware/target/arm/tcc780x/system-tcc780x.c +++ b/firmware/target/arm/tcc780x/system-tcc780x.c @@ -142,12 +142,6 @@ void irq_handler(void) "subs pc, lr, #4 \n"); /* Return from IRQ */ } -void fiq_handler(void) -{ - asm volatile ( - "subs pc, lr, #4 \r\n" - ); -} #endif /* !defined(BOOTLOADER) */ @@ -254,7 +248,8 @@ void system_init(void) #if !defined(BOOTLOADER) - IRQSEL = -1; /* set all interrupts to be IRQs not FIQs */ + /* Set DAI interrupts as FIQ, all others are IRQ. */ + IRQSEL = ~(DAI_RX_IRQ_MASK | DAI_TX_IRQ_MASK); POL = 0x200108; /* IRQs 3,8,21 active low (as OF) */ MODE = 0x20ce07c0; /* IRQs 6-10,17-19,22-23,29 level-triggered (as OF) */ diff --git a/firmware/target/arm/wmcodec-telechips.c b/firmware/target/arm/wmcodec-telechips.c index 851158ca8d..0e42df9c20 100644 --- a/firmware/target/arm/wmcodec-telechips.c +++ b/firmware/target/arm/wmcodec-telechips.c @@ -38,7 +38,6 @@ void audiohw_init(void) { - #warning function not implemented } void wmcodec_write(int reg, int data) |