mbox series

[PATCH/RFC,0/4] *arm64: Add CAN-FD support for R-Car V4M and Gray Hawk Single

Message ID cover.1715956819.git.geert+renesas@glider.be (mailing list archive)
Headers show
Series *arm64: Add CAN-FD support for R-Car V4M and Gray Hawk Single | expand

Message

Geert Uytterhoeven May 17, 2024, 2:57 p.m. UTC
Hi all,

This patch series aims to add support for CAN-FD on the R-Car V4M SoC
and the Gray Hawk Single development board.

Unfortunately it does not work: bringing up any CAN interface fails
with:

    rcar_canfd e6660000.can can0: channel 0 communication state failed
    RTNETLINK answers: Connection timed out

This error means that instructing the internal MCU to switch the CAN-FD
channel to operational mode timed out, and the channel is still in reset
mode.

The CAN-FD module on R-Car V4M is very similar to the one on R-Car V4H,
but differ in some hardware parameters, as reflected by the Parameter
Status Information part of the Global IP Version Register.  However,
none of this parameterization should have any impact on the driver, as
the driver does not access any register that is impacted by the
parameterization (except for the number of channels).

Channels 0 and 1 work fine on R-Car V4H.  I have compared all register
writes between V4H and V4M, and dumped and compared the full register
block after a sucessful and failed bring-up of a channel, but there is
no other failure indication in e.g. a status or error flag register...

Thanks for your comments!

Cong Dang (1):
  clk: renesas: r8a779h0: Add CANFD clock

Duy Nguyen (2):
  dt-bindings: can: renesas,rcar-canfd: Document R-Car V4M support
  arm64: dts: renesas: r8a779h0: Add CAN-FD node

Geert Uytterhoeven (1):
  arm64: dts: renesas: gray-hawk-single: Add CAN-FD support

 .../bindings/net/can/renesas,rcar-canfd.yaml  | 22 +++++++---
 .../dts/renesas/r8a779h0-gray-hawk-single.dts | 40 ++++++++++++++++++
 arch/arm64/boot/dts/renesas/r8a779h0.dtsi     | 41 +++++++++++++++++++
 drivers/clk/renesas/r8a779h0-cpg-mssr.c       |  1 +
 4 files changed, 98 insertions(+), 6 deletions(-)

Comments

Wolfram Sang May 17, 2024, 3:18 p.m. UTC | #1
Hi Geert,

> The CAN-FD module on R-Car V4M is very similar to the one on R-Car V4H,
> but differ in some hardware parameters, as reflected by the Parameter
> Status Information part of the Global IP Version Register.  However,
> none of this parameterization should have any impact on the driver, as
> the driver does not access any register that is impacted by the
> parameterization (except for the number of channels).

Does the BSP work?

Happy hacking,

   Wolfram
Geert Uytterhoeven May 17, 2024, 3:27 p.m. UTC | #2
Hi Wolfram,

On Fri, May 17, 2024 at 5:18 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> > The CAN-FD module on R-Car V4M is very similar to the one on R-Car V4H,
> > but differ in some hardware parameters, as reflected by the Parameter
> > Status Information part of the Global IP Version Register.  However,
> > none of this parameterization should have any impact on the driver, as
> > the driver does not access any register that is impacted by the
> > parameterization (except for the number of channels).
>
> Does the BSP work?

I haven't tried the BSP in-se (it does not support Gray Hawk Single),
but a forward port of rcar_canfd from the BSP exhibits the same behavior.

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven May 17, 2024, 4:02 p.m. UTC | #3
Hi Wolfram,

On Fri, May 17, 2024 at 5:27 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Fri, May 17, 2024 at 5:18 PM Wolfram Sang
> <wsa+renesas@sang-engineering.com> wrote:
> > > The CAN-FD module on R-Car V4M is very similar to the one on R-Car V4H,
> > > but differ in some hardware parameters, as reflected by the Parameter
> > > Status Information part of the Global IP Version Register.  However,
> > > none of this parameterization should have any impact on the driver, as
> > > the driver does not access any register that is impacted by the
> > > parameterization (except for the number of channels).
> >
> > Does the BSP work?
>
> I haven't tried the BSP in-se (it does not support Gray Hawk Single),
> but a forward port of rcar_canfd from the BSP exhibits the same behavior.

I just booted the BSP's kernel and its Gray Hawk DTS on Gray Hawk
Single, and I no longer get an error message when bringing up the CAN
devices.  However, that does not make CAN work, as v5.10 (and the BSP
rcar-canfd driver) lack CAN transceiver support.  Backporting that
didn't help, but now I have something more to investigate next week ;-)

Thanks!

Gr{oetje,eeting}s,

                        Geert
Wolfram Sang May 17, 2024, 6:37 p.m. UTC | #4
> rcar-canfd driver) lack CAN transceiver support.  Backporting that
> didn't help, but now I have something more to investigate next week ;-)

Yay, at least something!