Devicetree
 help / color / mirror / Atom feed
* Re: [PATCH 2/3] can: rockchip: add RK3588 CAN-FD support
@ 2026-07-02  2:53 Cunhao Lu
  2026-07-02  8:15 ` Marc Kleine-Budde
  0 siblings, 1 reply; 13+ messages in thread
From: Cunhao Lu @ 2026-07-02  2:53 UTC (permalink / raw)
  To: heiko
  Cc: Marc Kleine-Budde, linux-can, mailhol, kernel, robh, krzk+dt,
	conor+dt, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel

Hi Heiko,

thanks for the guidance, and thanks for leaving this to me. :-)

> I don't think we need two people working on this and you did the better
> investigation into the differences, so you should get the credit :-)
>
> So I guess my preference would be to:
> - pick up the erratum 6 into your patch
> - add my haikou patch to the series - that way we also get a user
> - handle Krzysztof's comment from
>   https://lore.kernel.org/linux-rockchip/20260701-sensible-cryptic-ocelot-58035b@quoll/
>
>   as both our bindings have the same structure, so I guess it should be
>
>     oneOf:
>        - enum:
>              rockchip,rk3568v2-canfd
>              rockchip,rk3588v2-canfd
>        - items:
>            - const: rockchip,rk3568v3-canfd
>            - const: rockchip,rk3568v2-canfd
>
> And submit that as v2.

That works for me. I will prepare a v2 with:

- the binding schema changed to use enum as suggested by Krzysztof
- RKCANFD_QUIRK_RK3568_ERRATUM_6 enabled for RK3588v2
- your Haikou patch added to the series

> But if it actually works, then personally I'm more than fine with
> enabling CAN-FD :-D .
>
> I guess Marc might have more insight where the FD issue triggered on
> the RK3568.

I will also double-check that CAN-FD still works with the v2 changes and
wait for Marc's feedback on the CAN-FD issue before deciding whether
RKCANFD_QUIRK_CANFD_BROKEN should stay disabled for RK3588v2.

Thanks,
Cunhao Lu

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] can: rockchip: add RK3588 CAN-FD support
@ 2026-07-02  9:23 Cunhao Lu
  2026-07-02 11:11 ` Marc Kleine-Budde
  0 siblings, 1 reply; 13+ messages in thread
From: Cunhao Lu @ 2026-07-02  9:23 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: heiko, linux-can, mailhol, kernel, robh, krzk+dt, conor+dt,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel

Hi Marc,

> Is the SoC you're using actually a 'v2' silicon revision? At least on
> the rk3568 the downstream kernel has code to read the revision.

The kernel reports the CAN-FD controller as rk3588v2 rev2.2:

  rockchip_canfd fea60000.can can0: Rockchip-CANFD rk3588v2 rev2.2 (errata 0x0000) found
  rockchip_canfd fea70000.can can1: Rockchip-CANFD rk3588v2 rev2.2 (errata 0x0000) found

Following your earlier feedback, I have changed the v2 series to use
rockchip,rk3588-canfd instead of rockchip,rk3588v2-canfd unless we get
more information about RK3588 CAN-FD errata and SoC silicon revisions
from Rockchip.

> Compile the latest https://github.com/linux-can/can-utils/ and test:
>
> $ cangen can0 -I 2 -Li -Di -p 10 -f -g 1 -c32 -b
> $ cansequence -rv can1 -f

I tested with can0 and can1 directly connected. The CAN clock was
200 MHz, and the interfaces were configured as follows:

  ip link set can0 down
  ip link set can0 type can bitrate 500000 sample-point 0.8 dbitrate 1000000 dsample-point 0.8 fd on
  ip link set can0 up

  ip link set can1 down
  ip link set can1 type can bitrate 500000 sample-point 0.8 dbitrate 1000000 dsample-point 0.8 fd on
  ip link set can1 up

Without BRS, this test ran for 15 minutes without problems:

  cangen can0 -I 2 -Li -Di -p 10 -f -g 1 -c32

With BRS enabled:

  cangen can0 -I 2 -Li -Di -p 10 -f -g 1 -c32 -b

the test only worked when dbitrate was equal to bitrate, for example
with both set to 1M. If dbitrate differed from bitrate, the
controller went bus-off immediately.

So my current conclusion is that CAN-FD itself works on RK3588, but the
support appears incomplete: using a faster data phase with BRS does not
work in my setup.

This looks different from the issue described by the current
RKCANFD_QUIRK_CANFD_BROKEN comment. That quirk is about specific
CAN-FD frames triggering Error Interrupt or Error-Warning during
reception. In my test the non-BRS CAN-FD frames work, while the failure
is tied to using BRS with a data bitrate different from the nominal
bitrate, which immediately drives the controller bus-off.

Given this result, should I still keep CAN-FD disabled for RK3588, or is
it acceptable to enable CAN-FD but document that BRS with a faster data
phase is currently not working?

Thanks,
Cunhao Lu

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] can: rockchip: add RK3588 CAN-FD support
@ 2026-07-02 12:45 Cunhao Lu
  0 siblings, 0 replies; 13+ messages in thread
From: Cunhao Lu @ 2026-07-02 12:45 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: heiko, linux-can, mailhol, kernel, robh, krzk+dt, conor+dt,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel

Hi Marc,

thanks for the feedback.

> Then CAN-FD is broken. :/
>
> Maybe in a later patch we can hack something, to allow working
> configurations.

Understood. I will keep CAN-FD disabled for RK3588 in v2.

I will also try to investigate whether the failing BRS/data-phase setup
can be fixed. If I can find a proper fix, I will send it as a follow-up
patch instead of mixing it into this v2 series.

> Can you update the description of the quirk for the rk3588 and add how
> to reproduce it?

Yes. I will update the RK3588 quirk description and add the reproduce
steps for the BRS/data bitrate issue.

> Please keep it disabled for now.

I will keep RKCANFD_QUIRK_CANFD_BROKEN enabled for RK3588 in v2, so
CAN-FD stays disabled for now.

Thanks,
Cunhao Lu

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-07-02 12:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260701070128.2096267-1-1579567540@qq.com>
2026-07-01  7:01 ` [PATCH 1/3] dt-bindings: can: rockchip: add rk3588v2 CAN-FD compatible 1579567540
2026-07-02  7:43   ` Krzysztof Kozlowski
2026-07-01  7:01 ` [PATCH 2/3] can: rockchip: add RK3588 CAN-FD support 1579567540
2026-07-01  9:55   ` Heiko Stübner
2026-07-01 11:07     ` Marc Kleine-Budde
2026-07-01 12:29       ` 💫.220
2026-07-01 16:02         ` Heiko Stübner
2026-07-01  7:01 ` [PATCH 3/3] arm64: dts: rockchip: add CAN-FD nodes for RK3588 1579567540
2026-07-02  2:53 [PATCH 2/3] can: rockchip: add RK3588 CAN-FD support Cunhao Lu
2026-07-02  8:15 ` Marc Kleine-Budde
  -- strict thread matches above, loose matches on Subject: below --
2026-07-02  9:23 Cunhao Lu
2026-07-02 11:11 ` Marc Kleine-Budde
2026-07-02 12:45 Cunhao Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox