title: Create flexible mtd partitions
body: <p>I would like to populate partitions depend on its content. During system boot I would like to check if the flash area contain any data. If true - make it visible read-only, or rewritable.</p>
  
  <p>I would like to make it automatically, without U-boot shell...</p>
  
  <p>On Linux kernel level I can make it only statically in partition table.
  Is it possible to do it in U-boot ?</p>
  
  <p>Thank you for any hints.</p>
  
  <h3>Update: CmdLine and mtd_partition checked</h3>
  
  <p>I've checked two possibilities:
  U-boot mtd-parts</p>
  
  <pre><code>U-Boot&gt; 
  setenv mtdparts mtdparts=atmel_nand:2M@0x40000(u-boot),30M@0x200000(kernel),-@0x2000000(user),**0x20000@0x100000(u)**
  
  U-Boot&gt;
  mtdparts
  </code></pre>
  
  <p>no partitions allowed after a fill-up partition</p>
  
  <p>Unfortunately its not possible to add partition at the and of table. I would like to have mtd4 as separate partition if the data exist in <code>0x100000</code> area.</p>
  
  <p>It is possible in kernel mtd_partition table. But this table is declared in arch/arm... board file (early startup stage). On this startup stage I can not read nand. I don't have access to nand read interface provided by nand driver.</p>
  
  <h1>Update: solution</h1>
  
  <p>Thank you for all hints. Following "artless noise" hints I decided to read nand area in u-boot, and send useful parameters via different kernel command line arguments. This is very flexible. Some other HW configurations can be stored in flash and used for kernel initialization.</p>
  
  <p>Catching kernel parameters can be done via: <code>early_param()</code> function.</p>