diff mbox series

[v3] riscv: dts: allwinner: d1: Add CAN controller nodes

Message ID 20230807191952.2019208-1-contact@jookia.org (mailing list archive)
State New, archived
Headers show
Series [v3] riscv: dts: allwinner: d1: Add CAN controller nodes | expand

Commit Message

John Watts Aug. 7, 2023, 7:19 p.m. UTC
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.

Signed-off-by: John Watts <contact@jookia.org>
---
Changes in v3:
- Set default pinctrl for can controller
- Moved can nodes to proper location
- Moved can pins to proper location

 .../boot/dts/allwinner/sunxi-d1s-t113.dtsi    | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)

Comments

Markus Elfring Aug. 8, 2023, 2:26 p.m. UTC | #1
> Both of these fully support both CAN controllers.

Please choose a corresponding imperative change suggestion.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.5-rc5#n94


> Signed-off-by: John Watts <contact@jookia.org>

I find the local-part of this email address suspicious according to the Developer's Certificate of Origin.
Should it usually indicate an unique person instead of the shown key word?

Regards,
Markus
Conor Dooley Aug. 8, 2023, 2:32 p.m. UTC | #2
On Tue, Aug 08, 2023 at 04:26:17PM +0200, Markus Elfring wrote:
> …
> > Both of these fully support both CAN controllers.
> 
> Please choose a corresponding imperative change suggestion.
> 
> See also:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.5-rc5#n94
> 
> 
> > Signed-off-by: John Watts <contact@jookia.org>
> 
> I find the local-part of this email address suspicious according to the Developer's Certificate of Origin.
> Should it usually indicate an unique person instead of the shown key word?

Markus, please stop bothering developers with nuisance comments.
Marc Kleine-Budde Aug. 8, 2023, 2:36 p.m. UTC | #3
On 08.08.2023 16:26:17, Markus Elfring wrote:
> …
> > Both of these fully support both CAN controllers.
> 
> Please choose a corresponding imperative change suggestion.
> 
> See also:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.5-rc5#n94
> 
> 
> > Signed-off-by: John Watts <contact@jookia.org>
> 
> I find the local-part of this email address suspicious according to the Developer's Certificate of Origin.
> Should it usually indicate an unique person instead of the shown key word?

FYI: https://lore.kernel.org/all/20230718221504.GA2015343-robh@kernel.org

Marc
Markus Elfring Aug. 9, 2023, 6:10 a.m. UTC | #4
> Markus, please stop bothering developers with nuisance comments.

Why do you interpret a recurring patch review in such a direction?

How much do mentioned concerns hinder the integration of the discussed patch?

