diff options
author | Anson Huang <anson.huang@nxp.com> | 2018-11-04 20:10:27 -0500 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2018-12-18 16:22:23 -0500 |
commit | df181e38281602bb404c5c8158a87317274dc653 (patch) | |
tree | f468076cd5dd044c41da23a61b9e339d86b29a4a /drivers/clocksource/timer-imx-gpt.c | |
parent | fa83c6f45aa560f814adfdf1a0bf523c1157dfe1 (diff) |
clocksource/drivers/imx-gpt: Add support for ARM64
This patch allows building and compile-testing the i.MX GPT driver
also for ARM64. The delay_timer is only supported on ARMv7.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/clocksource/timer-imx-gpt.c')
-rw-r--r-- | drivers/clocksource/timer-imx-gpt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/clocksource/timer-imx-gpt.c b/drivers/clocksource/timer-imx-gpt.c index 165fbbb1c9a0..a3d6ccbf4a16 100644 --- a/drivers/clocksource/timer-imx-gpt.c +++ b/drivers/clocksource/timer-imx-gpt.c | |||
@@ -141,21 +141,25 @@ static u64 notrace mxc_read_sched_clock(void) | |||
141 | return sched_clock_reg ? readl_relaxed(sched_clock_reg) : 0; | 141 | return sched_clock_reg ? readl_relaxed(sched_clock_reg) : 0; |
142 | } | 142 | } |
143 | 143 | ||
144 | #if defined(CONFIG_ARM) | ||
144 | static struct delay_timer imx_delay_timer; | 145 | static struct delay_timer imx_delay_timer; |
145 | 146 | ||
146 | static unsigned long imx_read_current_timer(void) | 147 | static unsigned long imx_read_current_timer(void) |
147 | { | 148 | { |
148 | return readl_relaxed(sched_clock_reg); | 149 | return readl_relaxed(sched_clock_reg); |
149 | } | 150 | } |
151 | #endif | ||
150 | 152 | ||
151 | static int __init mxc_clocksource_init(struct imx_timer *imxtm) | 153 | static int __init mxc_clocksource_init(struct imx_timer *imxtm) |
152 | { | 154 | { |
153 | unsigned int c = clk_get_rate(imxtm->clk_per); | 155 | unsigned int c = clk_get_rate(imxtm->clk_per); |
154 | void __iomem *reg = imxtm->base + imxtm->gpt->reg_tcn; | 156 | void __iomem *reg = imxtm->base + imxtm->gpt->reg_tcn; |
155 | 157 | ||
158 | #if defined(CONFIG_ARM) | ||
156 | imx_delay_timer.read_current_timer = &imx_read_current_timer; | 159 | imx_delay_timer.read_current_timer = &imx_read_current_timer; |
157 | imx_delay_timer.freq = c; | 160 | imx_delay_timer.freq = c; |
158 | register_current_timer_delay(&imx_delay_timer); | 161 | register_current_timer_delay(&imx_delay_timer); |
162 | #endif | ||
159 | 163 | ||
160 | sched_clock_reg = reg; | 164 | sched_clock_reg = reg; |
161 | 165 | ||