linux/drivers/net/can/rockchip
Cunhao Lu b7d51d9b14 can: rockchip: add RK3588 CAN support
Add support for the RK3588 CAN controller by introducing a dedicated
model ID and OF match entry.

The block is closely related to the existing RK3568 variants, but it
cannot reuse their match data unchanged. In particular, RK3588
encodes RX_FIFO_CNT in bits 7:5 instead of 6:4, so the RX path needs
SoC-specific handling.

The RX FIFO count bitfield difference was found by comparing Rockchip's
vendor kernel 6.1 CAN support for RK3568 and RK3588. Runtime testing on
RK3588 also confirms that bits 7:5 are needed.

Enable the existing erratum 5 empty-FIFO workaround for RK3588.
Heiko reproduced erratum 6 on RK3588, so enable that workaround as
well.

CAN-FD is enabled for RK3588. The BRS bus-off issue seen in earlier
testing was caused by the transmit delay compensation setting. With
RKCANFD_REG_TRANSMIT_DELAY_COMPENSATION programmed to 0 on RK3588,
CAN-FD with BRS works in local testing.

Tested on an embedfire,rk3588-lubancat-5io board with can0/can1
directly connected, no other device on the bus, 60 Ohm bus
termination, and a 300 MHz CAN clock. Runtime testing used 500 kbit/s
arbitration bitrate and 1, 3 and 5 Mbit/s data bitrates. The 5 Mbit/s
data phase test ran for 15 minutes with cangen using BRS and
cansequence on the receiver. Both interfaces reported 9528377 packets
and 150667356 bytes, with 0 bus-errors, 0 error-warn, 0 error-pass and
0 bus-off events.

Co-developed-by: Heiko Stuebner <heiko.stuebner@cherry.de>
Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Cunhao Lu <1579567540@qq.com>
Link: https://patch.msgid.link/tencent_207E464D12344B3228096E23A001D6882508@qq.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2026-08-17 19:20:37 +02:00
..
Kconfig can: rockchip_canfd: Drop obsolete dependency on COMPILE_TEST 2024-11-04 18:01:06 +01:00
Makefile can: rockchip_canfd: add stats support for errata workarounds 2024-09-04 14:41:53 +02:00
rockchip_canfd-core.c can: rockchip: add RK3588 CAN support 2026-08-17 19:20:37 +02:00
rockchip_canfd-ethtool.c can: rockchip_canfd: add hardware timestamping support 2024-09-04 14:41:53 +02:00
rockchip_canfd-rx.c can: rockchip: add RK3588 CAN support 2026-08-17 19:20:37 +02:00
rockchip_canfd-timestamp.c time/timecounter: Fix the lie that struct cyclecounter is const 2025-07-01 15:38:25 +02:00
rockchip_canfd-tx.c can: rockchip-canfd: rkcanfd_start_xmit(): use can_dev_dropped_skb() instead of can_dropped_invalid_skb() 2025-10-20 17:18:04 +02:00
rockchip_canfd.h can: rockchip: add RK3588 CAN support 2026-08-17 19:20:37 +02:00