Skip to main content.

5.9.3. Flash Memory Commands

5.9.3.1. cp - memory copy

=> help cp
cp - memory copy

Usage:
cp [.b, .w, .l] source target count
=> help cp
cp - memory copy

Usage:
cp [.b, .w, .l] source target count
=>

The cp command "knows" about flash memory areas and will automatically invoke the necessary flash programming algorithm when the target area is in flash memory.

=> cp.b 0x100000 0xFF900000 0x40000
Copy to Flash... done
=>

ALERT! Writing to flash memory may fail when the target area has not been erased (see erase below), or if it is write-protected (see protect below).

=> cp.b 0x100000 0xFF900000 0x40000
Copy to Flash... Can't write to protected Flash sectors
=>

ALERT! Remember that the count argument specifies the number of items to copy. If you have a "length" instead (= byte count) you should use cp.b or you will have to calculate the correct number of items.

5.9.3.2. flinfo - print FLASH memory information

The command flinfo (short: fli) can be used to get information about the available flash memory. The number of flash banks is printed with information about the size and organization into flash "sectors" or erase units. For all sectors the start addresses are printed; write-protected sectors are marked as read-only (RO). Some configurations of U-Boot also mark empty sectors with an (E).

=> fli

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 64 MB in 512 Sectors
  AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x227E
  Erase timeout: 16384 ms, write timeout: 2 ms
  Buffer write timeout: 5 ms, buffer size: 32 bytes

  Sector Start Addresses:
  FC000000     FC020000     FC040000     FC060000     FC080000
  FC0A0000     FC0C0000     FC0E0000     FC100000     FC120000
  FC140000     FC160000     FC180000     FC1A0000     FC1C0000 E
  FC1E0000     FC200000     FC220000     FC240000     FC260000
  FC280000     FC2A0000     FC2C0000     FC2E0000     FC300000
  FC320000     FC340000     FC360000     FC380000     FC3A0000
  FC3C0000 E     FC3E0000 E     FC400000 E     FC420000 E     FC440000 E
  FC460000 E     FC480000 E     FC4A0000 E     FC4C0000 E     FC4E0000 E
  FC500000 E     FC520000 E     FC540000 E     FC560000 E     FC580000 E
  FC5A0000 E     FC5C0000 E     FC5E0000 E     FC600000 E     FC620000 E
  FC640000 E     FC660000 E     FC680000 E     FC6A0000 E     FC6C0000 E
  FC6E0000 E     FC700000 E     FC720000 E     FC740000 E     FC760000 E
  FC780000 E     FC7A0000 E     FC7C0000 E     FC7E0000 E     FC800000 E
  FC820000 E     FC840000 E     FC860000 E     FC880000 E     FC8A0000 E
  FC8C0000 E     FC8E0000 E     FC900000 E     FC920000 E     FC940000 E
  FC960000 E     FC980000 E     FC9A0000 E     FC9C0000 E     FC9E0000 E
  FCA00000 E     FCA20000 E     FCA40000 E     FCA60000 E     FCA80000 E
  FCAA0000 E     FCAC0000 E     FCAE0000 E     FCB00000 E     FCB20000 E
  FCB40000 E     FCB60000 E     FCB80000 E     FCBA0000 E     FCBC0000 E
  FCBE0000 E     FCC00000 E     FCC20000 E     FCC40000 E     FCC60000 E
  FCC80000 E     FCCA0000 E     FCCC0000 E     FCCE0000 E     FCD00000 E
  FCD20000 E     FCD40000 E     FCD60000 E     FCD80000 E     FCDA0000 E
  FCDC0000 E     FCDE0000 E     FCE00000 E     FCE20000 E     FCE40000 E
  FCE60000 E     FCE80000 E     FCEA0000 E     FCEC0000 E     FCEE0000 E
  FCF00000 E     FCF20000 E     FCF40000 E     FCF60000 E     FCF80000 E
  FCFA0000 E     FCFC0000 E     FCFE0000 E     FD000000 E     FD020000 E
  FD040000 E     FD060000 E     FD080000 E     FD0A0000 E     FD0C0000 E
  FD0E0000 E     FD100000 E     FD120000 E     FD140000 E     FD160000 E
  FD180000 E     FD1A0000 E     FD1C0000 E     FD1E0000 E     FD200000 E
  FD220000 E     FD240000 E     FD260000 E     FD280000 E     FD2A0000 E
  FD2C0000 E     FD2E0000 E     FD300000 E     FD320000 E     FD340000 E
  FD360000 E     FD380000 E     FD3A0000 E     FD3C0000 E     FD3E0000 E
  FD400000 E     FD420000 E     FD440000 E     FD460000 E     FD480000 E
  FD4A0000 E     FD4C0000 E     FD4E0000 E     FD500000 E     FD520000 E
  FD540000 E     FD560000 E     FD580000 E     FD5A0000 E     FD5C0000 E
  FD5E0000 E     FD600000     FD620000 E     FD640000 E     FD660000 E
  FD680000 E     FD6A0000 E     FD6C0000 E     FD6E0000 E     FD700000 E
  FD720000 E     FD740000 E     FD760000 E     FD780000 E     FD7A0000 E
  FD7C0000 E     FD7E0000 E     FD800000 E     FD820000 E     FD840000 E
  FD860000 E     FD880000 E     FD8A0000 E     FD8C0000 E     FD8E0000 E
  FD900000 E     FD920000 E     FD940000 E     FD960000 E     FD980000 E
  FD9A0000 E     FD9C0000 E     FD9E0000 E     FDA00000 E     FDA20000 E
  FDA40000 E     FDA60000 E     FDA80000 E     FDAA0000 E     FDAC0000 E
  FDAE0000 E     FDB00000 E     FDB20000 E     FDB40000 E     FDB60000 E
  FDB80000 E     FDBA0000 E     FDBC0000 E     FDBE0000 E     FDC00000 E
  FDC20000 E     FDC40000 E     FDC60000 E     FDC80000 E     FDCA0000 E
  FDCC0000 E     FDCE0000 E     FDD00000 E     FDD20000 E     FDD40000 E
  FDD60000 E     FDD80000 E     FDDA0000 E     FDDC0000 E     FDDE0000 E
  FDE00000 E     FDE20000 E     FDE40000 E     FDE60000 E     FDE80000 E
  FDEA0000 E     FDEC0000 E     FDEE0000 E     FDF00000 E     FDF20000 E
  FDF40000 E     FDF60000 E     FDF80000 E     FDFA0000 E     FDFC0000 E
  FDFE0000 E     FE000000 E     FE020000 E     FE040000 E     FE060000 E
  FE080000 E     FE0A0000 E     FE0C0000 E     FE0E0000 E     FE100000 E
  FE120000 E     FE140000 E     FE160000 E     FE180000 E     FE1A0000 E
  FE1C0000 E     FE1E0000 E     FE200000 E     FE220000 E     FE240000 E
  FE260000 E     FE280000 E     FE2A0000 E     FE2C0000 E     FE2E0000 E
  FE300000 E     FE320000 E     FE340000 E     FE360000 E     FE380000 E
  FE3A0000 E     FE3C0000 E     FE3E0000 E     FE400000 E     FE420000 E
  FE440000 E     FE460000 E     FE480000 E     FE4A0000 E     FE4C0000 E
  FE4E0000 E     FE500000 E     FE520000 E     FE540000 E     FE560000 E
  FE580000 E     FE5A0000 E     FE5C0000 E     FE5E0000 E     FE600000 E
  FE620000 E     FE640000 E     FE660000 E     FE680000 E     FE6A0000 E
  FE6C0000 E     FE6E0000 E     FE700000 E     FE720000 E     FE740000 E
  FE760000 E     FE780000 E     FE7A0000 E     FE7C0000 E     FE7E0000 E
  FE800000 E     FE820000 E     FE840000 E     FE860000 E     FE880000 E
  FE8A0000 E     FE8C0000 E     FE8E0000 E     FE900000 E     FE920000 E
  FE940000 E     FE960000 E     FE980000 E     FE9A0000 E     FE9C0000 E
  FE9E0000 E     FEA00000 E     FEA20000 E     FEA40000 E     FEA60000 E
  FEA80000 E     FEAA0000 E     FEAC0000 E     FEAE0000 E     FEB00000 E
  FEB20000 E     FEB40000 E     FEB60000 E     FEB80000 E     FEBA0000 E
  FEBC0000 E     FEBE0000 E     FEC00000 E     FEC20000 E     FEC40000 E
  FEC60000 E     FEC80000 E     FECA0000 E     FECC0000 E     FECE0000 E
  FED00000 E     FED20000 E     FED40000 E     FED60000 E     FED80000 E
  FEDA0000 E     FEDC0000 E     FEDE0000 E     FEE00000 E     FEE20000 E
  FEE40000 E     FEE60000 E     FEE80000 E     FEEA0000 E     FEEC0000 E
  FEEE0000 E     FEF00000 E     FEF20000 E     FEF40000 E     FEF60000 E
  FEF80000 E     FEFA0000 E     FEFC0000 E     FEFE0000 E     FF000000 E
  FF020000 E     FF040000 E     FF060000 E     FF080000 E     FF0A0000 E
  FF0C0000 E     FF0E0000 E     FF100000 E     FF120000 E     FF140000 E
  FF160000 E     FF180000 E     FF1A0000 E     FF1C0000 E     FF1E0000 E
  FF200000 E     FF220000 E     FF240000 E     FF260000 E     FF280000 E
  FF2A0000 E     FF2C0000 E     FF2E0000 E     FF300000 E     FF320000 E
  FF340000 E     FF360000 E     FF380000 E     FF3A0000 E     FF3C0000 E
  FF3E0000 E     FF400000 E     FF420000 E     FF440000 E     FF460000 E
  FF480000 E     FF4A0000 E     FF4C0000 E     FF4E0000 E     FF500000 E
  FF520000 E     FF540000 E     FF560000 E     FF580000 E     FF5A0000 E
  FF5C0000 E     FF5E0000 E     FF600000 E     FF620000 E     FF640000 E
  FF660000 E     FF680000 E     FF6A0000 E     FF6C0000 E     FF6E0000 E
  FF700000 E     FF720000 E     FF740000 E     FF760000 E     FF780000 E
  FF7A0000 E     FF7C0000 E     FF7E0000 E     FF800000 E     FF820000 E
  FF840000 E     FF860000 E     FF880000 E     FF8A0000 E     FF8C0000 E
  FF8E0000 E     FF900000 E     FF920000 E     FF940000 E     FF960000 E
  FF980000 E     FF9A0000 E     FF9C0000 E     FF9E0000 E     FFA00000 E
  FFA20000 E     FFA40000 E     FFA60000 E     FFA80000 E     FFAA0000 E
  FFAC0000 E     FFAE0000 E     FFB00000 E     FFB20000 E     FFB40000 E
  FFB60000 E     FFB80000 E     FFBA0000 E     FFBC0000 E     FFBE0000 E
  FFC00000 E     FFC20000 E     FFC40000 E     FFC60000 E     FFC80000 E
  FFCA0000 E     FFCC0000 E     FFCE0000 E     FFD00000 E     FFD20000 E
  FFD40000 E     FFD60000 E     FFD80000 E     FFDA0000 E     FFDC0000 E
  FFDE0000 E     FFE00000 E     FFE20000 E     FFE40000 E     FFE60000 E
  FFE80000 E     FFEA0000 E     FFEC0000 E     FFEE0000 E     FFF00000 E
  FFF20000 E     FFF40000 E     FFF60000   RO     FFF80000   RO     FFFA0000   RO
  FFFC0000   RO     FFFE0000   RO
