aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-omap/mcbsp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/arch-omap/mcbsp.h')
-rw-r--r--include/asm-arm/arch-omap/mcbsp.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/include/asm-arm/arch-omap/mcbsp.h b/include/asm-arm/arch-omap/mcbsp.h
index e79d98ab2ab6..ed0dde4f7219 100644
--- a/include/asm-arm/arch-omap/mcbsp.h
+++ b/include/asm-arm/arch-omap/mcbsp.h
@@ -37,6 +37,11 @@
37#define OMAP1610_MCBSP2_BASE 0xfffb1000 37#define OMAP1610_MCBSP2_BASE 0xfffb1000
38#define OMAP1610_MCBSP3_BASE 0xe1017000 38#define OMAP1610_MCBSP3_BASE 0xe1017000
39 39
40#define OMAP24XX_MCBSP1_BASE 0x48074000
41#define OMAP24XX_MCBSP2_BASE 0x48076000
42
43#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730)
44
40#define OMAP_MCBSP_REG_DRR2 0x00 45#define OMAP_MCBSP_REG_DRR2 0x00
41#define OMAP_MCBSP_REG_DRR1 0x02 46#define OMAP_MCBSP_REG_DRR1 0x02
42#define OMAP_MCBSP_REG_DXR2 0x04 47#define OMAP_MCBSP_REG_DXR2 0x04
@@ -71,9 +76,62 @@
71 76
72#define OMAP_MAX_MCBSP_COUNT 3 77#define OMAP_MAX_MCBSP_COUNT 3
73 78
79#define AUDIO_MCBSP_DATAWRITE (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1)
80#define AUDIO_MCBSP_DATAREAD (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1)
81
82#define AUDIO_MCBSP OMAP_MCBSP1
83#define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX
84#define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX
85
86#elif defined(CONFIG_ARCH_OMAP24XX)
87
88#define OMAP_MCBSP_REG_DRR2 0x00
89#define OMAP_MCBSP_REG_DRR1 0x04
90#define OMAP_MCBSP_REG_DXR2 0x08
91#define OMAP_MCBSP_REG_DXR1 0x0C
92#define OMAP_MCBSP_REG_SPCR2 0x10
93#define OMAP_MCBSP_REG_SPCR1 0x14
94#define OMAP_MCBSP_REG_RCR2 0x18
95#define OMAP_MCBSP_REG_RCR1 0x1C
96#define OMAP_MCBSP_REG_XCR2 0x20
97#define OMAP_MCBSP_REG_XCR1 0x24
98#define OMAP_MCBSP_REG_SRGR2 0x28
99#define OMAP_MCBSP_REG_SRGR1 0x2C
100#define OMAP_MCBSP_REG_MCR2 0x30
101#define OMAP_MCBSP_REG_MCR1 0x34
102#define OMAP_MCBSP_REG_RCERA 0x38
103#define OMAP_MCBSP_REG_RCERB 0x3C
104#define OMAP_MCBSP_REG_XCERA 0x40
105#define OMAP_MCBSP_REG_XCERB 0x44
106#define OMAP_MCBSP_REG_PCR0 0x48
107#define OMAP_MCBSP_REG_RCERC 0x4C
108#define OMAP_MCBSP_REG_RCERD 0x50
109#define OMAP_MCBSP_REG_XCERC 0x54
110#define OMAP_MCBSP_REG_XCERD 0x58
111#define OMAP_MCBSP_REG_RCERE 0x5C
112#define OMAP_MCBSP_REG_RCERF 0x60
113#define OMAP_MCBSP_REG_XCERE 0x64
114#define OMAP_MCBSP_REG_XCERF 0x68
115#define OMAP_MCBSP_REG_RCERG 0x6C
116#define OMAP_MCBSP_REG_RCERH 0x70
117#define OMAP_MCBSP_REG_XCERG 0x74
118#define OMAP_MCBSP_REG_XCERH 0x78
119
120#define OMAP_MAX_MCBSP_COUNT 2
121
122#define AUDIO_MCBSP_DATAWRITE (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1)
123#define AUDIO_MCBSP_DATAREAD (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1)
124
125#define AUDIO_MCBSP OMAP_MCBSP2
126#define AUDIO_DMA_TX OMAP24XX_DMA_MCBSP2_TX
127#define AUDIO_DMA_RX OMAP24XX_DMA_MCBSP2_RX
128
129#endif
130
74#define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg) 131#define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg)
75#define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg) 132#define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg)
76 133
134
77/************************** McBSP SPCR1 bit definitions ***********************/ 135/************************** McBSP SPCR1 bit definitions ***********************/
78#define RRST 0x0001 136#define RRST 0x0001
79#define RRDY 0x0002 137#define RRDY 0x0002
@@ -195,6 +253,10 @@ typedef enum {
195 OMAP_MCBSP3, 253 OMAP_MCBSP3,
196} omap_mcbsp_id; 254} omap_mcbsp_id;
197 255
256typedef int __bitwise omap_mcbsp_io_type_t;
257#define OMAP_MCBSP_IRQ_IO ((__force omap_mcbsp_io_type_t) 1)
258#define OMAP_MCBSP_POLL_IO ((__force omap_mcbsp_io_type_t) 2)
259
198typedef enum { 260typedef enum {
199 OMAP_MCBSP_WORD_8 = 0, 261 OMAP_MCBSP_WORD_8 = 0,
200 OMAP_MCBSP_WORD_12, 262 OMAP_MCBSP_WORD_12,
@@ -246,6 +308,9 @@ u32 omap_mcbsp_recv_word(unsigned int id);
246 308
247int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); 309int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length);
248int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); 310int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length);
311int omap_mcbsp_spi_master_xmit_word_poll(unsigned int id, u32 word);
312int omap_mcbsp_spi_master_recv_word_poll(unsigned int id, u32 * word);
313
249 314
250/* SPI specific API */ 315/* SPI specific API */
251void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg); 316void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg);