Nand Flash, ubi On Custom t1040 board and U-BOOT

cancel
Showing results for 
Search instead for 
Did you mean: 

Nand Flash, ubi On Custom t1040 board and U-BOOT

292 Views
Contributor I

I use SDK 2.0 to compile u-boot for my custom T1040 board.

The board has MX30UF4G18AB-TI  connected to IFC_CS0

On boot it say NAND: 0 MiB, so NAND is not accesble.

1) In RCW i have ifc_MODE 0b100010000 - 8-bit NAND Flash, 4-Kbyte page, 128 pages/block, Bad Block Indicator in page 0/1, ECC disabled

2) In codewarior ini i have

##################################################################################
# IFC Controller Setup
global ECC_EN
set ECC_ENC_EN 0x[format %x [expr $ECC_EN << 31]]
set ECC_DEC_EN 0x[format %x [expr $ECC_EN << 26]]

# set NOR_CS 0
# set NAND_CS 1
set NAND_CS 0
# set CPLD_CS 2

# CPLD, addr 0xFFDF0000, 128K size, 8-bit, GPCM, Valid
# CSPR_EXT
# mem [CCSR_ADDR [expr {0x12400C + $CPLD_CS * 0x0C}]] = 0x00000000
# CSPR
# mem [CCSR_ADDR [expr {0x124010 + $CPLD_CS * 0x0C}]] = 0xFFDF0085
# AMASK
# mem [CCSR_ADDR [expr {0x1240A0 + $CPLD_CS * 0x0C}]] = 0xFFFE0000
# CSOR
# mem [CCSR_ADDR [expr {0x124130 + $CPLD_CS * 0x0C}]] = 0x00000000

# IFC_FTIM0
# mem [CCSR_ADDR [expr {0x1241C0 + $CPLD_CS * 0x30}]] = 0xE00E000E
# IFC_FTIM1
# mem [CCSR_ADDR [expr {0x1241C4 + $CPLD_CS * 0x30}]] = 0x0E001F00
# IFC_FTIM2
# mem [CCSR_ADDR [expr {0x1241C8 + $CPLD_CS * 0x30}]] = 0x0E00001F
# IFC_FTIM3
# mem [CCSR_ADDR [expr {0x1241CC + $CPLD_CS * 0x30}]] = 0x00000000


# NAND Flash, addr 0xFF800000, 64K size, 8-bit NAND
# CSPR_EXT
mem [CCSR_ADDR [expr {0x12400C + $NAND_CS * 0x0C}]] = 0x00000000
# CSPR
mem [CCSR_ADDR [expr {0x124010 + $NAND_CS * 0x0C}]] = 0xFF800083
# AMASK
mem [CCSR_ADDR [expr {0x1240A0 + $NAND_CS * 0x0C}]] = 0xFFFF0000
# CSOR
mem [CCSR_ADDR [expr {0x124130 + $NAND_CS * 0x0C}]] = 0x[format %x [expr 0x0110A100 | $ECC_ENC_EN | $ECC_DEC_EN]]

# IFC_FTIM0
mem [CCSR_ADDR [expr {0x1241C0 + $NAND_CS * 0x30}]] = 0x0E18070A
# IFC_FTIM1
mem [CCSR_ADDR [expr {0x1241C4 + $NAND_CS * 0x30}]] = 0x32390E18
# IFC_FTIM2
mem [CCSR_ADDR [expr {0x1241C8 + $NAND_CS * 0x30}]] = 0x01E0501E
# IFC_FTIM3
mem [CCSR_ADDR [expr {0x1241CC + $NAND_CS * 0x30}]] = 0x00000000

3) in T1040D4RDB_SDCARD_defconfig  i have :

CONFIG_PPC=y
CONFIG_MPC85xx=y
CONFIG_TARGET_T104XRDB=y
CONFIG_SPL=y
CONFIG_SYS_EXTRA_OPTIONS="PPC_T1040,T1040D4RDB,RAMBOOT_PBL,SPL_FSL_PBL,SDCARD,T104XD4RDB,SYS_FSL_DDR3"
CONFIG_SPI_FLASH=y
CONFIG_SPI_FLASH_SST=y
CONFIG_SPI_FLASH_WINBOND=y
CONFIG_NETDEVICES=y
CONFIG_E1000=y
CONFIG_SYS_NS16550=y
CONFIG_FSL_ESPI=y
CONFIG_MTD=y
CONFIG_MTD_BLOCK2MTD=y
CONFIG_MTD_UBI=y
CONFIG_UBIFS_FS=y
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_BOOTDELAY=29

4) uboot =>ubi  comand does not work.

what and where should i configure to compile to ramboot and  make NAND and UBI  work on my board?

0 Kudos
18 Replies

105 Views
NXP TechSupport
NXP TechSupport

Please provide the processor to NAND Flash connection schematics for inspection as PDF.

0 Kudos

105 Views
Contributor I

pastedImage_2.png

0 Kudos

105 Views
NXP TechSupport
NXP TechSupport

The R/B# is an open-drain output pin - i.e. pull-up is required.

0 Kudos

105 Views
Contributor I

pastedImage_1.png

my board has u-boot in spi and nand memory is work, and it contain some data. but i have no source code of this, so i have to compile my own u-boot.Can i access NAND using codewarior memory viewer or flash programmer?

0 Kudos

105 Views
NXP TechSupport
NXP TechSupport

> Can i access NAND using codewarior memory viewer or flash programmer?

This should be possible.

You wrote:

> my board has u-boot in spi and nand memory is work

and previously:

> On boot it say NAND: 0 MiB, so NAND is not accesble.

To which use cases these statements belong?

0 Kudos

105 Views
Contributor I

ufedor написал(а):

> Can i access NAND using codewarior memory viewer or flash programmer?

This should be possible.

pastedImage_7.png

i dont see actual data. only FFFFFF.:((

=> nand info

Device 0: nand0, sector size 128 KiB
Page size 2048 b
OOB size 64 b
Erase size 131072 b
subpagesize 2048 b
options 0x40000200
bbt options 0x 28000
=> nand read 1000000 0 100

NAND read: device 0 offset 0x0, size 0x100
256 bytes read: OK
=> md.w 1000000 100
01000000: 5542 4923 0100 0000 0000 0000 0000 0007 UBI#............
01000010: 0000 0800 0000 1000 a32e f6b1 0000 0000 ................
01000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
01000030: 0000 0000 0000 0000 0000 0000 a989 be05 ................
01000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
01000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
01000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................

0 Kudos

105 Views
Contributor I

=> md.w ff800000
ff800000: 5542 4923 0100 0000 0000 0000 0000 0007 UBI#............
ff800010: 0000 0800 0000 1000 a32e f6b1 0000 0000 ................
ff800020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
ff800030: 0000 0000 0000 0000 0000 0000 a989 be05 ................
ff800040: 0000 0000 0000 0000 0000 0000 0000 0000 ................

0 Kudos

105 Views
NXP TechSupport
NXP TechSupport

> i dont see actual data. only FFFFFF.:((

NAND Flash contents is not memory mapped.

At the address 0xFF800000 is located memory buffer which is empty if nothing was read from the NAND Flash.

0 Kudos

105 Views
Contributor I

are you sure? so why on the refererence t1040rdb board a see NAND flash data immedeadly after reset?

pastedImage_2.png

0 Kudos

105 Views
NXP TechSupport
NXP TechSupport

> are you sure?

Please read the QorIQ T1040 Reference Manual, 24.5.5 SRAM buffer:

"Read and write accesses to IFC banks controlled by NAND FCM do not access attached NAND flash EEPROMs directly. Rather, these accesses read and write the buffer RAM"

0 Kudos

105 Views
Contributor I

ok, so what step by step bring NAND up?

0 Kudos

105 Views
NXP TechSupport
NXP TechSupport

It is needed to change CONFIG_SYS_NAND_CSOR according to the NAND device parameters in the u-boot/include/configs/T104xRDB.h

0 Kudos

105 Views
Contributor I

not only.

1040D4RDB_SDCARD_defconfig 

CONFIG_NAND=y
CONFIG_SYS_EXTRA_OPTIONS="PPC_T1040,T1040D4RDB,RAMBOOT_PBL,SPL_FSL_PBL,SDCARD,NAND,T104XD4RDB,SYS_FSL_DDR3"

boot/include/configs/T104xRDB.h

#define CONFIG_CMD_NAND
#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_RBTREE
#define CONFIG_MTD_DEVICE
#define CONFIG_MTD_PARTITIONS
#define CONFIG_CMD_MTDPARTS
#define CONFIG_LZO

0 Kudos

105 Views
NXP TechSupport
NXP TechSupport

Please attach complete modified "T104xRDB.h"

0 Kudos

105 Views
Contributor I

i recompled u-boot from and now have this error.

=> nand info

Device 0: nand0, sector size 128 KiB
Page size 2048 b
OOB size 64 b
Erase size 131072 b
subpagesize 2048 b
options 0x40004200
bbt options 0x00028000
=> nand read 1000000 0 1000

NAND read: device 0 offset 0x0, size 0x1000
Attempt to read outside the flash area
0 bytes read: ERROR
=>

0 Kudos

105 Views
NXP TechSupport
NXP TechSupport

Please try to build U-Boot using T1040D4RDB settings without modifications.

0 Kudos

105 Views
Contributor I

i downloaded source git@gitlab.denx.de:u-boot/u-boot.git v2019.01 sources, recompile and  and it work. Master  branch, also as Nxp sources does not work with my NAND and Spi flash chip. It look like there was some changes in mtd drivers and it has some bugs  now. 

0 Kudos

105 Views
Contributor I

i have a board with compiled u-boot ( no source codes). and it say NAND: 512 MiB and it work.

i need to recompile uboot to make board work with other type of DDR memory. And i got NAND : 0Mib and it does not work.   

0 Kudos