=>

5.9.3.3. erase - erase FLASH memory

=> help era
erase - erase FLASH memory

Usage:
erase start end
    - erase FLASH from addr 'start' to addr 'end'
erase start +len
    - erase FLASH from addr 'start' to the end of sect w/addr 'start'+'len'-1
erase N:SF[-SL]
    - erase sectors SF-SL in FLASH bank # N
erase bank N
    - erase FLASH bank # N
erase all
    - erase all FLASH banks
=>

The erase command (short: era) is used to erase the contents of one or more sectors of the flash memory. It is one of the more complex commands; the help output shows this.

Probably the most frequent usage of this command is to pass the start and end addresses of the area to be erased:

=> era 0xFF900000 0xFF95FFFF

... done
Erased 3 sectors
=>

ALERT! Note that both the start and end addresses for this command must point exactly at the start resp. end addresses of flash sectors. Otherwise the command will not be executed.

Another way to select certain areas of the flash memory for the erase command uses the notation of flash banks and sectors:

Technically speaking, a bank is an area of memory implemented by one or more memory chips that are connected to the same chip select signal of the CPU, and a flash sector or erase unit is the smallest area that can be erased in one operation.

For practical purposes it is sufficient to remember that with flash memory a bank is something that eventually may be erased as a whole in a single operation. This may be more efficient (faster) than erasing the same area sector by sector.

[It depends on the actual type of flash chips used on the board if such a fast bank erase algorithm exists, and on the implementation of the flash device driver if is actually used.]

In U-Boot, flash banks are numbered starting with 1, while flash sectors start with 0.

