dt-bindings: net: microchip,lan78xx: convert to DT schema
PATCH v2 1/1 dt-bindings: net: microchip,lan78xx: convert to DT schema
Convert the Microchip LAN78xx family (LAN7800, LAN7801, LAN7850) binding documentation from plain text to DT schema.
The conversion adds proper validation for the 'microchip,led-modes' property inside the MDIO node and updates the MAINTAINERS entry.
---
Changes in v2:
- Rename file to microchip,lan7800.yaml.
- Keeps only one maintainer.
- Code style fixed.
- Example fixed, remove usb-port@1 node.
- Move patternProperties for PHY inside mdio node to fix validation. (suggested by sashiko-bot)
Link to v1: https://lore.kernel.org/netdev/[email protected]
.../bindings/net/microchip,lan7800.yaml | 105 ++++++++++++++++++ .../bindings/net/microchip,lan78xx.txt | 53 --------- MAINTAINERS | 3 +- 3 files changed, 106 insertions(+), 55 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/microchip,lan7800.yaml delete mode 100644 Documentation/devicetree/bindings/net/microchip,lan78xx.txt
Documentation/devicetree/bindings/net/microchip,lan7800.yaml new file +105 -0
@@ -0,0 +1,105 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/microchip,lan7800.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip LAN7800/LAN7801/LAN7850 Gigabit Ethernet controller + +maintainers: + - Rengarajan Sundararajan <[email protected]> + +description: + The LAN7800/LAN7801/LAN7850 devices are usually configured by + programming their OTP or with an external EEPROM, but some + platforms (e.g. Raspberry Pi 3 B+) have neither. The Device Tree + properties, if present, override the OTP and EEPROM. + +allOf: + - $ref: /schemas/usb/usb-device.yaml# + - $ref: /schemas/net/ethernet-controller.yaml# + +properties: + compatible: + enum: + - usb424,7800 + - usb424,7801 + - usb424,7850 + + reg: + maxItems: 1 + description: USB port number + + local-mac-address: + $ref: /schemas/types.yaml#/definitions/uint8-array + minItems: 6 + maxItems: 6 + description: + MAC address to use if not stored in OTP or EEPROM. If present, + overrides OTP/EEPROM. + + mdio: + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + + patternProperties: + "^ethernet-phy(@[0-9a-f]+)?$": + type: object + description: | + PHY node for the embedded or external PHY. The PHY address is + given by the 'reg' property. + + properties: + reg: + maxItems: 1 + description: PHY address. + + microchip,led-modes: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 4 + description: + Array of LED mode values for each of up to 4 LEDs. + Omitted LEDs are turned off. Allowed values are defined + in include/dt-bindings/net/microchip-lan78xx.h. + + required: + - reg + + additionalProperties: false + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/net/microchip-lan78xx.h> + / { + usb { + compatible = "usb-host"; + #address-cells = <1>; + #size-cells = <0>; + + ethernet@1 { + compatible = "usb424,7800"; + reg = <1>; + local-mac-address = [00 11 22 33 44 55]; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + ethernet-phy@1 { + reg = <1>; + microchip,led-modes = < + LAN78XX_LINK_1000_ACTIVITY + LAN78XX_LINK_10_100_ACTIVITY + >; + }; + }; + }; + }; + }; +...
Documentation/devicetree/bindings/net/microchip,lan78xx.txt deleted +0 -53
53 lines not on this page · raw message
MAINTAINERS +1 -2
@@ -27928,10 +27928,9 @@ F: drivers/usb/isp1760/* USB LAN78XX ETHERNET DRIVER M: Thangaraj Samynathan <[email protected]> M: Rengarajan Sundararajan <[email protected]> -M: [email protected] L: [email protected] S: Maintained -F: Documentation/devicetree/bindings/net/microchip,lan78xx.txt +F: Documentation/devicetree/bindings/net/microchip,lan7800.yaml F: drivers/net/usb/lan78xx.* F: include/dt-bindings/net/microchip-lan78xx.h
Signature · 1 line
2.52.0
Rob Herring (Arm)
maintainerQuoted 15 lines · Mikhail Lukianchikov
Convert the Microchip LAN78xx family (LAN7800, LAN7801, LAN7850) binding documentation from plain text to DT schema.
The conversion adds proper validation for the 'microchip,led-modes' property inside the MDIO node and updates the
MAINTAINERSentry.Signed-off-by Mikhail Lukianchikov <[email protected]>---
Changes in v2:
- Rename file to microchip,lan7800.yaml.
- Keeps only one maintainer.
- Code style fixed.
- Example fixed, remove usb-port@1 node.
- Move patternProperties for PHY inside mdio node to fix validation. (suggested by sashiko-bot)
Quoted 9 lines
Link to v1: https://lore.kernel.org/netdev/[email protected]
.../bindings/net/microchip,lan7800.yaml | 105 ++++++++++++++++++ .../bindings/net/microchip,lan78xx.txt | 53 --------- MAINTAINERS | 3 +- 3 files changed, 106 insertions(+), 55 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/microchip,lan7800.yaml delete mode 100644 Documentation/devicetree/bindings/net/microchip,lan78xx.txt
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/microchip,lan7800.example.dtb: /: 'compatible' is a required property
from schema $id: http://devicetree.org/schemas/root-node.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/microchip,lan7800.example.dtb: /: 'model' is a required property
from schema $id: http://devicetree.org/schemas/root-node.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/microchip,lan7800.example.dtb: /: '#address-cells' is a required property
from schema $id: http://devicetree.org/schemas/root-node.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/microchip,lan7800.example.dtb: /: '#size-cells' is a required property
from schema $id: http://devicetree.org/schemas/root-node.yamlDocumentation/devicetree/bindings/net/microchip,lan7800.example.dtb: /usb: failed to match any schema with compatible: ['usb-host']
doc reference errors (make refcheckdocs):
See https://patchwork.kernel.org/project/devicetree/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.
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The ethernet-phy node schema incorrectly rejects standard Ethernet PHY properties by using…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The ethernet-phy node schema incorrectly rejects standard Ethernet PHY properties by using additionalProperties: false without referencing ethernet-phy.yaml. --
--- Patch [1]: [PATCH v2] dt-bindings: net: microchip,lan78xx: convert to DT schema --- commit 484d7e78e4b223fac4e7382aab39e598f0a7d9b3
Author: Mikhail Lukianchikov <[email protected]>
dt-bindings: net: microchip,lan78xx: convert to DT schema
Convert the Microchip LAN78xx family (LAN7800, LAN7801, LAN7850) binding documentation from plain text to DT schema. The conversion adds proper validation for the 'microchip,led-modes' property inside the MDIO node.
Quoted 5 lines
Documentation/devicetree/bindings/net/microchip,lan7800.yaml new file +0
-0
[ ... ]
Quoted 15 lines
Documentation/devicetree/bindings/net/microchip,lan7800.yaml new file +15
-0+ patternProperties: + "^ethernet-phy(@[0-9a-f]+)?$": + type: object + description: | + PHY node for the embedded or external PHY. The PHY address is + given by the 'reg' property. + + properties: + reg: + maxItems: 1 + description: PHY address. + + microchip,led-modes: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1
Documentation/devicetree/bindings/net/microchip,lan7800.yaml line 69
Quoted 10 lines
Documentation/devicetree/bindings/net/microchip,lan7800.yaml new file +10
-0+ maxItems: 4 + description: + Array of LED mode values for each of up to 4 LEDs. + Omitted LEDs are turned off. Allowed values are defined + in include/dt-bindings/net/microchip-lan78xx.h. + + required: + - reg + + additionalProperties: false
[Severity: Medium]
Will this schema definition incorrectly reject standard Ethernet PHY properties?
Using additionalProperties: false here without an explicit $ref: /schemas/net/ethernet-phy.yaml# strictly forbids all standard Ethernet PHY properties (like max-speed, interrupts, or reset-gpios) on the child ethernet-phy node.
This causes the dt-schema validation to fail for boards that legitimately describe their hardware PHY connections, which forces users to omit valid device descriptions to pass validation.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Rob Herring
maintainerQuoted 67 lines · Mikhail Lukianchikov
Convert the Microchip LAN78xx family (LAN7800, LAN7801, LAN7850) binding documentation from plain text to DT schema.
The conversion adds proper validation for the 'microchip,led-modes' property inside the MDIO node and updates the
MAINTAINERSentry.Signed-off-by Mikhail Lukianchikov <[email protected]>---
Changes in v2:
- Rename file to microchip,lan7800.yaml.
- Keeps only one maintainer.
- Code style fixed.
- Example fixed, remove usb-port@1 node.
- Move patternProperties for PHY inside mdio node to fix validation. (suggested by sashiko-bot)Link to v1: https://lore.kernel.org/netdev/[email protected]
.../bindings/net/microchip,lan7800.yaml | 105 ++++++++++++++++++ .../bindings/net/microchip,lan78xx.txt | 53 --------- MAINTAINERS | 3 +- 3 files changed, 106 insertions(+), 55 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/microchip,lan7800.yaml delete mode 100644 Documentation/devicetree/bindings/net/microchip,lan78xx.txtDocumentation/devicetree/bindings/net/microchip,lan7800.yaml new file +37
-0@@ -0,0 +1,105 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/microchip,lan7800.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip LAN7800/LAN7801/LAN7850 Gigabit Ethernet controller + +maintainers: + - Rengarajan Sundararajan <[email protected]> + +description: + The LAN7800/LAN7801/LAN7850 devices are usually configured by + programming their OTP or with an external EEPROM, but some + platforms (e.g. Raspberry Pi 3 B+) have neither. The Device Tree + properties, if present, override the OTP and EEPROM. + +allOf: + - $ref: /schemas/usb/usb-device.yaml# + - $ref: /schemas/net/ethernet-controller.yaml# + +properties: + compatible: + enum: + - usb424,7800 + - usb424,7801 + - usb424,7850 + + reg: + maxItems: 1 + description: USB port number + + local-mac-address: + $ref: /schemas/types.yaml#/definitions/uint8-array + minItems: 6 + maxItems: 6 + description:
Documentation/devicetree/bindings/net/microchip,lan7800.yaml line 47
Quoted 10 lines
Documentation/devicetree/bindings/net/microchip,lan7800.yaml new file +10
-0+ MAC address to use if not stored in OTP or EEPROM. If present, + overrides OTP/EEPROM. + + mdio: + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + + patternProperties: + "^ethernet-phy(@[0-9a-f]+)?$": + type: object
Is there some reason standard phy properties are not valid here? If not, then add:
$ref: /schemas/net/ethernet-phy.yaml#
unevaluatedProperties: false
Documentation/devicetree/bindings/net/microchip,lan7800.yaml line 50
Quoted 3 lines
Documentation/devicetree/bindings/net/microchip,lan7800.yaml new file +3
-0+ description: | + PHY node for the embedded or external PHY. The PHY address is + given by the 'reg' property.
Drop. That's true for every MDIO bus.
Quoted 20 lines
Documentation/devicetree/bindings/net/microchip,lan7800.yaml new file +20
-0+ + properties: + reg: + maxItems: 1 + description: PHY address. + + microchip,led-modes: + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 4 + description: + Array of LED mode values for each of up to 4 LEDs. + Omitted LEDs are turned off. Allowed values are defined + in include/dt-bindings/net/microchip-lan78xx.h. + + required: + - reg + + additionalProperties: false +
Documentation/devicetree/bindings/net/microchip,lan7800.yaml line 80
Quoted 10 lines
Documentation/devicetree/bindings/net/microchip,lan7800.yaml new file +10
-0+required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/net/microchip-lan78xx.h> + / {
Drop root node.
Documentation/devicetree/bindings/net/microchip,lan7800.yaml line 82
Quoted 2 lines
Documentation/devicetree/bindings/net/microchip,lan7800.yaml new file +2
-0+ usb { + compatible = "usb-host";
Drop fake compatibles.
Quoted 23 lines
Documentation/devicetree/bindings/net/microchip,lan7800.yaml new file +23
-0+ #address-cells = <1>; + #size-cells = <0>; + + ethernet@1 { + compatible = "usb424,7800"; + reg = <1>; + local-mac-address = [00 11 22 33 44 55]; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + ethernet-phy@1 { + reg = <1>; + microchip,led-modes = < + LAN78XX_LINK_1000_ACTIVITY + LAN78XX_LINK_10_100_ACTIVITY + >; + }; + }; + }; + }; + }; +...