diff options
author | Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> | 2011-04-14 16:11:57 +0530 |
---|---|---|
committer | Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> | 2011-04-20 10:31:51 +0200 |
commit | ff8da858cb74331041806a67d2c370647a94aac9 (patch) | |
tree | e92825082ac68e4ed804443d33400188c14e0430 /arch | |
parent | 87e4bf0745a0d5147a23154c8771bd5478d861e7 (diff) |
ux500: uart0: fix glitch in the tx pin in tty_open
when tty port0 is opened a glitch is seen in the tx line
of uart0. This happens in __pl011_startup() when tx fifo
interrupt is provoked into asserting.
Now uart0 pins are enabled (alt function) only when init
is complete and turned back to gpio when closed.
ST-Ericsson Linux next: - 336280
ST-Ericsson ID: 334262
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I809eac2ab8aea643dd304fb80256b291cce75b59
Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/20831
Reviewed-by: QATEST
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-pins.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 31 |
2 files changed, 52 insertions, 4 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c index 703cf038e6f..6716da9c578 100644 --- a/arch/arm/mach-ux500/board-mop500-pins.c +++ b/arch/arm/mach-ux500/board-mop500-pins.c @@ -93,10 +93,18 @@ static pin_cfg_t mop500_pins_common[] = { GPIO207_MC4_DAT4 | PIN_INPUT_PULLUP, /* UART */ - GPIO0_U0_CTSn | PIN_INPUT_PULLUP, - GPIO1_U0_RTSn | PIN_OUTPUT_HIGH, - GPIO2_U0_RXD | PIN_INPUT_PULLUP, - GPIO3_U0_TXD | PIN_OUTPUT_HIGH, + /* uart-0 pins gpio configuration should be + * kept intact to prevent glitch in tx line + * when tty dev is opened. Later these pins + * are configured to uart mop500_pins_uart0 + * + * It will be replaced with uart configuration + * once the issue is solved. + */ + GPIO0_GPIO | PIN_INPUT_PULLUP, + GPIO1_GPIO | PIN_OUTPUT_HIGH, + GPIO2_GPIO | PIN_INPUT_PULLUP, + GPIO3_GPIO | PIN_OUTPUT_LOW, GPIO29_U2_RXD | PIN_INPUT_PULLUP, GPIO30_U2_TXD | PIN_OUTPUT_HIGH, @@ -230,6 +238,14 @@ static pin_cfg_t u9500_21_pins[] = { GPIO4_U1_RXD | PIN_INPUT_PULLUP, GPIO5_U1_TXD | PIN_OUTPUT_HIGH, }; + +static UX500_PINS(mop500_pins_uart0, + GPIO0_U0_CTSn | PIN_INPUT_PULLUP, + GPIO1_U0_RTSn | PIN_OUTPUT_HIGH, + GPIO2_U0_RXD | PIN_INPUT_PULLUP, + GPIO3_U0_TXD | PIN_OUTPUT_HIGH, +); + /* * I2C */ @@ -315,6 +331,7 @@ static UX500_PINS(mop500_pins_ske, static struct ux500_pin_lookup mop500_pins[] = { PIN_LOOKUP("mcde-dpi", &mop500_pins_mcde_dpi), PIN_LOOKUP("mcde-tvout", &mop500_pins_mcde_tvout), + PIN_LOOKUP("uart0", &mop500_pins_uart0), PIN_LOOKUP("nmk-i2c.0", &mop500_pins_i2c0), PIN_LOOKUP("nmk-i2c.1", &mop500_pins_i2c1), PIN_LOOKUP("nmk-i2c.2", &mop500_pins_i2c2), diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 965bfc6921f..5e059f9c2bf 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -1198,6 +1198,7 @@ static struct wlan1200_platform_data hrefv50_plat_data = { #define PRCC_K_SOFTRST_SET 0x18 #define PRCC_K_SOFTRST_CLEAR 0x1C +static struct ux500_pins *uart0_pins; static void ux500_pl011_reset(void) { void __iomem *prcc_rst_set, *prcc_rst_clr; @@ -1216,7 +1217,37 @@ static void ux500_pl011_reset(void) udelay(1); } +static void ux500_pl011_init(void) +{ + int ret; + + if (!uart0_pins) { + uart0_pins = ux500_pins_get("uart0"); + if (!uart0_pins) { + pr_err("pl011: uart0 pins_get failed\n"); + return; + } + } + + ret = ux500_pins_enable(uart0_pins); + if (ret) + pr_err("pl011: uart0 pins_enable failed\n"); +} + +static void ux500_pl011_exit(void) +{ + int ret; + + if (uart0_pins) { + ret = ux500_pins_disable(uart0_pins); + if (ret) + pr_err("pl011: uart0 pins_disable failed\n"); + } +} + static struct uart_amba_plat_data ux500_pl011_pdata = { + .init = ux500_pl011_init, + .exit = ux500_pl011_exit, .reset = ux500_pl011_reset, }; |