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