To erase the same flash area as specified using start and end addresses in the example above you could also type:

=> era 1:455-456
Erase Flash Sectors 455-456 in Bank # 1
.. done
=>

To erase a whole bank of flash memory you can use a command like this one:

=> era bank 1
Erase Flash Bank # 1 - Warning: 5 protected sectors will not be erased!
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... done
=>

ALERT! Note that a warning message is printed because some write protected sectors exist in this flash bank which were not erased.

With the command:

=> era all
Erase Flash Bank # 1 - Warning: 5 protected sectors will not be erased!
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... done
=>

the whole flash memory (except for the write-protected sectors) can be erased.

5.9.3.4. protect - enable or disable FLASH write protection

=> help protect
protect - enable or disable FLASH write protection

Usage:
protect on  start end
    - protect FLASH from addr 'start' to addr 'end'
protect on start +len
    - protect FLASH from addr 'start' to end of sect w/addr 'start'+'len'-1
protect on  N:SF[-SL]
    - protect sectors SF-SL in FLASH bank # N
protect on  bank N
    - protect FLASH bank # N
protect on  all
    - protect all FLASH banks
protect off start end
    - make FLASH from addr 'start' to addr 'end' writable
protect off start +len
    - make FLASH from addr 'start' to end of sect w/addr 'start'+'len'-1 wrtable
protect off N:SF[-SL]
    - make sectors SF-SL writable in FLASH bank # N
protect off bank N
    - make FLASH bank # N writable
protect off all
    - make all FLASH banks writable
=>

The protect command is another complex one. It is used to set certain parts of the flash memory to read-only mode or to make them writable again. Flash memory that is "protected" (= read-only) cannot be written (with the cp command) or erased (with the erase command). Protected areas are marked as (RO) (for "read-only") in the output of the flinfo command:

=> fli

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 64 MB in 512 Sectors
  AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x227E
  Erase timeout: 16384 ms, write timeout: 2 ms
  Buffer write timeout: 5 ms, buffer size: 32 bytes

  Sector Start Addresses:
  FC000000 E     FC020000 E     FC040000 E     FC060000 E     FC080000 E
  FC0A0000 E     FC0C0000 E     FC0E0000 E     FC100000 E     FC120000 E
  FC140000 E     FC160000 E     FC180000 E     FC1A0000 E     FC1C0000 E
  FC1E0000 E     FC200000 E     FC220000 E     FC240000 E     FC260000 E
  FC280000 E     FC2A0000 E     FC2C0000 E     FC2E0000 E     FC300000 E
  FC320000 E     FC340000 E     FC360000 E     FC380000 E     FC3A0000 E
  FC3C0000 E     FC3E0000 E     FC400000 E     FC420000 E     FC440000 E
  FC460000 E     FC480000 E     FC4A0000 E     FC4C0000 E     FC4E0000 E
  FC500000 E     FC520000 E     FC540000 E     FC560000 E     FC580000 E
  FC5A0000 E     FC5C0000 E     FC5E0000 E     FC600000 E     FC620000 E
  FC640000 E     FC660000 E     FC680000 E     FC6A0000 E     FC6C0000 E
  FC6E0000 E     FC700000 E     FC720000 E     FC740000 E     FC760000 E
  FC780000 E     FC7A0000 E     FC7C0000 E     FC7E0000 E     FC800000 E
  FC820000 E     FC840000 E     FC860000 E     FC880000 E     FC8A0000 E
  FC8C0000 E     FC8E0000 E     FC900000 E     FC920000 E     FC940000 E
  FC960000 E     FC980000 E     FC9A0000 E     FC9C0000 E     FC9E0000 E
  FCA00000 E     FCA20000 E     FCA40000 E     FCA60000 E     FCA80000 E
  FCAA0000 E     FCAC0000 E     FCAE0000 E     FCB00000 E     FCB20000 E
  FCB40000 E     FCB60000 E     FCB80000 E     FCBA0000 E     FCBC0000 E
  FCBE0000 E     FCC00000 E     FCC20000 E     FCC40000 E     FCC60000 E
  FCC80000 E     FCCA0000 E     FCCC0000 E     FCCE0000 E     FCD00000 E
  FCD20000 E     FCD40000 E     FCD60000 E     FCD80000 E     FCDA0000 E
  FCDC0000 E     FCDE0000 E     FCE00000 E     FCE20000 E     FCE40000 E
  FCE60000 E     FCE80000 E     FCEA0000 E     FCEC0000 E     FCEE0000 E
  FCF00000 E     FCF20000 E     FCF40000 E     FCF60000 E     FCF80000 E
  FCFA0000 E     FCFC0000 E     FCFE0000 E     FD000000 E     FD020000 E
  FD040000 E     FD060000 E     FD080000 E     FD0A0000 E     FD0C0000 E
  FD0E0000 E     FD100000 E     FD120000 E     FD140000 E     FD160000 E
  FD180000 E     FD1A0000 E     FD1C0000 E     FD1E0000 E     FD200000 E
  FD220000 E     FD240000 E     FD260000 E     FD280000 E     FD2A0000 E
  FD2C0000 E     FD2E0000 E     FD300000 E     FD320000 E     FD340000 E
  FD360000 E     FD380000 E     FD3A0000 E     FD3C0000 E     FD3E0000 E
  FD400000 E     FD420000 E     FD440000 E     FD460000 E     FD480000 E
  FD4A0000 E     FD4C0000 E     FD4E0000 E     FD500000 E     FD520000 E
  FD540000 E     FD560000 E     FD580000 E     FD5A0000 E     FD5C0000 E
  FD5E0000 E     FD600000 E     FD620000 E     FD640000 E     FD660000 E
  FD680000 E     FD6A0000 E     FD6C0000 E     FD6E0000 E     FD700000 E
  FD720000 E     FD740000 E     FD760000 E     FD780000 E     FD7A0000 E
  FD7C0000 E     FD7E0000 E     FD800000 E     FD820000 E     FD840000 E
  FD860000 E     FD880000 E     FD8A0000 E     FD8C0000 E     FD8E0000 E
  FD900000 E     FD920000 E     FD940000 E     FD960000 E     FD980000 E
  FD9A0000 E     FD9C0000 E     FD9E0000 E     FDA00000 E     FDA20000 E
  FDA40000 E     FDA60000 E     FDA80000 E     FDAA0000 E     FDAC0000 E
  FDAE0000 E     FDB00000 E     FDB20000 E     FDB40000 E     FDB60000 E
  FDB80000 E     FDBA0000 E     FDBC0000 E     FDBE0000 E     FDC00000 E
  FDC20000 E     FDC40000 E     FDC60000 E     FDC80000 E     FDCA0000 E
  FDCC0000 E     FDCE0000 E     FDD00000 E     FDD20000 E     FDD40000 E
  FDD60000 E     FDD80000 E     FDDA0000 E     FDDC0000 E     FDDE0000 E
  FDE00000 E     FDE20000 E     FDE40000 E     FDE60000 E     FDE80000 E
  FDEA0000 E     FDEC0000 E     FDEE0000 E     FDF00000 E     FDF20000 E
  FDF40000 E     FDF60000 E     FDF80000 E     FDFA0000 E     FDFC0000 E
  FDFE0000 E     FE000000 E     FE020000 E     FE040000 E     FE060000 E
  FE080000 E     FE0A0000 E     FE0C0000 E     FE0E0000 E     FE100000 E
  FE120000 E     FE140000 E     FE160000 E     FE180000 E     FE1A0000 E
  FE1C0000 E     FE1E0000 E     FE200000 E     FE220000 E     FE240000 E
  FE260000 E     FE280000 E     FE2A0000 E     FE2C0000 E     FE2E0000 E
  FE300000 E     FE320000 E     FE340000 E     FE360000 E     FE380000 E
  FE3A0000 E     FE3C0000 E     FE3E0000 E     FE400000 E     FE420000 E
  FE440000 E     FE460000 E     FE480000 E     FE4A0000 E     FE4C0000 E
  FE4E0000 E     FE500000 E     FE520000 E     FE540000 E     FE560000 E
  FE580000 E     FE5A0000 E     FE5C0000 E     FE5E0000 E     FE600000 E
  FE620000 E     FE640000 E     FE660000 E     FE680000 E     FE6A0000 E
  FE6C0000 E     FE6E0000 E     FE700000 E     FE720000 E     FE740000 E
  FE760000 E     FE780000 E     FE7A0000 E     FE7C0000 E     FE7E0000 E
  FE800000 E     FE820000 E     FE840000 E     FE860000 E     FE880000 E
  FE8A0000 E     FE8C0000 E     FE8E0000 E     FE900000 E     FE920000 E
  FE940000 E     FE960000 E     FE980000 E     FE9A0000 E     FE9C0000 E
  FE9E0000 E     FEA00000 E     FEA20000 E     FEA40000 E     FEA60000 E
  FEA80000 E     FEAA0000 E     FEAC0000 E     FEAE0000 E     FEB00000 E
  FEB20000 E     FEB40000 E     FEB60000 E     FEB80000 E     FEBA0000 E
  FEBC0000 E     FEBE0000 E     FEC00000 E     FEC20000 E     FEC40000 E
  FEC60000 E     FEC80000 E     FECA0000 E     FECC0000 E     FECE0000 E
  FED00000 E     FED20000 E     FED40000 E     FED60000 E     FED80000 E
  FEDA0000 E     FEDC0000 E     FEDE0000 E     FEE00000 E     FEE20000 E
  FEE40000 E     FEE60000 E     FEE80000 E     FEEA0000 E     FEEC0000 E
  FEEE0000 E     FEF00000 E     FEF20000 E     FEF40000 E     FEF60000 E
  FEF80000 E     FEFA0000 E     FEFC0000 E     FEFE0000 E     FF000000 E
  FF020000 E     FF040000 E     FF060000 E     FF080000 E     FF0A0000 E
  FF0C0000 E     FF0E0000 E     FF100000 E     FF120000 E     FF140000 E
  FF160000 E     FF180000 E     FF1A0000 E     FF1C0000 E     FF1E0000 E
  FF200000 E     FF220000 E     FF240000 E     FF260000 E     FF280000 E
  FF2A0000 E     FF2C0000 E     FF2E0000 E     FF300000 E     FF320000 E
  FF340000 E     FF360000 E     FF380000 E     FF3A0000 E     FF3C0000 E
  FF3E0000 E     FF400000 E     FF420000 E     FF440000 E     FF460000 E
  FF480000 E     FF4A0000 E     FF4C0000 E     FF4E0000 E     FF500000 E
  FF520000 E     FF540000 E     FF560000 E     FF580000 E     FF5A0000 E
  FF5C0000 E     FF5E0000 E     FF600000 E     FF620000 E     FF640000 E
  FF660000 E     FF680000 E     FF6A0000 E     FF6C0000 E     FF6E0000 E
  FF700000 E     FF720000 E     FF740000 E     FF760000 E     FF780000 E
  FF7A0000 E     FF7C0000 E     FF7E0000 E     FF800000 E     FF820000 E
  FF840000 E     FF860000 E     FF880000 E     FF8A0000 E     FF8C0000 E
  FF8E0000 E     FF900000 E     FF920000 E     FF940000 E     FF960000 E
  FF980000 E     FF9A0000 E     FF9C0000 E     FF9E0000 E     FFA00000 E
  FFA20000 E     FFA40000 E     FFA60000 E     FFA80000 E     FFAA0000 E
  FFAC0000 E     FFAE0000 E     FFB00000 E     FFB20000 E     FFB40000 E
  FFB60000 E     FFB80000 E     FFBA0000 E     FFBC0000 E     FFBE0000 E
  FFC00000 E     FFC20000 E     FFC40000 E     FFC60000 E     FFC80000 E
  FFCA0000 E     FFCC0000 E     FFCE0000 E     FFD00000 E     FFD20000 E
  FFD40000 E     FFD60000 E     FFD80000 E     FFDA0000 E     FFDC0000 E
  FFDE0000 E     FFE00000 E     FFE20000 E     FFE40000 E     FFE60000 E
  FFE80000 E     FFEA0000 E     FFEC0000 E     FFEE0000 E     FFF00000 E
  FFF20000 E     FFF40000 E     FFF60000   RO     FFF80000   RO     FFFA0000   RO
  FFFC0000   RO     FFFE0000   RO
