[PATCH v2 00/10] kernel: mtdsplit_uimage: use device tree properties for non-standard uimage parsing

Bjørn Mork bjorn at mork.no
Mon Nov 30 17:19:25 EST 2020


OK, another go at this.  The idea is still to replace a number of
device specific variants of the "denx,uimage" partition splitter with
a unified parser, using optional device-tree properties to describe
deviations from the standard U-Boot Image.

Changes in v2:
 - added documentation of the properties, almost upstreamable
 - added a device tree header shared with the driver
 - changed property names to openwrt,foo and tied these to an
   openwrt,uimage compatible string
 - split out the definition of the properties from the deletion of the
   "edimax,uimage" parser

Naming is hard.  And I am still not sure about the "openwrt," thing.
Ref http://lists.openwrt.org/pipermail/openwrt-devel/2018-December/021004.html

But it fealt so wrong trying to define these properties with a "denx,"
prefix.  The way I read
https://www.kernel.org/doc/html/latest/devicetree/bindings/writing-bindings.html
we must use some prefix here.  These properties are not generally
applicable to any partition.  They are very specific to the uimage,
and in particular to the bastard uimage partitions which don't really
qualify as "denx,uimage".

So it ended up as "openwrt,".  I'll change it if you hate it, but I'd
appreciate some hints on what I should change it to..

Yes, and testing. I've build tested all the steps with an assorted set
of affected devices.  And I have run tested this with a new device
which needs the "openwrt,ih-magic" property or similar.  But I have
NOT run tested this on any of the affected existing devices.  Which
means that we don't know if they work at all.  And if they don't then
you will not have a rootfs.  So some care should be taken until this
is verified on those devices.

Might have made the new header too complete.  It makes the diffstat
look worse...  But the real savings are still there in
mtdsplit_uimage.c



Bjørn
---

Bjørn Mork (10):
  dt-bindings: mtd: partitions: add OpenWrt defined U-Boot Image
  kernel: mtdsplit_uimage: read extralen from device tree
  kernel: mtdsplit_uimage: replace "fonfxc" and "sge" parsers
  kernel: mtdsplit_uimage: add "openwrt,ih-magic" device-tree property
  kernel: mtdsplit_uimage: replace "openwrt,okli" parser
  kernel: mtdsplit_uimage: replace "allnet,uimage" parser
  kernel: mtdsplit_uimage: add "openwrt,ih-type" device-tree property
  kernel: mtdsplit_uimage: replace "netgear,uimage" parser
  kernel: mtdsplit_uimage: add "openwrt,offset" and
    "openwrt,partition-magic"
  kernel: mtdsplit_uimage: replace "edimax,uimage" parser

 .../linux/ath79/dts/ar7161_netgear_wndr.dtsi  |   1 +
 .../ath79/dts/ar7161_netgear_wndr3700-v2.dts  |   4 +-
 .../ath79/dts/ar7161_netgear_wndr3700.dts     |   4 +-
 .../ath79/dts/ar7161_netgear_wndr3800.dts     |   4 +-
 .../ath79/dts/ar7161_netgear_wndr3800ch.dts   |   4 +-
 .../ath79/dts/ar7161_netgear_wndrmac-v1.dts   |   4 +-
 .../ath79/dts/ar7161_netgear_wndrmac-v2.dts   |   4 +-
 .../ath79/dts/ar7240_engenius_enh202-v1.dts   |   3 +-
 .../ath79/dts/ar7240_netgear_wnr1000-v2.dts   |   5 +-
 .../ath79/dts/ar7240_netgear_wnr612-v2.dtsi   |   5 +-
 .../ath79/dts/ar7241_netgear_wnr2000-v3.dts   |   5 +-
 .../ath79/dts/ar7241_netgear_wnr2200-16m.dts  |   4 +-
 .../ath79/dts/ar7241_netgear_wnr2200-8m.dts   |   4 +-
 .../ath79/dts/ar7241_netgear_wnr2200.dtsi     |   1 +
 .../dts/ar9341_engenius_ens202ext-v1.dts      |   3 +-
 .../linux/ath79/dts/ar9341_pisen_wmb001n.dts  |   3 +-
 .../linux/ath79/dts/ar9344_netgear_wndr.dtsi  |   5 +-
 .../mtd/partitions/openwrt,uimage.yaml        |  91 ++++
 .../drivers/mtd/mtdsplit/mtdsplit_uimage.c    | 426 +++---------------
 .../dt-bindings/mtd/partitions/uimage.h       | 191 ++++++++
 .../dts/mt7620a_edimax_br-6478ac-v2.dts       |   4 +-
 .../ramips/dts/mt7620a_edimax_ew-7478apc.dts  |   4 +-
 .../linux/ramips/dts/mt7620a_fon_fon2601.dts  |   3 +-
 .../ramips/dts/mt7620n_sunvalley_filehub.dtsi |   3 +-
 .../ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi   |   3 +-
 .../ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi  |   6 +-
 .../linux/ramips/dts/mt7621_edimax_re23s.dts  |   4 +-
 .../ramips/dts/rt3050_edimax_3g-6200n.dts     |   4 +-
 .../ramips/dts/rt3050_edimax_3g-6200nl.dts    |   4 +-
 .../ramips/dts/rt3662_edimax_br-6475nd.dts    |   4 +-
 .../dts/rtl8380_netgear_gs110tpp-v1.dts       |   3 +-
 .../dts/rtl8382_allnet_all-sg8208m.dts        |   3 +-
 32 files changed, 432 insertions(+), 384 deletions(-)
 create mode 100644 target/linux/generic/files/Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.yaml
 create mode 100644 target/linux/generic/files/include/dt-bindings/mtd/partitions/uimage.h

-- 
2.20.1




More information about the openwrt-devel mailing list