From: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
To: u-boot@lists.denx.de, Sumit Garg <sumit.garg@kernel.org>,
u-boot-qcom@groups.io
Cc: Tom Rini <trini@konsulko.com>,
Kaustabh Chakraborty <kauschluss@disroot.org>,
Casey Connolly <casey.connolly@linaro.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Sughosh Ganu <sughosh.ganu@arm.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
George Chan <gchan9527@gmail.com>,
Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Subject: [PATCH 2/2] snapdragon: Set timer frequency for ARMV8_CNTFRQ_BROKEN platforms
Date: Mon, 06 Apr 2026 16:25:37 +0530 [thread overview]
Message-ID: <20260406-timer-v1-2-f7c5a290c459@oss.qualcomm.com> (raw)
In-Reply-To: <20260406-timer-v1-0-f7c5a290c459@oss.qualcomm.com>
Implement arch_cpu_init() for Snapdragon platforms to initialize the
timer frequency when CONFIG_ARMV8_CNTFRQ_BROKEN is enabled. This is
required for platforms where the firmware does not set CNTFRQ_EL0.
Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
---
arch/arm/mach-snapdragon/board.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c
index 5fb3240acc5..6cc9270cc5a 100644
--- a/arch/arm/mach-snapdragon/board.c
+++ b/arch/arm/mach-snapdragon/board.c
@@ -39,6 +39,23 @@ DECLARE_GLOBAL_DATA_PTR;
enum qcom_boot_source qcom_boot_source __section(".data") = 0;
+int arch_cpu_init(void)
+{
+ /* Set timer frequency for CONFIG_ARMV8_CNTFRQ_BROKEN
+ * Use CONFIG_COUNTER_FREQUENCY if defined, which allows per-platform
+ * timer frequency configuration via defconfig.
+ */
+ if (IS_ENABLED(CONFIG_ARMV8_CNTFRQ_BROKEN)) {
+#ifdef CONFIG_COUNTER_FREQUENCY
+ gd->arch.timer_rate_hz = CONFIG_COUNTER_FREQUENCY;
+#else
+ gd->arch.timer_rate_hz = 19200000; /* Default 19.2 MHz for Qualcomm */
+#endif
+ }
+
+ return 0;
+}
+
static struct mm_region rbx_mem_map[CONFIG_NR_DRAM_BANKS + 2] = { { 0 } };
struct mm_region *mem_map = rbx_mem_map;
--
2.34.1
next prev parent reply other threads:[~2026-04-06 10:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 10:55 [PATCH 0/2] ARMv8 timer fixes for platforms without EL2 configuration Balaji Selvanathan
2026-04-06 10:55 ` [PATCH 1/2] armv8: timer: Add option to use virtual counter at EL1 Balaji Selvanathan
2026-04-06 10:55 ` Balaji Selvanathan [this message]
2026-04-13 9:22 ` [PATCH 0/2] ARMv8 timer fixes for platforms without EL2 configuration Sumit Garg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260406-timer-v1-2-f7c5a290c459@oss.qualcomm.com \
--to=balaji.selvanathan@oss.qualcomm.com \
--cc=casey.connolly@linaro.org \
--cc=gchan9527@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=kauschluss@disroot.org \
--cc=neil.armstrong@linaro.org \
--cc=sughosh.ganu@arm.com \
--cc=sumit.garg@kernel.org \
--cc=trini@konsulko.com \
--cc=u-boot-qcom@groups.io \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox