aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-spear
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-05-14 11:31:45 -0400
committerArnd Bergmann <arnd@arndb.de>2012-05-14 11:31:45 -0400
commit66a2886d867343eff6bf2646bea2c923d0cbf620 (patch)
treead44dcca4fa410ab2c16b4964f6c19571421b4df /arch/arm/plat-spear
parentd2819f80d465672b09c2f4cb52303b7f951c4d0f (diff)
parentf613e220aebfafb653f7ce264950c15c99e27f2a (diff)
Merge branch 'spear/dt' into spear/clock
Conflicts: arch/arm/mach-spear3xx/clock.c arch/arm/mach-spear3xx/include/mach/generic.h arch/arm/mach-spear3xx/include/mach/misc_regs.h arch/arm/mach-spear3xx/spear320.c arch/arm/mach-spear6xx/clock.c arch/arm/mach-spear6xx/include/mach/misc_regs.h Resolve even more merge conflicts. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/plat-spear')
-rw-r--r--arch/arm/plat-spear/include/plat/debug-macro.S2
-rw-r--r--arch/arm/plat-spear/include/plat/hardware.h17
-rw-r--r--arch/arm/plat-spear/include/plat/uncompress.h2
-rw-r--r--arch/arm/plat-spear/pl080.c1
-rw-r--r--arch/arm/plat-spear/restart.c2
-rw-r--r--arch/arm/plat-spear/time.c40
6 files changed, 30 insertions, 34 deletions
diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S
index 02b160a1ec9b..ab3de721c5db 100644
--- a/arch/arm/plat-spear/include/plat/debug-macro.S
+++ b/arch/arm/plat-spear/include/plat/debug-macro.S
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include <linux/amba/serial.h> 14#include <linux/amba/serial.h>
15#include <mach/hardware.h> 15#include <mach/spear.h>
16 16
17 .macro addruart, rp, rv, tmp 17 .macro addruart, rp, rv, tmp
18 mov \rp, #SPEAR_DBG_UART_BASE @ Physical base 18 mov \rp, #SPEAR_DBG_UART_BASE @ Physical base
diff --git a/arch/arm/plat-spear/include/plat/hardware.h b/arch/arm/plat-spear/include/plat/hardware.h
deleted file mode 100644
index 70187d763e26..000000000000
--- a/arch/arm/plat-spear/include/plat/hardware.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * arch/arm/plat-spear/include/plat/hardware.h
3 *
4 * Hardware definitions for SPEAr
5 *
6 * Copyright (C) 2010 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_HARDWARE_H
15#define __PLAT_HARDWARE_H
16
17#endif /* __PLAT_HARDWARE_H */
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h
index 1bf84527aee4..6dd455bafdfd 100644
--- a/arch/arm/plat-spear/include/plat/uncompress.h
+++ b/arch/arm/plat-spear/include/plat/uncompress.h
@@ -13,7 +13,7 @@
13 13
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/amba/serial.h> 15#include <linux/amba/serial.h>
16#include <mach/hardware.h> 16#include <mach/spear.h>
17 17
18#ifndef __PLAT_UNCOMPRESS_H 18#ifndef __PLAT_UNCOMPRESS_H
19#define __PLAT_UNCOMPRESS_H 19#define __PLAT_UNCOMPRESS_H
diff --git a/arch/arm/plat-spear/pl080.c b/arch/arm/plat-spear/pl080.c
index d53d75e1af5e..a56a067717c1 100644
--- a/arch/arm/plat-spear/pl080.c
+++ b/arch/arm/plat-spear/pl080.c
@@ -17,6 +17,7 @@
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/spinlock_types.h> 19#include <linux/spinlock_types.h>
20#include <mach/spear.h>
20#include <mach/misc_regs.h> 21#include <mach/misc_regs.h>
21 22
22static spinlock_t lock = __SPIN_LOCK_UNLOCKED(x); 23static spinlock_t lock = __SPIN_LOCK_UNLOCKED(x);
diff --git a/arch/arm/plat-spear/restart.c b/arch/arm/plat-spear/restart.c
index 16f203e78d89..4471a232713a 100644
--- a/arch/arm/plat-spear/restart.c
+++ b/arch/arm/plat-spear/restart.c
@@ -13,7 +13,7 @@
13#include <linux/io.h> 13#include <linux/io.h>
14#include <asm/system_misc.h> 14#include <asm/system_misc.h>
15#include <asm/hardware/sp810.h> 15#include <asm/hardware/sp810.h>
16#include <mach/hardware.h> 16#include <mach/spear.h>
17#include <mach/generic.h> 17#include <mach/generic.h>
18 18
19void spear_restart(char mode, const char *cmd) 19void spear_restart(char mode, const char *cmd)
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c
index 1c94989d725f..03321af5de9f 100644
--- a/arch/arm/plat-spear/time.c
+++ b/arch/arm/plat-spear/time.c
@@ -15,14 +15,15 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/ioport.h>
18#include <linux/io.h> 19#include <linux/io.h>
19#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/of_irq.h>
22#include <linux/of_address.h>
20#include <linux/time.h> 23#include <linux/time.h>
21#include <linux/irq.h> 24#include <linux/irq.h>
22#include <asm/mach/time.h> 25#include <asm/mach/time.h>
23#include <mach/generic.h> 26#include <mach/generic.h>
24#include <mach/hardware.h>
25#include <mach/irqs.h>
26 27
27/* 28/*
28 * We would use TIMER0 and TIMER1 as clockevent and clocksource. 29 * We would use TIMER0 and TIMER1 as clockevent and clocksource.
@@ -175,7 +176,7 @@ static struct irqaction spear_timer_irq = {
175 .handler = spear_timer_interrupt 176 .handler = spear_timer_interrupt
176}; 177};
177 178
178static void __init spear_clockevent_init(void) 179static void __init spear_clockevent_init(int irq)
179{ 180{
180 u32 tick_rate; 181 u32 tick_rate;
181 182
@@ -195,22 +196,35 @@ static void __init spear_clockevent_init(void)
195 196
196 clockevents_register_device(&clkevt); 197 clockevents_register_device(&clkevt);
197 198
198 setup_irq(SPEAR_GPT0_CHAN0_IRQ, &spear_timer_irq); 199 setup_irq(irq, &spear_timer_irq);
199} 200}
200 201
201void __init spear_setup_timer(void) 202const static struct of_device_id timer_of_match[] __initconst = {
203 { .compatible = "st,spear-timer", },
204 { },
205};
206
207void __init spear_setup_of_timer(void)
202{ 208{
203 int ret; 209 struct device_node *np;
210 int irq, ret;
211
212 np = of_find_matching_node(NULL, timer_of_match);
213 if (!np) {
214 pr_err("%s: No timer passed via DT\n", __func__);
215 return;
216 }
204 217
205 if (!request_mem_region(SPEAR_GPT0_BASE, SZ_1K, "gpt0")) { 218 irq = irq_of_parse_and_map(np, 0);
206 pr_err("%s:cannot get IO addr\n", __func__); 219 if (!irq) {
220 pr_err("%s: No irq passed for timer via DT\n", __func__);
207 return; 221 return;
208 } 222 }
209 223
210 gpt_base = (void __iomem *)ioremap(SPEAR_GPT0_BASE, SZ_1K); 224 gpt_base = of_iomap(np, 0);
211 if (!gpt_base) { 225 if (!gpt_base) {
212 pr_err("%s:ioremap failed for gpt\n", __func__); 226 pr_err("%s: of iomap failed\n", __func__);
213 goto err_mem; 227 return;
214 } 228 }
215 229
216 gpt_clk = clk_get_sys("gpt0", NULL); 230 gpt_clk = clk_get_sys("gpt0", NULL);
@@ -225,7 +239,7 @@ void __init spear_setup_timer(void)
225 goto err_prepare_enable_clk; 239 goto err_prepare_enable_clk;
226 } 240 }
227 241
228 spear_clockevent_init(); 242 spear_clockevent_init(irq);
229 spear_clocksource_init(); 243 spear_clocksource_init();
230 244
231 return; 245 return;
@@ -234,6 +248,4 @@ err_prepare_enable_clk:
234 clk_put(gpt_clk); 248 clk_put(gpt_clk);
235err_iomap: 249err_iomap:
236 iounmap(gpt_base); 250 iounmap(gpt_base);
237err_mem:
238 release_mem_region(SPEAR_GPT0_BASE, SZ_1K);
239} 251}