On 12/09/2020 13:45, Zhen Lei wrote:
> 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.
> 
> Use compatible = "hisilicon,sp804" mark as Hisilicon sp804 timer.
> 
> Signed-off-by: Zhen Lei <thunder.leiz...@huawei.com>
> ---
>  drivers/clocksource/timer-sp.h    | 12 ++++++++++++
>  drivers/clocksource/timer-sp804.c | 15 +++++++++++++++
>  2 files changed, 27 insertions(+)
> 
> diff --git a/drivers/clocksource/timer-sp.h b/drivers/clocksource/timer-sp.h
> index 1ab75cbed0e0..6ca8d82e8544 100644
> --- a/drivers/clocksource/timer-sp.h
> +++ b/drivers/clocksource/timer-sp.h
> @@ -31,6 +31,18 @@
>  #define TIMER_MIS    0x14                    /*  CVR ro */
>  #define TIMER_BGLOAD 0x18                    /*  CVR rw */
>  
> +
> +#define HISI_TIMER_1_BASE    0x00
> +#define HISI_TIMER_2_BASE    0x40
> +#define HISI_TIMER_LOAD              0x00
> +#define HISI_TIMER_VALUE     0x08
> +#define HISI_TIMER_CTRL              0x10
> +#define HISI_TIMER_INTCLR    0x14
> +#define HISI_TIMER_RIS               0x18
> +#define HISI_TIMER_MIS               0x1c
> +#define HISI_TIMER_BGLOAD    0x20

Why not put them in timer-sp804.c directly ?

[ ... ]

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Reply via email to