^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) ==============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) Embedded device command line partition parsing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ==============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) The "blkdevparts" command line option adds support for reading the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) block device partition table from the kernel command line.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) It is typically used for fixed block (eMMC) embedded devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) It has no MBR, so saves storage space. Bootloader can be easily accessed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) by absolute address of data on the block device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) Users can easily change the partition.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) The format for the command line is just like mtdparts:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) blkdevparts=<blkdev-def>[;<blkdev-def>]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) <blkdev-def> := <blkdev-id>:<partdef>[,<partdef>]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) <partdef> := <size>[@<offset>](part-name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) <blkdev-id>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) block device disk name. Embedded device uses fixed block device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) Its disk name is also fixed, such as: mmcblk0, mmcblk1, mmcblk0boot0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) <size>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) partition size, in bytes, such as: 512, 1m, 1G.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) size may contain an optional suffix of (upper or lower case):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) K, M, G, T, P, E.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) "-" is used to denote all remaining space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) <offset>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) partition start address, in bytes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) offset may contain an optional suffix of (upper or lower case):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) K, M, G, T, P, E.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) (part-name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) partition name. Kernel sends uevent with "PARTNAME". Application can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) create a link to block device partition with the name "PARTNAME".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) User space application can access partition by partition name.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) Example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) eMMC disk names are "mmcblk0" and "mmcblk0boot0".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) bootargs::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 'blkdevparts=mmcblk0:1G(data0),1G(data1),-;mmcblk0boot0:1m(boot),-(kernel)'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) dmesg::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) mmcblk0: p1(data0) p2(data1) p3()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) mmcblk0boot0: p1(boot) p2(kernel)