* [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible
[not found] <20260702140654.2961561-1-1579567540@qq.com>
@ 2026-07-02 14:06 ` 1579567540
2026-07-02 14:23 ` Krzysztof Kozlowski
2026-07-02 16:01 ` Heiko Stübner
2026-07-02 14:06 ` [PATCH v2 2/4] can: rockchip: add RK3588 CAN support 1579567540
` (2 subsequent siblings)
3 siblings, 2 replies; 13+ messages in thread
From: 1579567540 @ 2026-07-02 14:06 UTC (permalink / raw)
To: Marc Kleine-Budde, linux-can
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Heiko Stuebner, Dmitry Torokhov, Shengjiu Wang,
Pengpeng Hou, Russell King, Eric Biggers, Mario Limonciello,
Karl Mehltretter, Yixun Lan, Stephen Boyd, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Cunhao Lu
From: Cunhao Lu <1579567540@qq.com>
RK3588 integrates a Rockchip CAN-FD controller variant that is not
fully compatible with RK3568v2. The RX FIFO count register field is
encoded in bits 7:5 on RK3588, while RK3568v2 uses bits 6:4.
Add a dedicated rockchip,rk3588-canfd compatible to describe this
variant. Do not use rockchip,rk3568v2-canfd as a fallback, because that
would describe a register layout that does not match the hardware.
Changes in v2:
- Use enum for the single-compatible entries, as suggested by Krzysztof.
- Reword the commit message to explain the hardware difference instead
of referring to Linux driver match data.
Signed-off-by: Cunhao Lu <1579567540@qq.com>
---
.../devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml b/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml
index a077c0330013..81e2b6dfeb02 100644
--- a/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml
+++ b/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml
@@ -16,7 +16,9 @@ allOf:
properties:
compatible:
oneOf:
- - const: rockchip,rk3568v2-canfd
+ - enum:
+ - rockchip,rk3568v2-canfd
+ - rockchip,rk3588-canfd
- items:
- const: rockchip,rk3568v3-canfd
- const: rockchip,rk3568v2-canfd
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible
2026-07-02 14:06 ` [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible 1579567540
@ 2026-07-02 14:23 ` Krzysztof Kozlowski
2026-07-02 15:25 ` Cunhao Lu
2026-07-02 16:01 ` Heiko Stübner
1 sibling, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-02 14:23 UTC (permalink / raw)
To: 1579567540, Marc Kleine-Budde, linux-can
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Heiko Stuebner, Dmitry Torokhov, Shengjiu Wang,
Pengpeng Hou, Russell King, Eric Biggers, Mario Limonciello,
Karl Mehltretter, Yixun Lan, Stephen Boyd, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel
On 02/07/2026 16:06, 1579567540@qq.com wrote:
> From: Cunhao Lu <1579567540@qq.com>
>
> RK3588 integrates a Rockchip CAN-FD controller variant that is not
> fully compatible with RK3568v2. The RX FIFO count register field is
> encoded in bits 7:5 on RK3588, while RK3568v2 uses bits 6:4.
>
> Add a dedicated rockchip,rk3588-canfd compatible to describe this
> variant. Do not use rockchip,rk3568v2-canfd as a fallback, because that
> would describe a register layout that does not match the hardware.
>
> Changes in v2:
Changelog goes to changelog, so ---.
See also submitting patches or just start using b4, which would solve
also your broken threading problem.
> - Use enum for the single-compatible entries, as suggested by Krzysztof.
> - Reword the commit message to explain the hardware difference instead
> of referring to Linux driver match data.
>
> Signed-off-by: Cunhao Lu <1579567540@qq.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible
2026-07-02 14:23 ` Krzysztof Kozlowski
@ 2026-07-02 15:25 ` Cunhao Lu
0 siblings, 0 replies; 13+ messages in thread
From: Cunhao Lu @ 2026-07-02 15:25 UTC (permalink / raw)
To: Krzysztof Kozlowski, Marc Kleine-Budde, linux-can
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Heiko Stuebner, Dmitry Torokhov, Shengjiu Wang,
Pengpeng Hou, Russell King, Eric Biggers, Mario Limonciello,
Karl Mehltretter, Yixun Lan, Stephen Boyd, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel
Hi Krzysztof,
Thanks for pointing this out.
> > Add a dedicated rockchip,rk3588-canfd compatible to describe this
> > variant. Do not use rockchip,rk3568v2-canfd as a fallback, because that
> > would describe a register layout that does not match the hardware.
> >
> > Changes in v2:
>
> Changelog goes to changelog, so ---.
>
> See also submitting patches or just start using b4, which would solve
> also your broken threading problem.
>
I will move it below --- in v3. At the same time, I'll also spend some time
learning how to use b4, and will use b4 to send the next v3 submission.
Best regards,
Cunhao
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible
2026-07-02 14:06 ` [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible 1579567540
2026-07-02 14:23 ` Krzysztof Kozlowski
@ 2026-07-02 16:01 ` Heiko Stübner
2026-07-02 16:32 ` Cunhao Lu
2026-07-02 16:39 ` Krzysztof Kozlowski
1 sibling, 2 replies; 13+ messages in thread
From: Heiko Stübner @ 2026-07-02 16:01 UTC (permalink / raw)
To: Marc Kleine-Budde, linux-can, 1579567540
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Dmitry Torokhov, Shengjiu Wang, Pengpeng Hou,
Russell King, Eric Biggers, Mario Limonciello, Karl Mehltretter,
Yixun Lan, Stephen Boyd, devicetree, linux-arm-kernel,
linux-rockchip, linux-kernel, Cunhao Lu
Am Donnerstag, 2. Juli 2026, 16:06:51 Mitteleuropäische Sommerzeit schrieb 1579567540@qq.com:
> From: Cunhao Lu <1579567540@qq.com>
>
> RK3588 integrates a Rockchip CAN-FD controller variant that is not
> fully compatible with RK3568v2. The RX FIFO count register field is
> encoded in bits 7:5 on RK3588, while RK3568v2 uses bits 6:4.
>
> Add a dedicated rockchip,rk3588-canfd compatible to describe this
> variant. Do not use rockchip,rk3568v2-canfd as a fallback, because that
> would describe a register layout that does not match the hardware.
>
> Changes in v2:
> - Use enum for the single-compatible entries, as suggested by Krzysztof.
> - Reword the commit message to explain the hardware difference instead
> of referring to Linux driver match data.
>
> Signed-off-by: Cunhao Lu <1579567540@qq.com>
after fixing Krzysztof's comment:
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
and doing dtbscheck of the binding against the dt-patches:
Tested-by: Heiko Stuebner <heiko@sntech.de>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible
2026-07-02 16:01 ` Heiko Stübner
@ 2026-07-02 16:32 ` Cunhao Lu
2026-07-02 16:39 ` Krzysztof Kozlowski
1 sibling, 0 replies; 13+ messages in thread
From: Cunhao Lu @ 2026-07-02 16:32 UTC (permalink / raw)
To: Heiko Stübner, Marc Kleine-Budde, linux-can
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Dmitry Torokhov, Shengjiu Wang, Pengpeng Hou,
Russell King, Eric Biggers, Mario Limonciello, Karl Mehltretter,
Yixun Lan, Stephen Boyd, devicetree, linux-arm-kernel,
linux-rockchip, linux-kernel
> after fixing Krzysztof's comment:
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
>
> and doing dtbscheck of the binding against the dt-patches:
> Tested-by: Heiko Stuebner <heiko@sntech.de>
Hi Heiko,
Thanks for the review and testing.
I will add your Reviewed-by and Tested-by tags in v3.
Best regards,
Cunhao
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible
2026-07-02 16:01 ` Heiko Stübner
2026-07-02 16:32 ` Cunhao Lu
@ 2026-07-02 16:39 ` Krzysztof Kozlowski
2026-07-02 16:42 ` Heiko Stübner
1 sibling, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-02 16:39 UTC (permalink / raw)
To: Heiko Stübner, Marc Kleine-Budde, linux-can, 1579567540
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Dmitry Torokhov, Shengjiu Wang, Pengpeng Hou,
Russell King, Eric Biggers, Mario Limonciello, Karl Mehltretter,
Yixun Lan, Stephen Boyd, devicetree, linux-arm-kernel,
linux-rockchip, linux-kernel
On 02/07/2026 18:01, Heiko Stübner wrote:
> Am Donnerstag, 2. Juli 2026, 16:06:51 Mitteleuropäische Sommerzeit schrieb 1579567540@qq.com:
>> From: Cunhao Lu <1579567540@qq.com>
>>
>> RK3588 integrates a Rockchip CAN-FD controller variant that is not
>> fully compatible with RK3568v2. The RX FIFO count register field is
>> encoded in bits 7:5 on RK3588, while RK3568v2 uses bits 6:4.
>>
>> Add a dedicated rockchip,rk3588-canfd compatible to describe this
>> variant. Do not use rockchip,rk3568v2-canfd as a fallback, because that
>> would describe a register layout that does not match the hardware.
>>
>> Changes in v2:
>> - Use enum for the single-compatible entries, as suggested by Krzysztof.
>> - Reword the commit message to explain the hardware difference instead
>> of referring to Linux driver match data.
>>
>> Signed-off-by: Cunhao Lu <1579567540@qq.com>
>
> after fixing Krzysztof's comment:
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
>
> and doing dtbscheck of the binding against the dt-patches:
> Tested-by: Heiko Stuebner <heiko@sntech.de>
Makefile/build level steps are not testing. Please don't provide such
tags for bindings. Otherwise all bindings would carry Rob's tag, because
he wrote the bot which does such testing.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible
2026-07-02 16:39 ` Krzysztof Kozlowski
@ 2026-07-02 16:42 ` Heiko Stübner
0 siblings, 0 replies; 13+ messages in thread
From: Heiko Stübner @ 2026-07-02 16:42 UTC (permalink / raw)
To: Marc Kleine-Budde, linux-can, 1579567540, Krzysztof Kozlowski
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Dmitry Torokhov, Shengjiu Wang, Pengpeng Hou,
Russell King, Eric Biggers, Mario Limonciello, Karl Mehltretter,
Yixun Lan, Stephen Boyd, devicetree, linux-arm-kernel,
linux-rockchip, linux-kernel
Am Donnerstag, 2. Juli 2026, 18:39:53 Mitteleuropäische Sommerzeit schrieb Krzysztof Kozlowski:
> On 02/07/2026 18:01, Heiko Stübner wrote:
> > Am Donnerstag, 2. Juli 2026, 16:06:51 Mitteleuropäische Sommerzeit schrieb 1579567540@qq.com:
> >> From: Cunhao Lu <1579567540@qq.com>
> >>
> >> RK3588 integrates a Rockchip CAN-FD controller variant that is not
> >> fully compatible with RK3568v2. The RX FIFO count register field is
> >> encoded in bits 7:5 on RK3588, while RK3568v2 uses bits 6:4.
> >>
> >> Add a dedicated rockchip,rk3588-canfd compatible to describe this
> >> variant. Do not use rockchip,rk3568v2-canfd as a fallback, because that
> >> would describe a register layout that does not match the hardware.
> >>
> >> Changes in v2:
> >> - Use enum for the single-compatible entries, as suggested by Krzysztof.
> >> - Reword the commit message to explain the hardware difference instead
> >> of referring to Linux driver match data.
> >>
> >> Signed-off-by: Cunhao Lu <1579567540@qq.com>
> >
> > after fixing Krzysztof's comment:
> > Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> >
> > and doing dtbscheck of the binding against the dt-patches:
> > Tested-by: Heiko Stuebner <heiko@sntech.de>
>
> Makefile/build level steps are not testing. Please don't provide such
> tags for bindings. Otherwise all bindings would carry Rob's tag, because
> he wrote the bot which does such testing.
ok ... will keep that in mind for the future
Heiko
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 2/4] can: rockchip: add RK3588 CAN support
[not found] <20260702140654.2961561-1-1579567540@qq.com>
2026-07-02 14:06 ` [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible 1579567540
@ 2026-07-02 14:06 ` 1579567540
2026-07-02 16:02 ` Heiko Stübner
2026-07-02 14:06 ` [PATCH v2 3/4] arm64: dts: rockchip: add CAN-FD nodes for RK3588 1579567540
2026-07-02 14:06 ` [PATCH v2 4/4] arm64: dts: rockchip: Enable CAN controller on RK3588-Tiger-Haikou 1579567540
3 siblings, 1 reply; 13+ messages in thread
From: 1579567540 @ 2026-07-02 14:06 UTC (permalink / raw)
To: Marc Kleine-Budde, linux-can
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Heiko Stuebner, Dmitry Torokhov, Shengjiu Wang,
Pengpeng Hou, Russell King, Eric Biggers, Mario Limonciello,
Karl Mehltretter, Yixun Lan, Stephen Boyd, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Cunhao Lu,
Heiko Stuebner
From: Cunhao Lu <1579567540@qq.com>
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.
Keep RKCANFD_QUIRK_CANFD_BROKEN enabled for RK3588, so CAN-FD stays
disabled for now. Local testing did not reproduce the two known CAN-FD
trigger frames that cause Error Interrupts on RK3568 variants. Instead,
RK3588 shows a different CAN-FD failure mode: CAN-FD frames without BRS
work in this setup, but BRS with a data bitrate different from the
nominal bitrate immediately drives the controller bus-off.
Reported-by: Heiko Stuebner <heiko.stuebner@cherry.de>
Link: https://lore.kernel.org/lkml/20260630164336.3444550-4-heiko@sntech.de/
Signed-off-by: Cunhao Lu <1579567540@qq.com>
---
.../net/can/rockchip/rockchip_canfd-core.c | 12 +++++++++
drivers/net/can/rockchip/rockchip_canfd-rx.c | 5 +++-
drivers/net/can/rockchip/rockchip_canfd.h | 26 ++++++++++++++++++-
3 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/drivers/net/can/rockchip/rockchip_canfd-core.c b/drivers/net/can/rockchip/rockchip_canfd-core.c
index 29de0c01e4ed..178d69edf1bb 100644
--- a/drivers/net/can/rockchip/rockchip_canfd-core.c
+++ b/drivers/net/can/rockchip/rockchip_canfd-core.c
@@ -50,6 +50,13 @@ static const struct rkcanfd_devtype_data rkcanfd_devtype_data_rk3568v3 = {
RKCANFD_QUIRK_CANFD_BROKEN,
};
+static const struct rkcanfd_devtype_data rkcanfd_devtype_data_rk3588 = {
+ .model = RKCANFD_MODEL_RK3588,
+ .quirks = RKCANFD_QUIRK_RK3568_ERRATUM_5 |
+ RKCANFD_QUIRK_RK3568_ERRATUM_6 |
+ RKCANFD_QUIRK_CANFD_BROKEN,
+};
+
static const char *__rkcanfd_get_model_str(enum rkcanfd_model model)
{
switch (model) {
@@ -57,6 +64,8 @@ static const char *__rkcanfd_get_model_str(enum rkcanfd_model model)
return "rk3568v2";
case RKCANFD_MODEL_RK3568V3:
return "rk3568v3";
+ case RKCANFD_MODEL_RK3588:
+ return "rk3588";
}
return "<unknown>";
@@ -846,6 +855,9 @@ static const struct of_device_id rkcanfd_of_match[] = {
}, {
.compatible = "rockchip,rk3568v3-canfd",
.data = &rkcanfd_devtype_data_rk3568v3,
+ }, {
+ .compatible = "rockchip,rk3588-canfd",
+ .data = &rkcanfd_devtype_data_rk3588,
}, {
/* sentinel */
},
diff --git a/drivers/net/can/rockchip/rockchip_canfd-rx.c b/drivers/net/can/rockchip/rockchip_canfd-rx.c
index 475c0409e215..24e87daa1df0 100644
--- a/drivers/net/can/rockchip/rockchip_canfd-rx.c
+++ b/drivers/net/can/rockchip/rockchip_canfd-rx.c
@@ -281,7 +281,10 @@ rkcanfd_rx_fifo_get_len(const struct rkcanfd_priv *priv)
{
const u32 reg = rkcanfd_read(priv, RKCANFD_REG_RX_FIFO_CTRL);
- return FIELD_GET(RKCANFD_REG_RX_FIFO_CTRL_RX_FIFO_CNT, reg);
+ if (priv->devtype_data.model == RKCANFD_MODEL_RK3588)
+ return FIELD_GET(RKCANFD_REG_RX_FIFO_CTRL_RX_FIFO_CNT_RK3588, reg);
+
+ return FIELD_GET(RKCANFD_REG_RX_FIFO_CTRL_RX_FIFO_CNT_RK3568, reg);
}
int rkcanfd_handle_rx_int(struct rkcanfd_priv *priv)
diff --git a/drivers/net/can/rockchip/rockchip_canfd.h b/drivers/net/can/rockchip/rockchip_canfd.h
index 93131c7d7f54..82a617e4ca66 100644
--- a/drivers/net/can/rockchip/rockchip_canfd.h
+++ b/drivers/net/can/rockchip/rockchip_canfd.h
@@ -214,7 +214,8 @@
#define RKCANFD_REG_TXEVENT_FIFO_CTRL_TXE_FIFO_ENABLE BIT(0)
#define RKCANFD_REG_RX_FIFO_CTRL 0x118
-#define RKCANFD_REG_RX_FIFO_CTRL_RX_FIFO_CNT GENMASK(6, 4)
+#define RKCANFD_REG_RX_FIFO_CTRL_RX_FIFO_CNT_RK3568 GENMASK(6, 4)
+#define RKCANFD_REG_RX_FIFO_CTRL_RX_FIFO_CNT_RK3588 GENMASK(7, 5)
#define RKCANFD_REG_RX_FIFO_CTRL_RX_FIFO_FULL_WATERMARK GENMASK(3, 1)
#define RKCANFD_REG_RX_FIFO_CTRL_RX_FIFO_ENABLE BIT(0)
@@ -331,6 +332,11 @@
* rarely with the standard clock of 300 MHz, but almost immediately
* at 80 MHz.
*
+ * Tests on the rk3588 show the same empty FIFO condition.
+ * In that setup rx_fifo_empty_errors increments when the bus
+ * transitions from idle to high CAN-FD load and stops growing once
+ * the bus reaches a steady state.
+ *
* To workaround this problem, check for empty FIFO with
* rkcanfd_fifo_header_empty() in rkcanfd_handle_rx_int_one() and exit
* early.
@@ -344,6 +350,8 @@
/* Erratum 6: The CAN controller's transmission of extended frames may
* intermittently change into standard frames
*
+ * Tests on the rk3588 show the same problem.
+ *
* Work around this issue by activating self reception (RXSTX). If we
* have pending TX CAN frames, check all RX'ed CAN frames in
* rkcanfd_rxstx_filter().
@@ -408,6 +416,18 @@
* cansend can0 002##07217010000000000
* DUT:
* candump any,0:0,#FFFFFFFF -cexdHtA
+ *
+ * Tests on the rk3588 show a different CAN-FD failure mode: these two
+ * CAN-FD frames do not trigger Error Interrupt or Error-Warning. CAN-FD
+ * frames without bitrate switching work in this setup, but BRS with a
+ * data bitrate different from the nominal bitrate drives the controller
+ * bus-off immediately.
+ *
+ * To reproduce:
+ * host:
+ * cangen can0 -I 2 -Li -Di -p 10 -f -g 1 -c32 -b
+ * DUT:
+ * cansequence -rv can1 -f
*/
#define RKCANFD_QUIRK_CANFD_BROKEN BIT(12)
@@ -424,6 +444,9 @@
* cansequence -rv -i 1
*
* - TX starvation after repeated Bus-Off
+ * Tests on the rk3588 show the same problem. In a
+ * 10-cycle Bus-Off recovery test, 9 cycles failed to send after the
+ * controller restarted.
* To reproduce:
* host:
* sleep 3 && cangen can0 -I2 -Li -Di -p10 -g 0.0
@@ -434,6 +457,7 @@
enum rkcanfd_model {
RKCANFD_MODEL_RK3568V2 = 0x35682,
RKCANFD_MODEL_RK3568V3 = 0x35683,
+ RKCANFD_MODEL_RK3588 = 0x3588,
};
struct rkcanfd_devtype_data {
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v2 2/4] can: rockchip: add RK3588 CAN support
2026-07-02 14:06 ` [PATCH v2 2/4] can: rockchip: add RK3588 CAN support 1579567540
@ 2026-07-02 16:02 ` Heiko Stübner
2026-07-02 16:34 ` Cunhao Lu
0 siblings, 1 reply; 13+ messages in thread
From: Heiko Stübner @ 2026-07-02 16:02 UTC (permalink / raw)
To: Marc Kleine-Budde, linux-can, 1579567540
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Dmitry Torokhov, Shengjiu Wang, Pengpeng Hou,
Russell King, Eric Biggers, Mario Limonciello, Karl Mehltretter,
Yixun Lan, Stephen Boyd, devicetree, linux-arm-kernel,
linux-rockchip, linux-kernel, Cunhao Lu, Heiko Stuebner
Am Donnerstag, 2. Juli 2026, 16:06:52 Mitteleuropäische Sommerzeit schrieb 1579567540@qq.com:
> From: Cunhao Lu <1579567540@qq.com>
>
> 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.
>
> Keep RKCANFD_QUIRK_CANFD_BROKEN enabled for RK3588, so CAN-FD stays
> disabled for now. Local testing did not reproduce the two known CAN-FD
> trigger frames that cause Error Interrupts on RK3568 variants. Instead,
> RK3588 shows a different CAN-FD failure mode: CAN-FD frames without BRS
> work in this setup, but BRS with a data bitrate different from the
> nominal bitrate immediately drives the controller bus-off.
>
> Reported-by: Heiko Stuebner <heiko.stuebner@cherry.de>
> Link: https://lore.kernel.org/lkml/20260630164336.3444550-4-heiko@sntech.de/
I think you might want to drop that above. If anything a Co-developed-by
would be applicable, but from the (small) size of the change, that also
isn't really necessary for me :-)
> Signed-off-by: Cunhao Lu <1579567540@qq.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 2/4] can: rockchip: add RK3588 CAN support
2026-07-02 16:02 ` Heiko Stübner
@ 2026-07-02 16:34 ` Cunhao Lu
2026-07-02 16:36 ` Heiko Stübner
0 siblings, 1 reply; 13+ messages in thread
From: Cunhao Lu @ 2026-07-02 16:34 UTC (permalink / raw)
To: Heiko Stübner, Marc Kleine-Budde, linux-can
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Dmitry Torokhov, Shengjiu Wang, Pengpeng Hou,
Russell King, Eric Biggers, Mario Limonciello, Karl Mehltretter,
Yixun Lan, Stephen Boyd, devicetree, linux-arm-kernel,
linux-rockchip, linux-kernel, Heiko Stuebner
> I think you might want to drop that above. If anything a Co-developed-by
> would be applicable, but from the (small) size of the change, that also
> isn't really necessary for me :-)
>
>
> > Signed-off-by: Cunhao Lu <1579567540@qq.com>
>
> Tested-by: Heiko Stuebner <heiko@sntech.de>
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Hi Heiko,
Sorry about that. This is my first contribution to the Linux kernel, and
I have not fully understood yet which tags are appropriate in which
situations. Please bear with me.
I will add your Co-developed-by tag in v3, together with your
Signed-off-by as required for Co-developed-by.
Best regards,
Cunhao
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 2/4] can: rockchip: add RK3588 CAN support
2026-07-02 16:34 ` Cunhao Lu
@ 2026-07-02 16:36 ` Heiko Stübner
0 siblings, 0 replies; 13+ messages in thread
From: Heiko Stübner @ 2026-07-02 16:36 UTC (permalink / raw)
To: Marc Kleine-Budde, linux-can, Cunhao Lu
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Dmitry Torokhov, Shengjiu Wang, Pengpeng Hou,
Russell King, Eric Biggers, Mario Limonciello, Karl Mehltretter,
Yixun Lan, Stephen Boyd, devicetree, linux-arm-kernel,
linux-rockchip, linux-kernel, Heiko Stuebner
Am Donnerstag, 2. Juli 2026, 18:34:04 Mitteleuropäische Sommerzeit schrieb Cunhao Lu:
> > I think you might want to drop that above. If anything a Co-developed-by
> > would be applicable, but from the (small) size of the change, that also
> > isn't really necessary for me :-)
> >
> >
> > > Signed-off-by: Cunhao Lu <1579567540@qq.com>
> >
> > Tested-by: Heiko Stuebner <heiko@sntech.de>
> > Reviewed-by: Heiko Stuebner <heiko@sntech.de>
>
> Sorry about that. This is my first contribution to the Linux kernel, and
> I have not fully understood yet which tags are appropriate in which
> situations. Please bear with me.
no worries, I think you're doing really great for your first contribution
Heiko
> I will add your Co-developed-by tag in v3, together with your
> Signed-off-by as required for Co-developed-by.
>
> Best regards,
> Cunhao
>
>
>
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 3/4] arm64: dts: rockchip: add CAN-FD nodes for RK3588
[not found] <20260702140654.2961561-1-1579567540@qq.com>
2026-07-02 14:06 ` [PATCH v2 1/4] dt-bindings: can: rockchip: add rk3588 CAN-FD compatible 1579567540
2026-07-02 14:06 ` [PATCH v2 2/4] can: rockchip: add RK3588 CAN support 1579567540
@ 2026-07-02 14:06 ` 1579567540
2026-07-02 14:06 ` [PATCH v2 4/4] arm64: dts: rockchip: Enable CAN controller on RK3588-Tiger-Haikou 1579567540
3 siblings, 0 replies; 13+ messages in thread
From: 1579567540 @ 2026-07-02 14:06 UTC (permalink / raw)
To: Marc Kleine-Budde, linux-can
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Heiko Stuebner, Dmitry Torokhov, Shengjiu Wang,
Pengpeng Hou, Russell King, Eric Biggers, Mario Limonciello,
Karl Mehltretter, Yixun Lan, Stephen Boyd, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Cunhao Lu
From: Cunhao Lu <1579567540@qq.com>
Describe the three CAN-FD controllers integrated in RK3588 in the base
SoC .dtsi.
Add CAN0, CAN1 and CAN2 nodes with their register ranges, interrupts,
clocks and resets, and keep them disabled by default so board DTS files
can enable them as needed.
Signed-off-by: Cunhao Lu <1579567540@qq.com>
---
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 39 +++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
index fc1fdbfd3162..b340973775c5 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
@@ -2648,6 +2648,45 @@ dmac1: dma-controller@fea30000 {
#dma-cells = <1>;
};
+ can0: can@fea50000 {
+ compatible = "rockchip,rk3588-canfd";
+ reg = <0x0 0xfea50000 0x0 0x1000>;
+ interrupts = <GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&cru CLK_CAN0>, <&cru PCLK_CAN0>;
+ clock-names = "baud", "pclk";
+ resets = <&cru SRST_CAN0>, <&cru SRST_P_CAN0>;
+ reset-names = "core", "apb";
+ pinctrl-names = "default";
+ pinctrl-0 = <&can0m0_pins>;
+ status = "disabled";
+ };
+
+ can1: can@fea60000 {
+ compatible = "rockchip,rk3588-canfd";
+ reg = <0x0 0xfea60000 0x0 0x1000>;
+ interrupts = <GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&cru CLK_CAN1>, <&cru PCLK_CAN1>;
+ clock-names = "baud", "pclk";
+ resets = <&cru SRST_CAN1>, <&cru SRST_P_CAN1>;
+ reset-names = "core", "apb";
+ pinctrl-names = "default";
+ pinctrl-0 = <&can1m0_pins>;
+ status = "disabled";
+ };
+
+ can2: can@fea70000 {
+ compatible = "rockchip,rk3588-canfd";
+ reg = <0x0 0xfea70000 0x0 0x1000>;
+ interrupts = <GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&cru CLK_CAN2>, <&cru PCLK_CAN2>;
+ clock-names = "baud", "pclk";
+ resets = <&cru SRST_CAN2>, <&cru SRST_P_CAN2>;
+ reset-names = "core", "apb";
+ pinctrl-names = "default";
+ pinctrl-0 = <&can2m0_pins>;
+ status = "disabled";
+ };
+
i2c1: i2c@fea90000 {
compatible = "rockchip,rk3588-i2c", "rockchip,rk3399-i2c";
reg = <0x0 0xfea90000 0x0 0x1000>;
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v2 4/4] arm64: dts: rockchip: Enable CAN controller on RK3588-Tiger-Haikou
[not found] <20260702140654.2961561-1-1579567540@qq.com>
` (2 preceding siblings ...)
2026-07-02 14:06 ` [PATCH v2 3/4] arm64: dts: rockchip: add CAN-FD nodes for RK3588 1579567540
@ 2026-07-02 14:06 ` 1579567540
3 siblings, 0 replies; 13+ messages in thread
From: 1579567540 @ 2026-07-02 14:06 UTC (permalink / raw)
To: Marc Kleine-Budde, linux-can
Cc: Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, kernel,
Conor Dooley, Heiko Stuebner, Dmitry Torokhov, Shengjiu Wang,
Pengpeng Hou, Russell King, Eric Biggers, Mario Limonciello,
Karl Mehltretter, Yixun Lan, Stephen Boyd, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Heiko Stuebner,
Cunhao Lu
From: Heiko Stuebner <heiko.stuebner@cherry.de>
CAN0 is piped through the Q7-connector to the CAN-Header on the Haikou
base-board, so enable support for it there.
At least on RK3588-Tiger, the CAN clocks default to 99MHz, limiting
usable CAN bitrates without skew. Errata documentation mentions
300MHz as the default frequency on RK3568, so replicate this here
to allow more bitrates.
Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
Signed-off-by: Cunhao Lu <1579567540@qq.com>
---
arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
index 873fbeb8daa1..6273e695b039 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
@@ -155,6 +155,12 @@ vddd_audio_1v6: regulator-vddd-audio-1v6 {
};
};
+&can0 {
+ assigned-clocks = <&cru CLK_CAN0>;
+ assigned-clock-rates = <300000000>;
+ status = "okay";
+};
+
&combphy2_psu {
status = "okay";
};
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread