Skip to content

dt-bindings: phy: ti,cd2e22: give apple,tunable the type its other users have - #1896

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
base/dt-bindings-tunable-type-cleanup
Nov 14, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
base/dt-bindings-tunable-type-cleanup

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

apple,tunable is defined with two different integer types: uint32-matrix in iommu/apple,dart.yaml and
pci/apple,pcie.yaml, and uint8-array in phy/ti,cd2e22.yaml. dtschema keeps one integer type per property
name for the whole tree. With this clash dt-mk-schema prints "apple,tunable: multiple incompatible types", and
dt-validate crashes on the first apple,tunable it has to decode in a DTB (KeyError: 'uint8-array' in
prop_value()). No schema is applied to that DTB, and because kbuild does not fail the target,
make CHECK_DTBS=y returns 0 and prints no warnings. So dtbs_check has been validating nothing for every Apple
DTB that has a DART or a PCIe port with apple,tunable in its source. The binding's own example crashes
dt-validate in dt_binding_check the same way.

This describes the repeater's property as a uint32-matrix as well. Its content is a whole number of four-byte
(register, mask, value, reserved) entries, so each entry is one big-endian cell and the flattened property is
byte-for-byte unchanged. The bootloader that fills it and the driver (which reads it with
device_property_read_u8_array()) need no change, and no in-tree DT sets the property. The example is written as
a cell to match. The minItems/maxItems byte counts go away with the old type: dtschema merges the dimensions
of all matrix definitions of one name, so counts here would change how the three-cell DART and PCIe rows are
split. The driver already rejects an empty list, a length that is not a multiple of four, and a nonzero reserved
byte.

Tested with dtschema 2026.9 (make dt_binding_check / make CHECK_DTBS=y <dtb>, ARCH=arm64, LLVM=1):

check before (d89d8c0) after
dt_binding_check of ti,cd2e22, apple,dart, apple,pcie, apple,agx 3 "multiple incompatible types" lines and a dt-validate traceback on the ti,cd2e22 example no output
dtbs_check apple/t6050-j714s.dtb dt-validate traceback, nothing validated runs to the end, 14 warnings
dtbs_check apple/t6020-j414s.dtb dt-validate traceback, nothing validated runs to the end, 69 warnings
dtbs_check apple/t8112-j413.dtb (no apple,tunable in its source) 30 warnings the same 30 warnings
dtbs_check apple/t8140-j700.dtb (has the ti,cd2e22 node) 0 warnings 0 warnings

The warnings that now show up are existing ones in other bindings and DTs; this PR does not fix them. A J700 DTB
with a four-entry apple,tunable added to the repeater node in byte syntax also validates without a warning.

🤖 Generated with Claude Code

…ers have

apple,tunable is a uint32-matrix in iommu/apple,dart.yaml and in
pci/apple,pcie.yaml, and a uint8-array here. dtschema keeps one integer
type per property name for the whole tree, so dt-mk-schema reports
"apple,tunable: multiple incompatible types", and dt-validate then fails
to decode the first apple,tunable it meets in a DTB: it looks up
'uint8-array' in its table of scalar formats and dies with

  KeyError: 'uint8-array'

in prop_value(). No schema is applied to that DTB, and since kbuild does
not fail the target on it, "make CHECK_DTBS=y" returns 0 with no
warnings. Every Apple DTB that carries a DART or a PCIe port with
apple,tunable is affected, so dtbs_check has been validating none of
them.

Describe the repeater's property as a uint32-matrix too. Its content is
a whole number of four-byte (register, mask, value, reserved) entries,
so each entry is one big-endian cell and the flattened property is
byte-for-byte what it was: the bootloader that fills it and the driver,
which reads it with device_property_read_u8_array(), need no change, and
no in-tree DT sets the property. Write the example as a cell to match.

The item counts go away with the old type. dtschema merges the
dimensions of all matrix definitions of one property name, so counts
given here would change how the three-cell rows of the DART and PCIe
tunables are split. The driver already rejects an empty list, a length
that is not a multiple of four and a nonzero reserved byte.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

The dt-checks failure here is not caused by this change. Checked two ways:

  1. None of the 1084 "new" lines in the job log refers to ti,cd2e22.yaml, to the compatible ti,cd2e22, to
    the one node that uses it (phy@21 in t8140-j700), or to apple,tunable. The single "removed" line is
    KeyError: 'uint8-array', the end of the dt-validate traceback this PR fixes.

  2. CHECK_DTBS=y over all 137 Apple DTBs with the method of scripts/dtc/apple-dt-check.sh, dtschema 2026.9:

    tree warning lines dt-validate tracebacks
    base d89d8c0 399 30 (one per DTB that has apple,tunable)
    base with only the uint8-array type lines dropped from ti,cd2e22.yaml (scratch, to stop the crash) 1482 0
    this PR 0fb75b0 1482 0

    The second and third sets are identical line for line (0 lines differ). A second scratch variant, the base
    with ti,cd2e22.yaml removed entirely, gives the same 1482 lines plus 2 lines on phy@21 of t8140-j700
    that come from the missing binding. The base and head sets from this run are also identical to the job's
    own base.warn and head.warn (399 and 1482 lines).

The 30 DTBs that crash on the base are exactly the 30 DTBs carrying the 1084 lines, and the 137 compiled DTBs
are byte-identical on base and head. So the 1084 lines are existing warnings that the base could not print,
and this PR adds none. The job compares against a base whose validation crashes, so it cannot pass for this
change.

Merging over the red dt-checks on this evidence; the new baseline for integration/aurora is 1482 warning lines with no validator crash.

@DjDeveloperr
DjDeveloperr merged commit 0a02a04 into integration/aurora Nov 14, 2026
1 of 2 checks passed
@RyanTheTide
RyanTheTide deleted the base/dt-bindings-tunable-type-cleanup branch November 16, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant