]> www.infradead.org Git - users/hch/misc.git/commit
block: add support for partition table defined in OF
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 2 Oct 2024 22:11:45 +0000 (00:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 22 Oct 2024 14:14:56 +0000 (08:14 -0600)
commit2e3a191e89f951b8cb3a7a0365d4d949cbf9599a
treee7986f2cf72a3537acac1fe8412f275be0b46c24
parent3ec7cb11bb9e41e3018656eb7a34e0ce9507785e
block: add support for partition table defined in OF

Add support for partition table defined in Device Tree. Similar to how
it's done with MTD, add support for defining a fixed partition table in
device tree.

A common scenario for this is fixed block (eMMC) embedded devices that
have no MBR or GPT partition table to save storage space. Bootloader
access the block device with absolute address of data.

This is to complete the functionality with an equivalent implementation
with providing partition table with bootargs, for case where the booargs
can't be modified and tweaking the Device Tree is the only solution to
have an usabe partition table.

The implementation follow the fixed-partitions parser used on MTD
devices where a "partitions" node is expected to be declared with
"fixed-partitions" compatible in the OF node of the disk device
(mmc-card for eMMC for example) and each child node declare a label
and a reg with offset and size. If label is not declared, the node name
is used as fallback. Eventually is also possible to declare the read-only
property to flag the partition as read-only.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20241002221306.4403-6-ansuelsmth@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/partitions/Kconfig
block/partitions/Makefile
block/partitions/check.h
block/partitions/core.c
block/partitions/of.c [new file with mode: 0644]