@@ -42,13 +42,13 @@ static unsigned int timer_clock_freq;
4242#define TCSR_PWMA (1<<9)
4343#define TCSR_ENALL (1<<10)
4444
45- static inline void microblaze_timer0_stop (void )
45+ static inline void xilinx_timer0_stop (void )
4646{
4747 out_be32 (timer_baseaddr + TCSR0 ,
4848 in_be32 (timer_baseaddr + TCSR0 ) & ~TCSR_ENT );
4949}
5050
51- static inline void microblaze_timer0_start_periodic (unsigned long load_val )
51+ static inline void xilinx_timer0_start_periodic (unsigned long load_val )
5252{
5353 if (!load_val )
5454 load_val = 1 ;
@@ -75,7 +75,7 @@ static inline void microblaze_timer0_start_periodic(unsigned long load_val)
7575 TCSR_TINT |TCSR_ENIT |TCSR_ENT |TCSR_ARHT |TCSR_UDT );
7676}
7777
78- static inline void microblaze_timer0_start_oneshot (unsigned long load_val )
78+ static inline void xilinx_timer0_start_oneshot (unsigned long load_val )
7979{
8080 if (!load_val )
8181 load_val = 1 ;
@@ -89,21 +89,21 @@ static inline void microblaze_timer0_start_oneshot(unsigned long load_val)
8989 TCSR_TINT |TCSR_ENIT |TCSR_ENT |TCSR_ARHT |TCSR_UDT );
9090}
9191
92- static int microblaze_timer_set_next_event (unsigned long delta ,
92+ static int xilinx_timer_set_next_event (unsigned long delta ,
9393 struct clock_event_device * dev )
9494{
9595 pr_debug ("%s: next event, delta %x\n" , __func__ , (u32 )delta );
96- microblaze_timer0_start_oneshot (delta );
96+ xilinx_timer0_start_oneshot (delta );
9797 return 0 ;
9898}
9999
100- static void microblaze_timer_set_mode (enum clock_event_mode mode ,
100+ static void xilinx_timer_set_mode (enum clock_event_mode mode ,
101101 struct clock_event_device * evt )
102102{
103103 switch (mode ) {
104104 case CLOCK_EVT_MODE_PERIODIC :
105105 pr_info ("%s: periodic\n" , __func__ );
106- microblaze_timer0_start_periodic (freq_div_hz );
106+ xilinx_timer0_start_periodic (freq_div_hz );
107107 break ;
108108 case CLOCK_EVT_MODE_ONESHOT :
109109 pr_info ("%s: oneshot\n" , __func__ );
@@ -113,21 +113,21 @@ static void microblaze_timer_set_mode(enum clock_event_mode mode,
113113 break ;
114114 case CLOCK_EVT_MODE_SHUTDOWN :
115115 pr_info ("%s: shutdown\n" , __func__ );
116- microblaze_timer0_stop ();
116+ xilinx_timer0_stop ();
117117 break ;
118118 case CLOCK_EVT_MODE_RESUME :
119119 pr_info ("%s: resume\n" , __func__ );
120120 break ;
121121 }
122122}
123123
124- static struct clock_event_device clockevent_microblaze_timer = {
125- .name = "microblaze_clockevent " ,
124+ static struct clock_event_device clockevent_xilinx_timer = {
125+ .name = "xilinx_clockevent " ,
126126 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC ,
127127 .shift = 8 ,
128128 .rating = 300 ,
129- .set_next_event = microblaze_timer_set_next_event ,
130- .set_mode = microblaze_timer_set_mode ,
129+ .set_next_event = xilinx_timer_set_next_event ,
130+ .set_mode = xilinx_timer_set_mode ,
131131};
132132
133133static inline void timer_ack (void )
@@ -137,7 +137,7 @@ static inline void timer_ack(void)
137137
138138static irqreturn_t timer_interrupt (int irq , void * dev_id )
139139{
140- struct clock_event_device * evt = & clockevent_microblaze_timer ;
140+ struct clock_event_device * evt = & clockevent_xilinx_timer ;
141141#ifdef CONFIG_HEART_BEAT
142142 heartbeat ();
143143#endif
@@ -150,62 +150,62 @@ static struct irqaction timer_irqaction = {
150150 .handler = timer_interrupt ,
151151 .flags = IRQF_DISABLED | IRQF_TIMER ,
152152 .name = "timer" ,
153- .dev_id = & clockevent_microblaze_timer ,
153+ .dev_id = & clockevent_xilinx_timer ,
154154};
155155
156- static __init void microblaze_clockevent_init (void )
156+ static __init void xilinx_clockevent_init (void )
157157{
158- clockevent_microblaze_timer .mult =
158+ clockevent_xilinx_timer .mult =
159159 div_sc (timer_clock_freq , NSEC_PER_SEC ,
160- clockevent_microblaze_timer .shift );
161- clockevent_microblaze_timer .max_delta_ns =
162- clockevent_delta2ns ((u32 )~0 , & clockevent_microblaze_timer );
163- clockevent_microblaze_timer .min_delta_ns =
164- clockevent_delta2ns (1 , & clockevent_microblaze_timer );
165- clockevent_microblaze_timer .cpumask = cpumask_of (0 );
166- clockevents_register_device (& clockevent_microblaze_timer );
160+ clockevent_xilinx_timer .shift );
161+ clockevent_xilinx_timer .max_delta_ns =
162+ clockevent_delta2ns ((u32 )~0 , & clockevent_xilinx_timer );
163+ clockevent_xilinx_timer .min_delta_ns =
164+ clockevent_delta2ns (1 , & clockevent_xilinx_timer );
165+ clockevent_xilinx_timer .cpumask = cpumask_of (0 );
166+ clockevents_register_device (& clockevent_xilinx_timer );
167167}
168168
169- static cycle_t microblaze_read (struct clocksource * cs )
169+ static cycle_t xilinx_read (struct clocksource * cs )
170170{
171171 /* reading actual value of timer 1 */
172172 return (cycle_t ) (in_be32 (timer_baseaddr + TCR1 ));
173173}
174174
175- static struct timecounter microblaze_tc = {
175+ static struct timecounter xilinx_tc = {
176176 .cc = NULL ,
177177};
178178
179- static cycle_t microblaze_cc_read (const struct cyclecounter * cc )
179+ static cycle_t xilinx_cc_read (const struct cyclecounter * cc )
180180{
181- return microblaze_read (NULL );
181+ return xilinx_read (NULL );
182182}
183183
184- static struct cyclecounter microblaze_cc = {
185- .read = microblaze_cc_read ,
184+ static struct cyclecounter xilinx_cc = {
185+ .read = xilinx_cc_read ,
186186 .mask = CLOCKSOURCE_MASK (32 ),
187187 .shift = 8 ,
188188};
189189
190- static int __init init_microblaze_timecounter (void )
190+ static int __init init_xilinx_timecounter (void )
191191{
192- microblaze_cc .mult = div_sc (timer_clock_freq , NSEC_PER_SEC ,
193- microblaze_cc .shift );
192+ xilinx_cc .mult = div_sc (timer_clock_freq , NSEC_PER_SEC ,
193+ xilinx_cc .shift );
194194
195- timecounter_init (& microblaze_tc , & microblaze_cc , sched_clock ());
195+ timecounter_init (& xilinx_tc , & xilinx_cc , sched_clock ());
196196
197197 return 0 ;
198198}
199199
200200static struct clocksource clocksource_microblaze = {
201- .name = "microblaze_clocksource " ,
201+ .name = "xilinx_clocksource " ,
202202 .rating = 300 ,
203- .read = microblaze_read ,
203+ .read = xilinx_read ,
204204 .mask = CLOCKSOURCE_MASK (32 ),
205205 .flags = CLOCK_SOURCE_IS_CONTINUOUS ,
206206};
207207
208- static int __init microblaze_clocksource_init (void )
208+ static int __init xilinx_clocksource_init (void )
209209{
210210 if (clocksource_register_hz (& clocksource_microblaze , timer_clock_freq ))
211211 panic ("failed to register clocksource" );
@@ -217,7 +217,7 @@ static int __init microblaze_clocksource_init(void)
217217 out_be32 (timer_baseaddr + TCSR1 , TCSR_TINT |TCSR_ENT |TCSR_ARHT );
218218
219219 /* register timecounter - for ftrace support */
220- init_microblaze_timecounter ();
220+ init_xilinx_timecounter ();
221221 return 0 ;
222222}
223223
@@ -260,8 +260,8 @@ static void __init xilinx_timer_init(struct device_node *timer)
260260#ifdef CONFIG_HEART_BEAT
261261 setup_heartbeat ();
262262#endif
263- microblaze_clocksource_init ();
264- microblaze_clockevent_init ();
263+ xilinx_clocksource_init ();
264+ xilinx_clockevent_init ();
265265 timer_initialized = 1 ;
266266}
267267
0 commit comments