diff --git a/platform/msm8916/gpio.c b/platform/msm8916/gpio.c index 145b81ce3..b6547c7c2 100644 --- a/platform/msm8916/gpio.c +++ b/platform/msm8916/gpio.c @@ -56,16 +56,26 @@ uint32_t gpio_status(uint32_t gpio) return readl(GPIO_IN_OUT_ADDR(gpio)) & GPIO_IN; } -/* Configure gpio for blsp uart 2 */ +/* Configure gpio for blsp uart 1 or 2 */ void gpio_config_uart_dm(uint8_t id) { - /* configure rx gpio */ - gpio_tlmm_config(5, 2, GPIO_INPUT, GPIO_NO_PULL, - GPIO_8MA, GPIO_DISABLE); + if (id == 1) { + /* configure rx gpio */ + gpio_tlmm_config(1, 2, GPIO_INPUT, GPIO_NO_PULL, + GPIO_8MA, GPIO_DISABLE); - /* configure tx gpio */ - gpio_tlmm_config(4, 2, GPIO_OUTPUT, GPIO_NO_PULL, - GPIO_8MA, GPIO_DISABLE); + /* configure tx gpio */ + gpio_tlmm_config(0, 2, GPIO_OUTPUT, GPIO_NO_PULL, + GPIO_8MA, GPIO_DISABLE); + } else { + /* configure rx gpio */ + gpio_tlmm_config(5, 2, GPIO_INPUT, GPIO_NO_PULL, + GPIO_8MA, GPIO_DISABLE); + + /* configure tx gpio */ + gpio_tlmm_config(4, 2, GPIO_OUTPUT, GPIO_NO_PULL, + GPIO_8MA, GPIO_DISABLE); + } } void gpio_config_blsp_i2c(uint8_t blsp_id, uint8_t qup_id) diff --git a/platform/msm8916/include/platform/iomap.h b/platform/msm8916/include/platform/iomap.h index 494f6cf5f..358d0b3a3 100644 --- a/platform/msm8916/include/platform/iomap.h +++ b/platform/msm8916/include/platform/iomap.h @@ -142,6 +142,12 @@ /* UART */ #define BLSP1_AHB_CBCR (CLK_CTL_BASE + 0x1008) +#define BLSP1_UART1_APPS_CBCR (CLK_CTL_BASE + 0x203C) +#define BLSP1_UART1_APPS_CMD_RCGR (CLK_CTL_BASE + 0x2044) +#define BLSP1_UART1_APPS_CFG_RCGR (CLK_CTL_BASE + 0x2048) +#define BLSP1_UART1_APPS_M (CLK_CTL_BASE + 0x204C) +#define BLSP1_UART1_APPS_N (CLK_CTL_BASE + 0x2050) +#define BLSP1_UART1_APPS_D (CLK_CTL_BASE + 0x2054) #define BLSP1_UART2_APPS_CBCR (CLK_CTL_BASE + 0x302C) #define BLSP1_UART2_APPS_CMD_RCGR (CLK_CTL_BASE + 0x3034) #define BLSP1_UART2_APPS_CFG_RCGR (CLK_CTL_BASE + 0x3038) diff --git a/platform/msm8916/msm8916-clock.c b/platform/msm8916/msm8916-clock.c index 43df860ca..744fafb1a 100644 --- a/platform/msm8916/msm8916-clock.c +++ b/platform/msm8916/msm8916-clock.c @@ -253,6 +253,35 @@ static struct clk_freq_tbl ftbl_gcc_blsp1_2_uart1_6_apps_clk[] = F_END }; +static struct rcg_clk blsp1_uart1_apps_clk_src = +{ + .cmd_reg = (uint32_t *) BLSP1_UART1_APPS_CMD_RCGR, + .cfg_reg = (uint32_t *) BLSP1_UART1_APPS_CFG_RCGR, + .m_reg = (uint32_t *) BLSP1_UART1_APPS_M, + .n_reg = (uint32_t *) BLSP1_UART1_APPS_N, + .d_reg = (uint32_t *) BLSP1_UART1_APPS_D, + + .set_rate = clock_lib2_rcg_set_rate_mnd, + .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk, + .current_freq = &rcg_dummy_freq, + + .c = { + .dbg_name = "blsp1_uart1_apps_clk", + .ops = &clk_ops_rcg_mnd, + }, +}; + +static struct branch_clk gcc_blsp1_uart1_apps_clk = +{ + .cbcr_reg = (uint32_t *) BLSP1_UART1_APPS_CBCR, + .parent = &blsp1_uart1_apps_clk_src.c, + + .c = { + .dbg_name = "gcc_blsp1_uart1_apps_clk", + .ops = &clk_ops_branch, + }, +}; + static struct rcg_clk blsp1_uart2_apps_clk_src = { .cmd_reg = (uint32_t *) BLSP1_UART2_APPS_CMD_RCGR, @@ -596,6 +625,9 @@ static struct clk_lookup msm_clocks_8916[] = CLK_LOOKUP("sdc2_iface_clk", gcc_sdcc2_ahb_clk.c), CLK_LOOKUP("sdc2_core_clk", gcc_sdcc2_apps_clk.c), + CLK_LOOKUP("uart1_iface_clk", gcc_blsp1_ahb_clk.c), + CLK_LOOKUP("uart1_core_clk", gcc_blsp1_uart1_apps_clk.c), + CLK_LOOKUP("uart2_iface_clk", gcc_blsp1_ahb_clk.c), CLK_LOOKUP("uart2_core_clk", gcc_blsp1_uart2_apps_clk.c),