Skip to content

RFC ARM: use C pre-processor with dtc

Tony Lindgren linux-arm-kernel linux-devicetree 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] ARM: use C pre-processor with dtc
Quoted 14 lines · Stephen Warren
Quoted 5 lines · Scott Wood

Do you have an example of where you'd actually benefit from this? I'd think most things could either be done reasonably well with what's built into DTC (see what we've done in arch/powerpc/boot/dts/fsl), or would need math expression support in DTC (or has that been added?).

Yes, support for basic integer math in cell values has indeed been recently added to upstream dtc. I don't believe this has been ported into the in-kernel dtc yet though.

The primary motivation here is probably naming constants and associated readability. For example, instead of:

Quoted 7 lines

nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */

You could write:

nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO_PV1 0>;

No more opaque numbers!

This would be nice indeed.

Regards,

Tony