* [PATCH 1/8] clk: r9a08g045-cpg: Add clocks and resets for CAN-FD
2026-07-07 10:24 [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
@ 2026-07-07 10:24 ` Claudiu Beznea
2026-07-07 10:34 ` sashiko-bot
2026-07-09 15:45 ` Geert Uytterhoeven
2026-07-07 10:24 ` [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC Claudiu Beznea
` (7 subsequent siblings)
8 siblings, 2 replies; 18+ messages in thread
From: Claudiu Beznea @ 2026-07-07 10:24 UTC (permalink / raw)
To: mkl, mailhol, robh, krzk+dt, conor+dt, geert+renesas, magnus.damm,
mturquette, sboyd, bmasney, biju.das.jz, tu.nguyen.xg,
fabrizio.castro.jz
Cc: claudiu.beznea, linux-can, devicetree, linux-renesas-soc,
linux-kernel, linux-clk, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Renesas RZ/G3S SoC has a CAN-FD IP. Add clocks and resets for it.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
drivers/clk/renesas/r9a08g045-cpg.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/clk/renesas/r9a08g045-cpg.c b/drivers/clk/renesas/r9a08g045-cpg.c
index 624fc5e6fb24..8d28f2d02064 100644
--- a/drivers/clk/renesas/r9a08g045-cpg.c
+++ b/drivers/clk/renesas/r9a08g045-cpg.c
@@ -77,6 +77,8 @@ enum clk_ids {
CLK_SEL_PLL4,
CLK_P1_DIV2,
CLK_P3_DIV2,
+ CLK_P4,
+ CLK_P4_DIV2,
CLK_SD0_DIV4,
CLK_SD1_DIV4,
CLK_SD2_DIV4,
@@ -171,6 +173,8 @@ static const struct cpg_core_clk r9a08g045_core_clks[] __initconst = {
dtable_1_32, 0, 0, 0, NULL),
DEF_G3S_DIV("P3", R9A08G045_CLK_P3, CLK_PLL3_DIV2_4, DIVPL3C, G3S_DIVPL3C_STS,
dtable_1_32, 0, 0, 0, NULL),
+ DEF_FIXED("P4", CLK_P4, CLK_PLL2_DIV2, 1, 5),
+ DEF_FIXED("P4_DIV2", CLK_P4_DIV2, CLK_P4, 1, 2),
DEF_FIXED("P3_DIV2", CLK_P3_DIV2, R9A08G045_CLK_P3, 1, 2),
DEF_FIXED("P5", R9A08G045_CLK_P5, CLK_PLL2_DIV2, 1, 4),
DEF_FIXED("ZT", R9A08G045_CLK_ZT, CLK_PLL3_DIV2_8, 1, 1),
@@ -274,6 +278,10 @@ static const struct rzg2l_mod_clk r9a08g045_mod_clks[] = {
MSTOP(BUS_MCPU2, BIT(5))),
DEF_MOD("scif5_clk_pck", R9A08G045_SCIF5_CLK_PCK, R9A08G045_CLK_P0, 0x584, 5,
MSTOP(BUS_MCPU3, BIT(4))),
+ DEF_MOD("canfd_pclk", R9A08G045_CANFD_PCLK, CLK_P4_DIV2, 0x594, 0,
+ MSTOP(BUS_MCPU2, BIT(9))),
+ DEF_MOD("canfd_clk_ram", R9A08G045_CANFD_CLK_RAM, CLK_P4, 0x594, 1,
+ MSTOP(BUS_MCPU2, BIT(9))),
DEF_MOD("gpio_hclk", R9A08G045_GPIO_HCLK, R9A08G045_OSCCLK, 0x598, 0,
MSTOP(BUS_PERI_CPU, BIT(6))),
DEF_MOD("adc_adclk", R9A08G045_ADC_ADCLK, R9A08G045_CLK_TSU, 0x5a8, 0,
@@ -324,6 +332,8 @@ static const struct rzg2l_reset r9a08g045_resets[] = {
DEF_RST(R9A08G045_SCIF3_RST_SYSTEM_N, 0x884, 3),
DEF_RST(R9A08G045_SCIF4_RST_SYSTEM_N, 0x884, 4),
DEF_RST(R9A08G045_SCIF5_RST_SYSTEM_N, 0x884, 5),
+ DEF_RST(R9A08G045_CANFD_RSTP_N, 0x894, 0),
+ DEF_RST(R9A08G045_CANFD_RSTC_N, 0x894, 1),
DEF_RST(R9A08G045_GPIO_RSTN, 0x898, 0),
DEF_RST(R9A08G045_GPIO_PORT_RESETN, 0x898, 1),
DEF_RST(R9A08G045_GPIO_SPARE_RESETN, 0x898, 2),
--
2.43.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 1/8] clk: r9a08g045-cpg: Add clocks and resets for CAN-FD
2026-07-07 10:24 ` [PATCH 1/8] clk: r9a08g045-cpg: Add clocks and resets for CAN-FD Claudiu Beznea
@ 2026-07-07 10:34 ` sashiko-bot
2026-07-09 15:45 ` Geert Uytterhoeven
1 sibling, 0 replies; 18+ messages in thread
From: sashiko-bot @ 2026-07-07 10:34 UTC (permalink / raw)
To: Claudiu Beznea
Cc: wsa+renesas, Vincent Mailhol, robh, Marc Kleine-Budde, linux-can,
Oleksij Rempel, devicetree, Oliver Hartkopp, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The P4 core clock is registered using an internal enum ID instead of its Device Tree exported ID, rendering it inaccessible to DT consumers.
--
--- Patch [1]: [PATCH 1/8] clk: r9a08g045-cpg: Add clocks and resets for CAN-FD ---
commit 6c9b264ec67002e41ec321d8af3b04f800484a8a
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
clk: r9a08g045-cpg: Add clocks and resets for CAN-FD
Renesas RZ/G3S SoC has a CAN-FD IP. Add clocks and resets for it.
> diff --git a/drivers/clk/renesas/r9a08g045-cpg.c b/drivers/clk/renesas/r9a08g045-cpg.c
> index 1232fec913eb5..34927d1ee4639 100644
> --- a/drivers/clk/renesas/r9a08g045-cpg.c
> +++ b/drivers/clk/renesas/r9a08g045-cpg.c
> @@ -88,6 +88,8 @@ enum clk_ids {
> CLK_SEL_PLL4,
> CLK_P1_DIV2,
> CLK_P3_DIV2,
> + CLK_P4,
[Severity: High]
Should this clock be exported to the device tree instead of being added as an
internal enum?
Because CLK_P4 is defined after LAST_DT_CORE_CLK in clk_ids, it seems device
tree consumers requesting <&cpg CPG_CORE R9A08G045_CLK_P4> would fail to
probe with -ENOENT.
> + CLK_P4_DIV2,
> CLK_SD0_DIV4,
[ ... ]
> @@ -182,6 +184,8 @@ static const struct cpg_core_clk r9a08g045_core_clks[] __initconst = {
> dtable_1_32, 0, 0, 0, NULL),
> DEF_G3S_DIV("P3", R9A08G045_CLK_P3, CLK_PLL3_DIV2_4, DIVPL3C, G3S_DIVPL3C_STS,
> dtable_1_32, 0, 0, 0, NULL),
> + DEF_FIXED("P4", CLK_P4, CLK_PLL2_DIV2, 1, 5),
[Severity: High]
Looking at the surrounding definitions for P1, P2, P3, and P5 in
r9a08g045_core_clks, they all use their respective R9A08G045_CLK_* macros.
Does P4 need to be registered with the exported R9A08G045_CLK_P4 macro instead
of CLK_P4 to ensure the clock populates correctly at the intended device tree
index?
> + DEF_FIXED("P4_DIV2", CLK_P4_DIV2, CLK_P4, 1, 2),
> DEF_FIXED("P3_DIV2", CLK_P3_DIV2, R9A08G045_CLK_P3, 1, 2),
[ ... ]
> @@ -285,6 +289,10 @@ static const struct rzg2l_mod_clk r9a08g045_mod_clks[] = {
> MSTOP(BUS_MCPU2, BIT(5))),
> DEF_MOD("scif5_clk_pck", R9A08G045_SCIF5_CLK_PCK, R9A08G045_CLK_P0, 0x584, 5,
> MSTOP(BUS_MCPU3, BIT(4))),
> + DEF_MOD("canfd_pclk", R9A08G045_CANFD_PCLK, CLK_P4_DIV2, 0x594, 0,
> + MSTOP(BUS_MCPU2, BIT(9))),
> + DEF_MOD("canfd_clk_ram", R9A08G045_CANFD_CLK_RAM, CLK_P4, 0x594, 1,
[Severity: High]
If P4 is exported as R9A08G045_CLK_P4, should this module clock reference
the exported macro as its parent here in r9a08g045_mod_clks?
> + MSTOP(BUS_MCPU2, BIT(9))),
> DEF_MOD("gpio_hclk", R9A08G045_GPIO_HCLK, R9A08G045_OSCCLK, 0x598, 0,
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707102418.1646159-1-claudiu.beznea+renesas@tuxon.dev?part=1
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 1/8] clk: r9a08g045-cpg: Add clocks and resets for CAN-FD
2026-07-07 10:24 ` [PATCH 1/8] clk: r9a08g045-cpg: Add clocks and resets for CAN-FD Claudiu Beznea
2026-07-07 10:34 ` sashiko-bot
@ 2026-07-09 15:45 ` Geert Uytterhoeven
1 sibling, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2026-07-09 15:45 UTC (permalink / raw)
To: Claudiu Beznea
Cc: mkl, mailhol, robh, krzk+dt, conor+dt, magnus.damm, mturquette,
sboyd, bmasney, biju.das.jz, tu.nguyen.xg, fabrizio.castro.jz,
claudiu.beznea, linux-can, devicetree, linux-renesas-soc,
linux-kernel, linux-clk, Claudiu Beznea
On Tue, 7 Jul 2026 at 12:24, Claudiu Beznea
<claudiu.beznea+renesas@tuxon.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Renesas RZ/G3S SoC has a CAN-FD IP. Add clocks and resets for it.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v7.3.
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] 18+ messages in thread
* [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC
2026-07-07 10:24 [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
2026-07-07 10:24 ` [PATCH 1/8] clk: r9a08g045-cpg: Add clocks and resets for CAN-FD Claudiu Beznea
@ 2026-07-07 10:24 ` Claudiu Beznea
2026-07-07 10:30 ` sashiko-bot
2026-07-07 16:16 ` Conor Dooley
2026-07-07 10:24 ` [PATCH 3/8] can: rcar_canfd: Fix typos in macro names Claudiu Beznea
` (6 subsequent siblings)
8 siblings, 2 replies; 18+ messages in thread
From: Claudiu Beznea @ 2026-07-07 10:24 UTC (permalink / raw)
To: mkl, mailhol, robh, krzk+dt, conor+dt, geert+renesas, magnus.damm,
mturquette, sboyd, bmasney, biju.das.jz, tu.nguyen.xg,
fabrizio.castro.jz
Cc: claudiu.beznea, linux-can, devicetree, linux-renesas-soc,
linux-kernel, linux-clk, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The CAN FD controller found on the Renesas RZ/G3S SoC is largely compatible
with the variant present on the RZ/G3E SoC. The main differences are:
- the RZ/G3S provides only two CAN FD channels
- the RZ/G3S supports only CAN FD operation; the Channel n CAN FD
Configuration Register does not implement the bits used to select
classical CAN-only mode (bit 30) or CAN FD-only mode (bit 28);
consequently, bit 31 (CAN FD Frame Distinction Enable) of the same
register is also not implemented
- some bits in several registers (mainly reserved or status bits) are
read-write on the RZ/G3S but read-only on the RZ/G3E; their behavior is
otherwise identical: the bits read back as 0 on both SoCs and software
is allowed to write only 0 to them on the RZ/G3S
- the RZ/G3S provides 128 acceptance filters, compared to 64 on the
RZ/G3E
- the RZ/G3S can use PCLK clock as the CAN FD clock source through an
internal clock divider, while also supporting an external CAN FD clock
source
Since:
- the SoC clock generator provides to the CAN IP only the peripheral and
the RAM clocks
- when sourced from the peripheral clock, the CAN-FD clock is obtained
inside the IP itself by dividing the peripheral clock
- the assigned-clocks and assigned-clock-rates properties are specific to
the CAN-FD clock
the assigned-clocks and assigned-clock-rates properties were dropped from
the required properties list of the Renesas RZ/G3S SoC.
Add documentation for the Renesas RZ/G3S SoC.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
.../bindings/net/can/renesas,rcar-canfd.yaml | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
index b9d9dd7a7967..f8b4d3dd54af 100644
--- a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
+++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
@@ -13,6 +13,7 @@ properties:
compatible:
oneOf:
- enum:
+ - renesas,r9a08g045-canfd # RZ/G3S
- renesas,r9a09g047-canfd # RZ/G3E
- renesas,r9a09g077-canfd # RZ/T2H
@@ -185,8 +186,6 @@ required:
- clocks
- clock-names
- power-domains
- - assigned-clocks
- - assigned-clock-rates
- channel0
- channel1
@@ -198,6 +197,7 @@ allOf:
compatible:
contains:
enum:
+ - renesas,r9a08g045-canfd
- renesas,rzg2l-canfd
then:
properties:
@@ -267,6 +267,7 @@ allOf:
contains:
enum:
- renesas,r9a09g077-canfd
+ - renesas,r9a08g045-canfd
- renesas,rcar-gen3-canfd
- renesas,rzg2l-canfd
then:
@@ -330,6 +331,7 @@ allOf:
compatible:
contains:
enum:
+ - renesas,r9a08g045-canfd
- renesas,r9a09g047-canfd
- renesas,rzg2l-canfd
then:
@@ -350,6 +352,17 @@ allOf:
properties:
reset-names: false
+ - if:
+ properties:
+ compatible:
+ not:
+ contains:
+ const: renesas,r9a08g045-canfd
+ then:
+ required:
+ - assigned-clocks
+ - assigned-clock-rates
+
unevaluatedProperties: false
examples:
--
2.43.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC
2026-07-07 10:24 ` [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC Claudiu Beznea
@ 2026-07-07 10:30 ` sashiko-bot
2026-07-07 16:15 ` Conor Dooley
2026-07-07 16:16 ` Conor Dooley
1 sibling, 1 reply; 18+ messages in thread
From: sashiko-bot @ 2026-07-07 10:30 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Marc Kleine-Budde, robh, conor+dt, Oleksij Rempel,
Vincent Mailhol, linux-can, devicetree, wsa+renesas,
Oliver Hartkopp
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The schema fails to forbid the `renesas,no-can-fd` and `renesas,fd-only` properties for the RZ/G3S (`renesas,r9a08g045-canfd`) SoC, allowing unsupported hardware configurations to pass schema validation.
--
--- Patch [2]: [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC ---
commit fc07d92ff1acfa102fb8f08fa8b6ff1a0537c592
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC
This commit documents the CAN FD controller found on the Renesas RZ/G3S SoC.
It updates the bindings since the RZ/G3S provides only two channels, supports
only CAN FD operation, and does not require assigned-clocks properties.
> diff --git a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> index b9d9dd7a79676..f8b4d3dd54afc 100644
> --- a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
[ ... ]
> @@ -350,6 +352,17 @@ allOf:
> properties:
> reset-names: false
>
> + - if:
> + properties:
> + compatible:
> + not:
> + contains:
> + const: renesas,r9a08g045-canfd
> + then:
> + required:
> + - assigned-clocks
> + - assigned-clock-rates
> +
[Severity: Medium]
Since the commit message states that the RZ/G3S supports only CAN FD operation,
should the schema also explicitly forbid the renesas,no-can-fd and
renesas,fd-only properties for the renesas,r9a08g045-canfd compatible?
Without an if-then block restricting these properties to false, the schema
will incorrectly validate device trees that specify these unsupported modes.
> unevaluatedProperties: false
>
> examples:
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707102418.1646159-1-claudiu.beznea+renesas@tuxon.dev?part=2
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC
2026-07-07 10:30 ` sashiko-bot
@ 2026-07-07 16:15 ` Conor Dooley
0 siblings, 0 replies; 18+ messages in thread
From: Conor Dooley @ 2026-07-07 16:15 UTC (permalink / raw)
To: sashiko-reviews
Cc: Claudiu Beznea, Marc Kleine-Budde, robh, conor+dt, Oleksij Rempel,
Vincent Mailhol, linux-can, devicetree, wsa+renesas,
Oliver Hartkopp
[-- Attachment #1: Type: text/plain, Size: 2332 bytes --]
On Tue, Jul 07, 2026 at 10:30:39AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The schema fails to forbid the `renesas,no-can-fd` and `renesas,fd-only` properties for the RZ/G3S (`renesas,r9a08g045-canfd`) SoC, allowing unsupported hardware configurations to pass schema validation.
> --
>
> --- Patch [2]: [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC ---
> commit fc07d92ff1acfa102fb8f08fa8b6ff1a0537c592
> Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC
>
> This commit documents the CAN FD controller found on the Renesas RZ/G3S SoC.
> It updates the bindings since the RZ/G3S provides only two channels, supports
> only CAN FD operation, and does not require assigned-clocks properties.
>
> > diff --git a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> > index b9d9dd7a79676..f8b4d3dd54afc 100644
> > --- a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> > +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
>
> [ ... ]
>
> > @@ -350,6 +352,17 @@ allOf:
> > properties:
> > reset-names: false
> >
> > + - if:
> > + properties:
> > + compatible:
> > + not:
> > + contains:
> > + const: renesas,r9a08g045-canfd
> > + then:
> > + required:
> > + - assigned-clocks
> > + - assigned-clock-rates
> > +
>
> [Severity: Medium]
> Since the commit message states that the RZ/G3S supports only CAN FD operation,
> should the schema also explicitly forbid the renesas,no-can-fd and
> renesas,fd-only properties for the renesas,r9a08g045-canfd compatible?
>
> Without an if-then block restricting these properties to false, the schema
> will incorrectly validate device trees that specify these unsupported modes.
This looks like a reasonable request.
pw-bot: changes-requested
>
> > unevaluatedProperties: false
> >
> > examples:
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260707102418.1646159-1-claudiu.beznea+renesas@tuxon.dev?part=2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC
2026-07-07 10:24 ` [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC Claudiu Beznea
2026-07-07 10:30 ` sashiko-bot
@ 2026-07-07 16:16 ` Conor Dooley
1 sibling, 0 replies; 18+ messages in thread
From: Conor Dooley @ 2026-07-07 16:16 UTC (permalink / raw)
To: Claudiu Beznea
Cc: mkl, mailhol, robh, krzk+dt, conor+dt, geert+renesas, magnus.damm,
mturquette, sboyd, bmasney, biju.das.jz, tu.nguyen.xg,
fabrizio.castro.jz, claudiu.beznea, linux-can, devicetree,
linux-renesas-soc, linux-kernel, linux-clk, Claudiu Beznea
[-- Attachment #1: Type: text/plain, Size: 1928 bytes --]
On Tue, Jul 07, 2026 at 01:24:12PM +0300, Claudiu Beznea wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> The CAN FD controller found on the Renesas RZ/G3S SoC is largely compatible
> with the variant present on the RZ/G3E SoC. The main differences are:
> - the RZ/G3S provides only two CAN FD channels
> - the RZ/G3S supports only CAN FD operation; the Channel n CAN FD
> Configuration Register does not implement the bits used to select
> classical CAN-only mode (bit 30) or CAN FD-only mode (bit 28);
> consequently, bit 31 (CAN FD Frame Distinction Enable) of the same
> register is also not implemented
> - some bits in several registers (mainly reserved or status bits) are
> read-write on the RZ/G3S but read-only on the RZ/G3E; their behavior is
> otherwise identical: the bits read back as 0 on both SoCs and software
> is allowed to write only 0 to them on the RZ/G3S
> - the RZ/G3S provides 128 acceptance filters, compared to 64 on the
> RZ/G3E
> - the RZ/G3S can use PCLK clock as the CAN FD clock source through an
> internal clock divider, while also supporting an external CAN FD clock
> source
>
> Since:
> - the SoC clock generator provides to the CAN IP only the peripheral and
> the RAM clocks
> - when sourced from the peripheral clock, the CAN-FD clock is obtained
> inside the IP itself by dividing the peripheral clock
> - the assigned-clocks and assigned-clock-rates properties are specific to
> the CAN-FD clock
> the assigned-clocks and assigned-clock-rates properties were dropped from
> the required properties list of the Renesas RZ/G3S SoC.
>
> Add documentation for the Renesas RZ/G3S SoC.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
No idea if patchwork will pick up the response to Sashiko, but the thing
it raises about the fd properties seems valid.
pw-bot: changes-requested
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/8] can: rcar_canfd: Fix typos in macro names
2026-07-07 10:24 [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
2026-07-07 10:24 ` [PATCH 1/8] clk: r9a08g045-cpg: Add clocks and resets for CAN-FD Claudiu Beznea
2026-07-07 10:24 ` [PATCH 2/8] dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC Claudiu Beznea
@ 2026-07-07 10:24 ` Claudiu Beznea
2026-07-07 10:24 ` [PATCH 4/8] can: rcar_canfd: Allow the CAN FD clock to be sourced from fck Claudiu Beznea
` (5 subsequent siblings)
8 siblings, 0 replies; 18+ messages in thread
From: Claudiu Beznea @ 2026-07-07 10:24 UTC (permalink / raw)
To: mkl, mailhol, robh, krzk+dt, conor+dt, geert+renesas, magnus.damm,
mturquette, sboyd, bmasney, biju.das.jz, tu.nguyen.xg,
fabrizio.castro.jz
Cc: claudiu.beznea, linux-can, devicetree, linux-renesas-soc,
linux-kernel, linux-clk, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The bits 1..0 of the Channel n Control Register are named CHMDC (Channel
Mode select). Fix typos in macro names by replacing DMC with MDC.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
drivers/net/can/rcar/rcar_canfd.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
index 4ee108abffb8..879f31c97276 100644
--- a/drivers/net/can/rcar/rcar_canfd.c
+++ b/drivers/net/can/rcar/rcar_canfd.c
@@ -132,9 +132,9 @@
#define RCANFD_CCTR_BEIE BIT(8)
#define RCANFD_CCTR_CSLPR BIT(2)
#define RCANFD_CCTR_CHMDC_MASK (0x3)
-#define RCANFD_CCTR_CHDMC_COPM (0x0)
-#define RCANFD_CCTR_CHDMC_CRESET (0x1)
-#define RCANFD_CCTR_CHDMC_CHLT (0x2)
+#define RCANFD_CCTR_CHMDC_COPM (0x0)
+#define RCANFD_CCTR_CHMDC_CRESET (0x1)
+#define RCANFD_CCTR_CHMDC_CHLT (0x2)
/* RSCFDnCFDCmSTS / RSCFDnCmSTS */
#define RCANFD_CSTS_COMSTS BIT(7)
@@ -828,7 +828,7 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv)
rcar_canfd_update_bit(gpriv->base, RCANFD_CCTR(ch),
RCANFD_CCTR_CHMDC_MASK,
- RCANFD_CCTR_CHDMC_CRESET);
+ RCANFD_CCTR_CHMDC_CRESET);
/* Ensure Channel reset mode */
err = readl_poll_timeout((gpriv->base + RCANFD_CSTS(ch)), sts,
@@ -1504,7 +1504,7 @@ static int rcar_canfd_start(struct net_device *ndev)
/* Set channel to Operational mode */
rcar_canfd_update_bit(priv->base, RCANFD_CCTR(ch),
- RCANFD_CCTR_CHMDC_MASK, RCANFD_CCTR_CHDMC_COPM);
+ RCANFD_CCTR_CHMDC_MASK, RCANFD_CCTR_CHMDC_COPM);
/* Verify channel mode change */
err = readl_poll_timeout((priv->base + RCANFD_CSTS(ch)), sts,
@@ -1578,7 +1578,7 @@ static void rcar_canfd_stop(struct net_device *ndev)
/* Transition to channel reset mode */
rcar_canfd_update_bit(priv->base, RCANFD_CCTR(ch),
- RCANFD_CCTR_CHMDC_MASK, RCANFD_CCTR_CHDMC_CRESET);
+ RCANFD_CCTR_CHMDC_MASK, RCANFD_CCTR_CHMDC_CRESET);
/* Check Channel reset mode */
err = readl_poll_timeout((priv->base + RCANFD_CSTS(ch)), sts,
--
2.43.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 4/8] can: rcar_canfd: Allow the CAN FD clock to be sourced from fck
2026-07-07 10:24 [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
` (2 preceding siblings ...)
2026-07-07 10:24 ` [PATCH 3/8] can: rcar_canfd: Fix typos in macro names Claudiu Beznea
@ 2026-07-07 10:24 ` Claudiu Beznea
2026-07-07 10:33 ` sashiko-bot
2026-07-07 10:24 ` [PATCH 5/8] can: rcar_canfd: Do not set registers selecting the CAN mode Claudiu Beznea
` (4 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Claudiu Beznea @ 2026-07-07 10:24 UTC (permalink / raw)
To: mkl, mailhol, robh, krzk+dt, conor+dt, geert+renesas, magnus.damm,
mturquette, sboyd, bmasney, biju.das.jz, tu.nguyen.xg,
fabrizio.castro.jz
Cc: claudiu.beznea, linux-can, devicetree, linux-renesas-soc,
linux-kernel, linux-clk, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
On the Renesas RZ/G3S, the CAN FD clock can be sourced either from fck
(the peripheral clock) or from an external clock (can_clk). When fck is
used, it is divided internally by the CAN FD controller.
Adjust the existing canfd clock handling code to support the RZ/G3S CAN.
The existing struct rcar_canfd_hw_info instances were updated to address
the request in the Link discussion.
Link: https://lore.kernel.org/all/1d9719e3-10ff-4cd8-b729-55fea93c37ce@wanadoo.fr
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
drivers/net/can/rcar/rcar_canfd.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
index 879f31c97276..75512d41e3ee 100644
--- a/drivers/net/can/rcar/rcar_canfd.c
+++ b/drivers/net/can/rcar/rcar_canfd.c
@@ -444,6 +444,7 @@ struct rcar_canfd_hw_info {
unsigned ch_interface_mode:1; /* Has channel interface mode */
unsigned shared_can_regs:1; /* Has shared classical can registers */
unsigned external_clk:1; /* Has external clock */
+ unsigned fcan_pclk:1; /* Has fcan sourced from pclk. */
};
/* Channel priv data */
@@ -617,6 +618,7 @@ static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
.ch_interface_mode = 0,
.shared_can_regs = 0,
.external_clk = 1,
+ .fcan_pclk = 0,
};
static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
@@ -634,6 +636,7 @@ static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
.ch_interface_mode = 1,
.shared_can_regs = 1,
.external_clk = 1,
+ .fcan_pclk = 0,
};
static const struct rcar_canfd_hw_info rzg2l_hw_info = {
@@ -651,6 +654,7 @@ static const struct rcar_canfd_hw_info rzg2l_hw_info = {
.ch_interface_mode = 0,
.shared_can_regs = 0,
.external_clk = 1,
+ .fcan_pclk = 0,
};
static const struct rcar_canfd_hw_info r9a09g047_hw_info = {
@@ -668,6 +672,7 @@ static const struct rcar_canfd_hw_info r9a09g047_hw_info = {
.ch_interface_mode = 1,
.shared_can_regs = 1,
.external_clk = 0,
+ .fcan_pclk = 0,
};
static const struct rcar_canfd_hw_info r9a09g077_hw_info = {
@@ -685,6 +690,7 @@ static const struct rcar_canfd_hw_info r9a09g077_hw_info = {
.ch_interface_mode = 1,
.shared_can_regs = 1,
.external_clk = 1,
+ .fcan_pclk = 0,
};
/* Helper functions */
@@ -2191,13 +2197,18 @@ static int rcar_canfd_probe(struct platform_device *pdev)
*/
gpriv->can_clk = devm_clk_get(dev, "can_clk");
if (IS_ERR(gpriv->can_clk) || (clk_get_rate(gpriv->can_clk) == 0)) {
- gpriv->can_clk = devm_clk_get(dev, "canfd");
+ gpriv->can_clk = devm_clk_get_optional(dev, "canfd");
if (IS_ERR(gpriv->can_clk))
return dev_err_probe(dev, PTR_ERR(gpriv->can_clk),
"cannot get canfd clock\n");
+ if (gpriv->can_clk)
+ fcan_freq = clk_get_rate(gpriv->can_clk);
+ else if (info->fcan_pclk)
+ fcan_freq = clk_get_rate(gpriv->clkp);
+
/* CANFD clock may be further divided within the IP */
- fcan_freq = clk_get_rate(gpriv->can_clk) / info->postdiv;
+ fcan_freq /= info->postdiv;
} else {
fcan_freq = clk_get_rate(gpriv->can_clk);
gpriv->extclk = gpriv->info->external_clk;
--
2.43.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 4/8] can: rcar_canfd: Allow the CAN FD clock to be sourced from fck
2026-07-07 10:24 ` [PATCH 4/8] can: rcar_canfd: Allow the CAN FD clock to be sourced from fck Claudiu Beznea
@ 2026-07-07 10:33 ` sashiko-bot
0 siblings, 0 replies; 18+ messages in thread
From: sashiko-bot @ 2026-07-07 10:33 UTC (permalink / raw)
To: Claudiu Beznea
Cc: Vincent Mailhol, devicetree, Oleksij Rempel, conor+dt,
Marc Kleine-Budde, robh, linux-can, wsa+renesas, Oliver Hartkopp
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Uninitialized variable usage when 'canfd' clock is missing on platforms where 'fcan_pclk' is 0.
--
--- Patch [4]: [PATCH 4/8] can: rcar_canfd: Allow the CAN FD clock to be sourced from fck ---
commit 0fffa3e660d5596983dd22ee45ce4eb746f70520
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
can: rcar_canfd: Allow the CAN FD clock to be sourced from fck
This commit adjusts the CAN FD clock handling in the R-Car CAN FD driver to
allow sourcing the clock from the peripheral clock (fck) for the RZ/G3S
platform, changing the "canfd" clock lookup to be optional.
Link: https://lore.kernel.org/all/1d9719e3-10ff-4cd8-b729-55fea93c37ce@wanadoo.fr
> diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
> index b40ae5998c1da..6ec2d7a031238 100644
> --- a/drivers/net/can/rcar/rcar_canfd.c
> +++ b/drivers/net/can/rcar/rcar_canfd.c
[ ... ]
> @@ -2190,13 +2196,18 @@ static int rcar_canfd_probe(struct platform_device *pdev)
> */
> gpriv->can_clk = devm_clk_get(dev, "can_clk");
> if (IS_ERR(gpriv->can_clk) || (clk_get_rate(gpriv->can_clk) == 0)) {
> - gpriv->can_clk = devm_clk_get(dev, "canfd");
> + gpriv->can_clk = devm_clk_get_optional(dev, "canfd");
> if (IS_ERR(gpriv->can_clk))
> return dev_err_probe(dev, PTR_ERR(gpriv->can_clk),
> "cannot get canfd clock\n");
>
> + if (gpriv->can_clk)
> + fcan_freq = clk_get_rate(gpriv->can_clk);
> + else if (info->fcan_pclk)
> + fcan_freq = clk_get_rate(gpriv->clkp);
> +
[Severity: High]
Does this code leave fcan_freq uninitialized on legacy platforms if the device
tree is missing the "canfd" clock?
Because devm_clk_get_optional() returns NULL when the clock is missing,
gpriv->can_clk will be NULL. On platforms where info->fcan_pclk is 0, both
conditions in this if/else block evaluate to false.
> /* CANFD clock may be further divided within the IP */
> - fcan_freq = clk_get_rate(gpriv->can_clk) / info->postdiv;
> + fcan_freq /= info->postdiv;
If fcan_freq is uninitialized here, it will divide random stack memory and pass
that downstream to configure CAN bus bit timings. Should there be an error
returned if neither clock source is available?
> } else {
> fcan_freq = clk_get_rate(gpriv->can_clk);
> gpriv->extclk = gpriv->info->external_clk;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707102418.1646159-1-claudiu.beznea+renesas@tuxon.dev?part=4
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 5/8] can: rcar_canfd: Do not set registers selecting the CAN mode
2026-07-07 10:24 [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
` (3 preceding siblings ...)
2026-07-07 10:24 ` [PATCH 4/8] can: rcar_canfd: Allow the CAN FD clock to be sourced from fck Claudiu Beznea
@ 2026-07-07 10:24 ` Claudiu Beznea
2026-07-07 10:53 ` sashiko-bot
2026-07-07 10:24 ` [PATCH 6/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
` (3 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Claudiu Beznea @ 2026-07-07 10:24 UTC (permalink / raw)
To: mkl, mailhol, robh, krzk+dt, conor+dt, geert+renesas, magnus.damm,
mturquette, sboyd, bmasney, biju.das.jz, tu.nguyen.xg,
fabrizio.castro.jz
Cc: claudiu.beznea, linux-can, devicetree, linux-renesas-soc,
linux-kernel, linux-clk, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The bits 30 (classical CAN-only mode) and 28 (FD-only enable) of the
Channel n CAN-FD Configuration Register of the Renesas RZ/G3S SoC are not
available. The IP supports only CAN-FD mode. RZ/G3S HW manual (revision
1.30) specify the bits are read as zero and the write value should always
be zero.
Add the mode_select_na flag in struct rcar_canfd_hw_info to cover RZ/G3S
and avoid writing to unavailable bits.
The existing struct rcar_canfd_hw_info instances were updated to address
the request in the Link discussion.
Link: https://lore.kernel.org/all/1d9719e3-10ff-4cd8-b729-55fea93c37ce@wanadoo.fr
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
drivers/net/can/rcar/rcar_canfd.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
index 75512d41e3ee..9b0a67195824 100644
--- a/drivers/net/can/rcar/rcar_canfd.c
+++ b/drivers/net/can/rcar/rcar_canfd.c
@@ -445,6 +445,7 @@ struct rcar_canfd_hw_info {
unsigned shared_can_regs:1; /* Has shared classical can registers */
unsigned external_clk:1; /* Has external clock */
unsigned fcan_pclk:1; /* Has fcan sourced from pclk. */
+ unsigned mode_select_na:1; /* Has no bits for selecting the mode. */
};
/* Channel priv data */
@@ -619,6 +620,7 @@ static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
.shared_can_regs = 0,
.external_clk = 1,
.fcan_pclk = 0,
+ .mode_select_na = 0,
};
static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
@@ -637,6 +639,7 @@ static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
.shared_can_regs = 1,
.external_clk = 1,
.fcan_pclk = 0,
+ .mode_select_na = 0,
};
static const struct rcar_canfd_hw_info rzg2l_hw_info = {
@@ -655,6 +658,7 @@ static const struct rcar_canfd_hw_info rzg2l_hw_info = {
.shared_can_regs = 0,
.external_clk = 1,
.fcan_pclk = 0,
+ .mode_select_na = 0,
};
static const struct rcar_canfd_hw_info r9a09g047_hw_info = {
@@ -673,6 +677,7 @@ static const struct rcar_canfd_hw_info r9a09g047_hw_info = {
.shared_can_regs = 1,
.external_clk = 0,
.fcan_pclk = 0,
+ .mode_select_na = 0,
};
static const struct rcar_canfd_hw_info r9a09g077_hw_info = {
@@ -691,6 +696,7 @@ static const struct rcar_canfd_hw_info r9a09g077_hw_info = {
.shared_can_regs = 1,
.external_clk = 1,
.fcan_pclk = 0,
+ .mode_select_na = 0,
};
/* Helper functions */
@@ -846,6 +852,9 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv)
}
/* Set the controller into appropriate mode */
+ if (gpriv->info->mode_select_na)
+ continue;
+
if (gpriv->info->ch_interface_mode) {
/* Do not set CLOE and FDOE simultaneously */
if (!gpriv->fdmode) {
--
2.43.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 5/8] can: rcar_canfd: Do not set registers selecting the CAN mode
2026-07-07 10:24 ` [PATCH 5/8] can: rcar_canfd: Do not set registers selecting the CAN mode Claudiu Beznea
@ 2026-07-07 10:53 ` sashiko-bot
0 siblings, 0 replies; 18+ messages in thread
From: sashiko-bot @ 2026-07-07 10:53 UTC (permalink / raw)
To: Claudiu Beznea
Cc: devicetree, Oliver Hartkopp, Oleksij Rempel, linux-can, robh,
conor+dt, wsa+renesas, Marc Kleine-Budde, Vincent Mailhol
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch adds the `mode_select_na` flag to support the RZ/G3S SoC, but fails to provide the RZ/G3S hardware info structure with the flag set, rendering the logic as dead code.
--
--- Patch [5]: [PATCH 5/8] can: rcar_canfd: Do not set registers selecting the CAN mode ---
commit c89aa117ce922f6dfb13d5f51bb4146e8af1be2c
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
can: rcar_canfd: Do not set registers selecting the CAN mode
This patch adds the mode_select_na flag to struct rcar_canfd_hw_info to avoid
writing to unavailable CAN mode bits on the Renesas RZ/G3S SoC. The flag is
initialized to 0 for existing hardware structures, and a conditional check
is added in the controller reset path to skip mode selection if the flag is
set.
Link: https://lore.kernel.org/all/1d9719e3-10ff-4cd8-b729-55fea93c37ce@wanadoo.fr
> diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
> index 6ec2d7a031238..7f01afe60a4c2 100644
> --- a/drivers/net/can/rcar/rcar_canfd.c
> +++ b/drivers/net/can/rcar/rcar_canfd.c
> @@ -445,6 +445,7 @@ struct rcar_canfd_hw_info {
> unsigned shared_can_regs:1; /* Has shared classical can registers */
> unsigned external_clk:1; /* Has external clock */
> unsigned fcan_pclk:1; /* Has fcan sourced from pclk. */
> + unsigned mode_select_na:1; /* Has no bits for selecting the mode. */
> };
>
> /* Channel priv data */
[Severity: Medium]
Was the RZ/G3S hardware info structure missing from this patch series?
The commit message mentions adding this flag to cover the RZ/G3S SoC, but
all existing structures are updated to set this flag to 0, and no new
structure is added that sets it to 1.
[ ... ]
> @@ -846,6 +852,9 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv)
> }
>
> /* Set the controller into appropriate mode */
> + if (gpriv->info->mode_select_na)
> + continue;
> +
> if (gpriv->info->ch_interface_mode) {
> /* Do not set CLOE and FDOE simultaneously */
> if (!gpriv->fdmode) {
[Severity: Medium]
Since mode_select_na is never set to 1 anywhere in the driver, doesn't this
conditional evaluate to false for all devices, resulting in dead code?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707102418.1646159-1-claudiu.beznea+renesas@tuxon.dev?part=5
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 6/8] can: rcar_canfd: Add support for Renesas RZ/G3S
2026-07-07 10:24 [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
` (4 preceding siblings ...)
2026-07-07 10:24 ` [PATCH 5/8] can: rcar_canfd: Do not set registers selecting the CAN mode Claudiu Beznea
@ 2026-07-07 10:24 ` Claudiu Beznea
2026-07-07 10:49 ` sashiko-bot
2026-07-07 10:24 ` [PATCH 7/8] arm64: dts: renesas: r9a08g045: Add CAN-FD node Claudiu Beznea
` (2 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Claudiu Beznea @ 2026-07-07 10:24 UTC (permalink / raw)
To: mkl, mailhol, robh, krzk+dt, conor+dt, geert+renesas, magnus.damm,
mturquette, sboyd, bmasney, biju.das.jz, tu.nguyen.xg,
fabrizio.castro.jz
Cc: claudiu.beznea, linux-can, devicetree, linux-renesas-soc,
linux-kernel, linux-clk, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Add support for Renesas RZ/G3S
The Renesas RZ/G3S CAN-FD controller is largely compatible with the
variant found on the Renesas RZ/G3E. The main differences are:
- the RZ/G3S provides 128 acceptance filters
- the RZ/G3S supports only two channels
- the RZ/G3S supports only CAN-FD operation and does not implement the
bits used to select between classical CAN-only and CAN FD-only modes.
- the RZ/G3S includes an internal divider that allows the peripheral
clock to be used as the CAN FD clock source.
Add support for the Renesas RZ/G3S.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
drivers/net/can/rcar/rcar_canfd.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
index 9b0a67195824..bcb91fc0a35a 100644
--- a/drivers/net/can/rcar/rcar_canfd.c
+++ b/drivers/net/can/rcar/rcar_canfd.c
@@ -661,6 +661,25 @@ static const struct rcar_canfd_hw_info rzg2l_hw_info = {
.mode_select_na = 0,
};
+static const struct rcar_canfd_hw_info r9a08g045_hw_info = {
+ .nom_bittiming = &rcar_canfd_gen4_nom_bittiming_const,
+ .data_bittiming = &rcar_canfd_gen4_data_bittiming_const,
+ .tdc_const = &rcar_canfd_gen4_tdc_const,
+ .regs = &rcar_gen4_regs,
+ .sh = &rcar_gen4_shift_data,
+ .rnc_field_width = 16,
+ .max_aflpn = 127,
+ .max_cftml = 31,
+ .max_channels = 2,
+ .postdiv = 2,
+ .multi_channel_irqs = 1,
+ .ch_interface_mode = 1,
+ .shared_can_regs = 1,
+ .external_clk = 1,
+ .fcan_pclk = 1,
+ .mode_select_na = 1,
+};
+
static const struct rcar_canfd_hw_info r9a09g047_hw_info = {
.nom_bittiming = &rcar_canfd_gen4_nom_bittiming_const,
.data_bittiming = &rcar_canfd_gen4_data_bittiming_const,
@@ -2382,6 +2401,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(rcar_canfd_pm_ops, rcar_canfd_suspend,
static const __maybe_unused struct of_device_id rcar_canfd_of_table[] = {
{ .compatible = "renesas,r8a779a0-canfd", .data = &rcar_gen4_hw_info },
+ { .compatible = "renesas,r9a08g045-canfd", .data = &r9a08g045_hw_info },
{ .compatible = "renesas,r9a09g047-canfd", .data = &r9a09g047_hw_info },
{ .compatible = "renesas,r9a09g077-canfd", .data = &r9a09g077_hw_info },
{ .compatible = "renesas,rcar-gen3-canfd", .data = &rcar_gen3_hw_info },
--
2.43.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 6/8] can: rcar_canfd: Add support for Renesas RZ/G3S
2026-07-07 10:24 ` [PATCH 6/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
@ 2026-07-07 10:49 ` sashiko-bot
0 siblings, 0 replies; 18+ messages in thread
From: sashiko-bot @ 2026-07-07 10:49 UTC (permalink / raw)
To: Claudiu Beznea
Cc: robh, Marc Kleine-Budde, Vincent Mailhol, conor+dt, wsa+renesas,
Oliver Hartkopp, linux-can, devicetree, Oleksij Rempel
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Missing enforcement of CAN-FD mode when hardware does not support classical CAN mode.
- [High] The variable `fcan_freq` is used uninitialized when clock fallback branches fail.
--
--- Patch [6]: [PATCH 6/8] can: rcar_canfd: Add support for Renesas RZ/G3S ---
commit cd9e80c9be5a9e3af3e5266e74d95204fb8cf5b3
Author: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
can: rcar_canfd: Add support for Renesas RZ/G3S
This commit adds CAN-FD support for the Renesas RZ/G3S controller. It
configures the hardware info struct to reflect the controller's capabilities,
including its lack of support for classical CAN mode and its internal clock
divider.
> diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
> index 7f01afe60a4c2..6d6b2d999b782 100644
> --- a/drivers/net/can/rcar/rcar_canfd.c
> +++ b/drivers/net/can/rcar/rcar_canfd.c
> @@ -661,6 +661,25 @@ static const struct rcar_canfd_hw_info rzg2l_hw_info = {
[ ... ]
> +static const struct rcar_canfd_hw_info r9a08g045_hw_info = {
> + .nom_bittiming = &rcar_canfd_gen4_nom_bittiming_const,
> + .data_bittiming = &rcar_canfd_gen4_data_bittiming_const,
> + .tdc_const = &rcar_canfd_gen4_tdc_const,
> + .regs = &rcar_gen4_regs,
> + .sh = &rcar_gen4_shift_data,
> + .rnc_field_width = 16,
> + .max_aflpn = 127,
> + .max_cftml = 31,
> + .max_channels = 2,
> + .postdiv = 2,
> + .multi_channel_irqs = 1,
> + .ch_interface_mode = 1,
> + .shared_can_regs = 1,
> + .external_clk = 1,
> + .fcan_pclk = 1,
> + .mode_select_na = 1,
[Severity: High]
Since this hardware sets .mode_select_na = 1 because it does not support
classical CAN mode, could there be a mismatch if the device tree contains the
"renesas,no-can-fd" property?
In rcar_canfd_probe(), we set the software mode to classical CAN if this
property is present:
drivers/net/can/rcar/rcar_canfd.c:rcar_canfd_probe() {
if (of_property_read_bool(dev->of_node, "renesas,no-can-fd"))
fdmode = false; /* Classical CAN only mode */
...
}
Since the hardware configuration bits are bypassed by .mode_select_na = 1,
would this leave the hardware in CAN-FD mode while the software driver allocates
MTU and payload sizes for classical CAN frames?
[Severity: High]
While reviewing the clock configuration related to .postdiv = 2 and
.fcan_pclk = 1, I noticed a potential regression in the clock fallback logic
that might affect older platforms.
In rcar_canfd_probe(), if "can_clk" and "canfd" clocks are missing from the
device tree, devm_clk_get_optional() returns NULL instead of an error, which
skips the error path but leaves gpriv->can_clk as NULL:
drivers/net/can/rcar/rcar_canfd.c:rcar_canfd_probe() {
...
gpriv->can_clk = devm_clk_get_optional(dev, "canfd");
if (IS_ERR(gpriv->can_clk))
return dev_err_probe(...);
if (gpriv->can_clk)
fcan_freq = clk_get_rate(gpriv->can_clk);
else if (info->fcan_pclk)
fcan_freq = clk_get_rate(gpriv->clkp);
/* CANFD clock may be further divided within the IP */
fcan_freq /= info->postdiv;
...
}
If info->fcan_pclk is 0 (which is the case for Gen3/Gen4 platforms), does
this mean fcan_freq is used uninitialized when calculating the CAN bit timing?
Can this lead to unstable or non-functional CAN buses on those platforms?
> +};
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707102418.1646159-1-claudiu.beznea+renesas@tuxon.dev?part=6
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 7/8] arm64: dts: renesas: r9a08g045: Add CAN-FD node
2026-07-07 10:24 [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
` (5 preceding siblings ...)
2026-07-07 10:24 ` [PATCH 6/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
@ 2026-07-07 10:24 ` Claudiu Beznea
2026-07-07 10:24 ` [PATCH 8/8] arm64: dts: renesas: rzg3s-smarc: Enable CAN-FD Claudiu Beznea
2026-07-07 10:31 ` [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Biju Das
8 siblings, 0 replies; 18+ messages in thread
From: Claudiu Beznea @ 2026-07-07 10:24 UTC (permalink / raw)
To: mkl, mailhol, robh, krzk+dt, conor+dt, geert+renesas, magnus.damm,
mturquette, sboyd, bmasney, biju.das.jz, tu.nguyen.xg,
fabrizio.castro.jz
Cc: claudiu.beznea, linux-can, devicetree, linux-renesas-soc,
linux-kernel, linux-clk, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The Renesas RZ/G3S SoC includes a CAN-FD controller with two channels.
Add the corresponding device tree node.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi
index 3a69bb246bab..fe46f3d9c7cc 100644
--- a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi
@@ -29,6 +29,13 @@ audio_clk2: audio2-clk {
clock-frequency = <0>;
};
+ can_clk: can-clk {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ /* This value must be overridden by boards that provide it. */
+ clock-frequency = <0>;
+ };
+
cluster0_opp: opp-table-0 {
compatible = "operating-points-v2";
opp-shared;
@@ -498,6 +505,38 @@ ssi3: ssi@100a8c00 {
status = "disabled";
};
+ canfd: can@100c0000 {
+ compatible = "renesas,r9a08g045-canfd";
+ reg = <0 0x100c0000 0 0x20000>;
+ interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 380 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "g_err", "g_recc",
+ "ch0_err", "ch0_rec", "ch0_trx",
+ "ch1_err", "ch1_rec", "ch1_trx";
+ clocks = <&cpg CPG_MOD R9A08G045_CANFD_PCLK>,
+ <&cpg CPG_MOD R9A08G045_CANFD_CLK_RAM>,
+ <&can_clk>;
+ clock-names = "fck", "ram_clk", "can_clk";
+ resets = <&cpg R9A08G045_CANFD_RSTP_N>,
+ <&cpg R9A08G045_CANFD_RSTC_N>;
+ reset-names = "rstp_n", "rstc_n";
+ power-domains = <&cpg>;
+ status = "disabled";
+
+ channel0 {
+ status = "disabled";
+ };
+ channel1 {
+ status = "disabled";
+ };
+ };
+
cpg: clock-controller@11010000 {
compatible = "renesas,r9a08g045-cpg";
reg = <0 0x11010000 0 0x10000>;
--
2.43.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 8/8] arm64: dts: renesas: rzg3s-smarc: Enable CAN-FD
2026-07-07 10:24 [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
` (6 preceding siblings ...)
2026-07-07 10:24 ` [PATCH 7/8] arm64: dts: renesas: r9a08g045: Add CAN-FD node Claudiu Beznea
@ 2026-07-07 10:24 ` Claudiu Beznea
2026-07-07 10:31 ` [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Biju Das
8 siblings, 0 replies; 18+ messages in thread
From: Claudiu Beznea @ 2026-07-07 10:24 UTC (permalink / raw)
To: mkl, mailhol, robh, krzk+dt, conor+dt, geert+renesas, magnus.damm,
mturquette, sboyd, bmasney, biju.das.jz, tu.nguyen.xg,
fabrizio.castro.jz
Cc: claudiu.beznea, linux-can, devicetree, linux-renesas-soc,
linux-kernel, linux-clk, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The two CAN FD channels available on the Renesas RZ/G3S SoC are routed
through the Renesas SMARC Carrier II board when used with the Renesas
RZ/G3S SMARC Module.
The CAN transceiver on the Carrier II board has its standby pins connected
to GPIOs that are selected through the SW_GPIO_CAN_PMOD switches. By
default, these switches route the GPIOs to the PMOD interfaces.
Enable the CAN FD controller and its two available channels.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
.../boot/dts/renesas/rzg3s-smarc-switches.h | 12 +++++
arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 46 +++++++++++++++++++
2 files changed, 58 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h b/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h
index bbf908a5322c..198874ad9a65 100644
--- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h
+++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h
@@ -37,4 +37,16 @@
*/
#define SW_OPT_MUX4 SW_ON
+/*
+ * SW_GPIO_CAN_PMOD[x] switches' states:
+ * @SW_GPIO_CAN_PMOD1:
+ * SW_OFF - GPIO8 connected to CAN0_STB (position 1-2)
+ * SW_ON - GPIO8 connected to PMOD1 (position 2-3)
+ * @SW_GPIO_CAN_PMOD2:
+ * SW_OFF - GPIO9 connected to CAN1_STB (position 4-5)
+ * SW_ON - GPIO9 connected to PMOD1 (position 5-6)
+ */
+#define SW_GPIO_CAN_PMOD1 SW_ON
+#define SW_GPIO_CAN_PMOD2 SW_ON
+
#endif /* __RZG3S_SMARC_SWITCHES_H__ */
diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
index 70af605168b0..2be684f55914 100644
--- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi
@@ -68,6 +68,24 @@ codec_dai: simple-audio-card,codec {
};
};
+ can_transceiver0: can-phy0 {
+ compatible = "ti,tcan1042";
+ #phy-cells = <0>;
+ max-bitrate = <8000000>;
+#if SW_GPIO_CAN_PMOD1 == SW_OFF
+ standby-gpios = <&pinctrl RZG2L_GPIO(13, 0) GPIO_ACTIVE_HIGH>;
+#endif
+ };
+
+ can_transceiver1: can-phy1 {
+ compatible = "ti,tcan1042";
+ #phy-cells = <0>;
+ max-bitrate = <8000000>;
+#if SW_GPIO_CAN_PMOD2 == SW_OFF
+ standby-gpios = <&pinctrl RZG2L_GPIO(13, 1) GPIO_ACTIVE_HIGH>;
+#endif
+ };
+
vcc_sdhi1: regulator-vcc-sdhi1 {
compatible = "regulator-fixed";
regulator-name = "SDHI1 Vcc";
@@ -92,6 +110,22 @@ &audio_clk2 {
clock-frequency = <12288000>;
};
+&canfd {
+ pinctrl-0 = <&canfd_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+
+ channel0 {
+ phys = <&can_transceiver0>;
+ status = "okay";
+ };
+
+ channel1 {
+ phys = <&can_transceiver1>;
+ status = "okay";
+ };
+};
+
&ehci0 {
dr_mode = "otg";
status = "okay";
@@ -171,6 +205,18 @@ audio_clock_pins: audio-clock {
input-enable;
};
+ canfd_pins: canfd {
+ can0_pins: can0 {
+ pinmux = <RZG2L_PORT_PINMUX(6, 1, 3)>, /* CAN0_TX */
+ <RZG2L_PORT_PINMUX(6, 2, 3)>; /* CAN0_RX */
+ };
+
+ can1_pins: can1 {
+ pinmux = <RZG2L_PORT_PINMUX(17, 0, 3)>, /* CAN1_TX */
+ <RZG2L_PORT_PINMUX(17, 1, 3)>; /* CAN1_RX */
+ };
+ };
+
key-1-gpio-hog {
gpio-hog;
gpios = <RZG2L_GPIO(18, 0) GPIO_ACTIVE_LOW>;
--
2.43.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* RE: [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S
2026-07-07 10:24 [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S Claudiu Beznea
` (7 preceding siblings ...)
2026-07-07 10:24 ` [PATCH 8/8] arm64: dts: renesas: rzg3s-smarc: Enable CAN-FD Claudiu Beznea
@ 2026-07-07 10:31 ` Biju Das
8 siblings, 0 replies; 18+ messages in thread
From: Biju Das @ 2026-07-07 10:31 UTC (permalink / raw)
To: Claudiu Beznea, mkl@pengutronix.de, mailhol@kernel.org,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
geert+renesas@glider.be, magnus.damm, mturquette@baylibre.com,
sboyd@kernel.org, bmasney@redhat.com, Tu Nguyen, Fabrizio Castro
Cc: Claudiu.Beznea, linux-can@vger.kernel.org,
devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
Claudiu Beznea
Hi Claudiu,
> -----Original Message-----
> From: Claudiu Beznea <claudiu.beznea+renesas@tuxon.dev>
> Sent: 07 July 2026 11:24
> Subject: [PATCH 0/8] can: rcar_canfd: Add support for Renesas RZ/G3S
>
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Hi,
>
> Series adds CAN support for the Renesas RZ/G3S SoC. Along with it a typo fix patch was added on the CAN
> driver.
>
> Thank you,
> Claudiu
>
> Claudiu Beznea (8):
> clk: r9a08g045-cpg: Add clocks and resets for CAN-FD
> dt-bindings: can: renesas,rcar-canfd: Document RZ/G3S SoC
> can: rcar_canfd: Fix typos in macro names
> can: rcar_canfd: Allow the CAN FD clock to be sourced from fck
> can: rcar_canfd: Do not set registers selecting the CAN mode
> can: rcar_canfd: Add support for Renesas RZ/G3S
> arm64: dts: renesas: r9a08g045: Add CAN-FD node
> arm64: dts: renesas: rzg3s-smarc: Enable CAN-FD
>
> .../bindings/net/can/renesas,rcar-canfd.yaml | 17 +++++-
> arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 39 +++++++++++++
> .../boot/dts/renesas/rzg3s-smarc-switches.h | 12 ++++
> arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 46 +++++++++++++++
> drivers/clk/renesas/r9a08g045-cpg.c | 10 ++++
> drivers/net/can/rcar/rcar_canfd.c | 56 ++++++++++++++++---
> 6 files changed, 170 insertions(+), 10 deletions(-)
>
For the series,
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
^ permalink raw reply [flat|nested] 18+ messages in thread