=> prot on 0xFF900000 0xFF97FFFF
Protected 4 sectors
=> fli

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 64 MB in 512 Sectors
  AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x227E
  Erase timeout: 16384 ms, write timeout: 2 ms
  Buffer write timeout: 5 ms, buffer size: 32 bytes

  Sector Start Addresses:
  FC000000 E     FC020000 E     FC040000 E     FC060000 E     FC080000 E
  FC0A0000 E     FC0C0000 E     FC0E0000 E     FC100000 E     FC120000 E
  FC140000 E     FC160000 E     FC180000 E     FC1A0000 E     FC1C0000 E
  FC1E0000 E     FC200000 E     FC220000 E     FC240000 E     FC260000 E
  FC280000 E     FC2A0000 E     FC2C0000 E     FC2E0000 E     FC300000 E
  FC320000 E     FC340000 E     FC360000 E     FC380000 E     FC3A0000 E
  FC3C0000 E     FC3E0000 E     FC400000 E     FC420000 E     FC440000 E
  FC460000 E     FC480000 E     FC4A0000 E     FC4C0000 E     FC4E0000 E
  FC500000 E     FC520000 E     FC540000 E     FC560000 E     FC580000 E
  FC5A0000 E     FC5C0000 E     FC5E0000 E     FC600000 E     FC620000 E
  FC640000 E     FC660000 E     FC680000 E     FC6A0000 E     FC6C0000 E
  FC6E0000 E     FC700000 E     FC720000 E     FC740000 E     FC760000 E
  FC780000 E     FC7A0000 E     FC7C0000 E     FC7E0000 E     FC800000 E
  FC820000 E     FC840000 E     FC860000 E     FC880000 E     FC8A0000 E
  FC8C0000 E     FC8E0000 E     FC900000 E     FC920000 E     FC940000 E
  FC960000 E     FC980000 E     FC9A0000 E     FC9C0000 E     FC9E0000 E
  FCA00000 E     FCA20000 E     FCA40000 E     FCA60000 E     FCA80000 E
  FCAA0000 E     FCAC0000 E     FCAE0000 E     FCB00000 E     FCB20000 E
  FCB40000 E     FCB60000 E     FCB80000 E     FCBA0000 E     FCBC0000 E
  FCBE0000 E     FCC00000 E     FCC20000 E     FCC40000 E     FCC60000 E
  FCC80000 E     FCCA0000 E     FCCC0000 E     FCCE0000 E     FCD00000 E
  FCD20000 E     FCD40000 E     FCD60000 E     FCD80000 E     FCDA0000 E
  FCDC0000 E     FCDE0000 E     FCE00000 E     FCE20000 E     FCE40000 E
  FCE60000 E     FCE80000 E     FCEA0000 E     FCEC0000 E     FCEE0000 E
  FCF00000 E     FCF20000 E     FCF40000 E     FCF60000 E     FCF80000 E
  FCFA0000 E     FCFC0000 E     FCFE0000 E     FD000000 E     FD020000 E
  FD040000 E     FD060000 E     FD080000 E     FD0A0000 E     FD0C0000 E
  FD0E0000 E     FD100000 E     FD120000 E     FD140000 E     FD160000 E
  FD180000 E     FD1A0000 E     FD1C0000 E     FD1E0000 E     FD200000 E
  FD220000 E     FD240000 E     FD260000 E     FD280000 E     FD2A0000 E
  FD2C0000 E     FD2E0000 E     FD300000 E     FD320000 E     FD340000 E
  FD360000 E     FD380000 E     FD3A0000 E     FD3C0000 E     FD3E0000 E
  FD400000 E     FD420000 E     FD440000 E     FD460000 E     FD480000 E
  FD4A0000 E     FD4C0000 E     FD4E0000 E     FD500000 E     FD520000 E
  FD540000 E     FD560000 E     FD580000 E     FD5A0000 E     FD5C0000 E
  FD5E0000 E     FD600000 E     FD620000 E     FD640000 E     FD660000 E
  FD680000 E     FD6A0000 E     FD6C0000 E     FD6E0000 E     FD700000 E
  FD720000 E     FD740000 E     FD760000 E     FD780000 E     FD7A0000 E
  FD7C0000 E     FD7E0000 E     FD800000 E     FD820000 E     FD840000 E
  FD860000 E     FD880000 E     FD8A0000 E     FD8C0000 E     FD8E0000 E
  FD900000 E     FD920000 E     FD940000 E     FD960000 E     FD980000 E
  FD9A0000 E     FD9C0000 E     FD9E0000 E     FDA00000 E     FDA20000 E
  FDA40000 E     FDA60000 E     FDA80000 E     FDAA0000 E     FDAC0000 E
  FDAE0000 E     FDB00000 E     FDB20000 E     FDB40000 E     FDB60000 E
  FDB80000 E     FDBA0000 E     FDBC0000 E     FDBE0000 E     FDC00000 E
  FDC20000 E     FDC40000 E     FDC60000 E     FDC80000 E     FDCA0000 E
  FDCC0000 E     FDCE0000 E     FDD00000 E     FDD20000 E     FDD40000 E
  FDD60000 E     FDD80000 E     FDDA0000 E     FDDC0000 E     FDDE0000 E
  FDE00000 E     FDE20000 E     FDE40000 E     FDE60000 E     FDE80000 E
  FDEA0000 E     FDEC0000 E     FDEE0000 E     FDF00000 E     FDF20000 E
  FDF40000 E     FDF60000 E     FDF80000 E     FDFA0000 E     FDFC0000 E
  FDFE0000 E     FE000000 E     FE020000 E     FE040000 E     FE060000 E
  FE080000 E     FE0A0000 E     FE0C0000 E     FE0E0000 E     FE100000 E
  FE120000 E     FE140000 E     FE160000 E     FE180000 E     FE1A0000 E
  FE1C0000 E     FE1E0000 E     FE200000 E     FE220000 E     FE240000 E
  FE260000 E     FE280000 E     FE2A0000 E     FE2C0000 E     FE2E0000 E
  FE300000 E     FE320000 E     FE340000 E     FE360000 E     FE380000 E
  FE3A0000 E     FE3C0000 E     FE3E0000 E     FE400000 E     FE420000 E
  FE440000 E     FE460000 E     FE480000 E     FE4A0000 E     FE4C0000 E
  FE4E0000 E     FE500000 E     FE520000 E     FE540000 E     FE560000 E
  FE580000 E     FE5A0000 E     FE5C0000 E     FE5E0000 E     FE600000 E
  FE620000 E     FE640000 E     FE660000 E     FE680000 E     FE6A0000 E
  FE6C0000 E     FE6E0000 E     FE700000 E     FE720000 E     FE740000 E
  FE760000 E     FE780000 E     FE7A0000 E     FE7C0000 E     FE7E0000 E
  FE800000 E     FE820000 E     FE840000 E     FE860000 E     FE880000 E
  FE8A0000 E     FE8C0000 E     FE8E0000 E     FE900000 E     FE920000 E
  FE940000 E     FE960000 E     FE980000 E     FE9A0000 E     FE9C0000 E
  FE9E0000 E     FEA00000 E     FEA20000 E     FEA40000 E     FEA60000 E
  FEA80000 E     FEAA0000 E     FEAC0000 E     FEAE0000 E     FEB00000 E
  FEB20000 E     FEB40000 E     FEB60000 E     FEB80000 E     FEBA0000 E
  FEBC0000 E     FEBE0000 E     FEC00000 E     FEC20000 E     FEC40000 E
  FEC60000 E     FEC80000 E     FECA0000 E     FECC0000 E     FECE0000 E
  FED00000 E     FED20000 E     FED40000 E     FED60000 E     FED80000 E
  FEDA0000 E     FEDC0000 E     FEDE0000 E     FEE00000 E     FEE20000 E
  FEE40000 E     FEE60000 E     FEE80000 E     FEEA0000 E     FEEC0000 E
  FEEE0000 E     FEF00000 E     FEF20000 E     FEF40000 E     FEF60000 E
  FEF80000 E     FEFA0000 E     FEFC0000 E     FEFE0000 E     FF000000 E
  FF020000 E     FF040000 E     FF060000 E     FF080000 E     FF0A0000 E
  FF0C0000 E     FF0E0000 E     FF100000 E     FF120000 E     FF140000 E
  FF160000 E     FF180000 E     FF1A0000 E     FF1C0000 E     FF1E0000 E
  FF200000 E     FF220000 E     FF240000 E     FF260000 E     FF280000 E
  FF2A0000 E     FF2C0000 E     FF2E0000 E     FF300000 E     FF320000 E
  FF340000 E     FF360000 E     FF380000 E     FF3A0000 E     FF3C0000 E
  FF3E0000 E     FF400000 E     FF420000 E     FF440000 E     FF460000 E
  FF480000 E     FF4A0000 E     FF4C0000 E     FF4E0000 E     FF500000 E
  FF520000 E     FF540000 E     FF560000 E     FF580000 E     FF5A0000 E
  FF5C0000 E     FF5E0000 E     FF600000 E     FF620000 E     FF640000 E
  FF660000 E     FF680000 E     FF6A0000 E     FF6C0000 E     FF6E0000 E
  FF700000 E     FF720000 E     FF740000 E     FF760000 E     FF780000 E
  FF7A0000 E     FF7C0000 E     FF7E0000 E     FF800000 E     FF820000 E
  FF840000 E     FF860000 E     FF880000 E     FF8A0000 E     FF8C0000 E
  FF8E0000 E     FF900000 E RO     FF920000 E RO     FF940000 E RO     FF960000 E RO
  FF980000 E     FF9A0000 E     FF9C0000 E     FF9E0000 E     FFA00000 E
  FFA20000 E     FFA40000 E     FFA60000 E     FFA80000 E     FFAA0000 E
  FFAC0000 E     FFAE0000 E     FFB00000 E     FFB20000 E     FFB40000 E
  FFB60000 E     FFB80000 E     FFBA0000 E     FFBC0000 E     FFBE0000 E
  FFC00000 E     FFC20000 E     FFC40000 E     FFC60000 E     FFC80000 E
  FFCA0000 E     FFCC0000 E     FFCE0000 E     FFD00000 E     FFD20000 E
  FFD40000 E     FFD60000 E     FFD80000 E     FFDA0000 E     FFDC0000 E
  FFDE0000 E     FFE00000 E     FFE20000 E     FFE40000 E     FFE60000 E
  FFE80000 E     FFEA0000 E     FFEC0000 E     FFEE0000 E     FFF00000 E
  FFF20000 E     FFF40000 E     FFF60000   RO     FFF80000   RO     FFFA0000   RO
  FFFC0000   RO     FFFE0000   RO
