blob: 530bedff548aac45b7019f99e52e1f5d9fce9f76 [file] [log] [blame]
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -03001==============================================
Paul Gortmaker080506a2013-09-30 13:45:19 -07002Embedded device command line partition parsing
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -03003==============================================
Cai Zhiyongbab55412013-09-11 14:20:09 -07004
Randy Dunlapf6dbf65b2018-05-06 11:50:29 -07005The "blkdevparts" command line option adds support for reading the
6block device partition table from the kernel command line.
7
Paul Gortmaker080506a2013-09-30 13:45:19 -07008It is typically used for fixed block (eMMC) embedded devices.
9It has no MBR, so saves storage space. Bootloader can be easily accessed
Cai Zhiyongbab55412013-09-11 14:20:09 -070010by absolute address of data on the block device.
11Users can easily change the partition.
12
13The format for the command line is just like mtdparts:
14
15blkdevparts=<blkdev-def>[;<blkdev-def>]
16 <blkdev-def> := <blkdev-id>:<partdef>[,<partdef>]
17 <partdef> := <size>[@<offset>](part-name)
18
19<blkdev-id>
Randy Dunlapf6dbf65b2018-05-06 11:50:29 -070020 block device disk name. Embedded device uses fixed block device.
21 Its disk name is also fixed, such as: mmcblk0, mmcblk1, mmcblk0boot0.
Cai Zhiyongbab55412013-09-11 14:20:09 -070022
23<size>
24 partition size, in bytes, such as: 512, 1m, 1G.
Randy Dunlapf6dbf65b2018-05-06 11:50:29 -070025 size may contain an optional suffix of (upper or lower case):
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030026
Randy Dunlapf6dbf65b2018-05-06 11:50:29 -070027 K, M, G, T, P, E.
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030028
Randy Dunlapf6dbf65b2018-05-06 11:50:29 -070029 "-" is used to denote all remaining space.
Cai Zhiyongbab55412013-09-11 14:20:09 -070030
31<offset>
32 partition start address, in bytes.
Randy Dunlapf6dbf65b2018-05-06 11:50:29 -070033 offset may contain an optional suffix of (upper or lower case):
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030034
Randy Dunlapf6dbf65b2018-05-06 11:50:29 -070035 K, M, G, T, P, E.
Cai Zhiyongbab55412013-09-11 14:20:09 -070036
37(part-name)
Randy Dunlapf6dbf65b2018-05-06 11:50:29 -070038 partition name. Kernel sends uevent with "PARTNAME". Application can
39 create a link to block device partition with the name "PARTNAME".
40 User space application can access partition by partition name.
Cai Zhiyongbab55412013-09-11 14:20:09 -070041
42Example:
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030043
Randy Dunlapf6dbf65b2018-05-06 11:50:29 -070044 eMMC disk names are "mmcblk0" and "mmcblk0boot0".
Cai Zhiyongbab55412013-09-11 14:20:09 -070045
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030046 bootargs::
47
Cai Zhiyongbab55412013-09-11 14:20:09 -070048 'blkdevparts=mmcblk0:1G(data0),1G(data1),-;mmcblk0boot0:1m(boot),-(kernel)'
49
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030050 dmesg::
51
Cai Zhiyongbab55412013-09-11 14:20:09 -070052 mmcblk0: p1(data0) p2(data1) p3()
53 mmcblk0boot0: p1(boot) p2(kernel)