arm:omap:am335x - Add support for UART 2
authorHebbar, Gururaja <gururaja.hebbar@ti.com>
Fri, 16 Dec 2011 10:21:58 +0000 (15:51 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:14:41 +0000 (00:44 +0530)
Support for UART 2 is added. UART 2 is tested for working in Profile 3
by passing kernel boot args from u-boot as setenv bootargs
'console=ttyO2,115200n8......'

Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
arch/arm/mach-omap2/board-am335xevm.c
arch/arm/mach-omap2/mux33xx.c
arch/arm/mach-omap2/omap_hwmod_33xx_data.c

index cd8ca3ab958c856b2a12735f1f81dfe95aae7158..e83e0f9ce0491f3e2a198ae1f88026ef46e9aaaa 100644 (file)
@@ -585,6 +585,17 @@ static struct pinmux_config d_can_ia_pin_mux[] = {
        {NULL, 0},
 };
 
+/* Module pin mux for uart2 */
+static struct pinmux_config uart2_pin_mux[] = {
+       {"spi0_sclk.uart2_rxd", OMAP_MUX_MODE1 | AM33XX_SLEWCTRL_SLOW |
+                                               AM33XX_PIN_INPUT_PULLUP},
+       {"spi0_d0.uart2_txd", OMAP_MUX_MODE1 | AM33XX_PULL_UP |
+                                               AM33XX_PULL_DISA |
+                                               AM33XX_SLEWCTRL_SLOW},
+       {NULL, 0},
+};
+
+
 /*
 * @pin_mux - single module pin-mux structure which defines pin-mux
 *                      details for all its pins.
@@ -942,6 +953,13 @@ static void uart3_init(int evm_id, int profile)
        return;
 }
 
+/* setup uart2 */
+static void uart2_init(int evm_id, int profile)
+{
+       setup_pin_mux(uart2_pin_mux);
+       return;
+}
+
 /* NAND partition information */
 static struct mtd_partition am335x_nand_partitions[] = {
 /* All the partition sizes are listed in terms of NAND block size */
@@ -1389,6 +1407,7 @@ static struct evm_dev_cfg gen_purp_evm_dev_cfg[] = {
        {d_can_init,    DEV_ON_DGHTR_BRD, PROFILE_1},
        {matrix_keypad_init, DEV_ON_DGHTR_BRD, PROFILE_0},
        {volume_keys_init,  DEV_ON_DGHTR_BRD, PROFILE_0},
+       {uart2_init,    DEV_ON_DGHTR_BRD, PROFILE_3},
        {NULL, 0, 0},
 };
 
index a7e120f902f254f4a5aa6ce1aea0f4628882b12b..f3bc09a2f2fdeedc193a5c22ea451e0b32a1e319 100644 (file)
@@ -175,10 +175,10 @@ static struct omap_mux __initdata am33xx_muxmodes[] = {
                NULL, NULL, NULL, NULL),
        _AM33XX_MUXENTRY(LCD_DATA8, 0,
                "lcd_data8", "gpmc_a12", NULL, "mcasp0_aclkx",
-               NULL, NULL, NULL, NULL),
+               NULL, NULL, "uart2_ctsn", NULL),
        _AM33XX_MUXENTRY(LCD_DATA9, 0,
                "lcd_data9", "gpmc_a13", NULL, "mcasp0_fsx",
-               NULL, NULL, NULL, NULL),
+               NULL, NULL, "uart2_rtsn", NULL),
        _AM33XX_MUXENTRY(LCD_DATA10, 0,
                "lcd_data10", "gpmc_a14", NULL, "mcasp0_axr0",
                NULL, NULL, NULL, NULL),
@@ -285,10 +285,10 @@ static struct omap_mux __initdata am33xx_muxmodes[] = {
                "mdio_clk", NULL, NULL, NULL,
                "mmc0_sdwp", "mmc1_clk", "mmc2_clk", NULL),
        _AM33XX_MUXENTRY(SPI0_SCLK, 0,
-               "spi0_sclk", NULL, NULL, NULL,
+               "spi0_sclk", "uart2_rxd", NULL, NULL,
                NULL, NULL, NULL, "gpio0_2"),
        _AM33XX_MUXENTRY(SPI0_D0, 0,
-               "spi0_d0", NULL, NULL, NULL,
+               "spi0_d0", "uart2_txd", NULL, NULL,
                NULL, NULL, NULL, "gpio0_3"),
        _AM33XX_MUXENTRY(SPI0_D1, 0,
                "spi0_d1", "mmc1_sdwp", "i2c1_sda", NULL,
index 9dc1f5741de2af765ea27f51f7f8887b66c39702..cd9cadd70d379f2d16366b07b382cfc7b336c9e9 100644 (file)
@@ -2116,6 +2116,12 @@ static struct omap_hwmod am33xx_uart2_hwmod = {
 };
 
 /* uart3 */
+static struct omap_hwmod_dma_info uart3_edma_reqs[] = {
+       { .name = "tx", .dma_req = 30, },
+       { .name = "rx", .dma_req = 31, },
+       { .dma_req = -1 }
+};
+
 static struct omap_hwmod_addr_space am33xx_uart3_addr_space[] = {
        {
                .pa_start       = AM33XX_UART3_BASE,
@@ -2147,7 +2153,7 @@ static struct omap_hwmod am33xx_uart3_hwmod = {
        .mpu_irqs       = am33xx_uart3_irqs,
        .main_clk       = "uart3_fck",
        .clkdm_name     = "l4ls_clkdm",
-       .sdma_reqs      = uart1_edma_reqs,
+       .sdma_reqs      = uart3_edma_reqs,
        .prcm           = {
                .omap4  = {
                        .clkctrl_offs   = AM33XX_CM_PER_UART2_CLKCTRL_OFFSET,