linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] r8a779a0: enable PWM
@ 2023-05-02 17:06 Wolfram Sang
  2023-05-02 17:06 ` [PATCH 1/2] clk: renesas: r8a779a0: Add PWM clock Wolfram Sang
  2023-05-02 17:06 ` [PATCH 2/2] arm64: dts: renesas: r8a779a0: Add PWM nodes Wolfram Sang
  0 siblings, 2 replies; 10+ messages in thread
From: Wolfram Sang @ 2023-05-02 17:06 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Wolfram Sang, devicetree, linux-clk, linux-kernel

Having another look at the specs, I finally discovered a testpoint (CP2)
which we could use to test PWM4 on a Falcon board. Thanks go to Kieran
for setting up the scope and do the actual testing. This was the last
missing V3U bit from my side, hooray!

Phong Hoang (1):
  arm64: dts: renesas: r8a779a0: Add PWM nodes

Wolfram Sang (1):
  clk: renesas: r8a779a0: Add PWM clock

 arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 50 +++++++++++++++++++++++
 drivers/clk/renesas/r8a779a0-cpg-mssr.c   |  1 +
 2 files changed, 51 insertions(+)

-- 
2.30.2


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

* [PATCH 1/2] clk: renesas: r8a779a0: Add PWM clock
  2023-05-02 17:06 [PATCH 0/2] r8a779a0: enable PWM Wolfram Sang
@ 2023-05-02 17:06 ` Wolfram Sang
  2023-05-03 10:09   ` Geert Uytterhoeven
  2023-05-02 17:06 ` [PATCH 2/2] arm64: dts: renesas: r8a779a0: Add PWM nodes Wolfram Sang
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfram Sang @ 2023-05-02 17:06 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Kieran Bingham, Geert Uytterhoeven,
	Michael Turquette, Stephen Boyd, linux-clk, linux-kernel

Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/clk/renesas/r8a779a0-cpg-mssr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/renesas/r8a779a0-cpg-mssr.c b/drivers/clk/renesas/r8a779a0-cpg-mssr.c
index fcc8279647a6..136a0d4e7ed6 100644
--- a/drivers/clk/renesas/r8a779a0-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a779a0-cpg-mssr.c
@@ -170,6 +170,7 @@ static const struct mssr_mod_clk r8a779a0_mod_clks[] __initconst = {
 	DEF_MOD("msi3",		621,	R8A779A0_CLK_MSO),
 	DEF_MOD("msi4",		622,	R8A779A0_CLK_MSO),
 	DEF_MOD("msi5",		623,	R8A779A0_CLK_MSO),
+	DEF_MOD("pwm",		628,	R8A779A0_CLK_S1D8),
 	DEF_MOD("rpc-if",	629,	R8A779A0_CLK_RPCD2),
 	DEF_MOD("scif0",	702,	R8A779A0_CLK_S1D8),
 	DEF_MOD("scif1",	703,	R8A779A0_CLK_S1D8),
-- 
2.30.2


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

* [PATCH 2/2] arm64: dts: renesas: r8a779a0: Add PWM nodes
  2023-05-02 17:06 [PATCH 0/2] r8a779a0: enable PWM Wolfram Sang
  2023-05-02 17:06 ` [PATCH 1/2] clk: renesas: r8a779a0: Add PWM clock Wolfram Sang
@ 2023-05-02 17:06 ` Wolfram Sang
  2023-05-03 10:14   ` Geert Uytterhoeven
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfram Sang @ 2023-05-02 17:06 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Phong Hoang, Kieran Bingham, Wolfram Sang, Geert Uytterhoeven,
	Magnus Damm, Rob Herring, Krzysztof Kozlowski, devicetree,
	linux-kernel

From: Phong Hoang <phong.hoang.wz@renesas.com>

This patch adds PWM nodes for R-Car V3U (r8a779a0) SoC.

