Skip to contentSkip to conversation

Add support for Allwinner D1 CAN controllers

PATCH In review John Watts 7 participants 20 messages Jul 21, 2023 – Sep 1, 2023

Subsystems (6)
lore
Share & tools
lore

John Watts

author
#0 lore raw

v2 cover Add support for Allwinner D1 CAN controllers

This patch series adds support for the Allwinner D1 CAN controllers. It requires adding a new device tree compatible and driver support to work around some hardware quirks.

This has been tested on the Mango Pi MQ Dual running a T113 and a Lichee Panel 86 running a D1.

Changes in v2:
- Re-ordered patches to work with bisecting
- Fixed device tree label underscores
- Fixed email headers

John Watts (4):
dt-bindings: net: can: Add support for Allwinner D1 CAN controller
riscv: dts: allwinner: d1: Add CAN controller nodes
can: sun4i_can: Add acceptance register quirk
can: sun4i_can: Add support for the Allwinner D1

 .../net/can/allwinner,sun4i-a10-can.yaml      |  6 ++--
 .../boot/dts/allwinner/sunxi-d1s-t113.dtsi    | 30 +++++++++++++++++++
 drivers/net/can/Kconfig                       |  4 +--
 drivers/net/can/sun4i_can.c                   | 22 ++++++++++++--
 4 files changed, 55 insertions(+), 7 deletions(-)
Signature · 1 line
2.41.0
author
#1 lore raw

PATCH v2 1/4 dt-bindings: net: can: Add support for Allwinner D1 CAN controller

The Allwinner D1 has two CAN controllers, both a variant of the R40 controller. Unfortunately the registers for the D1 controllers are moved around enough to be incompatible and require a new compatible.

Introduce the "allwinner,sun20i-d1-can" compatible to support this.

---
 .../bindings/net/can/allwinner,sun4i-a10-can.yaml           | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/net/can/allwinner,sun4i-a10-can.yaml +4 -2
index 9c494957a07a..e42ea28d6ab4 100644
@@ -21,6 +21,7 @@ properties:
           - const: allwinner,sun4i-a10-can
       - const: allwinner,sun4i-a10-can
       - const: allwinner,sun8i-r40-can
+      - const: allwinner,sun20i-d1-can
 
   reg:
     maxItems: 1
@@ -37,8 +38,9 @@ properties:
 if:
   properties:
     compatible:
-      contains:
-        const: allwinner,sun8i-r40-can
+      enum:
+        - allwinner,sun8i-r40-can
+        - allwinner,sun20i-d1-can
 
 then:
   required:
Signature · 1 line
2.41.0
Acked-by on v2 1/4
#2 lore raw

Re: [PATCH v2 1/4] dt-bindings: net: can: Add support for Allwinner D1 CAN controller

Quoted 8 lines · John Watts

The Allwinner D1 has two CAN controllers, both a variant of the R40 controller. Unfortunately the registers for the D1 controllers are moved around enough to be incompatible and require a new compatible.

Introduce the "allwinner,sun20i-d1-can" compatible to support this.

---

Best regards,
Krzysztof

author
#3 lore raw

PATCH v2 2/4 riscv: dts: allwinner: d1: Add CAN controller nodes

In reply to John Watts

The Allwinner D1, T113 provide two CAN controllers that are variants of the R40 controller.

I have tested support for these controllers on two boards:

- A Lichee Panel RV 86 Panel running a D1 chip
- A Mango Pi MQ Dual running a T113-s3 chip

Both of these fully support both CAN controllers.

---
 .../boot/dts/allwinner/sunxi-d1s-t113.dtsi    | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +30 -0
index 1bb1e5cae602..4086c0cc0f9d 100644
@@ -131,6 +131,18 @@ uart3_pb_pins: uart3-pb-pins {
 				pins = "PB6", "PB7";
 				function = "uart3";
 			};
