diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-11-17 19:24:23 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-11-17 19:38:27 +0100 |
commit | 379df2793efdca18e91cb8570f844ad1f83eb609 (patch) | |
tree | 6f61e172528c1fdade27517301787e4c0b174243 /arch/arm/mach-integrator/core.c | |
parent | ARM: integrator: delete static UART1 mapping (diff) | |
download | linux-379df2793efdca18e91cb8570f844ad1f83eb609.tar.xz linux-379df2793efdca18e91cb8570f844ad1f83eb609.zip |
ARM: integrator: push down SC dependencies
This pushes the dependencies on the Integrator/AP system
controller (SC) down into the PCI V3 driver and the
AP-specific board file.
First, the platform data for the PL010 UART is moved into
the integrator_ap.c board file, and the Integrator/CP is
assigned with NULL pdata. This way the callback functions
can reference the dynamically remapped AP syscon address
in both the ATAG and DT boot path, and this remapping
is localized to the board file.
Second the PCIv3 driver is making its own dynamic remapping
of the SC for the few registers it is using. When we
convert the PCIv3 driver over to using device tree having a
dynamically assigned base address will be useful, but we
will have to use the definition from <mach/platform.h> for
now, the only improvement is that it's done dynamically.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-integrator/core.c')
-rw-r--r-- | arch/arm/mach-integrator/core.c | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 161fbf8596bd..39c060f75e47 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c @@ -18,7 +18,6 @@ #include <linux/memblock.h> #include <linux/sched.h> #include <linux/smp.h> -#include <linux/termios.h> #include <linux/amba/bus.h> #include <linux/amba/serial.h> #include <linux/io.h> @@ -47,10 +46,10 @@ static AMBA_APB_DEVICE(rtc, "rtc", 0, INTEGRATOR_RTC_BASE, INTEGRATOR_RTC_IRQ, NULL); static AMBA_APB_DEVICE(uart0, "uart0", 0, - INTEGRATOR_UART0_BASE, INTEGRATOR_UART0_IRQ, &integrator_uart_data); + INTEGRATOR_UART0_BASE, INTEGRATOR_UART0_IRQ, NULL); static AMBA_APB_DEVICE(uart1, "uart1", 0, - INTEGRATOR_UART1_BASE, INTEGRATOR_UART1_IRQ, &integrator_uart_data); + INTEGRATOR_UART1_BASE, INTEGRATOR_UART1_IRQ, NULL); static AMBA_APB_DEVICE(kmi0, "kmi0", 0, KMI0_BASE, KMI0_IRQ, NULL); static AMBA_APB_DEVICE(kmi1, "kmi1", 0, KMI1_BASE, KMI1_IRQ, NULL); @@ -78,6 +77,8 @@ int __init integrator_init(bool is_cp) uart1_device.periphid = 0x00041010; kmi0_device.periphid = 0x00041050; kmi1_device.periphid = 0x00041050; + uart0_device.dev.platform_data = &ap_uart_data; + uart1_device.dev.platform_data = &ap_uart_data; } for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { @@ -90,49 +91,6 @@ int __init integrator_init(bool is_cp) #endif -/* - * On the Integrator platform, the port RTS and DTR are provided by - * bits in the following SC_CTRLS register bits: - * RTS DTR - * UART0 7 6 - * UART1 5 4 - */ -#define SC_CTRLC __io_address(INTEGRATOR_SC_CTRLC) -#define SC_CTRLS __io_address(INTEGRATOR_SC_CTRLS) - -static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) -{ - unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask; - u32 phybase = dev->res.start; - - if (phybase == INTEGRATOR_UART0_BASE) { - /* UART0 */ - rts_mask = 1 << 4; - dtr_mask = 1 << 5; - } else { - /* UART1 */ - rts_mask = 1 << 6; - dtr_mask = 1 << 7; - } - - if (mctrl & TIOCM_RTS) - ctrlc |= rts_mask; - else - ctrls |= rts_mask; - - if (mctrl & TIOCM_DTR) - ctrlc |= dtr_mask; - else - ctrls |= dtr_mask; - - __raw_writel(ctrls, SC_CTRLS); - __raw_writel(ctrlc, SC_CTRLC); -} - -struct amba_pl010_data integrator_uart_data = { - .set_mctrl = integrator_uart_set_mctrl, -}; - static DEFINE_RAW_SPINLOCK(cm_lock); /** |