Message ID | 20250407165202.197570-10-prabhakar.mahadev-lad.rj@bp.renesas.com (mailing list archive) |
---|---|
State | New |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | clk: renesas: rzv2h: Add clock and reset entries for USB2 and GBETH | expand |
Hi Prabhakar, On Mon, 7 Apr 2025 at 18:52, Prabhakar <prabhakar.csengg@gmail.com> wrote: > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Add clock and reset entries for GBETH instances. Include core clocks for > PTP, sourced from PLLETH, and add PLLs, dividers, and static mux clocks > used as clock sources for the GBETH IP. > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Thanks for your patch! > --- a/drivers/clk/renesas/r9a09g057-cpg.c > +++ b/drivers/clk/renesas/r9a09g057-cpg.c > @@ -78,6 +87,19 @@ static const struct clk_div_table dtable_2_64[] = { > {0, 0}, > }; > > +static const struct clk_div_table dtable_2_100[] = { > + {0, 2}, > + {1, 10}, > + {2, 100}, > + {0, 0}, > +}; > + > +/* Mux clock tables */ > +static const char * const smux2_gbe0_rxclk[] = { ".plleth_gbe0", "et0-rxc-rxclk" }; > +static const char * const smux2_gbe0_txclk[] = { ".plleth_gbe0", "et0-txc-txclk" }; > +static const char * const smux2_gbe1_rxclk[] = { ".plleth_gbe1", "et1-rxc-rxclk" }; > +static const char * const smux2_gbe1_txclk[] = { ".plleth_gbe1", "et1-txc-txclk" }; The "et[01]-[rt]xc-[rt]xclk" clocks are not created by this driver. IIUIC, they are actually Ethernet PHY signals. How is this supposed to work? The rest LGTM. 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
Hi Prabhakar, On Mon, 7 Apr 2025 at 18:52, Prabhakar <prabhakar.csengg@gmail.com> wrote: > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Add clock and reset entries for GBETH instances. Include core clocks for > PTP, sourced from PLLETH, and add PLLs, dividers, and static mux clocks > used as clock sources for the GBETH IP. > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > --- > drivers/clk/renesas/r9a09g057-cpg.c | 72 +++++++++++++++++++++++++++++ > drivers/clk/renesas/rzv2h-cpg.h | 11 +++++ > 2 files changed, 83 insertions(+) > > diff --git a/drivers/clk/renesas/r9a09g057-cpg.c b/drivers/clk/renesas/r9a09g057-cpg.c > index 3c40e36259fe..057bfa0e2a57 100644 > --- a/drivers/clk/renesas/r9a09g057-cpg.c > +++ b/drivers/clk/renesas/r9a09g057-cpg.c > @@ -115,6 +138,17 @@ static const struct cpg_core_clk r9a09g057_core_clks[] __initconst = { > DEF_DDIV(".pllvdo_cru2", CLK_PLLVDO_CRU2, CLK_PLLVDO, CDDIV4_DIVCTL1, dtable_2_4), > DEF_DDIV(".pllvdo_cru3", CLK_PLLVDO_CRU3, CLK_PLLVDO, CDDIV4_DIVCTL2, dtable_2_4), > > + DEF_FIXED(".plleth_250_fix", CLK_PLLETH_DIV_250_FIX, CLK_PLLETH, 1, 4), > + DEF_FIXED(".plleth_125_fix", CLK_PLLETH_DIV_125_FIX, CLK_PLLETH_DIV_250_FIX, 1, 2), > + DEF_CSDIV(".plleth_gbe0", CLK_CSDIV_PLLETH_GBE0, > + CLK_PLLETH_DIV_250_FIX, CSDIV0_DIVCTL0, dtable_2_100), > + DEF_CSDIV(".plleth_gbe1", CLK_CSDIV_PLLETH_GBE1, > + CLK_PLLETH_DIV_250_FIX, CSDIV0_DIVCTL1, dtable_2_100), > + DEF_SMUX(".smux2_gbe0_txclk", CLK_SMUX2_GBE0_TXCLK, SSEL0_SELCTL2, smux2_gbe0_txclk), > + DEF_SMUX(".smux2_gbe0_rxclk", CLK_SMUX2_GBE0_RXCLK, SSEL0_SELCTL3, smux2_gbe0_rxclk), > + DEF_SMUX(".smux2_gbe1_txclk", CLK_SMUX2_GBE1_TXCLK, SSEL1_SELCTL0, smux2_gbe1_txclk), > + DEF_SMUX(".smux2_gbe1_rxclk", CLK_SMUX2_GBE1_RXCLK, SSEL1_SELCTL1, smux2_gbe1_rxclk), > + > DEF_DDIV(".pllgpu_gear", CLK_PLLGPU_GEAR, CLK_PLLGPU, CDDIV3_DIVCTL1, dtable_2_64), > > /* Core Clocks */ > @@ -233,6 +271,38 @@ static const struct rzv2h_mod_clk r9a09g057_mod_clks[] __initconst = { > BUS_MSTOP(7, BIT(10))), > DEF_MOD("usb2_0_pclk_usbtst1", CLK_PLLDTY_ACPU_DIV4, 11, 7, 5, 23, > BUS_MSTOP(7, BIT(11))), > + DEF_MOD_EXTERNAL("gbeth_0_clk_tx_i", CLK_SMUX2_GBE0_TXCLK, 11, 8, 5, 24, > + BUS_MSTOP(8, BIT(5)), > + 0x300, 8, 1), CPG_SSEL0 I'm wondering if you really have to store and duplicate this info here. Can't you infer it from the parent's smux description? > + DEF_MOD_EXTERNAL("gbeth_0_clk_rx_i", CLK_SMUX2_GBE0_RXCLK, 11, 9, 5, 25, > + BUS_MSTOP(8, BIT(5)), > + 0x300, 12, 1), > + DEF_MOD_EXTERNAL("gbeth_0_clk_tx_180_i", CLK_SMUX2_GBE0_TXCLK, 11, 10, 5, 26, > + BUS_MSTOP(8, BIT(5)), > + 0x300, 8, 1), > + DEF_MOD_EXTERNAL("gbeth_0_clk_rx_180_i", CLK_SMUX2_GBE0_RXCLK, 11, 11, 5, 27, > + BUS_MSTOP(8, BIT(5)), > + 0x300, 12, 1), > + DEF_MOD("gbeth_0_aclk_csr_i", CLK_PLLDTY_DIV8, 11, 12, 5, 28, > + BUS_MSTOP(8, BIT(5))), > + DEF_MOD("gbeth_0_aclk_i", CLK_PLLDTY_DIV8, 11, 13, 5, 29, > + BUS_MSTOP(8, BIT(5))), > + DEF_MOD_EXTERNAL("gbeth_1_clk_tx_i", CLK_SMUX2_GBE1_TXCLK, 11, 14, 5, 30, > + BUS_MSTOP(8, BIT(6)), > + 0x304, 8, 1), CPG_SSEL0 > + DEF_MOD_EXTERNAL("gbeth_1_clk_rx_i", CLK_SMUX2_GBE1_RXCLK, 11, 15, 5, 31, > + BUS_MSTOP(8, BIT(6)), > + 0x304, 12, 1), > + DEF_MOD_EXTERNAL("gbeth_1_clk_tx_180_i", CLK_SMUX2_GBE1_TXCLK, 12, 0, 6, 0, > + BUS_MSTOP(8, BIT(6)), > + 0x304, 8, 1), > + DEF_MOD_EXTERNAL("gbeth_1_clk_rx_180_i", CLK_SMUX2_GBE1_RXCLK, 12, 1, 6, 1, > + BUS_MSTOP(8, BIT(6)), > + 0x304, 12, 1), > + DEF_MOD("gbeth_1_aclk_csr_i", CLK_PLLDTY_DIV8, 12, 2, 6, 2, > + BUS_MSTOP(8, BIT(6))), > + DEF_MOD("gbeth_1_aclk_i", CLK_PLLDTY_DIV8, 12, 3, 6, 3, > + BUS_MSTOP(8, BIT(6))), > DEF_MOD("cru_0_aclk", CLK_PLLDTY_ACPU_DIV2, 13, 2, 6, 18, > BUS_MSTOP(9, BIT(4))), > DEF_MOD_NO_PM("cru_0_vclk", CLK_PLLVDO_CRU0, 13, 3, 6, 19, > @@ -304,6 +374,8 @@ static const struct rzv2h_reset r9a09g057_resets[] __initconst = { > DEF_RST(10, 13, 4, 30), /* USB2_0_U2H1_HRESETN */ > DEF_RST(10, 14, 4, 31), /* USB2_0_U2P_EXL_SYSRST */ > DEF_RST(10, 15, 5, 0), /* USB2_0_PRESETN */ > + DEF_RST(11, 0, 5, 1), /* GBETH_0_ARESETN_I */ > + DEF_RST(11, 1, 5, 2), /* GBETH_1_ARESETN_I */ > DEF_RST(12, 5, 5, 22), /* CRU_0_PRESETN */ > DEF_RST(12, 6, 5, 23), /* CRU_0_ARESETN */ > DEF_RST(12, 7, 5, 24), /* CRU_0_S_RESETN */ > diff --git a/drivers/clk/renesas/rzv2h-cpg.h b/drivers/clk/renesas/rzv2h-cpg.h > index c64cfead6dc1..e730179d92aa 100644 > --- a/drivers/clk/renesas/rzv2h-cpg.h > +++ b/drivers/clk/renesas/rzv2h-cpg.h > @@ -93,10 +93,13 @@ struct smuxed { > .width = (_width), \ > }) > > +#define CPG_SSEL0 (0x300) > +#define CPG_SSEL1 (0x304) > #define CPG_CDDIV0 (0x400) > #define CPG_CDDIV1 (0x404) > #define CPG_CDDIV3 (0x40C) > #define CPG_CDDIV4 (0x410) > +#define CPG_CSDIV0 (0x500) > > #define CDDIV0_DIVCTL1 DDIV_PACK(CPG_CDDIV0, 4, 3, 1) > #define CDDIV0_DIVCTL2 DDIV_PACK(CPG_CDDIV0, 8, 3, 2) > @@ -111,6 +114,14 @@ struct smuxed { > #define CDDIV4_DIVCTL1 DDIV_PACK(CPG_CDDIV4, 4, 1, 17) > #define CDDIV4_DIVCTL2 DDIV_PACK(CPG_CDDIV4, 8, 1, 18) > > +#define CSDIV0_DIVCTL0 DDIV_PACK(CPG_CSDIV0, 0, 2, CSDIV_NO_MON) > +#define CSDIV0_DIVCTL1 DDIV_PACK(CPG_CSDIV0, 4, 2, CSDIV_NO_MON) > + > +#define SSEL0_SELCTL2 SMUX_PACK(CPG_SSEL0, 8, 1) > +#define SSEL0_SELCTL3 SMUX_PACK(CPG_SSEL0, 12, 1) > +#define SSEL1_SELCTL0 SMUX_PACK(CPG_SSEL1, 0, 1) > +#define SSEL1_SELCTL1 SMUX_PACK(CPG_SSEL1, 4, 1) > + > #define BUS_MSTOP_IDX_MASK GENMASK(31, 16) > #define BUS_MSTOP_BITS_MASK GENMASK(15, 0) > #define BUS_MSTOP(idx, mask) (FIELD_PREP_CONST(BUS_MSTOP_IDX_MASK, (idx)) | \ Gr{oetje,eeting}s, Geert
Hi Geert, Thank you for the review. On Tue, Apr 15, 2025 at 3:37 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Hi Prabhakar, > > On Mon, 7 Apr 2025 at 18:52, Prabhakar <prabhakar.csengg@gmail.com> wrote: > > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > > > Add clock and reset entries for GBETH instances. Include core clocks for > > PTP, sourced from PLLETH, and add PLLs, dividers, and static mux clocks > > used as clock sources for the GBETH IP. > > > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Thanks for your patch! > > > --- a/drivers/clk/renesas/r9a09g057-cpg.c > > +++ b/drivers/clk/renesas/r9a09g057-cpg.c > > > @@ -78,6 +87,19 @@ static const struct clk_div_table dtable_2_64[] = { > > {0, 0}, > > }; > > > > +static const struct clk_div_table dtable_2_100[] = { > > + {0, 2}, > > + {1, 10}, > > + {2, 100}, > > + {0, 0}, > > +}; > > + > > +/* Mux clock tables */ > > +static const char * const smux2_gbe0_rxclk[] = { ".plleth_gbe0", "et0-rxc-rxclk" }; > > +static const char * const smux2_gbe0_txclk[] = { ".plleth_gbe0", "et0-txc-txclk" }; > > +static const char * const smux2_gbe1_rxclk[] = { ".plleth_gbe1", "et1-rxc-rxclk" }; > > +static const char * const smux2_gbe1_txclk[] = { ".plleth_gbe1", "et1-txc-txclk" }; > > The "et[01]-[rt]xc-[rt]xclk" clocks are not created by this driver. > IIUIC, they are actually Ethernet PHY signals. > How is this supposed to work? > My intention was to add support for PHY drivers to provide the clocks and hook them up accordingly. Currently, for the RX clocks, we get a rate of 0 since they are external. # cat /sys/kernel/debug/clk/clk_summary | grep eth_0 gbeth_0_clk_tx_180_i 1 1 0 125000000 0 0 50000 Y 15c30000.ethernet tx-180 gbeth_0_clk_tx_i 1 1 0 125000000 0 0 50000 Y 15c30000.ethernet tx gbeth_0_clk_ptp_ref_i 1 1 0 125000000 0 0 50000 Y 15c30000.ethernet ptp_ref gbeth_0_aclk_i 1 1 0 200000000 0 0 50000 Y 15c30000.ethernet stmmaceth gbeth_0_aclk_csr_i 1 1 0 200000000 0 0 50000 Y 15c30000.ethernet pclk gbeth_0_clk_rx_180_i 1 1 0 0 0 0 50000 Y 15c30000.ethernet rx-180 gbeth_0_clk_rx_i 1 1 0 0 0 0 50000 Y 15c30000.ethernet rx I haven’t written a prototype yet for the PHY driver to provide the clocks, but the plan is to get the initial pieces in place and then extend support for that. Is my understanding correct that the PHY should provide the clocks? Or would you suggest a different approach? Cheers, Prabhakar
Hi Prabhakar, On Tue, 15 Apr 2025 at 21:25, Lad, Prabhakar <prabhakar.csengg@gmail.com> wrote: > On Tue, Apr 15, 2025 at 3:37 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > On Mon, 7 Apr 2025 at 18:52, Prabhakar <prabhakar.csengg@gmail.com> wrote: > > > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > > > > > Add clock and reset entries for GBETH instances. Include core clocks for > > > PTP, sourced from PLLETH, and add PLLs, dividers, and static mux clocks > > > used as clock sources for the GBETH IP. > > > > > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > > > Thanks for your patch! > > > > > --- a/drivers/clk/renesas/r9a09g057-cpg.c > > > +++ b/drivers/clk/renesas/r9a09g057-cpg.c > > > > > @@ -78,6 +87,19 @@ static const struct clk_div_table dtable_2_64[] = { > > > {0, 0}, > > > }; > > > > > > +static const struct clk_div_table dtable_2_100[] = { > > > + {0, 2}, > > > + {1, 10}, > > > + {2, 100}, > > > + {0, 0}, > > > +}; > > > + > > > +/* Mux clock tables */ > > > +static const char * const smux2_gbe0_rxclk[] = { ".plleth_gbe0", "et0-rxc-rxclk" }; > > > +static const char * const smux2_gbe0_txclk[] = { ".plleth_gbe0", "et0-txc-txclk" }; > > > +static const char * const smux2_gbe1_rxclk[] = { ".plleth_gbe1", "et1-rxc-rxclk" }; > > > +static const char * const smux2_gbe1_txclk[] = { ".plleth_gbe1", "et1-txc-txclk" }; > > > > The "et[01]-[rt]xc-[rt]xclk" clocks are not created by this driver. > > IIUIC, they are actually Ethernet PHY signals. > > How is this supposed to work? > > > My intention was to add support for PHY drivers to provide the clocks > and hook them up accordingly. Currently, for the RX clocks, we get a > rate of 0 since they are external. So the link would not be provided by DT? If these clocks are inputs to the clock controller, they should be listed in the clock controller's clock{,-name}s' properties... > I haven’t written a prototype yet for the PHY driver to provide the > clocks, but the plan is to get the initial pieces in place and then > extend support for that. > > Is my understanding correct that the PHY should provide the clocks? Or > would you suggest a different approach? The Static Mux Control Registers (CPG_SSEL[01]) registers treat them as clock inputs. However, Figure 6.3-1 ("Block Diagram of the Ethernet Interface") shows the TX clocks are bidirectional, so they can be used as either inputs or outputs? On RGMII[1], RXC is an input (PHY-to-MAC), while TXC is an output (MAC-to-PHY). I'm a bit lost on how this works, and how to model and handle this... [1] https://en.wikipedia.org/wiki/Media-independent_interface#Reduced_gigabit_media-independent_interface Gr{oetje,eeting}s, Geert
diff --git a/drivers/clk/renesas/r9a09g057-cpg.c b/drivers/clk/renesas/r9a09g057-cpg.c index 3c40e36259fe..057bfa0e2a57 100644 --- a/drivers/clk/renesas/r9a09g057-cpg.c +++ b/drivers/clk/renesas/r9a09g057-cpg.c @@ -29,6 +29,7 @@ enum clk_ids { CLK_PLLDTY, CLK_PLLCA55, CLK_PLLVDO, + CLK_PLLETH, CLK_PLLGPU, /* Internal Core Clocks */ @@ -49,6 +50,14 @@ enum clk_ids { CLK_PLLVDO_CRU1, CLK_PLLVDO_CRU2, CLK_PLLVDO_CRU3, + CLK_PLLETH_DIV_250_FIX, + CLK_PLLETH_DIV_125_FIX, + CLK_CSDIV_PLLETH_GBE0, + CLK_CSDIV_PLLETH_GBE1, + CLK_SMUX2_GBE0_TXCLK, + CLK_SMUX2_GBE0_RXCLK, + CLK_SMUX2_GBE1_TXCLK, + CLK_SMUX2_GBE1_RXCLK, CLK_PLLGPU_GEAR, /* Module Clocks */ @@ -78,6 +87,19 @@ static const struct clk_div_table dtable_2_64[] = { {0, 0}, }; +static const struct clk_div_table dtable_2_100[] = { + {0, 2}, + {1, 10}, + {2, 100}, + {0, 0}, +}; + +/* Mux clock tables */ +static const char * const smux2_gbe0_rxclk[] = { ".plleth_gbe0", "et0-rxc-rxclk" }; +static const char * const smux2_gbe0_txclk[] = { ".plleth_gbe0", "et0-txc-txclk" }; +static const char * const smux2_gbe1_rxclk[] = { ".plleth_gbe1", "et1-rxc-rxclk" }; +static const char * const smux2_gbe1_txclk[] = { ".plleth_gbe1", "et1-txc-txclk" }; + static const struct cpg_core_clk r9a09g057_core_clks[] __initconst = { /* External Clock Inputs */ DEF_INPUT("audio_extal", CLK_AUDIO_EXTAL), @@ -90,6 +112,7 @@ static const struct cpg_core_clk r9a09g057_core_clks[] __initconst = { DEF_FIXED(".plldty", CLK_PLLDTY, CLK_QEXTAL, 200, 3), DEF_PLL(".pllca55", CLK_PLLCA55, CLK_QEXTAL, PLLCA55), DEF_FIXED(".pllvdo", CLK_PLLVDO, CLK_QEXTAL, 105, 2), + DEF_FIXED(".plleth", CLK_PLLETH, CLK_QEXTAL, 125, 3), DEF_PLL(".pllgpu", CLK_PLLGPU, CLK_QEXTAL, PLLGPU), /* Internal Core Clocks */ @@ -115,6 +138,17 @@ static const struct cpg_core_clk r9a09g057_core_clks[] __initconst = { DEF_DDIV(".pllvdo_cru2", CLK_PLLVDO_CRU2, CLK_PLLVDO, CDDIV4_DIVCTL1, dtable_2_4), DEF_DDIV(".pllvdo_cru3", CLK_PLLVDO_CRU3, CLK_PLLVDO, CDDIV4_DIVCTL2, dtable_2_4), + DEF_FIXED(".plleth_250_fix", CLK_PLLETH_DIV_250_FIX, CLK_PLLETH, 1, 4), + DEF_FIXED(".plleth_125_fix", CLK_PLLETH_DIV_125_FIX, CLK_PLLETH_DIV_250_FIX, 1, 2), + DEF_CSDIV(".plleth_gbe0", CLK_CSDIV_PLLETH_GBE0, + CLK_PLLETH_DIV_250_FIX, CSDIV0_DIVCTL0, dtable_2_100), + DEF_CSDIV(".plleth_gbe1", CLK_CSDIV_PLLETH_GBE1, + CLK_PLLETH_DIV_250_FIX, CSDIV0_DIVCTL1, dtable_2_100), + DEF_SMUX(".smux2_gbe0_txclk", CLK_SMUX2_GBE0_TXCLK, SSEL0_SELCTL2, smux2_gbe0_txclk), + DEF_SMUX(".smux2_gbe0_rxclk", CLK_SMUX2_GBE0_RXCLK, SSEL0_SELCTL3, smux2_gbe0_rxclk), + DEF_SMUX(".smux2_gbe1_txclk", CLK_SMUX2_GBE1_TXCLK, SSEL1_SELCTL0, smux2_gbe1_txclk), + DEF_SMUX(".smux2_gbe1_rxclk", CLK_SMUX2_GBE1_RXCLK, SSEL1_SELCTL1, smux2_gbe1_rxclk), + DEF_DDIV(".pllgpu_gear", CLK_PLLGPU_GEAR, CLK_PLLGPU, CDDIV3_DIVCTL1, dtable_2_64), /* Core Clocks */ @@ -130,6 +164,10 @@ static const struct cpg_core_clk r9a09g057_core_clks[] __initconst = { DEF_FIXED("iotop_0_shclk", R9A09G057_IOTOP_0_SHCLK, CLK_PLLCM33_DIV16, 1, 1), DEF_FIXED("usb2_0_clk_core0", R9A09G057_USB2_0_CLK_CORE0, CLK_QEXTAL, 1, 1), DEF_FIXED("usb2_0_clk_core1", R9A09G057_USB2_0_CLK_CORE1, CLK_QEXTAL, 1, 1), + DEF_FIXED("gbeth_0_clk_ptp_ref_i", R9A09G057_GBETH_0_CLK_PTP_REF_I, + CLK_PLLETH_DIV_125_FIX, 1, 1), + DEF_FIXED("gbeth_1_clk_ptp_ref_i", R9A09G057_GBETH_1_CLK_PTP_REF_I, + CLK_PLLETH_DIV_125_FIX, 1, 1), }; static const struct rzv2h_mod_clk r9a09g057_mod_clks[] __initconst = { @@ -233,6 +271,38 @@ static const struct rzv2h_mod_clk r9a09g057_mod_clks[] __initconst = { BUS_MSTOP(7, BIT(10))), DEF_MOD("usb2_0_pclk_usbtst1", CLK_PLLDTY_ACPU_DIV4, 11, 7, 5, 23, BUS_MSTOP(7, BIT(11))), + DEF_MOD_EXTERNAL("gbeth_0_clk_tx_i", CLK_SMUX2_GBE0_TXCLK, 11, 8, 5, 24, + BUS_MSTOP(8, BIT(5)), + 0x300, 8, 1), + DEF_MOD_EXTERNAL("gbeth_0_clk_rx_i", CLK_SMUX2_GBE0_RXCLK, 11, 9, 5, 25, + BUS_MSTOP(8, BIT(5)), + 0x300, 12, 1), + DEF_MOD_EXTERNAL("gbeth_0_clk_tx_180_i", CLK_SMUX2_GBE0_TXCLK, 11, 10, 5, 26, + BUS_MSTOP(8, BIT(5)), + 0x300, 8, 1), + DEF_MOD_EXTERNAL("gbeth_0_clk_rx_180_i", CLK_SMUX2_GBE0_RXCLK, 11, 11, 5, 27, + BUS_MSTOP(8, BIT(5)), + 0x300, 12, 1), + DEF_MOD("gbeth_0_aclk_csr_i", CLK_PLLDTY_DIV8, 11, 12, 5, 28, + BUS_MSTOP(8, BIT(5))), + DEF_MOD("gbeth_0_aclk_i", CLK_PLLDTY_DIV8, 11, 13, 5, 29, + BUS_MSTOP(8, BIT(5))), + DEF_MOD_EXTERNAL("gbeth_1_clk_tx_i", CLK_SMUX2_GBE1_TXCLK, 11, 14, 5, 30, + BUS_MSTOP(8, BIT(6)), + 0x304, 8, 1), + DEF_MOD_EXTERNAL("gbeth_1_clk_rx_i", CLK_SMUX2_GBE1_RXCLK, 11, 15, 5, 31, + BUS_MSTOP(8, BIT(6)), + 0x304, 12, 1), + DEF_MOD_EXTERNAL("gbeth_1_clk_tx_180_i", CLK_SMUX2_GBE1_TXCLK, 12, 0, 6, 0, + BUS_MSTOP(8, BIT(6)), + 0x304, 8, 1), + DEF_MOD_EXTERNAL("gbeth_1_clk_rx_180_i", CLK_SMUX2_GBE1_RXCLK, 12, 1, 6, 1, + BUS_MSTOP(8, BIT(6)), + 0x304, 12, 1), + DEF_MOD("gbeth_1_aclk_csr_i", CLK_PLLDTY_DIV8, 12, 2, 6, 2, + BUS_MSTOP(8, BIT(6))), + DEF_MOD("gbeth_1_aclk_i", CLK_PLLDTY_DIV8, 12, 3, 6, 3, + BUS_MSTOP(8, BIT(6))), DEF_MOD("cru_0_aclk", CLK_PLLDTY_ACPU_DIV2, 13, 2, 6, 18, BUS_MSTOP(9, BIT(4))), DEF_MOD_NO_PM("cru_0_vclk", CLK_PLLVDO_CRU0, 13, 3, 6, 19, @@ -304,6 +374,8 @@ static const struct rzv2h_reset r9a09g057_resets[] __initconst = { DEF_RST(10, 13, 4, 30), /* USB2_0_U2H1_HRESETN */ DEF_RST(10, 14, 4, 31), /* USB2_0_U2P_EXL_SYSRST */ DEF_RST(10, 15, 5, 0), /* USB2_0_PRESETN */ + DEF_RST(11, 0, 5, 1), /* GBETH_0_ARESETN_I */ + DEF_RST(11, 1, 5, 2), /* GBETH_1_ARESETN_I */ DEF_RST(12, 5, 5, 22), /* CRU_0_PRESETN */ DEF_RST(12, 6, 5, 23), /* CRU_0_ARESETN */ DEF_RST(12, 7, 5, 24), /* CRU_0_S_RESETN */ diff --git a/drivers/clk/renesas/rzv2h-cpg.h b/drivers/clk/renesas/rzv2h-cpg.h index c64cfead6dc1..e730179d92aa 100644 --- a/drivers/clk/renesas/rzv2h-cpg.h +++ b/drivers/clk/renesas/rzv2h-cpg.h @@ -93,10 +93,13 @@ struct smuxed { .width = (_width), \ }) +#define CPG_SSEL0 (0x300) +#define CPG_SSEL1 (0x304) #define CPG_CDDIV0 (0x400) #define CPG_CDDIV1 (0x404) #define CPG_CDDIV3 (0x40C) #define CPG_CDDIV4 (0x410) +#define CPG_CSDIV0 (0x500) #define CDDIV0_DIVCTL1 DDIV_PACK(CPG_CDDIV0, 4, 3, 1) #define CDDIV0_DIVCTL2 DDIV_PACK(CPG_CDDIV0, 8, 3, 2) @@ -111,6 +114,14 @@ struct smuxed { #define CDDIV4_DIVCTL1 DDIV_PACK(CPG_CDDIV4, 4, 1, 17) #define CDDIV4_DIVCTL2 DDIV_PACK(CPG_CDDIV4, 8, 1, 18) +#define CSDIV0_DIVCTL0 DDIV_PACK(CPG_CSDIV0, 0, 2, CSDIV_NO_MON) +#define CSDIV0_DIVCTL1 DDIV_PACK(CPG_CSDIV0, 4, 2, CSDIV_NO_MON) + +#define SSEL0_SELCTL2 SMUX_PACK(CPG_SSEL0, 8, 1) +#define SSEL0_SELCTL3 SMUX_PACK(CPG_SSEL0, 12, 1) +#define SSEL1_SELCTL0 SMUX_PACK(CPG_SSEL1, 0, 1) +#define SSEL1_SELCTL1 SMUX_PACK(CPG_SSEL1, 4, 1) + #define BUS_MSTOP_IDX_MASK GENMASK(31, 16) #define BUS_MSTOP_BITS_MASK GENMASK(15, 0) #define BUS_MSTOP(idx, mask) (FIELD_PREP_CONST(BUS_MSTOP_IDX_MASK, (idx)) | \