Re: [PATCH v1 2/2] clocksource: Add Intel Keem Bay Timer Support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26/11/2020 11:34, vijayakannan.ayyathurai@xxxxxxxxx wrote:
> From: Vijayakannan Ayyathurai <vijayakannan.ayyathurai@xxxxxxxxx>
> 
> Add generic clocksource and clockevent driver for the timer IP
> used in Intel Keem Bay SoC.
> 
> One free running Counter used as a clocksource device and one Timer
> used as a clockevent device. Both are enabled through TIM_GEN_CONFIG
> register. This register is in the DT resource index 1.
> 
> Timer/Counter base register is in the DT resource index 0
> and it's map/unmap handled by TIMER OF api.
> 
> Signed-off-by: Vijayakannan Ayyathurai <vijayakannan.ayyathurai@xxxxxxxxx>
> Acked-by: Mark Gross <mgross@xxxxxxxxxxxxxxx>
> Acked-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
>  drivers/clocksource/Kconfig         |  10 ++
>  drivers/clocksource/Makefile        |   1 +
>  drivers/clocksource/timer-keembay.c | 221 ++++++++++++++++++++++++++++
>  3 files changed, 232 insertions(+)
>  create mode 100644 drivers/clocksource/timer-keembay.c
> 
> diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> index 68b087bff59c..b1f29e12c571 100644
> --- a/drivers/clocksource/Kconfig
> +++ b/drivers/clocksource/Kconfig
> @@ -738,4 +738,14 @@ config MICROCHIP_PIT64B
>  	  modes and high resolution. It is used as a clocksource
>  	  and a clockevent.
>  
> +config KEEMBAY_TIMER
> +	bool "Intel Keem Bay timer driver"
> +	depends on ARCH_KEEMBAY || (ARM64 && COMPILE_TEST)

The timer drivers subsystem wants silent options and let the platform to
select the timer.

Please select the timer in arch/arm64/Kconfig.platforms in the
ARCH_KEEMBAY section.

So it would come:

config KEEMBAY_TIMER
	bool "bla bla" if COMPILE_TEST



> +	select TIMER_OF
> +	help
> +	  This option enables the support for the Intel Keem Bay general
> +	  purpose timer and free running counter driver. Each timer can
> +	  generate an individual interrupt and the 64 bit counter can also
> +	  be used as one of the clock source.
> +

[ ... ]

> +static struct timer_of keembay_ce_to = {
> +	.flags	= TIMER_OF_IRQ | TIMER_OF_BASE | TIMER_OF_CLOCK,
> +	.clkevt = {
> +		.name			= "keembay_timer",
> +		.features		= CLOCK_EVT_FEAT_PERIODIC |
> +					  CLOCK_EVT_FEAT_ONESHOT,

May be consider CLOCK_EVT_FEAT_DYNIRQ ?

see commit d2348fb6fdc6d67

Other than that, LGTM

Thanks

  -- Daniel

-- 
<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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux