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