summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2020-09-18 21:22:34 +0800
committerDaniel Lezcano <daniel.lezcano@linaro.org>2020-09-24 10:51:04 +0200
commit23c788cd48db9e2646fb5455f004e4a5626e4230 (patch)
tree0dd3dde07bc62482898c2bc9529c515fd9347950 /drivers/mtd
parente69aae713bef63b357d4ff85bcb3f8f63dbf4ba3 (diff)
downloadlinux-stable-23c788cd48db9e2646fb5455f004e4a5626e4230.tar.gz
linux-stable-23c788cd48db9e2646fb5455f004e4a5626e4230.tar.bz2
linux-stable-23c788cd48db9e2646fb5455f004e4a5626e4230.zip
clocksource/drivers/sp804: Support non-standard register offset
The ARM SP804 supports a maximum of 32-bit counter, but Hisilicon extends it to 64-bit. That means, the registers: TimerXload, TimerXValue and TimerXBGLoad are 64bits, all other registers are the same as those in the SP804. The driver code can be completely reused except that the register offset is different. Currently, we get a timer register address by: add the constant register offset to the timer base address. e.g. "base + TIMER_CTRL". It can not be dynamically adjusted at run time. So create a new structure "sp804_timer" to record the original registers offset, and create a new structure "sp804_clkevt" to record the calculated registers address. So the "base + TIMER_CTRL" is changed to "clkevt->ctrl", this will faster than "base + timer->ctrl". For example: struct sp804_timer arm_sp804_timer = { .ctrl = TIMER_CTRL, }; struct sp804_clkevt clkevt; clkevt.ctrl = base + arm_sp804_timer.ctrl. - writel(0, base + TIMER_CTRL); + writel(0, clkevt->ctrl); Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200918132237.3552-7-thunder.leizhen@huawei.com
Diffstat (limited to 'drivers/mtd')
0 files changed, 0 insertions, 0 deletions