All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] clk: renesas: r8a7799[05]: Add RPC clocks
@ 2022-03-29  9:44 Geert Uytterhoeven
  2022-03-29  9:44 ` [PATCH 1/2] clk: renesas: r8a77990: " Geert Uytterhoeven
  2022-03-29  9:44 ` [PATCH 2/2] clk: renesas: r8a77995: " Geert Uytterhoeven
  0 siblings, 2 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-03-29  9:44 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-renesas-soc, linux-clk, Geert Uytterhoeven

	Hi Mike, Stephen,

This patch series adds support for the various clocks used by the SPI
Multi I/O Bus Controller (RPC-IF) on the R-Car E3 and D3 SoCs.
It has been tested on the Ebisu-4D and Draak development boards.

I intend to queue this in renesas-clk for v5.19.

Thanks for your comments!

Geert Uytterhoeven (2):
  clk: renesas: r8a77990: Add RPC clocks
  clk: renesas: r8a77995: Add RPC clocks

 drivers/clk/renesas/r8a77990-cpg-mssr.c | 9 +++++++++
 drivers/clk/renesas/r8a77995-cpg-mssr.c | 9 +++++++++
 drivers/clk/renesas/rcar-gen3-cpg.h     | 3 +++
 3 files changed, 21 insertions(+)

-- 
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 1/2] clk: renesas: r8a77990: Add RPC clocks
  2022-03-29  9:44 [PATCH 0/2] clk: renesas: r8a7799[05]: Add RPC clocks Geert Uytterhoeven
@ 2022-03-29  9:44 ` Geert Uytterhoeven
  2022-04-07  6:46   ` Wolfram Sang
  2022-03-29  9:44 ` [PATCH 2/2] clk: renesas: r8a77995: " Geert Uytterhoeven
  1 sibling, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-03-29  9:44 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-renesas-soc, linux-clk, Geert Uytterhoeven

Describe the various clocks used by the SPI Multi I/O Bus Controller
(RPC-IF) on the R-Car E3 SoC: RPCSRC internal clock, RPC{,D2} clocks
derived from it, and RPC-IF module clock.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/renesas/r8a77990-cpg-mssr.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/clk/renesas/r8a77990-cpg-mssr.c b/drivers/clk/renesas/r8a77990-cpg-mssr.c
index d34d97baab35f3be..a5c95e0021f82e7f 100644
--- a/drivers/clk/renesas/r8a77990-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a77990-cpg-mssr.c
@@ -44,6 +44,7 @@ enum clk_ids {
 	CLK_S2,
 	CLK_S3,
 	CLK_SDSRC,
+	CLK_RPCSRC,
 	CLK_RINT,
 	CLK_OCO,
 
@@ -74,6 +75,8 @@ static const struct cpg_core_clk r8a77990_core_clks[] __initconst = {
 	DEF_FIXED(".s3",       CLK_S3,             CLK_PLL1,       6, 1),
 	DEF_FIXED(".sdsrc",    CLK_SDSRC,          CLK_PLL1,       2, 1),
 
+	DEF_FIXED_RPCSRC_E3(".rpcsrc", CLK_RPCSRC, CLK_PLL0, CLK_PLL1),
+
 	DEF_DIV6_RO(".r",      CLK_RINT,           CLK_EXTAL, CPG_RCKCR, 32),
 
 	DEF_RATE(".oco",       CLK_OCO,            8 * 1000 * 1000),
@@ -107,6 +110,11 @@ static const struct cpg_core_clk r8a77990_core_clks[] __initconst = {
 	DEF_GEN3_SD("sd1",     R8A77990_CLK_SD1,   R8A77990_CLK_SD1H, 0x0078),
 	DEF_GEN3_SD("sd3",     R8A77990_CLK_SD3,   R8A77990_CLK_SD3H, 0x026c),
 
+	DEF_BASE("rpc",		R8A77990_CLK_RPC, CLK_TYPE_GEN3_RPC,
+		 CLK_RPCSRC),
+	DEF_BASE("rpcd2",	R8A77990_CLK_RPCD2, CLK_TYPE_GEN3_RPCD2,
+		 R8A77990_CLK_RPC),
+
 	DEF_FIXED("cl",        R8A77990_CLK_CL,    CLK_PLL1,      48, 1),
 	DEF_FIXED("cr",        R8A77990_CLK_CR,    CLK_PLL1D2,     2, 1),
 	DEF_FIXED("cp",        R8A77990_CLK_CP,    CLK_EXTAL,      2, 1),
@@ -215,6 +223,7 @@ static const struct mssr_mod_clk r8a77990_mod_clks[] __initconst = {
 	DEF_MOD("can-fd",		 914,	R8A77990_CLK_S3D2),
 	DEF_MOD("can-if1",		 915,	R8A77990_CLK_S3D4),
 	DEF_MOD("can-if0",		 916,	R8A77990_CLK_S3D4),
+	DEF_MOD("rpc-if",		 917,	R8A77990_CLK_RPCD2),
 	DEF_MOD("i2c6",			 918,	R8A77990_CLK_S3D2),
 	DEF_MOD("i2c5",			 919,	R8A77990_CLK_S3D2),
 	DEF_MOD("i2c-dvfs",		 926,	R8A77990_CLK_CP),
-- 
2.25.1


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

* [PATCH 2/2] clk: renesas: r8a77995: Add RPC clocks
  2022-03-29  9:44 [PATCH 0/2] clk: renesas: r8a7799[05]: Add RPC clocks Geert Uytterhoeven
  2022-03-29  9:44 ` [PATCH 1/2] clk: renesas: r8a77990: " Geert Uytterhoeven
