Re: Phandles
Rob Herring <[email protected]> Tue, 14 Apr 2026 10:24:23 -0500
| Newsgroups | org.kernel.vger.devicetree-compiler,org.kernel.vger.linux-devicetree |
|---|---|
| Message-ID | <CAL_JsqL2bRmX6qeapqqZZx=V7ARA_XbenrTqNk4ru2AAR24VZg@mail.gmail.com> |
On Mon, Apr 13, 2026 at 4:50=E2=80=AFAM Kyle Bonnici <[email protected]= om> wrote: > > > > You cannot have random values. I quoted the DT spec. > > Where in the DTS 0.4 spec are property names such as pwms, clocks > etc=E2=80=A6 mandated to be of format <phandle cell =E2=80=A6>? I would not read too much into what is defined in the spec vs. what is defined in dtschema. It's a conscious decision that all these properties are not in the spec. The goal is the whole spec or at least any parts defining properties is just schemas and the spec is generated from the schemas. That's the only way new properties will get added to the spec (with a few exceptions). However, no one is working on generating the spec from schemas. > > Well, we don't use discord but IRC... but that github issue also uses > > "pwms =3D <1 &pwm0 1 20 PWM_POLARITY_NORMAL>;" > > > > So again - what is "1"? > > > > I am asking because if you use incorrect value as phandle value, then > > DTC warning is obviously expected and nothing to fix here. > > The warning is only valid if =E2=80=981=E2=80=99 is expected to be a pha= ndle which is what I am > Arguing the spec does not mandate this. > > > You asked why phandle has to be the first entry in phandle-value type? = I > > responded that DT spec makes it. > > Which section in DTS 0.4 spec? Doesn't matter. How would you ever parse the properties if that's not the case. You have to have the phandle first to get the number of arg cells to find the next phandle. I suppose you could define some other convention, but it would have to be pretty much global like this convention is. And this convention dates back to the GPIO binding which dates back to at least 2005 if not the 1990s. And most of these properties you list date back to well before Zephyr existed. The spec, dtc and the dts format will let you do something like this: foo =3D <0x12345678>, "bar", /bits/ 16 <0xabcd>; You would have to be out of your mind to do something like that when the format has zero type information. Every warning in dtc can be disabled. So if they are a problem, turn them o= ff. Rob