From 9bf26a180578b92890ed77890d4e9e9807adcda3 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 6 Sep 2012 09:06:52 +0100 Subject: ARM: 7514/1: integrator: call common init function from machine There is currently a common integrator_init() function set up to be called from an arch_initcall(). The problem is that it is using machine_is_integrator() which is not working with device tree, let's call this from respective machine initilization function and add a parameter to tell whether it's the Integrator/AP or Integrator/CP instead. There are still machine_is*() calls in the Integrator machines directory, but this one needs to be fixed lest we don't even get a UART console on the Integrator/AP after a Device Tree boot. Acked-by: Arnd Bergmann Signed-off-by: Linus Walleij Signed-off-by: Russell King --- arch/arm/mach-integrator/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-integrator/core.c') diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 3fa6c51..5ba4bc8 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c @@ -61,7 +61,7 @@ static struct amba_device *amba_devs[] __initdata = { &kmi1_device, }; -static int __init integrator_init(void) +int __init integrator_init(bool is_cp) { int i; @@ -70,7 +70,7 @@ static int __init integrator_init(void) * hard-code them. The Integator/CP and forward have proper cell IDs. * Else we leave them undefined to the bus driver can autoprobe them. */ - if (machine_is_integrator()) { + if (!is_cp) { rtc_device.periphid = 0x00041030; uart0_device.periphid = 0x00041010; uart1_device.periphid = 0x00041010; @@ -86,8 +86,6 @@ static int __init integrator_init(void) return 0; } -arch_initcall(integrator_init); - /* * On the Integrator platform, the port RTS and DTR are provided by * bits in the following SC_CTRLS register bits: -- cgit v1.1 From 2c88543b953581f70f05bf133a1b8f196c48ef23 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 6 Sep 2012 09:07:27 +0100 Subject: ARM: 7515/1: integrator: check PL010 base address from resource In the PL010 UART callback a comparison against the location of the statically allocated PL010 device is done to figure out which UART is doing the callback. This does not play well with dynamic devices such as in device tree, so let's check the base address of the memory resource inside the amba_device instead. Acked-by: Arnd Bergmann Signed-off-by: Linus Walleij Signed-off-by: Russell King --- arch/arm/mach-integrator/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-integrator/core.c') diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 5ba4bc8..268eadf 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c @@ -99,11 +99,14 @@ int __init integrator_init(bool is_cp) 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 (dev == &uart0_device) { + if (phybase == INTEGRATOR_UART0_BASE) { + /* UART0 */ rts_mask = 1 << 4; dtr_mask = 1 << 5; } else { + /* UART1 */ rts_mask = 1 << 6; dtr_mask = 1 << 7; } -- cgit v1.1 From 4672cddff21f6edde857aa4b523bbc1bfc741cf8 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 6 Sep 2012 09:08:47 +0100 Subject: ARM: 7518/1: integrator: convert AMBA devices to device tree This converts the AMBA (PrimeCell) devices on the Integrator/AP and Integrator/CP over to probing from the Device Tree if the kernel is compiled for Device Tree support. We continue to #ifdef out all non-DT code and vice versa on respective boot type to get a clean cut. We need to add a bunch of auxdata (compare to the Versatile) to handle bus names and callbacks alike. Signed-off-by: Linus Walleij Signed-off-by: Russell King --- arch/arm/mach-integrator/core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-integrator/core.c') diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 268eadf..1772c02 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c @@ -33,7 +33,9 @@ #include #include -static struct amba_pl010_data integrator_uart_data; +#include "common.h" + +#ifdef CONFIG_ATAGS #define INTEGRATOR_RTC_IRQ { IRQ_RTCINT } #define INTEGRATOR_UART0_IRQ { IRQ_UARTINT0 } @@ -86,6 +88,8 @@ int __init integrator_init(bool is_cp) return 0; } +#endif + /* * On the Integrator platform, the port RTS and DTR are provided by * bits in the following SC_CTRLS register bits: @@ -125,7 +129,7 @@ static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *bas __raw_writel(ctrlc, SC_CTRLC); } -static struct amba_pl010_data integrator_uart_data = { +struct amba_pl010_data integrator_uart_data = { .set_mctrl = integrator_uart_set_mctrl, }; -- cgit v1.1