=> era 0xFF900000 0xFF97FFFF
- Warning: 4 protected sectors will not be erased!
 done
Erased 4 sectors
=> prot off 1:455
Un-Protect Flash Sectors 455-455 in Bank # 1
=> fli

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 64 MB in 512 Sectors
  AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x227E
  Erase timeout: 16384 ms, write timeout: 2 ms
  Buffer write timeout: 5 ms, buffer size: 32 bytes

  Sector Start Addresses:
  FC000000 E     FC020000 E     FC040000 E     FC060000 E     FC080000 E
  FC0A0000 E     FC0C0000 E     FC0E0000 E     FC100000 E     FC120000 E
  FC140000 E     FC160000 E     FC180000 E     FC1A0000 E     FC1C0000 E
  FC1E0000 E     FC200000 E     FC220000 E     FC240000 E     FC260000 E
  FC280000 E     FC2A0000 E     FC2C0000 E     FC2E0000 E     FC300000 E
  FC320000 E     FC340000 E     FC360000 E     FC380000 E     FC3A0000 E
  FC3C0000 E     FC3E0000 E     FC400000 E     FC420000 E     FC440000 E
  FC460000 E     FC480000 E     FC4A0000 E     FC4C0000 E     FC4E0000 E
  FC500000 E     FC520000 E     FC540000 E     FC560000 E     FC580000 E
  FC5A0000 E     FC5C0000 E     FC5E0000 E     FC600000 E     FC620000 E
  FC640000 E     FC660000 E     FC680000 E     FC6A0000 E     FC6C0000 E
  FC6E0000 E     FC700000 E     FC720000 E     FC740000 E     FC760000 E
  FC780000 E     FC7A0000 E     FC7C0000 E     FC7E0000 E     FC800000 E
  FC820000 E     FC840000 E     FC860000 E     FC880000 E     FC8A0000 E
  FC8C0000 E     FC8E0000 E     FC900000 E     FC920000 E     FC940000 E
  FC960000 E     FC980000 E     FC9A0000 E     FC9C0000 E     FC9E0000 E
  FCA00000 E     FCA20000 E     FCA40000 E     FCA60000 E     FCA80000 E
  FCAA0000 E     FCAC0000 E     FCAE0000 E     FCB00000 E     FCB20000 E
  FCB40000 E     FCB60000 E     FCB80000 E     FCBA0000 E     FCBC0000 E
  FCBE0000 E     FCC00000 E     FCC20000 E     FCC40000 E     FCC60000 E
  FCC80000 E     FCCA0000 E     FCCC0000 E     FCCE0000 E     FCD00000 E
  FCD20000 E     FCD40000 E     FCD60000 E     FCD80000 E     FCDA0000 E
  FCDC0000 E     FCDE0000 E     FCE00000 E     FCE20000 E     FCE40000 E
  FCE60000 E     FCE80000 E     FCEA0000 E     FCEC0000 E     FCEE0000 E
  FCF00000 E     FCF20000 E     FCF40000 E     FCF60000 E     FCF80000 E
  FCFA0000 E     FCFC0000 E     FCFE0000 E     FD000000 E     FD020000 E
  FD040000 E     FD060000 E     FD080000 E     FD0A0000 E     FD0C0000 E
  FD0E0000 E     FD100000 E     FD120000 E     FD140000 E     FD160000 E
  FD180000 E     FD1A0000 E     FD1C0000 E     FD1E0000 E     FD200000 E
  FD220000 E     FD240000 E     FD260000 E     FD280000 E     FD2A0000 E
  FD2C0000 E     FD2E0000 E     FD300000 E     FD320000 E     FD340000 E
  FD360000 E     FD380000 E     FD3A0000 E     FD3C0000 E     FD3E0000 E
  FD400000 E     FD420000 E     FD440000 E     FD460000 E     FD480000 E
  FD4A0000 E     FD4C0000 E     FD4E0000 E     FD500000 E     FD520000 E
  FD540000 E     FD560000 E     FD580000 E     FD5A0000 E     FD5C0000 E
  FD5E0000 E     FD600000 E     FD620000 E     FD640000 E     FD660000 E
  FD680000 E     FD6A0000 E     FD6C0000 E     FD6E0000 E     FD700000 E
  FD720000 E     FD740000 E     FD760000 E     FD780000 E     FD7A0000 E
  FD7C0000 E     FD7E0000 E     FD800000 E     FD820000 E     FD840000 E
  FD860000 E     FD880000 E     FD8A0000 E     FD8C0000 E     FD8E0000 E
  FD900000 E     FD920000 E     FD940000 E     FD960000 E     FD980000 E
  FD9A0000 E     FD9C0000 E     FD9E0000 E     FDA00000 E     FDA20000 E
  FDA40000 E     FDA60000 E     FDA80000 E     FDAA0000 E     FDAC0000 E
  FDAE0000 E     FDB00000 E     FDB20000 E     FDB40000 E     FDB60000 E
  FDB80000 E     FDBA0000 E     FDBC0000 E     FDBE0000 E     FDC00000 E
  FDC20000 E     FDC40000 E     FDC60000 E     FDC80000 E     FDCA0000 E
  FDCC0000 E     FDCE0000 E     FDD00000 E     FDD20000 E     FDD40000 E
  FDD60000 E     FDD80000 E     FDDA0000 E     FDDC0000 E     FDDE0000 E
  FDE00000 E     FDE20000 E     FDE40000 E     FDE60000 E     FDE80000 E
  FDEA0000 E     FDEC0000 E     FDEE0000 E     FDF00000 E     FDF20000 E
  FDF40000 E     FDF60000 E     FDF80000 E     FDFA0000 E     FDFC0000 E
  FDFE0000 E     FE000000 E     FE020000 E     FE040000 E     FE060000 E
  FE080000 E     FE0A0000 E     FE0C0000 E     FE0E0000 E     FE100000 E
  FE120000 E     FE140000 E     FE160000 E     FE180000 E     FE1A0000 E
  FE1C0000 E     FE1E0000 E     FE200000 E     FE220000 E     FE240000 E
  FE260000 E     FE280000 E     FE2A0000 E     FE2C0000 E     FE2E0000 E
  FE300000 E     FE320000 E     FE340000 E     FE360000 E     FE380000 E
  FE3A0000 E     FE3C0000 E     FE3E0000 E     FE400000 E     FE420000 E
  FE440000 E     FE460000 E     FE480000 E     FE4A0000 E     FE4C0000 E
  FE4E0000 E     FE500000 E     FE520000 E     FE540000 E     FE560000 E
  FE580000 E     FE5A0000 E     FE5C0000 E     FE5E0000 E     FE600000 E
  FE620000 E     FE640000 E     FE660000 E     FE680000 E     FE6A0000 E
  FE6C0000 E     FE6E0000 E     FE700000 E     FE720000 E     FE740000 E
  FE760000 E     FE780000 E     FE7A0000 E     FE7C0000 E     FE7E0000 E
  FE800000 E     FE820000 E     FE840000 E     FE860000 E     FE880000 E
  FE8A0000 E     FE8C0000 E     FE8E0000 E     FE900000 E     FE920000 E
  FE940000 E     FE960000 E     FE980000 E     FE9A0000 E     FE9C0000 E
  FE9E0000 E     FEA00000 E     FEA20000 E     FEA40000 E     FEA60000 E
  FEA80000 E     FEAA0000 E     FEAC0000 E     FEAE0000 E     FEB00000 E
  FEB20000 E     FEB40000 E     FEB60000 E     FEB80000 E     FEBA0000 E
  FEBC0000 E     FEBE0000 E     FEC00000 E     FEC20000 E     FEC40000 E
  FEC60000 E     FEC80000 E     FECA0000 E     FECC0000 E     FECE0000 E
  FED00000 E     FED20000 E     FED40000 E     FED60000 E     FED80000 E
  FEDA0000 E     FEDC0000 E     FEDE0000 E     FEE00000 E     FEE20000 E
  FEE40000 E     FEE60000 E     FEE80000 E     FEEA0000 E     FEEC0000 E
  FEEE0000 E     FEF00000 E     FEF20000 E     FEF40000 E     FEF60000 E
  FEF80000 E     FEFA0000 E     FEFC0000 E     FEFE0000 E     FF000000 E
  FF020000 E     FF040000 E     FF060000 E     FF080000 E     FF0A0000 E
  FF0C0000 E     FF0E0000 E     FF100000 E     FF120000 E     FF140000 E
  FF160000 E     FF180000 E     FF1A0000 E     FF1C0000 E     FF1E0000 E
  FF200000 E     FF220000 E     FF240000 E     FF260000 E     FF280000 E
  FF2A0000 E     FF2C0000 E     FF2E0000 E     FF300000 E     FF320000 E
  FF340000 E     FF360000 E     FF380000 E     FF3A0000 E     FF3C0000 E
  FF3E0000 E     FF400000 E     FF420000 E     FF440000 E     FF460000 E
  FF480000 E     FF4A0000 E     FF4C0000 E     FF4E0000 E     FF500000 E
  FF520000 E     FF540000 E     FF560000 E     FF580000 E     FF5A0000 E
  FF5C0000 E     FF5E0000 E     FF600000 E     FF620000 E     FF640000 E
  FF660000 E     FF680000 E     FF6A0000 E     FF6C0000 E     FF6E0000 E
  FF700000 E     FF720000 E     FF740000 E     FF760000 E     FF780000 E
  FF7A0000 E     FF7C0000 E     FF7E0000 E     FF800000 E     FF820000 E
  FF840000 E     FF860000 E     FF880000 E     FF8A0000 E     FF8C0000 E
  FF8E0000 E     FF900000 E RO     FF920000 E RO     FF940000 E RO     FF960000 E RO
  FF980000 E     FF9A0000 E     FF9C0000 E     FF9E0000 E     FFA00000 E
  FFA20000 E     FFA40000 E     FFA60000 E     FFA80000 E     FFAA0000 E
  FFAC0000 E     FFAE0000 E     FFB00000 E     FFB20000 E     FFB40000 E
  FFB60000 E     FFB80000 E     FFBA0000 E     FFBC0000 E     FFBE0000 E
  FFC00000 E     FFC20000 E     FFC40000 E     FFC60000 E     FFC80000 E
  FFCA0000 E     FFCC0000 E     FFCE0000 E     FFD00000 E     FFD20000 E
  FFD40000 E     FFD60000 E     FFD80000 E     FFDA0000 E     FFDC0000 E
  FFDE0000 E     FFE00000 E     FFE20000 E     FFE40000 E     FFE60000 E
  FFE80000 E     FFEA0000 E     FFEC0000 E     FFEE0000 E     FFF00000 E
  FFF20000 E     FFF40000 E     FFF60000   RO     FFF80000   RO     FFFA0000   RO
  FFFC0000   RO     FFFE0000   RO