@ 2022-03-29  9:44 ` Geert Uytterhoeven
  2022-04-07  6:48   ` Wolfram Sang
  1 sibling, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-03-29  9:44 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-renesas-soc, linux-clk, Geert Uytterhoeven

Describe the various clocks used by the SPI Multi I/O Bus Controller
(RPC-IF) on the R-Car D3 SoC: RPCSRC internal clock, RPC{,D2} clocks
derived from it, and RPC-IF module clock.

The RPCSRC clock divider on R-Car D3 is very similar to the one on R-Car
E3, but uses a different pre-divider for the PLL0 parent.  Add a new
macro to describe it, reusing the existing clock type for R-Car E3.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/renesas/r8a77995-cpg-mssr.c | 9 +++++++++
 drivers/clk/renesas/rcar-gen3-cpg.h     | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/drivers/clk/renesas/r8a77995-cpg-mssr.c b/drivers/clk/renesas/r8a77995-cpg-mssr.c
index 525eef197fd9a9ab..22e7bf0de9fe1f53 100644
--- a/drivers/clk/renesas/r8a77995-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a77995-cpg-mssr.c
@@ -42,6 +42,7 @@ enum clk_ids {
 	CLK_S2,
 	CLK_S3,
 	CLK_SDSRC,
+	CLK_RPCSRC,
 	CLK_RINT,
 	CLK_OCO,
 
@@ -70,6 +71,8 @@ static const struct cpg_core_clk r8a77995_core_clks[] __initconst = {
 	DEF_FIXED(".s3",       CLK_S3,             CLK_PLL1,       6, 1),
 	DEF_FIXED(".sdsrc",    CLK_SDSRC,          CLK_PLL1,       2, 1),
 
+	DEF_FIXED_RPCSRC_D3(".rpcsrc", CLK_RPCSRC, CLK_PLL0, CLK_PLL1),
+
 	DEF_DIV6_RO(".r",      CLK_RINT,           CLK_EXTAL, CPG_RCKCR, 32),
 
 	DEF_RATE(".oco",       CLK_OCO,            8 * 1000 * 1000),
@@ -106,6 +109,11 @@ static const struct cpg_core_clk r8a77995_core_clks[] __initconst = {
 	DEF_GEN3_SDH("sd0h",   R8A77995_CLK_SD0H, CLK_SDSRC,         0x268),
 	DEF_GEN3_SD("sd0",     R8A77995_CLK_SD0,  R8A77995_CLK_SD0H, 0x268),
 
+	DEF_BASE("rpc",		R8A77995_CLK_RPC, CLK_TYPE_GEN3_RPC,
+		 CLK_RPCSRC),
+	DEF_BASE("rpcd2",	R8A77995_CLK_RPCD2, CLK_TYPE_GEN3_RPCD2,
+		 R8A77995_CLK_RPC),
+
 	DEF_DIV6P1("canfd",    R8A77995_CLK_CANFD, CLK_PLL0D3,    0x244),
 	DEF_DIV6P1("mso",      R8A77995_CLK_MSO,   CLK_PLL1D2,    0x014),
 
@@ -174,6 +182,7 @@ static const struct mssr_mod_clk r8a77995_mod_clks[] __initconst = {
 	DEF_MOD("can-fd",		 914,	R8A77995_CLK_S3D2),
 	DEF_MOD("can-if1",		 915,	R8A77995_CLK_S3D4),
 	DEF_MOD("can-if0",		 916,	R8A77995_CLK_S3D4),
+	DEF_MOD("rpc-if",		 917,	R8A77995_CLK_RPCD2),
 	DEF_MOD("i2c3",			 928,	R8A77995_CLK_S3D2),
 	DEF_MOD("i2c2",			 929,	R8A77995_CLK_S3D2),
 	DEF_MOD("i2c1",			 930,	R8A77995_CLK_S3D2),
diff --git a/drivers/clk/renesas/rcar-gen3-cpg.h b/drivers/clk/renesas/rcar-gen3-cpg.h
index 2bc0afadf60413d2..a13df006f531519e 100644
--- a/drivers/clk/renesas/rcar-gen3-cpg.h
+++ b/drivers/clk/renesas/rcar-gen3-cpg.h
@@ -62,6 +62,9 @@ enum rcar_gen3_clk_types {
 #define DEF_FIXED_RPCSRC_E3(_name, _id, _parent0, _parent1)	\
 	DEF_BASE(_name, _id, CLK_TYPE_GEN3_E3_RPCSRC,	\
 		 (_parent0) << 16 | (_parent1), .div = 8)
+#define DEF_FIXED_RPCSRC_D3(_name, _id, _parent0, _parent1)	\
+	DEF_BASE(_name, _id, CLK_TYPE_GEN3_E3_RPCSRC,	\
+		 (_parent0) << 16 | (_parent1), .div = 5)
 
 struct rcar_gen3_cpg_pll_config {
 	u8 extal_div;
-- 
2.25.1


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

* Re: [PATCH 1/2] clk: renesas: r8a77990: Add RPC clocks
  2022-03-29  9:44 ` [PATCH 1/2] clk: renesas: r8a77990: " Geert Uytterhoeven
@ 2022-04-07  6:46   ` Wolfram Sang
  2022-04-11  8:57     ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2022-04-07  6:46 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Turquette, Stephen Boyd, linux-renesas-soc, linux-clk

[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]

On Tue, Mar 29, 2022 at 11:44:25AM +0200, Geert Uytterhoeven wrote:
> Describe the various clocks used by the SPI Multi I/O Bus Controller
> (RPC-IF) on the R-Car E3 SoC: RPCSRC internal clock, RPC{,D2} clocks
> derived from it, and RPC-IF module clock.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

One minor question, though:

> +	DEF_FIXED_RPCSRC_E3(".rpcsrc", CLK_RPCSRC, CLK_PLL0, CLK_PLL1),
> +
>  	DEF_DIV6_RO(".r",      CLK_RINT,           CLK_EXTAL, CPG_RCKCR, 32),
>  
>  	DEF_RATE(".oco",       CLK_OCO,            8 * 1000 * 1000),
> @@ -107,6 +110,11 @@ static const struct cpg_core_clk r8a77990_core_clks[] __initconst = {
>  	DEF_GEN3_SD("sd1",     R8A77990_CLK_SD1,   R8A77990_CLK_SD1H, 0x0078),
>  	DEF_GEN3_SD("sd3",     R8A77990_CLK_SD3,   R8A77990_CLK_SD3H, 0x026c),
>  
> +	DEF_BASE("rpc",		R8A77990_CLK_RPC, CLK_TYPE_GEN3_RPC,
> +		 CLK_RPCSRC),
> +	DEF_BASE("rpcd2",	R8A77990_CLK_RPCD2, CLK_TYPE_GEN3_RPCD2,
> +		 R8A77990_CLK_RPC),
> +

Any reason the RPC clocks are not grouped together? All other SoCs I
checked have that.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 2/2] clk: renesas: r8a77995: Add RPC clocks
  2022-03-29  9:44 ` [PATCH 2/2] clk: renesas: r8a77995: " Geert Uytterhoeven
@ 2022-04-07  6:48   ` Wolfram Sang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2022-04-07  6:48 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Turquette, Stephen Boyd, linux-renesas-soc, linux-clk

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

On Tue, Mar 29, 2022 at 11:44:26AM +0200, Geert Uytterhoeven wrote:
> Describe the various clocks used by the SPI Multi I/O Bus Controller
> (RPC-IF) on the R-Car D3 SoC: RPCSRC internal clock, RPC{,D2} clocks
> derived from it, and RPC-IF module clock.
> 
> The RPCSRC clock divider on R-Car D3 is very similar to the one on R-Car
> E3, but uses a different pre-divider for the PLL0 parent.  Add a new
> macro to describe it, reusing the existing clock type for R-Car E3.

Maybe add a comment in the header file stating the last paragraph, so it
is obvious the "E3" there is intended? Other than that:

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 1/2] clk: renesas: r8a77990: Add RPC clocks
  2022-04-07  6:46   ` Wolfram Sang
@ 2022-04-11  8:57     ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-04-11  8:57 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Michael Turquette, Stephen Boyd, Linux-Renesas, linux-clk

Hi Wolfram,

On Thu, Apr 7, 2022 at 8:46 AM Wolfram Sang <wsa@kernel.org> wrote:
> On Tue, Mar 29, 2022 at 11:44:25AM +0200, Geert Uytterhoeven wrote:
> > Describe the various clocks used by the SPI Multi I/O Bus Controller
> > (RPC-IF) on the R-Car E3 SoC: RPCSRC internal clock, RPC{,D2} clocks
> > derived from it, and RPC-IF module clock.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks!

> One minor question, though:
>
> > +     DEF_FIXED_RPCSRC_E3(".rpcsrc", CLK_RPCSRC, CLK_PLL0, CLK_PLL1),
> > +
> >       DEF_DIV6_RO(".r",      CLK_RINT,           CLK_EXTAL, CPG_RCKCR, 32),
> >
> >       DEF_RATE(".oco",       CLK_OCO,            8 * 1000 * 1000),
> > @@ -107,6 +110,11 @@ static const struct cpg_core_clk r8a77990_core_clks[] __initconst = {
> >       DEF_GEN3_SD("sd1",     R8A77990_CLK_SD1,   R8A77990_CLK_SD1H, 0x0078),
> >       DEF_GEN3_SD("sd3",     R8A77990_CLK_SD3,   R8A77990_CLK_SD3H, 0x026c),
> >
> > +     DEF_BASE("rpc",         R8A77990_CLK_RPC, CLK_TYPE_GEN3_RPC,
> > +              CLK_RPCSRC),
> > +     DEF_BASE("rpcd2",       R8A77990_CLK_RPCD2, CLK_TYPE_GEN3_RPCD2,
> > +              R8A77990_CLK_RPC),
> > +
>
> Any reason the RPC clocks are not grouped together? All other SoCs I

Yes :-)
The "rpc" and "rpcd2" clocks are not internal clocks, so they do not belong
under "/* Internal Core Clocks */", but under "/* Core Clock Outputs */"...

> checked have that.

... Hence soon I'll send out a patch to fix that...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2022-04-11  8:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29  9:44 [PATCH 0/2] clk: renesas: r8a7799[05]: Add RPC clocks Geert Uytterhoeven
2022-03-29  9:44 ` [PATCH 1/2] clk: renesas: r8a77990: " Geert Uytterhoeven
2022-04-07  6:46   ` Wolfram Sang
2022-04-11  8:57     ` Geert Uytterhoeven
2022-03-29  9:44 ` [PATCH 2/2] clk: renesas: r8a77995: " Geert Uytterhoeven
2022-04-07  6:48   ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.