[LEDE-DEV] [OpenWrt-Devel] How to merge/combine more than one mtd partition for storage?

Y.T. Jiang yutang.jiang at nxp.com
Thu Sep 8 19:22:00 PDT 2016


1. In general , partitions definition in dts file, you can find some example according to yours device:
grep -r partition build_dir/target-xxxxxx/linux-xxxxxx/linux-4.xxxx/arch/arm/boot/dts/


2. Or, partitions definition also can be transmit by uboot env, for example:
In u-boot prompt:
setenv bootargs root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1M(rcw),1M(u-boot),1M(u-boot-env),1M(fman),1M(dtb),5M(kernel),54M(rootfs),64M(otherbank),60M at 0x400000(firmware)

while kernel bootup, you can see following log:
...
Kernel command line: root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1M(rcw),1M(u-boot),1M(u-boot-env),1M(fman),1M(dtb),5M(kernel),54M(rootfs),64M(otherbank),60M at 0x400000(firmware)
...
60000000.nor: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000089 Chip ID 0x00227e
... 
fsl,ifc-nand 7e800000.nand: IFC NAND device at 0x7e800000, bank 1
...

Find your MTD device name("60000000.nor", "7e800000.nand") then replace it, also adjust the partitions definition argument.


3. Warning: Don't change those important partitions(uboot, kernel, etc), only adjust that you can using.


Thanks & Best Regards
Jiang Yutang

-----Original Message-----
From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org] On Behalf Of J Mo
Sent: Friday, September 09, 2016 9:15 AM
To: lede-dev at lists.infradead.org; openwrt-devel at lists.openwrt.org; openwrt-users at lists.openwrt.org
Subject: [OpenWrt-Devel] How to merge/combine more than one mtd partition for storage?


Hello!

I have a device which has a 256MB SLC NAND flash for storage. It uses a redundant pair of 64MB UBI partitions. Then it has 108MB of completely unused non-partitioned space at the end of the NAND.

I would like to combine these partitions so that I can use the combined 236MB of NAND space.

Any suggestions on how I should do that?Are there any existing examples of devices which do anything similar?



Basically I want to RAID0 these things.

One of the 64MB partitions is non-continuous with the other two. The 
other 64MB partition is right in front of the remaining 
unused/unpartitioned area, so we could just combine them in the DTS or 
similar.

Here is what the partition table actually looks like:

No.: Name             Attributes Start             Size              ;   
REAL-ORDER
   0: 0:SBL1           0x0000ffff              0x0 0x40000  256KB       
;   1
   1: 0:MIBIB          0x0000ffff          0x40000 0x140000  1.4MB       
;   2
   2: 0:SBL2           0x0000ffff         0x180000 0x140000  1.4MB       
;   3
   3: 0:SBL3           0x0000ffff         0x2c0000 0x280000  2.4MB       
;   4
   4: 0:DDRCONFIG      0x0000ffff         0x540000 0x120000  1.2MB       
;   5
   5: 0:SSD            0x0000ffff         0x660000 0x120000  1.2MB       
;   6
   6: 0:TZ             0x0000ffff         0x780000 0x280000  2.4MB       
;   7
   7: 0:RPM            0x0000ffff         0xa00000 0x280000  2.4MB       
;   8
   8: 0:APPSBL         0x0000ffff        0x53a0000 0x500000  5.2MB       
;   14
   9: 0:APPSBLENV      0x0000ffff        0x1180000 0x80000  512KB       
;   10
  10: 0:ART            0x0000ffff        0x1200000 0x140000  1.4MB       
;   11
  11: rootfs           0x0000ffff        0x58a0000 0x4000000  
65MB        ;   15
  12: 0:BOOTCONFIG     0x0000ffff        0x5340000 0x60000  393KB       
;   13
  13: 0:APPSBL_1       0x0000ffff         0xc80000 0x500000  5.2MB       
;   9
  14: rootfs_1         0x0000ffff        0x1340000 0x4000000  
65MB        ;   12

0x98a0000 to 0xfffffff is apparently unused


APPSBL = u-boot. BOOTCONFIG is very important and can not be moved.
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the Lede-dev mailing list