diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-05-14 17:31:45 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-05-14 17:31:45 +0200 |
commit | 66a2886d867343eff6bf2646bea2c923d0cbf620 (patch) | |
tree | ad44dcca4fa410ab2c16b4964f6c19571421b4df /arch/arm/plat-spear | |
parent | d2819f80d465672b09c2f4cb52303b7f951c4d0f (diff) | |
parent | f613e220aebfafb653f7ce264950c15c99e27f2a (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.S | 2 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/hardware.h | 17 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/uncompress.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-spear/pl080.c | 1 | ||||
-rw-r--r-- | arch/arm/plat-spear/restart.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-spear/time.c | 40 |
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 02b160a1ec9..ab3de721c5d 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 @@ */ #include <linux/amba/serial.h> -#include <mach/hardware.h> +#include <mach/spear.h> .macro addruart, rp, rv, tmp 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 70187d763e2..00000000000 --- a/arch/arm/plat-spear/include/plat/hardware.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * arch/arm/plat-spear/include/plat/hardware.h - * - * Hardware definitions for SPEAr - * - * Copyright (C) 2010 ST Microelectronics - * Viresh Kumar<viresh.kumar@st.com> - * - * 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 __PLAT_HARDWARE_H -#define __PLAT_HARDWARE_H - -#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 1bf84527aee..6dd455bafdf 100644 --- a/arch/arm/plat-spear/include/plat/uncompress.h +++ b/arch/arm/plat-spear/include/plat/uncompress.h @@ -13,7 +13,7 @@ #include <linux/io.h> #include <linux/amba/serial.h> -#include <mach/hardware.h> +#include <mach/spear.h> #ifndef __PLAT_UNCOMPRESS_H #define __PLAT_UNCOMPRESS_H diff --git a/arch/arm/plat-spear/pl080.c b/arch/arm/plat-spear/pl080.c index d53d75e1af5..a56a067717c 100644 --- a/arch/arm/plat-spear/pl080.c +++ b/arch/arm/plat-spear/pl080.c @@ -17,6 +17,7 @@ #include <linux/err.h> #include <linux/io.h> #include <linux/spinlock_types.h> +#include <mach/spear.h> #include <mach/misc_regs.h> static spinlock_t lock = __SPIN_LOCK_UNLOCKED(x); diff --git a/arch/arm/plat-spear/restart.c b/arch/arm/plat-spear/restart.c index 16f203e78d8..4471a232713 100644 --- a/arch/arm/plat-spear/restart.c +++ b/arch/arm/plat-spear/restart.c @@ -13,7 +13,7 @@ #include <linux/io.h> #include <asm/system_misc.h> #include <asm/hardware/sp810.h> -#include <mach/hardware.h> +#include <mach/spear.h> #include <mach/generic.h> void spear_restart(char mode, const char *cmd) diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c index 1c94989d725..03321af5de9 100644 --- a/arch/arm/plat-spear/time.c +++ b/arch/arm/plat-spear/time.c @@ -15,14 +15,15 @@ #include <linux/err.h> #include <linux/init.h> #include <linux/interrupt.h> +#include <linux/ioport.h> #include <linux/io.h> #include <linux/kernel.h> +#include <linux/of_irq.h> +#include <linux/of_address.h> #include <linux/time.h> #include <linux/irq.h> #include <asm/mach/time.h> #include <mach/generic.h> -#include <mach/hardware.h> -#include <mach/irqs.h> /* * We would use TIMER0 and TIMER1 as clockevent and clocksource. @@ -175,7 +176,7 @@ static struct irqaction spear_timer_irq = { .handler = spear_timer_interrupt }; -static void __init spear_clockevent_init(void) +static void __init spear_clockevent_init(int irq) { u32 tick_rate; @@ -195,22 +196,35 @@ static void __init spear_clockevent_init(void) clockevents_register_device(&clkevt); - setup_irq(SPEAR_GPT0_CHAN0_IRQ, &spear_timer_irq); + setup_irq(irq, &spear_timer_irq); } -void __init spear_setup_timer(void) +const static struct of_device_id timer_of_match[] __initconst = { + { .compatible = "st,spear-timer", }, + { }, +}; + +void __init spear_setup_of_timer(void) { - int ret; + struct device_node *np; + int irq, ret; + + np = of_find_matching_node(NULL, timer_of_match); + if (!np) { + pr_err("%s: No timer passed via DT\n", __func__); + return; + } - if (!request_mem_region(SPEAR_GPT0_BASE, SZ_1K, "gpt0")) { - pr_err("%s:cannot get IO addr\n", __func__); + irq = irq_of_parse_and_map(np, 0); + if (!irq) { + pr_err("%s: No irq passed for timer via DT\n", __func__); return; } - gpt_base = (void __iomem *)ioremap(SPEAR_GPT0_BASE, SZ_1K); + gpt_base = of_iomap(np, 0); if (!gpt_base) { - pr_err("%s:ioremap failed for gpt\n", __func__); - goto err_mem; + pr_err("%s: of iomap failed\n", __func__); + return; } gpt_clk = clk_get_sys("gpt0", NULL); @@ -225,7 +239,7 @@ void __init spear_setup_timer(void) goto err_prepare_enable_clk; } - spear_clockevent_init(); + spear_clockevent_init(irq); spear_clocksource_init(); return; @@ -234,6 +248,4 @@ err_prepare_enable_clk: clk_put(gpt_clk); err_iomap: iounmap(gpt_base); -err_mem: - release_mem_region(SPEAR_GPT0_BASE, SZ_1K); } |