Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: timer: Use non-empty ranges in example

On many arm64 qcom device trees, running `make dtbs_check` yells:

timer@17c20000: #size-cells:0:0: 1 was expected

It appears that someone was trying to assert the fact that sub-nodes
describing frames would never have a size that's more than 32-bits
big. That does indeed appear to be true for all cases I could find.

Currently many arm64 qcom device tree files have a #address-cells and
about in commit bede7d2dc8f3 ("arm64: dts: qcom: sdm845: Increase
address and size cells for soc"). That means the only way we can
shrink them down is to use a non-empty ranges.

Since forever it has said in "writing-bindings.txt" to "DO use
non-empty 'ranges' to limit the size of child buses/devices". I guess
we should start listening to it.

I believe (but am not certain) that this also means that we should use
"ranges" to simplify the "reg" of our sub devices by specifying an
offset. Let's update the example in the bindings to make this
obvious.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Douglas Anderson and committed by
Rob Herring
c5c689d3 d8cacecf

+6 -6
+6 -6
Documentation/devicetree/bindings/timer/arm,arch_timer_mmio.yaml
··· 99 99 compatible = "arm,armv7-timer-mem"; 100 100 #address-cells = <1>; 101 101 #size-cells = <1>; 102 - ranges; 102 + ranges = <0 0xf0001000 0x1000>; 103 103 reg = <0xf0000000 0x1000>; 104 104 clock-frequency = <50000000>; 105 105 106 - frame@f0001000 { 106 + frame@0 { 107 107 frame-number = <0>; 108 108 interrupts = <0 13 0x8>, 109 109 <0 14 0x8>; 110 - reg = <0xf0001000 0x1000>, 111 - <0xf0002000 0x1000>; 110 + reg = <0x0000 0x1000>, 111 + <0x1000 0x1000>; 112 112 }; 113 113 114 - frame@f0003000 { 114 + frame@2000 { 115 115 frame-number = <1>; 116 116 interrupts = <0 15 0x8>; 117 - reg = <0xf0003000 0x1000>; 117 + reg = <0x2000 0x1000>; 118 118 }; 119 119 }; 120 120