[PATCH 0/8] kernel: mtdsplit_uimage: use device tree properties for non-standard uimage parsing

Bjørn Mork bjorn at mork.no
Thu Nov 26 08:48:55 EST 2020


"Adrian Schmutzler" <mail at adrianschmutzler.de> writes:

> However, I wonder whether - strictly - these parameter belong into
> device tree, i.e. "describe the hardware".  (this is meant as an open
> question, I do not want to express any rejection with that)

FWIW, I believe it does in the same way the existing compatible
properties do. They are a description of the expected image format on
that partition. And the knowledge of this format is shared with the boot
loader.

> And probably we would need to involve upstream (devicetree-spec) for
> the naming of the properties?  Or is this irrelevant as
> mtdsplit_uimage is just "our stuff" anyway?

My impression is that mtdsplit_uimage is not intended to go upstream.
But I could be wrong there?

Anyway, I believe it's a good idea in any case to stick to upstream
guidelines if possible.  Reading
https://www.kernel.org/doc/html/latest/devicetree/bindings/writing-bindings.html
I see that I have made a few grave errors...

The properties are "device specific", if we consider that a "device" in
this context is the "uimage" partition. The properties will not be
shared with any other partition "devices".  This means that the
properties should have a vendor prefix.

It is probably not a good idea to mess with the "denx" namespace, so I
am tempted to make this "openwrt,ih-magic" etc, and use a separate
compatible string for that. E.g "openwrt,uimage".  So you would have
something like

   partition at 300000 {
       label = "firmware";
       compatible = "openwrt,uimage", "denx,uimage";
       openwrt,ih-magic = <0x4e474520>;
       reg = <0x00300000 0xe80000>;
   };

Without defining a separate parser for that,  Just a second compatible
string for the match table.  Possibly with a of_device_is_compatible()
test to ignore the openwrt properties for pure "denx,uimage" partitions.

But then I found this discussion about "openwrt,fit-firmware" vs
"denx,fit":
http://lists.openwrt.org/pipermail/openwrt-devel/2018-December/021004.html

If we stick to the conclusion of that discussion, then we will stick to
"denx,uimage".  And I guess the properties should be "denx,ih-magic"
etc.  Which I do feel a bit uncomfortable.  One thing is abusing a name
defined by someone else.  Another is stealing parts of their namespace.

What do you say?  Is the "openwrt,fit-firmware" discussion still valid?


Bjørn






More information about the openwrt-devel mailing list