=> era 1:455
Erase Flash Sectors 455-455 in Bank # 1
. done
=>

ALERT! The actual level of protection depends on the flash chips used on your hardware, and on the implementation of the flash device driver for this board. In most cases U-Boot provides just a simple software-protection, i. e. it prevents you from erasing or overwriting important stuff by accident (like the U-Boot code itself or U-Boot's environment variables), but it cannot prevent you from circumventing these restrictions - a nasty user who is loading and running his own flash driver code cannot and will not be stopped by this mechanism. Also, in most cases this protection is only effective while running U-Boot, i. e. any operating system will not know about "protected" flash areas and will happily erase these if requested to do so.

5.9.3.5. mtdparts - define a Linux compatible MTD partition scheme

U-Boot implements two different approaches to define a MTD partition scheme that can be shared easily with the linux kernel.

The first one is to define a single, static partition in your board config file, for example:

#undef CONFIG_JFFS2_CMDLINE
#define CONFIG_JFFS2_DEV               "nor0"
#define CONFIG_JFFS2_PART_SIZE         0xFFFFFFFF     /* use whole device */
#define CONFIG_JFFS2_PART_SIZE         0x00100000     /* use 1MB */
#define CONFIG_JFFS2_PART_OFFSET       0x00000000
The second method uses the Linux kernel's mtdparts command line option and dynamic partitioning:
#define CONFIG_JFFS2_CMDLINE
#define MTDIDS_DEFAULT      "nor1=zuma-1,nor2=zuma-2"
#define MTDPARTS_DEFAULT   "mtdparts=zuma-1:-(jffs2),zuma-2:-(user)"
Command line of course produces bigger images, and may be inappropriate for some targets, so by default it's off.

The mtdparts command offers an easy to use and powerful interface to define the contents of the environment variable of the same name that can be passed as boot argument to the Linux kernel:

=> help mtdparts
mtdparts 
    - list partition table
mtdparts delall
    - delete all partitions
mtdparts del part-id
    - delete partition (e.g. part-id = nand0,1)
mtdparts add <mtd-dev> <size>[@<offset>] [<name>] [ro]
    - add partition
mtdparts default
    - reset partition table to defaults

-----

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'<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 some target system the mtdparts command might display this information:
=> mtdparts

device nor0 <TQM5200-0>, # parts = 4
 #: name                        size            offset          mask_flags
 0: firmware            0x00100000      0x00000000      1
 1: kernel              0x00180000      0x00100000      0
 2: small-fs            0x00d80000      0x00280000      0
 3: big-fs              0x01000000      0x01000000      0

active partition: nor0,0 - (firmware) 0x00100000 @ 0x00000000

defaults:
mtdids  : nor0=TQM5200-0
mtdparts: mtdparts=TQM5200-0:1m(firmware),1536k(kernel),3584k(small-fs),2m(initrd),8m(misc),16m(big-fs)
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=TQM5200-0:1024k(firmware)ro,1536k(kernel),13824k(small-fs),16m(big-fs)
and we can see that it exactly matches the partition table printed above.

Now let's switch back to the default settings:

=> mtdparts default
=> mtdparts

device nor0 <TQM5200-0>, # parts = 6
 #: name                        size            offset          mask_flags
 0: firmware            0x00100000      0x00000000      0
 1: kernel              0x00180000      0x00100000      0
 2: small-fs            0x00380000      0x00280000      0
 3: initrd              0x00200000      0x00600000      0
 4: misc                0x00800000      0x00800000      0
 5: big-fs              0x01000000      0x01000000      0

active partition: nor0,0 - (firmware) 0x00100000 @ 0x00000000

defaults:
mtdids  : nor0=TQM5200-0
mtdparts: mtdparts=TQM5200-0:1m(firmware),1536k(kernel),3584k(small-fs),2m(initrd),8m(misc),16m(big-fs)
=> print mtdparts
mtdparts=mtdparts=TQM5200-0:1m(firmware),1536k(kernel),3584k(small-fs),2m(initrd),8m(misc),16m(big-fs)
Then we delete the last 4 partitions ("small-fs", "initrd", "misc" and "big-fs") ...
=> mtdparts del small-fs
=> mtdparts del initrd
=> mtdparts del misc  
=> mtdparts del big-fs  
=> mtdparts

device nor0 <TQM5200-0>, # parts = 2
 #: name                        size            offset          mask_flags
 0: firmware            0x00100000      0x00000000      0
 1: kernel              0x00180000      0x00100000      0

active partition: nor0,0 - (firmware) 0x00100000 @ 0x00000000

defaults:
mtdids  : nor0=TQM5200-0
mtdparts: mtdparts=TQM5200-0:1m(firmware),1536k(kernel),3584k(small-fs),2m(initrd),8m(misc),16m(big-fs)
... and combine the free space into a singe big partition:
=> mtdparts add nor0 - new-part
=> mtdparts

device nor0 <TQM5200-0>, # parts = 3
 #: name                        size            offset          mask_flags
 0: firmware            0x00100000      0x00000000      0
 1: kernel              0x00180000      0x00100000      0
 2: new-part            0x01d80000      0x00280000      0

active partition: nor0,0 - (firmware) 0x00100000 @ 0x00000000

defaults:
mtdids  : nor0=TQM5200-0
mtdparts: mtdparts=TQM5200-0:1m(firmware),1536k(kernel),3584k(small-fs),2m(initrd),8m(misc),16m(big-fs)
=> print mtdparts
mtdparts=mtdparts=TQM5200-0:1m(firmware),1536k(kernel),30208k(new-part)

5.9.2. Memory Commands 1. Abstract 5.9.4. Execution Control Commands
Prev Home Next