[net-next,1/4] dt-bindings: net: phy: Add Allwinner AC300 EPHY binding

Message ID 20260916044119.475666-2-alastair@d-silva.org (mailing list archive)
State New
Headers
Series net: Add Allwinner H616/H618 EMAC1 and AC300 EPHY support |

Commit Message

Alastair D'Silva Sept. 16, 2026, 4:41 a.m. UTC
Add device tree binding documentation for the Allwinner AC300
Fast Ethernet Physical Layer (EPHY) co-packaged on Allwinner
H616 and H618 SoCs.

Assisted-by: LLM
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---

Notes:
    Tested on Mellow Fly-C5 (Allwinner H618) under Armbian with Linux 6.18 and
    7.x kernels, verifying schema validation with dt_binding_check.

 .../net/allwinner,sun50i-h618-ac300-ephy.yaml | 79 +++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml
  

Comments

Andrew Lunn Sept. 16, 2026, 2:49 p.m. UTC | #1
> +properties:
> +  compatible:
> +    items:
> +      - const: ethernet-phy-id0044.1400
> +      - const: allwinner,sun50i-h618-ac300-ephy

PHYs don't have compatibles which are vendor strings, only IDs or
c22/c45. PHYs get probed by ID, not these strings.

    Andrew

---
pw-bot: cr
  
Rob Herring (Arm) Sept. 16, 2026, 3:22 p.m. UTC | #2
On Wed, 16 Sep 2026 14:41:16 +1000, Alastair D'Silva wrote:
> Add device tree binding documentation for the Allwinner AC300
> Fast Ethernet Physical Layer (EPHY) co-packaged on Allwinner
> H616 and H618 SoCs.
> 
> Assisted-by: LLM
> Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
> ---
> 
> Notes:
>     Tested on Mellow Fly-C5 (Allwinner H618) under Armbian with Linux 6.18 and
>     7.x kernels, verifying schema validation with dt_binding_check.
> 
>  .../net/allwinner,sun50i-h618-ac300-ephy.yaml | 79 +++++++++++++++++++
>  1 file changed, 79 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.example.dtb: ethernet-phy@0 (ethernet-phy-id0044.1400): compatible: 'oneOf' conditional failed, one must be fixed:
	['ethernet-phy-id0044.1400', 'allwinner,sun50i-h618-ac300-ephy', 'ethernet-phy-ieee802.3-c22'] is too long
	'ethernet-phy-ieee802.3-c22' was expected
	'ethernet-phy-ieee802.3-c45' was expected
	from schema $id: http://devicetree.org/schemas/net/allwinner,sun50i-h618-ac300-ephy.yaml
Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.example.dtb: ethernet-phy@0 (ethernet-phy-id0044.1400): compatible: 'oneOf' conditional failed, one must be fixed:
	['ethernet-phy-id0044.1400', 'allwinner,sun50i-h618-ac300-ephy', 'ethernet-phy-ieee802.3-c22'] is too long
	'ethernet-phy-ieee802.3-c22' was expected
	'ethernet-phy-ieee802.3-c45' was expected
	from schema $id: http://devicetree.org/schemas/net/ethernet-phy.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/20260916044119.475666-2-alastair@d-silva.org

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.
  
sashiko-bot@kernel.org Sept. 17, 2026, 4:42 a.m. UTC | #3
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] dt-bindings: net: phy: conflicting duplicate schema for AC300 EPHY
- [Low] dt-bindings: net: phy: schema validation failure on 3-item compatible
--

commit 78619c40b1c730a8fe995945c43fe97d336ddfb6
Author: Alastair D'Silva <alastair@d-silva.org>

dt-bindings: net: phy: Add Allwinner AC300 EPHY binding

Add device tree binding documentation for the Allwinner AC300
Fast Ethernet Physical Layer (EPHY) co-packaged on Allwinner
H616 and H618 SoCs.

