aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-sa1100/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-sa1100/time.c')
-rw-r--r--arch/arm/mach-sa1100/time.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 6af26e8d55e6..80702c9ecc77 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -22,7 +22,7 @@
22 22
23static u32 notrace sa1100_read_sched_clock(void) 23static u32 notrace sa1100_read_sched_clock(void)
24{ 24{
25 return OSCR; 25 return readl_relaxed(OSCR);
26} 26}
27 27
28#define MIN_OSCR_DELTA 2 28#define MIN_OSCR_DELTA 2
@@ -32,8 +32,8 @@ static irqreturn_t sa1100_ost0_interrupt(int irq, void *dev_id)
32 struct clock_event_device *c = dev_id; 32 struct clock_event_device *c = dev_id;
33 33
34 /* Disarm the compare/match, signal the event. */ 34 /* Disarm the compare/match, signal the event. */
35 OIER &= ~OIER_E0; 35 writel_relaxed(readl_relaxed(OIER) & ~OIER_E0, OIER);
36 OSSR = OSSR_M0; 36 writel_relaxed(OSSR_M0, OSSR);
37 c->event_handler(c); 37 c->event_handler(c);
38 38
39 return IRQ_HANDLED; 39 return IRQ_HANDLED;
@@ -44,10 +44,10 @@ sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c)
44{ 44{
45 unsigned long next, oscr; 45 unsigned long next, oscr;
46 46
47 OIER |= OIER_E0; 47 writel_relaxed(readl_relaxed(OIER) | OIER_E0, OIER);
48 next = OSCR + delta; 48 next = readl_relaxed(OSCR) + delta;
49 OSMR0 = next; 49 writel_relaxed(next, OSMR0);
50 oscr = OSCR; 50 oscr = readl_relaxed(OSCR);
51 51
52 return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; 52 return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0;
53} 53}
@@ -59,8 +59,8 @@ sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c)
59 case CLOCK_EVT_MODE_ONESHOT: 59 case CLOCK_EVT_MODE_ONESHOT:
60 case CLOCK_EVT_MODE_UNUSED: 60 case CLOCK_EVT_MODE_UNUSED:
61 case CLOCK_EVT_MODE_SHUTDOWN: 61 case CLOCK_EVT_MODE_SHUTDOWN:
62 OIER &= ~OIER_E0; 62 writel_relaxed(readl_relaxed(OIER) & ~OIER_E0, OIER);
63 OSSR = OSSR_M0; 63 writel_relaxed(OSSR_M0, OSSR);
64 break; 64 break;
65 65
66 case CLOCK_EVT_MODE_RESUME: 66 case CLOCK_EVT_MODE_RESUME:
@@ -86,8 +86,8 @@ static struct irqaction sa1100_timer_irq = {
86 86
87static void __init sa1100_timer_init(void) 87static void __init sa1100_timer_init(void)
88{ 88{
89 OIER = 0; 89 writel_relaxed(0, OIER);
90 OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3; 90 writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
91 91
92 setup_sched_clock(sa1100_read_sched_clock, 32, 3686400); 92 setup_sched_clock(sa1100_read_sched_clock, 32, 3686400);
93 93
@@ -100,7 +100,7 @@ static void __init sa1100_timer_init(void)
100 100
101 setup_irq(IRQ_OST0, &sa1100_timer_irq); 101 setup_irq(IRQ_OST0, &sa1100_timer_irq);
102 102
103 clocksource_mmio_init(&OSCR, "oscr", CLOCK_TICK_RATE, 200, 32, 103 clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32,
104 clocksource_mmio_readl_up); 104 clocksource_mmio_readl_up);
105 clockevents_register_device(&ckevt_sa1100_osmr0); 105 clockevents_register_device(&ckevt_sa1100_osmr0);
106} 106}
@@ -110,26 +110,26 @@ unsigned long osmr[4], oier;
110 110
111static void sa1100_timer_suspend(void) 111static void sa1100_timer_suspend(void)
112{ 112{
113 osmr[0] = OSMR0; 113 osmr[0] = readl_relaxed(OSMR0);
114 osmr[1] = OSMR1; 114 osmr[1] = readl_relaxed(OSMR1);
115 osmr[2] = OSMR2; 115 osmr[2] = readl_relaxed(OSMR2);
116 osmr[3] = OSMR3; 116 osmr[3] = readl_relaxed(OSMR3);
117 oier = OIER; 117 oier = readl_relaxed(OIER);
118} 118}
119 119
120static void sa1100_timer_resume(void) 120static void sa1100_timer_resume(void)
121{ 121{
122 OSSR = 0x0f; 122 writel_relaxed(0x0f, OSSR);
123 OSMR0 = osmr[0]; 123 writel_relaxed(osmr[0], OSMR0);
124 OSMR1 = osmr[1]; 124 writel_relaxed(osmr[1], OSMR1);
125 OSMR2 = osmr[2]; 125 writel_relaxed(osmr[2], OSMR2);
126 OSMR3 = osmr[3]; 126 writel_relaxed(osmr[3], OSMR3);
127 OIER = oier; 127 writel_relaxed(oier, OIER);
128 128
129 /* 129 /*
130 * OSMR0 is the system timer: make sure OSCR is sufficiently behind 130 * OSMR0 is the system timer: make sure OSCR is sufficiently behind
131 */ 131 */
132 OSCR = OSMR0 - LATCH; 132 writel_relaxed(OSMR0 - LATCH, OSCR);
133} 133}
134#else 134#else
135#define sa1100_timer_suspend NULL 135#define sa1100_timer_suspend NULL