aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 23:18:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 23:18:05 -0400
commitac5761a650d22dd7dfad4d417463a0981d2da0a4 (patch)
treec01a46a889dde74fbbb05d3b2da22387bb4875c6 /arch/arm/mach-ux500
parent25498e5b3df931a3d52a6e0642ae242e4ee19488 (diff)
parenteed1e576507b52e03e549e0c9e0c747978122403 (diff)
Merge branch 'next/timer' of git://git.linaro.org/people/arnd/arm-soc
* 'next/timer' of git://git.linaro.org/people/arnd/arm-soc: clocksource: fixup ux500 build problems ARM: omap: use __devexit_p in dmtimer driver ARM: ux500: Reprogram timers upon resume ARM: plat-nomadik: timer: Export reset functions ARM: plat-nomadik: timer: Add support for periodic timers ARM: ux500: Move timer code to separate file ARM: ux500: add support for clocksource DBX500 PRCMU clocksource: add DBX500 PRCMU Timer support ARM: plat-nomadik: MTU sched_clock as an option ARM: OMAP: dmtimer: add error handling to export APIs ARM: OMAP: dmtimer: low-power mode support ARM: OMAP: dmtimer: skip reserved timers ARM: OMAP: dmtimer: pm_runtime support ARM: OMAP: dmtimer: switch-over to platform device driver ARM: OMAP: dmtimer: platform driver ARM: OMAP2+: dmtimer: convert to platform devices ARM: OMAP1: dmtimer: conversion to platform devices ARM: OMAP2+: dmtimer: add device names to flck nodes ARM: OMAP: Add support for dmtimer v2 ip
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r--arch/arm/mach-ux500/Makefile2
-rw-r--r--arch/arm/mach-ux500/cpu.c29
-rw-r--r--arch/arm/mach-ux500/include/mach/db5500-regs.h2
-rw-r--r--arch/arm/mach-ux500/include/mach/db8500-regs.h3
-rw-r--r--arch/arm/mach-ux500/timer.c68
5 files changed, 75 insertions, 29 deletions
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 9fd00a6d4248..6bd2f451c185 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5obj-y := clock.o cpu.o devices.o devices-common.o \ 5obj-y := clock.o cpu.o devices.o devices-common.o \
6 id.o usb.o 6 id.o usb.o timer.o
7obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 7obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
8obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o dma-db5500.o 8obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o dma-db5500.o
9obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o 9obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index 252e8b3c5706..1405d0eb7edb 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -10,12 +10,12 @@
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/mfd/db8500-prcmu.h> 11#include <linux/mfd/db8500-prcmu.h>
12#include <linux/mfd/db5500-prcmu.h> 12#include <linux/mfd/db5500-prcmu.h>
13#include <linux/clksrc-dbx500-prcmu.h>
13 14
14#include <asm/hardware/gic.h> 15#include <asm/hardware/gic.h>
15#include <asm/mach/map.h> 16#include <asm/mach/map.h>
16#include <asm/localtimer.h> 17#include <asm/localtimer.h>
17 18
18#include <plat/mtu.h>
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <mach/setup.h> 20#include <mach/setup.h>
21#include <mach/devices.h> 21#include <mach/devices.h>
@@ -50,30 +50,3 @@ void __init ux500_init_irq(void)
50 prcmu_early_init(); 50 prcmu_early_init();
51 clk_init(); 51 clk_init();
52} 52}
53
54static void __init ux500_timer_init(void)
55{
56#ifdef CONFIG_LOCAL_TIMERS
57 /* Setup the local timer base */
58 if (cpu_is_u5500())
59 twd_base = __io_address(U5500_TWD_BASE);
60 else if (cpu_is_u8500())
61 twd_base = __io_address(U8500_TWD_BASE);
62 else
63 ux500_unknown_soc();
64#endif
65 if (cpu_is_u5500())
66 mtu_base = __io_address(U5500_MTU0_BASE);
67 else if (cpu_is_u8500ed())
68 mtu_base = __io_address(U8500_MTU0_BASE_ED);
69 else if (cpu_is_u8500())
70 mtu_base = __io_address(U8500_MTU0_BASE);
71 else
72 ux500_unknown_soc();
73
74 nmdk_timer_init();
75}
76
77struct sys_timer ux500_timer = {
78 .init = ux500_timer_init,
79};
diff --git a/arch/arm/mach-ux500/include/mach/db5500-regs.h b/arch/arm/mach-ux500/include/mach/db5500-regs.h
index 6ad983294103..994b5fe6f85a 100644
--- a/arch/arm/mach-ux500/include/mach/db5500-regs.h
+++ b/arch/arm/mach-ux500/include/mach/db5500-regs.h
@@ -61,6 +61,8 @@
61#define U5500_SCR_BASE (U5500_PER4_BASE + 0x5000) 61#define U5500_SCR_BASE (U5500_PER4_BASE + 0x5000)
62#define U5500_DMC_BASE (U5500_PER4_BASE + 0x6000) 62#define U5500_DMC_BASE (U5500_PER4_BASE + 0x6000)
63#define U5500_PRCMU_BASE (U5500_PER4_BASE + 0x7000) 63#define U5500_PRCMU_BASE (U5500_PER4_BASE + 0x7000)
64#define U5500_PRCMU_TIMER_3_BASE (U5500_PER4_BASE + 0x07338)
65#define U5500_PRCMU_TIMER_4_BASE (U5500_PER4_BASE + 0x07450)
64#define U5500_MSP1_BASE (U5500_PER4_BASE + 0x9000) 66#define U5500_MSP1_BASE (U5500_PER4_BASE + 0x9000)
65#define U5500_GPIO2_BASE (U5500_PER4_BASE + 0xA000) 67#define U5500_GPIO2_BASE (U5500_PER4_BASE + 0xA000)
66#define U5500_CDETECT_BASE (U5500_PER4_BASE + 0xF000) 68#define U5500_CDETECT_BASE (U5500_PER4_BASE + 0xF000)
diff --git a/arch/arm/mach-ux500/include/mach/db8500-regs.h b/arch/arm/mach-ux500/include/mach/db8500-regs.h
index 049997109cf9..751b0e6938d4 100644
--- a/arch/arm/mach-ux500/include/mach/db8500-regs.h
+++ b/arch/arm/mach-ux500/include/mach/db8500-regs.h
@@ -102,10 +102,13 @@
102#define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000) 102#define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000)
103#define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000) 103#define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000)
104#define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000) 104#define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000)
105#define U8500_PRCMU_TIMER_3_BASE (U8500_PER4_BASE + 0x07338)
106#define U8500_PRCMU_TIMER_4_BASE (U8500_PER4_BASE + 0x07450)
105#define U8500_PRCMU_TCDM_BASE_V1 (U8500_PER4_BASE + 0x0f000) 107#define U8500_PRCMU_TCDM_BASE_V1 (U8500_PER4_BASE + 0x0f000)
106#define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x68000) 108#define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x68000)
107#define U8500_PRCMU_TCPM_BASE (U8500_PER4_BASE + 0x60000) 109#define U8500_PRCMU_TCPM_BASE (U8500_PER4_BASE + 0x60000)
108 110
111
109/* per3 base addresses */ 112/* per3 base addresses */
110#define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) 113#define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000)
111#define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000) 114#define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000)
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c
new file mode 100644
index 000000000000..aea467d04ff7
--- /dev/null
+++ b/arch/arm/mach-ux500/timer.c
@@ -0,0 +1,68 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * License Terms: GNU General Public License v2
5 * Author: Mattias Wallin <mattias.wallin@stericsson.com> for ST-Ericsson
6 */
7#include <linux/io.h>
8#include <linux/errno.h>
9#include <linux/clksrc-dbx500-prcmu.h>
10
11#include <asm/localtimer.h>
12
13#include <plat/mtu.h>
14
15#include <mach/setup.h>
16#include <mach/hardware.h>
17
18static void __init ux500_timer_init(void)
19{
20 void __iomem *prcmu_timer_base;
21
22 if (cpu_is_u5500()) {
23#ifdef CONFIG_LOCAL_TIMERS
24 twd_base = __io_address(U5500_TWD_BASE);
25#endif
26 mtu_base = __io_address(U5500_MTU0_BASE);
27 prcmu_timer_base = __io_address(U5500_PRCMU_TIMER_3_BASE);
28 } else if (cpu_is_u8500()) {
29#ifdef CONFIG_LOCAL_TIMERS
30 twd_base = __io_address(U8500_TWD_BASE);
31#endif
32 mtu_base = __io_address(U8500_MTU0_BASE);
33 prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE);
34 } else {
35 ux500_unknown_soc();
36 }
37
38 /*
39 * Here we register the timerblocks active in the system.
40 * Localtimers (twd) is started when both cpu is up and running.
41 * MTU register a clocksource, clockevent and sched_clock.
42 * Since the MTU is located in the VAPE power domain
43 * it will be cleared in sleep which makes it unsuitable.
44 * We however need it as a timer tick (clockevent)
45 * during boot to calibrate delay until twd is started.
46 * RTC-RTT have problems as timer tick during boot since it is
47 * depending on delay which is not yet calibrated. RTC-RTT is in the
48 * always-on powerdomain and is used as clockevent instead of twd when
49 * sleeping.
50 * The PRCMU timer 4(3 for DB5500) register a clocksource and
51 * sched_clock with higher rating then MTU since is always-on.
52 *
53 */
54
55 nmdk_timer_init();
56 clksrc_dbx500_prcmu_init(prcmu_timer_base);
57}
58
59static void ux500_timer_reset(void)
60{
61 nmdk_clkevt_reset();
62 nmdk_clksrc_reset();
63}
64
65struct sys_timer ux500_timer = {
66 .init = ux500_timer_init,
67 .resume = ux500_timer_reset,
68};