devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] clk: visconti: Add support for VIIF on Toshiba Visconti TMPV770x SoC
@ 2025-10-29  6:13 Yuji Ishikawa
  2025-10-29  6:13 ` [PATCH v2 1/2] dt-bindings: clock: Add identifiers " Yuji Ishikawa
  2025-10-29  6:13 ` [PATCH v2 2/2] clk: visconti: Add definition of " Yuji Ishikawa
  0 siblings, 2 replies; 5+ messages in thread
From: Yuji Ishikawa @ 2025-10-29  6:13 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Nobuhiro Iwamatsu, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Philipp Zabel
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
	Yuji Ishikawa

This series adds support for Video Input Interface (VIIF) module to the
clock and reset driver of Toshiba Visconti TMPV770x SoC. It provides the
definition of identifiers for clocks and resets, and the control sequence
of registers.

Changelog v2:
- dt-bindings: Do not modify existing identifiers to avoid breaking ABI.
- clk: Update clk_gate_tables to reflect changes in bindings identifiers.

Yuji Ishikawa (2):
  dt-bindings: clock: Add identifiers for VIIF on Toshiba Visconti
    TMPV770x SoC
  clk: visconti: Add definition of VIIF on Toshiba Visconti TMPV770x SoC

 drivers/clk/visconti/clkc-tmpv770x.c         | 71 ++++++++++++++++++++
 include/dt-bindings/clock/toshiba,tmpv770x.h | 15 ++++-
 include/dt-bindings/reset/toshiba,tmpv770x.h | 10 ++-
 3 files changed, 93 insertions(+), 3 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] dt-bindings: clock: Add identifiers for VIIF on Toshiba Visconti TMPV770x SoC
  2025-10-29  6:13 [PATCH v2 0/2] clk: visconti: Add support for VIIF on Toshiba Visconti TMPV770x SoC Yuji Ishikawa
