* Re: Phandles [not found] ` <D22046DB-95B3-431E-8E80-0BA806811D01@hotmail.com> @ 2026-04-12 15:40 ` Herve Codina 2026-04-12 16:37 ` Phandles Kyle Bonnici 0 siblings, 1 reply; 2+ messages in thread From: Herve Codina @ 2026-04-12 15:40 UTC (permalink / raw) To: Kyle Bonnici Cc: devicetree-compiler@vger.kernel.org, Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree Hi Kyle, +Cc Kernel device-tree maintainers On Sun, 12 Apr 2026 13:51:35 +0000 Kyle Bonnici <kylebonnici@hotmail.com> wrote: > > On 12 Apr 2026, at 14:51, Herve Codina <herve.codina@bootlin.com> wrote: > > > > Hi Kyle, > > > > On Sat, 11 Apr 2026 18:33:33 +0000 > > Kyle Bonnici <kylebonnici@hotmail.com> wrote: > > > >> Hi > >> > >> I have been looking at the the code for the compiler and I am wondering which specifications marks the below properties MUST BE Nexus Properties hence the validation. > >> > >> WARNING_PROPERTY_PHANDLE_CELLS(clocks, "clocks", "#clock-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(cooling_device, "cooling-device", "#cooling-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(dmas, "dmas", "#dma-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(hwlocks, "hwlocks", "#hwlock-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(interrupts_extended, "interrupts-extended", "#interrupt-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(io_channels, "io-channels", "#io-channel-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(iommus, "iommus", "#iommu-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(mboxes, "mboxes", "#mbox-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(msi_parent, "msi-parent", "#msi-cells", true); > >> WARNING_PROPERTY_PHANDLE_CELLS(mux_controls, "mux-controls", "#mux-control-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(phys, "phys", "#phy-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(power_domains, "power-domains", "#power-domain-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(pwms, "pwms", "#pwm-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(resets, "resets", "#reset-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(sound_dai, "sound-dai", "#sound-dai-cells"); > >> WARNING_PROPERTY_PHANDLE_CELLS(thermal_sensors, "thermal-sensors", "#thermal-sensor-cells"); > > > > All of those properties are defined as phandles. > > > > For instance, the 'pwms' property available in a node means the the node is > > a pwm consumer. It must follow the pwm consumer binding [1] and so a phandle > > is involved. > > > > This phandle can have arguments and the number of argument is defined by the > > #pwm-cells property set in the pwm provider node [2], [3]. > > > > [1] https://elixir.bootlin.com/zephyr/v4.4.0-rc3/source/dts/bindings/pwm/pwm-controller.yaml > > [2] https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/bindings/pwm/pwm-controller.yaml > > [3] https://elixir.bootlin.com/linux/v7.0-rc7/source/Documentation/devicetree/bindings/pwm/pwm.yaml > > > >> > >> > >> These can be found here: https://github.com/dgibson/dtc/blob/main/checks.c#L1498 this is relevant for https://github.com/zephyrproject-rtos/zephyr/issues/107066 > > > > Examples provided in the zephyrproject issue link are, in my opinion, incorrect. > > > > Case 1: > > / { > > node1 { > > pwms = <1 &pwm0 1 20 PWM_POLARITY_NORMAL>; > > > > Here the first cell '1' is not a phandle. > > Here the compiler is making an assumption here that all `pwms` properties must be specifier properties and all use `pwm` specifier. I think the purpose of 'select: true' is to have the binding always applied: https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/pwm/pwm-consumer.yaml#L15 If this is confirmed, DTC performs correct checks as this binding must always be applied and so the 'pwms' property must be a phandle-array property. Device-tree maintainers, can you confirm the purpose of 'select: true' set in a DT binding ? Best regards, Hervé ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Phandles 2026-04-12 15:40 ` Phandles Herve Codina @ 2026-04-12 16:37 ` Kyle Bonnici 0 siblings, 0 replies; 2+ messages in thread From: Kyle Bonnici @ 2026-04-12 16:37 UTC (permalink / raw) To: Herve Codina Cc: devicetree-compiler@vger.kernel.org, Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree@vger.kernel.org > On 12 Apr 2026, at 17:40, Herve Codina <herve.codina@bootlin.com> wrote: > > Hi Kyle, > > +Cc Kernel device-tree maintainers > > On Sun, 12 Apr 2026 13:51:35 +0000 > Kyle Bonnici <kylebonnici@hotmail.com> wrote: > >>> On 12 Apr 2026, at 14:51, Herve Codina <herve.codina@bootlin.com> wrote: >>> >>> Hi Kyle, >>> >>> On Sat, 11 Apr 2026 18:33:33 +0000 >>> Kyle Bonnici <kylebonnici@hotmail.com> wrote: >>> >>>> Hi >>>> >>>> I have been looking at the the code for the compiler and I am wondering which specifications marks the below properties MUST BE Nexus Properties hence the validation. >>>> >>>> WARNING_PROPERTY_PHANDLE_CELLS(clocks, "clocks", "#clock-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(cooling_device, "cooling-device", "#cooling-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(dmas, "dmas", "#dma-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(hwlocks, "hwlocks", "#hwlock-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(interrupts_extended, "interrupts-extended", "#interrupt-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(io_channels, "io-channels", "#io-channel-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(iommus, "iommus", "#iommu-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(mboxes, "mboxes", "#mbox-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(msi_parent, "msi-parent", "#msi-cells", true); >>>> WARNING_PROPERTY_PHANDLE_CELLS(mux_controls, "mux-controls", "#mux-control-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(phys, "phys", "#phy-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(power_domains, "power-domains", "#power-domain-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(pwms, "pwms", "#pwm-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(resets, "resets", "#reset-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(sound_dai, "sound-dai", "#sound-dai-cells"); >>>> WARNING_PROPERTY_PHANDLE_CELLS(thermal_sensors, "thermal-sensors", "#thermal-sensor-cells"); >>> >>> All of those properties are defined as phandles. >>> >>> For instance, the 'pwms' property available in a node means the the node is >>> a pwm consumer. It must follow the pwm consumer binding [1] and so a phandle >>> is involved. >>> >>> This phandle can have arguments and the number of argument is defined by the >>> #pwm-cells property set in the pwm provider node [2], [3]. >>> >>> [1] https://elixir.bootlin.com/zephyr/v4.4.0-rc3/source/dts/bindings/pwm/pwm-controller.yaml >>> [2] https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/bindings/pwm/pwm-controller.yaml >>> [3] https://elixir.bootlin.com/linux/v7.0-rc7/source/Documentation/devicetree/bindings/pwm/pwm.yaml >>> >>>> >>>> >>>> These can be found here: https://github.com/dgibson/dtc/blob/main/checks.c#L1498 this is relevant for https://github.com/zephyrproject-rtos/zephyr/issues/107066 >>> >>> Examples provided in the zephyrproject issue link are, in my opinion, incorrect. >>> >>> Case 1: >>> / { >>> node1 { >>> pwms = <1 &pwm0 1 20 PWM_POLARITY_NORMAL>; >>> >>> Here the first cell '1' is not a phandle. >> >> Here the compiler is making an assumption here that all `pwms` properties must be specifier properties and all use `pwm` specifier. > > I think the purpose of 'select: true' is to have the binding always applied: > https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/pwm/pwm-consumer.yaml#L15 > I’m having trouble finding where the Devicetree Specification (v0.4) mandates that all binding systems must extend dt-schema. Since this requirement isn't explicitly in the spec, it follows that the WARNING_PROPERTY_PHANDLE_CELLS validation belongs in dt-validate rather than within dtc itself. > If this is confirmed, DTC performs correct checks as this binding must always > be applied and so the 'pwms' property must be a phandle-array property. > > Device-tree maintainers, can you confirm the purpose of 'select: true' set > in a DT binding ? > > Best regards, > Hervé ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-12 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <BB363BC4-B813-4D03-8737-587DF7425908@hotmail.com>
[not found] ` <20260412145144.4737fde6@bootlin.com>
[not found] ` <D22046DB-95B3-431E-8E80-0BA806811D01@hotmail.com>
2026-04-12 15:40 ` Phandles Herve Codina
2026-04-12 16:37 ` Phandles Kyle Bonnici
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox