* [PATCH v2 0/2] Add Ethernet and GMAC clocks for Renesas RZ/{T2H, N2H} SoCs @ 2025-09-01 18:29 Prabhakar 2025-09-01 18:29 ` [PATCH v2 1/2] dt-bindings: clock: renesas,r9a09g077/87: Add Ethernet and GMAC clocks Prabhakar 2025-09-01 18:30 ` [PATCH v2 2/2] clk: renesas: r9a09g077: Add Ethernet Subsystem core and module clocks Prabhakar 0 siblings, 2 replies; 8+ messages in thread From: Prabhakar @ 2025-09-01 18:29 UTC (permalink / raw) To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm Cc: linux-renesas-soc, linux-clk, linux-kernel, devicetree, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Hi All, This patch series aims to add Ethernet and GMAC clocks for Renesas RZ/{T2H, N2H} SoCs. The first patch adds the core clock definitions and the second patch adds the entries to modules and core clocks. v1->v2: - Added Acked-by tag from Conor - Dropped an unnecessary extra line in core clocks - Sorted the module clocks in ascending order of their IDs Cheers, Prabhakar Lad Prabhakar (2): dt-bindings: clock: renesas,r9a09g077/87: Add Ethernet and GMAC clocks clk: renesas: r9a09g077: Add Ethernet Subsystem core and module clocks drivers/clk/renesas/r9a09g077-cpg.c | 17 ++++++++++++++++- .../clock/renesas,r9a09g077-cpg-mssr.h | 9 +++++++++ .../clock/renesas,r9a09g087-cpg-mssr.h | 9 +++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) -- 2.51.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/2] dt-bindings: clock: renesas,r9a09g077/87: Add Ethernet and GMAC clocks 2025-09-01 18:29 [PATCH v2 0/2] Add Ethernet and GMAC clocks for Renesas RZ/{T2H, N2H} SoCs Prabhakar @ 2025-09-01 18:29 ` Prabhakar 2025-09-02 13:02 ` Geert Uytterhoeven 2025-09-01 18:30 ` [PATCH v2 2/2] clk: renesas: r9a09g077: Add Ethernet Subsystem core and module clocks Prabhakar 1 sibling, 1 reply; 8+ messages in thread From: Prabhakar @ 2025-09-01 18:29 UTC (permalink / raw) To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm Cc: linux-renesas-soc, linux-clk, linux-kernel, devicetree, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar, Conor Dooley From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Add clock definitions for Ethernet (ETCLK A-E) and GMAC (GMAC0-2) peripherals to both R9A09G077 and R9A09G087 SoCs. These definitions are required for describing Ethernet and GMAC devices in device trees. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> --- v1->v2: - Added Acked-by tag from Conor. --- include/dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h | 9 +++++++++ include/dt-bindings/clock/renesas,r9a09g087-cpg-mssr.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/include/dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h b/include/dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h index 0c2ce81a8744..a9e88b0c502d 100644 --- a/include/dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h +++ b/include/dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h @@ -26,5 +26,14 @@ #define R9A09G077_CLK_PCLKL 14 #define R9A09G077_SDHI_CLKHS 15 #define R9A09G077_USB_CLK 16 +#define R9A09G077_ETCLKA 17 +#define R9A09G077_ETCLKB 18 +#define R9A09G077_ETCLKC 19 +#define R9A09G077_ETCLKD 20 +#define R9A09G077_ETCLKE 21 +#define R9A09G077_GMAC0_PCLKH 22 +#define R9A09G077_GMAC1_PCLKAH 23 +#define R9A09G077_GMAC2_PCLKAH 24 + #endif /* __DT_BINDINGS_CLOCK_RENESAS_R9A09G077_CPG_H__ */ diff --git a/include/dt-bindings/clock/renesas,r9a09g087-cpg-mssr.h b/include/dt-bindings/clock/renesas,r9a09g087-cpg-mssr.h index 70ee883f2386..c86ffa68f87c 100644 --- a/include/dt-bindings/clock/renesas,r9a09g087-cpg-mssr.h +++ b/include/dt-bindings/clock/renesas,r9a09g087-cpg-mssr.h @@ -26,5 +26,14 @@ #define R9A09G087_CLK_PCLKL 14 #define R9A09G087_SDHI_CLKHS 15 #define R9A09G087_USB_CLK 16 +#define R9A09G087_ETCLKA 17 +#define R9A09G087_ETCLKB 18 +#define R9A09G087_ETCLKC 19 +#define R9A09G087_ETCLKD 20 +#define R9A09G087_ETCLKE 21 +#define R9A09G087_GMAC0_PCLKH 22 +#define R9A09G087_GMAC1_PCLKAH 23 +#define R9A09G087_GMAC2_PCLKAH 24 + #endif /* __DT_BINDINGS_CLOCK_RENESAS_R9A09G087_CPG_H__ */ -- 2.51.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: clock: renesas,r9a09g077/87: Add Ethernet and GMAC clocks 2025-09-01 18:29 ` [PATCH v2 1/2] dt-bindings: clock: renesas,r9a09g077/87: Add Ethernet and GMAC clocks Prabhakar @ 2025-09-02 13:02 ` Geert Uytterhoeven 2025-09-02 15:37 ` Lad, Prabhakar 0 siblings, 1 reply; 8+ messages in thread From: Geert Uytterhoeven @ 2025-09-02 13:02 UTC (permalink / raw) To: Prabhakar Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, linux-renesas-soc, linux-clk, linux-kernel, devicetree, Biju Das, Fabrizio Castro, Lad Prabhakar, Conor Dooley Hi Prabhakar, On Mon, 1 Sept 2025 at 20:30, Prabhakar <prabhakar.csengg@gmail.com> wrote: > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Add clock definitions for Ethernet (ETCLK A-E) and GMAC (GMAC0-2) > peripherals to both R9A09G077 and R9A09G087 SoCs. These definitions > are required for describing Ethernet and GMAC devices in device trees. > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > Acked-by: Conor Dooley <conor.dooley@microchip.com> Thanks for your patch! > --- a/include/dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h > +++ b/include/dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h > @@ -26,5 +26,14 @@ > #define R9A09G077_CLK_PCLKL 14 > #define R9A09G077_SDHI_CLKHS 15 > #define R9A09G077_USB_CLK 16 > +#define R9A09G077_ETCLKA 17 > +#define R9A09G077_ETCLKB 18 > +#define R9A09G077_ETCLKC 19 > +#define R9A09G077_ETCLKD 20 > +#define R9A09G077_ETCLKE 21 These five LGTM. > +#define R9A09G077_GMAC0_PCLKH 22 > +#define R9A09G077_GMAC1_PCLKAH 23 > +#define R9A09G077_GMAC2_PCLKAH 24 I doubt you really need these, cfr. my comments on [PATCH v2 2/2]. 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] 8+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: clock: renesas,r9a09g077/87: Add Ethernet and GMAC clocks 2025-09-02 13:02 ` Geert Uytterhoeven @ 2025-09-02 15:37 ` Lad, Prabhakar 0 siblings, 0 replies; 8+ messages in thread From: Lad, Prabhakar @ 2025-09-02 15:37 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, linux-renesas-soc, linux-clk, linux-kernel, devicetree, Biju Das, Fabrizio Castro, Lad Prabhakar, Conor Dooley Hi Geert, Thank you for the review. On Tue, Sep 2, 2025 at 2:02 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Hi Prabhakar, > > On Mon, 1 Sept 2025 at 20:30, Prabhakar <prabhakar.csengg@gmail.com> wrote: > > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > > > Add clock definitions for Ethernet (ETCLK A-E) and GMAC (GMAC0-2) > > peripherals to both R9A09G077 and R9A09G087 SoCs. These definitions > > are required for describing Ethernet and GMAC devices in device trees. > > > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Acked-by: Conor Dooley <conor.dooley@microchip.com> > > Thanks for your patch! > > > --- a/include/dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h > > +++ b/include/dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h > > @@ -26,5 +26,14 @@ > > #define R9A09G077_CLK_PCLKL 14 > > #define R9A09G077_SDHI_CLKHS 15 > > #define R9A09G077_USB_CLK 16 > > +#define R9A09G077_ETCLKA 17 > > +#define R9A09G077_ETCLKB 18 > > +#define R9A09G077_ETCLKC 19 > > +#define R9A09G077_ETCLKD 20 > > +#define R9A09G077_ETCLKE 21 > > These five LGTM. > > > +#define R9A09G077_GMAC0_PCLKH 22 > > +#define R9A09G077_GMAC1_PCLKAH 23 > > +#define R9A09G077_GMAC2_PCLKAH 24 > > I doubt you really need these, cfr. my comments on [PATCH v2 2/2]. > As agreed on patch 2/2, I will drop these macros in v3. Cheers, Prabhakar ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] clk: renesas: r9a09g077: Add Ethernet Subsystem core and module clocks 2025-09-01 18:29 [PATCH v2 0/2] Add Ethernet and GMAC clocks for Renesas RZ/{T2H, N2H} SoCs Prabhakar 2025-09-01 18:29 ` [PATCH v2 1/2] dt-bindings: clock: renesas,r9a09g077/87: Add Ethernet and GMAC clocks Prabhakar @ 2025-09-01 18:30 ` Prabhakar 2025-09-02 13:01 ` Geert Uytterhoeven 1 sibling, 1 reply; 8+ messages in thread From: Prabhakar @ 2025-09-01 18:30 UTC (permalink / raw) To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm Cc: linux-renesas-soc, linux-clk, linux-kernel, devicetree, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Add module and core clocks used by Ethernet Subsystem (Ethernet_SS), Ethernet MAC (GMAC), Ethernet Switch (ETHSW). Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> --- v1->v2: - Dropped an unnecessary extra line in core clocks - Sorted the module clocks in ascending order of their IDs --- drivers/clk/renesas/r9a09g077-cpg.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/clk/renesas/r9a09g077-cpg.c b/drivers/clk/renesas/r9a09g077-cpg.c index 1fdd764f9b91..8a544ef48397 100644 --- a/drivers/clk/renesas/r9a09g077-cpg.c +++ b/drivers/clk/renesas/r9a09g077-cpg.c @@ -72,7 +72,7 @@ enum rzt2h_clk_types { enum clk_ids { /* Core Clock Outputs exported to DT */ - LAST_DT_CORE_CLK = R9A09G077_USB_CLK, + LAST_DT_CORE_CLK = R9A09G077_GMAC2_PCLKAH, /* External Input Clocks */ CLK_EXTAL, @@ -166,11 +166,21 @@ static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = { DEF_DIV("CA55S", R9A09G077_CLK_CA55S, CLK_SEL_CLK_PLL0, DIVCA55S, dtable_1_2), DEF_FIXED("PCLKGPTL", R9A09G077_CLK_PCLKGPTL, CLK_SEL_CLK_PLL1, 2, 1), + DEF_FIXED("PCLKH", R9A09G077_CLK_PCLKH, CLK_SEL_CLK_PLL1, 4, 1), DEF_FIXED("PCLKM", R9A09G077_CLK_PCLKM, CLK_SEL_CLK_PLL1, 8, 1), DEF_FIXED("PCLKL", R9A09G077_CLK_PCLKL, CLK_SEL_CLK_PLL1, 16, 1), + DEF_FIXED("PCLKAH", R9A09G077_CLK_PCLKAH, CLK_PLL4D1, 6, 1), DEF_FIXED("PCLKAM", R9A09G077_CLK_PCLKAM, CLK_PLL4D1, 12, 1), DEF_FIXED("SDHI_CLKHS", R9A09G077_SDHI_CLKHS, CLK_SEL_CLK_PLL2, 1, 1), DEF_FIXED("USB_CLK", R9A09G077_USB_CLK, CLK_PLL4D1, 48, 1), + DEF_FIXED("ETCLKA", R9A09G077_ETCLKA, CLK_SEL_CLK_PLL1, 5, 1), + DEF_FIXED("ETCLKB", R9A09G077_ETCLKB, CLK_SEL_CLK_PLL1, 8, 1), + DEF_FIXED("ETCLKC", R9A09G077_ETCLKC, CLK_SEL_CLK_PLL1, 10, 1), + DEF_FIXED("ETCLKD", R9A09G077_ETCLKD, CLK_SEL_CLK_PLL1, 20, 1), + DEF_FIXED("ETCLKE", R9A09G077_ETCLKE, CLK_SEL_CLK_PLL1, 40, 1), + DEF_FIXED("GMAC0_PCLKH", R9A09G077_GMAC0_PCLKH, R9A09G077_CLK_PCLKH, 1, 1), + DEF_FIXED("GMAC1_PCLKH", R9A09G077_GMAC1_PCLKAH, R9A09G077_CLK_PCLKAH, 1, 1), + DEF_FIXED("GMAC2_PCLKH", R9A09G077_GMAC2_PCLKAH, R9A09G077_CLK_PCLKAH, 1, 1), }; static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = { @@ -181,7 +191,12 @@ static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = { DEF_MOD("sci4fck", 12, CLK_SCI4ASYNC), DEF_MOD("iic0", 100, R9A09G077_CLK_PCLKL), DEF_MOD("iic1", 101, R9A09G077_CLK_PCLKL), + DEF_MOD("gmac0", 400, R9A09G077_CLK_PCLKM), + DEF_MOD("ethsw", 401, R9A09G077_CLK_PCLKM), + DEF_MOD("ethss", 403, R9A09G077_CLK_PCLKM), DEF_MOD("usb", 408, R9A09G077_CLK_PCLKAM), + DEF_MOD("gmac1", 416, R9A09G077_CLK_PCLKAM), + DEF_MOD("gmac2", 417, R9A09G077_CLK_PCLKAM), DEF_MOD("sci5fck", 600, CLK_SCI5ASYNC), DEF_MOD("iic2", 601, R9A09G077_CLK_PCLKL), DEF_MOD("sdhi0", 1212, R9A09G077_CLK_PCLKAM), -- 2.51.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] clk: renesas: r9a09g077: Add Ethernet Subsystem core and module clocks 2025-09-01 18:30 ` [PATCH v2 2/2] clk: renesas: r9a09g077: Add Ethernet Subsystem core and module clocks Prabhakar @ 2025-09-02 13:01 ` Geert Uytterhoeven 2025-09-02 15:05 ` Lad, Prabhakar 0 siblings, 1 reply; 8+ messages in thread From: Geert Uytterhoeven @ 2025-09-02 13:01 UTC (permalink / raw) To: Prabhakar Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, linux-renesas-soc, linux-clk, linux-kernel, devicetree, Biju Das, Fabrizio Castro, Lad Prabhakar Hi Prabhakar, On Mon, 1 Sept 2025 at 20:30, Prabhakar <prabhakar.csengg@gmail.com> wrote: > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Add module and core clocks used by Ethernet Subsystem (Ethernet_SS), > Ethernet MAC (GMAC), Ethernet Switch (ETHSW). > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Thanks for your patch! > --- a/drivers/clk/renesas/r9a09g077-cpg.c > +++ b/drivers/clk/renesas/r9a09g077-cpg.c > @@ -72,7 +72,7 @@ enum rzt2h_clk_types { > > enum clk_ids { > /* Core Clock Outputs exported to DT */ > - LAST_DT_CORE_CLK = R9A09G077_USB_CLK, > + LAST_DT_CORE_CLK = R9A09G077_GMAC2_PCLKAH, > > /* External Input Clocks */ > CLK_EXTAL, > @@ -166,11 +166,21 @@ static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = { > DEF_DIV("CA55S", R9A09G077_CLK_CA55S, CLK_SEL_CLK_PLL0, DIVCA55S, > dtable_1_2), > DEF_FIXED("PCLKGPTL", R9A09G077_CLK_PCLKGPTL, CLK_SEL_CLK_PLL1, 2, 1), > + DEF_FIXED("PCLKH", R9A09G077_CLK_PCLKH, CLK_SEL_CLK_PLL1, 4, 1), > DEF_FIXED("PCLKM", R9A09G077_CLK_PCLKM, CLK_SEL_CLK_PLL1, 8, 1), > DEF_FIXED("PCLKL", R9A09G077_CLK_PCLKL, CLK_SEL_CLK_PLL1, 16, 1), > + DEF_FIXED("PCLKAH", R9A09G077_CLK_PCLKAH, CLK_PLL4D1, 6, 1), > DEF_FIXED("PCLKAM", R9A09G077_CLK_PCLKAM, CLK_PLL4D1, 12, 1), > DEF_FIXED("SDHI_CLKHS", R9A09G077_SDHI_CLKHS, CLK_SEL_CLK_PLL2, 1, 1), > DEF_FIXED("USB_CLK", R9A09G077_USB_CLK, CLK_PLL4D1, 48, 1), > + DEF_FIXED("ETCLKA", R9A09G077_ETCLKA, CLK_SEL_CLK_PLL1, 5, 1), > + DEF_FIXED("ETCLKB", R9A09G077_ETCLKB, CLK_SEL_CLK_PLL1, 8, 1), > + DEF_FIXED("ETCLKC", R9A09G077_ETCLKC, CLK_SEL_CLK_PLL1, 10, 1), > + DEF_FIXED("ETCLKD", R9A09G077_ETCLKD, CLK_SEL_CLK_PLL1, 20, 1), > + DEF_FIXED("ETCLKE", R9A09G077_ETCLKE, CLK_SEL_CLK_PLL1, 40, 1), > + DEF_FIXED("GMAC0_PCLKH", R9A09G077_GMAC0_PCLKH, R9A09G077_CLK_PCLKH, 1, 1), > + DEF_FIXED("GMAC1_PCLKH", R9A09G077_GMAC1_PCLKAH, R9A09G077_CLK_PCLKAH, 1, 1), > + DEF_FIXED("GMAC2_PCLKH", R9A09G077_GMAC2_PCLKAH, R9A09G077_CLK_PCLKAH, 1, 1), Do you need these? I can't seem to find them in the documentation, so they are not just for aiding the casual reader. As their multipliers/dividers are 1/1, you can just use R9A09G077_CLK_PCLKH resp. R9A09G077_CLK_PCLKAH in the DTS? > }; > > static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = { > @@ -181,7 +191,12 @@ static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = { > DEF_MOD("sci4fck", 12, CLK_SCI4ASYNC), > DEF_MOD("iic0", 100, R9A09G077_CLK_PCLKL), > DEF_MOD("iic1", 101, R9A09G077_CLK_PCLKL), > + DEF_MOD("gmac0", 400, R9A09G077_CLK_PCLKM), > + DEF_MOD("ethsw", 401, R9A09G077_CLK_PCLKM), According to Table 7.13 ("Overview of Clock Generation Circuit Specifications (Internal Clock)"), ETCLKA is used as the operating clock for ETHSW? > + DEF_MOD("ethss", 403, R9A09G077_CLK_PCLKM), > DEF_MOD("usb", 408, R9A09G077_CLK_PCLKAM), > + DEF_MOD("gmac1", 416, R9A09G077_CLK_PCLKAM), > + DEF_MOD("gmac2", 417, R9A09G077_CLK_PCLKAM), > DEF_MOD("sci5fck", 600, CLK_SCI5ASYNC), > DEF_MOD("iic2", 601, R9A09G077_CLK_PCLKL), > DEF_MOD("sdhi0", 1212, R9A09G077_CLK_PCLKAM), The rest LGTM. But as the full wiring is not clear to me, I guess I'll have to wait for the DTS... 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] 8+ messages in thread
* Re: [PATCH v2 2/2] clk: renesas: r9a09g077: Add Ethernet Subsystem core and module clocks 2025-09-02 13:01 ` Geert Uytterhoeven @ 2025-09-02 15:05 ` Lad, Prabhakar 2025-09-03 9:03 ` Geert Uytterhoeven 0 siblings, 1 reply; 8+ messages in thread From: Lad, Prabhakar @ 2025-09-02 15:05 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, linux-renesas-soc, linux-clk, linux-kernel, devicetree, Biju Das, Fabrizio Castro, Lad Prabhakar Hi Geert, Thank you for the review. On Tue, Sep 2, 2025 at 2:01 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Hi Prabhakar, > > On Mon, 1 Sept 2025 at 20:30, Prabhakar <prabhakar.csengg@gmail.com> wrote: > > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > > > Add module and core clocks used by Ethernet Subsystem (Ethernet_SS), > > Ethernet MAC (GMAC), Ethernet Switch (ETHSW). > > > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Thanks for your patch! > > > --- a/drivers/clk/renesas/r9a09g077-cpg.c > > +++ b/drivers/clk/renesas/r9a09g077-cpg.c > > @@ -72,7 +72,7 @@ enum rzt2h_clk_types { > > > > enum clk_ids { > > /* Core Clock Outputs exported to DT */ > > - LAST_DT_CORE_CLK = R9A09G077_USB_CLK, > > + LAST_DT_CORE_CLK = R9A09G077_GMAC2_PCLKAH, > > > > /* External Input Clocks */ > > CLK_EXTAL, > > @@ -166,11 +166,21 @@ static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = { > > DEF_DIV("CA55S", R9A09G077_CLK_CA55S, CLK_SEL_CLK_PLL0, DIVCA55S, > > dtable_1_2), > > DEF_FIXED("PCLKGPTL", R9A09G077_CLK_PCLKGPTL, CLK_SEL_CLK_PLL1, 2, 1), > > + DEF_FIXED("PCLKH", R9A09G077_CLK_PCLKH, CLK_SEL_CLK_PLL1, 4, 1), > > DEF_FIXED("PCLKM", R9A09G077_CLK_PCLKM, CLK_SEL_CLK_PLL1, 8, 1), > > DEF_FIXED("PCLKL", R9A09G077_CLK_PCLKL, CLK_SEL_CLK_PLL1, 16, 1), > > + DEF_FIXED("PCLKAH", R9A09G077_CLK_PCLKAH, CLK_PLL4D1, 6, 1), > > DEF_FIXED("PCLKAM", R9A09G077_CLK_PCLKAM, CLK_PLL4D1, 12, 1), > > DEF_FIXED("SDHI_CLKHS", R9A09G077_SDHI_CLKHS, CLK_SEL_CLK_PLL2, 1, 1), > > DEF_FIXED("USB_CLK", R9A09G077_USB_CLK, CLK_PLL4D1, 48, 1), > > + DEF_FIXED("ETCLKA", R9A09G077_ETCLKA, CLK_SEL_CLK_PLL1, 5, 1), > > + DEF_FIXED("ETCLKB", R9A09G077_ETCLKB, CLK_SEL_CLK_PLL1, 8, 1), > > + DEF_FIXED("ETCLKC", R9A09G077_ETCLKC, CLK_SEL_CLK_PLL1, 10, 1), > > + DEF_FIXED("ETCLKD", R9A09G077_ETCLKD, CLK_SEL_CLK_PLL1, 20, 1), > > + DEF_FIXED("ETCLKE", R9A09G077_ETCLKE, CLK_SEL_CLK_PLL1, 40, 1), > > + DEF_FIXED("GMAC0_PCLKH", R9A09G077_GMAC0_PCLKH, R9A09G077_CLK_PCLKH, 1, 1), > > + DEF_FIXED("GMAC1_PCLKH", R9A09G077_GMAC1_PCLKAH, R9A09G077_CLK_PCLKAH, 1, 1), > > + DEF_FIXED("GMAC2_PCLKH", R9A09G077_GMAC2_PCLKAH, R9A09G077_CLK_PCLKAH, 1, 1), > > Do you need these? I can't seem to find them in the documentation, > so they are not just for aiding the casual reader. As their > multipliers/dividers are 1/1, you can just use R9A09G077_CLK_PCLKH > resp. R9A09G077_CLK_PCLKAH in the DTS? > Agreed, we can get rid of these and just use R9A09G077_CLK_PCLK{A}H in the SoC DTSI. > > }; > > > > static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = { > > @@ -181,7 +191,12 @@ static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = { > > DEF_MOD("sci4fck", 12, CLK_SCI4ASYNC), > > DEF_MOD("iic0", 100, R9A09G077_CLK_PCLKL), > > DEF_MOD("iic1", 101, R9A09G077_CLK_PCLKL), > > + DEF_MOD("gmac0", 400, R9A09G077_CLK_PCLKM), > > + DEF_MOD("ethsw", 401, R9A09G077_CLK_PCLKM), > > According to Table 7.13 ("Overview of Clock Generation Circuit > Specifications (Internal Clock)"), ETCLKA is used as the operating > clock for ETHSW? > There are 3 clock inputs to ETHSW, - PCLKM - bus clock - ETCLKA - operating clock - ETCLKB - Ts clock Based on Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml we have two clocks for RZ/N1 (Ts clock is missing) - description: AHB clock used for the switch register interface - description: Switch system clock - const: hclk - const: clk So I was treating, - hclk -> PCLKM, - clk -> ETCLKA - ts -> ETCLKB Since pclkm is used for register access, I added this entry to the r9a09g077_mod_clks array as I was under the impression the clocks used for reg access need to go into this array. > > + DEF_MOD("ethss", 403, R9A09G077_CLK_PCLKM), > > DEF_MOD("usb", 408, R9A09G077_CLK_PCLKAM), > > + DEF_MOD("gmac1", 416, R9A09G077_CLK_PCLKAM), > > + DEF_MOD("gmac2", 417, R9A09G077_CLK_PCLKAM), > > DEF_MOD("sci5fck", 600, CLK_SCI5ASYNC), > > DEF_MOD("iic2", 601, R9A09G077_CLK_PCLKL), > > DEF_MOD("sdhi0", 1212, R9A09G077_CLK_PCLKAM), > > The rest LGTM. But as the full wiring is not clear to me, I guess > I'll have to wait for the DTS... > I'll soon post the Ethernet enabling patches. Cheers, Prabhakar ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] clk: renesas: r9a09g077: Add Ethernet Subsystem core and module clocks 2025-09-02 15:05 ` Lad, Prabhakar @ 2025-09-03 9:03 ` Geert Uytterhoeven 0 siblings, 0 replies; 8+ messages in thread From: Geert Uytterhoeven @ 2025-09-03 9:03 UTC (permalink / raw) To: Lad, Prabhakar Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm, linux-renesas-soc, linux-clk, linux-kernel, devicetree, Biju Das, Fabrizio Castro, Lad Prabhakar Hi Prabhakar, On Tue, 2 Sept 2025 at 17:06, Lad, Prabhakar <prabhakar.csengg@gmail.com> wrote: > On Tue, Sep 2, 2025 at 2:01 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > On Mon, 1 Sept 2025 at 20:30, Prabhakar <prabhakar.csengg@gmail.com> wrote: > > > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > > > > > Add module and core clocks used by Ethernet Subsystem (Ethernet_SS), > > > Ethernet MAC (GMAC), Ethernet Switch (ETHSW). > > > > > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > > > > --- a/drivers/clk/renesas/r9a09g077-cpg.c > > > +++ b/drivers/clk/renesas/r9a09g077-cpg.c > > > @@ -181,7 +191,12 @@ static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = { > > > DEF_MOD("sci4fck", 12, CLK_SCI4ASYNC), > > > DEF_MOD("iic0", 100, R9A09G077_CLK_PCLKL), > > > DEF_MOD("iic1", 101, R9A09G077_CLK_PCLKL), > > > + DEF_MOD("gmac0", 400, R9A09G077_CLK_PCLKM), > > > + DEF_MOD("ethsw", 401, R9A09G077_CLK_PCLKM), > > > > According to Table 7.13 ("Overview of Clock Generation Circuit > > Specifications (Internal Clock)"), ETCLKA is used as the operating > > clock for ETHSW? > > > There are 3 clock inputs to ETHSW, > - PCLKM - bus clock > - ETCLKA - operating clock > - ETCLKB - Ts clock > > Based on Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml > we have two clocks for RZ/N1 (Ts clock is missing) > - description: AHB clock used for the switch register interface > - description: Switch system clock > > - const: hclk > - const: clk > > So I was treating, > - hclk -> PCLKM, > - clk -> ETCLKA > - ts -> ETCLKB > > Since pclkm is used for register access, I added this entry to the > r9a09g077_mod_clks array as I was under the impression the clocks used > for reg access need to go into this array. OK, thanks for the explanation! 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] 8+ messages in thread
end of thread, other threads:[~2025-09-03 9:04 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-09-01 18:29 [PATCH v2 0/2] Add Ethernet and GMAC clocks for Renesas RZ/{T2H, N2H} SoCs Prabhakar 2025-09-01 18:29 ` [PATCH v2 1/2] dt-bindings: clock: renesas,r9a09g077/87: Add Ethernet and GMAC clocks Prabhakar 2025-09-02 13:02 ` Geert Uytterhoeven 2025-09-02 15:37 ` Lad, Prabhakar 2025-09-01 18:30 ` [PATCH v2 2/2] clk: renesas: r9a09g077: Add Ethernet Subsystem core and module clocks Prabhakar 2025-09-02 13:01 ` Geert Uytterhoeven 2025-09-02 15:05 ` Lad, Prabhakar 2025-09-03 9:03 ` Geert Uytterhoeven
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).