@ 2025-10-29  6:13 ` Yuji Ishikawa
  2025-10-29  6:38   ` Krzysztof Kozlowski
  2025-10-29  6:13 ` [PATCH v2 2/2] clk: visconti: Add definition of " Yuji Ishikawa
  1 sibling, 1 reply; 5+ messages in thread
From: Yuji Ishikawa @ 2025-10-29  6:13 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Nobuhiro Iwamatsu, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Philipp Zabel
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
	Yuji Ishikawa

Add clock and reset identifiers for the Video Input Interface.
These identifiers support two instances: VIIF0 and VIIF1.

Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
---
Changelog v2:
- Do not modify existing identifiers to avoid breaking ABI.
  Keep existing identfiers for VIIF0.
  Introduce new idenfifiers for VIIF1, following the same naming conventions.
---
 include/dt-bindings/clock/toshiba,tmpv770x.h | 15 +++++++++++++--
 include/dt-bindings/reset/toshiba,tmpv770x.h | 10 +++++++++-
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/include/dt-bindings/clock/toshiba,tmpv770x.h b/include/dt-bindings/clock/toshiba,tmpv770x.h
index 5fce71300..ff4ef1be5 100644
--- a/include/dt-bindings/clock/toshiba,tmpv770x.h
+++ b/include/dt-bindings/clock/toshiba,tmpv770x.h
@@ -141,7 +141,10 @@
 #define TMPV770X_CLK_PIREFCLK		124
 #define TMPV770X_CLK_SBUS		125
 #define TMPV770X_CLK_BUSLCK		126
-#define TMPV770X_NR_CLK			127
+#define TMPV770X_CLK_VIIFBS1_L2ISP	127
+#define TMPV770X_CLK_VIIFBS1_L1ISP	128
+#define TMPV770X_CLK_VIIFBS1_PROC	129
+#define TMPV770X_NR_CLK			130
 
 /* Reset */
 #define TMPV770X_RESET_PIETHER_2P5M	0
@@ -176,6 +179,14 @@
 #define TMPV770X_RESET_PIPCMIF		29
 #define TMPV770X_RESET_PICKMON		30
 #define TMPV770X_RESET_SBUSCLK		31
-#define TMPV770X_NR_RESET		32
+#define TMPV770X_RESET_VIIFBS0		32
+#define TMPV770X_RESET_VIIFBS0_APB	33
+#define TMPV770X_RESET_VIIFBS0_L2ISP	34
+#define TMPV770X_RESET_VIIFBS0_L1ISP	35
+#define TMPV770X_RESET_VIIFBS1		36
+#define TMPV770X_RESET_VIIFBS1_APB	37
+#define TMPV770X_RESET_VIIFBS1_L2ISP	38
+#define TMPV770X_RESET_VIIFBS1_L1ISP	39
+#define TMPV770X_NR_RESET		40
 
 #endif /*_DT_BINDINGS_CLOCK_TOSHIBA_TMPV770X_H_ */
diff --git a/include/dt-bindings/reset/toshiba,tmpv770x.h b/include/dt-bindings/reset/toshiba,tmpv770x.h
index c1007acb1..d711006d6 100644
--- a/include/dt-bindings/reset/toshiba,tmpv770x.h
+++ b/include/dt-bindings/reset/toshiba,tmpv770x.h
@@ -36,6 +36,14 @@
 #define TMPV770X_RESET_PIPCMIF		29
 #define TMPV770X_RESET_PICKMON		30
 #define TMPV770X_RESET_SBUSCLK		31
-#define TMPV770X_NR_RESET		32
+#define TMPV770X_RESET_VIIFBS0		32
+#define TMPV770X_RESET_VIIFBS0_APB	33
+#define TMPV770X_RESET_VIIFBS0_L2ISP	34
+#define TMPV770X_RESET_VIIFBS0_L1ISP	35
+#define TMPV770X_RESET_VIIFBS1		36
+#define TMPV770X_RESET_VIIFBS1_APB	37
+#define TMPV770X_RESET_VIIFBS1_L2ISP	38
+#define TMPV770X_RESET_VIIFBS1_L1ISP	39
+#define TMPV770X_NR_RESET		40
 
 #endif /*_DT_BINDINGS_RESET_TOSHIBA_TMPV770X_H_ */
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] clk: visconti: Add definition of VIIF on Toshiba Visconti TMPV770x SoC
  2025-10-29  6:13 [PATCH v2 0/2] clk: visconti: Add support for VIIF on Toshiba Visconti TMPV770x SoC Yuji Ishikawa
  2025-10-29  6:13 ` [PATCH v2 1/2] dt-bindings: clock: Add identifiers " Yuji Ishikawa
