[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <db9c2cc8-d73b-4614-be9b-741510428070@linaro.org>
Date: Wed, 17 Sep 2025 18:00:42 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Markus Schneider-Pargmann <msp@...libre.com>,
Thomas Gleixner <tglx@...utronix.de>,
Patrice Chotard <patrice.chotard@...s.st.com>
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
"Mendez, Judith" <jm@...com>, Kevin Hilman <khilman@...libre.com>
Subject: Re: [PATCH v2] clocksource/drivers/arm_global_timer: Add
auto-detection for initial prescaler values
On 19/08/2025 09:52, Markus Schneider-Pargmann wrote:
> am43xx has a clock tree where the global timer clock is an indirect child
> of the CPU clock used for frequency scaling:
>
> dpll_mpu_ck -- CPU/cpufreq
> |
> v
> dpll_mpu_m2_ck -- divider
> |
> v
> mpu_periphclk -- fixed divider by 2 used for global timer
>
> When CPU frequency changes, the global timer's clock notifier rejects
> the change because the hardcoded prescaler (1 or 2) cannot accommodate
> the frequency range across all CPU OPPs (300, 600, 720, 800, 1000 MHz).
>
> Add platform-specific prescaler auto-detection to solve this issue:
>
> - am43xx: prescaler = 50 (calculated as initial_freq/GCD of all OPP
> freqs) This allows the timer to work across all CPU frequencies after
> the fixed divider by 2. Tested on am4372-idk-evm.
>
> - zynq-7000: prescaler = 2 (preserves previous Kconfig default)
>
> - Other platforms: prescaler = 1 (previous default)
>
> The Kconfig option now defaults to 0 (auto-detection) but can still
> override the auto-detected value when set to a non-zero value,
> preserving existing customization workflows.
>
> Reviewed-by: Kevin Hilman <khilman@...libre.com>
> Tested-by: Kevin Hilman <khilman@...libre.com>
> Signed-off-by: Markus Schneider-Pargmann <msp@...libre.com>
> ---
> Changes in v2:
> - Rebased to v6.17-rc1
> - Link to v1: https://lore.kernel.org/r/20250808-topic-am43-arm-global-timer-v6-16-v1-1-82067d327580@baylibre.com
> ---
Applied, thanks
--
<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
Powered by blists - more mailing lists