block: partition table OF support
Subsystems (4)
v5 cover block: partition table OF support
Hi,
this is an initial proposal to complete support for manually defining partition table.
Some background on this. Many OEM on embedded device (modem, router...) are starting to migrate from NOR/NAND flash to eMMC. The reason for this is that OEM are starting to require more and more space for the firmware and price difference is becoming so little that using eMMC is only benefits and no cons.
Given these reason, OEM are also using very custom way to provide a partition table and doesn't relay on common method like writing a table on the eMMC.
One way that is commonly used is to hardcode the partition table and pass it to the system via various way (cmdline, special glue driver, block2mtd...)
This way is also used on Android where the partition table is passed from the bootloader via cmdline.
One reason to use this method is to save space on the device and to permit more flexibility on partition handling.
What this series does is complete support for this feature. It's possible to use the cmdline to define a partition table similar to how it's done for MTD but this is problematic for a number of device where tweaking the cmdline is not possible. This series adds OF support to make it possible to define a partition table in the Device Tree.
We implement a similar schema to the MTD fixed-partition, where we define a "label" and a "reg" with "offset" and "size".
A new block partition parser is introduced that check if the disk device have an OF node attached and check if a fixed-partition table is defined.
block driver can use the device_add_of_disk() function to register a new disk and attach a fwnode to it for usage with the OF parser.
This permits flexibility from the driver side to implement the partitions node in different nodes across different block devices.
If a correct node is found, then partition table is filled. cmdline will still have priority to this new parser.
Some block device also implement boot1 and boot2 additional disk. Similar to the cmdline parser, these disk can have OF support using the "partitions-boot1" and "partitions-boot2" additional node. Also eMMC gp 1/2/3/4 disk are supported.
It's also completed support for declaring partition as read-only as this feature was introduced but never finished in the cmdline parser.
I hope this solution is better accepted as downstream this is becoming a real problem with a growing number of strange solution for the simple task of providing a fixed partition table.
Changes v5:
- Introduce device_add_of_disk() function
- Detach eMMC special disk from OF block partition code and move parsing to eMMC block driver (as requested by Christoph)
- Rework OF block partition to use the device disk device_node
- Extend support for eMMC GP1/2/3/4
- Rename boot0/1 to boot1/2
- Drop strends patch (unused now)
Changes v4:
- Fix wrong description and title in Kconfig
- Validate reg len with addr and size cells
- Drop offset 0 constraint (not needed)
- Rework bytes to sector conversion
- Follow common logic with ignore partitions after state->limit
- Better handle device_node put
- Add suggested strends string helper
Changes v3:
- Out of RFC
- Drop partition schema generalization and simplify it
- Require fixed-partitions compatible to adapt to MTD schema
- Make label property optional and fallback to node name Changes v2:
- Reference bytes in DT instead of Sector Size
- Validate offset and size after Sector Size conversion
- Limit boot0 and boot1 to eMMC and add comments about JEDEC spec
- Generalize MTD partition schema and introduce block partitions schema
- Add missing code to actually attach the OF parser to block partition core
- Add reviewed by tag for read-only patch
Christian Marangi (6):
block: add support for defining read-only partitions
docs: block: Document support for read-only partition in cmdline part
block: introduce device_add_of_disk()
mmc: block: attach partitions fwnode if found in mmc-card
block: add support for partition table defined in OF
dt-bindings: mmc: Document support for partition table in mmc-card
Documentation/block/cmdline-partition.rst | 5 +- .../devicetree/bindings/mmc/mmc-card.yaml | 52 ++++++++ block/blk.h | 1 + block/genhd.c | 21 +++- block/partitions/Kconfig | 9 ++ block/partitions/Makefile | 1 + block/partitions/check.h | 1 + block/partitions/cmdline.c | 3 + block/partitions/core.c | 6 + block/partitions/of.c | 116 ++++++++++++++++++ drivers/mmc/core/block.c | 55 ++++++++- include/linux/blkdev.h | 3 + 12 files changed, 269 insertions(+), 4 deletions(-) create mode 100644 block/partitions/of.c
Signature · 1 line
2.45.2
PATCH v5 1/6 block: add support for defining read-only partitions
Add support for defining read-only partitions and complete support for it in the cmdline partition parser as the additional "ro" after a partition is scanned but never actually applied.
--- block/blk.h | 1 + block/partitions/cmdline.c | 3 +++ block/partitions/core.c | 3 +++ 3 files changed, 7 insertions(+)
block/blk.h +1 -0
@@ -558,6 +558,7 @@ void blk_free_ext_minor(unsigned int minor);#define ADDPART_FLAG_NONE 0#define ADDPART_FLAG_RAID 1#define ADDPART_FLAG_WHOLEDISK 2 +#define ADDPART_FLAG_READONLY 4int bdev_add_partition (struct gendisk *disk,int partno,sector_t start,sector_t length);int bdev_del_partition (struct gendisk *disk,int partno);
block/partitions/cmdline.c +3 -0
@@ -237,6 +237,9 @@ static int add_part(int slot, struct cmdline_subpart *subpart,put_partition (state, slot, subpart->from >>9 , subpart->size >>9 ); +if (subpart->flags &PF_RDONLY ) + state->parts[slot].flags |=ADDPART_FLAG_READONLY ; + info = &state->parts[slot].info;strscpy (info->volname, subpart->name,sizeof (info->volname));
block/partitions/core.c +3 -0
@@ -373,6 +373,9 @@ static struct block_device *add_partition(struct gendisk *disk, int partno, goto out_del; } +if (flags &ADDPART_FLAG_READONLY ) +bdev_set_flag (bdev,BD_READ_ONLY ); +/* everything is up and running, commence */ err =xa_insert (&disk->part_tbl, partno, bdev,GFP_KERNEL );if (err)
Signature · 1 line
2.45.2
PATCH v5 2/6 docs: block: Document support for read-only partition in cmdline part
In reply to Christian MarangiDocument support for read-only partition in cmdline partition for block devices by appending "ro" after the (partition name).
--- Documentation/block/cmdline-partition.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/block/cmdline-partition.rst +4 -1
@@ -39,13 +39,16 @@ blkdevparts=<blkdev-def>[;<blkdev-def>] create a link to block device partition with the name "PARTNAME". User space application can access partition by partition name. +ro + read-only. Flag the partition as read-only. + Example: eMMC disk names are "mmcblk0" and "mmcblk0boot0". bootargs:: - 'blkdevparts=mmcblk0:1G(data0),1G(data1),-;mmcblk0boot0:1m(boot),-(kernel)' + 'blkdevparts=mmcblk0:1G(data0),1G(data1),-;mmcblk0boot0:1m(boot)ro,-(kernel)' dmesg::
Signature · 1 line
2.45.2
PATCH v5 3/6 block: introduce device_add_of_disk()
In reply to Christian MarangiIntroduce device_add_of_disk() as a variant of device_add_disk() that permits to pass and attach a fwnode to disk dev.
This variant can be useful for eMMC that might have the partition table for the disk defined in DT. A parser can later make use of the attached fwnode to parse the related table and init the hardcoded partition for the disk.
--- block/genhd.c | 21 +++++++++++++++++++-- include/linux/blkdev.h | 3 +++ 2 files changed, 22 insertions(+), 2 deletions(-)
block/genhd.c +19 -2
@@ -391,8 +391,9 @@ int disk_scan_partitions(struct gendisk *disk, blk_mode_t mode)* This function registers the partitioning information in @disk * with the kernel. */ -int __must_check device_add_disk (struct device *parent,struct gendisk *disk, -const struct attribute_group **groups) +static int __device_add_disk (struct device *parent,struct gendisk *disk, +const struct attribute_group **groups, +struct fwnode_handle *fwnode) {struct device *ddev =disk_to_dev (disk);
@@ -452,6 +453,8 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk, ddev->parent = parent; ddev->groups = groups;dev_set_name (ddev,"%s" , disk->disk_name); +if (fwnode) +device_set_node (ddev, fwnode);if (!(disk->flags &GENHD_FL_HIDDEN )) ddev->devt =MKDEV (disk->major, disk->first_minor); ret =device_add (ddev);
@@ -553,8 +556,22 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk,elevator_exit (disk->queue);return ret; } + +int __must_check device_add_disk (struct device *parent,struct gendisk *disk, +const struct attribute_group **groups) +{ +return __device_add_disk (parent, disk, groups,NULL ); +}EXPORT_SYMBOL (device_add_disk); +int __must_check device_add_of_disk (struct device *parent,struct gendisk *disk, +const struct attribute_group **groups, +struct fwnode_handle *fwnode) +{ +return __device_add_disk (parent, disk, groups, fwnode); +} +EXPORT_SYMBOL (device_add_of_disk); +static void blk_report_disk_dead (struct gendisk *disk,bool surprise) {struct block_device *bdev;
include/linux/blkdev.h +3 -0
@@ -725,6 +725,9 @@ static inline unsigned int blk_queue_depth(struct request_queue *q)#define for_each_bio (_bio) \ for (; _bio; _bio = _bio->bi_next) +int __must_check device_add_of_disk (struct device *parent,struct gendisk *disk, +const struct attribute_group **groups, +struct fwnode_handle *fwnode);int __must_check device_add_disk (struct device *parent,struct gendisk *disk,const struct attribute_group **groups);static inline int __must_check add_disk (struct gendisk *disk)
Signature · 1 line
2.45.2
Re: [PATCH v5 3/6] block: introduce device_add_of_disk()
Thanks,
this looks much better. A few minor nitpicks, though:
block/genhd.c int disk_scan_partitions(struct gendisk *disk, blk_mode_t mode) · line 396
Quoted 5 lines
block/genhd.c +3
-2-int __must_check device_add_disk (struct device *parent,struct gendisk *disk, -const struct attribute_group **groups) +static int __device_add_disk (struct device *parent,struct gendisk *disk, +const struct attribute_group **groups, +struct fwnode_handle *fwnode)
I don't think we need a separate helper if device_add_disk simply wraps the OF version by passing a NULL fwnode.
block/genhd.c int __must_check device_add_disk(struct device *parent, struct gendisk *disk, · line 572
Quoted 6 lines
block/genhd.c +6
-0+int __must_check device_add_of_disk (struct device *parent,struct gendisk *disk, +const struct attribute_group **groups, +struct fwnode_handle *fwnode) +{ +return __device_add_disk (parent, disk, groups, fwnode); +}
I'd name this as add_disk_fwnode as the of in device_add_of_disk reads as in add the device of the disk, and the fwnode is what gets passed. The device_ is a bit redundant and just there for historic reasons as the original add_disk predates the device model.
Can you also add a kerneldoc comment for the new helper?
Quoted 1 line
+EXPORT_SYMBOL(device_add_of_disk);
EXPORT_SYMBO_GPL, please.
Re: [PATCH v5 3/6] block: introduce device_add_of_disk()
Quoted 4 lines · Christoph Hellwig
Thanks,
this looks much better. A few minor nitpicks, though:
Very happy you like it, yes I wasn't sure what was the correct way to introduce the helper. If you notice in the blkdev.h we have also add_disk() that is a static inline wrapper for device_add_disk().
Wonder if device_add_disk() should have the same treatement? No idea if it would cause problem with symbol with external modules, that is why I used the wrapper.
Quoted 21 lines
block/genhd.c int disk_scan_partitions(struct gendisk *disk, blk_mode_t mode) · line 396
Quoted 5 lines
block/genhd.c +3
-2-int __must_check device_add_disk (struct device *parent,struct gendisk *disk, -const struct attribute_group **groups) +static int __device_add_disk (struct device *parent,struct gendisk *disk, +const struct attribute_group **groups, +struct fwnode_handle *fwnode)I don't think we need a separate helper if
device_add_disksimply wraps the OF version by passing a NULL fwnode.block/genhd.c int __must_check device_add_disk(struct device *parent, struct gendisk *disk, · line 572
Quoted 6 lines
block/genhd.c +6
-0+int __must_check device_add_of_disk (struct device *parent,struct gendisk *disk, +const struct attribute_group **groups, +struct fwnode_handle *fwnode) +{ +return __device_add_disk (parent, disk, groups, fwnode); +}I'd name this as
add_disk_fwnodeas the of indevice_add_of_diskreads as in add the device of the disk, and the fwnode is what gets passed. Thedevice_is a bit redundant and just there for historic reasons as the originaladd_diskpredates the device model.
Quoted 2 lines
Can you also add a kerneldoc comment for the new helper?
sure! I will wait the usual 24h to respin this.
Quoted 4 lines
Quoted 1 line
+EXPORT_SYMBOL(device_add_of_disk);
EXPORT_SYMBO_GPL, please.
ack.
Signature · 1 line
Ansuel
Re: [PATCH v5 3/6] block: introduce device_add_of_disk()
Quoted 7 lines · Christian Marangi
Very happy you like it, yes I wasn't sure what was the correct way to introduce the helper. If you notice in the
blkdev.hwe have alsoadd_disk()that is a static inline wrapper fordevice_add_disk().Wonder if
device_add_disk()should have the same treatement? No idea if it would cause problem with symbol with external modules, that is why I used the wrapper.
We could make it an inline wrapper, but it's not in a high performance path so there isn't really much of a point in doing so. I don't remember why it was done for add_disk.
PATCH v5 4/6 mmc: block: attach partitions fwnode if found in mmc-card
In reply to Christian MarangiAttach partitions fwnode if found in mmc-card and register disk with it.
This permits block partition to reference the node and register a partition table defined in DT for the special case for embedded device that doesn't have a partition table flashed but have an hardcoded partition table passed from the system.
JEDEC BOOT partition boot0/boot1 are supported but in DT we refer with the JEDEC name of boot1 and boot2 to better adhere to documentation.
Also JEDEC GP partition gp0/1/2/3 are supported but in DT we refer with the JEDEC name of gp1/2/3/4 to better adhere to documentration.
--- drivers/mmc/core/block.c | 55 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-)
drivers/mmc/core/block.c +54 -1
@@ -2501,6 +2501,56 @@ static inline int mmc_blk_readonly(struct mmc_card *card) !(card->csd.cmdclass &CCC_BLOCK_WRITE ); } +/* +* Search for a declared partitions node for the disk in mmc-card related node. +* +* This is to permit support for partition table defined in DT in special case +* where a partition table is not written in the disk and is expected to be +* passed from the running system. +* +* For the user disk, "partitions" node is searched. +* For the special HW disk, "partitions-" node with the appended name is used +* following this conversion table (to adhere to JEDEC naming) +* - boot0 -> partitions-boot1 +* - boot1 -> partitions-boot2 +* - gp0 -> partitions-gp1 +* - gp1 -> partitions-gp2 +* - gp2 -> partitions-gp3 +* - gp3 -> partitions-gp4 +*/ +static struct fwnode_handle *mmc_blk_get_partitions_node (struct device *mmc_dev, +const char *subname) +{ +const char *node_name ="partitions" ; + +if (subname) { + mmc_dev = mmc_dev->parent; + +/* +* Check if we are allocating a BOOT disk boot0/1 disk. +* In DT we use the JEDEC naming boot1/2. +*/ +if (!strcmp (subname,"boot0" )) + node_name ="partitions-boot1" ; +if (!strcmp (subname,"boot1" )) + node_name ="partitions-boot2" ; +/* +* Check if we are allocating a GP disk gp0/1/2/3 disk. +* In DT we use the JEDEC naming gp1/2/3/4. +*/ +if (!strcmp (subname,"gp0" )) + node_name ="partitions-gp1" ; +if (!strcmp (subname,"gp1" )) + node_name ="partitions-gp2" ; +if (!strcmp (subname,"gp2" )) + node_name ="partitions-gp3" ; +if (!strcmp (subname,"gp3" )) + node_name ="partitions-gp4" ; + } + +return device_get_named_child_node (mmc_dev, node_name); +} + static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, struct device *parent, sector_t size,
@@ -2509,6 +2559,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,int area_type, unsigned int part_type) { + struct fwnode_handle *disk_fwnode;struct mmc_blk_data *md;int devidx, ret;char cap_str[10 ];
@@ -2610,7 +2661,9 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,/* used in ->open, must be set before add_disk: */ if (area_type ==MMC_BLK_DATA_AREA_MAIN )dev_set_drvdata (&card->dev, md); - ret =device_add_disk (md->parent, md->disk, mmc_disk_attr_groups); + disk_fwnode =mmc_blk_get_partitions_node (parent, subname); + ret =device_add_of_disk (md->parent, md->disk, mmc_disk_attr_groups, + disk_fwnode);if (ret) goto err_put_disk;return md;
Signature · 1 line
2.45.2
Re: [PATCH v5 4/6] mmc: block: attach partitions fwnode if found in mmc-card
Quoted 7 lines · Christian Marangi
Attach partitions fwnode if found in mmc-card and register disk with it.
This permits block partition to reference the node and register a partition table defined in DT for the special case for embedded device that doesn't have a partition table flashed but have an hardcoded partition table passed from the system.
Quoted 7 lines
JEDEC BOOT partition boot0/boot1 are supported but in DT we refer with the JEDEC name of boot1 and boot2 to better adhere to documentation.
Also JEDEC GP partition gp0/1/2/3 are supported but in DT we refer with the JEDEC name of gp1/2/3/4 to better adhere to documentration.
Signed-off-by Christian Marangi <[email protected]>
This looks very useful and avoids a lot of out-of-tree hacks.
Yours,
Linus Walleij
PATCH v5 5/6 block: add support for partition table defined in OF
In reply to Christian MarangiAdd 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.
--- block/partitions/Kconfig | 9 +++ block/partitions/Makefile | 1 + block/partitions/check.h | 1 + block/partitions/core.c | 3 + block/partitions/of.c | 116 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 130 insertions(+) create mode 100644 block/partitions/of.c
block/partitions/Kconfig +9 -0
@@ -270,4 +270,13 @@ config CMDLINE_PARTITION Say Y here if you want to read the partition table from bootargs. The format for the command line is just like mtdparts. +config OF_PARTITION + bool "Device Tree partition support" if PARTITION_ADVANCED + depends on OF + help + Say Y here if you want to enable support for partition table + defined in Device Tree. (mainly for eMMC) + The format for the device tree node is just like MTD fixed-partition + schema. + endmenu
block/partitions/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_CMDLINE_PARTITION) += cmdline.o obj-$(CONFIG_MAC_PARTITION) += mac.o obj-$(CONFIG_LDM_PARTITION) += ldm.o obj-$(CONFIG_MSDOS_PARTITION) += msdos.o +obj-$(CONFIG_OF_PARTITION) += of.o obj-$(CONFIG_OSF_PARTITION) += osf.o obj-$(CONFIG_SGI_PARTITION) += sgi.o obj-$(CONFIG_SUN_PARTITION) += sun.o
block/partitions/check.h +1 -0
@@ -62,6 +62,7 @@ int karma_partition(struct parsed_partitions *state);int ldm_partition (struct parsed_partitions *state);int mac_partition (struct parsed_partitions *state);int msdos_partition (struct parsed_partitions *state); +int of_partition (struct parsed_partitions *state);int osf_partition (struct parsed_partitions *state);int sgi_partition (struct parsed_partitions *state);int sun_partition (struct parsed_partitions *state);
block/partitions/core.c +3 -0
@@ -43,6 +43,9 @@ static int (*const check_part[])(struct parsed_partitions *) = {#ifdef CONFIG_CMDLINE_PARTITION cmdline_partition,#endif +#ifdef CONFIG_OF_PARTITION + of_partition, /* cmdline have priority to OF */ +#endif #ifdef CONFIG_EFI_PARTITION efi_partition, /* this must come before msdos */#endif
block/partitions/of.c new file +116 -0
116 lines not on this page · raw message
Signature · 1 line
2.45.2
Re: [PATCH v5 5/6] block: add support for partition table defined in OF
block/partitions/of.c line 19
Quoted 11 lines · Christian Marangi
block/partitions/of.c new file +11
-0+static int validate_of_partition (struct device_node *np,int slot) +{ +int a_cells, s_cells; +const __be32 *reg; +u64 offset, size; +int len; + + reg =of_get_property (np,"reg" , &len); + + a_cells =of_n_addr_cells (np); + s_cells =of_n_size_cells (np);
Just personal preference, but I find code easier to read if variables are initialized at declaration time whenever possible:
const __be32 *reg = of_get_property(np, "reg", &len); int a_cells = of_n_addr_cells(np); int s_cells = of_n_size_cells(np);
(same for a few other functions below)
Otherwise looks good:
PATCH v5 6/6 dt-bindings: mmc: Document support for partition table in mmc-card
In reply to Christian MarangiDocument support for defining a partition table in the mmc-card node.
This is needed if the eMMC doesn't have a partition table written and the bootloader of the device load data by using absolute offset of the block device. This is common on embedded device that have eMMC installed to save space and have non removable block devices.
If an OF partition table is detected, any partition table written in the eMMC will be ignored and won't be parsed.
eMMC provide a generic disk for user data and if supported (JEDEC 4.4+) also provide two additional disk ("boot1" and "boot2") for special usage of boot operation where normally is stored the bootloader or boot info. New JEDEC version also supports up to 4 GP partition for other usage called "gp1", "gp2", "gp3", "gp4".
--- .../devicetree/bindings/mmc/mmc-card.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+)
Documentation/devicetree/bindings/mmc/mmc-card.yaml +52 -0
@@ -13,6 +13,10 @@ description: | This documents describes the devicetree bindings for a mmc-host controller child node describing a mmc-card / an eMMC. + It's possible to define a fixed partition table for an eMMC for the user + partition, the 2 BOOT partition (boot1/2) and the 4 GP (gp1/2/3/4) if supported + by the eMMC. + properties: compatible: const: mmc-card
@@ -26,6 +30,24 @@ properties: Use this to indicate that the mmc-card has a broken hpi implementation, and that hpi should not be used. +patternProperties: + "^partitions(-boot[12]|-gp[14])?$": + $ref: /schemas/mtd/partitions/partitions.yaml + + patternProperties: + "^partition@[0-9a-f]+$": + $ref: /schemas/mtd/partitions/partition.yaml + + properties: + reg: + description: Must be multiple of 512 as it's converted + internally from bytes to SECTOR_SIZE (512 bytes) + + required: + - reg + + unevaluatedProperties: false + required: - compatible - reg
@@ -42,6 +64,36 @@ examples: compatible = "mmc-card"; reg = <0>; broken-hpi; + + partitions { + compatible = "fixed-partitions"; + + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; /* Kernel */ + reg = <0x0 0x2000000>; /* 32 MB */ + }; + + partition@2000000 { + label = "rootfs"; + reg = <0x2000000 0x40000000>; /* 1GB */ + }; + }; + + partitions-boot1 { + compatible = "fixed-partitions"; + + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bl"; + reg = <0x0 0x2000000>; /* 32MB */ + read-only; + }; + }; }; };
Signature · 1 line
2.45.2
Re: [PATCH v5 6/6] dt-bindings: mmc: Document support for partition table in mmc-card
Quoted 10 lines · Christian Marangi
Document support for defining a partition table in the mmc-card node.
This is needed if the eMMC doesn't have a partition table written and the bootloader of the device load data by using absolute offset of the block device. This is common on embedded device that have eMMC installed to save space and have non removable block devices.
If an OF partition table is detected, any partition table written in the eMMC will be ignored and won't be parsed.
Quoted 7 lines
eMMC provide a generic disk for user data and if supported (JEDEC 4.4+) also provide two additional disk ("boot1" and "boot2") for special usage of boot operation where normally is stored the bootloader or boot info. New JEDEC version also supports up to 4 GP partition for other usage called "gp1", "gp2", "gp3", "gp4".
Signed-off-by Christian Marangi <[email protected]>
Yours,
Linus Walleij
Re: [PATCH v5 6/6] dt-bindings: mmc: Document support for partition table in mmc-card
In reply to Christian MarangiQuoted 16 lines · Christian Marangi
Document support for defining a partition table in the mmc-card node.
This is needed if the eMMC doesn't have a partition table written and the bootloader of the device load data by using absolute offset of the block device. This is common on embedded device that have eMMC installed to save space and have non removable block devices.
If an OF partition table is detected, any partition table written in the eMMC will be ignored and won't be parsed.
eMMC provide a generic disk for user data and if supported (JEDEC 4.4+) also provide two additional disk ("boot1" and "boot2") for special usage of boot operation where normally is stored the bootloader or boot info. New JEDEC version also supports up to 4 GP partition for other usage called "gp1", "gp2", "gp3", "gp4".
Quoted 5 lines
Signed-off-by Christian Marangi <[email protected]>--- .../devicetree/bindings/mmc/mmc-card.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+)