diff options
author | Michal Simek <michal.simek@xilinx.com> | 2013-03-27 07:05:28 -0400 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2013-04-04 03:22:02 -0400 |
commit | 9e09dc5f7fdc1e914c3b7bc186fa4b54d05a88d6 (patch) | |
tree | 183e73072ef8449a39a8ef74c1d23118a955ff8f /arch/arm | |
parent | c5263bb8b7944f1e34b36b5ea8a9119fc48a31ae (diff) |
arm: zynq: Do not use xilinx specific function names
Remove all xilinx specific names from the driver
because this is generic driver for cadence ttc.
xttc->ttc
ttcps->ttc
...
No functional changes in this driver.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-zynq/timer.c | 212 |
1 files changed, 106 insertions, 106 deletions
diff --git a/arch/arm/mach-zynq/timer.c b/arch/arm/mach-zynq/timer.c index ab5b839e22f0..685bc60e210a 100644 --- a/arch/arm/mach-zynq/timer.c +++ b/arch/arm/mach-zynq/timer.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * This file contains driver for the Xilinx PS Timer Counter IP. | 2 | * This file contains driver for the Cadence Triple Timer Counter Rev 06 |
3 | * | 3 | * |
4 | * Copyright (C) 2011-2013 Xilinx | 4 | * Copyright (C) 2011-2013 Xilinx |
5 | * | 5 | * |
@@ -42,14 +42,14 @@ | |||
42 | * Timer Register Offset Definitions of Timer 1, Increment base address by 4 | 42 | * Timer Register Offset Definitions of Timer 1, Increment base address by 4 |
43 | * and use same offsets for Timer 2 | 43 | * and use same offsets for Timer 2 |
44 | */ | 44 | */ |
45 | #define XTTCPS_CLK_CNTRL_OFFSET 0x00 /* Clock Control Reg, RW */ | 45 | #define TTC_CLK_CNTRL_OFFSET 0x00 /* Clock Control Reg, RW */ |
46 | #define XTTCPS_CNT_CNTRL_OFFSET 0x0C /* Counter Control Reg, RW */ | 46 | #define TTC_CNT_CNTRL_OFFSET 0x0C /* Counter Control Reg, RW */ |
47 | #define XTTCPS_COUNT_VAL_OFFSET 0x18 /* Counter Value Reg, RO */ | 47 | #define TTC_COUNT_VAL_OFFSET 0x18 /* Counter Value Reg, RO */ |
48 | #define XTTCPS_INTR_VAL_OFFSET 0x24 /* Interval Count Reg, RW */ | 48 | #define TTC_INTR_VAL_OFFSET 0x24 /* Interval Count Reg, RW */ |
49 | #define XTTCPS_ISR_OFFSET 0x54 /* Interrupt Status Reg, RO */ | 49 | #define TTC_ISR_OFFSET 0x54 /* Interrupt Status Reg, RO */ |
50 | #define XTTCPS_IER_OFFSET 0x60 /* Interrupt Enable Reg, RW */ | 50 | #define TTC_IER_OFFSET 0x60 /* Interrupt Enable Reg, RW */ |
51 | 51 | ||
52 | #define XTTCPS_CNT_CNTRL_DISABLE_MASK 0x1 | 52 | #define TTC_CNT_CNTRL_DISABLE_MASK 0x1 |
53 | 53 | ||
54 | /* | 54 | /* |
55 | * Setup the timers to use pre-scaling, using a fixed value for now that will | 55 | * Setup the timers to use pre-scaling, using a fixed value for now that will |
@@ -62,161 +62,161 @@ | |||
62 | #define CNT_CNTRL_RESET (1 << 4) | 62 | #define CNT_CNTRL_RESET (1 << 4) |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * struct xttcps_timer - This definition defines local timer structure | 65 | * struct ttc_timer - This definition defines local timer structure |
66 | * | 66 | * |
67 | * @base_addr: Base address of timer | 67 | * @base_addr: Base address of timer |
68 | * @clk: Associated clock source | 68 | * @clk: Associated clock source |
69 | * @clk_rate_change_nb Notifier block for clock rate changes | 69 | * @clk_rate_change_nb Notifier block for clock rate changes |
70 | */ | 70 | */ |
71 | struct xttcps_timer { | 71 | struct ttc_timer { |
72 | void __iomem *base_addr; | 72 | void __iomem *base_addr; |
73 | struct clk *clk; | 73 | struct clk *clk; |
74 | struct notifier_block clk_rate_change_nb; | 74 | struct notifier_block clk_rate_change_nb; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | #define to_xttcps_timer(x) \ | 77 | #define to_ttc_timer(x) \ |
78 | container_of(x, struct xttcps_timer, clk_rate_change_nb) | 78 | container_of(x, struct ttc_timer, clk_rate_change_nb) |
79 | 79 | ||
80 | struct xttcps_timer_clocksource { | 80 | struct ttc_timer_clocksource { |
81 | struct xttcps_timer xttc; | 81 | struct ttc_timer ttc; |
82 | struct clocksource cs; | 82 | struct clocksource cs; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | #define to_xttcps_timer_clksrc(x) \ | 85 | #define to_ttc_timer_clksrc(x) \ |
86 | container_of(x, struct xttcps_timer_clocksource, cs) | 86 | container_of(x, struct ttc_timer_clocksource, cs) |
87 | 87 | ||
88 | struct xttcps_timer_clockevent { | 88 | struct ttc_timer_clockevent { |
89 | struct xttcps_timer xttc; | 89 | struct ttc_timer ttc; |
90 | struct clock_event_device ce; | 90 | struct clock_event_device ce; |
91 | }; | 91 | }; |
92 | 92 | ||
93 | #define to_xttcps_timer_clkevent(x) \ | 93 | #define to_ttc_timer_clkevent(x) \ |
94 | container_of(x, struct xttcps_timer_clockevent, ce) | 94 | container_of(x, struct ttc_timer_clockevent, ce) |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * xttcps_set_interval - Set the timer interval value | 97 | * ttc_set_interval - Set the timer interval value |
98 | * | 98 | * |
99 | * @timer: Pointer to the timer instance | 99 | * @timer: Pointer to the timer instance |
100 | * @cycles: Timer interval ticks | 100 | * @cycles: Timer interval ticks |
101 | **/ | 101 | **/ |
102 | static void xttcps_set_interval(struct xttcps_timer *timer, | 102 | static void ttc_set_interval(struct ttc_timer *timer, |
103 | unsigned long cycles) | 103 | unsigned long cycles) |
104 | { | 104 | { |
105 | u32 ctrl_reg; | 105 | u32 ctrl_reg; |
106 | 106 | ||
107 | /* Disable the counter, set the counter value and re-enable counter */ | 107 | /* Disable the counter, set the counter value and re-enable counter */ |
108 | ctrl_reg = __raw_readl(timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET); | 108 | ctrl_reg = __raw_readl(timer->base_addr + TTC_CNT_CNTRL_OFFSET); |
109 | ctrl_reg |= XTTCPS_CNT_CNTRL_DISABLE_MASK; | 109 | ctrl_reg |= TTC_CNT_CNTRL_DISABLE_MASK; |
110 | __raw_writel(ctrl_reg, timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET); | 110 | __raw_writel(ctrl_reg, timer->base_addr + TTC_CNT_CNTRL_OFFSET); |
111 | 111 | ||
112 | __raw_writel(cycles, timer->base_addr + XTTCPS_INTR_VAL_OFFSET); | 112 | __raw_writel(cycles, timer->base_addr + TTC_INTR_VAL_OFFSET); |
113 | 113 | ||
114 | /* | 114 | /* |
115 | * Reset the counter (0x10) so that it starts from 0, one-shot | 115 | * Reset the counter (0x10) so that it starts from 0, one-shot |
116 | * mode makes this needed for timing to be right. | 116 | * mode makes this needed for timing to be right. |
117 | */ | 117 | */ |
118 | ctrl_reg |= CNT_CNTRL_RESET; | 118 | ctrl_reg |= CNT_CNTRL_RESET; |
119 | ctrl_reg &= ~XTTCPS_CNT_CNTRL_DISABLE_MASK; | 119 | ctrl_reg &= ~TTC_CNT_CNTRL_DISABLE_MASK; |
120 | __raw_writel(ctrl_reg, timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET); | 120 | __raw_writel(ctrl_reg, timer->base_addr + TTC_CNT_CNTRL_OFFSET); |
121 | } | 121 | } |
122 | 122 | ||
123 | /** | 123 | /** |
124 | * xttcps_clock_event_interrupt - Clock event timer interrupt handler | 124 | * ttc_clock_event_interrupt - Clock event timer interrupt handler |
125 | * | 125 | * |
126 | * @irq: IRQ number of the Timer | 126 | * @irq: IRQ number of the Timer |
127 | * @dev_id: void pointer to the xttcps_timer instance | 127 | * @dev_id: void pointer to the ttc_timer instance |
128 | * | 128 | * |
129 | * returns: Always IRQ_HANDLED - success | 129 | * returns: Always IRQ_HANDLED - success |
130 | **/ | 130 | **/ |
131 | static irqreturn_t xttcps_clock_event_interrupt(int irq, void *dev_id) | 131 | static irqreturn_t ttc_clock_event_interrupt(int irq, void *dev_id) |
132 | { | 132 | { |
133 | struct xttcps_timer_clockevent *xttce = dev_id; | 133 | struct ttc_timer_clockevent *ttce = dev_id; |
134 | struct xttcps_timer *timer = &xttce->xttc; | 134 | struct ttc_timer *timer = &ttce->ttc; |
135 | 135 | ||
136 | /* Acknowledge the interrupt and call event handler */ | 136 | /* Acknowledge the interrupt and call event handler */ |
137 | __raw_readl(timer->base_addr + XTTCPS_ISR_OFFSET); | 137 | __raw_readl(timer->base_addr + TTC_ISR_OFFSET); |
138 | 138 | ||
139 | xttce->ce.event_handler(&xttce->ce); | 139 | ttce->ce.event_handler(&ttce->ce); |
140 | 140 | ||
141 | return IRQ_HANDLED; | 141 | return IRQ_HANDLED; |
142 | } | 142 | } |
143 | 143 | ||
144 | /** | 144 | /** |
145 | * __xttc_clocksource_read - Reads the timer counter register | 145 | * __ttc_clocksource_read - Reads the timer counter register |
146 | * | 146 | * |
147 | * returns: Current timer counter register value | 147 | * returns: Current timer counter register value |
148 | **/ | 148 | **/ |
149 | static cycle_t __xttc_clocksource_read(struct clocksource *cs) | 149 | static cycle_t __ttc_clocksource_read(struct clocksource *cs) |
150 | { | 150 | { |
151 | struct xttcps_timer *timer = &to_xttcps_timer_clksrc(cs)->xttc; | 151 | struct ttc_timer *timer = &to_ttc_timer_clksrc(cs)->ttc; |
152 | 152 | ||
153 | return (cycle_t)__raw_readl(timer->base_addr + | 153 | return (cycle_t)__raw_readl(timer->base_addr + |
154 | XTTCPS_COUNT_VAL_OFFSET); | 154 | TTC_COUNT_VAL_OFFSET); |
155 | } | 155 | } |
156 | 156 | ||
157 | /** | 157 | /** |
158 | * xttcps_set_next_event - Sets the time interval for next event | 158 | * ttc_set_next_event - Sets the time interval for next event |
159 | * | 159 | * |
160 | * @cycles: Timer interval ticks | 160 | * @cycles: Timer interval ticks |
161 | * @evt: Address of clock event instance | 161 | * @evt: Address of clock event instance |
162 | * | 162 | * |
163 | * returns: Always 0 - success | 163 | * returns: Always 0 - success |
164 | **/ | 164 | **/ |
165 | static int xttcps_set_next_event(unsigned long cycles, | 165 | static int ttc_set_next_event(unsigned long cycles, |
166 | struct clock_event_device *evt) | 166 | struct clock_event_device *evt) |
167 | { | 167 | { |
168 | struct xttcps_timer_clockevent *xttce = to_xttcps_timer_clkevent(evt); | 168 | struct ttc_timer_clockevent *ttce = to_ttc_timer_clkevent(evt); |
169 | struct xttcps_timer *timer = &xttce->xttc; | 169 | struct ttc_timer *timer = &ttce->ttc; |
170 | 170 | ||
171 | xttcps_set_interval(timer, cycles); | 171 | ttc_set_interval(timer, cycles); |
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | /** | 175 | /** |
176 | * xttcps_set_mode - Sets the mode of timer | 176 | * ttc_set_mode - Sets the mode of timer |
177 | * | 177 | * |
178 | * @mode: Mode to be set | 178 | * @mode: Mode to be set |
179 | * @evt: Address of clock event instance | 179 | * @evt: Address of clock event instance |
180 | **/ | 180 | **/ |
181 | static void xttcps_set_mode(enum clock_event_mode mode, | 181 | static void ttc_set_mode(enum clock_event_mode mode, |
182 | struct clock_event_device *evt) | 182 | struct clock_event_device *evt) |
183 | { | 183 | { |
184 | struct xttcps_timer_clockevent *xttce = to_xttcps_timer_clkevent(evt); | 184 | struct ttc_timer_clockevent *ttce = to_ttc_timer_clkevent(evt); |
185 | struct xttcps_timer *timer = &xttce->xttc; | 185 | struct ttc_timer *timer = &ttce->ttc; |
186 | u32 ctrl_reg; | 186 | u32 ctrl_reg; |
187 | 187 | ||
188 | switch (mode) { | 188 | switch (mode) { |
189 | case CLOCK_EVT_MODE_PERIODIC: | 189 | case CLOCK_EVT_MODE_PERIODIC: |
190 | xttcps_set_interval(timer, | 190 | ttc_set_interval(timer, |
191 | DIV_ROUND_CLOSEST(clk_get_rate(xttce->xttc.clk), | 191 | DIV_ROUND_CLOSEST(clk_get_rate(ttce->ttc.clk), |
192 | PRESCALE * HZ)); | 192 | PRESCALE * HZ)); |
193 | break; | 193 | break; |
194 | case CLOCK_EVT_MODE_ONESHOT: | 194 | case CLOCK_EVT_MODE_ONESHOT: |
195 | case CLOCK_EVT_MODE_UNUSED: | 195 | case CLOCK_EVT_MODE_UNUSED: |
196 | case CLOCK_EVT_MODE_SHUTDOWN: | 196 | case CLOCK_EVT_MODE_SHUTDOWN: |
197 | ctrl_reg = __raw_readl(timer->base_addr + | 197 | ctrl_reg = __raw_readl(timer->base_addr + |
198 | XTTCPS_CNT_CNTRL_OFFSET); | 198 | TTC_CNT_CNTRL_OFFSET); |
199 | ctrl_reg |= XTTCPS_CNT_CNTRL_DISABLE_MASK; | 199 | ctrl_reg |= TTC_CNT_CNTRL_DISABLE_MASK; |
200 | __raw_writel(ctrl_reg, | 200 | __raw_writel(ctrl_reg, |
201 | timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET); | 201 | timer->base_addr + TTC_CNT_CNTRL_OFFSET); |
202 | break; | 202 | break; |
203 | case CLOCK_EVT_MODE_RESUME: | 203 | case CLOCK_EVT_MODE_RESUME: |
204 | ctrl_reg = __raw_readl(timer->base_addr + | 204 | ctrl_reg = __raw_readl(timer->base_addr + |
205 | XTTCPS_CNT_CNTRL_OFFSET); | 205 | TTC_CNT_CNTRL_OFFSET); |
206 | ctrl_reg &= ~XTTCPS_CNT_CNTRL_DISABLE_MASK; | 206 | ctrl_reg &= ~TTC_CNT_CNTRL_DISABLE_MASK; |
207 | __raw_writel(ctrl_reg, | 207 | __raw_writel(ctrl_reg, |
208 | timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET); | 208 | timer->base_addr + TTC_CNT_CNTRL_OFFSET); |
209 | break; | 209 | break; |
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | static int xttcps_rate_change_clocksource_cb(struct notifier_block *nb, | 213 | static int ttc_rate_change_clocksource_cb(struct notifier_block *nb, |
214 | unsigned long event, void *data) | 214 | unsigned long event, void *data) |
215 | { | 215 | { |
216 | struct clk_notifier_data *ndata = data; | 216 | struct clk_notifier_data *ndata = data; |
217 | struct xttcps_timer *xttcps = to_xttcps_timer(nb); | 217 | struct ttc_timer *ttc = to_ttc_timer(nb); |
218 | struct xttcps_timer_clocksource *xttccs = container_of(xttcps, | 218 | struct ttc_timer_clocksource *ttccs = container_of(ttc, |
219 | struct xttcps_timer_clocksource, xttc); | 219 | struct ttc_timer_clocksource, ttc); |
220 | 220 | ||
221 | switch (event) { | 221 | switch (event) { |
222 | case POST_RATE_CHANGE: | 222 | case POST_RATE_CHANGE: |
@@ -236,8 +236,8 @@ static int xttcps_rate_change_clocksource_cb(struct notifier_block *nb, | |||
236 | * one unregister call, but only trigger one clocksource switch | 236 | * one unregister call, but only trigger one clocksource switch |
237 | * for the cost of another HW timer used by the OS. | 237 | * for the cost of another HW timer used by the OS. |
238 | */ | 238 | */ |
239 | clocksource_unregister(&xttccs->cs); | 239 | clocksource_unregister(&ttccs->cs); |
240 | clocksource_register_hz(&xttccs->cs, | 240 | clocksource_register_hz(&ttccs->cs, |
241 | ndata->new_rate / PRESCALE); | 241 | ndata->new_rate / PRESCALE); |
242 | /* fall through */ | 242 | /* fall through */ |
243 | case PRE_RATE_CHANGE: | 243 | case PRE_RATE_CHANGE: |
@@ -247,34 +247,34 @@ static int xttcps_rate_change_clocksource_cb(struct notifier_block *nb, | |||
247 | } | 247 | } |
248 | } | 248 | } |
249 | 249 | ||
250 | static void __init xttc_setup_clocksource(struct clk *clk, void __iomem *base) | 250 | static void __init ttc_setup_clocksource(struct clk *clk, void __iomem *base) |
251 | { | 251 | { |
252 | struct xttcps_timer_clocksource *ttccs; | 252 | struct ttc_timer_clocksource *ttccs; |
253 | int err; | 253 | int err; |
254 | 254 | ||
255 | ttccs = kzalloc(sizeof(*ttccs), GFP_KERNEL); | 255 | ttccs = kzalloc(sizeof(*ttccs), GFP_KERNEL); |
256 | if (WARN_ON(!ttccs)) | 256 | if (WARN_ON(!ttccs)) |
257 | return; | 257 | return; |
258 | 258 | ||
259 | ttccs->xttc.clk = clk; | 259 | ttccs->ttc.clk = clk; |
260 | 260 | ||
261 | err = clk_prepare_enable(ttccs->xttc.clk); | 261 | err = clk_prepare_enable(ttccs->ttc.clk); |
262 | if (WARN_ON(err)) { | 262 | if (WARN_ON(err)) { |
263 | kfree(ttccs); | 263 | kfree(ttccs); |
264 | return; | 264 | return; |
265 | } | 265 | } |
266 | 266 | ||
267 | ttccs->xttc.clk_rate_change_nb.notifier_call = | 267 | ttccs->ttc.clk_rate_change_nb.notifier_call = |
268 | xttcps_rate_change_clocksource_cb; | 268 | ttc_rate_change_clocksource_cb; |
269 | ttccs->xttc.clk_rate_change_nb.next = NULL; | 269 | ttccs->ttc.clk_rate_change_nb.next = NULL; |
270 | if (clk_notifier_register(ttccs->xttc.clk, | 270 | if (clk_notifier_register(ttccs->ttc.clk, |
271 | &ttccs->xttc.clk_rate_change_nb)) | 271 | &ttccs->ttc.clk_rate_change_nb)) |
272 | pr_warn("Unable to register clock notifier.\n"); | 272 | pr_warn("Unable to register clock notifier.\n"); |
273 | 273 | ||
274 | ttccs->xttc.base_addr = base; | 274 | ttccs->ttc.base_addr = base; |
275 | ttccs->cs.name = "xttcps_clocksource"; | 275 | ttccs->cs.name = "ttc_clocksource"; |
276 | ttccs->cs.rating = 200; | 276 | ttccs->cs.rating = 200; |
277 | ttccs->cs.read = __xttc_clocksource_read; | 277 | ttccs->cs.read = __ttc_clocksource_read; |
278 | ttccs->cs.mask = CLOCKSOURCE_MASK(16); | 278 | ttccs->cs.mask = CLOCKSOURCE_MASK(16); |
279 | ttccs->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS; | 279 | ttccs->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS; |
280 | 280 | ||
@@ -283,27 +283,27 @@ static void __init xttc_setup_clocksource(struct clk *clk, void __iomem *base) | |||
283 | * with no interrupt and it rolls over at 0xFFFF. Pre-scale | 283 | * with no interrupt and it rolls over at 0xFFFF. Pre-scale |
284 | * it by 32 also. Let it start running now. | 284 | * it by 32 also. Let it start running now. |
285 | */ | 285 | */ |
286 | __raw_writel(0x0, ttccs->xttc.base_addr + XTTCPS_IER_OFFSET); | 286 | __raw_writel(0x0, ttccs->ttc.base_addr + TTC_IER_OFFSET); |
287 | __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN, | 287 | __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN, |
288 | ttccs->xttc.base_addr + XTTCPS_CLK_CNTRL_OFFSET); | 288 | ttccs->ttc.base_addr + TTC_CLK_CNTRL_OFFSET); |
289 | __raw_writel(CNT_CNTRL_RESET, | 289 | __raw_writel(CNT_CNTRL_RESET, |
290 | ttccs->xttc.base_addr + XTTCPS_CNT_CNTRL_OFFSET); | 290 | ttccs->ttc.base_addr + TTC_CNT_CNTRL_OFFSET); |
291 | 291 | ||
292 | err = clocksource_register_hz(&ttccs->cs, | 292 | err = clocksource_register_hz(&ttccs->cs, |
293 | clk_get_rate(ttccs->xttc.clk) / PRESCALE); | 293 | clk_get_rate(ttccs->ttc.clk) / PRESCALE); |
294 | if (WARN_ON(err)) { | 294 | if (WARN_ON(err)) { |
295 | kfree(ttccs); | 295 | kfree(ttccs); |
296 | return; | 296 | return; |
297 | } | 297 | } |
298 | } | 298 | } |
299 | 299 | ||
300 | static int xttcps_rate_change_clockevent_cb(struct notifier_block *nb, | 300 | static int ttc_rate_change_clockevent_cb(struct notifier_block *nb, |
301 | unsigned long event, void *data) | 301 | unsigned long event, void *data) |
302 | { | 302 | { |
303 | struct clk_notifier_data *ndata = data; | 303 | struct clk_notifier_data *ndata = data; |
304 | struct xttcps_timer *xttcps = to_xttcps_timer(nb); | 304 | struct ttc_timer *ttc = to_ttc_timer(nb); |
305 | struct xttcps_timer_clockevent *xttcce = container_of(xttcps, | 305 | struct ttc_timer_clockevent *ttcce = container_of(ttc, |
306 | struct xttcps_timer_clockevent, xttc); | 306 | struct ttc_timer_clockevent, ttc); |
307 | 307 | ||
308 | switch (event) { | 308 | switch (event) { |
309 | case POST_RATE_CHANGE: | 309 | case POST_RATE_CHANGE: |
@@ -317,7 +317,7 @@ static int xttcps_rate_change_clockevent_cb(struct notifier_block *nb, | |||
317 | * cores. | 317 | * cores. |
318 | */ | 318 | */ |
319 | local_irq_save(flags); | 319 | local_irq_save(flags); |
320 | clockevents_update_freq(&xttcce->ce, | 320 | clockevents_update_freq(&ttcce->ce, |
321 | ndata->new_rate / PRESCALE); | 321 | ndata->new_rate / PRESCALE); |
322 | local_irq_restore(flags); | 322 | local_irq_restore(flags); |
323 | 323 | ||
@@ -330,36 +330,36 @@ static int xttcps_rate_change_clockevent_cb(struct notifier_block *nb, | |||
330 | } | 330 | } |
331 | } | 331 | } |
332 | 332 | ||
333 | static void __init xttc_setup_clockevent(struct clk *clk, | 333 | static void __init ttc_setup_clockevent(struct clk *clk, |
334 | void __iomem *base, u32 irq) | 334 | void __iomem *base, u32 irq) |
335 | { | 335 | { |
336 | struct xttcps_timer_clockevent *ttcce; | 336 | struct ttc_timer_clockevent *ttcce; |
337 | int err; | 337 | int err; |
338 | 338 | ||
339 | ttcce = kzalloc(sizeof(*ttcce), GFP_KERNEL); | 339 | ttcce = kzalloc(sizeof(*ttcce), GFP_KERNEL); |
340 | if (WARN_ON(!ttcce)) | 340 | if (WARN_ON(!ttcce)) |
341 | return; | 341 | return; |
342 | 342 | ||
343 | ttcce->xttc.clk = clk; | 343 | ttcce->ttc.clk = clk; |
344 | 344 | ||
345 | err = clk_prepare_enable(ttcce->xttc.clk); | 345 | err = clk_prepare_enable(ttcce->ttc.clk); |
346 | if (WARN_ON(err)) { | 346 | if (WARN_ON(err)) { |
347 | kfree(ttcce); | 347 | kfree(ttcce); |
348 | return; | 348 | return; |
349 | } | 349 | } |
350 | 350 | ||
351 | ttcce->xttc.clk_rate_change_nb.notifier_call = | 351 | ttcce->ttc.clk_rate_change_nb.notifier_call = |
352 | xttcps_rate_change_clockevent_cb; | 352 | ttc_rate_change_clockevent_cb; |
353 | ttcce->xttc.clk_rate_change_nb.next = NULL; | 353 | ttcce->ttc.clk_rate_change_nb.next = NULL; |
354 | if (clk_notifier_register(ttcce->xttc.clk, | 354 | if (clk_notifier_register(ttcce->ttc.clk, |
355 | &ttcce->xttc.clk_rate_change_nb)) | 355 | &ttcce->ttc.clk_rate_change_nb)) |
356 | pr_warn("Unable to register clock notifier.\n"); | 356 | pr_warn("Unable to register clock notifier.\n"); |
357 | 357 | ||
358 | ttcce->xttc.base_addr = base; | 358 | ttcce->ttc.base_addr = base; |
359 | ttcce->ce.name = "xttcps_clockevent"; | 359 | ttcce->ce.name = "ttc_clockevent"; |
360 | ttcce->ce.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; | 360 | ttcce->ce.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; |
361 | ttcce->ce.set_next_event = xttcps_set_next_event; | 361 | ttcce->ce.set_next_event = ttc_set_next_event; |
362 | ttcce->ce.set_mode = xttcps_set_mode; | 362 | ttcce->ce.set_mode = ttc_set_mode; |
363 | ttcce->ce.rating = 200; | 363 | ttcce->ce.rating = 200; |
364 | ttcce->ce.irq = irq; | 364 | ttcce->ce.irq = irq; |
365 | ttcce->ce.cpumask = cpu_possible_mask; | 365 | ttcce->ce.cpumask = cpu_possible_mask; |
@@ -369,12 +369,12 @@ static void __init xttc_setup_clockevent(struct clk *clk, | |||
369 | * is prescaled by 32 using the interval interrupt. Leave it | 369 | * is prescaled by 32 using the interval interrupt. Leave it |
370 | * disabled for now. | 370 | * disabled for now. |
371 | */ | 371 | */ |
372 | __raw_writel(0x23, ttcce->xttc.base_addr + XTTCPS_CNT_CNTRL_OFFSET); | 372 | __raw_writel(0x23, ttcce->ttc.base_addr + TTC_CNT_CNTRL_OFFSET); |
373 | __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN, | 373 | __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN, |
374 | ttcce->xttc.base_addr + XTTCPS_CLK_CNTRL_OFFSET); | 374 | ttcce->ttc.base_addr + TTC_CLK_CNTRL_OFFSET); |
375 | __raw_writel(0x1, ttcce->xttc.base_addr + XTTCPS_IER_OFFSET); | 375 | __raw_writel(0x1, ttcce->ttc.base_addr + TTC_IER_OFFSET); |
376 | 376 | ||
377 | err = request_irq(irq, xttcps_clock_event_interrupt, | 377 | err = request_irq(irq, ttc_clock_event_interrupt, |
378 | IRQF_DISABLED | IRQF_TIMER, | 378 | IRQF_DISABLED | IRQF_TIMER, |
379 | ttcce->ce.name, ttcce); | 379 | ttcce->ce.name, ttcce); |
380 | if (WARN_ON(err)) { | 380 | if (WARN_ON(err)) { |
@@ -383,16 +383,16 @@ static void __init xttc_setup_clockevent(struct clk *clk, | |||
383 | } | 383 | } |
384 | 384 | ||
385 | clockevents_config_and_register(&ttcce->ce, | 385 | clockevents_config_and_register(&ttcce->ce, |
386 | clk_get_rate(ttcce->xttc.clk) / PRESCALE, 1, 0xfffe); | 386 | clk_get_rate(ttcce->ttc.clk) / PRESCALE, 1, 0xfffe); |
387 | } | 387 | } |
388 | 388 | ||
389 | /** | 389 | /** |
390 | * xttcps_timer_init - Initialize the timer | 390 | * ttc_timer_init - Initialize the timer |
391 | * | 391 | * |
392 | * Initializes the timer hardware and register the clock source and clock event | 392 | * Initializes the timer hardware and register the clock source and clock event |
393 | * timers with Linux kernal timer framework | 393 | * timers with Linux kernal timer framework |
394 | */ | 394 | */ |
395 | static void __init xttcps_timer_init(struct device_node *timer) | 395 | static void __init ttc_timer_init(struct device_node *timer) |
396 | { | 396 | { |
397 | unsigned int irq; | 397 | unsigned int irq; |
398 | void __iomem *timer_baseaddr; | 398 | void __iomem *timer_baseaddr; |
@@ -427,10 +427,10 @@ static void __init xttcps_timer_init(struct device_node *timer) | |||
427 | BUG(); | 427 | BUG(); |
428 | } | 428 | } |
429 | 429 | ||
430 | xttc_setup_clocksource(clk, timer_baseaddr); | 430 | ttc_setup_clocksource(clk, timer_baseaddr); |
431 | xttc_setup_clockevent(clk, timer_baseaddr + 4, irq); | 431 | ttc_setup_clockevent(clk, timer_baseaddr + 4, irq); |
432 | 432 | ||
433 | pr_info("%s #0 at %p, irq=%d\n", timer->name, timer_baseaddr, irq); | 433 | pr_info("%s #0 at %p, irq=%d\n", timer->name, timer_baseaddr, irq); |
434 | } | 434 | } |
435 | 435 | ||
436 | CLOCKSOURCE_OF_DECLARE(ttc, "cdns,ttc", xttcps_timer_init); | 436 | CLOCKSOURCE_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init); |