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/common.h | 2 + arch/arm/mach-integrator/core.c | 8 ++- arch/arm/mach-integrator/integrator_ap.c | 109 ++++++++++++++++++++++--------- arch/arm/mach-integrator/integrator_cp.c | 84 ++++++++++++++++++------ 4 files changed, 150 insertions(+), 53 deletions(-) (limited to 'arch/arm/mach-integrator') diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h index c4338e2fc63..c3ff21b5ea2 100644 --- a/arch/arm/mach-integrator/common.h +++ b/arch/arm/mach-integrator/common.h @@ -1,3 +1,5 @@ +#include +extern struct amba_pl010_data integrator_uart_data; void integrator_init_early(void); int integrator_init(bool is_cp); void integrator_reserve(void); diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 268eadf6d3e..1772c024e78 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, }; diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 57add86c4a6..8cd05607435 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c @@ -36,6 +36,7 @@ #include #include #include +#include #include