Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Enable CAN support on RK3588
@ 2026-06-30 16:43 Heiko Stuebner
  2026-06-30 16:43 ` [PATCH 1/6] dt-bindings: can: rockchip_canfd: add compatible for the RK3588 variant Heiko Stuebner
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Heiko Stuebner @ 2026-06-30 16:43 UTC (permalink / raw)
  To: mkl, mailhol
  Cc: kernel, robh, krzk+dt, conor+dt, heiko, shawn.lin, linux-can,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	quentin.schulz, zhangqing

The RK3588 uses basically the same CAN controller as the RK3588, except
the documentation stopped claiming for it to support CAN-FD.

So add a compatible to the binding, the basic driver support and the
errata I could test for so far + enable CAN on the Tiger-Haikou board.

I'm not sure if more errata apply, so I've added Elaine Zhang in Cc
to maybe add more information.


Heiko Stuebner (6):
  dt-bindings: can: rockchip_canfd: add compatible for the RK3588
    variant
  can: rockchip-canfd: add support for the RK3588 variant
  can: rockchip-canfd: enable erratum 6 on RK3588
  can: rockchip-canfd: enable erratum 5 on RK3588
  arm64: dts: rockchip: Add RK3588 CAN controller nodes
  arm64: dts: rockchip: Enable CAN controller on RK3588-Tiger-Haikou

 .../net/can/rockchip,rk3568v2-canfd.yaml      |  1 +
 arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 39 +++++++++++++++++++
 .../boot/dts/rockchip/rk3588-tiger-haikou.dts |  6 +++
 .../net/can/rockchip/rockchip_canfd-core.c    | 12 ++++++
 drivers/net/can/rockchip/rockchip_canfd.h     |  1 +
 5 files changed, 59 insertions(+)

-- 
2.47.3



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

* [PATCH 1/6] dt-bindings: can: rockchip_canfd: add compatible for the RK3588 variant
  2026-06-30 16:43 [PATCH 0/6] Enable CAN support on RK3588 Heiko Stuebner
@ 2026-06-30 16:43 ` Heiko Stuebner
  2026-07-01  7:33   ` Krzysztof Kozlowski
  2026-06-30 16:43 ` [PATCH 2/6] can: rockchip-canfd: add support " Heiko Stuebner
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Heiko Stuebner @ 2026-06-30 16:43 UTC (permalink / raw)
  To: mkl, mailhol
  Cc: kernel, robh, krzk+dt, conor+dt, heiko, shawn.lin, linux-can,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	quentin.schulz, zhangqing, Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

The RK3588 uses a variant of the CAN(-FD) controller introduced at first
with the RK3568 SoC.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 .../devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml     | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml b/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml
index a077c0330013..02211ea3ec41 100644
--- a/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml
+++ b/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml
@@ -20,6 +20,7 @@ properties:
       - items:
           - const: rockchip,rk3568v3-canfd
           - const: rockchip,rk3568v2-canfd
+      - const: rockchip,rk3588-canfd
 
   reg:
     maxItems: 1
-- 
2.47.3



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

