diff options
author | Rajanikanth H.V <rajanikanth.hv@stericsson.com> | 2011-08-30 12:49:34 +0530 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 16:05:54 +0200 |
commit | 9af16c52799521c3df8bb4cef36f5c894c7cffe5 (patch) | |
tree | 17b7ae47587266a24d6f5b71548d71f02f194d0e | |
parent | 40ce868021c2a13c772b46223b85af0b774d11da (diff) |
pl011: migrate pl011 changes from 2.3v3.2
Ref:
ARM: ux500: uart: context save/restore uses relaxed
pl011: add ifdef
pl011: don't touch registers when clock is off
ux500: pl011: Workaround for UART registers lockup
Migrated Changes from: e1f512c, 852b78d, c2195fa, ac87c0e
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-ux500/devices-common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/uart.h | 17 | ||||
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 13 |
4 files changed, 13 insertions, 20 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 3cce4118027..83f071fc8a2 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -1039,6 +1039,7 @@ static pin_cfg_t mop500_pins_uart0[] = { #define PRCC_K_SOFTRST_SET 0x18 #define PRCC_K_SOFTRST_CLEAR 0x1C +/* pl011 reset */ static void ux500_uart0_reset(void) { void __iomem *prcc_rst_set, *prcc_rst_clr; diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h index 8ee40ff9825..cec9dce34fc 100644 --- a/arch/arm/mach-ux500/devices-common.h +++ b/arch/arm/mach-ux500/devices-common.h @@ -8,6 +8,8 @@ #ifndef __DEVICES_COMMON_H #define __DEVICES_COMMON_H +#include <linux/amba/serial.h> + extern struct amba_device * dbx500_add_amba_device(const char *name, resource_size_t base, int irq, void *pdata, unsigned int periphid); diff --git a/arch/arm/mach-ux500/include/mach/uart.h b/arch/arm/mach-ux500/include/mach/uart.h deleted file mode 100644 index 22feb1f84da..00000000000 --- a/arch/arm/mach-ux500/include/mach/uart.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (C) 2009 ST-Ericsson SA - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#ifndef _U8500_UART_H_ -#define _U8500_UART_H_ - -struct uart_amba_plat_data { - void (*init) (void); - void (*exit) (void); -}; - -#endif /* _U8500_UART_H_ */ diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index ff4761e482c..73bd1bc59df 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1236,7 +1236,7 @@ static irqreturn_t pl011_int(int irq, void *dev_id) do { writew(status & ~(UART011_TXIS|UART011_RTIS| UART011_RXIS), - uap->port.membase + UART011_ICR); + uap->port.membase + UART011_ICR); if (status & (UART011_RTIS|UART011_RXIS)) { if (pl011_dma_rx_running(uap)) @@ -1723,8 +1723,6 @@ static struct uart_ops amba_pl011_pops = { #endif }; -static struct uart_amba_port *amba_ports[UART_NR]; - #ifdef CONFIG_SERIAL_AMBA_PL011_CONSOLE static void pl011_console_putchar(struct uart_port *port, int ch) @@ -1961,7 +1959,12 @@ static int pl011_suspend(struct amba_device *dev, pm_message_t state) if (!uap) return -EINVAL; +#ifdef CONFIG_SERIAL_AMBA_PL011_CLOCK_CONTROL + cancel_delayed_work_sync(&uap->clk_off_work); + if (uap->clk_state == PL011_CLK_OFF) + return 0; +#endif return uart_suspend_port(&amba_reg, &uap->port); } @@ -1971,6 +1974,10 @@ static int pl011_resume(struct amba_device *dev) if (!uap) return -EINVAL; +#ifdef CONFIG_SERIAL_AMBA_PL011_CLOCK_CONTROL + if (uap->clk_state == PL011_CLK_OFF) + return 0; +#endif return uart_resume_port(&amba_reg, &uap->port); } |