This shows the path we could take with this, deprecating the
weird external bus thing.
I don't know what to do about the irq lines with a pointless
type flag that should be onecell:ed.
I need proper schema checking to add LED support to the
Marvell switch. Just how it is, it can't go on like this.
Some Device Tree fixes are included in the series, these
remove the major and most annoying warnings fallout noise:
some warnings remain, and these are of more serious nature,
such as missing phy-mode.
Signed-off-by: Linus Walleij <[email protected]>
---
Changes in v3:
- Fix up a related mvusb example in a different binding that
the scripts were complaining about.
- Fix up the wording on internal vs external MDIO buses in the
mv88e6xxx binding document.
- Remove pointless label and put the right rev-mii into the
MV88E6060 schema.
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Break out a separate Marvell MV88E6060 binding file. I stand corrected.
- Drop the idea to rely on nodename mdio-external for the external
MDIO bus, keep the compatible, drop patch for the driver.
- Fix more Marvell DT mistakes.
- Fix NXP DT mistakes in a separate patch.
- Fix Marvell ARM64 mistakes in a separate patch.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Linus Walleij (6):
dt-bindings: marvell: Rewrite MV88E6xxx in schema
dt-bindings: marvell: Add Marvell MV88E6060 DSA schema
dt-bindings: net: mvusb: Fix up DSA example
ARM: dts: marvell: Fix some common switch mistakes
ARM: dts: nxp: Fix some common switch mistakes
ARM64: dts: marvell: Fix some common switch mistakes
.../bindings/net/dsa/marvell,mv88e6060.yaml | 105 +++++++++
.../bindings/net/dsa/marvell,mv88e6xxx.yaml | 243 +++++++++++++++++++++
.../devicetree/bindings/net/dsa/marvell.txt | 109 ---------
.../devicetree/bindings/net/marvell,mvusb.yaml | 6 +
MAINTAINERS | 3 +-
arch/arm/boot/dts/marvell/armada-370-rd.dts | 2 -
.../dts/marvell/armada-381-netgear-gs110emx.dts | 6 +-
.../dts/marvell/armada-385-clearfog-gtr-l8.dts | 2 +-
.../dts/marvell/armada-385-clearfog-gtr-s4.dts | 2 +-
arch/arm/boot/dts/marvell/armada-385-linksys.dtsi | 2 -
.../boot/dts/marvell/armada-385-turris-omnia.dts | 16 +-
arch/arm/boot/dts/marvell/armada-388-clearfog.dts | 2 -
.../boot/dts/marvell/armada-xp-linksys-mamba.dts | 2 -
arch/arm/boot/dts/nxp/vf/vf610-zii-cfu1.dts | 2 +-
arch/arm/boot/dts/nxp/vf/vf610-zii-scu4-aib.dts | 8 +-
arch/arm/boot/dts/nxp/vf/vf610-zii-spb4.dts | 2 +-
arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-dtu.dts | 4 +-
arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-spu3.dts | 2 +-
.../boot/dts/marvell/armada-3720-espressobin.dtsi | 4 +-
.../boot/dts/marvell/armada-3720-gl-mv1000.dts | 4 +-
.../boot/dts/marvell/armada-3720-turris-mox.dts | 32 +--
.../boot/dts/marvell/armada-7040-mochabin.dts | 2 -
.../dts/marvell/armada-8040-clearfog-gt-8k.dts | 2 +-
arch/arm64/boot/dts/marvell/cn9130-crb.dtsi | 6 +-
24 files changed, 397 insertions(+), 171 deletions(-)
---
base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
change-id: 20231008-marvell-88e6152-wan-led-88c43b7fd2fd
Best regards,
--
Linus Walleij <[email protected]>
This is an attempt to rewrite the Marvell MV88E6xxx switch bindings
in YAML schema.
The current text binding says:
WARNING: This binding is currently unstable. Do not program it into a
FLASH never to be changed again. Once this binding is stable, this
warning will be removed.
Well that never happened before we switched to YAML markup,
we can't have it like this, what about fixing the mess?
Signed-off-by: Linus Walleij <[email protected]>
---
.../bindings/net/dsa/marvell,mv88e6xxx.yaml | 243 +++++++++++++++++++++
.../devicetree/bindings/net/dsa/marvell.txt | 109 ---------
MAINTAINERS | 2 +-
3 files changed, 244 insertions(+), 110 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml b/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml
new file mode 100644
index 000000000000..954db04147f8
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml
@@ -0,0 +1,243 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/dsa/marvell,mv88e6xxx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell MV88E6xxx DSA switch family
+
+maintainers:
+ - Andrew Lunn <[email protected]>
+
+description:
+ The Marvell MV88E6xxx switch series has been produced and sold
+ by Marvell since at least 2010. The switch has a few compatibles which
+ just indicate the base address of the switch, then operating systems
+ can investigate switch ID registers to find out which actual version
+ of the switch it is dealing with.
+
+properties:
+ compatible:
+ oneOf:
+ - enum:
+ - marvell,mv88e6085
+ - marvell,mv88e6190
+ - marvell,mv88e6250
+ description: |
+ marvell,mv88e6085: This switch uses base address 0x10.
+ This switch and its siblings will be autodetected from
+ ID registers found in the switch, so only "marvell,mv88e6085" should be
+ specified. This includes the following list of MV88Exxxx switches:
+ 6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165, 6171, 6172, 6175, 6176,
+ 6185, 6240, 6320, 6321, 6341, 6350, 6351, 6352
+ marvell,mv88e6190: This switch uses base address 0x00.
+ This switch and its siblings will be autodetected from
+ ID registers found in the switch, so only "marvell,mv88e6190" should be
+ specified. This includes the following list of MV88Exxxx switches:
+ 6190, 6190X, 6191, 6290, 6361, 6390, 6390X
+ marvell,mv88e6250: This switch uses base address 0x08 or 0x18.
+ This switch and its siblings will be autodetected from
+ ID registers found in the switch, so only "marvell,mv88e6250" should be
+ specified. This includes the following list of MV88Exxxx switches:
+ 6220, 6250
+
+ reg:
+ maxItems: 1
+
+ eeprom-length:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Set to the length of an EEPROM connected to the switch. Must be
+ set if the switch can not detect the presence and/or size of a connected
+ EEPROM, otherwise optional.
+
+ reset-gpios:
+ description:
+ GPIO to be used to reset the whole device
+ maxItems: 1
+
+ interrupts:
+ description: The switch provides an external interrupt line, but it is
+ not always used by target systems.
+ maxItems: 1
+
+ interrupt-controller:
+ description: The switch has an internal interrupt controller used by
+ the different sub-blocks.
+
+ '#interrupt-cells':
+ description: The internal interrupt controller only supports triggering
+ on active high level interrupts so the second cell must alway be set to
+ IRQ_TYPE_LEVEL_HIGH.
+ const: 2
+
+ mdio:
+ $ref: /schemas/net/mdio.yaml#
+ unevaluatedProperties: false
+ description: Marvell MV88E6xxx switches have an varying combination of
+ internal and external MDIO buses, in some cases a combined bus that
+ can be used both internally and externally. This node is for the
+ primary bus, used internally and sometimes also externally.
+
+ mdio-external:
+ $ref: /schemas/net/mdio.yaml#
+ unevaluatedProperties: false
+ description: Marvell MV88E6xxx switches that have a separate external
+ MDIO bus use this port to access external components on the MDIO bus.
+
+ properties:
+ compatible:
+ const: marvell,mv88e6xxx-mdio-external
+
+ required:
+ - compatible
+
+$ref: dsa.yaml#
+
+patternProperties:
+ "^(ethernet-)?ports$":
+ type: object
+ patternProperties:
+ "^(ethernet-)?port@[0-9]+$":
+ type: object
+ description: Ethernet switch ports
+
+ $ref: dsa-port.yaml#
+
+ unevaluatedProperties: false
+
+oneOf:
+ - required:
+ - ports
+ - required:
+ - ethernet-ports
+
+required:
+ - compatible
+ - reg
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ switch0: switch@0 {
+ compatible = "marvell,mv88e6085";
+ reg = <0>;
+ reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
+ interrupt-parent = <&gpio0>;
+ interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ label = "lan1";
+ };
+ port@1 {
+ reg = <1>;
+ label = "lan2";
+ };
+ port@2 {
+ reg = <2>;
+ label = "lan3";
+ };
+ port@3 {
+ reg = <3>;
+ label = "lan4";
+ };
+ port@4 {
+ reg = <4>;
+ label = "wan";
+ };
+
+ port@5 {
+ reg = <5>;
+ phy-mode = "sgmii";
+ ethernet = <ð2>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ };
+
+ mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ switch0phy0: switch0phy@0 {
+ reg = <0>;
+ interrupt-parent = <&switch0>;
+ interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+ };
+ };
+ };
+ };
+
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ switch1: switch@0 {
+ compatible = "marvell,mv88e6190";
+ reg = <0>;
+ reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
+ interrupt-parent = <&gpio0>;
+ interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ label = "lan1";
+ };
+ port@1 {
+ reg = <1>;
+ label = "lan2";
+ };
+ port@2 {
+ reg = <2>;
+ label = "lan3";
+ };
+ port@3 {
+ reg = <3>;
+ label = "lan4";
+ };
+ };
+
+ mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ switch1phy0: switch1phy@0 {
+ reg = <0>;
+ interrupt-parent = <&switch1>;
+ interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+ };
+ };
+
+ mdio-external {
+ compatible = "marvell,mv88e6xxx-mdio-external";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ switch1phy9: switch1phy@9 {
+ reg = <9>;
+ };
+ };
+ };
+ };
diff --git a/Documentation/devicetree/bindings/net/dsa/marvell.txt b/Documentation/devicetree/bindings/net/dsa/marvell.txt
deleted file mode 100644
index 6ec0c181b6db..000000000000
--- a/Documentation/devicetree/bindings/net/dsa/marvell.txt
+++ /dev/null
@@ -1,109 +0,0 @@
-Marvell DSA Switch Device Tree Bindings
----------------------------------------
-
-WARNING: This binding is currently unstable. Do not program it into a
-FLASH never to be changed again. Once this binding is stable, this
-warning will be removed.
-
-If you need a stable binding, use the old dsa.txt binding.
-
-Marvell Switches are MDIO devices. The following properties should be
-placed as a child node of an mdio device.
-
-The properties described here are those specific to Marvell devices.
-Additional required and optional properties can be found in dsa.txt.
-
-The compatibility string is used only to find an identification register,
-which is at a different MDIO base address in different switch families.
-- "marvell,mv88e6085" : Switch has base address 0x10. Use with models:
- 6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165,
- 6171, 6172, 6175, 6176, 6185, 6240, 6320, 6321,
- 6341, 6350, 6351, 6352
-- "marvell,mv88e6190" : Switch has base address 0x00. Use with models:
- 6190, 6190X, 6191, 6290, 6361, 6390, 6390X
-- "marvell,mv88e6250" : Switch has base address 0x08 or 0x18. Use with model:
- 6220, 6250
-
-Required properties:
-- compatible : Should be one of "marvell,mv88e6085",
- "marvell,mv88e6190" or "marvell,mv88e6250" as
- indicated above
-- reg : Address on the MII bus for the switch.
-
-Optional properties:
-
-- reset-gpios : Should be a gpio specifier for a reset line
-- interrupts : Interrupt from the switch
-- interrupt-controller : Indicates the switch is itself an interrupt
- controller. This is used for the PHY interrupts.
-#interrupt-cells = <2> : Controller uses two cells, number and flag
-- eeprom-length : Set to the length of an EEPROM connected to the
- switch. Must be set if the switch can not detect
- the presence and/or size of a connected EEPROM,
- otherwise optional.
-- mdio : Container of PHY and devices on the switches MDIO
- bus.
-- mdio? : Container of PHYs and devices on the external MDIO
- bus. The node must contains a compatible string of
- "marvell,mv88e6xxx-mdio-external"
-
-Example:
-
- mdio {
- #address-cells = <1>;
- #size-cells = <0>;
- interrupt-parent = <&gpio0>;
- interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
- interrupt-controller;
- #interrupt-cells = <2>;
-
- switch0: switch@0 {
- compatible = "marvell,mv88e6085";
- reg = <0>;
- reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
-
- mdio {
- #address-cells = <1>;
- #size-cells = <0>;
- switch1phy0: switch1phy0@0 {
- reg = <0>;
- interrupt-parent = <&switch0>;
- interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
- };
- };
- };
- };
-
- mdio {
- #address-cells = <1>;
- #size-cells = <0>;
- interrupt-parent = <&gpio0>;
- interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
- interrupt-controller;
- #interrupt-cells = <2>;
-
- switch0: switch@0 {
- compatible = "marvell,mv88e6190";
- reg = <0>;
- reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
-
- mdio {
- #address-cells = <1>;
- #size-cells = <0>;
- switch1phy0: switch1phy0@0 {
- reg = <0>;
- interrupt-parent = <&switch0>;
- interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
- };
- };
-
- mdio1 {
- compatible = "marvell,mv88e6xxx-mdio-external";
- #address-cells = <1>;
- #size-cells = <0>;
- switch1phy9: switch1phy0@9 {
- reg = <9>;
- };
- };
- };
- };
diff --git a/MAINTAINERS b/MAINTAINERS
index 90f13281d297..1b4475254d27 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12625,7 +12625,7 @@ MARVELL 88E6XXX ETHERNET SWITCH FABRIC DRIVER
M: Andrew Lunn <[email protected]>
L: [email protected]
S: Maintained
-F: Documentation/devicetree/bindings/net/dsa/marvell.txt
+F: Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml
F: Documentation/networking/devlink/mv88e6xxx.rst
F: drivers/net/dsa/mv88e6xxx/
F: include/linux/dsa/mv88e6xxx.h
--
2.34.1
Fix some errors in the Marvell MV88E6xxx switch descriptions:
- The top node had no address size or cells.
- switch0@0 is not OK, should be switch@0.
- port@a is not normal port naming, use decimal port@10.
Signed-off-by: Linus Walleij <[email protected]>
---
.../boot/dts/marvell/armada-3720-espressobin.dtsi | 4 +--
.../boot/dts/marvell/armada-3720-gl-mv1000.dts | 4 +--
.../boot/dts/marvell/armada-3720-turris-mox.dts | 32 +++++++++++-----------
.../boot/dts/marvell/armada-7040-mochabin.dts | 2 --
.../dts/marvell/armada-8040-clearfog-gt-8k.dts | 2 +-
arch/arm64/boot/dts/marvell/cn9130-crb.dtsi | 6 ++--
6 files changed, 21 insertions(+), 29 deletions(-)
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi
index 5fc613d24151..b526efeee293 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi
@@ -145,10 +145,8 @@ &usb2 {
};
&mdio {
- switch0: switch0@1 {
+ switch0: switch@1 {
compatible = "marvell,mv88e6085";
- #address-cells = <1>;
- #size-cells = <0>;
reg = <1>;
dsa,member = <0 0>;
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts b/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
index b1b45b4fa9d4..5de4417f929c 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
@@ -152,10 +152,8 @@ &uart0 {
};
&mdio {
- switch0: switch0@1 {
+ switch0: switch@1 {
compatible = "marvell,mv88e6085";
- #address-cells = <1>;
- #size-cells = <0>;
reg = <1>;
dsa,member = <0 0>;
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
index 9eab2bb22134..ea66ba5a9762 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
@@ -305,7 +305,7 @@ phy1: ethernet-phy@1 {
};
/* switch nodes are enabled by U-Boot if modules are present */
- switch0@10 {
+ switch@10 {
compatible = "marvell,mv88e6190";
reg = <0x10>;
dsa,member = <0 0>;
@@ -410,8 +410,8 @@ port@9 {
managed = "in-band-status";
};
- switch0port10: port@a {
- reg = <0xa>;
+ switch0port10: port@10 {
+ reg = <10>;
label = "dsa";
phy-mode = "2500base-x";
managed = "in-band-status";
@@ -419,8 +419,8 @@ switch0port10: port@a {
status = "disabled";
};
- port-sfp@a {
- reg = <0xa>;
+ port-sfp@10 {
+ reg = <10>;
label = "sfp";
sfp = <&sfp>;
phy-mode = "sgmii";
@@ -430,7 +430,7 @@ port-sfp@a {
};
};
- switch0@2 {
+ switch@2 {
compatible = "marvell,mv88e6085";
reg = <0x2>;
dsa,member = <0 0>;
@@ -497,7 +497,7 @@ port@5 {
};
};
- switch1@11 {
+ switch@11 {
compatible = "marvell,mv88e6190";
reg = <0x11>;
dsa,member = <0 1>;
@@ -602,8 +602,8 @@ switch1port9: port@9 {
link = <&switch0port10>;
};
- switch1port10: port@a {
- reg = <0xa>;
+ switch1port10: port@10 {
+ reg = <10>;
label = "dsa";
phy-mode = "2500base-x";
managed = "in-band-status";
@@ -611,8 +611,8 @@ switch1port10: port@a {
status = "disabled";
};
- port-sfp@a {
- reg = <0xa>;
+ port-sfp@10 {
+ reg = <10>;
label = "sfp";
sfp = <&sfp>;
phy-mode = "sgmii";
@@ -622,7 +622,7 @@ port-sfp@a {
};
};
- switch1@2 {
+ switch@2 {
compatible = "marvell,mv88e6085";
reg = <0x2>;
dsa,member = <0 1>;
@@ -689,7 +689,7 @@ port@5 {
};
};
- switch2@12 {
+ switch@12 {
compatible = "marvell,mv88e6190";
reg = <0x12>;
dsa,member = <0 2>;
@@ -794,8 +794,8 @@ switch2port9: port@9 {
link = <&switch1port10 &switch0port10>;
};
- port-sfp@a {
- reg = <0xa>;
+ port-sfp@10 {
+ reg = <10>;
label = "sfp";
sfp = <&sfp>;
phy-mode = "sgmii";
@@ -805,7 +805,7 @@ port-sfp@a {
};
};
- switch2@2 {
+ switch@2 {
compatible = "marvell,mv88e6085";
reg = <0x2>;
dsa,member = <0 2>;
diff --git a/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts b/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts
index 48202810bf78..3cc794fcf12e 100644
--- a/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts
+++ b/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts
@@ -303,8 +303,6 @@ eth2phy: ethernet-phy@1 {
/* 88E6141 Topaz switch */
switch: switch@3 {
compatible = "marvell,mv88e6085";
- #address-cells = <1>;
- #size-cells = <0>;
reg = <3>;
pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/marvell/armada-8040-clearfog-gt-8k.dts b/arch/arm64/boot/dts/marvell/armada-8040-clearfog-gt-8k.dts
index 4125202028c8..7a25ea36b565 100644
--- a/arch/arm64/boot/dts/marvell/armada-8040-clearfog-gt-8k.dts
+++ b/arch/arm64/boot/dts/marvell/armada-8040-clearfog-gt-8k.dts
@@ -497,7 +497,7 @@ ge_phy: ethernet-phy@0 {
reset-deassert-us = <10000>;
};
- switch0: switch0@4 {
+ switch0: switch@4 {
compatible = "marvell,mv88e6085";
reg = <4>;
pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/marvell/cn9130-crb.dtsi b/arch/arm64/boot/dts/marvell/cn9130-crb.dtsi
index 32cfb3e2efc3..2f6281b66467 100644
--- a/arch/arm64/boot/dts/marvell/cn9130-crb.dtsi
+++ b/arch/arm64/boot/dts/marvell/cn9130-crb.dtsi
@@ -207,11 +207,9 @@ phy0: ethernet-phy@0 {
reg = <0>;
};
- switch6: switch0@6 {
+ switch6: switch@6 {
/* Actual device is MV88E6393X */
compatible = "marvell,mv88e6190";
- #address-cells = <1>;
- #size-cells = <0>;
reg = <6>;
interrupt-parent = <&cp0_gpio1>;
interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
@@ -280,7 +278,7 @@ port@9 {
managed = "in-band-status";
};
- port@a {
+ port@10 {
reg = <10>;
ethernet = <&cp0_eth0>;
phy-mode = "10gbase-r";
--
2.34.1
Fix some errors in the Marvell MV88E6xxx switch descriptions:
- switch0@0 is not OK, should be switch@0
Signed-off-by: Linus Walleij <[email protected]>
---
arch/arm/boot/dts/nxp/vf/vf610-zii-cfu1.dts | 2 +-
arch/arm/boot/dts/nxp/vf/vf610-zii-scu4-aib.dts | 8 ++++----
arch/arm/boot/dts/nxp/vf/vf610-zii-spb4.dts | 2 +-
arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-dtu.dts | 4 ++--
arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-spu3.dts | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/arm/boot/dts/nxp/vf/vf610-zii-cfu1.dts b/arch/arm/boot/dts/nxp/vf/vf610-zii-cfu1.dts
index 1a19aec8957b..add47d8fb58a 100644
--- a/arch/arm/boot/dts/nxp/vf/vf610-zii-cfu1.dts
+++ b/arch/arm/boot/dts/nxp/vf/vf610-zii-cfu1.dts
@@ -162,7 +162,7 @@ mdio1: mdio {
suppress-preamble;
status = "okay";
- switch0: switch0@0 {
+ switch0: switch@0 {
compatible = "marvell,mv88e6085";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_switch>;
diff --git a/arch/arm/boot/dts/nxp/vf/vf610-zii-scu4-aib.dts b/arch/arm/boot/dts/nxp/vf/vf610-zii-scu4-aib.dts
index df1335492a19..50356bd87d04 100644
--- a/arch/arm/boot/dts/nxp/vf/vf610-zii-scu4-aib.dts
+++ b/arch/arm/boot/dts/nxp/vf/vf610-zii-scu4-aib.dts
@@ -47,7 +47,7 @@ mdio_mux_1: mdio@1 {
#address-cells = <1>;
#size-cells = <0>;
- switch0: switch0@0 {
+ switch0: switch@0 {
compatible = "marvell,mv88e6190";
reg = <0>;
dsa,member = <0 0>;
@@ -130,7 +130,7 @@ mdio_mux_2: mdio@2 {
#address-cells = <1>;
#size-cells = <0>;
- switch1: switch1@0 {
+ switch1: switch@0 {
compatible = "marvell,mv88e6190";
reg = <0>;
dsa,member = <0 1>;
@@ -188,7 +188,7 @@ mdio_mux_4: mdio@4 {
#address-cells = <1>;
#size-cells = <0>;
- switch2: switch2@0 {
+ switch2: switch@0 {
compatible = "marvell,mv88e6190";
reg = <0>;
dsa,member = <0 2>;
@@ -276,7 +276,7 @@ mdio_mux_8: mdio@8 {
#address-cells = <1>;
#size-cells = <0>;
- switch3: switch3@0 {
+ switch3: switch@0 {
compatible = "marvell,mv88e6190";
reg = <0>;
dsa,member = <0 3>;
diff --git a/arch/arm/boot/dts/nxp/vf/vf610-zii-spb4.dts b/arch/arm/boot/dts/nxp/vf/vf610-zii-spb4.dts
index 1461804ecaea..20e9e2dacbe6 100644
--- a/arch/arm/boot/dts/nxp/vf/vf610-zii-spb4.dts
+++ b/arch/arm/boot/dts/nxp/vf/vf610-zii-spb4.dts
@@ -123,7 +123,7 @@ mdio1: mdio {
suppress-preamble;
status = "okay";
- switch0: switch0@0 {
+ switch0: switch@0 {
compatible = "marvell,mv88e6190";
pinctrl-0 = <&pinctrl_gpio_switch0>;
pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-dtu.dts b/arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-dtu.dts
index 463c2452b9b7..aa53a60518c3 100644
--- a/arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-dtu.dts
+++ b/arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-dtu.dts
@@ -112,7 +112,7 @@ mdio1: mdio {
suppress-preamble;
status = "okay";
- switch0: switch0@0 {
+ switch0: switch@0 {
compatible = "marvell,mv88e6190";
pinctrl-0 = <&pinctrl_gpio_switch0>;
pinctrl-names = "default";
@@ -167,7 +167,7 @@ port@9 {
};
};
- mdio1 {
+ mdio-external {
compatible = "marvell,mv88e6xxx-mdio-external";
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-spu3.dts b/arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-spu3.dts
index f5ae0d5de315..0b7063b74130 100644
--- a/arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-spu3.dts
+++ b/arch/arm/boot/dts/nxp/vf/vf610-zii-ssmb-spu3.dts
@@ -137,7 +137,7 @@ mdio1: mdio {
suppress-preamble;
status = "okay";
- switch0: switch0@0 {
+ switch0: switch@0 {
compatible = "marvell,mv88e6190";
pinctrl-0 = <&pinctrl_gpio_switch0>;
pinctrl-names = "default";
--
2.34.1
Fix some errors in the Marvell MV88E6xxx switch descriptions:
- The top node had no address size or cells.
- switch0@0 is not OK, should be switch@0.
- port@a is not normal port naming, use decimal port@10.
- The ports node should have port@0 etc children, no
plural "ports".
This serves as an example of fixes needed for introducing a
schema for the bindings, but the patch can simply be applied.
Signed-off-by: Linus Walleij <[email protected]>
---
arch/arm/boot/dts/marvell/armada-370-rd.dts | 2 --
.../arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts | 6 ++----
arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts | 2 +-
arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts | 2 +-
arch/arm/boot/dts/marvell/armada-385-linksys.dtsi | 2 --
arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts | 16 +++++++---------
arch/arm/boot/dts/marvell/armada-388-clearfog.dts | 2 --
arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts | 2 --
8 files changed, 11 insertions(+), 23 deletions(-)
diff --git a/arch/arm/boot/dts/marvell/armada-370-rd.dts b/arch/arm/boot/dts/marvell/armada-370-rd.dts
index b459a670f615..e3a1834986ee 100644
--- a/arch/arm/boot/dts/marvell/armada-370-rd.dts
+++ b/arch/arm/boot/dts/marvell/armada-370-rd.dts
@@ -151,8 +151,6 @@ led@0 {
switch: switch@10 {
compatible = "marvell,mv88e6085";
- #address-cells = <1>;
- #size-cells = <0>;
reg = <0x10>;
interrupt-controller;
#interrupt-cells = <2>;
diff --git a/arch/arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts b/arch/arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts
index f4c4b213ef4e..cf37f53ec070 100644
--- a/arch/arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts
+++ b/arch/arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts
@@ -79,14 +79,12 @@ &mdio {
switch@0 {
compatible = "marvell,mv88e6190";
- #address-cells = <1>;
#interrupt-cells = <2>;
interrupt-controller;
interrupt-parent = <&gpio1>;
interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
pinctrl-0 = <&switch_interrupt_pins>;
pinctrl-names = "default";
- #size-cells = <0>;
reg = <0>;
mdio {
@@ -214,12 +212,12 @@ port@9 {
reg = <9>;
};
- port@a {
+ port@10 {
/* 88X3310P external phy */
label = "lan10";
phy-handle = <&phy2>;
phy-mode = "xaui";
- reg = <0xa>;
+ reg = <10>;
};
};
};
diff --git a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts
index 1990f7d0cc79..1be0419f8f3e 100644
--- a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts
+++ b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts
@@ -7,7 +7,7 @@ / {
};
&mdio {
- switch0: switch0@4 {
+ switch0: switch@4 {
compatible = "marvell,mv88e6190";
reg = <4>;
pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts
index b795ad573891..6ec536222bfb 100644
--- a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts
+++ b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts
@@ -11,7 +11,7 @@ &sfp0 {
};
&mdio {
- switch0: switch0@4 {
+ switch0: switch@4 {
compatible = "marvell,mv88e6085";
reg = <4>;
pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi b/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi
index fc8216fd9f60..63a0bc9455ca 100644
--- a/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi
+++ b/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi
@@ -160,8 +160,6 @@ &mdio {
switch@0 {
compatible = "marvell,mv88e6085";
- #address-cells = <1>;
- #size-cells = <0>;
reg = <0>;
ports {
diff --git a/arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts b/arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts
index 2d8d319bec83..8c69dbd6a2c7 100644
--- a/arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts
@@ -439,8 +439,6 @@ switch@10 {
pinctrl-names = "default";
pinctrl-0 = <&swint_pins>;
compatible = "marvell,mv88e6085";
- #address-cells = <1>;
- #size-cells = <0>;
dsa,member = <0 0>;
reg = <0x10>;
@@ -452,32 +450,32 @@ ports {
#address-cells = <1>;
#size-cells = <0>;
- ports@0 {
+ port@0 {
reg = <0>;
label = "lan0";
};
- ports@1 {
+ port@1 {
reg = <1>;
label = "lan1";
};
- ports@2 {
+ port@2 {
reg = <2>;
label = "lan2";
};
- ports@3 {
+ port@3 {
reg = <3>;
label = "lan3";
};
- ports@4 {
+ port@4 {
reg = <4>;
label = "lan4";
};
- ports@5 {
+ port@5 {
reg = <5>;
ethernet = <ð1>;
phy-mode = "rgmii-id";
@@ -488,7 +486,7 @@ fixed-link {
};
};
- ports@6 {
+ port@6 {
reg = <6>;
ethernet = <ð0>;
phy-mode = "rgmii-id";
diff --git a/arch/arm/boot/dts/marvell/armada-388-clearfog.dts b/arch/arm/boot/dts/marvell/armada-388-clearfog.dts
index 32c569df142f..ab46903580aa 100644
--- a/arch/arm/boot/dts/marvell/armada-388-clearfog.dts
+++ b/arch/arm/boot/dts/marvell/armada-388-clearfog.dts
@@ -94,8 +94,6 @@ &mdio {
switch@4 {
compatible = "marvell,mv88e6085";
- #address-cells = <1>;
- #size-cells = <0>;
reg = <4>;
pinctrl-0 = <&clearfog_dsa0_clk_pins &clearfog_dsa0_pins>;
pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts b/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts
index 7a0614fd0c93..2a5518c73bff 100644
--- a/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts
+++ b/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts
@@ -267,8 +267,6 @@ &mdio {
switch@0 {
compatible = "marvell,mv88e6085";
- #address-cells = <1>;
- #size-cells = <0>;
reg = <0>;
ports {
--
2.34.1
On Mon, 16 Oct 2023 11:12:54 +0200, Linus Walleij wrote:
> This is an attempt to rewrite the Marvell MV88E6xxx switch bindings
> in YAML schema.
>
> The current text binding says:
> WARNING: This binding is currently unstable. Do not program it into a
> FLASH never to be changed again. Once this binding is stable, this
> warning will be removed.
>
> Well that never happened before we switched to YAML markup,
> we can't have it like this, what about fixing the mess?
>
> Signed-off-by: Linus Walleij <[email protected]>
> ---
> .../bindings/net/dsa/marvell,mv88e6xxx.yaml | 243 +++++++++++++++++++++
> .../devicetree/bindings/net/dsa/marvell.txt | 109 ---------
> MAINTAINERS | 2 +-
> 3 files changed, 244 insertions(+), 110 deletions(-)
>
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
./Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml:78:5: [error] syntax error: could not find expected ':' (syntax)
dtschema/dtc warnings/errors:
make[2]: *** Deleting file 'Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.example.dts'
Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml:78:5: could not find expected ':'
make[2]: *** [Documentation/devicetree/bindings/Makefile:26: Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.example.dts] Error 1
make[2]: *** Waiting for unfinished jobs....
./Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml:78:5: could not find expected ':'
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml: ignoring, error parsing file
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1427: dt_binding_check] Error 2
make: *** [Makefile:234: __sub-make] Error 2
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
On Mon, Oct 16, 2023 at 11:12:59AM +0200, Linus Walleij wrote:
> - port@a is not normal port naming, use decimal port@10.
What is the basis on which you are claiming this? How do you explain
"ethernet@30000" for "reg = <0x30000 0x4000>"?
On Mon, Oct 16, 2023 at 11:12:54AM +0200, Linus Walleij wrote:
> This is an attempt to rewrite the Marvell MV88E6xxx switch bindings
> in YAML schema.
>
> The current text binding says:
> WARNING: This binding is currently unstable. Do not program it into a
> FLASH never to be changed again. Once this binding is stable, this
> warning will be removed.
>
> Well that never happened before we switched to YAML markup,
> we can't have it like this, what about fixing the mess?
Removing that remark seems in order.
>
> Signed-off-by: Linus Walleij <[email protected]>
> ---
> .../bindings/net/dsa/marvell,mv88e6xxx.yaml | 243 +++++++++++++++++++++
> .../devicetree/bindings/net/dsa/marvell.txt | 109 ---------
> MAINTAINERS | 2 +-
> 3 files changed, 244 insertions(+), 110 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml b/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml
> new file mode 100644
> index 000000000000..954db04147f8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml
> @@ -0,0 +1,243 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/dsa/marvell,mv88e6xxx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Marvell MV88E6xxx DSA switch family
> +
> +maintainers:
> + - Andrew Lunn <[email protected]>
> +
> +description:
> + The Marvell MV88E6xxx switch series has been produced and sold
> + by Marvell since at least 2010. The switch has a few compatibles which
> + just indicate the base address of the switch, then operating systems
> + can investigate switch ID registers to find out which actual version
> + of the switch it is dealing with.
> +
> +properties:
> + compatible:
> + oneOf:
> + - enum:
> + - marvell,mv88e6085
> + - marvell,mv88e6190
> + - marvell,mv88e6250
> + description: |
> + marvell,mv88e6085: This switch uses base address 0x10.
> + This switch and its siblings will be autodetected from
> + ID registers found in the switch, so only "marvell,mv88e6085" should be
> + specified. This includes the following list of MV88Exxxx switches:
> + 6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165, 6171, 6172, 6175, 6176,
> + 6185, 6240, 6320, 6321, 6341, 6350, 6351, 6352
> + marvell,mv88e6190: This switch uses base address 0x00.
> + This switch and its siblings will be autodetected from
> + ID registers found in the switch, so only "marvell,mv88e6190" should be
> + specified. This includes the following list of MV88Exxxx switches:
> + 6190, 6190X, 6191, 6290, 6361, 6390, 6390X
> + marvell,mv88e6250: This switch uses base address 0x08 or 0x18.
> + This switch and its siblings will be autodetected from
> + ID registers found in the switch, so only "marvell,mv88e6250" should be
> + specified. This includes the following list of MV88Exxxx switches:
> + 6220, 6250
> +
> + reg:
> + maxItems: 1
> +
> + eeprom-length:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Set to the length of an EEPROM connected to the switch. Must be
> + set if the switch can not detect the presence and/or size of a connected
> + EEPROM, otherwise optional.
> +
> + reset-gpios:
> + description:
> + GPIO to be used to reset the whole device
> + maxItems: 1
> +
> + interrupts:
> + description: The switch provides an external interrupt line, but it is
> + not always used by target systems.
> + maxItems: 1
> +
> + interrupt-controller:
> + description: The switch has an internal interrupt controller used by
> + the different sub-blocks.
> +
> + '#interrupt-cells':
> + description: The internal interrupt controller only supports triggering
> + on active high level interrupts so the second cell must alway be set to
> + IRQ_TYPE_LEVEL_HIGH.
> + const: 2
> +
> + mdio:
> + $ref: /schemas/net/mdio.yaml#
> + unevaluatedProperties: false
> + description: Marvell MV88E6xxx switches have an varying combination of
> + internal and external MDIO buses, in some cases a combined bus that
> + can be used both internally and externally. This node is for the
> + primary bus, used internally and sometimes also externally.
> +
> + mdio-external:
> + $ref: /schemas/net/mdio.yaml#
> + unevaluatedProperties: false
> + description: Marvell MV88E6xxx switches that have a separate external
> + MDIO bus use this port to access external components on the MDIO bus.
> +
> + properties:
> + compatible:
> + const: marvell,mv88e6xxx-mdio-external
> +
> + required:
> + - compatible
> +
> +$ref: dsa.yaml#
> +
> +patternProperties:
> + "^(ethernet-)?ports$":
> + type: object
> + patternProperties:
> + "^(ethernet-)?port@[0-9]+$":
> + type: object
> + description: Ethernet switch ports
> +
> + $ref: dsa-port.yaml#
> +
> + unevaluatedProperties: false
> +
> +oneOf:
> + - required:
> + - ports
> + - required:
> + - ethernet-ports
> +
> +required:
> + - compatible
> + - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> + mdio {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + switch0: switch@0 {
ethernet-switch is preferred
> + compatible = "marvell,mv88e6085";
> + reg = <0>;
> + reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
> + interrupt-parent = <&gpio0>;
I don't see interrupt-parent as an accepted property in the schema.
Should interrupts-extended also be accepted?
> + interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
> + interrupt-controller;
> + #interrupt-cells = <2>;
> +
> + ports {
ethernet-ports is preferred
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + label = "lan1";
> + };
> + port@1 {
> + reg = <1>;
> + label = "lan2";
> + };
> + port@2 {
> + reg = <2>;
> + label = "lan3";
> + };
> + port@3 {
> + reg = <3>;
> + label = "lan4";
> + };
> + port@4 {
> + reg = <4>;
> + label = "wan";
> + };
> +
> + port@5 {
> + reg = <5>;
> + phy-mode = "sgmii";
> + ethernet = <ð2>;
> +
> + fixed-link {
> + speed = <1000>;
> + full-duplex;
> + };
> + };
> + };
> +
> + mdio {
> + #address-cells = <1>;
> + #size-cells = <0>;
One blank link here
> + switch0phy0: switch0phy@0 {
ethernet-phy@0
> + reg = <0>;
> + interrupt-parent = <&switch0>;
> + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
interrupts-extended = <&switch0 0 IRQ_TYPE_LEVEL_HIGH>; would be shorter
> + };
> + };
> + };
> + };
> +
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> + mdio {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + switch1: switch@0 {
> + compatible = "marvell,mv88e6190";
> + reg = <0>;
> + reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
> + interrupt-parent = <&gpio0>;
> + interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
> + interrupt-controller;
> + #interrupt-cells = <2>;
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + label = "lan1";
> + };
> + port@1 {
> + reg = <1>;
> + label = "lan2";
> + };
> + port@2 {
> + reg = <2>;
> + label = "lan3";
> + };
> + port@3 {
> + reg = <3>;
> + label = "lan4";
> + };
FWIW, this example would be rejected by real-life DSA, because a CPU
port is missing (no port has an "ethernet" phandle).
> + };
> +
> + mdio {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + switch1phy0: switch1phy@0 {
ethernet-phy@0
> + reg = <0>;
> + interrupt-parent = <&switch1>;
> + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> + };
> + };
> +
> + mdio-external {
> + compatible = "marvell,mv88e6xxx-mdio-external";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + switch1phy9: switch1phy@9 {
ethernet-phy@9
> + reg = <9>;
> + };
> + };
> + };
> + };
On Mon, Oct 16, 2023 at 11:12:54AM +0200, Linus Walleij wrote:
> This is an attempt to rewrite the Marvell MV88E6xxx switch bindings
> in YAML schema.
>
> The current text binding says:
> WARNING: This binding is currently unstable. Do not program it into a
> FLASH never to be changed again. Once this binding is stable, this
> warning will be removed.
>
> Well that never happened before we switched to YAML markup,
> we can't have it like this, what about fixing the mess?
>
> Signed-off-by: Linus Walleij <[email protected]>
> ---
It would make more sense for this patch to be last, after you've fixed
the warnings that this patch introduces.
On Mon, Oct 16, 2023 at 11:12:54AM +0200, Linus Walleij wrote:
> This is an attempt to rewrite the Marvell MV88E6xxx switch bindings
> in YAML schema.
>
> The current text binding says:
> WARNING: This binding is currently unstable. Do not program it into a
> FLASH never to be changed again. Once this binding is stable, this
> warning will be removed.
>
> Well that never happened before we switched to YAML markup,
> we can't have it like this, what about fixing the mess?
>
> Signed-off-by: Linus Walleij <[email protected]>
> ---
> .../bindings/net/dsa/marvell,mv88e6xxx.yaml | 243 +++++++++++++++++++++
> .../devicetree/bindings/net/dsa/marvell.txt | 109 ---------
> MAINTAINERS | 2 +-
> 3 files changed, 244 insertions(+), 110 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml b/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml
> new file mode 100644
> index 000000000000..954db04147f8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml
> @@ -0,0 +1,243 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/dsa/marvell,mv88e6xxx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Marvell MV88E6xxx DSA switch family
> +
> +maintainers:
> + - Andrew Lunn <[email protected]>
> +
> +description:
> + The Marvell MV88E6xxx switch series has been produced and sold
> + by Marvell since at least 2010. The switch has a few compatibles which
> + just indicate the base address of the switch, then operating systems
> + can investigate switch ID registers to find out which actual version
> + of the switch it is dealing with.
> +
> +properties:
> + compatible:
> + oneOf:
> + - enum:
Don't need oneOf with only 1 entry. However, I'd probably split each
compatible and description for it into 3 entries.
> + - marvell,mv88e6085
> + - marvell,mv88e6190
> + - marvell,mv88e6250
> + description: |
> + marvell,mv88e6085: This switch uses base address 0x10.
> + This switch and its siblings will be autodetected from
> + ID registers found in the switch, so only "marvell,mv88e6085" should be
> + specified. This includes the following list of MV88Exxxx switches:
> + 6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165, 6171, 6172, 6175, 6176,
> + 6185, 6240, 6320, 6321, 6341, 6350, 6351, 6352
> + marvell,mv88e6190: This switch uses base address 0x00.
> + This switch and its siblings will be autodetected from
> + ID registers found in the switch, so only "marvell,mv88e6190" should be
> + specified. This includes the following list of MV88Exxxx switches:
> + 6190, 6190X, 6191, 6290, 6361, 6390, 6390X
> + marvell,mv88e6250: This switch uses base address 0x08 or 0x18.
> + This switch and its siblings will be autodetected from
> + ID registers found in the switch, so only "marvell,mv88e6250" should be
> + specified. This includes the following list of MV88Exxxx switches:
> + 6220, 6250
> +
> + reg:
> + maxItems: 1
> +
> + eeprom-length:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Set to the length of an EEPROM connected to the switch. Must be
> + set if the switch can not detect the presence and/or size of a connected
> + EEPROM, otherwise optional.
> +
> + reset-gpios:
> + description:
> + GPIO to be used to reset the whole device
> + maxItems: 1
> +
> + interrupts:
> + description: The switch provides an external interrupt line, but it is
> + not always used by target systems.
> + maxItems: 1
> +
> + interrupt-controller:
> + description: The switch has an internal interrupt controller used by
> + the different sub-blocks.
> +
> + '#interrupt-cells':
> + description: The internal interrupt controller only supports triggering
> + on active high level interrupts so the second cell must alway be set to
> + IRQ_TYPE_LEVEL_HIGH.
> + const: 2
> +
> + mdio:
> + $ref: /schemas/net/mdio.yaml#
> + unevaluatedProperties: false
> + description: Marvell MV88E6xxx switches have an varying combination of
> + internal and external MDIO buses, in some cases a combined bus that
> + can be used both internally and externally. This node is for the
> + primary bus, used internally and sometimes also externally.
> +
> + mdio-external:
> + $ref: /schemas/net/mdio.yaml#
> + unevaluatedProperties: false
> + description: Marvell MV88E6xxx switches that have a separate external
> + MDIO bus use this port to access external components on the MDIO bus.
> +
> + properties:
> + compatible:
> + const: marvell,mv88e6xxx-mdio-external
> +
> + required:
> + - compatible
> +
> +$ref: dsa.yaml#
> +
> +patternProperties:
> + "^(ethernet-)?ports$":
> + type: object
> + patternProperties:
> + "^(ethernet-)?port@[0-9]+$":
> + type: object
> + description: Ethernet switch ports
> +
> + $ref: dsa-port.yaml#
> +
> + unevaluatedProperties: false
You can drop all this and ref dsa.yaml#/$defs/ethernet-ports instead of
just dsa.yaml.
> +
> +oneOf:
> + - required:
> + - ports
> + - required:
> + - ethernet-ports
This probably belongs in dsa.yaml.
Rob
On Mon, Oct 16, 2023 at 02:08:58PM +0300, Vladimir Oltean wrote:
> On Mon, Oct 16, 2023 at 11:12:54AM +0200, Linus Walleij wrote:
> > This is an attempt to rewrite the Marvell MV88E6xxx switch bindings
> > in YAML schema.
> >
> > The current text binding says:
> > WARNING: This binding is currently unstable. Do not program it into a
> > FLASH never to be changed again. Once this binding is stable, this
> > warning will be removed.
> >
> > Well that never happened before we switched to YAML markup,
> > we can't have it like this, what about fixing the mess?
>
> Removing that remark seems in order.
>
> >
> > Signed-off-by: Linus Walleij <[email protected]>
> > ---
> > .../bindings/net/dsa/marvell,mv88e6xxx.yaml | 243 +++++++++++++++++++++
> > .../devicetree/bindings/net/dsa/marvell.txt | 109 ---------
> > MAINTAINERS | 2 +-
> > 3 files changed, 244 insertions(+), 110 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml b/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml
> > new file mode 100644
> > index 000000000000..954db04147f8
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml
> > @@ -0,0 +1,243 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/net/dsa/marvell,mv88e6xxx.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Marvell MV88E6xxx DSA switch family
> > +
> > +maintainers:
> > + - Andrew Lunn <[email protected]>
> > +
> > +description:
> > + The Marvell MV88E6xxx switch series has been produced and sold
> > + by Marvell since at least 2010. The switch has a few compatibles which
> > + just indicate the base address of the switch, then operating systems
> > + can investigate switch ID registers to find out which actual version
> > + of the switch it is dealing with.
> > +
> > +properties:
> > + compatible:
> > + oneOf:
> > + - enum:
> > + - marvell,mv88e6085
> > + - marvell,mv88e6190
> > + - marvell,mv88e6250
> > + description: |
> > + marvell,mv88e6085: This switch uses base address 0x10.
> > + This switch and its siblings will be autodetected from
> > + ID registers found in the switch, so only "marvell,mv88e6085" should be
> > + specified. This includes the following list of MV88Exxxx switches:
> > + 6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165, 6171, 6172, 6175, 6176,
> > + 6185, 6240, 6320, 6321, 6341, 6350, 6351, 6352
> > + marvell,mv88e6190: This switch uses base address 0x00.
> > + This switch and its siblings will be autodetected from
> > + ID registers found in the switch, so only "marvell,mv88e6190" should be
> > + specified. This includes the following list of MV88Exxxx switches:
> > + 6190, 6190X, 6191, 6290, 6361, 6390, 6390X
> > + marvell,mv88e6250: This switch uses base address 0x08 or 0x18.
> > + This switch and its siblings will be autodetected from
> > + ID registers found in the switch, so only "marvell,mv88e6250" should be
> > + specified. This includes the following list of MV88Exxxx switches:
> > + 6220, 6250
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + eeprom-length:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Set to the length of an EEPROM connected to the switch. Must be
> > + set if the switch can not detect the presence and/or size of a connected
> > + EEPROM, otherwise optional.
> > +
> > + reset-gpios:
> > + description:
> > + GPIO to be used to reset the whole device
> > + maxItems: 1
> > +
> > + interrupts:
> > + description: The switch provides an external interrupt line, but it is
> > + not always used by target systems.
> > + maxItems: 1
> > +
> > + interrupt-controller:
> > + description: The switch has an internal interrupt controller used by
> > + the different sub-blocks.
> > +
> > + '#interrupt-cells':
> > + description: The internal interrupt controller only supports triggering
> > + on active high level interrupts so the second cell must alway be set to
> > + IRQ_TYPE_LEVEL_HIGH.
> > + const: 2
> > +
> > + mdio:
> > + $ref: /schemas/net/mdio.yaml#
> > + unevaluatedProperties: false
> > + description: Marvell MV88E6xxx switches have an varying combination of
> > + internal and external MDIO buses, in some cases a combined bus that
> > + can be used both internally and externally. This node is for the
> > + primary bus, used internally and sometimes also externally.
> > +
> > + mdio-external:
> > + $ref: /schemas/net/mdio.yaml#
> > + unevaluatedProperties: false
> > + description: Marvell MV88E6xxx switches that have a separate external
> > + MDIO bus use this port to access external components on the MDIO bus.
> > +
> > + properties:
> > + compatible:
> > + const: marvell,mv88e6xxx-mdio-external
> > +
> > + required:
> > + - compatible
> > +
> > +$ref: dsa.yaml#
> > +
> > +patternProperties:
> > + "^(ethernet-)?ports$":
> > + type: object
> > + patternProperties:
> > + "^(ethernet-)?port@[0-9]+$":
> > + type: object
> > + description: Ethernet switch ports
> > +
> > + $ref: dsa-port.yaml#
> > +
> > + unevaluatedProperties: false
> > +
> > +oneOf:
> > + - required:
> > + - ports
> > + - required:
> > + - ethernet-ports
> > +
> > +required:
> > + - compatible
> > + - reg
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/gpio/gpio.h>
> > + #include <dt-bindings/interrupt-controller/irq.h>
> > + mdio {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + switch0: switch@0 {
>
> ethernet-switch is preferred
>
> > + compatible = "marvell,mv88e6085";
> > + reg = <0>;
> > + reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
> > + interrupt-parent = <&gpio0>;
>
> I don't see interrupt-parent as an accepted property in the schema.
> Should interrupts-extended also be accepted?
Both are implicitly accepted since 'interrupts' is.
Rob