aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorChaithrika U S <chaithrika@ti.com>2009-08-11 17:03:25 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-08-26 04:55:53 -0400
commit491214e1f8129844289869bb6c231dc4542b11e3 (patch)
tree44b52d050a3d34fc7281ff304840ee782224a10c /arch
parente33ef5e3b368b31705d3024ee6a326f2a85a78fb (diff)
davinci: Audio support for DA850/OMAP-L138 EVM
Define resources for McASP used on DA850/OMAP-L138 EVM, add platform device defintion and Pin Mux configurations. Signed-off-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c29
-rw-r--r--arch/arm/mach-davinci/da850.c39
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c34
-rw-r--r--arch/arm/mach-davinci/include/mach/asp.h7
-rw-r--r--arch/arm/mach-davinci/include/mach/mux.h25
5 files changed, 133 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index d98934629604..52bfe4cba25c 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -38,6 +38,28 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = {
38 .enabled_uarts = 0x7, 38 .enabled_uarts = 0x7,
39}; 39};
40 40
41/* davinci da850 evm audio machine driver */
42static u8 da850_iis_serializer_direction[] = {
43 INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
44 INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
45 INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, TX_MODE,
46 RX_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
47};
48
49static struct snd_platform_data da850_evm_snd_data = {
50 .tx_dma_offset = 0x2000,
51 .rx_dma_offset = 0x2000,
52 .op_mode = DAVINCI_MCASP_IIS_MODE,
53 .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction),
54 .tdm_slots = 2,
55 .serial_dir = da850_iis_serializer_direction,
56 .eventq_no = EVENTQ_1,
57 .version = MCASP_VERSION_2,
58 .txnumevt = 1,
59 .rxnumevt = 1,
60};
61
62
41static __init void da850_evm_init(void) 63static __init void da850_evm_init(void)
42{ 64{
43 struct davinci_soc_info *soc_info = &davinci_soc_info; 65 struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -86,6 +108,13 @@ static __init void da850_evm_init(void)
86 */ 108 */
87 __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30); 109 __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
88 __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); 110 __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
111
112 ret = da8xx_pinmux_setup(da850_mcasp_pins);
113 if (ret)
114 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n",
115 ret);
116
117 da8xx_init_mcasp(0, &da850_evm_snd_data);
89} 118}
90 119
91#ifdef CONFIG_SERIAL_8250_CONSOLE 120#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index c5efc515df4f..e440c09c5576 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -290,6 +290,13 @@ static struct clk emac_clk = {
290 .psc_ctlr = 1, 290 .psc_ctlr = 1,
291}; 291};
292 292
293static struct clk mcasp_clk = {
294 .name = "mcasp",
295 .parent = &pll0_sysclk2,
296 .lpsc = DA8XX_LPSC1_McASP0,
297 .psc_ctlr = 1,
298};
299
293static struct davinci_clk da850_clks[] = { 300static struct davinci_clk da850_clks[] = {
294 CLK(NULL, "ref", &ref_clk), 301 CLK(NULL, "ref", &ref_clk),
295 CLK(NULL, "pll0", &pll0_clk), 302 CLK(NULL, "pll0", &pll0_clk),
@@ -327,6 +334,7 @@ static struct davinci_clk da850_clks[] = {
327 CLK(NULL, "arm", &arm_clk), 334 CLK(NULL, "arm", &arm_clk),
328 CLK(NULL, "rmii", &rmii_clk), 335 CLK(NULL, "rmii", &rmii_clk),
329 CLK("davinci_emac.1", NULL, &emac_clk), 336 CLK("davinci_emac.1", NULL, &emac_clk),
337 CLK("davinci-mcasp.0", NULL, &mcasp_clk),
330 CLK(NULL, NULL, NULL), 338 CLK(NULL, NULL, NULL),
331}; 339};
332 340
@@ -373,6 +381,30 @@ static const struct mux_config da850_pins[] = {
373 MUX_CFG(DA850, MII_RXD_0, 3, 28, 15, 8, false) 381 MUX_CFG(DA850, MII_RXD_0, 3, 28, 15, 8, false)
374 MUX_CFG(DA850, MDIO_CLK, 4, 0, 15, 8, false) 382 MUX_CFG(DA850, MDIO_CLK, 4, 0, 15, 8, false)
375 MUX_CFG(DA850, MDIO_D, 4, 4, 15, 8, false) 383 MUX_CFG(DA850, MDIO_D, 4, 4, 15, 8, false)
384 /* McASP function */
385 MUX_CFG(DA850, ACLKR, 0, 0, 15, 1, false)
386 MUX_CFG(DA850, ACLKX, 0, 4, 15, 1, false)
387 MUX_CFG(DA850, AFSR, 0, 8, 15, 1, false)
388 MUX_CFG(DA850, AFSX, 0, 12, 15, 1, false)
389 MUX_CFG(DA850, AHCLKR, 0, 16, 15, 1, false)
390 MUX_CFG(DA850, AHCLKX, 0, 20, 15, 1, false)
391 MUX_CFG(DA850, AMUTE, 0, 24, 15, 1, false)
392 MUX_CFG(DA850, AXR_15, 1, 0, 15, 1, false)
393 MUX_CFG(DA850, AXR_14, 1, 4, 15, 1, false)
394 MUX_CFG(DA850, AXR_13, 1, 8, 15, 1, false)
395 MUX_CFG(DA850, AXR_12, 1, 12, 15, 1, false)
396 MUX_CFG(DA850, AXR_11, 1, 16, 15, 1, false)
397 MUX_CFG(DA850, AXR_10, 1, 20, 15, 1, false)
398 MUX_CFG(DA850, AXR_9, 1, 24, 15, 1, false)
399 MUX_CFG(DA850, AXR_8, 1, 28, 15, 1, false)
400 MUX_CFG(DA850, AXR_7, 2, 0, 15, 1, false)
401 MUX_CFG(DA850, AXR_6, 2, 4, 15, 1, false)
402 MUX_CFG(DA850, AXR_5, 2, 8, 15, 1, false)
403 MUX_CFG(DA850, AXR_4, 2, 12, 15, 1, false)
404 MUX_CFG(DA850, AXR_3, 2, 16, 15, 1, false)
405 MUX_CFG(DA850, AXR_2, 2, 20, 15, 1, false)
406 MUX_CFG(DA850, AXR_1, 2, 24, 15, 1, false)
407 MUX_CFG(DA850, AXR_0, 2, 28, 15, 1, false)
376#endif 408#endif
377}; 409};
378 410
@@ -410,6 +442,13 @@ const short da850_cpgmac_pins[] __initdata = {
410 -1 442 -1
411}; 443};
412 444
445const short da850_mcasp_pins[] __initdata = {
446 DA850_AHCLKX, DA850_ACLKX, DA850_AFSX,
447 DA850_AHCLKR, DA850_ACLKR, DA850_AFSR, DA850_AMUTE,
448 DA850_AXR_11, DA850_AXR_12,
449 -1
450};
451
413/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */ 452/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
414static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = { 453static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = {
415 [IRQ_DA8XX_COMMTX] = 7, 454 [IRQ_DA8XX_COMMTX] = 7,
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index fe0baafcf610..1882eef3aead 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -309,6 +309,34 @@ static struct platform_device da830_mcasp1_device = {
309 .resource = da830_mcasp1_resources, 309 .resource = da830_mcasp1_resources,
310}; 310};
311 311
312static struct resource da850_mcasp_resources[] = {
313 {
314 .name = "mcasp",
315 .start = DAVINCI_DA8XX_MCASP0_REG_BASE,
316 .end = DAVINCI_DA8XX_MCASP0_REG_BASE + (SZ_1K * 12) - 1,
317 .flags = IORESOURCE_MEM,
318 },
319 /* TX event */
320 {
321 .start = DAVINCI_DA8XX_DMA_MCASP0_AXEVT,
322 .end = DAVINCI_DA8XX_DMA_MCASP0_AXEVT,
323 .flags = IORESOURCE_DMA,
324 },
325 /* RX event */
326 {
327 .start = DAVINCI_DA8XX_DMA_MCASP0_AREVT,
328 .end = DAVINCI_DA8XX_DMA_MCASP0_AREVT,
329 .flags = IORESOURCE_DMA,
330 },
331};
332
333static struct platform_device da850_mcasp_device = {
334 .name = "davinci-mcasp",
335 .id = 0,
336 .num_resources = ARRAY_SIZE(da850_mcasp_resources),
337 .resource = da850_mcasp_resources,
338};
339
312int __init da8xx_register_emac(void) 340int __init da8xx_register_emac(void)
313{ 341{
314 return platform_device_register(&da8xx_emac_device); 342 return platform_device_register(&da8xx_emac_device);
@@ -316,8 +344,12 @@ int __init da8xx_register_emac(void)
316 344
317void __init da8xx_init_mcasp(int id, struct snd_platform_data *pdata) 345void __init da8xx_init_mcasp(int id, struct snd_platform_data *pdata)
318{ 346{
319 if (id == 1) { /* DA830/OMAP-L137 has 3 instances of McASP */ 347 /* DA830/OMAP-L137 has 3 instances of McASP */
348 if (cpu_is_davinci_da830() && id == 1) {
320 da830_mcasp1_device.dev.platform_data = pdata; 349 da830_mcasp1_device.dev.platform_data = pdata;
321 platform_device_register(&da830_mcasp1_device); 350 platform_device_register(&da830_mcasp1_device);
351 } else if (cpu_is_davinci_da850()) {
352 da850_mcasp_device.dev.platform_data = pdata;
353 platform_device_register(&da850_mcasp_device);
322 } 354 }
323} 355}
diff --git a/arch/arm/mach-davinci/include/mach/asp.h b/arch/arm/mach-davinci/include/mach/asp.h
index f3c97ac3425c..18e4ce34ece6 100644
--- a/arch/arm/mach-davinci/include/mach/asp.h
+++ b/arch/arm/mach-davinci/include/mach/asp.h
@@ -15,6 +15,9 @@
15#define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000 15#define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000
16#define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800 16#define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800
17 17
18/* Bases of da850/da830 McASP0 register banks */
19#define DAVINCI_DA8XX_MCASP0_REG_BASE 0x01D00000
20
18/* Bases of da830 McASP1 register banks */ 21/* Bases of da830 McASP1 register banks */
19#define DAVINCI_DA830_MCASP1_REG_BASE 0x01D04000 22#define DAVINCI_DA830_MCASP1_REG_BASE 0x01D04000
20 23
@@ -29,6 +32,10 @@
29#define DAVINCI_DM646X_DMA_MCASP0_AREVT0 9 32#define DAVINCI_DM646X_DMA_MCASP0_AREVT0 9
30#define DAVINCI_DM646X_DMA_MCASP1_AXEVT1 12 33#define DAVINCI_DM646X_DMA_MCASP1_AXEVT1 12
31 34
35/* EDMA channels of da850/da830 McASP0 */
36#define DAVINCI_DA8XX_DMA_MCASP0_AREVT 0
37#define DAVINCI_DA8XX_DMA_MCASP0_AXEVT 1
38
32/* EDMA channels of da830 McASP1 */ 39/* EDMA channels of da830 McASP1 */
33#define DAVINCI_DA830_DMA_MCASP1_AREVT 2 40#define DAVINCI_DA830_DMA_MCASP1_AREVT 2
34#define DAVINCI_DA830_DMA_MCASP1_AXEVT 3 41#define DAVINCI_DA830_DMA_MCASP1_AXEVT 3
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h
index 8676680fc5b6..82d751461856 100644
--- a/arch/arm/mach-davinci/include/mach/mux.h
+++ b/arch/arm/mach-davinci/include/mach/mux.h
@@ -750,6 +750,31 @@ enum davinci_da850_index {
750 DA850_MII_RXD_0, 750 DA850_MII_RXD_0,
751 DA850_MDIO_CLK, 751 DA850_MDIO_CLK,
752 DA850_MDIO_D, 752 DA850_MDIO_D,
753
754 /* McASP function */
755 DA850_ACLKR,
756 DA850_ACLKX,
757 DA850_AFSR,
758 DA850_AFSX,
759 DA850_AHCLKR,
760 DA850_AHCLKX,
761 DA850_AMUTE,
762 DA850_AXR_15,
763 DA850_AXR_14,
764 DA850_AXR_13,
765 DA850_AXR_12,
766 DA850_AXR_11,
767 DA850_AXR_10,
768 DA850_AXR_9,
769 DA850_AXR_8,
770 DA850_AXR_7,
771 DA850_AXR_6,
772 DA850_AXR_5,
773 DA850_AXR_4,
774 DA850_AXR_3,
775 DA850_AXR_2,
776 DA850_AXR_1,
777 DA850_AXR_0,
753}; 778};
754 779
755#ifdef CONFIG_DAVINCI_MUX 780#ifdef CONFIG_DAVINCI_MUX