AnsweredAssumed Answered

NAND JFFS2 Support on T2080rdb

Question asked by pushpamanjunath on Jan 18, 2018
Latest reply on Feb 6, 2018 by Pavel Chubakov
I am trying to flash JFFS2 FS to the NAND flash.  Built the kernel with the following configs enabled
CONFIG_MTD
CONFIG_MTD_CMDLINE_PARTS
CONFIG_MTD_BLOCK
CONFIG_MTD_OF_PARTS
CONFIG_MTD_NAND
CONFIG_MTD_NAND_FSL_EBC
CONFIG_JFFS2_FS
CONFIG_JFFS2_FS_WRITEBUFFER
On the u-boot console following is the printenv o/p
=>printenv
baudrate=115200
bdev=sda3
bootcmd=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;setenv ramdiskaddr 0x02000000;setenv fdtaddr 0x00c00000;setenv loadaddr 0x1000000;bootm $loadaddr $ramdiskaddr $fdtaddr
bootdelay=10
bootfile=uImage
consoledev=ttyS0
eth1addr=00:04:9F:03:A2:a5
eth2addr=00:04:9F:03:A3:a5
eth3addr=00:04:9F:03:A4:a5
eth4addr=00:04:9F:03:A5:a5
eth5addr=00:04:9F:03:A6:a5
eth7addr=00:04:9F:03:A7:a5
ethact=FM1@DTSEC3
ethaddr=00:04:9F:03:A1:a5
ethprime=FM1@DTSEC3
fdtaddr=c00000
fdtfile=t2080rdb/t2080rdb.dtb
filesize=86b4
fman_ucode=7faf66c0
gatewayip=192.168.15.1
hwconfig=fsl_ddr:ctlr_intlv=cacheline,bank_intlv=auto;usb1:dr_mode=host,phy_type=utmi
ipaddr=192.168.15.3
loadaddr=1000000
mtddevname=uboot
mtddevnum=0
mtdids=nor0=fe8000000.nor,nand0=fff800000.flash
mtdparts=mtdparts=fe8000000.nor:1m(uboot),5m(kernel),128k(dtb),96m(fs),-(user);fff800000.flash:1m(uboot),5m(kernel),128k(dtb),96m(fs),-(user)
nand_erasesize=20000
nand_oobsize=40
nand_writesize=800
netdev=eth4
netmask=255.255.255.0
nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr
partition=nor0,0
ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr $ramdiskfile;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr
ramdiskaddr=2000000
ramdiskfile=t2080rdb/ramdisk.uboot
rootpath=/opt/nfsroot
serverip=192.168.15.2
stderr=serial
stdin=serial
stdout=serial
tftpflash=tftpboot $loadaddr $uboot && protect off $ubootaddr +$filesize && erase $ubootaddr +$filesize && cp.b $loadaddr $ubootaddr $filesize && protect on $ubootaddr +$filesize && cmp.b $loadaddr $ubootaddr $filesize
uboot="u-boot.bin"
ubootaddr=0x00201000
=> mtdparts
 
device nor0 <fe8000000.nor>, # parts = 5
 #: name        size        offset        mask_flags
 0: uboot               0x00100000    0x00000000    0
 1: kernel              0x00500000    0x00100000    0
 2: dtb                 0x00020000    0x00600000    0
 3: fs                  0x06000000    0x00620000    0
 4: user                0x019e0000    0x06620000    0
 
device nand0 <fff800000.flash>, # parts = 5
 #: name        size        offset        mask_flags
 0: uboot               0x00100000    0x00000000    0
 1: kernel              0x00500000    0x00100000    0
 2: dtb                 0x00020000    0x00600000    0
 3: fs                  0x06000000    0x00620000    0
 4: user                0x199e0000    0x06620000    0
 
active partition: nor0,0 - (uboot) 0x00100000 @ 0x00000000
 
defaults:
mtdids  : nor0=fe8000000.nor,nand0=fff800000.flash,spi0=spife110000.1
mtdparts: mtdparts=fe8000000.nor:1m(uboot),5m(kernel),128k(dtb),96m(fs),-(user);fff800000.flash:1m(uboot),5m(kernel),128k(dtb),96m(fs),-(user)
Following is my dtsi file
    nor@0,0 {
            #address-cells = <1>;
            #size-cells = <1>;
            compatible = "cfi-flash";
            reg = <0x0 0x0 0x8000000>;

 

            bank-width = <2>;
            device-width = <1>;
        };
nand@1,0 {
            #address-cells = <1>;
            #size-cells = <1>;
            compatible = "fsl,ifc-nand";
            reg = <0x2 0x0 0x10000>;
        };
    boardctrl: board-control@2,0 {
            #address-cells = <1>;
            #size-cells = <1>;
            compatible = "fsl,t2080-cpld";
            reg = <3 0 0x300>;
            ranges = <0 3 0 0x300>;
        };
Should I change the .dtsi file to add the kernel,jffs2 partition
And also Where can I get the nand_jffs2_start_address?

 

Regards,
Pushpa

Outcomes