Regards,
Markus
Chen-Yu Tsai Aug. 13, 2023, 4:17 a.m. UTC | #5
On Tue, Aug 8, 2023 at 3:20 AM John Watts <contact@jookia.org> wrote:
>
> 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.
>
> Signed-off-by: John Watts <contact@jookia.org>
> ---
> Changes in v3:
> - Set default pinctrl for can controller
> - Moved can nodes to proper location
> - Moved can pins to proper location
>
>  .../boot/dts/allwinner/sunxi-d1s-t113.dtsi    | 34 +++++++++++++++++++
>  1 file changed, 34 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
> index d59b4acf183a..24f2e70d5886 100644
> --- a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
> +++ b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
> @@ -52,6 +52,18 @@ pio: pinctrl@2000000 {
>                         #gpio-cells = <3>;
>                         #interrupt-cells = <3>;
>
> +                       /omit-if-no-ref/

Just FYI this likely ends up doing nothing if you also have them
referenced through a default pinctrl setting. They end up always
referenced and always included. For the D1 series it looks like no
peripheral has default pinctrl setting given.

We can still keep it though. It would help when future chip variants
specify different pinmuxes.

> +                       can0_pins: can0-pins {
> +                               pins = "PB2", "PB3";
> +                               function = "can0";
> +                       };
> +
> +                       /omit-if-no-ref/
> +                       can1_pins: can1-pins {
> +                               pins = "PB4", "PB5";
> +                               function = "can1";
> +                       };
> +
>                         /omit-if-no-ref/
>                         clk_pg11_pin: clk-pg11-pin {
>                                 pins = "PG11";
> @@ -356,6 +368,28 @@ i2c3: i2c@2502c00 {
>                         #size-cells = <0>;
>                 };
>
> +               can0: can@2504000 {
> +                       pinctrl-names = "default";
> +                       pinctrl-0 = <&can0_pins>;

The compatible string should be the first property. In other sunxi SoC dtsi
files, we put the pinctrl just before the "status" property if it's present
to specify a default pin muxing.

I can fix it up while applying.

ChenYu

> +                       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 {
> +                       pinctrl-names = "default";
> +                       pinctrl-0 = <&can1_pins>;
> +                       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";
> +               };
> +
>                 syscon: syscon@3000000 {
>                         compatible = "allwinner,sun20i-d1-system-control";
>                         reg = <0x3000000 0x1000>;
> --
> 2.41.0
>
>
John Watts Aug. 13, 2023, 4:23 a.m. UTC | #6
On Sun, Aug 13, 2023 at 12:17:27PM +0800, Chen-Yu Tsai wrote:
> > Signed-off-by: John Watts <contact@jookia.org>
> > ---
> > Changes in v3:
> > - Set default pinctrl for can controller
> > - Moved can nodes to proper location
> > - Moved can pins to proper location
> >
> >  .../boot/dts/allwinner/sunxi-d1s-t113.dtsi    | 34 +++++++++++++++++++
> >  1 file changed, 34 insertions(+)
> >
> > diff --git a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
> > index d59b4acf183a..24f2e70d5886 100644
> > --- a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
> > +++ b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
> > @@ -52,6 +52,18 @@ pio: pinctrl@2000000 {
> >                         #gpio-cells = <3>;
> >                         #interrupt-cells = <3>;
> >
> > +                       /omit-if-no-ref/
> 
> Just FYI this likely ends up doing nothing if you also have them
> referenced through a default pinctrl setting. They end up always
> referenced and always included. For the D1 series it looks like no
> peripheral has default pinctrl setting given.
>
> We can still keep it though. It would help when future chip variants
> specify different pinmuxes.

Oops, thanks for pointing that out. I'll try to avoid that mistake in future.

> The compatible string should be the first property. In other sunxi SoC dtsi
> files, we put the pinctrl just before the "status" property if it's present
> to specify a default pin muxing.

Oh that makes sense.

> 
> I can fix it up while applying.

Please do!

> ChenYu

Thanks,

John.
Chen-Yu Tsai Aug. 13, 2023, 6:14 a.m. UTC | #7
On Sun, Aug 13, 2023 at 12:23 PM John Watts <contact@jookia.org> wrote:
>
> On Sun, Aug 13, 2023 at 12:17:27PM +0800, Chen-Yu Tsai wrote:
> > > Signed-off-by: John Watts <contact@jookia.org>
> > > ---
> > > Changes in v3:
> > > - Set default pinctrl for can controller
> > > - Moved can nodes to proper location
> > > - Moved can pins to proper location
> > >
> > >  .../boot/dts/allwinner/sunxi-d1s-t113.dtsi    | 34 +++++++++++++++++++
> > >  1 file changed, 34 insertions(+)
> > >
> > > diff --git a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
> > > index d59b4acf183a..24f2e70d5886 100644
> > > --- a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
> > > +++ b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
> > > @@ -52,6 +52,18 @@ pio: pinctrl@2000000 {
> > >                         #gpio-cells = <3>;
> > >                         #interrupt-cells = <3>;
> > >
> > > +                       /omit-if-no-ref/
> >
> > Just FYI this likely ends up doing nothing if you also have them
> > referenced through a default pinctrl setting. They end up always
> > referenced and always included. For the D1 series it looks like no
> > peripheral has default pinctrl setting given.
> >
> > We can still keep it though. It would help when future chip variants
> > specify different pinmuxes.
>
> Oops, thanks for pointing that out. I'll try to avoid that mistake in future.
>
> > The compatible string should be the first property. In other sunxi SoC dtsi
> > files, we put the pinctrl just before the "status" property if it's present
> > to specify a default pin muxing.
>
> Oh that makes sense.
>
> >
> > I can fix it up while applying.
>
> Please do!

Applied. Please check here:

https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git/commit/?h=sunxi/dt-for-6.6&id=f05af44f691351bfd954f39ec376666dc5e1b869
John Watts Aug. 13, 2023, 6:16 a.m. UTC | #8
On Sun, Aug 13, 2023 at 02:14:42PM +0800, Chen-Yu Tsai wrote:
> Applied. Please check here:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git/commit/?h=sunxi/dt-for-6.6&id=f05af44f691351bfd954f39ec376666dc5e1b869

Looks good to me. Thank you.
patchwork-bot+linux-riscv@kernel.org Sept. 1, 2023, 4:25 p.m. UTC | #9
Hello:

This patch was applied to riscv/linux.git (fixes)
by Chen-Yu Tsai <wens@csie.org>:

On Tue,  8 Aug 2023 05:19:52 +1000 you wrote:
> 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
> 
> [...]

Here is the summary with links:
  - [v3] riscv: dts: allwinner: d1: Add CAN controller nodes
    https://git.kernel.org/riscv/c/f05af44f6913

You are awesome, thank you!
diff mbox series

Patch

diff --git a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
index d59b4acf183a..24f2e70d5886 100644
--- a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
+++ b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi
@@ -52,6 +52,18 @@  pio: pinctrl@2000000 {
 			#gpio-cells = <3>;
 			#interrupt-cells = <3>;
 
+			/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";
+			};
+
 			/omit-if-no-ref/
 			clk_pg11_pin: clk-pg11-pin {
 				pins = "PG11";
@@ -356,6 +368,28 @@  i2c3: i2c@2502c00 {
 			#size-cells = <0>;
 		};
 
+		can0: can@2504000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&can0_pins>;
+			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 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&can1_pins>;
+			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";
+		};
+
 		syscon: syscon@3000000 {
 			compatible = "allwinner,sun20i-d1-system-control";
 			reg = <0x3000000 0x1000>;