From: Vincent Whitchurch <vincent.whitchurch@axis.com>
To: <krzysztof.kozlowski@linaro.org>, <tglx@linutronix.de>,
<daniel.lezcano@linaro.org>
Cc: <kernel@axis.com>,
Vincent Whitchurch <vincent.whitchurch@axis.com>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-samsung-soc@vger.kernel.org>, <alim.akhtar@samsung.com>,
<devicetree@vger.kernel.org>, <robh+dt@kernel.org>
Subject: [PATCH v4 2/4] clocksource/drivers/exynos_mct: Support frc-shared property
Date: Thu, 9 Jun 2022 13:27:36 +0200 [thread overview]
Message-ID: <20220609112738.359385-3-vincent.whitchurch@axis.com> (raw)
In-Reply-To: <20220609112738.359385-1-vincent.whitchurch@axis.com>
When the FRC is shared with another main processor, the other processor
is assumed to have started it and this processor should not write to the
global registers.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
---
Notes:
v4:
- Add Krzysztof's Reviewed-by.
v3:
- Split FRC sharing handling from local timer indices handling
- Remove addition of global variable.
drivers/clocksource/exynos_mct.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index f29c812b70c9..12023831dedf 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -233,9 +233,16 @@ static cycles_t exynos4_read_current_timer(void)
}
#endif
-static int __init exynos4_clocksource_init(void)
+static int __init exynos4_clocksource_init(bool frc_shared)
{
- exynos4_mct_frc_start();
+ /*
+ * When the frc is shared, the main processer should have already
+ * turned it on and we shouldn't be writing to TCON.
+ */
+ if (frc_shared)
+ mct_frc.resume = NULL;
+ else
+ exynos4_mct_frc_start();
#if defined(CONFIG_ARM)
exynos4_delay_timer.read_current_timer = &exynos4_read_current_timer;
@@ -605,6 +612,7 @@ static int __init exynos4_timer_interrupts(struct device_node *np,
static int __init mct_init_dt(struct device_node *np, unsigned int int_type)
{
+ bool frc_shared = of_property_read_bool(np, "samsung,frc-shared");
int ret;
ret = exynos4_timer_resources(np);
@@ -615,10 +623,17 @@ static int __init mct_init_dt(struct device_node *np, unsigned int int_type)
if (ret)
return ret;
- ret = exynos4_clocksource_init();
+ ret = exynos4_clocksource_init(frc_shared);
if (ret)
return ret;
+ /*
+ * When the FRC is shared with a main processor, this secondary
+ * processor cannot use the global comparator.
+ */
+ if (frc_shared)
+ return ret;
+
return exynos4_clockevent_init();
}
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-06-09 11:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 11:27 [PATCH v4 0/4] clocksource: Add MCT support for ARTPEC-8 Vincent Whitchurch
2022-06-09 11:27 ` [PATCH v4 1/4] dt-bindings: timer: exynos4210-mct: Add ARTPEC-8 MCT support Vincent Whitchurch
2022-06-09 11:27 ` Vincent Whitchurch [this message]
2022-06-09 11:27 ` [PATCH v4 3/4] clocksource/drivers/exynos_mct: Support local-timers property Vincent Whitchurch
2022-06-21 13:11 ` Krzysztof Kozlowski
2022-09-07 8:59 ` Vincent Whitchurch
2022-09-07 9:07 ` Daniel Lezcano
2022-06-09 11:27 ` [PATCH v4 4/4] clocksource/drivers/exynos_mct: Enable building on ARTPEC Vincent Whitchurch
2022-09-07 9:08 ` [PATCH v4 0/4] clocksource: Add MCT support for ARTPEC-8 Daniel Lezcano
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=20220609112738.359385-3-vincent.whitchurch@axis.com \
--to=vincent.whitchurch@axis.com \
--cc=alim.akhtar@samsung.com \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@axis.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=tglx@linutronix.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