[U-Boot] MTD combine/merge flash bank like linux : MPC83xx / u-boot	v2016.03
    asebt69 
    asebt69 at gmail.com
       
    Wed Oct 31 11:16:52 UTC 2018
    
    
  
Dear,
I've got a flash split into 2 bank of 32 Mb. From linux view there is only
one flash with a size of 64 Mb (define in the DTS).
My goal, do the same thing with u-boot to read a ubi file with a size > 32
Mb which contains my uImage, but mtdparts still to see 2 flash device and i
can"t open the ubi file.
Linux MTD partitions are :
 4 cmdlinepart partitions found on MTD device fc000000.flash
Creating 4 MTD partitions on "fc000000.flash":
0x000000000000-0x000000100000 : "Primary"
0x000000100000-0x000000180000 : " uboot"
0x000000180000-0x0000001a0000 : "uboot_var"
*0x0000001a0000-0x000004000000* : "rfs"
u-boot config :
MTD :
#define MTDIDS_DEFAULT      "nor0=fc000000.flash,nor1=fe000000.flash"
#define MTDPARTS_DEFAULT
"mtdparts=fc000000.flash:0x100000(Primary)ro,0x080000(uboot
)ro,0x020000( uboot_var),-(RFS)"
CFI config :
#define CONFIG_SYS_FLASH_CFI
#define CONFIG_FLASH_CFI_DRIVER
#define CONFIG_SYS_FLASH_BASE 0xFC000000
#define CONFIG_SYS_FLASH_SIZE 64
#define CONFIG_SYS_FLASH_PROTECTION 1
#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE,
CONFIG_SYS_FLASH_BASE+ ((CONFIG_SYS_FLASH_SIZE*1024*1024)/2)}
#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_64MB)
#define CONFIG_SYS_MAX_FLASH_BANKS 2 /* number of banks */
#define CONFIG_SYS_MAX_FLASH_SECT 512 /* sectors per device */
u-boot log :
 mtdparts
device nor0 <fc000000.flash>, # parts = 4
 #: name                size            offset          mask_flags
 0: Primary              0x00100000      0x00000000      1
 1: uboot          0x00080000      0x00100000      1
 2: uboot_var      0x00020000      0x00180000      0
 3: rfs                 *0x01e60000*      0x001a0000      0   => Expected
to have 0x3CC0000
active partition: nor0,0 - ( Primary  ) 0x00100000 @ 0x00000000
defaults:
mtdids  : nor0=fc000000.flash,nor1=fe000000.flash
mtdparts: mtdparts=fc000000.flash:0x100000( Primary  )ro,0x080000( uboot
)ro,0x020000( uboot_var ),-(rfs)
Only the CONFIG_SYS_LBLAWAR0_PRELIM is used to realized this feature ?
Sébastien.
    
    
More information about the U-Boot
mailing list