[PATCH 0/3] Add support for Renesas CAN-FD Bus-Off recovery mode selection
From: Biju
Date: Fri Apr 03 2026 - 05:56:29 EST
From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
The CAN-FD IP supports the below Bus-Off recovery modes:
1) ISO11898-1 compliant
2) Entry to Channel Halt mode automatically at bus-off entry
3) Entry to Channel Halt mode automatically at bus-off end
4) Entry to Channel Halt mode (in bus-off state) by program request
Add support for Bus-Off recovery mode selection via the
renesas,bus-off-recovery-mode device tree property. If the property is
absent, it defaults to RCANFD_CCTR_BOM_BENTRY (entry to Channel Halt mode
automatically at bus-off entry) for backward compatibility.
Testing:
CANBUS-OFF trigger on RZ/G3E SMARC EVK:-
Enable
CONFIG_EXPERT=y
CONFIG_GPIO_SYSFS=y
echo 556 > /sys/class/gpio/export
echo 557 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio556/direction
echo out > /sys/class/gpio/gpio557/direction
echo 1 > /sys/class/gpio/gpio556/value
echo 1 > /sys/class/gpio/gpio557/value
ip link set can0 down
ip link set can1 down
ip link set can0 up type can bitrate 1000000 dbitrate 4000000 fd on restart-ms 100
ip link set can1 up type can bitrate 1000000 dbitrate 4000000 fd on restart-ms 100
Set the switches SW_GPIO8_CAN0_STB and SW_GPIO9_CAN1_STB to STANDBY mode
candump can0 &
cansend can1 123#1122334455667788
This will trigger BUS-OFF as CAN is in STANDBY mode
Then, Set the switches SW_GPIO8_CAN0_STB and SW_GPIO9_CAN1_STB to
NORMAL mode, the messages started receiving after bus-off errors.
With BOM=0, after bus recovery, Bus-Off recovery interrupt is triggered
by CAN-FD IP.
Biju Das (3):
dt-bindings: can: renesas,rcar-canfd: Document
renesas,bus-off-recovery-mode property
can: rcar_canfd: Add support for Bus-Off recovery mode selection
can: rcar_canfd: Handle Bus-Off recovery interrupt
.../bindings/net/can/renesas,rcar-canfd.yaml | 11 ++++++++++
drivers/net/can/rcar/rcar_canfd.c | 20 +++++++++++++------
2 files changed, 25 insertions(+), 6 deletions(-)
--
2.43.0