Thomas Gleixner | a636cd6 | 2019-05-19 15:51:34 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 2 | /* |
| 3 | * System timer for CSR SiRFprimaII |
| 4 | * |
| 5 | * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <linux/kernel.h> |
| 9 | #include <linux/interrupt.h> |
| 10 | #include <linux/clockchips.h> |
| 11 | #include <linux/clocksource.h> |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 12 | #include <linux/cpu.h> |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 13 | #include <linux/bitops.h> |
| 14 | #include <linux/irq.h> |
| 15 | #include <linux/clk.h> |
| 16 | #include <linux/slab.h> |
| 17 | #include <linux/of.h> |
| 18 | #include <linux/of_irq.h> |
| 19 | #include <linux/of_address.h> |
Stephen Boyd | 38ff87f | 2013-06-01 23:39:40 -0700 | [diff] [blame] | 20 | #include <linux/sched_clock.h> |
Uwe Kleine-König | 980c51a | 2013-11-11 21:06:11 +0100 | [diff] [blame] | 21 | |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 22 | #define SIRFSOC_TIMER_32COUNTER_0_CTRL 0x0000 |
| 23 | #define SIRFSOC_TIMER_32COUNTER_1_CTRL 0x0004 |
| 24 | #define SIRFSOC_TIMER_MATCH_0 0x0018 |
| 25 | #define SIRFSOC_TIMER_MATCH_1 0x001c |
| 26 | #define SIRFSOC_TIMER_COUNTER_0 0x0048 |
| 27 | #define SIRFSOC_TIMER_COUNTER_1 0x004c |
| 28 | #define SIRFSOC_TIMER_INTR_STATUS 0x0060 |
| 29 | #define SIRFSOC_TIMER_WATCHDOG_EN 0x0064 |
| 30 | #define SIRFSOC_TIMER_64COUNTER_CTRL 0x0068 |
| 31 | #define SIRFSOC_TIMER_64COUNTER_LO 0x006c |
| 32 | #define SIRFSOC_TIMER_64COUNTER_HI 0x0070 |
| 33 | #define SIRFSOC_TIMER_64COUNTER_LOAD_LO 0x0074 |
| 34 | #define SIRFSOC_TIMER_64COUNTER_LOAD_HI 0x0078 |
| 35 | #define SIRFSOC_TIMER_64COUNTER_RLATCHED_LO 0x007c |
| 36 | #define SIRFSOC_TIMER_64COUNTER_RLATCHED_HI 0x0080 |
| 37 | |
| 38 | #define SIRFSOC_TIMER_REG_CNT 6 |
| 39 | |
Barry Song | 5833ac9 | 2015-01-12 00:04:43 +0800 | [diff] [blame] | 40 | static unsigned long atlas7_timer_rate; |
Yanchang Li | ef89af1 | 2014-11-11 20:42:52 +0800 | [diff] [blame] | 41 | |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 42 | static const u32 sirfsoc_timer_reg_list[SIRFSOC_TIMER_REG_CNT] = { |
| 43 | SIRFSOC_TIMER_WATCHDOG_EN, |
| 44 | SIRFSOC_TIMER_32COUNTER_0_CTRL, |
| 45 | SIRFSOC_TIMER_32COUNTER_1_CTRL, |
| 46 | SIRFSOC_TIMER_64COUNTER_CTRL, |
| 47 | SIRFSOC_TIMER_64COUNTER_RLATCHED_LO, |
| 48 | SIRFSOC_TIMER_64COUNTER_RLATCHED_HI, |
| 49 | }; |
| 50 | |
| 51 | static u32 sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT]; |
| 52 | |
| 53 | static void __iomem *sirfsoc_timer_base; |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 54 | |
| 55 | /* disable count and interrupt */ |
| 56 | static inline void sirfsoc_timer_count_disable(int idx) |
| 57 | { |
| 58 | writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx) & ~0x7, |
| 59 | sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx); |
| 60 | } |
| 61 | |
| 62 | /* enable count and interrupt */ |
| 63 | static inline void sirfsoc_timer_count_enable(int idx) |
| 64 | { |
Hao Liu | 28cf356 | 2014-09-29 01:50:06 +0200 | [diff] [blame] | 65 | writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx) | 0x3, |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 66 | sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx); |
| 67 | } |
| 68 | |
| 69 | /* timer interrupt handler */ |
| 70 | static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id) |
| 71 | { |
| 72 | struct clock_event_device *ce = dev_id; |
| 73 | int cpu = smp_processor_id(); |
| 74 | |
| 75 | /* clear timer interrupt */ |
| 76 | writel_relaxed(BIT(cpu), sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); |
| 77 | |
Viresh Kumar | 1e729d3 | 2015-06-18 16:24:43 +0530 | [diff] [blame] | 78 | if (clockevent_state_oneshot(ce)) |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 79 | sirfsoc_timer_count_disable(cpu); |
| 80 | |
| 81 | ce->event_handler(ce); |
| 82 | |
| 83 | return IRQ_HANDLED; |
| 84 | } |
| 85 | |
| 86 | /* read 64-bit timer counter */ |
Thomas Gleixner | a5a1d1c | 2016-12-21 20:32:01 +0100 | [diff] [blame] | 87 | static u64 sirfsoc_timer_read(struct clocksource *cs) |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 88 | { |
| 89 | u64 cycles; |
| 90 | |
| 91 | writel_relaxed((readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) | |
| 92 | BIT(0)) & ~BIT(1), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); |
| 93 | |
| 94 | cycles = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_RLATCHED_HI); |
| 95 | cycles = (cycles << 32) | readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_RLATCHED_LO); |
| 96 | |
| 97 | return cycles; |
| 98 | } |
| 99 | |
| 100 | static int sirfsoc_timer_set_next_event(unsigned long delta, |
| 101 | struct clock_event_device *ce) |
| 102 | { |
| 103 | int cpu = smp_processor_id(); |
| 104 | |
Hao Liu | 28cf356 | 2014-09-29 01:50:06 +0200 | [diff] [blame] | 105 | /* disable timer first, then modify the related registers */ |
| 106 | sirfsoc_timer_count_disable(cpu); |
| 107 | |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 108 | writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_0 + |
| 109 | 4 * cpu); |
| 110 | writel_relaxed(delta, sirfsoc_timer_base + SIRFSOC_TIMER_MATCH_0 + |
| 111 | 4 * cpu); |
| 112 | |
| 113 | /* enable the tick */ |
| 114 | sirfsoc_timer_count_enable(cpu); |
| 115 | |
| 116 | return 0; |
| 117 | } |
| 118 | |
Viresh Kumar | 1e729d3 | 2015-06-18 16:24:43 +0530 | [diff] [blame] | 119 | /* Oneshot is enabled in set_next_event */ |
| 120 | static int sirfsoc_timer_shutdown(struct clock_event_device *evt) |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 121 | { |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 122 | sirfsoc_timer_count_disable(smp_processor_id()); |
Viresh Kumar | 1e729d3 | 2015-06-18 16:24:43 +0530 | [diff] [blame] | 123 | return 0; |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | static void sirfsoc_clocksource_suspend(struct clocksource *cs) |
| 127 | { |
| 128 | int i; |
| 129 | |
| 130 | for (i = 0; i < SIRFSOC_TIMER_REG_CNT; i++) |
| 131 | sirfsoc_timer_reg_val[i] = readl_relaxed(sirfsoc_timer_base + sirfsoc_timer_reg_list[i]); |
| 132 | } |
| 133 | |
| 134 | static void sirfsoc_clocksource_resume(struct clocksource *cs) |
| 135 | { |
| 136 | int i; |
| 137 | |
| 138 | for (i = 0; i < SIRFSOC_TIMER_REG_CNT - 2; i++) |
| 139 | writel_relaxed(sirfsoc_timer_reg_val[i], sirfsoc_timer_base + sirfsoc_timer_reg_list[i]); |
| 140 | |
| 141 | writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2], |
| 142 | sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_LO); |
| 143 | writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1], |
| 144 | sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_HI); |
| 145 | |
| 146 | writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) | |
| 147 | BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); |
| 148 | } |
| 149 | |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 150 | static struct clock_event_device __percpu *sirfsoc_clockevent; |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 151 | |
| 152 | static struct clocksource sirfsoc_clocksource = { |
| 153 | .name = "sirfsoc_clocksource", |
| 154 | .rating = 200, |
| 155 | .mask = CLOCKSOURCE_MASK(64), |
| 156 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
| 157 | .read = sirfsoc_timer_read, |
| 158 | .suspend = sirfsoc_clocksource_suspend, |
| 159 | .resume = sirfsoc_clocksource_resume, |
| 160 | }; |
| 161 | |
| 162 | static struct irqaction sirfsoc_timer_irq = { |
| 163 | .name = "sirfsoc_timer0", |
| 164 | .flags = IRQF_TIMER | IRQF_NOBALANCING, |
| 165 | .handler = sirfsoc_timer_interrupt, |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 166 | }; |
| 167 | |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 168 | static struct irqaction sirfsoc_timer1_irq = { |
| 169 | .name = "sirfsoc_timer1", |
| 170 | .flags = IRQF_TIMER | IRQF_NOBALANCING, |
| 171 | .handler = sirfsoc_timer_interrupt, |
| 172 | }; |
| 173 | |
Richard Cochran | eb0a9d8 | 2016-07-13 17:17:07 +0000 | [diff] [blame] | 174 | static int sirfsoc_local_timer_starting_cpu(unsigned int cpu) |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 175 | { |
Richard Cochran | eb0a9d8 | 2016-07-13 17:17:07 +0000 | [diff] [blame] | 176 | struct clock_event_device *ce = per_cpu_ptr(sirfsoc_clockevent, cpu); |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 177 | struct irqaction *action; |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 178 | |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 179 | if (cpu == 0) |
| 180 | action = &sirfsoc_timer_irq; |
| 181 | else |
| 182 | action = &sirfsoc_timer1_irq; |
| 183 | |
| 184 | ce->irq = action->irq; |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 185 | ce->name = "local_timer"; |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 186 | ce->features = CLOCK_EVT_FEAT_ONESHOT; |
| 187 | ce->rating = 200; |
Viresh Kumar | 1e729d3 | 2015-06-18 16:24:43 +0530 | [diff] [blame] | 188 | ce->set_state_shutdown = sirfsoc_timer_shutdown; |
| 189 | ce->set_state_oneshot = sirfsoc_timer_shutdown; |
| 190 | ce->tick_resume = sirfsoc_timer_shutdown; |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 191 | ce->set_next_event = sirfsoc_timer_set_next_event; |
Barry Song | 5833ac9 | 2015-01-12 00:04:43 +0800 | [diff] [blame] | 192 | clockevents_calc_mult_shift(ce, atlas7_timer_rate, 60); |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 193 | ce->max_delta_ns = clockevent_delta2ns(-2, ce); |
Nicolai Stange | 547733c | 2017-03-30 22:10:21 +0200 | [diff] [blame] | 194 | ce->max_delta_ticks = (unsigned long)-2; |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 195 | ce->min_delta_ns = clockevent_delta2ns(2, ce); |
Nicolai Stange | 547733c | 2017-03-30 22:10:21 +0200 | [diff] [blame] | 196 | ce->min_delta_ticks = 2; |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 197 | ce->cpumask = cpumask_of(cpu); |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 198 | |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 199 | action->dev_id = ce; |
| 200 | BUG_ON(setup_irq(ce->irq, action)); |
Zhiwu Song | f214be5 | 2014-05-07 14:46:44 +0800 | [diff] [blame] | 201 | irq_force_affinity(action->irq, cpumask_of(cpu)); |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 202 | |
| 203 | clockevents_register_device(ce); |
| 204 | return 0; |
| 205 | } |
| 206 | |
Richard Cochran | eb0a9d8 | 2016-07-13 17:17:07 +0000 | [diff] [blame] | 207 | static int sirfsoc_local_timer_dying_cpu(unsigned int cpu) |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 208 | { |
| 209 | sirfsoc_timer_count_disable(1); |
| 210 | |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 211 | if (cpu == 0) |
| 212 | remove_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq); |
| 213 | else |
| 214 | remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq); |
Richard Cochran | eb0a9d8 | 2016-07-13 17:17:07 +0000 | [diff] [blame] | 215 | return 0; |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 216 | } |
| 217 | |
Daniel Lezcano | c41c96d | 2016-06-06 18:01:09 +0200 | [diff] [blame] | 218 | static int __init sirfsoc_clockevent_init(void) |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 219 | { |
Stephen Boyd | 05a6548 | 2013-02-15 17:02:16 -0800 | [diff] [blame] | 220 | sirfsoc_clockevent = alloc_percpu(struct clock_event_device); |
| 221 | BUG_ON(!sirfsoc_clockevent); |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 222 | |
Richard Cochran | eb0a9d8 | 2016-07-13 17:17:07 +0000 | [diff] [blame] | 223 | /* Install and invoke hotplug callbacks */ |
| 224 | return cpuhp_setup_state(CPUHP_AP_MARCO_TIMER_STARTING, |
Thomas Gleixner | 73c1b41 | 2016-12-21 20:19:54 +0100 | [diff] [blame] | 225 | "clockevents/marco:starting", |
Richard Cochran | eb0a9d8 | 2016-07-13 17:17:07 +0000 | [diff] [blame] | 226 | sirfsoc_local_timer_starting_cpu, |
| 227 | sirfsoc_local_timer_dying_cpu); |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | /* initialize the kernel jiffy timer source */ |
Daniel Lezcano | c41c96d | 2016-06-06 18:01:09 +0200 | [diff] [blame] | 231 | static int __init sirfsoc_atlas7_timer_init(struct device_node *np) |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 232 | { |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 233 | struct clk *clk; |
| 234 | |
Zhiwu Song | c7cff54 | 2014-05-05 19:30:04 +0800 | [diff] [blame] | 235 | clk = of_clk_get(np, 0); |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 236 | BUG_ON(IS_ERR(clk)); |
Zhiwu Song | 3894152 | 2014-07-03 20:52:51 +0800 | [diff] [blame] | 237 | |
| 238 | BUG_ON(clk_prepare_enable(clk)); |
| 239 | |
Barry Song | 5833ac9 | 2015-01-12 00:04:43 +0800 | [diff] [blame] | 240 | atlas7_timer_rate = clk_get_rate(clk); |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 241 | |
Yanchang Li | ef89af1 | 2014-11-11 20:42:52 +0800 | [diff] [blame] | 242 | /* timer dividers: 0, not divided */ |
| 243 | writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); |
| 244 | writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL); |
| 245 | writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_1_CTRL); |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 246 | |
| 247 | /* Initialize timer counters to 0 */ |
| 248 | writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_LO); |
| 249 | writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_HI); |
| 250 | writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) | |
| 251 | BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); |
| 252 | writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_0); |
| 253 | writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_1); |
| 254 | |
| 255 | /* Clear all interrupts */ |
| 256 | writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); |
| 257 | |
Barry Song | 5833ac9 | 2015-01-12 00:04:43 +0800 | [diff] [blame] | 258 | BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, atlas7_timer_rate)); |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 259 | |
Daniel Lezcano | c41c96d | 2016-06-06 18:01:09 +0200 | [diff] [blame] | 260 | return sirfsoc_clockevent_init(); |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 261 | } |
| 262 | |
Daniel Lezcano | c41c96d | 2016-06-06 18:01:09 +0200 | [diff] [blame] | 263 | static int __init sirfsoc_of_timer_init(struct device_node *np) |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 264 | { |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 265 | sirfsoc_timer_base = of_iomap(np, 0); |
Daniel Lezcano | c41c96d | 2016-06-06 18:01:09 +0200 | [diff] [blame] | 266 | if (!sirfsoc_timer_base) { |
| 267 | pr_err("unable to map timer cpu registers\n"); |
| 268 | return -ENXIO; |
| 269 | } |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 270 | |
| 271 | sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0); |
Daniel Lezcano | c41c96d | 2016-06-06 18:01:09 +0200 | [diff] [blame] | 272 | if (!sirfsoc_timer_irq.irq) { |
| 273 | pr_err("No irq passed for timer0 via DT\n"); |
| 274 | return -EINVAL; |
| 275 | } |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 276 | |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 277 | sirfsoc_timer1_irq.irq = irq_of_parse_and_map(np, 1); |
Daniel Lezcano | c41c96d | 2016-06-06 18:01:09 +0200 | [diff] [blame] | 278 | if (!sirfsoc_timer1_irq.irq) { |
| 279 | pr_err("No irq passed for timer1 via DT\n"); |
| 280 | return -EINVAL; |
| 281 | } |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 282 | |
Daniel Lezcano | c41c96d | 2016-06-06 18:01:09 +0200 | [diff] [blame] | 283 | return sirfsoc_atlas7_timer_init(np); |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 284 | } |
Daniel Lezcano | 1727339 | 2017-05-26 16:56:11 +0200 | [diff] [blame] | 285 | TIMER_OF_DECLARE(sirfsoc_atlas7_timer, "sirf,atlas7-tick", sirfsoc_of_timer_init); |