From: Hebbar, Gururaja Date: Fri, 16 Dec 2011 10:21:58 +0000 (+0530) Subject: arm:omap:am335x - Add support for UART 2 X-Git-Url: https://git.ti.com/gitweb?p=sitara-epos%2Fsitara-epos-kernel.git;a=commitdiff_plain;h=c8f61532c454c98855fdbace073df8180469f309 arm:omap:am335x - Add support for UART 2 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 --- diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c index cd8ca3ab958c..e83e0f9ce049 100644 --- a/arch/arm/mach-omap2/board-am335xevm.c +++ b/arch/arm/mach-omap2/board-am335xevm.c @@ -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}, }; diff --git a/arch/arm/mach-omap2/mux33xx.c b/arch/arm/mach-omap2/mux33xx.c index a7e120f902f2..f3bc09a2f2fd 100644 --- a/arch/arm/mach-omap2/mux33xx.c +++ b/arch/arm/mach-omap2/mux33xx.c @@ -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, diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c index 9dc1f5741de2..cd9cadd70d37 100644 --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c @@ -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,