NAND JFFS2 Support on T2080rdb

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NAND JFFS2 Support on T2080rdb

1,058 Views
pushpamanjunath
Contributor I
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
Labels (1)
0 Kudos
4 Replies

722 Views
Pavel
NXP Employee
NXP Employee

Look at the Section 4.4.15.9.4 of NXP SDK 2.0-1703 documentation:

https://www.nxp.com/docs/en/supporting-information/QORIQ-SDK-2.0-IC-REV0.pdf

This Section contains command sequence for SD deployment using ext2load.

Use similar command sequence for NAND deployment.

The ext2load is used for loading kernel, FS and dtb from the ext2 file system to the SDRAM and start Linux from the SDRAM.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

722 Views
Pavel
NXP Employee
NXP Employee

Look at the Chapter 7.8.2 of NXP SDK 2.0-1703 documentation:

https://www.nxp.com/docs/en/supporting-information/QORIQ-SDK-2.0-IC-REV0.pdf

 

Find the "Special MTD partition DTS" and "Boot up the board" in this chapter

 


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

722 Views
pushpamanjunath
Contributor I

Hi Pavel,

I refered the NXP SDK 2.0-1703 documentation for mounting the JFFS2 filesytem NAND flash. In the kernel logs could see the mtd partitions for NAND.

 
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xac (Micron MT29F4G08ABBDAH4), 512MiB, page size: 2048, OOB size: 64
Bad block table found at page 262080, version 0x01
Bad block table found at page 262016, version 0x01
5 cmdlinepart partitions found on MTD device fff800000.flash
Creating 5 MTD partitions on "fff800000.flash":
0x000000000000-0x000000300000 : "uboot"
0x000000300000-0x000000800000 : "kernel"
0x000000800000-0x000000820000 : "dtb"
0x000000820000-0x000006820000 : "fs"
0x000006820000-0x000020000000 : "user"
fsl,ifc-nand fff800000.nand: IFC NAND device at 0xfff800000, bank 0
fsl_espi ffe110000.spi: master is unqueued, this is deprecated
m25p80 spi32766.0: n25q512ax3 (65536 Kbytes)
fsl_espi ffe110000.spi: at 0x80000800801a6000 (irq = 53)
libphy: Fixed MDIO Bus: probed
libphy: Freescale XGMAC MDIO Bus: probed
libphy: Freescale XGMAC MDIO Bus: probed
libphy: Freescale XGMAC MDIO Bus: probed
libphy: Freescale XGMAC MDIO Bus: probed
libphy: Freescale XGMAC MDIO Bus: probed
libphy: Freescale XGMAC MDIO Bus: probed
libphy: Freescale XGMAC MDIO Bus: probed
libphy: Freescale XGMAC MDIO Bus: probed
libphy: Freescale XGMAC MDIO Bus: probed
libphy: Freescale XGMAC MDIO Bus: probed

Now I need to program kernel,dtb to NAND flash, but couldn't trace out NAND Flash memory map in any document for T2080RDB

Found out only following mapping
Start        End        Definition    Size
0x000000    0x0FFFFF    U-Boot img    1MB  (2 blocks)
0x100000    0x17FFFF    U-Boot env    512KB (1 block)
0x180000    0x1FFFFF    FMAN ucode    512KB (1 block)
0x200000    0x27FFFF    CS4315 ucode    512KB (1 block)

Regards,

Pushpa

0 Kudos

722 Views
pushpamanjunath
Contributor I

Is there a way to flash kernel,FS,dtb to NAND flash memory?

Regards,

Pushpa

0 Kudos