* [PATCH 2/6] can: rockchip-canfd: add support for the RK3588 variant
  2026-06-30 16:43 [PATCH 0/6] Enable CAN support on RK3588 Heiko Stuebner
  2026-06-30 16:43 ` [PATCH 1/6] dt-bindings: can: rockchip_canfd: add compatible for the RK3588 variant Heiko Stuebner
@ 2026-06-30 16:43 ` Heiko Stuebner
  2026-06-30 16:43 ` [PATCH 3/6] can: rockchip-canfd: enable erratum 6 on RK3588 Heiko Stuebner
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2026-06-30 16:43 UTC (permalink / raw)
  To: mkl, mailhol
  Cc: kernel, robh, krzk+dt, conor+dt, heiko, shawn.lin, linux-can,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	quentin.schulz, zhangqing, Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

The RK3588 SoC uses a variant of this controller.

From the start it does not claim to support can-fd in any part of the
documentation, so it seems that is still broken.

Further errata will be enabled in subsequent patches, with more
in-depth explanation.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 drivers/net/can/rockchip/rockchip_canfd-core.c | 11 +++++++++++
 drivers/net/can/rockchip/rockchip_canfd.h      |  1 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/net/can/rockchip/rockchip_canfd-core.c b/drivers/net/can/rockchip/rockchip_canfd-core.c
index 29de0c01e4ed..707f387e7cf4 100644
--- a/drivers/net/can/rockchip/rockchip_canfd-core.c
+++ b/drivers/net/can/rockchip/rockchip_canfd-core.c
@@ -50,6 +50,12 @@ 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 =  /* Possibly more errata */
+		RKCANFD_QUIRK_CANFD_BROKEN,
+};
+
 static const char *__rkcanfd_get_model_str(enum rkcanfd_model model)
 {
 	switch (model) {
@@ -57,6 +63,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 +854,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.h b/drivers/net/can/rockchip/rockchip_canfd.h
index 93131c7d7f54..92566822e141 100644
--- a/drivers/net/can/rockchip/rockchip_canfd.h
+++ b/drivers/net/can/rockchip/rockchip_canfd.h
@@ -434,6 +434,7 @@
 enum rkcanfd_model {
 	RKCANFD_MODEL_RK3568V2 = 0x35682,
 	RKCANFD_MODEL_RK3568V3 = 0x35683,
+	RKCANFD_MODEL_RK3588 = 0x3588,
 };
 
 struct rkcanfd_devtype_data {
-- 
2.47.3



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

* [PATCH 3/6] can: rockchip-canfd: enable erratum 6 on RK3588
  2026-06-30 16:43 [PATCH 0/6] Enable CAN support on RK3588 Heiko Stuebner
  2026-06-30 16:43 ` [PATCH 1/6] dt-bindings: can: rockchip_canfd: add compatible for the RK3588 variant Heiko Stuebner
  2026-06-30 16:43 ` [PATCH 2/6] can: rockchip-canfd: add support " Heiko Stuebner
@ 2026-06-30 16:43 ` Heiko Stuebner
  2026-06-30 16:43 ` [PATCH 4/6] can: rockchip-canfd: enable erratum 5 " Heiko Stuebner
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2026-06-30 16:43 UTC (permalink / raw)
  To: mkl, mailhol
  Cc: kernel, robh, krzk+dt, conor+dt, heiko, shawn.lin, linux-can,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	quentin.schulz, zhangqing, Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

Sending extended CAN frames from the RK3588's CAN controller, sometimes
sends standard frames, as explained in the erratum's description:

  can0  00001234   [4]  DE AD BE EF
  can0  00000001   [4]  DE AD BE EF
  can0  000007FF   [4]  DE AD BE EF
  can0  00000800   [4]  DE AD BE EF
  can0  1FFFFFFF   [4]  DE AD BE EF
  can0  12345678   [4]  DE AD BE EF
  can0       234   [4]  DE AD BE EF
  can0  00000001   [4]  DE AD BE EF

Enabling the erratum, introduces the correct behaviour in re-sending the
frame:

  can0  1FFFFFFF   [4]  DE AD BE EF
  can0  12345678   [4]  DE AD BE EF
  can0       234   [4]  DE AD BE EF
  can0  00001234   [4]  DE AD BE EF
  can0  00000001   [4]  DE AD BE EF

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 drivers/net/can/rockchip/rockchip_canfd-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/rockchip/rockchip_canfd-core.c b/drivers/net/can/rockchip/rockchip_canfd-core.c
index 707f387e7cf4..105ca4d5cbef 100644
--- a/drivers/net/can/rockchip/rockchip_canfd-core.c
+++ b/drivers/net/can/rockchip/rockchip_canfd-core.c
@@ -53,6 +53,7 @@ static const struct rkcanfd_devtype_data rkcanfd_devtype_data_rk3568v3 = {
 static const struct rkcanfd_devtype_data rkcanfd_devtype_data_rk3588 = {
 	.model = RKCANFD_MODEL_RK3588,
 	.quirks =  /* Possible more Errata */
+		RKCANFD_QUIRK_RK3568_ERRATUM_6,
 		RKCANFD_QUIRK_CANFD_BROKEN,
 };
 
-- 
2.47.3



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

* [PATCH 4/6] can: rockchip-canfd: enable erratum 5 on RK3588
  2026-06-30 16:43 [PATCH 0/6] Enable CAN support on RK3588 Heiko Stuebner
                   ` (2 preceding siblings ...)
  2026-06-30 16:43 ` [PATCH 3/6] can: rockchip-canfd: enable erratum 6 on RK3588 Heiko Stuebner
@ 2026-06-30 16:43 ` Heiko Stuebner
  2026-06-30 16:43 ` [PATCH 5/6] arm64: dts: rockchip: Add RK3588 CAN controller nodes Heiko Stuebner
  2026-06-30 16:43 ` [PATCH 6/6] arm64: dts: rockchip: Enable CAN controller on RK3588-Tiger-Haikou Heiko Stuebner
  5 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2026-06-30 16:43 UTC (permalink / raw)
  To: mkl, mailhol
  Cc: kernel, robh, krzk+dt, conor+dt, heiko, shawn.lin, linux-can,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	quentin.schulz, zhangqing, Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

