[PATCH 2/3] can: rockchip: add RK3588 CAN-FD support
Cunhao Lu
1579567540 at qq.com
Thu Jul 2 22:41:59 PDT 2026
Hi Marc,
> Then CAN-FD is broken. :/
>
> Maybe in a later patch we can hack something, to allow working
> configurations.
I did some more tests and found that the immediate bus-off with BRS is
related to the transmit delay compensation setting.
After setting RKCANFD_REG_TRANSMIT_DELAY_COMPENSATION to 0, i.e.
disabling TDC, CAN-FD with BRS works on RK3588 in my setup. I tested the
same command with 500 kbit/s arbitration bitrate and 1, 3 and 5 Mbit/s
data bitrate.
The 5 Mbit/s data phase test setup was:
CAN clock: 300 MHz
can0 <-> can1 directly connected
no other devices on the bus
bus termination: 60 Ohm
ip link set can0 type can bitrate 500000 sample-point 0.8 dbitrate 5000000 dsample-point 0.8 fd on berr-reporting on
ip link set can1 type can bitrate 500000 sample-point 0.8 dbitrate 5000000 dsample-point 0.8 fd on berr-reporting on
cangen can0 -I 2 -Li -Di -p 10 -f -g 1 -c32 -b
cansequence -rv can1 -f
The test ran for 15 minutes. The receiver reported continuous sequence
wrap-around messages, e.g.:
sequence wrap around (0)
sequence wrap around (1)
...
sequence wrap around (37218)
sequence wrap around (37219)
The interface statistics after the test were:
can0:
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped missed mcast
150667356 9528377 0 0 0 0
TX: bytes packets errors dropped carrier collsns
150667356 9528377 0 0 0 0
can1:
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped missed mcast
150667356 9528377 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
There were no bus errors and no bus-off events in this test.
> Can you update the description of the quirk for the rk3588 and add how
> to reproduce it?
With TDC disabled I cannot reproduce the BRS bus-off problem anymore.
This also looks different from RKCANFD_QUIRK_CANFD_BROKEN, so I do not
think RK3588 should use that quirk.
> Please keep it disabled for now.
Given the new test result, I plan to send v4 with the RK3588 TDC register
set to 0 and CAN-FD enabled for RK3588.
Regards,
Cunhao
More information about the linux-arm-kernel
mailing list