On Thu, Jun 27, 2024 at 09:55:47AM -0600, Rob Herring wrote: > On Wed, Jun 26, 2024 at 12:23:07PM -0400, Frank Li wrote: > > Convert enetc device binding file to yaml. Split to 3 yaml files, > > 'fsl,enetc.yaml', 'fsl,enetc-mdio.yaml', 'fsl,enetc-ierb.yaml'. > > > > Additional Changes: > > - Add pci<vendor id>,<production id> in compatible string. > > - Ref to common ethernet-controller.yaml and mdio.yaml. > > - Remove fixed-link part. > > > > Signed-off-by: Frank Li <Frank.Li@xxxxxxx> > > --- > > Change from v1 to v2 > > - renamee file as fsl,enetc-mdio.yaml, fsl,enetc-ierb.yaml, fsl,enetc.yaml > > - example include pcie node > > --- > > .../bindings/net/fsl,enetc-ierb.yaml | 35 ++++++ > > .../bindings/net/fsl,enetc-mdio.yaml | 53 ++++++++ > > .../devicetree/bindings/net/fsl,enetc.yaml | 50 ++++++++ > > .../devicetree/bindings/net/fsl-enetc.txt | 119 ------------------ > > 4 files changed, 138 insertions(+), 119 deletions(-) > > create mode 100644 Documentation/devicetree/bindings/net/fsl,enetc-ierb.yaml > > create mode 100644 Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml > > create mode 100644 Documentation/devicetree/bindings/net/fsl,enetc.yaml > > delete mode 100644 Documentation/devicetree/bindings/net/fsl-enetc.txt > > > > diff --git a/Documentation/devicetree/bindings/net/fsl,enetc-ierb.yaml b/Documentation/devicetree/bindings/net/fsl,enetc-ierb.yaml > > new file mode 100644 > > index 0000000000000..ce88d7ce07a5e > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/net/fsl,enetc-ierb.yaml > > @@ -0,0 +1,35 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/net/fsl,enetc-ierb.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Integrated Endpoint Register Block > > + > > +description: > > + The fsl_enetc driver can probe on the Integrated Endpoint Register > > + Block, which preconfigures the FIFO limits for the ENETC ports. > > Wrap at 80 chars > > > + > > +maintainers: > > + - Frank Li <Frank.Li@xxxxxxx> > > + > > +properties: > > + compatible: > > + enum: > > + - fsl,ls1028a-enetc-ierb > > + > > + reg: > > + maxItems: 1 > > + > > +required: > > + - compatible > > + - reg > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + ierb@1f0800000 { > > unit-address doesn't match > > > + compatible = "fsl,ls1028a-enetc-ierb"; > > + reg = <0xf0800000 0x10000>; > > + }; > > diff --git a/Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml b/Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml > > new file mode 100644 > > index 0000000000000..60740ea56cb08 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml > > @@ -0,0 +1,53 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/net/fsl,enetc-mdio.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: ENETC the central MDIO PCIe endpoint device > > + > > +description: > > + In this case, the mdio node should be defined as another PCIe > > + endpoint node, at the same level with the ENETC port nodes > > + > > +maintainers: > > + - Frank Li <Frank.Li@xxxxxxx>. > > stray '.' ^ > > > + > > +properties: > > + compatible: > > + items: > > + - enum: > > + - pci1957,ee01 > > + - const: fsl,enetc-mdio > > + > > + reg: > > + maxItems: 1 > > + > > +required: > > + - compatible > > + - reg > > + > > +allOf: > > + - $ref: mdio.yaml > > As a PCI device, also needs pci-device.yaml. After I add pci-devices.yaml, I get Documentation/devicetree/bindings/net/fsl,enetc.example.dtb: ethernet@0,0: False schema does not allow {'compatible': ['pci1957,e100', 'fsl,enetc'], 'reg': [[0, 0, 0, 0, 0]], 'phy-handle': [[4294967295]], 'phy-connection-type': ['sgmii'], '$nodename': ['ethernet@0,0']} It looks like match to two schemas, then report error. If I change enetc's compatible string to other random string. No error report. I am not sure how to fix this. I have not seen other schema use pci-device.yaml yet. Frank > > > + > > +unevaluatedProperties: false > > + > > +examples: > > + - | > > + pcie@1f0000000 { > > + compatible = "pci-host-ecam-generic"; > > + reg = <0x01 0xf0000000 0x0 0x100000>; > > Drop compatible and reg. Just need the minimum to define a PCI bus node. > > > + #address-cells = <3>; > > + #size-cells = <2>; > > + > > + mdio@0,3 { > > + compatible = "pci1957,ee01", "fsl,enetc-mdio"; > > + reg = <0x000300 0 0 0 0>; > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + ethernet-phy@2 { > > + reg = <0x2>; > > + }; > > + }; > > + }; > > diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml b/Documentation/devicetree/bindings/net/fsl,enetc.yaml > > new file mode 100644 > > index 0000000000000..843c27e357f2d > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml > > @@ -0,0 +1,50 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/net/fsl,enetc.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: ENETC ethernet > > + > > +description: > > + Depending on board design and ENETC port type (internal or > > + external) there are two supported link modes specified by > > + below device tree bindings. > > + > > +maintainers: > > + - Frank Li <Frank.Li@xxxxxxx> > > + > > +properties: > > + compatible: > > + items: > > + - enum: > > + - pci1957,e100 > > + - const: fsl,enetc > > + > > + reg: > > + maxItems: 1 > > + > > +required: > > + - compatible > > + - reg > > + > > +allOf: > > + - $ref: ethernet-controller.yaml > > As a PCI device, also needs pci-device.yaml. > > > + > > +unevaluatedProperties: false > > + > > +examples: > > + - | > > + pcie@1f0000000 { > > + compatible = "pci-host-ecam-generic"; > > + reg = <0x01 0xf0000000 0x0 0x100000>; > > + #address-cells = <3>; > > + #size-cells = <2>; > > + > > + ethernet@0,0 { > > + compatible = "pci1957,e100", "fsl,enetc"; > > + reg = <0x000000 0 0 0 0>; > > + phy-handle = <&sgmii_phy0>; > > + phy-connection-type = "sgmii"; > > + }; > > + };