@ 2025-10-29  6:13 ` Yuji Ishikawa
  1 sibling, 0 replies; 5+ messages in thread
From: Yuji Ishikawa @ 2025-10-29  6:13 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Nobuhiro Iwamatsu, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Philipp Zabel
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree,
	Yuji Ishikawa

Add the control sequence of register bits to handle the clocks and the
resets of Video Input Interface.

Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
---
Changelog v2:
- Update clk_gate_tables to reflect changes in bindings identifiers.
---
 drivers/clk/visconti/clkc-tmpv770x.c | 71 ++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/drivers/clk/visconti/clkc-tmpv770x.c b/drivers/clk/visconti/clkc-tmpv770x.c
index 6c753b2cb..b3f4de671 100644
--- a/drivers/clk/visconti/clkc-tmpv770x.c
+++ b/drivers/clk/visconti/clkc-tmpv770x.c
@@ -28,6 +28,10 @@ static const struct clk_parent_data pietherplls_parent_data[] = {
 	{ .fw_name = "pietherpll", .name = "pietherpll", },
 };
 
+static const struct clk_parent_data pidnnplls_parent_data[] = {
+	{ .fw_name = "pidnnpll", .name = "pidnnpll", },
+};
+
 static const struct visconti_fixed_clk fixed_clk_tables[] = {
 	/* PLL1 */
 	/* PICMPT0/1, PITSC, PIUWDT, PISWDT, PISBUS, PIPMU, PIGPMU, PITMU */
@@ -64,6 +68,41 @@ static const struct visconti_clk_gate_table pietherpll_clk_gate_tables[] = {
 		TMPV770X_RESET_PIETHER_125M, },
 };
 
+static const struct visconti_clk_gate_table pidnnpll_clk_gate_tables[] = {
+	{ TMPV770X_CLK_VIIFBS0, "viifbs0",
+		pidnnplls_parent_data, ARRAY_SIZE(pidnnplls_parent_data),
+		0, 0x58, 0x158, 1, 1,
+		NO_RESET, },
+	{ TMPV770X_CLK_VIIFBS0_PROC, "viifbs0_proc",
+		pidnnplls_parent_data, ARRAY_SIZE(pidnnplls_parent_data),
+		0, 0x58, 0x158, 18, 1,
+		NO_RESET, },
+	{ TMPV770X_CLK_VIIFBS0_L1ISP, "viifbs0_l1isp",
+		pidnnplls_parent_data, ARRAY_SIZE(pidnnplls_parent_data),
+		0, 0x58, 0x158, 17, 1,
+		NO_RESET, },
+	{ TMPV770X_CLK_VIIFBS0_L2ISP, "viifbs0_l2isp",
+		pidnnplls_parent_data, ARRAY_SIZE(pidnnplls_parent_data),
+		0, 0x58, 0x158, 16, 1,
+		NO_RESET, },
+	{ TMPV770X_CLK_VIIFBS1, "viifbs1",
+		pidnnplls_parent_data, ARRAY_SIZE(pidnnplls_parent_data),
+		0, 0x58, 0x158, 5, 1,
+		NO_RESET, },
+	{ TMPV770X_CLK_VIIFBS1_PROC, "viifbs1_proc",
+		pidnnplls_parent_data, ARRAY_SIZE(pidnnplls_parent_data),
+		0, 0x58, 0x158, 22, 1,
+		NO_RESET, },
+	{ TMPV770X_CLK_VIIFBS1_L1ISP, "viifbs1_l1isp",
+		pidnnplls_parent_data, ARRAY_SIZE(pidnnplls_parent_data),
+		0, 0x58, 0x158, 21, 1,
+		NO_RESET, },
+	{ TMPV770X_CLK_VIIFBS1_L2ISP, "viifbs1_l2isp",
+		pidnnplls_parent_data, ARRAY_SIZE(pidnnplls_parent_data),
+		0, 0x58, 0x158, 20, 1,
+		NO_RESET, },
+};
+
 static const struct visconti_clk_gate_table clk_gate_tables[] = {
 	{ TMPV770X_CLK_HOX, "hox",
 		clks_parent_data, ARRAY_SIZE(clks_parent_data),
@@ -185,6 +224,22 @@ static const struct visconti_clk_gate_table clk_gate_tables[] = {
 		clks_parent_data, ARRAY_SIZE(clks_parent_data),
 		0, 0x14, 0x114, 0, 4,
 		TMPV770X_RESET_SBUSCLK, },
+	{ TMPV770X_CLK_VIIF0_CFGCLK, "csi2rx0cfg",
+		clks_parent_data, ARRAY_SIZE(clks_parent_data),
+		0, 0x58, 0x158, 0, 24,
+		NO_RESET, },
+	{ TMPV770X_CLK_VIIF0_APBCLK, "csi2rx0apb",
+		clks_parent_data, ARRAY_SIZE(clks_parent_data),
+		0, 0x58, 0x158, 2, 4,
+		NO_RESET, },
+	{ TMPV770X_CLK_VIIF1_CFGCLK, "csi2rx1cfg",
+		clks_parent_data, ARRAY_SIZE(clks_parent_data),
+		0, 0x58, 0x158, 4, 24,
+		NO_RESET, },
+	{ TMPV770X_CLK_VIIF1_APBCLK, "csi2rx1apb",
+		clks_parent_data, ARRAY_SIZE(clks_parent_data),
+		0, 0x58, 0x158, 6, 4,
+		NO_RESET, },
 };
 
 static const struct visconti_reset_data clk_reset_data[] = {
@@ -220,6 +275,14 @@ static const struct visconti_reset_data clk_reset_data[] = {
 	[TMPV770X_RESET_PIPCMIF]	= { 0x464, 0x564, 0, },
 	[TMPV770X_RESET_PICKMON]	= { 0x410, 0x510, 8, },
 	[TMPV770X_RESET_SBUSCLK]	= { 0x414, 0x514, 0, },
+	[TMPV770X_RESET_VIIFBS0]	= { 0x458, 0x558, 0, },
+	[TMPV770X_RESET_VIIFBS0_APB]	= { 0x458, 0x558, 1, },
+	[TMPV770X_RESET_VIIFBS0_L2ISP]	= { 0x458, 0x558, 16, },
+	[TMPV770X_RESET_VIIFBS0_L1ISP]	= { 0x458, 0x558, 17, },
+	[TMPV770X_RESET_VIIFBS1]	= { 0x458, 0x558, 4, },
+	[TMPV770X_RESET_VIIFBS1_APB]	= { 0x458, 0x558, 5, },
+	[TMPV770X_RESET_VIIFBS1_L2ISP]	= { 0x458, 0x558, 20, },
+	[TMPV770X_RESET_VIIFBS1_L1ISP]	= { 0x458, 0x558, 21, },
 };
 
 static int visconti_clk_probe(struct platform_device *pdev)
@@ -272,6 +335,14 @@ static int visconti_clk_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	ret = visconti_clk_register_gates(ctx, pidnnpll_clk_gate_tables,
+				    ARRAY_SIZE(pidnnpll_clk_gate_tables),
+				    clk_reset_data, &tmpv770x_clk_lock);
+	if (ret) {
+		dev_err(dev, "Failed to register pidnnpll clock gate: %d\n", ret);
+		return ret;
+	}
+
 	return of_clk_add_hw_provider(np, of_clk_hw_onecell_get, &ctx->clk_data);
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: clock: Add identifiers for VIIF on Toshiba Visconti TMPV770x SoC
  2025-10-29  6:13 ` [PATCH v2 1/2] dt-bindings: clock: Add identifiers " Yuji Ishikawa