+
+			/omit-if-no-ref/
+			can0_pins: can0-pins {
+				pins = "PB2", "PB3";
+				function = "can0";
+			};
+
+			/omit-if-no-ref/
+			can1_pins: can1-pins {
+				pins = "PB4", "PB5";
+				function = "can1";
+			};
 		};
 
 		ccu: clock-controller@2001000 {
@@ -879,5 +891,23 @@ rtc: rtc@7090000 {
 			clock-names = "bus", "hosc", "ahb";
 			#clock-cells = <1>;
 		};
+
+		can0: can@2504000 {
+			compatible = "allwinner,sun20i-d1-can";
+			reg = <0x02504000 0x400>;
+			interrupts = <SOC_PERIPHERAL_IRQ(21) IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_CAN0>;
+			resets = <&ccu RST_BUS_CAN0>;
+			status = "disabled";
+		};
+
+		can1: can@2504400 {
+			compatible = "allwinner,sun20i-d1-can";
+			reg = <0x02504400 0x400>;
+			interrupts = <SOC_PERIPHERAL_IRQ(22) IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_CAN1>;
+			resets = <&ccu RST_BUS_CAN1>;
+			status = "disabled";
+		};
 	};
 };
Signature · 1 line
2.41.0
author
#4 lore raw

Re: [PATCH v2 2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

Quoted 5 lines · John Watts

...

arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +4 -0
+			/omit-if-no-ref/
+			can0_pins: can0-pins {
+				pins = "PB2", "PB3";
+				function = "can0";

arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi rtc: rtc@7090000 { · line 902

Quoted 10 lines
arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +9 -0
+			};
...
+		can0: can@2504000 {
+			compatible = "allwinner,sun20i-d1-can";
+			reg = <0x02504000 0x400>;
+			interrupts = <SOC_PERIPHERAL_IRQ(21) IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_CAN0>;
+			resets = <&ccu RST_BUS_CAN0>;
+			status = "disabled";
+		};

Just a quick late night question to people with more knowledge than me:

These chips only have one pinctrl configuration for can0 and can1. Should the can nodes have this pre-set instead of the board dts doing this?

I see this happening in sun4i-a10.dtsi for instance, but it also seems like it could become a problem when it comes to re-using the dtsi for newer chip variants.

John.

maintainer
#5 lore raw

Re: [PATCH v2 2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

Dne nedelja, 23. julij 2023 ob 11:18:33 CEST je John Watts napisal(a):

Quoted 12 lines · John Watts

arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi uart3_pb_pins: uart3-pb-pins {

Quoted 11 lines

...

arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +9 -0
+			/omit-if-no-ref/
+			can0_pins: can0-pins {
+				pins = "PB2", "PB3";
+				function = "can0";
+			};
...
+		can0: can@2504000 {
+			compatible = "allwinner,sun20i-d1-can";
+			reg = <0x02504000 0x400>;
+			interrupts = <SOC_PERIPHERAL_IRQ(21) 

IRQ_TYPE_LEVEL_HIGH>;

Quoted 9 lines

arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi rtc: rtc@7090000 { · line 902

Quoted 4 lines
arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +4 -0
+			clocks = <&ccu CLK_BUS_CAN0>;
+			resets = <&ccu RST_BUS_CAN0>;
+			status = "disabled";
+		};

Just a quick late night question to people with more knowledge than me:

These chips only have one pinctrl configuration for can0 and can1. Should the can nodes have this pre-set instead of the board dts doing this?

Yes, that's usually how it's done.

Quoted 4 lines

I see this happening in sun4i-a10.dtsi for instance, but it also seems like it could become a problem when it comes to re-using the dtsi for newer chip variants.

Properties can be either rewritten or deleted further down, so don't worry about that.

Best regards,
Jernej

Quoted 2 lines

John.

author
#6 lore raw

Re: [PATCH v2 2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

Quoted 7 lines · Jernej Škrabec

Yes, that's usually how it's done.

Quoted 4 lines

I see this happening in sun4i-a10.dtsi for instance, but it also seems like it could become a problem when it comes to re-using the dtsi for newer chip variants.

Quoted 8 lines

Properties can be either rewritten or deleted further down, so don't worry about that.

Best regards,
Jernej

Quoted 2 lines

John.

Thanks for the feedback, I've sent a patch to address this.

John.

#7 lore raw

Re: [PATCH v2 2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

In reply to John Watts

Hi John, Jernej

Quoted 8 lines · John Watts

...

arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +3 -0
@@ -131,6 +131,18 @@ uart3_pb_pins: uart3-pb-pins {
 				pins = "PB6", "PB7";
 				function = "uart3";
 			};
+
+			/omit-if-no-ref/
+			can0_pins: can0-pins {

arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi uart3_pb_pins: uart3-pb-pins { · line 145

Quoted 10 lines
arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +9 -0
+				pins = "PB2", "PB3";
+				function = "can0";
+			};
+
+			/omit-if-no-ref/
+			can1_pins: can1-pins {
+				pins = "PB4", "PB5";
+				function = "can1";
+			};
...

Should we also keep a pinctrl nodes itself in alphabetical order? I mean placing a CAN nodes before clk_pg11_pin node? Looks like the other nodes sorted in this way...

Cheers,
Maksim

author
#8 lore raw

Re: [PATCH v2 2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

Quoted 4 lines · Maksim Kiselev

Hi John, Jernej
Should we also keep a pinctrl nodes itself in alphabetical order? I mean placing a CAN nodes before clk_pg11_pin node? Looks like the other nodes sorted in this way...

Good catch. Now that you mention it, the device tree nodes are sorted by memory order too! These should be after i2c3.

It looks like I might need to do a patch to re-order those too.

Quoted 2 lines

Cheers,
Maksim

John.

maintainer
#9 lore raw

Re: [PATCH v2 2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

Dne sobota, 05. avgust 2023 ob 18:51:53 CEST je John Watts napisal(a):

Quoted 10 lines · Maksim Kiselev
Quoted 4 lines

Hi John, Jernej
Should we also keep a pinctrl nodes itself in alphabetical order? I mean placing a CAN nodes before clk_pg11_pin node? Looks like the other nodes sorted in this way...

Good catch. Now that you mention it, the device tree nodes are sorted by memory order too! These should be after i2c3.

It looks like I might need to do a patch to re-order those too.

It would be better if DT patches are dropped from netdev tree and then post new versions.

Best regards,
Jernej

Quoted 5 lines
Quoted 3 lines

Cheers,
Maksim

John.

author
#10 lore raw

Re: [PATCH v2 2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

Quoted 10 lines · Jernej Škrabec

Dne sobota, 05. avgust 2023 ob 18:51:53 CEST je John Watts napisal(a):

Quoted 9 lines · Maksim Kiselev
Quoted 4 lines

Hi John, Jernej
Should we also keep a pinctrl nodes itself in alphabetical order? I mean placing a CAN nodes before clk_pg11_pin node? Looks like the other nodes sorted in this way...

Good catch. Now that you mention it, the device tree nodes are sorted by memory order too! These should be after i2c3.

Quoted 7 lines
Quoted 1 line

It looks like I might need to do a patch to re-order those too.

It would be better if DT patches are dropped from netdev tree and then post new versions.

Best regards,
Jernej

Agreed. Is there a way to request that? Or will the maintainer just read this?

John.

maintainer
#11 lore raw

Re: [PATCH v2 2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

Dne nedelja, 06. avgust 2023 ob 08:33:45 CEST je John Watts napisal(a):

Quoted 17 lines · Jernej Škrabec
Quoted 16 lines

Dne sobota, 05. avgust 2023 ob 18:51:53 CEST je John Watts napisal(a):

Quoted 10 lines · Maksim Kiselev
Quoted 4 lines

Hi John, Jernej
Should we also keep a pinctrl nodes itself in alphabetical order? I mean placing a CAN nodes before clk_pg11_pin node? Looks like the other nodes sorted in this way...

Good catch. Now that you mention it, the device tree nodes are sorted by memory order too! These should be after i2c3.

It looks like I might need to do a patch to re-order those too.

It would be better if DT patches are dropped from netdev tree and then post
new versions.

Quoted 5 lines
Quoted 2 lines

Best regards,
Jernej

Agreed. Is there a way to request that? Or will the maintainer just read this?

Hopefully it will.

Best regards,
Jernej

#12 lore raw

Re: [PATCH v2 2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

Quoted 18 lines · Jernej Škrabec

Dne nedelja, 06. avgust 2023 ob 08:33:45 CEST je John Watts napisal(a):

Quoted 17 lines · Jernej Škrabec
Quoted 16 lines

Dne sobota, 05. avgust 2023 ob 18:51:53 CEST je John Watts napisal(a):

Quoted 10 lines · Maksim Kiselev
Quoted 4 lines

Hi John, Jernej
Should we also keep a pinctrl nodes itself in alphabetical order? I mean placing a CAN nodes before clk_pg11_pin node? Looks like the other nodes sorted in this way...

Good catch. Now that you mention it, the device tree nodes are sorted by memory order too! These should be after i2c3.

It looks like I might need to do a patch to re-order those too.

It would be better if DT patches are dropped from netdev tree and then post
new versions.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Best regards,
Jernej

Agreed. Is there a way to request that? Or will the maintainer just read this?

Hopefully it will.

I'm just catching up on last week's post (I had a long off-line weekend).

I'll revert the DT changes and send a PR to net-next.

Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |
#13 lore raw

Re: [PATCH v2 2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

Quoted 25 lines · Marc Kleine-Budde
Quoted 24 lines · Jernej Škrabec

Dne nedelja, 06. avgust 2023 ob 08:33:45 CEST je John Watts napisal(a):

Quoted 22 lines · Jernej Škrabec
Quoted 10 lines

Dne sobota, 05. avgust 2023 ob 18:51:53 CEST je John Watts napisal(a):

Quoted 9 lines · Maksim Kiselev
Quoted 4 lines

Hi John, Jernej
Should we also keep a pinctrl nodes itself in alphabetical order? I mean placing a CAN nodes before clk_pg11_pin node? Looks like the other nodes sorted in this way...

Good catch. Now that you mention it, the device tree nodes are sorted by memory order too! These should be after i2c3.

Quoted 8 lines
Quoted 1 line

It looks like I might need to do a patch to re-order those too.

It would be better if DT patches are dropped from netdev tree and then post
new versions.

Best regards,
Jernej

Agreed. Is there a way to request that? Or will the maintainer just read this?

Quoted 6 lines
Quoted 1 line

Hopefully it will.

I'm just catching up on last week's post (I had a long off-line weekend).

I'll revert the DT changes and send a PR to net-next.

Here's the revert:

| https://lore.kernel.org/all/20230807-riscv-allwinner-d1-revert-can-controller-nodes-v1-1-eb3f70b435d9@pengutronix.de/

Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |
author
#14 lore raw

PATCH v2 3/4 can: sun4i_can: Add acceptance register quirk

In reply to John Watts

The Allwinner D1's CAN controllers have the ACPC and ACPM registers moved down. Compensate for this by adding an offset quirk for the acceptance registers.

---
 drivers/net/can/sun4i_can.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/can/sun4i_can.c +8 -2
index 0827830bbf28..1f90fe6dbb8b 100644
@@ -205,9 +205,11 @@
  * struct sun4ican_quirks - Differences between SoC variants.
  *
  * @has_reset: SoC needs reset deasserted.
+ * @acp_offset: Offset of ACPC and ACPM registers
  */
 struct sun4ican_quirks {
 	bool has_reset;
+	int acp_offset;
 };
 
 struct sun4ican_priv {
@@ -216,6 +218,7 @@ struct sun4ican_priv {
 	struct clk *clk;
 	struct reset_control *reset;
 	spinlock_t cmdreg_lock;	/* lock for concurrent cmd register writes */
+	int acp_offset;
 };
 
 static const struct can_bittiming_const sun4ican_bittiming_const = {
@@ -338,8 +341,8 @@ static int sun4i_can_start(struct net_device *dev)
 	}
 
 	/* set filters - we accept all */
-	writel(0x00000000, priv->base + SUN4I_REG_ACPC_ADDR);
-	writel(0xFFFFFFFF, priv->base + SUN4I_REG_ACPM_ADDR);
+	writel(0x00000000, priv->base + SUN4I_REG_ACPC_ADDR + priv->acp_offset);
+	writel(0xFFFFFFFF, priv->base + SUN4I_REG_ACPM_ADDR + priv->acp_offset);
 
 	/* clear error counters and error code capture */
 	writel(0, priv->base + SUN4I_REG_ERRC_ADDR);
@@ -768,10 +771,12 @@ static const struct ethtool_ops sun4ican_ethtool_ops = {
 
 static const struct sun4ican_quirks sun4ican_quirks_a10 = {
 	.has_reset = false,
+	.acp_offset = 0,
 };
 
 static const struct sun4ican_quirks sun4ican_quirks_r40 = {
 	.has_reset = true,
+	.acp_offset = 0,
 };
 
 static const struct of_device_id sun4ican_of_match[] = {
@@ -870,6 +875,7 @@ static int sun4ican_probe(struct platform_device *pdev)
 	priv->base = addr;
 	priv->clk = clk;
 	priv->reset = reset;
+	priv->acp_offset = quirks->acp_offset;
 	spin_lock_init(&priv->cmdreg_lock);
 
 	platform_set_drvdata(pdev, dev);
Signature · 1 line
2.41.0
author
#15 lore raw

PATCH v2 4/4 can: sun4i_can: Add support for the Allwinner D1

In reply to John Watts

The controllers present in the D1 are extremely similar to the R40 and require the same reset quirks, but An extra quirk is needed to support receiving packets.

---
 drivers/net/can/Kconfig     |  4 ++--
 drivers/net/can/sun4i_can.c | 12 +++++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)
drivers/net/can/Kconfig +2 -2
index a5c5036dfb94..e626de33e735 100644
@@ -185,10 +185,10 @@ config CAN_SLCAN
 
 config CAN_SUN4I
 	tristate "Allwinner A10 CAN controller"
-	depends on MACH_SUN4I || MACH_SUN7I || COMPILE_TEST
+	depends on MACH_SUN4I || MACH_SUN7I || RISCV || COMPILE_TEST
 	help
 	  Say Y here if you want to use CAN controller found on Allwinner
-	  A10/A20 SoCs.
+	  A10/A20/D1 SoCs.
 
 	  To compile this driver as a module, choose M here: the module will
 	  be called sun4i_can.
drivers/net/can/sun4i_can.c +11 -1
index 1f90fe6dbb8b..c508a328e38d 100644
@@ -91,6 +91,8 @@
 #define SUN4I_REG_BUF12_ADDR	0x0070	/* CAN Tx/Rx Buffer 12 */
 #define SUN4I_REG_ACPC_ADDR	0x0040	/* CAN Acceptance Code 0 */
 #define SUN4I_REG_ACPM_ADDR	0x0044	/* CAN Acceptance Mask 0 */
+#define SUN4I_REG_ACPC_ADDR_D1	0x0028	/* CAN Acceptance Code 0 on the D1 */
+#define SUN4I_REG_ACPM_ADDR_D1	0x002C	/* CAN Acceptance Mask 0 on the D1 */
 #define SUN4I_REG_RBUF_RBACK_START_ADDR	0x0180	/* CAN transmit buffer start */
 #define SUN4I_REG_RBUF_RBACK_END_ADDR	0x01b0	/* CAN transmit buffer end */
 
@@ -779,6 +781,11 @@ static const struct sun4ican_quirks sun4ican_quirks_r40 = {
 	.acp_offset = 0,
 };
 
+static const struct sun4ican_quirks sun4ican_quirks_d1 = {
+	.has_reset = true,
+	.acp_offset = (SUN4I_REG_ACPC_ADDR_D1 - SUN4I_REG_ACPC_ADDR),
+};
+
 static const struct of_device_id sun4ican_of_match[] = {
 	{
 		.compatible = "allwinner,sun4i-a10-can",
@@ -789,6 +796,9 @@ static const struct of_device_id sun4ican_of_match[] = {
 	}, {
 		.compatible = "allwinner,sun8i-r40-can",
 		.data = &sun4ican_quirks_r40
+	}, {
+		.compatible = "allwinner,sun20i-d1-can",
+		.data = &sun4ican_quirks_d1
 	}, {
 		/* sentinel */
 	},
@@ -913,4 +923,4 @@ module_platform_driver(sun4i_can_driver);
 MODULE_AUTHOR("Peter Chen <[email protected]>");
 MODULE_AUTHOR("Gerhard Bertelsmann <[email protected]>");
 MODULE_LICENSE("Dual BSD/GPL");
-MODULE_DESCRIPTION("CAN driver for Allwinner SoCs (A10/A20)");
+MODULE_DESCRIPTION("CAN driver for Allwinner SoCs (A10/A20/D1)");
Signature · 1 line
2.41.0
#16 lore raw

Re: [PATCH v2 4/4] can: sun4i_can: Add support for the Allwinner D1

Hi John,

Quoted 5 lines · John Watts

The controllers present in the D1 are extremely similar to the R40 and require the same reset quirks, but An extra quirk is needed to support receiving packets.

Thanks for your patch, which is now commit 8abb95250ae6af2d ("can:
sun4i_can: Add support for the Allwinner D1") in linux-can-next/master.

drivers/net/can/Kconfig config CAN_SLCAN · line 188

Quoted 8 lines
drivers/net/can/Kconfig +1 -1
@@ -185,10 +185,10 @@ config CAN_SLCAN
 
 config CAN_SUN4I
        tristate "Allwinner A10 CAN controller"
-       depends on MACH_SUN4I || MACH_SUN7I || COMPILE_TEST
+       depends on MACH_SUN4I || MACH_SUN7I || RISCV || COMPILE_TEST

This makes this question pop up when configuring a kernel for any RISC-V platform, not just for Allwinner RISC-V platforms.

In comparison, drivers/clk/sunxi-ng/Kconfig does have some

    depends on MACH_SUN<foo>I || RISCV || COMPILE_TEST

but these are gated by ARCH_SUNXI at the top of the file.

I'm not sure what's the best way to fix this:
- Replace RISCV by ARCH_SUNXI?
This would expose it on more ARM sun<foo>i platforms, making the MACH_SUN4I || MACH_SUN7I superfluous?
- Replace RISCV by RISCV && ARCH_SUNXI?

Thanks for your comments!

drivers/net/can/Kconfig config CAN_SLCAN · line 194

Quoted 7 lines
drivers/net/can/Kconfig +1 -1
        help
          Say Y here if you want to use CAN controller found on Allwinner
-         A10/A20 SoCs.
+         A10/A20/D1 SoCs.
 
          To compile this driver as a module, choose M here: the module will
          be called sun4i_can.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
author
#17 lore raw

Re: [PATCH v2 4/4] can: sun4i_can: Add support for the Allwinner D1

Quoted 4 lines · Geert Uytterhoeven

Hi John,

This makes this question pop up when configuring a kernel for any RISC-V platform, not just for Allwinner RISC-V platforms.

Oh dear.

Quoted 5 lines

In comparison, drivers/clk/sunxi-ng/Kconfig does have some

    depends on MACH_SUN<foo>I || RISCV || COMPILE_TEST

but these are gated by ARCH_SUNXI at the top of the file.

Ah, that is what I copied.

Quoted 5 lines

I'm not sure what's the best way to fix this:
- Replace RISCV by ARCH_SUNXI?
This would expose it on more ARM sun<foo>i platforms, making the MACH_SUN4I || MACH_SUN7I superfluous?
- Replace RISCV by RISCV && ARCH_SUNXI?

I'm not sure what the best approach here is. Just having it require ARCH_SUNXI would make sense to me but I'm not too sure why where's so many different MACH here in the first place.

Quoted 7 lines

Thanks for your comments!

Quoted 5 lines

help
Say Y here if you want to use CAN controller found on Allwinner

drivers/net/can/Kconfig +1 -1
-         A10/A20 SoCs.
+         A10/A20/D1 SoCs.
Quoted 6 lines
Quoted 2 lines

To compile this driver as a module, choose M here: the module will be called sun4i_can.

Gr{oetje,eeting}s,

Geert

John.

#18 lore raw
In reply to John Watts
Quoted 6 lines · John Watts

This patch series adds support for the Allwinner D1 CAN controllers. It requires adding a new device tree compatible and driver support to work around some hardware quirks.

This has been tested on the Mango Pi MQ Dual running a T113 and a Lichee Panel 86 running a D1.

Applied to linux-can-next/testing.

regards,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |
#19 lore raw
In reply to John Watts
This series was applied to riscv/linux.git (fixes) by Marc Kleine-Budde <[email protected]>:

Hello:

This series was applied to riscv/linux.git (fixes) by Marc Kleine-Budde <[email protected]>:

Quoted 8 lines · On Sat, 22 Jul 2023 08:15:49 +1000 you wrote:

This patch series adds support for the Allwinner D1 CAN controllers. It requires adding a new device tree compatible and driver support to work around some hardware quirks.

This has been tested on the Mango Pi MQ Dual running a T113 and a Lichee Panel 86 running a D1.

[...]

Here is the summary with links:
- [v2,1/4] dt-bindings: net: can: Add support for Allwinner D1 CAN controller (no matching commit)
- [v2,2/4] riscv: dts: allwinner: d1: Add CAN controller nodes

    https://git.kernel.org/riscv/c/6ea1ad888f59

- [v2,3/4] can: sun4i_can: Add acceptance register quirk (no matching commit)
- [v2,4/4] can: sun4i_can: Add support for the Allwinner D1 (no matching commit)

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html