mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/6] of: partition: add Linux CONFIG_OF_PARTITION-compatible adaptive fixup mode
@ 2025-02-17 18:08 Ahmad Fatoum
  2025-02-17 18:08 ` [PATCH 1/6] of: factor out of_node_is_fixed_partitions check Ahmad Fatoum
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Ahmad Fatoum @ 2025-02-17 18:08 UTC (permalink / raw)
  To: barebox

barebox has for many years supported a superset of the upstream OF
partitions binding by parsing partitions out of SD/eMMC and EEPROM
in addition to MTD.

Unfortunately, we didn't upstream our binding and a different binding
went upstream into Linux v6.13-rc1 along with Linux commit
2e3a191e89f9 ("block: add support for partition table defined in OF").

Since then, if CONFIG_OF_PARTITION, which is disabled by default, is
enabled, Linux will ignore any GPT/MBR if an SD/eMMC node has a
fixed-partitions compatible subnode.

This is different from the barebox behavior, which allows both OF
partitions and GPT/MBR to co-exist as long as they don't conflict.

As many barebox boards:

  - Place the environment in non-partitioned space prior to the first
    partition

  - Fixup all fixed-partitions into the kernel device tree by default

this can result in breakage if a newer kernel is booted with
CONFIG_OF_PARTITION enabled.

To resolve this, this series introduces the barebox,fixed-partitions
compatible and uses that in Linux device tree fixups for SD/eMMC
by default.

Ahmad Fatoum (6):
  of: factor out of_node_is_fixed_partitions check
  of: of_path: support barebox,fixed-partitions
  ARM: IMX8MP: var-dart-dt8mcustomboard.dts: use new-style partition
    binding
  ARM: dts: prefix all non-MTD fixed-partitions with barebox,
  of: partition: refactor of_partition_binding checks into switch
  of: partition: add Linux CONFIG_OF_PARTITION-compatible adaptive fixup
    mode

 .../devicetree/bindings/mtd/partition.rst     | 27 +++++++-
 Documentation/user/state.rst                  |  4 +-
 arch/arm/dts/am335x-phytec-state.dtsi         |  2 +-
 .../dts/fsl-ls1046a-tqmls1046a-mbls10xxa.dts  |  2 +-
 arch/arm/dts/imx50-kindle-common.dtsi         |  2 +-
 arch/arm/dts/imx51-zii-rdu1.dts               |  2 +-
 arch/arm/dts/imx6dl-colibri-iris.dts          |  2 +-
 arch/arm/dts/imx6qdl-phytec-mira.dtsi         |  2 +-
 arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi  |  2 +-
 arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi  |  2 +-
 arch/arm/dts/imx6qdl-phytec-state.dtsi        |  2 +-
 arch/arm/dts/imx6qdl-zii-rdu2.dtsi            |  2 +-
 arch/arm/dts/imx6ul-liteboard.dts             |  4 +-
 arch/arm/dts/imx6ul-phytec-state.dtsi         |  2 +-
 arch/arm/dts/imx6ul-tqma6ul-common.dtsi       |  4 +-
 arch/arm/dts/imx6ul-webasto-ccbv2.dts         |  2 +-
 arch/arm/dts/imx6ul-webasto-marvel.dts        |  2 +-
 arch/arm/dts/imx7d-ac-sxb.dtsi                |  4 +-
 arch/arm/dts/imx7d-flex-concentrator-mfg.dts  |  2 +-
 arch/arm/dts/imx7d-gome-e143_01.dts           |  2 +-
 arch/arm/dts/imx7d-phyboard-zeta.dts          |  2 +-
 arch/arm/dts/imx7s-warp.dts                   |  2 +-
 arch/arm/dts/imx8mm-innocomm-wb15-evk.dts     |  4 +-
 arch/arm/dts/imx8mm-phyboard-polis-rdk.dts    |  4 +-
 arch/arm/dts/imx8mp-debix-model-a.dts         |  4 +-
 arch/arm/dts/imx8mp-debix-som-a-bmb-08.dts    |  4 +-
 arch/arm/dts/imx8mp-karo-qsxp-ml81.dtsi       |  2 +-
 .../dts/imx8mp-var-dart-dt8mcustomboard.dts   | 25 ++++----
 arch/arm/dts/rk3566-cm3-io.dts                |  4 +-
 arch/arm/dts/rk3566-pinetab2.dtsi             |  4 +-
 arch/arm/dts/rk3568-bpi-r2-pro.dts            |  4 +-
 arch/arm/dts/rk3568-evb1-v10.dts              |  4 +-
 arch/arm/dts/rk3568-mecsbc.dts                |  4 +-
 arch/arm/dts/rk3568-rock-3a.dts               |  4 +-
 arch/arm/dts/rk3568-wolfvision-pf5.dts        |  2 +-
 arch/arm/dts/rk3588-orangepi-5-plus.dts       |  4 +-
 arch/arm/dts/rk3588-rock-5b.dts               |  4 +-
 arch/arm/dts/socfpga_arria10_achilles.dts     |  2 +-
 arch/arm/dts/socfpga_arria10_mercury_aa1.dts  |  2 +-
 arch/arm/dts/state-example.dtsi               |  4 +-
 drivers/of/base.c                             |  6 +-
 drivers/of/of_path.c                          |  9 ++-
 drivers/of/partition.c                        | 62 ++++++++++++-------
 include/of.h                                  |  6 ++
 44 files changed, 149 insertions(+), 96 deletions(-)

-- 
2.39.5




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-02-20  8:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-17 18:08 [PATCH 0/6] of: partition: add Linux CONFIG_OF_PARTITION-compatible adaptive fixup mode Ahmad Fatoum
2025-02-17 18:08 ` [PATCH 1/6] of: factor out of_node_is_fixed_partitions check Ahmad Fatoum
2025-02-17 18:08 ` [PATCH 2/6] of: of_path: support barebox,fixed-partitions Ahmad Fatoum
2025-02-17 18:08 ` [PATCH 3/6] ARM: IMX8MP: var-dart-dt8mcustomboard.dts: use new-style partition binding Ahmad Fatoum
2025-02-17 18:08 ` [PATCH 4/6] ARM: dts: prefix all non-MTD fixed-partitions with barebox, Ahmad Fatoum
2025-02-17 18:08 ` [PATCH 5/6] of: partition: refactor of_partition_binding checks into switch Ahmad Fatoum
2025-02-17 18:08 ` [PATCH 6/6] of: partition: add Linux CONFIG_OF_PARTITION-compatible adaptive fixup mode Ahmad Fatoum
2025-02-17 19:25 ` [PATCH 0/6] " Marco Felsch
2025-02-17 19:57   ` Ahmad Fatoum
2025-02-20  8:26 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox