How to boot T4240RDB with rootfs on NAND?

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

How to boot T4240RDB with rootfs on NAND?

1,084 Views
samwellho
Contributor I

I have T4240RDB board with 2048 MB NAND.

I can boot the board with Linux rootfs (built from NXP Linux SDK/Yocto) on SDCARD (u-boot on NOR). But I don't know how to product/write Linux rootfs to NAND and configure u-Boot to boot Linux from NAND.

Please help me.

This is my board u-boot messages:

U-Boot 2016.012.0+ga9b437f (May 15 2016 - 04:19:12 +0800)

CPU0: T4240E, Version: 2.0, (0x82480020)
Core: e6500, Version: 2.0, (0x80400120)
Clock Configuration:
CPU0:1800 MHz, CPU1:1800 MHz, CPU2:1800 MHz, CPU3:1800 MHz,
CPU4:1800 MHz, CPU5:1800 MHz, CPU6:1800 MHz, CPU7:1800 MHz,
CPU8:1800 MHz, CPU9:1800 MHz, CPU10:1800 MHz, CPU11:1800 MHz,
CCB:733.333 MHz,
DDR:933.333 MHz (1866.667 MT/s data rate) (Asynchronous), IFC:183.333 MHz
FMAN1: 733.333 MHz
FMAN2: 733.333 MHz
QMAN: 366.667 MHz
PME: 533.333 MHz
L1: D-cache 32 KiB enabled
I-cache 32 KiB enabled
Reset Configuration Word (RCW):
00000000: 1607001b 18101b16 00000000 00000000
00000010: 6c6e0848 00448c00 0c020000 f5000000
00000020: 00000000 ee0000ee 00000000 000287fc
00000030: 00000000 50000000 00000000 00000028
I2C: ready
Board: T4240RDB, Board rev: 0x04 CPLD ver: 0x0700, vBank: 0
SERDES Reference Clocks:
SERDES1=100MHz SERDES2=156.25MHz
SERDES3=100MHz SERDES4=100MHz
SPI: ready
DRAM: Initializing....using SPD
DDR: failed to read SPD from address 82
Detected UDIMM 18JSF1G72AZ-1G9P1
There is no rank on CS0 for controller 0.
There is no rank on CS0 for controller 1.
Not all DIMMs are identical. Memory controller interleaving disabled.
6 GiB left unmapped
8 GiB (DDR3, 64-bit, CL=13, ECC on)
DDR Chip-Select Interleaving Mode: CS0+CS1
VID: Core voltage after adjustment is at 1023 mV
Flash: 128 MiB
L2: 2 MiB enabled
enable l2 for cluster 1 fec60000
enable l2 for cluster 2 feca0000
Corenet Platform Cache: 1.5 MiB enabled
Using SERDES1 Protocol: 27 (0x1b)
Using SERDES2 Protocol: 55 (0x37)
Using SERDES3 Protocol: 1 (0x1)
Using SERDES4 Protocol: 9 (0x9)
SEC0: RNG instantiated
NAND: 2048 MiB
MMC: FSL_SDHC: 0
PCIe1: Root Complex, no link, regs @ 0xfe240000
PCIe1: Bus 00 - 00
PCIe2: disabled
PCIe3: Root Complex, no link, regs @ 0xfe260000
PCIe3: Bus 01 - 01
PCIe4: Root Complex, no link, regs @ 0xfe270000
PCIe4: Bus 02 - 02
In: serial
Out: serial
Err: serial
Net: Fman1: Uploading microcode version 108.4.5
Fman2: Uploading microcode version 108.4.5
FM1@DTSEC1, FM1@DTSEC2, FM1@DTSEC3, FM1@DTSEC4, FM1@TGEC1, FM1@TGEC2, FM2@DTSEC1, FM2@DTSEC2, FM2@DTSEC3, FM2@DTSEC4, FM2@TGEC1, FM2@TGEC2
Hit any key to stop autoboot: 0

...

This is my u-boot config:

=> print
baudrate=115200
bdev=sda3
bootargs=root=/dev/ram rw console=ttyS0,115200
bootcmd=setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=$consoledev,$baudrate;mmcinfo;ext2load mmc 0:2 1000000 /boot/uImage.bin;ext2load mmc 0:2 e00000 /boot/uImage.dtb;bootm 1000000 - e00000
bootdelay=3
bootfile=uImage
consoledev=ttyS0
eth10addr=00:03:9F:02:02:10
eth11addr=00:03:9F:02:02:11
eth12addr=00:03:9F:02:02:12
eth1addr=00:03:9F:02:02:01
eth2addr=00:03:9F:02:02:02
eth3addr=00:03:9F:02:02:03
eth4addr=00:03:9F:02:02:04
eth5addr=00:03:9F:02:02:05
eth6addr=00:03:9F:02:02:06
eth7addr=00:03:9F:02:02:07
eth8addr=00:03:9F:02:02:08
eth9addr=00:03:9F:02:02:09
ethact=FM1@DTSEC1
ethaddr=00:03:9F:02:02:00
ethprim=eth0
ethprime=eth0
fdtaddr=0xe00000
fdtfile=t4240rdb/t4240rdb.dtb
fileaddr=100000
filesize=20a6a
fman_ucode=eff00000
gatewayip=192.168.1.1
hwconfig=fsl_ddr:ctlr_intlv=3way_4KB,bank_intlv=auto;usb1:dr_mode=host,phy_type=utmi
ipaddr=192.168.1.101
loadaddr=1000000
netdev=eth0
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
ramargs=setenv bootargs root=/dev/ram rw console=ttyS0,115200
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=t4240rdb/ramdisk.uboot
rootpath=/opt/nfsroot
serverip=192.168.1.100
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=0xeff40000

Environment size: 2022/8188 bytes

I can view NAND:

=> nand info

Device 0: nand0, sector size 512 KiB
Page size 4096 b
OOB size 224 b
Erase size 524288 b
subpagesize 4096 b
options 0x 200
bbt options 0x 20000
=>

In Linux, dmesg show NAND like this:

[ 2.268983] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x48
[ 2.274037] nand: Micron MT29F16G08ABABAWP
[ 2.276825] nand: 2048 MiB, SLC, erase size: 512 KiB, page size: 4096, OOB size: 224
[ 2.284036] Bad block table found at page 524160, version 0x01
[ 2.289898] Bad block table found at page 524032, version 0x01
[ 2.295625] fsl,ifc-nand fff800000.nand: IFC NAND device at 0xfff800000, bank 1
[ 2.302360] fsl_espi ffe110000.spi: cs=0, init_csmode=0x100008
[ 2.307084] m25p80 spi32766.0: unrecognized JEDEC id bytes: ff, ff, ff
[ 2.312326] fsl_espi ffe110000.spi: at 0x8000080080bce000 (irq = 53)

2 Replies

1,000 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please configure Linux Kernel as the following

File systems --->

       Miscellaneous filesystems --->

            <*> Journaling Flash File System v2 (JFFS2) support

            (0) JFFS2 debugging verbosity

            [*] JFFS2 write-buffering support

Define NAND partitions similar as the following

nand@2,0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "fsl,ifc-nand";
reg = <0x2 0x0 0x10000>;

partition@0 {
/* This location must not be altered */
/* 1MB for u-boot Bootloader Image */
reg = <0x0 0x00100000>;
label = "NAND U-Boot Image";
read-only;
};

partition@100000 {
/* 1MB for DTB Image */
reg = <0x00100000 0x00100000>;
label = "NAND DTB Image";
};

partition@200000 {
/* 10MB for Linux Kernel Image */
reg = <0x00200000 0x00A00000>;
label = "NAND Linux Kernel Image";
};

partition@C00000 {
/* 500MB for Root file System Image */
reg = <0x00c00000 0x1F400000>;
label = "NAND RFS Image";
};

Under u-boot:

=> tftp 0x10000000 uImage

=> nand erase 200000 +$filesize

=> nand write 0x10000000 200000  $filesize

=> tftp 0x10000000 t4240rdb.dtb

=> nand erase 100000 +$filesize

=> nand write 0x10000000 100000  $filesize

After boot up Linux

flash_eraseall /dev/mtd4

mount -t jffs2 /dev/mtdblock4 /mnt

Deploy rootfs.tar.gz to /mnt folder

Under u-boot:

=>setenv bootargs root=/dev/mtdblock4 rootfstype=jffs2 rw console=ttyS0,115200

=>nand read 0x10000000  200000  <uImage_size>

=>nand read 0x20000000 100000    <dtb_size>

=>bootm 0x10000000 - 0x20000000 

1,000 Views
samwellho
Contributor I

Thanks alot.

I'll try and let you know the result.

0 Kudos