Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Anson Huang and committed by
Daniel Lezcano
df181e38 fa83c6f4

+5 -1
+1 -1
drivers/clocksource/Kconfig
··· 567 567 568 568 config CLKSRC_IMX_GPT 569 569 bool "Clocksource using i.MX GPT" if COMPILE_TEST 570 - depends on ARM && CLKDEV_LOOKUP 570 + depends on (ARM || ARM64) && CLKDEV_LOOKUP 571 571 select CLKSRC_MMIO 572 572 573 573 config CLKSRC_IMX_TPM
+4
drivers/clocksource/timer-imx-gpt.c
··· 141 141 return sched_clock_reg ? readl_relaxed(sched_clock_reg) : 0; 142 142 } 143 143 144 + #if defined(CONFIG_ARM) 144 145 static struct delay_timer imx_delay_timer; 145 146 146 147 static unsigned long imx_read_current_timer(void) 147 148 { 148 149 return readl_relaxed(sched_clock_reg); 149 150 } 151 + #endif 150 152 151 153 static int __init mxc_clocksource_init(struct imx_timer *imxtm) 152 154 { 153 155 unsigned int c = clk_get_rate(imxtm->clk_per); 154 156 void __iomem *reg = imxtm->base + imxtm->gpt->reg_tcn; 155 157 158 + #if defined(CONFIG_ARM) 156 159 imx_delay_timer.read_current_timer = &imx_read_current_timer; 157 160 imx_delay_timer.freq = c; 158 161 register_current_timer_delay(&imx_delay_timer); 162 + #endif 159 163 160 164 sched_clock_reg = reg; 161 165