aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-zynq
diff options
context:
space:
mode:
authorSoren Brinkmann <soren.brinkmann@xilinx.com>2012-12-19 13:18:36 -0500
committerMichal Simek <michal.simek@xilinx.com>2013-01-28 07:27:20 -0500
commitf184c5caa983940305b37f428a6bfc22105235e4 (patch)
tree504a3cca4fc67bc5e21032499c81201bb8167a96 /arch/arm/mach-zynq
parentc067561759dec2a4aac0b9d9bcfaa2a3771e8dec (diff)
arm: zynq: timer: Replace PSS through PS
The acronym PSS is deprecated by Xilinx. The correct term, which is also used in Xilinx documentation is PS (processing system). This is just a search and replace: - s/PSS/PS/g - s/pss/ps/g Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Tested-by: Josh Cartwright <josh.cartwright@ni.com>
Diffstat (limited to 'arch/arm/mach-zynq')
-rw-r--r--arch/arm/mach-zynq/common.c2
-rw-r--r--arch/arm/mach-zynq/common.h2
-rw-r--r--arch/arm/mach-zynq/timer.c134
3 files changed, 69 insertions, 69 deletions
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index cf3ec5466af7..5c8983218183 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -77,7 +77,7 @@ static void __init xilinx_zynq_timer_init(void)
77 77
78 xilinx_zynq_clocks_init(slcr); 78 xilinx_zynq_clocks_init(slcr);
79 79
80 xttcpss_timer_init(); 80 xttcps_timer_init();
81} 81}
82 82
83/** 83/**
diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h
index 954b91c13c91..8b4dbbaa01cf 100644
--- a/arch/arm/mach-zynq/common.h
+++ b/arch/arm/mach-zynq/common.h
@@ -17,6 +17,6 @@
17#ifndef __MACH_ZYNQ_COMMON_H__ 17#ifndef __MACH_ZYNQ_COMMON_H__
18#define __MACH_ZYNQ_COMMON_H__ 18#define __MACH_ZYNQ_COMMON_H__
19 19
20void __init xttcpss_timer_init(void); 20void __init xttcps_timer_init(void);
21 21
22#endif 22#endif
diff --git a/arch/arm/mach-zynq/timer.c b/arch/arm/mach-zynq/timer.c
index de3df283da74..570491d37966 100644
--- a/arch/arm/mach-zynq/timer.c
+++ b/arch/arm/mach-zynq/timer.c
@@ -35,17 +35,17 @@
35 * Timer Register Offset Definitions of Timer 1, Increment base address by 4 35 * Timer Register Offset Definitions of Timer 1, Increment base address by 4
36 * and use same offsets for Timer 2 36 * and use same offsets for Timer 2
37 */ 37 */
38#define XTTCPSS_CLK_CNTRL_OFFSET 0x00 /* Clock Control Reg, RW */ 38#define XTTCPS_CLK_CNTRL_OFFSET 0x00 /* Clock Control Reg, RW */
39#define XTTCPSS_CNT_CNTRL_OFFSET 0x0C /* Counter Control Reg, RW */ 39#define XTTCPS_CNT_CNTRL_OFFSET 0x0C /* Counter Control Reg, RW */
40#define XTTCPSS_COUNT_VAL_OFFSET 0x18 /* Counter Value Reg, RO */ 40#define XTTCPS_COUNT_VAL_OFFSET 0x18 /* Counter Value Reg, RO */
41#define XTTCPSS_INTR_VAL_OFFSET 0x24 /* Interval Count Reg, RW */ 41#define XTTCPS_INTR_VAL_OFFSET 0x24 /* Interval Count Reg, RW */
42#define XTTCPSS_MATCH_1_OFFSET 0x30 /* Match 1 Value Reg, RW */ 42#define XTTCPS_MATCH_1_OFFSET 0x30 /* Match 1 Value Reg, RW */
43#define XTTCPSS_MATCH_2_OFFSET 0x3C /* Match 2 Value Reg, RW */ 43#define XTTCPS_MATCH_2_OFFSET 0x3C /* Match 2 Value Reg, RW */
44#define XTTCPSS_MATCH_3_OFFSET 0x48 /* Match 3 Value Reg, RW */ 44#define XTTCPS_MATCH_3_OFFSET 0x48 /* Match 3 Value Reg, RW */
45#define XTTCPSS_ISR_OFFSET 0x54 /* Interrupt Status Reg, RO */ 45#define XTTCPS_ISR_OFFSET 0x54 /* Interrupt Status Reg, RO */
46#define XTTCPSS_IER_OFFSET 0x60 /* Interrupt Enable Reg, RW */ 46#define XTTCPS_IER_OFFSET 0x60 /* Interrupt Enable Reg, RW */
47 47
48#define XTTCPSS_CNT_CNTRL_DISABLE_MASK 0x1 48#define XTTCPS_CNT_CNTRL_DISABLE_MASK 0x1
49 49
50/* Setup the timers to use pre-scaling, using a fixed value for now that will 50/* Setup the timers to use pre-scaling, using a fixed value for now that will
51 * work across most input frequency, but it may need to be more dynamic 51 * work across most input frequency, but it may need to be more dynamic
@@ -57,72 +57,72 @@
57#define CNT_CNTRL_RESET (1<<4) 57#define CNT_CNTRL_RESET (1<<4)
58 58
59/** 59/**
60 * struct xttcpss_timer - This definition defines local timer structure 60 * struct xttcps_timer - This definition defines local timer structure
61 * 61 *
62 * @base_addr: Base address of timer 62 * @base_addr: Base address of timer
63 **/ 63 **/
64struct xttcpss_timer { 64struct xttcps_timer {
65 void __iomem *base_addr; 65 void __iomem *base_addr;
66}; 66};
67 67
68struct xttcpss_timer_clocksource { 68struct xttcps_timer_clocksource {
69 struct xttcpss_timer xttc; 69 struct xttcps_timer xttc;
70 struct clocksource cs; 70 struct clocksource cs;
71}; 71};
72 72
73#define to_xttcpss_timer_clksrc(x) \ 73#define to_xttcps_timer_clksrc(x) \
74 container_of(x, struct xttcpss_timer_clocksource, cs) 74 container_of(x, struct xttcps_timer_clocksource, cs)
75 75
76struct xttcpss_timer_clockevent { 76struct xttcps_timer_clockevent {
77 struct xttcpss_timer xttc; 77 struct xttcps_timer xttc;
78 struct clock_event_device ce; 78 struct clock_event_device ce;
79 struct clk *clk; 79 struct clk *clk;
80}; 80};
81 81
82#define to_xttcpss_timer_clkevent(x) \ 82#define to_xttcps_timer_clkevent(x) \
83 container_of(x, struct xttcpss_timer_clockevent, ce) 83 container_of(x, struct xttcps_timer_clockevent, ce)
84 84
85/** 85/**
86 * xttcpss_set_interval - Set the timer interval value 86 * xttcps_set_interval - Set the timer interval value
87 * 87 *
88 * @timer: Pointer to the timer instance 88 * @timer: Pointer to the timer instance
89 * @cycles: Timer interval ticks 89 * @cycles: Timer interval ticks
90 **/ 90 **/
91static void xttcpss_set_interval(struct xttcpss_timer *timer, 91static void xttcps_set_interval(struct xttcps_timer *timer,
92 unsigned long cycles) 92 unsigned long cycles)
93{ 93{
94 u32 ctrl_reg; 94 u32 ctrl_reg;
95 95
96 /* Disable the counter, set the counter value and re-enable counter */ 96 /* Disable the counter, set the counter value and re-enable counter */
97 ctrl_reg = __raw_readl(timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 97 ctrl_reg = __raw_readl(timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET);
98 ctrl_reg |= XTTCPSS_CNT_CNTRL_DISABLE_MASK; 98 ctrl_reg |= XTTCPS_CNT_CNTRL_DISABLE_MASK;
99 __raw_writel(ctrl_reg, timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 99 __raw_writel(ctrl_reg, timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET);
100 100
101 __raw_writel(cycles, timer->base_addr + XTTCPSS_INTR_VAL_OFFSET); 101 __raw_writel(cycles, timer->base_addr + XTTCPS_INTR_VAL_OFFSET);
102 102
103 /* Reset the counter (0x10) so that it starts from 0, one-shot 103 /* Reset the counter (0x10) so that it starts from 0, one-shot
104 mode makes this needed for timing to be right. */ 104 mode makes this needed for timing to be right. */
105 ctrl_reg |= CNT_CNTRL_RESET; 105 ctrl_reg |= CNT_CNTRL_RESET;
106 ctrl_reg &= ~XTTCPSS_CNT_CNTRL_DISABLE_MASK; 106 ctrl_reg &= ~XTTCPS_CNT_CNTRL_DISABLE_MASK;
107 __raw_writel(ctrl_reg, timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 107 __raw_writel(ctrl_reg, timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET);
108} 108}
109 109
110/** 110/**
111 * xttcpss_clock_event_interrupt - Clock event timer interrupt handler 111 * xttcps_clock_event_interrupt - Clock event timer interrupt handler
112 * 112 *
113 * @irq: IRQ number of the Timer 113 * @irq: IRQ number of the Timer
114 * @dev_id: void pointer to the xttcpss_timer instance 114 * @dev_id: void pointer to the xttcps_timer instance
115 * 115 *
116 * returns: Always IRQ_HANDLED - success 116 * returns: Always IRQ_HANDLED - success
117 **/ 117 **/
118static irqreturn_t xttcpss_clock_event_interrupt(int irq, void *dev_id) 118static irqreturn_t xttcps_clock_event_interrupt(int irq, void *dev_id)
119{ 119{
120 struct xttcpss_timer_clockevent *xttce = dev_id; 120 struct xttcps_timer_clockevent *xttce = dev_id;
121 struct xttcpss_timer *timer = &xttce->xttc; 121 struct xttcps_timer *timer = &xttce->xttc;
122 122
123 /* Acknowledge the interrupt and call event handler */ 123 /* Acknowledge the interrupt and call event handler */
124 __raw_writel(__raw_readl(timer->base_addr + XTTCPSS_ISR_OFFSET), 124 __raw_writel(__raw_readl(timer->base_addr + XTTCPS_ISR_OFFSET),
125 timer->base_addr + XTTCPSS_ISR_OFFSET); 125 timer->base_addr + XTTCPS_ISR_OFFSET);
126 126
127 xttce->ce.event_handler(&xttce->ce); 127 xttce->ce.event_handler(&xttce->ce);
128 128
@@ -136,46 +136,46 @@ static irqreturn_t xttcpss_clock_event_interrupt(int irq, void *dev_id)
136 **/ 136 **/
137static cycle_t __xttc_clocksource_read(struct clocksource *cs) 137static cycle_t __xttc_clocksource_read(struct clocksource *cs)
138{ 138{
139 struct xttcpss_timer *timer = &to_xttcpss_timer_clksrc(cs)->xttc; 139 struct xttcps_timer *timer = &to_xttcps_timer_clksrc(cs)->xttc;
140 140
141 return (cycle_t)__raw_readl(timer->base_addr + 141 return (cycle_t)__raw_readl(timer->base_addr +
142 XTTCPSS_COUNT_VAL_OFFSET); 142 XTTCPS_COUNT_VAL_OFFSET);
143} 143}
144 144
145/** 145/**
146 * xttcpss_set_next_event - Sets the time interval for next event 146 * xttcps_set_next_event - Sets the time interval for next event
147 * 147 *
148 * @cycles: Timer interval ticks 148 * @cycles: Timer interval ticks
149 * @evt: Address of clock event instance 149 * @evt: Address of clock event instance
150 * 150 *
151 * returns: Always 0 - success 151 * returns: Always 0 - success
152 **/ 152 **/
153static int xttcpss_set_next_event(unsigned long cycles, 153static int xttcps_set_next_event(unsigned long cycles,
154 struct clock_event_device *evt) 154 struct clock_event_device *evt)
155{ 155{
156 struct xttcpss_timer_clockevent *xttce = to_xttcpss_timer_clkevent(evt); 156 struct xttcps_timer_clockevent *xttce = to_xttcps_timer_clkevent(evt);
157 struct xttcpss_timer *timer = &xttce->xttc; 157 struct xttcps_timer *timer = &xttce->xttc;
158 158
159 xttcpss_set_interval(timer, cycles); 159 xttcps_set_interval(timer, cycles);
160 return 0; 160 return 0;
161} 161}
162 162
163/** 163/**
164 * xttcpss_set_mode - Sets the mode of timer 164 * xttcps_set_mode - Sets the mode of timer
165 * 165 *
166 * @mode: Mode to be set 166 * @mode: Mode to be set
167 * @evt: Address of clock event instance 167 * @evt: Address of clock event instance
168 **/ 168 **/
169static void xttcpss_set_mode(enum clock_event_mode mode, 169static void xttcps_set_mode(enum clock_event_mode mode,
170 struct clock_event_device *evt) 170 struct clock_event_device *evt)
171{ 171{
172 struct xttcpss_timer_clockevent *xttce = to_xttcpss_timer_clkevent(evt); 172 struct xttcps_timer_clockevent *xttce = to_xttcps_timer_clkevent(evt);
173 struct xttcpss_timer *timer = &xttce->xttc; 173 struct xttcps_timer *timer = &xttce->xttc;
174 u32 ctrl_reg; 174 u32 ctrl_reg;
175 175
176 switch (mode) { 176 switch (mode) {
177 case CLOCK_EVT_MODE_PERIODIC: 177 case CLOCK_EVT_MODE_PERIODIC:
178 xttcpss_set_interval(timer, 178 xttcps_set_interval(timer,
179 DIV_ROUND_CLOSEST(clk_get_rate(xttce->clk), 179 DIV_ROUND_CLOSEST(clk_get_rate(xttce->clk),
180 PRESCALE * HZ)); 180 PRESCALE * HZ));
181 break; 181 break;
@@ -183,17 +183,17 @@ static void xttcpss_set_mode(enum clock_event_mode mode,
183 case CLOCK_EVT_MODE_UNUSED: 183 case CLOCK_EVT_MODE_UNUSED:
184 case CLOCK_EVT_MODE_SHUTDOWN: 184 case CLOCK_EVT_MODE_SHUTDOWN:
185 ctrl_reg = __raw_readl(timer->base_addr + 185 ctrl_reg = __raw_readl(timer->base_addr +
186 XTTCPSS_CNT_CNTRL_OFFSET); 186 XTTCPS_CNT_CNTRL_OFFSET);
187 ctrl_reg |= XTTCPSS_CNT_CNTRL_DISABLE_MASK; 187 ctrl_reg |= XTTCPS_CNT_CNTRL_DISABLE_MASK;
188 __raw_writel(ctrl_reg, 188 __raw_writel(ctrl_reg,
189 timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 189 timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET);
190 break; 190 break;
191 case CLOCK_EVT_MODE_RESUME: 191 case CLOCK_EVT_MODE_RESUME:
192 ctrl_reg = __raw_readl(timer->base_addr + 192 ctrl_reg = __raw_readl(timer->base_addr +
193 XTTCPSS_CNT_CNTRL_OFFSET); 193 XTTCPS_CNT_CNTRL_OFFSET);
194 ctrl_reg &= ~XTTCPSS_CNT_CNTRL_DISABLE_MASK; 194 ctrl_reg &= ~XTTCPS_CNT_CNTRL_DISABLE_MASK;
195 __raw_writel(ctrl_reg, 195 __raw_writel(ctrl_reg,
196 timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 196 timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET);
197 break; 197 break;
198 } 198 }
199} 199}
@@ -201,7 +201,7 @@ static void xttcpss_set_mode(enum clock_event_mode mode,
201static void __init zynq_ttc_setup_clocksource(struct device_node *np, 201static void __init zynq_ttc_setup_clocksource(struct device_node *np,
202 void __iomem *base) 202 void __iomem *base)
203{ 203{
204 struct xttcpss_timer_clocksource *ttccs; 204 struct xttcps_timer_clocksource *ttccs;
205 struct clk *clk; 205 struct clk *clk;
206 int err; 206 int err;
207 u32 reg; 207 u32 reg;
@@ -230,11 +230,11 @@ static void __init zynq_ttc_setup_clocksource(struct device_node *np,
230 ttccs->cs.mask = CLOCKSOURCE_MASK(16); 230 ttccs->cs.mask = CLOCKSOURCE_MASK(16);
231 ttccs->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS; 231 ttccs->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
232 232
233 __raw_writel(0x0, ttccs->xttc.base_addr + XTTCPSS_IER_OFFSET); 233 __raw_writel(0x0, ttccs->xttc.base_addr + XTTCPS_IER_OFFSET);
234 __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN, 234 __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN,
235 ttccs->xttc.base_addr + XTTCPSS_CLK_CNTRL_OFFSET); 235 ttccs->xttc.base_addr + XTTCPS_CLK_CNTRL_OFFSET);
236 __raw_writel(CNT_CNTRL_RESET, 236 __raw_writel(CNT_CNTRL_RESET,
237 ttccs->xttc.base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 237 ttccs->xttc.base_addr + XTTCPS_CNT_CNTRL_OFFSET);
238 238
239 err = clocksource_register_hz(&ttccs->cs, clk_get_rate(clk) / PRESCALE); 239 err = clocksource_register_hz(&ttccs->cs, clk_get_rate(clk) / PRESCALE);
240 if (WARN_ON(err)) 240 if (WARN_ON(err))
@@ -244,7 +244,7 @@ static void __init zynq_ttc_setup_clocksource(struct device_node *np,
244static void __init zynq_ttc_setup_clockevent(struct device_node *np, 244static void __init zynq_ttc_setup_clockevent(struct device_node *np,
245 void __iomem *base) 245 void __iomem *base)
246{ 246{
247 struct xttcpss_timer_clockevent *ttcce; 247 struct xttcps_timer_clockevent *ttcce;
248 int err, irq; 248 int err, irq;
249 u32 reg; 249 u32 reg;
250 250
@@ -272,17 +272,17 @@ static void __init zynq_ttc_setup_clockevent(struct device_node *np,
272 272
273 ttcce->ce.name = np->name; 273 ttcce->ce.name = np->name;
274 ttcce->ce.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; 274 ttcce->ce.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
275 ttcce->ce.set_next_event = xttcpss_set_next_event; 275 ttcce->ce.set_next_event = xttcps_set_next_event;
276 ttcce->ce.set_mode = xttcpss_set_mode; 276 ttcce->ce.set_mode = xttcps_set_mode;
277 ttcce->ce.rating = 200; 277 ttcce->ce.rating = 200;
278 ttcce->ce.irq = irq; 278 ttcce->ce.irq = irq;
279 279
280 __raw_writel(0x23, ttcce->xttc.base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 280 __raw_writel(0x23, ttcce->xttc.base_addr + XTTCPS_CNT_CNTRL_OFFSET);
281 __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN, 281 __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN,
282 ttcce->xttc.base_addr + XTTCPSS_CLK_CNTRL_OFFSET); 282 ttcce->xttc.base_addr + XTTCPS_CLK_CNTRL_OFFSET);
283 __raw_writel(0x1, ttcce->xttc.base_addr + XTTCPSS_IER_OFFSET); 283 __raw_writel(0x1, ttcce->xttc.base_addr + XTTCPS_IER_OFFSET);
284 284
285 err = request_irq(irq, xttcpss_clock_event_interrupt, IRQF_TIMER, 285 err = request_irq(irq, xttcps_clock_event_interrupt, IRQF_TIMER,
286 np->name, ttcce); 286 np->name, ttcce);
287 if (WARN_ON(err)) 287 if (WARN_ON(err))
288 return; 288 return;
@@ -301,12 +301,12 @@ static const __initconst struct of_device_id zynq_ttc_match[] = {
301}; 301};
302 302
303/** 303/**
304 * xttcpss_timer_init - Initialize the timer 304 * xttcps_timer_init - Initialize the timer
305 * 305 *
306 * Initializes the timer hardware and register the clock source and clock event 306 * Initializes the timer hardware and register the clock source and clock event
307 * timers with Linux kernal timer framework 307 * timers with Linux kernal timer framework
308 **/ 308 **/
309void __init xttcpss_timer_init(void) 309void __init xttcps_timer_init(void)
310{ 310{
311 struct device_node *np; 311 struct device_node *np;
312 312