@ 2025-10-29  6:38   ` Krzysztof Kozlowski
  2025-11-10  7:59     ` yuji2.ishikawa
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-29  6:38 UTC (permalink / raw)
  To: Yuji Ishikawa, Michael Turquette, Stephen Boyd, Nobuhiro Iwamatsu,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Philipp Zabel
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree

On 29/10/2025 07:13, Yuji Ishikawa wrote:
> Add clock and reset identifiers for the Video Input Interface.
> These identifiers support two instances: VIIF0 and VIIF1.
> 
> Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
> ---
> Changelog v2:
> - Do not modify existing identifiers to avoid breaking ABI.
>   Keep existing identfiers for VIIF0.
>   Introduce new idenfifiers for VIIF1, following the same naming conventions.
> ---
>  include/dt-bindings/clock/toshiba,tmpv770x.h | 15 +++++++++++++--
>  include/dt-bindings/reset/toshiba,tmpv770x.h | 10 +++++++++-
>  2 files changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/include/dt-bindings/clock/toshiba,tmpv770x.h b/include/dt-bindings/clock/toshiba,tmpv770x.h
> index 5fce71300..ff4ef1be5 100644
> --- a/include/dt-bindings/clock/toshiba,tmpv770x.h
> +++ b/include/dt-bindings/clock/toshiba,tmpv770x.h
> @@ -141,7 +141,10 @@
>  #define TMPV770X_CLK_PIREFCLK		124
>  #define TMPV770X_CLK_SBUS		125
>  #define TMPV770X_CLK_BUSLCK		126
> -#define TMPV770X_NR_CLK			127

