From: "Benoît Monin" <benoit.monin@bootlin.com>
To: "Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Gregory CLEMENT" <gregory.clement@bootlin.com>,
"Théo Lebrun" <theo.lebrun@bootlin.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
"Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Philipp Zabel" <p.zabel@pengutronix.de>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
linux-mips@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
"Sari Khoury" <sari.khoury@mobileye.com>,
"Benoît Monin" <benoit.monin@bootlin.com>
Subject: [PATCH 13/19] clk: eyeq: prefix the PLL registers with the PLL type
Date: Wed, 03 Sep 2025 14:47:20 +0200 [thread overview]
Message-ID: <20250903-clk-eyeq7-v1-13-3f5024b5d6e2@bootlin.com> (raw)
In-Reply-To: <20250903-clk-eyeq7-v1-0-3f5024b5d6e2@bootlin.com>
Rename the PLL registers to make room for other PLL types that are
present in the eyeQ7H.
We only prefix the register with the PLL type (FRACG), no other change.
Signed-off-by: Benoît Monin <benoit.monin@bootlin.com>
---
drivers/clk/clk-eyeq.c | 50 +++++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c
index a0581016100c7367efb373a3fb3b7c6d51b49912..63093a3099261e6798a6752651d25efa1b3e7592 100644
--- a/drivers/clk/clk-eyeq.c
+++ b/drivers/clk/clk-eyeq.c
@@ -47,28 +47,28 @@
#include <dt-bindings/clock/mobileye,eyeq-clk.h>
/* In frac mode, it enables fractional noise canceling DAC. Else, no function. */
-#define PCSR0_DAC_EN BIT(0)
+#define FRACG_PCSR0_DAC_EN BIT(0)
/* Fractional or integer mode */
-#define PCSR0_DSM_EN BIT(1)
-#define PCSR0_PLL_EN BIT(2)
+#define FRACG_PCSR0_DSM_EN BIT(1)
+#define FRACG_PCSR0_PLL_EN BIT(2)
/* All clocks output held at 0 */
-#define PCSR0_FOUTPOSTDIV_EN BIT(3)
-#define PCSR0_POST_DIV1 GENMASK(6, 4)
-#define PCSR0_POST_DIV2 GENMASK(9, 7)
-#define PCSR0_REF_DIV GENMASK(15, 10)
-#define PCSR0_INTIN GENMASK(27, 16)
-#define PCSR0_BYPASS BIT(28)
+#define FRACG_PCSR0_FOUTPOSTDIV_EN BIT(3)
+#define FRACG_PCSR0_POST_DIV1 GENMASK(6, 4)
+#define FRACG_PCSR0_POST_DIV2 GENMASK(9, 7)
+#define FRACG_PCSR0_REF_DIV GENMASK(15, 10)
+#define FRACG_PCSR0_INTIN GENMASK(27, 16)
+#define FRACG_PCSR0_BYPASS BIT(28)
/* Bits 30..29 are reserved */
-#define PCSR0_PLL_LOCKED BIT(31)
+#define FRACG_PCSR0_PLL_LOCKED BIT(31)
-#define PCSR1_RESET BIT(0)
-#define PCSR1_SSGC_DIV GENMASK(4, 1)
+#define FRACG_PCSR1_RESET BIT(0)
+#define FRACG_PCSR1_SSGC_DIV GENMASK(4, 1)
/* Spread amplitude (% = 0.1 * SPREAD[4:0]) */
-#define PCSR1_SPREAD GENMASK(9, 5)
-#define PCSR1_DIS_SSCG BIT(10)
+#define FRACG_PCSR1_SPREAD GENMASK(9, 5)
+#define FRACG_PCSR1_DIS_SSCG BIT(10)
/* Down-spread or center-spread */
-#define PCSR1_DOWN_SPREAD BIT(11)
-#define PCSR1_FRAC_IN GENMASK(31, 12)
+#define FRACG_PCSR1_DOWN_SPREAD BIT(11)
+#define FRACG_PCSR1_FRAC_IN GENMASK(31, 12)
struct eqc_pll {
unsigned int index;
@@ -167,29 +167,29 @@ static int eqc_pll_parse_registers(u32 r0, u32 r1, unsigned long *mult,
{
u32 spread;
- if (r0 & PCSR0_BYPASS) {
+ if (r0 & FRACG_PCSR0_BYPASS) {
*mult = 1;
*div = 1;
*acc = 0;
return 0;
}
- if (!(r0 & PCSR0_PLL_LOCKED))
+ if (!(r0 & FRACG_PCSR0_PLL_LOCKED))
return -EINVAL;
- *mult = FIELD_GET(PCSR0_INTIN, r0);
- *div = FIELD_GET(PCSR0_REF_DIV, r0);
+ *mult = FIELD_GET(FRACG_PCSR0_INTIN, r0);
+ *div = FIELD_GET(FRACG_PCSR0_REF_DIV, r0);
/* Fractional mode, in 2^20 (0x100000) parts. */
- if (r0 & PCSR0_DSM_EN) {
+ if (r0 & FRACG_PCSR0_DSM_EN) {
*div *= (1ULL << 20);
- *mult = *mult * (1ULL << 20) + FIELD_GET(PCSR1_FRAC_IN, r1);
+ *mult = *mult * (1ULL << 20) + FIELD_GET(FRACG_PCSR1_FRAC_IN, r1);
}
if (!*mult || !*div)
return -EINVAL;
- if (r1 & (PCSR1_RESET | PCSR1_DIS_SSCG)) {
+ if (r1 & (FRACG_PCSR1_RESET | FRACG_PCSR1_DIS_SSCG)) {
*acc = 0;
return 0;
}
@@ -204,10 +204,10 @@ static int eqc_pll_parse_registers(u32 r0, u32 r1, unsigned long *mult,
* with acc in parts per billion and,
* spread in parts per thousand.
*/
- spread = FIELD_GET(PCSR1_SPREAD, r1);
+ spread = FIELD_GET(FRACG_PCSR1_SPREAD, r1);
*acc = spread * 500000;
- if (r1 & PCSR1_DOWN_SPREAD) {
+ if (r1 & FRACG_PCSR1_DOWN_SPREAD) {
/*
* Downspreading: the central frequency is half a
* spread lower.
--
2.51.0
next prev parent reply other threads:[~2025-09-03 12:48 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 12:47 [PATCH 00/19] Add clock and reset support for Mobileye eyeQ7H Benoît Monin
2025-09-03 12:47 ` [PATCH 01/19] dt-bindings: soc: mobileye: rename to eyeq-olb.yaml Benoît Monin
2025-09-04 9:20 ` Krzysztof Kozlowski
2025-09-03 12:47 ` [PATCH 02/19] dt-bindings: clock: mobileye: rename to eyeq-clk.h Benoît Monin
2025-09-04 9:24 ` Krzysztof Kozlowski
2025-09-03 12:47 ` [PATCH 03/19] dt-bindings: soc: mobileye: add eyeQ7H compatibles Benoît Monin
2025-09-04 9:22 ` Krzysztof Kozlowski
2025-09-03 12:47 ` [PATCH 04/19] dt-bindings: clock: mobileye: add eyeQ7H clock indexes Benoît Monin
2025-09-04 9:23 ` Krzysztof Kozlowski
2025-09-03 12:47 ` [PATCH 05/19] dt-bindings: reset: add Mobileye eyeQ Benoît Monin
2025-09-04 9:25 ` Krzysztof Kozlowski
2025-09-03 12:47 ` [PATCH 06/19] reset: eyeq: add eyeQ7H compatibles Benoît Monin
2025-09-03 12:47 ` [PATCH 07/19] clk: fixed-factor: add clk_hw_register_fixed_factor_with_accuracy Benoît Monin
2025-09-20 5:14 ` Stephen Boyd
2025-09-25 11:47 ` Benoît Monin
2025-09-03 12:47 ` [PATCH 08/19] clk: divider: check divider validity for CLK_DIVIDER_EVEN_INTEGERS Benoît Monin
2025-09-20 5:15 ` Stephen Boyd
2025-09-25 11:51 ` Benoît Monin
2025-09-03 12:47 ` [PATCH 09/19] clk: divider: check validity of flags when a table is provided Benoît Monin
2025-09-20 5:24 ` Stephen Boyd
2025-09-25 11:55 ` Benoît Monin
2025-09-03 12:47 ` [PATCH 10/19] clk: eyeq: skip post-divisor when computing pll divisor Benoît Monin
2025-09-03 12:47 ` [PATCH 11/19] clk: eyeq: rename the parent field to parent_idx Benoît Monin
2025-09-03 12:47 ` [PATCH 12/19] clk: eyeq: lookup parent clock by name Benoît Monin
2025-09-03 12:47 ` Benoît Monin [this message]
2025-09-03 12:47 ` [PATCH 14/19] clk: eyeq: rename the reg64 field of eqc_pll Benoît Monin
2025-09-03 12:47 ` [PATCH 15/19] clk: eyeq: add a type for the PLL Benoît Monin
2025-09-03 12:47 ` [PATCH 16/19] clk: eyeq: add two PLL types Benoît Monin
2025-09-03 12:47 ` [PATCH 17/19] clk: eyeq: add a parent field to the pll Benoît Monin
2025-09-03 12:47 ` [PATCH 18/19] clk: eyeq: add an optional clk_div_table to divider Benoît Monin
2025-09-03 12:47 ` [PATCH 19/19] clk: eyeq: add eyeQ7H compatibles Benoît Monin
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=20250903-clk-eyeq7-v1-13-3f5024b5d6e2@bootlin.com \
--to=benoit.monin@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sari.khoury@mobileye.com \
--cc=sboyd@kernel.org \
--cc=tawfik.bayouk@mobileye.com \
--cc=theo.lebrun@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=tsbogend@alpha.franken.de \
--cc=vladimir.kondratiev@mobileye.com \
/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;
as well as URLs for NNTP newsgroup(s).