Lowering the clock-frequency as described in the erratum, also
leads to empty RX-fifos immediately, indicating that the
erratum is also present on the RK3588 variant.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 drivers/net/can/rockchip/rockchip_canfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/rockchip/rockchip_canfd-core.c b/drivers/net/can/rockchip/rockchip_canfd-core.c
index 105ca4d5cbef..f3c8b54a9f02 100644
--- a/drivers/net/can/rockchip/rockchip_canfd-core.c
+++ b/drivers/net/can/rockchip/rockchip_canfd-core.c
@@ -53,7 +53,7 @@ static const struct rkcanfd_devtype_data rkcanfd_devtype_data_rk3568v3 = {
 static const struct rkcanfd_devtype_data rkcanfd_devtype_data_rk3588 = {
 	.model = RKCANFD_MODEL_RK3588,
 	.quirks =  /* Possible more Errata */
-		RKCANFD_QUIRK_RK3568_ERRATUM_6,
+		RKCANFD_QUIRK_RK3568_ERRATUM_5 | RKCANFD_QUIRK_RK3568_ERRATUM_6,
 		RKCANFD_QUIRK_CANFD_BROKEN,
 };
 
-- 
2.47.3



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

* [PATCH 5/6] arm64: dts: rockchip: Add RK3588 CAN controller nodes
  2026-06-30 16:43 [PATCH 0/6] Enable CAN support on RK3588 Heiko Stuebner
                   ` (3 preceding siblings ...)
  2026-06-30 16:43 ` [PATCH 4/6] can: rockchip-canfd: enable erratum 5 " Heiko Stuebner
@ 2026-06-30 16:43 ` Heiko Stuebner
  2026-06-30 16:43 ` [PATCH 6/6] arm64: dts: rockchip: Enable CAN controller on RK3588-Tiger-Haikou Heiko Stuebner
  5 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2026-06-30 16:43 UTC (permalink / raw)
  To: mkl, mailhol
  Cc: kernel, robh, krzk+dt, conor+dt, heiko, shawn.lin, linux-can,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	quentin.schulz, zhangqing, Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

The RK3588 has 3 CAN controllers, so add the core nodes for them.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 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..ba82e2f057d2 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";
+		pinctrl-names = "default";
+		pinctrl-0 = <&can0m0_pins>;
+		resets = <&cru SRST_CAN0>, <&cru SRST_P_CAN0>;
+		reset-names = "can", "apb";
+		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";
+		pinctrl-names = "default";
+		pinctrl-0 = <&can1m0_pins>;
+		resets = <&cru SRST_CAN1>, <&cru SRST_P_CAN1>;
+		reset-names = "can", "apb";
+		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";
+		pinctrl-names = "default";
+		pinctrl-0 = <&can2m0_pins>;
+		resets = <&cru SRST_CAN2>, <&cru SRST_P_CAN2>;
+		reset-names = "can", "apb";
+		status = "disabled";
+	};
+
 	i2c1: i2c@fea90000 {
 		compatible = "rockchip,rk3588-i2c", "rockchip,rk3399-i2c";
 		reg = <0x0 0xfea90000 0x0 0x1000>;
-- 
2.47.3



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

* [PATCH 6/6] arm64: dts: rockchip: Enable CAN controller on RK3588-Tiger-Haikou
  2026-06-30 16:43 [PATCH 0/6] Enable CAN support on RK3588 Heiko Stuebner
                   ` (4 preceding siblings ...)
  2026-06-30 16:43 ` [PATCH 5/6] arm64: dts: rockchip: Add RK3588 CAN controller nodes Heiko Stuebner
@ 2026-06-30 16:43 ` Heiko Stuebner
  5 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2026-06-30 16:43 UTC (permalink / raw)
  To: mkl, mailhol
  Cc: kernel, robh, krzk+dt, conor+dt, heiko, shawn.lin, linux-can,
	devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	quentin.schulz, zhangqing, Heiko Stuebner

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>
---
 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.47.3



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

* Re: [PATCH 1/6] dt-bindings: can: rockchip_canfd: add compatible for the RK3588 variant
  2026-06-30 16:43 ` [PATCH 1/6] dt-bindings: can: rockchip_canfd: add compatible for the RK3588 variant Heiko Stuebner
@ 2026-07-01  7:33   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-01  7:33 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: mkl, mailhol, kernel, robh, krzk+dt, conor+dt, shawn.lin,
	linux-can, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, quentin.schulz, zhangqing, Heiko Stuebner

On Tue, Jun 30, 2026 at 06:43:31PM +0200, Heiko Stuebner wrote:
> From: Heiko Stuebner <heiko.stuebner@cherry.de>
> 
> The RK3588 uses a variant of the CAN(-FD) controller introduced at first
> with the RK3568 SoC.
> 
> Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
> ---
>  .../devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml     | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml b/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml
> index a077c0330013..02211ea3ec41 100644
> --- a/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml
> +++ b/Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml
> @@ -20,6 +20,7 @@ properties:
>        - items:
>            - const: rockchip,rk3568v3-canfd
>            - const: rockchip,rk3568v2-canfd
> +      - const: rockchip,rk3588-canfd

So this is just an enum with the first entry.

Best regards,
Krzysztof



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

end of thread, other threads:[~2026-07-01  7:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30 16:43 [PATCH 0/6] Enable CAN support on RK3588 Heiko Stuebner
2026-06-30 16:43 ` [PATCH 1/6] dt-bindings: can: rockchip_canfd: add compatible for the RK3588 variant Heiko Stuebner
2026-07-01  7:33   ` Krzysztof Kozlowski
2026-06-30 16:43 ` [PATCH 2/6] can: rockchip-canfd: add support " Heiko Stuebner
2026-06-30 16:43 ` [PATCH 3/6] can: rockchip-canfd: enable erratum 6 on RK3588 Heiko Stuebner
2026-06-30 16:43 ` [PATCH 4/6] can: rockchip-canfd: enable erratum 5 " Heiko Stuebner
2026-06-30 16:43 ` [PATCH 5/6] arm64: dts: rockchip: Add RK3588 CAN controller nodes Heiko Stuebner
2026-06-30 16:43 ` [PATCH 6/6] arm64: dts: rockchip: Enable CAN controller on RK3588-Tiger-Haikou Heiko Stuebner

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