Skip to contentSkip to conversation

dts: Add Linutronix Testbox

PATCH Applied [email protected] 6 participants 26 messages Feb 6, 2020 – Feb 19, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover dts: Add Linutronix Testbox

From: Bastian Germann <[email protected]>

The Testbox board is an open hardware enhancement for the Lamobo R1 router board. The Testbox board is used in the CI-RT project to manage devices under test (https://ci-rt.linutronix.de).

This series adds the device tree for that board and the nececessary bindings.

Bastian Germann (5):
dt-bindings: Add vendor prefix lx for Linutronix
dt-bindings: arm: sunxi: Add Linutronix Testbox
ARM: dts: sun7i: lamobo-r1: Use SPDX identifier
ARM: dts: sun7i: lamobo-r1: Split out commons
ARM: dts: sun7i: Add Linutronix Testbox v2 board

 .../devicetree/bindings/arm/sunxi.yaml        |   6 +
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 arch/arm/boot/dts/Makefile                    |   1 +
 .../boot/dts/sun7i-a20-lamobo-r1-common.dtsi  | 271 ++++++++++++++++
 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts     | 303 +-----------------
 arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts |  65 ++++
 6 files changed, 347 insertions(+), 301 deletions(-)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-lamobo-r1-common.dtsi
 create mode 100644 arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/5 dt-bindings: Add vendor prefix lx for Linutronix

From: Bastian Germann <[email protected]>

Add a vendor prefix for lx, known as Linutronix GmbH.
Website: https://linutronix.de/

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 7fcd48adc276..f6fea38b0848 100644
@@ -561,6 +561,8 @@ patternProperties:
     description: LSI Corp. (LSI Logic)
   "^lwn,.*":
     description: Liebherr-Werk Nenzing GmbH
+  "^lx,.*":
+    description: Linutronix GmbH
   "^macnica,.*":
     description: Macnica Americas
   "^mapleboard,.*":
Signature · 1 line
2.20.1
maintainer Applied
#2 lore raw

Re: [PATCH 1/5] dt-bindings: Add vendor prefix lx for Linutronix

Quoted 5 lines · On Thu, 6 Feb 2020 12:33:23 +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Add a vendor prefix for lx, known as Linutronix GmbH.
Website: https://linutronix.de/

Quoted 7 lines
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.

Rob

#3 lore raw

Re: [PATCH 1/5] dt-bindings: Add vendor prefix lx for Linutronix

In reply to [email protected]

Hi,

Quoted 17 lines · On Thu, Feb 06, 2020 at 12:33:23PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Add a vendor prefix for lx, known as Linutronix GmbH.
Website: https://linutronix.de/

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +0 -0
index 7fcd48adc276..f6fea38b0848 100644

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 565

Quoted 5 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -561,6 +561,8 @@ patternProperties:
     description: LSI Corp. (LSI Logic)
   "^lwn,.*":
     description: Liebherr-Werk Nenzing GmbH
+  "^lx,.*":
+    description: Linutronix GmbH

Vendor names are usually either the vendor name itself or the stock name, so you should really use linutronix here

Maxime

#4 lore raw

Re: [PATCH 1/5] dt-bindings: Add vendor prefix lx for Linutronix

Quoted 16 lines · Maxime Ripard

Hi,

Quoted 12 lines · On Thu, Feb 06, 2020 at 12:33:23PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Add a vendor prefix for lx, known as Linutronix GmbH.
Website: https://linutronix.de/

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Quoted 13 lines

Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 565

Quoted 10 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 7fcd48adc276..f6fea38b0848 100644
@@ -561,6 +561,8 @@ patternProperties:
     description: LSI Corp. (LSI Logic)
   "^lwn,.*":
     description: Liebherr-Werk Nenzing GmbH
+  "^lx,.*":
+    description: Linutronix GmbH

Vendor names are usually either the vendor name itself or the stock name, so you should really use linutronix here

Good point.

I hadn't pushed this out, so I've dropped it until sorted.

Rob

#5 lore raw

Re: [PATCH 1/5] dt-bindings: Add vendor prefix lx for Linutronix

In reply to Maxime Ripard
Quoted 2 lines · On Mon, 10 Feb 2020 08:43:10 +0100 Maxime Ripard <[email protected]> wrote:

Vendor names are usually either the vendor name itself or the stock name, so you should really use linutronix here

May you kindly enlighten me why?

"lx" is used internaly and externaly in projects, publications, contracts, etc. as common abbreviation by the Linutronix GmbH. Therefore it was self-evident to use this abbreviation in the device tree.

As I did not found any documented rule in the kernel documentation, which denote a restriction for the vendor abbreviation in the device tree bindings the decision for "lx" was clear.

A quick look into "Documentation/devicetree/bindings/vendor-prefixes.yaml" assured me in the decision to use "lx".
Here some example not fitting your rule:
"^ad,.*":
"^adi,.*":
"^al,.*":
"^anvo,.*":
...

In summary I would be encouraged if "lx" gets in, as it is *our* abbreviation.

Regards
Benedikt Spranger

#6 lore raw

Re: [PATCH 1/5] dt-bindings: Add vendor prefix lx for Linutronix

Quoted 6 lines · Benedikt Spranger
Quoted 2 lines · On Mon, 10 Feb 2020 08:43:10 +0100 Maxime Ripard <[email protected]> wrote:

Vendor names are usually either the vendor name itself or the stock name, so you should really use linutronix here

Quoted 6 lines

May you kindly enlighten me why?

"lx" is used internaly and externaly in projects, publications, contracts, etc. as common abbreviation by the Linutronix GmbH. Therefore it was self-evident to use this abbreviation in the device tree.

Googling "linutronix lx" returns approximately 0 meaningful results, so it's really not "common", at least externally.

"lx linux" doesn't return much either.

Quoted 3 lines

As I did not found any documented rule in the kernel documentation, which denote a restriction for the vendor abbreviation in the device tree bindings the decision for "lx" was clear.

It's in the devicetree specification:
https://github.com/devicetree-org/devicetree-specification/releases/download/v0.2/devicetree-specification-v0.2.pdf

Section 2.3: Standard Properties

"The recommended format is "manufacturer,model", where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol)"

Quoted 6 lines

A quick look into "Documentation/devicetree/bindings/vendor-prefixes.yaml" assured me in the decision to use "lx".
Here some example not fitting your rule:
"^ad,.*":
"^adi,.*":

https://www.nasdaq.com/market-activity/stocks/adi

Quoted 2 lines

"^al,.*":
"^anvo,.*":

That's the name of the company

Quoted 4 lines

...

In summary I would be encouraged if "lx" gets in, as it is *our* abbreviation.

How using the name of your company that *everybody* knows it by would be discouraging?

Maxime

#7 lore raw

PATCH 2/5 dt-bindings: arm: sunxi: Add Linutronix Testbox

In reply to [email protected]

From: Bastian Germann <[email protected]>

Add device tree bindings for the newly added Linutronix Testbox board.

---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/arm/sunxi.yaml +6 -0
index cffe8bb0bad1..5ee10e3f84c8 100644
@@ -384,6 +384,12 @@ properties:
           - const: linksprite,pcduino3-nano
           - const: allwinner,sun7i-a20
 
+      - description: Linutronix Testbox v2
+        items:
+          - const: lx,testbox-v2
+          - const: lamobo,lamobo-r1
+          - const: allwinner,sun7i-a20
+
       - description: HAOYU Electronics Marsboard A10
         items:
           - const: haoyu,a10-marsboard
Signature · 1 line
2.20.1
maintainer Reviewed-by on v1 2/5
#8 lore raw

Re: [PATCH 2/5] dt-bindings: arm: sunxi: Add Linutronix Testbox

Quoted 9 lines · On Thu, 6 Feb 2020 12:33:24 +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Add device tree bindings for the newly added Linutronix Testbox board.

---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
#9 lore raw

PATCH 3/5 ARM: dts: sun7i: lamobo-r1: Use SPDX identifier

In reply to [email protected]

From: Bastian Germann <[email protected]>

Adopt the SPDX license identifier.

The 2nd license text is specified by SPDX as MIT. So the identifier has to be (GPL-2.0-or-later OR MIT). SPDX's X11 has an additional advertising clause.

---
 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts | 39 +----------------------
 1 file changed, 1 insertion(+), 38 deletions(-)
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +1 -38
index 17fa8901fc00..37cbd78ea07c 100644
@@ -1,43 +1,6 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
 /*
  * Copyright 2015 Jelle de Jong <[email protected]>
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
 /dts-v1/;
Signature · 1 line
2.20.1
#10 lore raw

Re: [PATCH 3/5] ARM: dts: sun7i: lamobo-r1: Use SPDX identifier

Bastian,

Quoted 7 lines · [email protected] writes:

From: Bastian Germann <[email protected]>

Adopt the SPDX license identifier.

The 2nd license text is specified by SPDX as MIT. So the identifier has to be (GPL-2.0-or-later OR MIT). SPDX's X11 has an additional advertising clause.

Yes, the license text of the alternative license is plain MIT.

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 7

Quoted 9 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +1 -5
@@ -1,43 +1,6 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
 /*
  * Copyright 2015 Jelle de Jong <[email protected]>
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.

Jelle, can you please clarify your intention here?

Quoted 23 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +0 -23
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 4

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +0 -9
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
  */

Thanks,

tglx

#11 lore raw

PATCH 4/5 ARM: dts: sun7i: lamobo-r1: Split out commons

In reply to [email protected]

From: Bastian Germann <[email protected]>

Split out common parts of the Lamobo R1 board to enable using them for Linutronix Testbox board integration.

---
 .../boot/dts/sun7i-a20-lamobo-r1-common.dtsi  | 271 ++++++++++++++++++
 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts     | 264 +----------------
 2 files changed, 272 insertions(+), 263 deletions(-)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-lamobo-r1-common.dtsi
arch/arm/boot/dts/sun7i-a20-lamobo-r1-common.dtsi new file +271 -0
new file mode 100644
index 000000000000..ff9f7d99f5e0
@@ -0,0 +1,271 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
+/*
+ * Copyright 2015 Jelle de Jong <[email protected]>
+ */
+
+/dts-v1/;
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart3;
+		serial2 = &uart7;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	hdmi-connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+
+	reg_gmac_3v3: gmac-3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "gmac-3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		startup-delay-us = <100000>;
+		enable-active-high;
+		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
+	};
+};
+
+&ahci {
+	target-supply = <&reg_ahci_5v>;
+	status = "okay";
+};
+
+&codec {
+	status = "okay";
+};
+
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
+&de {
+	status = "okay";
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&ehci1 {
+	status = "okay";
+};
+
+&gmac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac_rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-supply = <&reg_gmac_3v3>;
+	status = "okay";
+
+	fixed-link {
+		speed = <1000>;
+		full-duplex;
+	};
+
+	mdio {
+		compatible = "snps,dwmac-mdio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		switch: ethernet-switch@1e {
+			compatible = "brcm,bcm53125";
+			reg = <30>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port0: port@0 {
+					reg = <0>;
+					label = "lan2";
+				};
+
+				port1: port@1 {
+					reg = <1>;
+					label = "lan3";
+				};
+
+				port2: port@2 {
+					reg = <2>;
+					label = "lan4";
+				};
+
+				port3: port@3 {
+					reg = <3>;
+					label = "wan";
+				};
+
+				port4: port@4 {
+					reg = <4>;
+					label = "lan1";
+				};
+
+				port8: port@8 {
+					reg = <8>;
+					label = "cpu";
+					ethernet = <&gmac>;
+					phy-mode = "rgmii-txid";
+					fixed-link {
+						speed = <1000>;
+						full-duplex;
+					};
+				};
+			};
+		};
+	};
+};
+
+&hdmi {
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
+&i2c0 {
+	status = "okay";
+
+	axp209: pmic@34 {
+		reg = <0x34>;
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
+&i2c2 {
+	status = "okay";
+};
+
+&ir0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&ir0_rx_pin>;
+	status = "okay";
+};
+
+&mmc0 {
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <4>;
+	cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
+&otg_sram {
+	status = "okay";
+};
+
+#include "axp209.dtsi"
+
+&ac_power_supply {
+	status = "okay";
+};
+
+&battery_power_supply {
+	status = "okay";
+};
+
+&reg_ahci_5v {
+	gpio = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
+	status = "okay";
+};
+
+&reg_dcdc2 {
+	regulator-always-on;
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1400000>;
+	regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+	regulator-always-on;
+	regulator-min-microvolt = <1000000>;
+	regulator-max-microvolt = <1400000>;
+	regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+	regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "avcc";
+};
+
+&reg_usb0_vbus {
+	status = "okay";
+};
+
+&reg_usb2_vbus {
+	gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
+	status = "okay";
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_pi_pins>,
+		    <&spi0_cs0_pi_pin>,
+		    <&spi0_cs1_pi_pin>;
+	status = "okay";
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pb_pins>;
+	status = "okay";
+};
+
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart3_ph_pins>;
+	status = "okay";
+};
+
+&uart7 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart7_pi_pins>;
+	status = "okay";
+};
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usb_power_supply {
+	status = "okay";
+};
+
+&usbphy {
+	usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */
+	usb0_vbus_power-supply = <&usb_power_supply>;
+	usb0_vbus-supply = <&reg_usb0_vbus>;
+	usb2_vbus-supply = <&reg_usb2_vbus>;
+	status = "okay";
+};
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +1 -263

279 lines not on this page · raw message

Signature · 1 line
2.20.1
#12 lore raw

Re: [PATCH 4/5] ARM: dts: sun7i: lamobo-r1: Split out commons

Hi,

Quoted 8 lines · On Thu, Feb 06, 2020 at 12:33:26PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Split out common parts of the Lamobo R1 board to enable using them for Linutronix Testbox board integration.

Looking at the board, it looks like it's just a daughter board to the lamobo-r1?

If so, you can just include its DTS directly, there's no need to create a DTSI (an overlay is an option as well).

Maxime

#13 lore raw

Re: [PATCH 4/5] ARM: dts: sun7i: lamobo-r1: Split out commons

Quoted 2 lines · On Mon, 10 Feb 2020 08:45:25 +0100 Maxime Ripard <[email protected]> wrote:

Looking at the board, it looks like it's just a daughter board to the lamobo-r1?

It is a daughter board.

Quoted 2 lines

If so, you can just include its DTS directly, there's no need to create a DTSI (an overlay is an option as well).

Weighing up to include a DTS and overriding nodes versus splitting out the commons into a DTSI let to the latter:

Overriding DTB nodes is a mess since it makes it unnessesarily complex to understand what happens and is hard to debug. I spend quite some time of my life to get a clou, why a DTB of a board is messed up and why changes got lost. Including DTS files is a matter of taste and none of my flavors.

Overlay would be an option, if there is a way to load the overlay without touching the bootloader or during kexec.

Regards
Benedikt Spranger

#14 lore raw

Re: [PATCH 4/5] ARM: dts: sun7i: lamobo-r1: Split out commons

Quoted 10 lines · Benedikt Spranger
Quoted 2 lines · On Mon, 10 Feb 2020 08:45:25 +0100 Maxime Ripard <[email protected]> wrote:

Looking at the board, it looks like it's just a daughter board to the lamobo-r1?

It is a daughter board.

Quoted 2 lines

If so, you can just include its DTS directly, there's no need to create a DTSI (an overlay is an option as well).

Quoted 8 lines

Weighing up to include a DTS and overriding nodes versus splitting out the commons into a DTSI let to the latter:

Overriding DTB nodes is a mess since it makes it unnessesarily complex to understand what happens and is hard to debug. I spend quite some time of my life to get a clou, why a DTB of a board is messed up and why changes got lost. Including DTS files is a matter of taste and none of my flavors.

I don't get it. If it's a daughter board, there's nothing to override, right?

Quoted 2 lines

Overlay would be an option, if there is a way to load the overlay without touching the bootloader or during kexec.

I mean, an overlay is strictly equivalent to including the DTS, so why are you ok with an overlay and not including it directly?

Aside, U-Boot is able to apply overlays to the device tree before booting the kernel, you just have to change the boot command a bit.

Maxime

#15 lore raw

PATCH 5/5 ARM: dts: sun7i: Add Linutronix Testbox v2 board

In reply to [email protected]

From: Bastian Germann <[email protected]>

The Testbox board is an open hardware enhancement for the Lamobo R1 router board. The Testbox board is used in the CI-RT project to manage devices under test (https://ci-rt.linutronix.de).

The hardware project is located at https://github.com/ci-rt/testbox-shield

The Testbox v2 expands the Lamobo R1 router board with
- a power supply,
- a CAN bus PHY,
- a power control,
- a relay,
- a I2C EEPROM,
- a secure key storage (ATECC608a) and
- two RS232 compliant serial ports.

---
 arch/arm/boot/dts/Makefile                    |  1 +
 arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts | 65 +++++++++++++++++++
 2 files changed, 66 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts
arch/arm/boot/dts/Makefile +1 -0
index 08011dc8c7a6..383541842695 100644
@@ -1069,6 +1069,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
 	sun7i-a20-i12-tvbox.dtb \
 	sun7i-a20-icnova-swac.dtb \
 	sun7i-a20-lamobo-r1.dtb \
+	sun7i-a20-lx-testbox-v2.dtb \
 	sun7i-a20-m3.dtb \
 	sun7i-a20-mk808c.dtb \
 	sun7i-a20-olimex-som-evb.dtb \
arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts new file +65 -0

65 lines not on this page · raw message

Signature · 1 line
2.20.1
#16 lore raw

Re: [PATCH 5/5] ARM: dts: sun7i: Add Linutronix Testbox v2 board

Quoted 44 lines · On Thu, Feb 06, 2020 at 12:33:27PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

The Testbox board is an open hardware enhancement for the Lamobo R1 router board. The Testbox board is used in the CI-RT project to manage devices under test (https://ci-rt.linutronix.de).

The hardware project is located at https://github.com/ci-rt/testbox-shield

The Testbox v2 expands the Lamobo R1 router board with
- a power supply,
- a CAN bus PHY,
- a power control,
- a relay,
- a I2C EEPROM,
- a secure key storage (ATECC608a) and
- two RS232 compliant serial ports.

---
 arch/arm/boot/dts/Makefile                    |  1 +
 arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts | 65 +++++++++++++++++++
 2 files changed, 66 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts
arch/arm/boot/dts/Makefile +1 -0
index 08011dc8c7a6..383541842695 100644
@@ -1069,6 +1069,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
 	sun7i-a20-i12-tvbox.dtb \
 	sun7i-a20-icnova-swac.dtb \
 	sun7i-a20-lamobo-r1.dtb \
+	sun7i-a20-lx-testbox-v2.dtb \
 	sun7i-a20-m3.dtb \
 	sun7i-a20-mk808c.dtb \
 	sun7i-a20-olimex-som-evb.dtb \
arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts new file +0 -0
new file mode 100644
index 000000000000..3b91fb026a92

arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts line 1

Quoted 1 line
arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts new file +1 -0
@@ -0,0 +1,65 @@
+// SPDX-License-Identifier: GPL-2.0-or-later

Using a double license would be great, otherwise other projects licensed under something else than the GPL might not be able to use it.

Quoted 6 lines
arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts new file +6 -0
+/*
+ * Copyright 2020 Linutronix GmbH
+ * Author: Benedikt Spranger <[email protected]>
+ */
+
+/dts-v1/;

arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts line 17

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts new file +10 -0
+#include "sun7i-a20-lamobo-r1-common.dtsi"
+
+/ {
+	model = "Lamobo R1";
+	compatible = "lx,testbox-v2", "lamobo,lamobo-r1", "allwinner,sun7i-a20";
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins_lamobo_r1>;

You don't need the pinctrl nodes at all for GPIOs

Maxime

#17 lore raw

Re: [PATCH 5/5] ARM: dts: sun7i: Add Linutronix Testbox v2 board

Quoted 5 lines · On Mon, 10 Feb 2020 08:56:28 +0100 Maxime Ripard <[email protected]> wrote:
Quoted 1 line

+// SPDX-License-Identifier: GPL-2.0-or-later

Using a double license would be great, otherwise other projects licensed under something else than the GPL might not be able to use it.

I don't get it, why GPL v2 is not adequate here...

Quoted 6 lines

arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts line 17

Quoted 4 lines
arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts new file +4 -0
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins_lamobo_r1>;

You don't need the pinctrl nodes at all for GPIOs

I did not agree on that:
The pincontrol configuration depend on the bootloader if you omit the configuration here. That may sufficient in most cases, but can cause unexpected behaviour after updating the bootloader or using kexec.

The A20 datasheet mentioned:
"For various system configurations, these ports can be easily configured by software. All these ports can be configured as GPIO if multiplexed functions not used. 32 external PIO interrupt sources are supported and interrupt mode can be configured by software."

I cannot simply check, if the pin was used otherwise. Therefore adding a pincontrl for a defined state of a pin seems reasonable.

Regards
Benedikt Spranger

#18 lore raw

Re: [PATCH 5/5] ARM: dts: sun7i: Add Linutronix Testbox v2 board

Quoted 10 lines · Benedikt Spranger
Quoted 5 lines · On Mon, 10 Feb 2020 08:56:28 +0100 Maxime Ripard <[email protected]> wrote:
Quoted 1 line

+// SPDX-License-Identifier: GPL-2.0-or-later

Using a double license would be great, otherwise other projects licensed under something else than the GPL might not be able to use it.

I don't get it, why GPL v2 is not adequate here...

*BSD for example can't include a file under the GPL. It's not that the
GPL is not adequate, it's that the GPL + MIT is better, since more people would be able to use it.

But then, if you don't care, that's not something that will prevent the patch from going in either, just something that you should consider.

Quoted 7 lines
Quoted 6 lines

arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts line 17

Quoted 4 lines
arch/arm/boot/dts/sun7i-a20-lx-testbox-v2.dts new file +4 -0
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins_lamobo_r1>;

You don't need the pinctrl nodes at all for GPIOs

Quoted 5 lines

I did not agree on that:

The pincontrol configuration depend on the bootloader if you omit the configuration here. That may sufficient in most cases, but can cause unexpected behaviour after updating the bootloader or using kexec.

What configuration do you want to have enforced?

Maxime

#19 lore raw

v2 cover dts: Add Linutronix Testbox

In reply to [email protected]

From: Bastian Germann <[email protected]>

The Testbox board is an open hardware enhancement for the Lamobo R1 router board. The Testbox board is used in the CI-RT project to manage devices under test (https://ci-rt.linutronix.de).

This series adds the device tree for that board and the necessary bindings.

Changelog
v2: - change the lx binding vendor to linutronix
- drop Lamobo R1 dts license header SPDX change
- drop extracting a dtsi from Lamobo R1 dts
- include Lamobo R1's dts instead of dtsi in the new dts
- drop the pinctrl nodes from the leds node in the new dts

Bastian Germann (3):
dt-bindings: Add vendor prefix for Linutronix
dt-bindings: arm: sunxi: Add Linutronix Testbox
ARM: dts: sun7i: Add Linutronix Testbox v2 board

 .../devicetree/bindings/arm/sunxi.yaml        |  6 ++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 arch/arm/boot/dts/Makefile                    |  1 +
 .../dts/sun7i-a20-linutronix-testbox-v2.dts   | 56 +++++++++++++++++++
 4 files changed, 65 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-linutronix-testbox-v2.dts
Signature · 1 line
2.20.1
#20 lore raw

PATCH v2 1/3 dt-bindings: Add vendor prefix for Linutronix

From: Bastian Germann <[email protected]>

Add a vendor prefix for Linutronix GmbH.
Website: https://linutronix.de/

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 9e67944bec9c..8d4462f85a00 100644
@@ -545,6 +545,8 @@ patternProperties:
     description: LinkSprite Technologies, Inc.
   "^linksys,.*":
     description: Belkin International, Inc. (Linksys)
+  "^linutronix,.*":
+    description: Linutronix GmbH
   "^linux,.*":
     description: Linux-specific binding
   "^linx,.*":
Signature · 1 line
2.20.1
Acked-by on v2 1/3
#21 lore raw

Re: [PATCH v2 1/3] dt-bindings: Add vendor prefix for Linutronix

Quoted 8 lines · On Fri, Feb 14, 2020 at 12:10:01PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Add a vendor prefix for Linutronix GmbH.
Website: https://linutronix.de/

Thanks!
Maxime

maintainer Applied
#22 lore raw

Re: [PATCH v2 1/3] dt-bindings: Add vendor prefix for Linutronix

In reply to [email protected]
Quoted 5 lines · On Fri, 14 Feb 2020 12:10:01 +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

Add a vendor prefix for Linutronix GmbH.
Website: https://linutronix.de/

Quoted 7 lines
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.

Rob

#23 lore raw

PATCH v2 2/3 dt-bindings: arm: sunxi: Add Linutronix Testbox

In reply to [email protected]

From: Bastian Germann <[email protected]>

Add device tree bindings for the newly added Linutronix Testbox board.

---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/arm/sunxi.yaml +6 -0
index 327ce6730823..71f0b1ae2805 100644
@@ -394,6 +394,12 @@ properties:
           - const: linksprite,pcduino3-nano
           - const: allwinner,sun7i-a20
 
+      - description: Linutronix Testbox v2
+        items:
+          - const: linutronix,testbox-v2
+          - const: lamobo,lamobo-r1
+          - const: allwinner,sun7i-a20
+
       - description: HAOYU Electronics Marsboard A10
         items:
           - const: haoyu,a10-marsboard
Signature · 1 line
2.20.1
#24 lore raw

PATCH v2 3/3 ARM: dts: sun7i: Add Linutronix Testbox v2 board

In reply to [email protected]

From: Bastian Germann <[email protected]>

The Testbox board is an open hardware enhancement for the Lamobo R1 router board. The Testbox board is used in the CI-RT project to manage devices under test (https://ci-rt.linutronix.de).

The hardware project is located at https://github.com/ci-rt/testbox-shield

The Testbox v2 expands the Lamobo R1 router board with
- a power supply,
- a CAN bus PHY,
- a power control,
- a relay,
- an I2C EEPROM,
- a secure key storage (ATECC608a) and
- two RS232 compliant serial ports.

---
 arch/arm/boot/dts/Makefile                    |  1 +
 .../dts/sun7i-a20-linutronix-testbox-v2.dts   | 56 +++++++++++++++++++
 2 files changed, 57 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-linutronix-testbox-v2.dts
arch/arm/boot/dts/Makefile +1 -0
index d6546d2676b9..e9ddca2946ce 100644
@@ -1086,6 +1086,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
 	sun7i-a20-i12-tvbox.dtb \
 	sun7i-a20-icnova-swac.dtb \
 	sun7i-a20-lamobo-r1.dtb \
+	sun7i-a20-linutronix-testbox-v2.dtb \
 	sun7i-a20-m3.dtb \
 	sun7i-a20-mk808c.dtb \
 	sun7i-a20-olimex-som-evb.dtb \
arch/arm/boot/dts/sun7i-a20-linutronix-testbox-v2.dts new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
2.20.1
#25 lore raw

Re: [PATCH v2 3/3] ARM: dts: sun7i: Add Linutronix Testbox v2 board

Quoted 84 lines · On Fri, Feb 14, 2020 at 12:10:03PM +0100, [email protected] wrote:

From: Bastian Germann <[email protected]>

The Testbox board is an open hardware enhancement for the Lamobo R1 router board. The Testbox board is used in the CI-RT project to manage devices under test (https://ci-rt.linutronix.de).

The hardware project is located at https://github.com/ci-rt/testbox-shield

The Testbox v2 expands the Lamobo R1 router board with
- a power supply,
- a CAN bus PHY,
- a power control,
- a relay,
- an I2C EEPROM,
- a secure key storage (ATECC608a) and
- two RS232 compliant serial ports.

---
 arch/arm/boot/dts/Makefile                    |  1 +
 .../dts/sun7i-a20-linutronix-testbox-v2.dts   | 56 +++++++++++++++++++
 2 files changed, 57 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-linutronix-testbox-v2.dts
arch/arm/boot/dts/Makefile +1 -0
index d6546d2676b9..e9ddca2946ce 100644
@@ -1086,6 +1086,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
 	sun7i-a20-i12-tvbox.dtb \
 	sun7i-a20-icnova-swac.dtb \
 	sun7i-a20-lamobo-r1.dtb \
+	sun7i-a20-linutronix-testbox-v2.dtb \
 	sun7i-a20-m3.dtb \
 	sun7i-a20-mk808c.dtb \
 	sun7i-a20-olimex-som-evb.dtb \
arch/arm/boot/dts/sun7i-a20-linutronix-testbox-v2.dts new file +40 -0
new file mode 100644
index 000000000000..685874d44e35
@@ -0,0 +1,56 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright 2020 Linutronix GmbH
+ * Author: Benedikt Spranger <[email protected]>
+ */
+
+/dts-v1/;
+#include "sun7i-a20-lamobo-r1.dts"
+
+/ {
+	model = "Lamobo R1";
+	compatible = "linutronix,testbox-v2", "lamobo,lamobo-r1", "allwinner,sun7i-a20";
+
+	leds {
+		led-opto1 {
+			label = "lamobo_r1:opto:powerswitch";
+			gpios = <&pio 7 3 GPIO_ACTIVE_HIGH>;
+		};
+
+		led-opto2 {
+			label = "lamobo_r1:opto:relay";
+			gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&i2c2 {
+	clock-frequency = <100000>;
+	status = "okay";
+
+	eeprom: eeprom@50 {
+		compatible = "atmel,24c08";
+		reg = <0x50>;
+		status = "okay";
+	};
+
+	atecc508a@60 {
+		compatible = "atmel,atecc508a";
+		reg = <0x60>;
+	};

arch/arm/boot/dts/sun7i-a20-linutronix-testbox-v2.dts line 50

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-linutronix-testbox-v2.dts new file +10 -0
+};
+
+&pio {
+	led_pins_lamobo_r1: led-pins {
+		pins = "PH3", "PH5", "PH24";
+		function = "gpio_out";
+		drive-strength = <40>;
+		bias-disable;
+	};
+};

That node was unused, so I removed it as well while applying, thanks!

Maxime