[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<TY3PR01MB11346B198D168F5F78BB74372860CA@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Date: Mon, 8 Sep 2025 10:37:05 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: geert <geert@...ux-m68k.org>, biju.das.au <biju.das.au@...il.com>
CC: Marc Kleine-Budde <mkl@...gutronix.de>, Vincent Mailhol
<mailhol.vincent@...adoo.fr>, magnus.damm <magnus.damm@...il.com>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
"linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Prabhakar
Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>, Fabrizio Castro
<fabrizio.castro.jz@...esas.com>
Subject: RE: [PATCH v2 1/4] can: rcar_canfd: Add shared_bittiming variable to
struct rcar_canfd_hw_info
Hi Geert,
Thanks for the feedback.
> -----Original Message-----
> From: Geert Uytterhoeven <geert@...ux-m68k.org>
> Sent: 01 September 2025 14:16
> Subject: Re: [PATCH v2 1/4] can: rcar_canfd: Add shared_bittiming variable to struct rcar_canfd_hw_info
>
> Hi Biju,
>
> On Thu, 21 Aug 2025 at 16:14, Biju <biju.das.au@...il.com> wrote:
> > From: Biju Das <biju.das.jz@...renesas.com>
> >
> > The calculation formula for nominal bit rate of classical CAN is same
> > as that of nominal bit rate of CANFD on the RZ/G3E SoC compared to other SoCs.
> > Add shared_bittiming variable to struct rcar_canfd_hw_info to handle
> > this difference.
> >
> > Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
> > Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@...esas.com>
>
> Thanks for your patch!
>
> > --- a/drivers/net/can/rcar/rcar_canfd.c
> > +++ b/drivers/net/can/rcar/rcar_canfd.c
> > @@ -461,6 +461,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 shared_bittiming:1; /* Has shared nominal bittiming constants */
> > };
> >
> > /* Channel priv data */
> > @@ -632,6 +633,7 @@ static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
> > .ch_interface_mode = 0,
> > .shared_can_regs = 0,
> > .external_clk = 1,
> > + .shared_bittiming = 0,
> > };
> >
> > static const struct rcar_canfd_hw_info rcar_gen4_hw_info = { @@
> > -649,6 +651,7 @@ static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
> > .ch_interface_mode = 1,
> > .shared_can_regs = 1,
> > .external_clk = 1,
> > + .shared_bittiming = 0,
>
> I could find no stricter limitation of the bit timings in classical CAN mode on R-Car Gen4, so it looks
> like this should be 1, too...
Agreed.
>
> > };
> >
> > static const struct rcar_canfd_hw_info rzg2l_hw_info = { @@ -666,6
> > +669,7 @@ static const struct rcar_canfd_hw_info rzg2l_hw_info = {
> > .ch_interface_mode = 0,
> > .shared_can_regs = 0,
> > .external_clk = 1,
> > + .shared_bittiming = 0,
> > };
> >
> > static const struct rcar_canfd_hw_info r9a09g047_hw_info = { @@
> > -683,6 +687,7 @@ static const struct rcar_canfd_hw_info r9a09g047_hw_info = {
> > .ch_interface_mode = 1,
> > .shared_can_regs = 1,
> > .external_clk = 0,
> > + .shared_bittiming = 1,
> > };
> >
> > /* Helper functions */
> > @@ -1912,7 +1917,10 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
> > priv->can.fd.do_get_auto_tdcv = rcar_canfd_get_auto_tdcv;
> > } else {
> > /* Controller starts in Classical CAN only mode */
> > - priv->can.bittiming_const = &rcar_canfd_bittiming_const;
> > + if (gpriv->info->shared_bittiming)
>
> ... hence you can just check the existing shared_can_regs flag here, and don't need to introduce a new
> flag for shared bittimings?
OK will use existing shared_can_regs flag here.
Cheers,
Biju
Powered by blists - more mailing lists