Skip to contentSkip to conversation

Are dt-bindings headers part of the device tree spec?

DISCUSSION Sean Anderson 3 participants 3 messages Dec 15, 2021 – Dec 17, 2021

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm reviewing a clock driver [1], and the submitter has deviated from the defines used by Linux. For example, where Linux might have

	#define CLOCK_FOOBAR 5

his driver might have

	#define CLK_FUBAR 6

Which means that both the device tree source and the resulting device tree binary will be different.

As I understand it, we try to be compatible with Linux on these things. However, it is unclear to me if include/dt-bindings is also part of this, or just the things in Documentation/devicetree/bindings. And if it is, do we need to have compatible sources, compatible binaries, or both? In general, I think we should try to have the same headers as well, but is it permitted to allow deviations with reasonable justification?

--Sean

[1] https://lore.kernel.org/u-boot/de6e75a083647dfeec3058dd4dcc0419b08e155c.1637285375.git.weijie.gao@mediatek.com/

#1 lore raw
Quoted 22 lines · Sean Anderson

Hi all,

I'm reviewing a clock driver [1], and the submitter has deviated from the defines used by Linux. For example, where Linux might have

	#define CLOCK_FOOBAR 5

his driver might have

	#define CLK_FUBAR 6

Which means that both the device tree source and the resulting device tree binary will be different.

As I understand it, we try to be compatible with Linux on these things. However, it is unclear to me if include/dt-bindings is also part of this, or just the things in Documentation/devicetree/bindings. And if it is, do we need to have compatible sources, compatible binaries, or both? In general, I think we should try to have the same headers as well, but is it permitted to allow deviations with reasonable justification?

Quoted 3 lines

--Sean

[1] https://lore.kernel.org/u-boot/de6e75a083647dfeec3058dd4dcc0419b08e155c.1637285375.git.weijie.gao@mediatek.com/

Adding a few more people to the thread.

Signature · 1 line
Tom
#2 lore raw
In reply to Sean Anderson

Hi Sean,

Quoted 16 lines · Sean Anderson

Hi all,

I'm reviewing a clock driver [1], and the submitter has deviated from the defines used by Linux. For example, where Linux might have

        #define CLOCK_FOOBAR 5

his driver might have

        #define CLK_FUBAR 6

Which means that both the device tree source and the resulting device tree binary will be different.

Quoted 6 lines

As I understand it, we try to be compatible with Linux on these things. However, it is unclear to me if include/dt-bindings is also part of this, or just the things in Documentation/devicetree/bindings. And if it is, do we need to have compatible sources, compatible binaries, or both? In general, I think we should try to have the same headers as well, but is it permitted to allow deviations with reasonable justification?

I think they should be the same, including the name and value. It gets too confusing otherwise.

If there are conversions needed for U-Boot, perhaps they could be handled by some #defines in the driver or another file in U-Boot.

Regards,
Simon

Quoted 4 lines

--Sean

[1] https://lore.kernel.org/u-boot/de6e75a083647dfeec3058dd4dcc0419b08e155c.1637285375.git.weijie.gao@mediatek.com/