From f9468dd74a5a765db44b86eefa49c453f87a330c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Bal=C3=A1zsy?= Date: Fri, 23 Oct 2026 22:03:08 +0200 Subject: [PATCH 1/2] dt-bindings: phy: apple,t6040-atcphy: Name the tunables explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The T6040 PHY tunables are described by a single patternProperty of type uint32-matrix. dtschema resolves the type of a property by its exact name first and only falls back to the patternProperties of all bindings when no binding names it. apple,pmp.yaml has the catch-all pattern '^apple,tunable-' of type uint8-array, so every tunable that is only matched by a pattern gets two types, and dt-validate (dtschema 2026.9) aborts while decoding the first such property it finds: Could not decode node phy@382a90000 property apple,tunable-common-cfg ... File ".../dtschema/dtb.py", line 185, in prop_value if len(p) / type_format[fmt].size >= min_dim: KeyError: 'uint8-array' apple,tunable-axi2af and apple,tunable-fabric were not affected only because apple,atcphy.yaml and apple,pcie.yaml already name them. List the tunables as properties sharing one definition, as apple,atcphy.yaml does, so that each has the single type uint32-matrix. Fixes: ca86efe0815a ("dt-bindings: phy: Add the Apple T6040 Type-C PHY") Signed-off-by: František Balázsy --- .../bindings/phy/apple,t6040-atcphy.yaml | 70 +++++++++++++++---- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/apple,t6040-atcphy.yaml b/Documentation/devicetree/bindings/phy/apple,t6040-atcphy.yaml index d982780c31f18..ce11949c34455 100644 --- a/Documentation/devicetree/bindings/phy/apple,t6040-atcphy.yaml +++ b/Documentation/devicetree/bindings/phy/apple,t6040-atcphy.yaml @@ -16,6 +16,20 @@ description: > line of the attached DWC3 controller and acts as the Type-C orientation switch. +$defs: + apple,tunable: + $ref: /schemas/types.yaml#/definitions/uint32-matrix + minItems: 1 + maxItems: 512 + items: + items: + - description: Register offset + - description: Mask to be applied to the register value + - description: Bits to be set after applying the mask + description: > + Calibration table from the device's Apple device tree, applied at every + USB3 power-on. + properties: compatible: const: apple,t6040-atcphy @@ -71,19 +85,49 @@ properties: $ref: /schemas/graph.yaml#/properties/port description: Link to the SuperSpeed lanes of the Type-C connector. -patternProperties: - "^apple,tunable-(axi2af|axi2af-lioa|fabric|common-cfg|lane0|lane1|aus40cmn-shm|auspll|cio4pll|pipehandler|usb2-host)$": - $ref: /schemas/types.yaml#/definitions/uint32-matrix - minItems: 1 - maxItems: 512 - items: - items: - - description: Register offset - - description: Mask to be applied to the register value - - description: Bits to be set after applying the mask - description: > - Calibration tables from the device's Apple device tree, applied at - every USB3 power-on to the region the name refers to. + apple,tunable-axi2af: + $ref: "#/$defs/apple,tunable" + description: Tunables applied to the axi2af region. + + apple,tunable-fabric: + $ref: "#/$defs/apple,tunable" + description: Tunables applied to the fabric region. + + apple,tunable-common-cfg: + $ref: "#/$defs/apple,tunable" + description: Tunables applied to the common-cfg region. + + apple,tunable-axi2af-lioa: + $ref: "#/$defs/apple,tunable" + description: Tunables applied to the axi2af-lioa region. + + apple,tunable-lane0: + $ref: "#/$defs/apple,tunable" + description: Lane 0 tunables, applied to the core region. + + apple,tunable-lane1: + $ref: "#/$defs/apple,tunable" + description: Lane 1 tunables, applied to the core region. + + apple,tunable-aus40cmn-shm: + $ref: "#/$defs/apple,tunable" + description: AUS40CMN_SHM tunables, applied to the core region. + + apple,tunable-auspll: + $ref: "#/$defs/apple,tunable" + description: AUSPLL tunables, applied to the core region. + + apple,tunable-cio4pll: + $ref: "#/$defs/apple,tunable" + description: CIO4PLL tunables, applied to the core region. + + apple,tunable-pipehandler: + $ref: "#/$defs/apple,tunable" + description: Tunables applied to the pipehandler region. + + apple,tunable-usb2-host: + $ref: "#/$defs/apple,tunable" + description: USB2 host tunables, applied to the bank0 region. required: - compatible From 0948c36fec12f0072930ecd13efdb63b6a45336d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Bal=C3=A1zsy?= Date: Fri, 23 Oct 2026 22:03:08 +0200 Subject: [PATCH 2/2] dt-bindings: usb: apple,dwc3: Name the T6040 tunables explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The T6040 controller tunables are described by a single patternProperty of type uint32-matrix. As the catch-all pattern '^apple,tunable-' of apple,pmp.yaml has the type uint8-array and dtschema only consults patterns for names no binding lists, these properties get two types and dt-validate (dtschema 2026.9) aborts while decoding them: Could not decode node usb@382280000 property apple,tunable-gbl-default KeyError: 'uint8-array' List the tunables as properties sharing one definition so that each has the single type uint32-matrix. Fixes: 4c3fb4f33f31 ("dt-bindings: usb: apple,dwc3: Add T6040") Signed-off-by: František Balázsy --- .../devicetree/bindings/usb/apple,dwc3.yaml | 46 +++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/apple,dwc3.yaml b/Documentation/devicetree/bindings/usb/apple,dwc3.yaml index 14061aa102b53..74ef99bccf870 100644 --- a/Documentation/devicetree/bindings/usb/apple,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/apple,dwc3.yaml @@ -25,6 +25,20 @@ allOf: required: - power-domains +$defs: + apple,tunable: + $ref: /schemas/types.yaml#/definitions/uint32-matrix + minItems: 1 + maxItems: 512 + items: + items: + - description: Register offset + - description: Mask to be applied to the register value + - description: Bits to be set after applying the mask + description: > + Controller table from the device's Apple device tree, applied after + every core reset (T6040). + properties: compatible: oneOf: @@ -66,19 +80,25 @@ properties: power-domains: maxItems: 1 -patternProperties: - "^apple,tunable-(gbl-default|gbl-host|dbg|cfg-host|link)$": - $ref: /schemas/types.yaml#/definitions/uint32-matrix - minItems: 1 - maxItems: 512 - items: - items: - - description: Register offset - - description: Mask to be applied to the register value - - description: Bits to be set after applying the mask - description: > - Controller tables from the device's Apple device tree, applied after - every core reset (T6040). + apple,tunable-gbl-default: + $ref: "#/$defs/apple,tunable" + description: Tunables applied to the DWC3 global registers. + + apple,tunable-gbl-host: + $ref: "#/$defs/apple,tunable" + description: Host mode tunables applied to the DWC3 global registers. + + apple,tunable-dbg: + $ref: "#/$defs/apple,tunable" + description: Tunables applied to the debug registers of the Apple region. + + apple,tunable-cfg-host: + $ref: "#/$defs/apple,tunable" + description: Host mode tunables applied to the drd-cfg region. + + apple,tunable-link: + $ref: "#/$defs/apple,tunable" + description: Tunables applied to the link registers of the Apple region. required: - compatible