> diff --git a/Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml b/Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml
> new file mode 100644
> index 0000000000000..a04416e781382
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml
> @@ -0,0 +1,79 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/allwinner,sun50i-h618-ac300-ephy.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Allwinner AC300 Ethernet PHY

[Severity: Medium]
Will this binding conflict with the existing x-powers,acx00-ephy-package.yaml?

The AC300 hardware appears to already be modeled by the ethernet-phy-package
architecture, which represents its split-address control architecture (where
control registers sit at base + 16). 

Introducing a standalone flattened binding seems to attach package-level
properties directly to the link PHY, potentially fragmenting the device tree
ABI. This could force drivers to hardcode a + 16 MDIO offset instead of
relying on the standard package architecture.

> +
> +maintainers:
> +  - Alastair D'Silva <alastair@d-silva.org>

[ ... ]

> +properties:
> +  compatible:
> +    items:
> +      - const: ethernet-phy-id0044.1400
> +      - const: allwinner,sun50i-h618-ac300-ephy
> +      - const: ethernet-phy-ieee802.3-c22

[Severity: Low]
Will this compatible string array fail dt_binding_check validation?

The included core ethernet-phy.yaml enforces a oneOf constraint that restricts
compatible arrays to a maximum of two elements (such as PHY ID and IEEE
clause). This block defines a 3-element array, which appears structurally
invalid under the included constraints.

> +
> +  reg:
> +    maxItems: 1

[ ... ]

> +examples:
> +  - |
> +    mdio {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        ethernet-phy@0 {
> +            compatible = "ethernet-phy-id0044.1400",
> +                         "allwinner,sun50i-h618-ac300-ephy",
> +                         "ethernet-phy-ieee802.3-c22";

[Severity: Low]
Will this example node fail validation?

This example demonstrates the 3-item list, which will violate the two-element
restriction inherited from the base ethernet-phy.yaml schema.

> +            reg = <0>;
> +            clocks = <&ccu 81>, <&ac300_pwm_clk>;
> +            clock-names = "ephy", "pwm";
> +            nvmem-cells = <&ephy_calibration>;
> +            nvmem-cell-names = "calibration";
> +        };
> +    };
  

Patch

diff --git a/Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml b/Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml
new file mode 100644
index 000000000000..a04416e78138
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/allwinner,sun50i-h618-ac300-ephy.yaml
@@ -0,0 +1,79 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/allwinner,sun50i-h618-ac300-ephy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner AC300 Ethernet PHY
+
+maintainers:
+  - Alastair D'Silva <alastair@d-silva.org>
+
+description:
+  The AC300 is an integrated Fast Ethernet Physical Layer (EPHY) co-packaged
+  with Allwinner H616 and H618 SoCs, communicated with over MDIO.
+
+allOf:
+  - $ref: ethernet-phy.yaml#
+
+select:
+  properties:
+    compatible:
+      contains:
+        const: allwinner,sun50i-h618-ac300-ephy
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - const: ethernet-phy-id0044.1400
+      - const: allwinner,sun50i-h618-ac300-ephy
+      - const: ethernet-phy-ieee802.3-c22
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    items:
+      - description: 25MHz reference clock from CCU
+      - description: 2MHz reference clock from PWM
+
+  clock-names:
+    minItems: 1
+    items:
+      - const: ephy
+      - const: pwm
+
+  nvmem-cells:
+    items:
+      - description: Calibration data from SID
+
+  nvmem-cell-names:
+    items:
+      - const: calibration
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    mdio {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ethernet-phy@0 {
+            compatible = "ethernet-phy-id0044.1400",
+                         "allwinner,sun50i-h618-ac300-ephy",
+                         "ethernet-phy-ieee802.3-c22";
+            reg = <0>;
+            clocks = <&ccu 81>, <&ac300_pwm_clk>;
+            clock-names = "ephy", "pwm";
+            nvmem-cells = <&ephy_calibration>;
+            nvmem-cell-names = "calibration";
+        };
+    };