Signed-off-by: Phong Hoang <phong.hoang.wz@renesas.com>
[wsa: rebased]
Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 50 +++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
index bf587a14ec19..7c63591a138f 100644
--- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
@@ -1108,6 +1108,56 @@ msiof5: spi@e6c28000 {
 			status = "disabled";
 		};
 
+		pwm0: pwm@e6e30000 {
+			compatible = "renesas,pwm-r8a779a0", "renesas,pwm-rcar";
+			reg = <0 0xe6e30000 0 0x10>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 628>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 628>;
+			status = "disabled";
+		};
+
+		pwm1: pwm@e6e31000 {
+			compatible = "renesas,pwm-r8a779a0", "renesas,pwm-rcar";
+			reg = <0 0xe6e31000 0 0x10>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 628>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 628>;
+			status = "disabled";
+		};
+
+		pwm2: pwm@e6e32000 {
+			compatible = "renesas,pwm-r8a779a0", "renesas,pwm-rcar";
+			reg = <0 0xe6e32000 0 0x10>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 628>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 628>;
+			status = "disabled";
+		};
+
+		pwm3: pwm@e6e33000 {
+			compatible = "renesas,pwm-r8a779a0", "renesas,pwm-rcar";
+			reg = <0 0xe6e33000 0 0x10>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 628>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 628>;
+			status = "disabled";
+		};
+
+		pwm4: pwm@e6e34000 {
+			compatible = "renesas,pwm-r8a779a0", "renesas,pwm-rcar";
+			reg = <0 0xe6e34000 0 0x10>;
+			#pwm-cells = <2>;
+			clocks = <&cpg CPG_MOD 628>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 628>;
+			status = "disabled";
+		};
+
 		vin00: video@e6ef0000 {
 			compatible = "renesas,vin-r8a779a0";
 			reg = <0 0xe6ef0000 0 0x1000>;
-- 
2.30.2


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

* Re: [PATCH 1/2] clk: renesas: r8a779a0: Add PWM clock
  2023-05-02 17:06 ` [PATCH 1/2] clk: renesas: r8a779a0: Add PWM clock Wolfram Sang
@ 2023-05-03 10:09   ` Geert Uytterhoeven
  2023-05-03 12:41     ` Wolfram Sang
  2023-05-03 19:37     ` Kieran Bingham
  0 siblings, 2 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2023-05-03 10:09 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Kieran Bingham, Geert Uytterhoeven,
	Michael Turquette, Stephen Boyd, linux-clk, linux-kernel

Hi Wolfram,

On Tue, May 2, 2023 at 7:06 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks for your patch!

> --- a/drivers/clk/renesas/r8a779a0-cpg-mssr.c
> +++ b/drivers/clk/renesas/r8a779a0-cpg-mssr.c
> @@ -170,6 +170,7 @@ static const struct mssr_mod_clk r8a779a0_mod_clks[] __initconst = {
>         DEF_MOD("msi3",         621,    R8A779A0_CLK_MSO),
>         DEF_MOD("msi4",         622,    R8A779A0_CLK_MSO),
>         DEF_MOD("msi5",         623,    R8A779A0_CLK_MSO),
> +       DEF_MOD("pwm",          628,    R8A779A0_CLK_S1D8),

Do you mind if I rename this to "pwm0" while applying, to match the docs?

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-clk-for-v6.5.

>         DEF_MOD("rpc-if",       629,    R8A779A0_CLK_RPCD2),
>         DEF_MOD("scif0",        702,    R8A779A0_CLK_S1D8),
>         DEF_MOD("scif1",        703,    R8A779A0_CLK_S1D8),

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] 10+ messages in thread

* Re: [PATCH 2/2] arm64: dts: renesas: r8a779a0: Add PWM nodes
  2023-05-02 17:06 ` [PATCH 2/2] arm64: dts: renesas: r8a779a0: Add PWM nodes Wolfram Sang
@ 2023-05-03 10:14   ` Geert Uytterhoeven
  2023-05-03 12:42     ` Wolfram Sang
  2023-05-03 19:38     ` Kieran Bingham
  0 siblings, 2 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2023-05-03 10:14 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Phong Hoang, Kieran Bingham,
	Geert Uytterhoeven, Magnus Damm, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Hi Wolfram,

On Tue, May 2, 2023 at 7:06 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> From: Phong Hoang <phong.hoang.wz@renesas.com>
>
> This patch adds PWM nodes for R-Car V3U (r8a779a0) SoC.
>
> Signed-off-by: Phong Hoang <phong.hoang.wz@renesas.com>
> [wsa: rebased]
> Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v6.5.

> --- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> @@ -1108,6 +1108,56 @@ msiof5: spi@e6c28000 {
>                         status = "disabled";
>                 };
>
> +               pwm0: pwm@e6e30000 {

I'll move this before serial@e6e60000 while applying, to preserve sort
order (by unit address).

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] 10+ messages in thread

* Re: [PATCH 1/2] clk: renesas: r8a779a0: Add PWM clock
  2023-05-03 10:09   ` Geert Uytterhoeven
@ 2023-05-03 12:41     ` Wolfram Sang
  2023-05-03 12:44       ` Geert Uytterhoeven
  2023-05-03 19:37     ` Kieran Bingham
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfram Sang @ 2023-05-03 12:41 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-renesas-soc, Kieran Bingham, Geert Uytterhoeven,
	Michael Turquette, Stephen Boyd, linux-clk, linux-kernel

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


> > +       DEF_MOD("pwm",          628,    R8A779A0_CLK_S1D8),
> 
> Do you mind if I rename this to "pwm0" while applying, to match the docs?

No, feel free. I think it is a bit misleading because the clock is used
up to pwm4. But if the docs have it that way...


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

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

* Re: [PATCH 2/2] arm64: dts: renesas: r8a779a0: Add PWM nodes
  2023-05-03 10:14   ` Geert Uytterhoeven
@ 2023-05-03 12:42     ` Wolfram Sang
  2023-05-03 19:38     ` Kieran Bingham
  1 sibling, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2023-05-03 12:42 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-renesas-soc, Phong Hoang, Kieran Bingham,
	Geert Uytterhoeven, Magnus Damm, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

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


> > --- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> > @@ -1108,6 +1108,56 @@ msiof5: spi@e6c28000 {
> >                         status = "disabled";
> >                 };
> >
> > +               pwm0: pwm@e6e30000 {
> 
> I'll move this before serial@e6e60000 while applying, to preserve sort
> order (by unit address).

Oops, right, things have been added since I last worked on V3U. Thank
you!


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

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

* Re: [PATCH 1/2] clk: renesas: r8a779a0: Add PWM clock
  2023-05-03 12:41     ` Wolfram Sang
@ 2023-05-03 12:44       ` Geert Uytterhoeven
  0 siblings, 0 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2023-05-03 12:44 UTC (permalink / raw)
  To: Wolfram Sang, Geert Uytterhoeven, linux-renesas-soc,
	Kieran Bingham, Geert Uytterhoeven, Michael Turquette,
	Stephen Boyd, linux-clk, linux-kernel

Hi Wolfram,

On Wed, May 3, 2023 at 2:41 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> > > +       DEF_MOD("pwm",          628,    R8A779A0_CLK_S1D8),
> >
> > Do you mind if I rename this to "pwm0" while applying, to match the docs?
>
> No, feel free. I think it is a bit misleading because the clock is used
> up to pwm4. But if the docs have it that way...

The preliminary R-Car V3U docs _are_ misleading... But it's probably
the best we'd ever get ;-)

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] 10+ messages in thread

* Re: [PATCH 1/2] clk: renesas: r8a779a0: Add PWM clock
  2023-05-03 10:09   ` Geert Uytterhoeven
  2023-05-03 12:41     ` Wolfram Sang
@ 2023-05-03 19:37     ` Kieran Bingham
  1 sibling, 0 replies; 10+ messages in thread
From: Kieran Bingham @ 2023-05-03 19:37 UTC (permalink / raw)
  To: Geert Uytterhoeven, Wolfram Sang
  Cc: linux-renesas-soc, Geert Uytterhoeven, Michael Turquette,
	Stephen Boyd, linux-clk, linux-kernel

Quoting Geert Uytterhoeven (2023-05-03 11:09:29)
> Hi Wolfram,
> 
> On Tue, May 2, 2023 at 7:06 PM Wolfram Sang
> <wsa+renesas@sang-engineering.com> wrote:
> > Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> Thanks for your patch!
> 
> > --- a/drivers/clk/renesas/r8a779a0-cpg-mssr.c
> > +++ b/drivers/clk/renesas/r8a779a0-cpg-mssr.c
> > @@ -170,6 +170,7 @@ static const struct mssr_mod_clk r8a779a0_mod_clks[] __initconst = {
> >         DEF_MOD("msi3",         621,    R8A779A0_CLK_MSO),
> >         DEF_MOD("msi4",         622,    R8A779A0_CLK_MSO),
> >         DEF_MOD("msi5",         623,    R8A779A0_CLK_MSO),
> > +       DEF_MOD("pwm",          628,    R8A779A0_CLK_S1D8),
> 
> Do you mind if I rename this to "pwm0" while applying, to match the docs?
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> i.e. will queue in renesas-clk-for-v6.5.

Either way is fine with me, and I've seen this work now so:

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> 
> >         DEF_MOD("rpc-if",       629,    R8A779A0_CLK_RPCD2),
> >         DEF_MOD("scif0",        702,    R8A779A0_CLK_S1D8),
> >         DEF_MOD("scif1",        703,    R8A779A0_CLK_S1D8),
> 
> 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] 10+ messages in thread

* Re: [PATCH 2/2] arm64: dts: renesas: r8a779a0: Add PWM nodes
  2023-05-03 10:14   ` Geert Uytterhoeven
  2023-05-03 12:42     ` Wolfram Sang
@ 2023-05-03 19:38     ` Kieran Bingham
  1 sibling, 0 replies; 10+ messages in thread
From: Kieran Bingham @ 2023-05-03 19:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, Wolfram Sang
  Cc: linux-renesas-soc, Phong Hoang, Geert Uytterhoeven, Magnus Damm,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

Quoting Geert Uytterhoeven (2023-05-03 11:14:52)
> Hi Wolfram,
> 
> On Tue, May 2, 2023 at 7:06 PM Wolfram Sang
> <wsa+renesas@sang-engineering.com> wrote:
> > From: Phong Hoang <phong.hoang.wz@renesas.com>
> >
> > This patch adds PWM nodes for R-Car V3U (r8a779a0) SoC.
> >
> > Signed-off-by: Phong Hoang <phong.hoang.wz@renesas.com>
> > [wsa: rebased]
> > Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> i.e. will queue in renesas-devel for v6.5.
> 
> > --- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> > @@ -1108,6 +1108,56 @@ msiof5: spi@e6c28000 {
> >                         status = "disabled";
> >                 };
> >
> > +               pwm0: pwm@e6e30000 {
> 
> I'll move this before serial@e6e60000 while applying, to preserve sort
> order (by unit address).

I still wonder when we can have nice tools that will sort DT and format
DT files for us!


Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> 
> 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] 10+ messages in thread

end of thread, other threads:[~2023-05-03 19:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-02 17:06 [PATCH 0/2] r8a779a0: enable PWM Wolfram Sang
2023-05-02 17:06 ` [PATCH 1/2] clk: renesas: r8a779a0: Add PWM clock Wolfram Sang
2023-05-03 10:09   ` Geert Uytterhoeven
2023-05-03 12:41     ` Wolfram Sang
2023-05-03 12:44       ` Geert Uytterhoeven
2023-05-03 19:37     ` Kieran Bingham
2023-05-02 17:06 ` [PATCH 2/2] arm64: dts: renesas: r8a779a0: Add PWM nodes Wolfram Sang
2023-05-03 10:14   ` Geert Uytterhoeven
2023-05-03 12:42     ` Wolfram Sang
2023-05-03 19:38     ` Kieran Bingham

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