aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ns9xxx/time.c
diff options
context:
space:
mode:
authorUwe Kleine-König <ukleinek@informatik.uni-freiburg.de>2007-09-30 15:36:33 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-10-12 18:43:41 -0400
commit361c7ad607bc0e84ef0fef8c3f11c47b33c06e41 (patch)
treeeb4d73ce8fec23d402ce5da05f3394ada0dbb9ed /arch/arm/mach-ns9xxx/time.c
parentc54ecb2481d464d50520ce60cf36011b68d1e89a (diff)
[ARM] 4595/1: ns9xxx: define registers as void __iomem * instead of volatile u32
As a consequence registers are now accessed with __raw_{read,write}[bl]. Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ns9xxx/time.c')
-rw-r--r--arch/arm/mach-ns9xxx/time.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/arch/arm/mach-ns9xxx/time.c b/arch/arm/mach-ns9xxx/time.c
index 6f295158b168..c3dd1f4acb99 100644
--- a/arch/arm/mach-ns9xxx/time.c
+++ b/arch/arm/mach-ns9xxx/time.c
@@ -27,7 +27,7 @@ static u32 latch;
27 27
28static cycle_t ns9xxx_clocksource_read(void) 28static cycle_t ns9xxx_clocksource_read(void)
29{ 29{
30 return SYS_TR(TIMER_CLOCKSOURCE); 30 return __raw_readl(SYS_TR(TIMER_CLOCKSOURCE));
31} 31}
32 32
33static struct clocksource ns9xxx_clocksource = { 33static struct clocksource ns9xxx_clocksource = {
@@ -42,11 +42,11 @@ static struct clocksource ns9xxx_clocksource = {
42static void ns9xxx_clockevent_setmode(enum clock_event_mode mode, 42static void ns9xxx_clockevent_setmode(enum clock_event_mode mode,
43 struct clock_event_device *clk) 43 struct clock_event_device *clk)
44{ 44{
45 u32 tc = SYS_TC(TIMER_CLOCKEVENT); 45 u32 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
46 46
47 switch(mode) { 47 switch(mode) {
48 case CLOCK_EVT_MODE_PERIODIC: 48 case CLOCK_EVT_MODE_PERIODIC:
49 SYS_TRC(TIMER_CLOCKEVENT) = latch; 49 __raw_writel(latch, SYS_TRC(TIMER_CLOCKEVENT));
50 REGSET(tc, SYS_TCx, REN, EN); 50 REGSET(tc, SYS_TCx, REN, EN);
51 REGSET(tc, SYS_TCx, INTS, EN); 51 REGSET(tc, SYS_TCx, INTS, EN);
52 REGSET(tc, SYS_TCx, TEN, EN); 52 REGSET(tc, SYS_TCx, TEN, EN);
@@ -66,24 +66,24 @@ static void ns9xxx_clockevent_setmode(enum clock_event_mode mode,
66 break; 66 break;
67 } 67 }
68 68
69 SYS_TC(TIMER_CLOCKEVENT) = tc; 69 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
70} 70}
71 71
72static int ns9xxx_clockevent_setnextevent(unsigned long evt, 72static int ns9xxx_clockevent_setnextevent(unsigned long evt,
73 struct clock_event_device *clk) 73 struct clock_event_device *clk)
74{ 74{
75 u32 tc = SYS_TC(TIMER_CLOCKEVENT); 75 u32 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
76 76
77 if (REGGET(tc, SYS_TCx, TEN)) { 77 if (REGGET(tc, SYS_TCx, TEN)) {
78 REGSET(tc, SYS_TCx, TEN, DIS); 78 REGSET(tc, SYS_TCx, TEN, DIS);
79 SYS_TC(TIMER_CLOCKEVENT) = tc; 79 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
80 } 80 }
81 81
82 REGSET(tc, SYS_TCx, TEN, EN); 82 REGSET(tc, SYS_TCx, TEN, EN);
83 83
84 SYS_TRC(TIMER_CLOCKEVENT) = evt; 84 __raw_writel(evt, SYS_TRC(TIMER_CLOCKEVENT));
85 85
86 SYS_TC(TIMER_CLOCKEVENT) = tc; 86 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
87 87
88 return 0; 88 return 0;
89} 89}
@@ -104,15 +104,15 @@ static irqreturn_t ns9xxx_clockevent_handler(int irq, void *dev_id)
104 struct clock_event_device *evt = &ns9xxx_clockevent_device; 104 struct clock_event_device *evt = &ns9xxx_clockevent_device;
105 105
106 /* clear irq */ 106 /* clear irq */
107 tc = SYS_TC(timerno); 107 tc = __raw_readl(SYS_TC(timerno));
108 if (REGGET(tc, SYS_TCx, REN) == SYS_TCx_REN_DIS) { 108 if (REGGET(tc, SYS_TCx, REN) == SYS_TCx_REN_DIS) {
109 REGSET(tc, SYS_TCx, TEN, DIS); 109 REGSET(tc, SYS_TCx, TEN, DIS);
110 SYS_TC(timerno) = tc; 110 __raw_writel(tc, SYS_TC(timerno));
111 } 111 }
112 REGSET(tc, SYS_TCx, INTC, SET); 112 REGSET(tc, SYS_TCx, INTC, SET);
113 SYS_TC(timerno) = tc; 113 __raw_writel(tc, SYS_TC(timerno));
114 REGSET(tc, SYS_TCx, INTC, UNSET); 114 REGSET(tc, SYS_TCx, INTC, UNSET);
115 SYS_TC(timerno) = tc; 115 __raw_writel(tc, SYS_TC(timerno));
116 116
117 evt->event_handler(evt); 117 evt->event_handler(evt);
118 118
@@ -129,13 +129,13 @@ static void __init ns9xxx_timer_init(void)
129{ 129{
130 int tc; 130 int tc;
131 131
132 tc = SYS_TC(TIMER_CLOCKSOURCE); 132 tc = __raw_readl(SYS_TC(TIMER_CLOCKSOURCE));
133 if (REGGET(tc, SYS_TCx, TEN)) { 133 if (REGGET(tc, SYS_TCx, TEN)) {
134 REGSET(tc, SYS_TCx, TEN, DIS); 134 REGSET(tc, SYS_TCx, TEN, DIS);
135 SYS_TC(TIMER_CLOCKSOURCE) = tc; 135 __raw_writel(tc, SYS_TC(TIMER_CLOCKSOURCE));
136 } 136 }
137 137
138 SYS_TRC(TIMER_CLOCKSOURCE) = 0; 138 __raw_writel(0, SYS_TRC(TIMER_CLOCKSOURCE));
139 139
140 REGSET(tc, SYS_TCx, TEN, EN); 140 REGSET(tc, SYS_TCx, TEN, EN);
141 REGSET(tc, SYS_TCx, TDBG, STOP); 141 REGSET(tc, SYS_TCx, TDBG, STOP);
@@ -146,7 +146,7 @@ static void __init ns9xxx_timer_init(void)
146 REGSET(tc, SYS_TCx, TSZ, 32); 146 REGSET(tc, SYS_TCx, TSZ, 32);
147 REGSET(tc, SYS_TCx, REN, EN); 147 REGSET(tc, SYS_TCx, REN, EN);
148 148
149 SYS_TC(TIMER_CLOCKSOURCE) = tc; 149 __raw_writel(tc, SYS_TC(TIMER_CLOCKSOURCE));
150 150
151 ns9xxx_clocksource.mult = clocksource_hz2mult(ns9xxx_cpuclock(), 151 ns9xxx_clocksource.mult = clocksource_hz2mult(ns9xxx_cpuclock(),
152 ns9xxx_clocksource.shift); 152 ns9xxx_clocksource.shift);
@@ -155,7 +155,7 @@ static void __init ns9xxx_timer_init(void)
155 155
156 latch = SH_DIV(ns9xxx_cpuclock(), HZ, 0); 156 latch = SH_DIV(ns9xxx_cpuclock(), HZ, 0);
157 157
158 tc = SYS_TC(TIMER_CLOCKEVENT); 158 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
159 REGSET(tc, SYS_TCx, TEN, DIS); 159 REGSET(tc, SYS_TCx, TEN, DIS);
160 REGSET(tc, SYS_TCx, TDBG, STOP); 160 REGSET(tc, SYS_TCx, TDBG, STOP);
161 REGSET(tc, SYS_TCx, TLCS, CPU); 161 REGSET(tc, SYS_TCx, TLCS, CPU);
@@ -164,7 +164,7 @@ static void __init ns9xxx_timer_init(void)
164 REGSET(tc, SYS_TCx, UDS, DOWN); 164 REGSET(tc, SYS_TCx, UDS, DOWN);
165 REGSET(tc, SYS_TCx, TSZ, 32); 165 REGSET(tc, SYS_TCx, TSZ, 32);
166 REGSET(tc, SYS_TCx, REN, EN); 166 REGSET(tc, SYS_TCx, REN, EN);
167 SYS_TC(TIMER_CLOCKEVENT) = tc; 167 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
168 168
169 ns9xxx_clockevent_device.mult = div_sc(ns9xxx_cpuclock(), 169 ns9xxx_clockevent_device.mult = div_sc(ns9xxx_cpuclock(),
170 NSEC_PER_SEC, ns9xxx_clockevent_device.shift); 170 NSEC_PER_SEC, ns9xxx_clockevent_device.shift);