Specifications

this command uses three environment variables:
'partition' - keeps current partition identifier
partition := <part-id>
<part-id> := <dev-id>,part_num
'mtdids' - linux kernel mtd device id <-> u-boot device id mapping
mtdids=<idmap>[,<idmap>,...]
<idmap> := <dev-id>=<mtd-id>
<dev-id> := 'nand'|'nor'|'onenand'<dev-num>
<dev-num> := mtd device number, 0...
<mtd-id> := unique device tag used by linux kernel to find mtd device (mtd->name)
'mtdparts' - partition list
mtdparts=mtdparts=<mtd-def>[;<mtd-def>...]
<mtd-def> := <mtd-id>:<part-def>[,<part-def>...]
<mtd-id> := unique device tag used by linux kernel to find mtd device (mtd->name)
<part-def> := <size>[@<offset>][<name>][<ro-flag>]
<size> := standard linux memsize OR '-' to denote all remaining space
<offset> := partition start offset within the device
<name> := '(' NAME ')'
<ro-flag> := when set to 'ro' makes partition read-only (not used, passed to kernel)
=>
For example, on the m28 target system the mtdparts command display this information:
=> mtdparts
device nand0 <gpmi-nand>, # parts = 5
#: name size offset mask_flags
0: bootloader 0x00300000 0x00000000 1
1: environment 0x00080000 0x00300000 0
2: redundant-environment0x00080000 0x00380000 0
3: kernel 0x00400000 0x00400000 0
4: filesystem 0x0f800000 0x00800000 0
active partition: nand0,0 - (bootloader) 0x00300000 @ 0x00000000
defaults:
mtdids : nand0=gpmi-nand
mtdparts: mtdparts=gpmi-nand:3m(bootloader)ro,512k(environment),512k(redundant-environment),4m(kernel),-(filesystem)
=>
The partition table printed here obviously differs from the default value for the mtdparts variable printed in
the last line. To verify this, we can check the current content of this variable:
=> print mtdparts
mtdparts=mtdparts=gpmi-nand:3m(bootloader)ro,512k(environment),512k(redundant-environment),4m(kernel),-(filesystem)
=>
and we can see that it exactly matches the partition table printed above.
Then we delete the last 2 partitions ...
=> print mtdparts
mtdparts=mtdparts=gpmi-nand:3m(bootloader)ro,512k(environment),512k(redundant-environment),4m(kernel),-(filesystem)
=> mtdparts del kernel
=> mtdparts del filesystem
5.9.3.5. mtdparts - define a Linux compatible MTD partitionscheme 53