You cannot change it, as explained last time. If this is not an ABI,
then in separate patch drop it (see examples in the history for Samsung,
NXP and probably many more SoCs).

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v2 1/2] dt-bindings: clock: Add identifiers for VIIF on Toshiba Visconti TMPV770x SoC
  2025-10-29  6:38   ` Krzysztof Kozlowski
@ 2025-11-10  7:59     ` yuji2.ishikawa
  0 siblings, 0 replies; 5+ messages in thread
From: yuji2.ishikawa @ 2025-11-10  7:59 UTC (permalink / raw)
  To: krzk, mturquette, sboyd, nobuhiro.iwamatsu.x90, robh, krzk+dt,
	conor+dt, p.zabel
  Cc: linux-clk, linux-arm-kernel, linux-kernel, devicetree

> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: Wednesday, October 29, 2025 3:39 PM
> To: ishikawa yuji(石川 悠司 □AIDC○EA開)
> <yuji2.ishikawa@toshiba.co.jp>; Michael Turquette
> <mturquette@baylibre.com>; Stephen Boyd <sboyd@kernel.org>; iwamatsu
> nobuhiro(岩松 信洋 □DITC○CPT)
> <nobuhiro.iwamatsu.x90@mail.toshiba>; Rob Herring <robh@kernel.org>;
> Krzysztof Kozlowski <krzk+dt@kernel.org>; Conor Dooley
> <conor+dt@kernel.org>; Philipp Zabel <p.zabel@pengutronix.de>
> Cc: linux-clk@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [PATCH v2 1/2] dt-bindings: clock: Add identifiers for VIIF on
> Toshiba Visconti TMPV770x SoC
> 
> On 29/10/2025 07:13, Yuji Ishikawa wrote:
> > Add clock and reset identifiers for the Video Input Interface.
> > These identifiers support two instances: VIIF0 and VIIF1.
> >
> > Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
> > ---
> > Changelog v2:
> > - Do not modify existing identifiers to avoid breaking ABI.
> >   Keep existing identfiers for VIIF0.
> >   Introduce new idenfifiers for VIIF1, following the same naming
> conventions.
> > ---
> >  include/dt-bindings/clock/toshiba,tmpv770x.h | 15 +++++++++++++--
> > include/dt-bindings/reset/toshiba,tmpv770x.h | 10 +++++++++-
> >  2 files changed, 22 insertions(+), 3 deletions(-)
> >
> > diff --git a/include/dt-bindings/clock/toshiba,tmpv770x.h
> > b/include/dt-bindings/clock/toshiba,tmpv770x.h
> > index 5fce71300..ff4ef1be5 100644
> > --- a/include/dt-bindings/clock/toshiba,tmpv770x.h
> > +++ b/include/dt-bindings/clock/toshiba,tmpv770x.h
> > @@ -141,7 +141,10 @@
> >  #define TMPV770X_CLK_PIREFCLK		124
> >  #define TMPV770X_CLK_SBUS		125
> >  #define TMPV770X_CLK_BUSLCK		126
> > -#define TMPV770X_NR_CLK			127
> 
> You cannot change it, as explained last time. If this is not an ABI, then in
> separate patch drop it (see examples in the history for Samsung, NXP and
> probably many more SoCs).

I understand TMPV770X_NR_CLK and others can not be changed.
I'll make a separate patchset to drop them.

> Best regards,
> Krzysztof

Regards,
Yuji Ishikawa

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-10  9:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29  6:13 [PATCH v2 0/2] clk: visconti: Add support for VIIF on Toshiba Visconti TMPV770x SoC Yuji Ishikawa
2025-10-29  6:13 ` [PATCH v2 1/2] dt-bindings: clock: Add identifiers " Yuji Ishikawa
2025-10-29  6:38   ` Krzysztof Kozlowski
2025-11-10  7:59     ` yuji2.ishikawa
2025-10-29  6:13 ` [PATCH v2 2/2] clk: visconti: Add definition of " Yuji Ishikawa

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