arm:omap:am33xx: Register McASP Platform on AM335x EVM
authorHebbar, Gururaja <gururaja.hebbar@ti.com>
Tue, 4 Oct 2011 15:35:46 +0000 (21:05 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:14:25 +0000 (00:44 +0530)
This patch adds the hardware info like base addresses, EDMA events,
interrupt nos. and other module specific data for the McASP IP.

Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
arch/arm/include/asm/hardware/asp.h
arch/arm/mach-omap2/board-am335xevm.c
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/devices.h
arch/arm/mach-omap2/include/mach/sram.h [new file with mode: 0644]
arch/arm/plat-omap/include/plat/am33xx.h

index 08305cfcb4f70867c1835e386f475abcd37311f7..0d5c0bf4c3c1df38882446dd4cc5418857ea36c2 100644 (file)
@@ -120,7 +120,7 @@ struct snd_platform_data {
 enum {
        MCASP_VERSION_1 = 0,    /* DM646x */
        MCASP_VERSION_2,        /* DA8xx/OMAPL1x */
-       MCASP_VERSION_3,
+       MCASP_VERSION_3,        /* AM33xx */
 };
 
 enum dm365_clk_input_pin {
index 43f2212e6efbe50c8e710b8d2772aa1bddc9f679..7e93a649cf9b612f456393e01f2a10fed84a9ad5 100644 (file)
@@ -34,6 +34,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/hardware/asp.h>
 
 #include <plat/irqs.h>
 #include <plat/board.h>
 #include <plat/lcdc.h>
 #include <plat/usb.h>
 
+#include "board-flash.h"
+#include "mux.h"
+#include "devices.h"
+
 static const struct display_panel disp_panel = {
        WVGA,
        32,
@@ -104,8 +109,25 @@ static struct platform_device tsc_device = {
        .resource       = tsc_resources,
 };
 
-#include "board-flash.h"
-#include "mux.h"
+static u8 am335x_iis_serializer_direction1[] = {
+       INACTIVE_MODE,  INACTIVE_MODE,  TX_MODE,        RX_MODE,
+       INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
+       INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
+       INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
+};
+
+static struct snd_platform_data am335x_evm_snd_data1 = {
+       .tx_dma_offset  = 0x46400000,   /* McASP1 */
+       .rx_dma_offset  = 0x46400000,
+       .op_mode        = DAVINCI_MCASP_IIS_MODE,
+       .num_serializer = ARRAY_SIZE(am335x_iis_serializer_direction1),
+       .tdm_slots      = 2,
+       .serial_dir     = am335x_iis_serializer_direction1,
+       .asp_chan_q     = EVENTQ_2,
+       .version        = MCASP_VERSION_3,
+       .txnumevt       = 1,
+       .rxnumevt       = 1,
+};
 
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
@@ -360,6 +382,16 @@ static struct pinmux_config i2c1_pin_mux[] = {
        {NULL, 0},
 };
 
+/* Module pin mux for mcasp1 */
+static struct pinmux_config mcasp1_pin_mux[] = {
+       {"mii1_crs.mcasp1_aclkx", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
+       {"mii1_rxerr.mcasp1_fsx", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
+       {"mii1_col.mcasp1_axr2", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
+       {"rmii1_refclk.mcasp1_axr3", OMAP_MUX_MODE4 |
+                                               AM33XX_PIN_INPUT_PULLDOWN},
+       {NULL, 0},
+};
+
 /*
 * @pin_mux - single module pin-mux structure which defines pin-mux
 *                      details for all its pins.
@@ -595,6 +627,7 @@ static void evm_nand_init(int evm_id, int profile)
 
 static struct i2c_board_info am335x_i2c_boardinfo1[] = {
        {
+               I2C_BOARD_INFO("tlv320aic3x", 0x1b),
        },
 };
 
@@ -606,6 +639,15 @@ static void i2c1_init(int evm_id, int profile)
        return;
 }
 
+/* Setup McASP 1 */
+static void mcasp1_init(int evm_id, int profile)
+{
+       /* Configure McASP */
+       setup_pin_mux(mcasp1_pin_mux);
+       am335x_register_mcasp1(&am335x_evm_snd_data1);
+       return;
+}
+
 /* Low-Cost EVM */
 static struct evm_dev_cfg low_cost_evm_dev_cfg[] = {
        {rgmii1_init,   DEV_ON_BASEBOARD, PROFILE_NONE},
@@ -631,6 +673,7 @@ static struct evm_dev_cfg gen_purp_evm_dev_cfg[] = {
        {evm_nand_init, DEV_ON_DGHTR_BRD,
                (PROFILE_ALL & ~PROFILE_2 & ~PROFILE_3)},
        {i2c1_init,     DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3 | PROFILE_7)},
+       {mcasp1_init,   DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3 | PROFILE_7)},
        {NULL, 0, 0},
 };
 
@@ -654,6 +697,7 @@ static struct evm_dev_cfg ip_phn_evm_dev_cfg[] = {
        {usb1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
        {evm_nand_init, DEV_ON_DGHTR_BRD, PROFILE_NONE},
        {i2c1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
+       {mcasp1_init,   DEV_ON_DGHTR_BRD, PROFILE_NONE},
        {NULL, 0, 0},
 };
 
index 0ecef254b6de25174effd12e419c5c9a344d5821..d9457105d66ee3bd7985d487d6d557405b9a552b 100644 (file)
@@ -32,6 +32,8 @@
 #include <mach/edma.h>
 #endif
 
+#include <asm/hardware/asp.h>
+
 #include <plat/tc.h>
 #include <plat/board.h>
 #include <plat/mcbsp.h>
@@ -174,6 +176,61 @@ void __init am33xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata)
 
 }
 
+#if defined(CONFIG_SND_AM335X_SOC_EVM) || \
+                               defined(CONFIG_SND_AM335X_SOC_EVM_MODULE)
+static struct resource am335x_mcasp1_resource[] = {
+       {
+               .name = "mcasp1",
+               .start = AM33XX_ASP1_BASE,
+               .end = AM33XX_ASP1_BASE + (SZ_1K * 12) - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       /* TX event */
+       {
+               .start = AM33XX_DMA_MCASP1_X,
+               .end = AM33XX_DMA_MCASP1_X,
+               .flags = IORESOURCE_DMA,
+       },
+       /* RX event */
+       {
+               .start = AM33XX_DMA_MCASP1_R,
+               .end = AM33XX_DMA_MCASP1_R,
+               .flags = IORESOURCE_DMA,
+       },
+};
+
+static struct platform_device am335x_mcasp1_device = {
+       .name = "davinci-mcasp",
+       .id = 1,
+       .num_resources = ARRAY_SIZE(am335x_mcasp1_resource),
+       .resource = am335x_mcasp1_resource,
+};
+
+void __init am335x_register_mcasp1(struct snd_platform_data *pdata)
+{
+       am335x_mcasp1_device.dev.platform_data = pdata;
+       platform_device_register(&am335x_mcasp1_device);
+}
+
+#else
+void __init am335x_register_mcasp1(struct snd_platform_data *pdata) {}
+#endif
+
+#if (defined(CONFIG_SND_AM33XX_SOC) || (defined(CONFIG_SND_AM33XX_SOC_MODULE)))
+struct platform_device am33xx_pcm_device = {
+       .name           = "davinci-pcm-audio",
+       .id             = -1,
+};
+
+static void am33xx_init_pcm(void)
+{
+       platform_device_register(&am33xx_pcm_device);
+}
+
+#else
+static inline void am33xx_init_pcm(void) {}
+#endif
+
 static struct resource omap3isp_resources[] = {
        {
                .start          = OMAP3430_ISP_BASE,
@@ -1030,6 +1087,7 @@ static int __init omap2_init_devices(void)
        omap_init_aes();
        omap_init_vout();
        am33xx_register_edma();
+       am33xx_init_pcm();
 
        return 0;
 }
index f61eb6e5d136632cd73d9757d7e26bcd77616f4a..10e4603874b4374abc611c3e417706c24b249d0c 100644 (file)
@@ -16,4 +16,6 @@ struct isp_platform_data;
 
 int omap3_init_camera(struct isp_platform_data *pdata);
 
+void __init am335x_register_mcasp1(struct snd_platform_data *pdata);
+
 #endif
diff --git a/arch/arm/mach-omap2/include/mach/sram.h b/arch/arm/mach-omap2/include/mach/sram.h
new file mode 100644 (file)
index 0000000..7869e2f
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * arch/arm/mach-omap2/include/mach/sram.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ARCH_ARM_SRAM_H
+#define __ARCH_ARM_SRAM_H
+
+#include <plat/sram.h>
+
+#endif
index 4a8816a40bcaed28056ceae50a9620cfc1c45959..8daf63e1b17076e50a8e0930555d700f3fe3e93f 100644 (file)
@@ -64,4 +64,7 @@
 
 #define AM33XX_ELM_BASE                0x48080000
 
+#define AM33XX_ASP0_BASE       0x48038000
+#define AM33XX_ASP1_BASE       0x4803C000
+
 #endif /* __ASM_ARCH_AM33XX_H */