Nand boot with evk board

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

Nand boot with evk board

Jump to solution
2,886 Views
guochgz
Contributor III

hello,

       I have removed the qspi flash from evk board and solder U302 W29n01hv NAND FLASH on the EVK board, that the flash pins is the same with MT29G08CBADBWP

pastedImage_1.pngpastedImage_2.png

and now I recompile the uboot follow the steps:

1: make distclean;

2: make mx6ull_14x14_evk_nand_defconfig

3: make

and replaced the firmware/u-boot-imx6ull14x14evk_nand with u-boot-dtb.imx, and the same with files u-boot-imx6ull14x14evk_nand.imx

then I got the log like this:


U-Boot 2018.03-imx_v2018.03_4.14.98_2.0.0_ga+g87a19df (Aug 02 2019 - 15:52:23 +0800)

CPU: Freescale i.MX6ULL rev1.0 900 MHz (running at 396 MHz)
CPU: Commercial temperature grade (0C to 95C) at 48C
Reset cause: POR
Model: Freescale i.MX6 ULL 14x14 EVK Board
Board: MX6ULL 14x14 EVK
DRAM: 512 MiB
NAND: 128 MiB
MMC: FSL_SDHC: 0
Loading Environment from NAND... cannot support the NAND, missing necessary info
Bad block table not found for chip 0
Bad block table not found for chip 0
nand_bbt: error while writing bad block table -5
*** Warning - bad CRC, using default environment

Failed (-5)
Display: TFT43AB (480x272)
Video: 480x272x24
In: serial
Out: serial
Err: serial
Net:
Warning: ethernet@020b4000 using MAC address from ROM
eth1: ethernet@020b4000 [PRIME]
Warning: ethernet@02188000 using MAC address from ROM
, eth0: ethernet@02188000
Boot from USB for mfgtools
Use default environment for mfgtools
Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
Hit any key to stop autoboot: 0

## Checking Image at 86800000 ...
Unknown image format!
Run fastboot ...
Unknown command 'fastboot' - try 'help'
=>

so It seems Nand has been recognized, but not configured correctly? 

EXTENDED_ID_NAND("NAND 128MiB 3,3V 8-bit",  0xF1, 128, 0x0),

should I added those item like this:

{"W29N01HVSINA 1G 3.3V 8-bit",
{ .id = {0xEF, 0xF1, 0x00, 0x95, 0x00, 0x00, 0x00, 0x00} },
SZ_2K, SZ_128, SZ_128K, 0, 5, 64, NAND_ECC_INFO(1, SZ_512),
2 },

pagesize: 2048

chipsize: 1Gbit, 128

erasesize: 128 

option: 0x0

id_len: 5

oobsize: 64

Nand_ECC_INFO: ? 

onfi_timing_defualt: ?

pastedImage_12.png

and the dts file is :

pastedImage_16.png

Labels (1)
Tags (1)
0 Kudos
1 Solution
2,223 Views
igorpadykov
NXP Employee
NXP Employee

Hi 国承 张 

 

one can check if there is entry for this nand in nand_ids.c file

nand_ids.c\nand\mtd\drivers - uboot-imx - i.MX U-Boot 

Best regards
igor

View solution in original post

0 Kudos
11 Replies
2,223 Views
igorpadykov
NXP Employee
NXP Employee

Hi 国承 张 

one can try to follow steps described on

https://community.nxp.com/docs/DOC-236994 

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

0 Kudos
2,223 Views
guochgz
Contributor III

hello, igor.

       I have just follow that steps, now the issue is uboot can not work with nand boot while in nand bbt funtion. Maybe this issue is related to the nand configs or uboot bad block table function .

       I have added comments in search_bbt function:

    pastedImage_1.png

      got log like this:

    pastedImage_2.png

0 Kudos
2,224 Views
igorpadykov
NXP Employee
NXP Employee

Hi 国承 张 

 

one can check if there is entry for this nand in nand_ids.c file

nand_ids.c\nand\mtd\drivers - uboot-imx - i.MX U-Boot 

Best regards
igor

0 Kudos
2,223 Views
guochgz
Contributor III

yes, there is one item matched. 

EXTENDED_ID_NAND("NAND 128MiB 3,3V 8-bit",  0xF1, 128, LP_OPTIONS),

 

0 Kudos
2,223 Views
igorpadykov
NXP Employee
NXP Employee

one can recheck if correctly used kobs-ng init, it updates FCB/DBBT.

Best regards
igor

0 Kudos
2,223 Views
guochgz
Contributor III

I have no idea about kobs-ng init, do you show me more details? 

 

I have added item in nand_ids.c

pastedImage_1.png

and got log like this:

U-Boot 2018.03-imx_v2018.03_4.14.98_2.0.0_ga+g87a19df (Aug 05 2019 - 15:26:03 +0800)

CPU: Freescale i.MX6ULL rev1.0 900 MHz (running at 396 MHz)
CPU: Commercial temperature grade (0C to 95C) at 51C
Reset cause: POR
Model: Freescale i.MX6 ULL 14x14 EVK Board
Board: MX6ULL 14x14 EVK
DRAM: 512 MiB
NAND: id_data[0] = ef
id_data[1] = f1
id_data[2] = 01
id_data[3] = 95
id_data[4] = 01
id_data[5] = 01
id_data[6] = 01
id_data[7] = 01
128 MiB
MMC: FSL_SDHC: 0
Loading Environment from NAND... !!! Neil.zhang added here :chip->ecc_strength_ds = 1, chip->ecc_step_ds = 512, mtd->oobsize is 64
!!! Neil.zhang added here : maxblocks is 4
Bad block table not found for chip 0
!!! Neil.zhang added here : maxblocks is 4
Bad block table not found for chip 0
nand_bbt: error while writing bad block table -5
*** Warning - bad CRC, using default environment

Failed (-5)
Display: TFT43AB (480x272)
Video: 480x272x24
In: serial
Out: serial
Err: serial
Net:
Warning: ethernet@020b4000 using MAC address from ROM
eth1: ethernet@020b4000 [PRIME]
Warning: ethernet@02188000 using MAC address from ROM
, eth0: ethernet@02188000
Boot from USB for mfgtools
Use default environment for mfgtools
Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
Hit any key to stop autoboot: 0

## Checking Image at 86800000 ...
Unknown image format!
Run fastboot ...
Unknown command 'fastboot' - try 'help'

   Bad block table not found for chip 0

   Does this means I need to disable this option? 

   nand->bbt_options = NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;

   and NAND_ECC_INFO(1, SZ512), I am not sure that this configuation is correct. can you help me check this? 

   pastedImage_1.png

   or NAND_ECC_INFO(1, 528) is correct? 

   thanks very much.

0 Kudos
2,223 Views
igorpadykov
NXP Employee
NXP Employee

>I have no idea about kobs-ng init, do you show me more details? 

please check first answer, it is used by Mfg Tool

How-To use NAND boot on i.MX6UL EVK board 

 

Best regards
igor

0 Kudos
2,223 Views
guochgz
Contributor III

hello.

I tested it with a lower version(L4.1.15) of uboot and found the results were different

the nand driver needs two changes, nand_ids.c and READID function.

so what need to do next? replace firmare/zImage ? 

0 Kudos
2,223 Views
igorpadykov
NXP Employee
NXP Employee

it is necessary to apply kobs-ng init on some step as in example on

i.MX7: Flashing Images to NAND - Develop.phytec - PHYTEC Wiki 

0 Kudos
2,223 Views
guochgz
Contributor III

Currently, the problem points to the erase problem of Nand flash. When the 60h, d0h command is executed, the 70h command is used to read the status, and the value returned is 0xFF, not 0x40.

pastedImage_1.png

log is:

nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
nand: Unknown W29N01HVSINA 1G 3.3V 8-bit
nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
gpmi-nand 1806000.gpmi-nand: use legacy bch geometry
Bad block table not found for chip 0
Bad block table not found for chip 0
Scanning device for bad blocks
nand: status = 0xff
nand: nand_erase_nand: failed erase, page 0x0000ffc0
nand_bbt: error while writing bad block table -5

The original datasheet is attached in the top post. the block erase seq as follow:

pastedImage_2.png

0 Kudos
2,223 Views
guochgz
Contributor III

Thanks igor, 

I have checked it. 

the dts file is:


#include "imx6ul-14x14-evk.dts"

&qspi{
status = "disabled";
};

&usdhc2 {
status = "disabled";
};

&gpmi {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpmi_nand_1>;
status = "okay";
nand-on-flash-bbt;
};

&iomuxc {
imx6ul-evk {
pinctrl_gpmi_nand_1: gpmi-nand-1 {
fsl,pins = <
MX6UL_PAD_NAND_CLE__RAWNAND_CLE 0xb0b1
MX6UL_PAD_NAND_ALE__RAWNAND_ALE 0xb0b1
MX6UL_PAD_NAND_WP_B__RAWNAND_WP_B 0xb0b1
MX6UL_PAD_NAND_READY_B__RAWNAND_READY_B 0xb000
MX6UL_PAD_NAND_CE0_B__RAWNAND_CE0_B 0xb0b1
MX6UL_PAD_NAND_CE1_B__RAWNAND_CE1_B 0xb0b1
MX6UL_PAD_NAND_RE_B__RAWNAND_RE_B 0xb0b1
MX6UL_PAD_NAND_WE_B__RAWNAND_WE_B 0xb0b1
MX6UL_PAD_NAND_DATA00__RAWNAND_DATA00 0xb0b1
MX6UL_PAD_NAND_DATA01__RAWNAND_DATA01 0xb0b1
MX6UL_PAD_NAND_DATA02__RAWNAND_DATA02 0xb0b1
MX6UL_PAD_NAND_DATA03__RAWNAND_DATA03 0xb0b1
MX6UL_PAD_NAND_DATA04__RAWNAND_DATA04 0xb0b1
MX6UL_PAD_NAND_DATA05__RAWNAND_DATA05 0xb0b1
MX6UL_PAD_NAND_DATA06__RAWNAND_DATA06 0xb0b1
MX6UL_PAD_NAND_DATA07__RAWNAND_DATA07 0xb0b1
>;
};
};
};

pastedImage_1.png

pastedImage_1.png

pastedImage_2.png

pastedImage_2.png

and the MFG-TOOLS version is: MFG_TOOLS\L4.1.15_2.0.0-ga_mfg-tools

the mfg-tools  log is :

ModuleID[2] LevelID[10]: ExecuteCommand--Boot[WndIndex:0], File is D:\Projects\IMX6ULL\MFG_TOOLS\L4.1.15_2.0.0-ga_mfg-tools\mfgtools-with-rootfs\mfgtools-with-rootfs\mfgtools-nand\Profiles\linux\OS Firmware\firmware\u-boot-imx6ull14x14evk_nand.imx
ModuleID[2] LevelID[10]: CmdOperation[0], skip current command, so SetEvent(hDevCanDeleteEvent)
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is D:\Projects\IMX6ULL\MFG_TOOLS\L4.1.15_2.0.0-ga_mfg-tools\mfgtools-with-rootfs\mfgtools-with-rootfs\mfgtools-nand\Profiles\linux\OS Firmware\firmware\zImage, address is 0x80800000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: CmdOperation[0], skip current command, so SetEvent(hDevCanDeleteEvent)
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is D:\Projects\IMX6ULL\MFG_TOOLS\L4.1.15_2.0.0-ga_mfg-tools\mfgtools-with-rootfs\mfgtools-with-rootfs\mfgtools-nand\Profiles\linux\OS Firmware\firmware\fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot, address is 0x83800000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: CmdOperation[0], skip current command, so SetEvent(hDevCanDeleteEvent)
ModuleID[2] LevelID[10]: CmdOperation[0], skip current command, so SetEvent(hDevCanDeleteEvent)
ModuleID[2] LevelID[10]: CmdOperation[0], skip current command, so SetEvent(hDevCanDeleteEvent)
ModuleID[2] LevelID[10]: CmdOperation[0], skip current command, so SetEvent(hDevCanDeleteEvent)
ModuleID[2] LevelID[10]: CmdOperation[0], skip current command, so SetEvent(hDevCanDeleteEvent)
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is D:\Projects\IMX6ULL\MFG_TOOLS\L4.1.15_2.0.0-ga_mfg-tools\mfgtools-with-rootfs\mfgtools-with-rootfs\mfgtools-nand\Profiles\linux\OS Firmware\firmware\zImage-imx6ull-14x14-evk-gpmi-weim.dtb, address is 0x83000000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: ExecuteCommand--Jump[WndIndex:0]
ModuleID[2] LevelID[10]: *********MxHidDevice[06A90A90] Jump to Ramkernel successfully!**********
ModuleID[2] LevelID[10]: CmdOperation[0], current state command has been finished and the last command is successful, so SetEvent(hDevCanDeleteEvent)
ModuleID[2] LevelID[10]: DeviceManager::DevChangeWnd::OnDeviceChange() - DEVICE_REMOVAL_EVT(\\?\USB#VID_15A2&PID_0080#5&20c67efd&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed})
ModuleID[2] LevelID[10]: DeviceManager::DevChangeWnd::OnDeviceChange() - end
ModuleID[2] LevelID[10]: DeviceManager::OnMsgDeviceEvent() - DEVICE_REMOVAL_EVT(\\?\USB#VID_15A2&PID_0080#5&20c67efd&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed})
ModuleID[2] LevelID[10]: DeviceClass::FindDeviceByUsbPath--DeviceListType_Current, _devices.size: 1
ModuleID[2] LevelID[10]: DeviceClass::FindDeviceByUsbPath--DeviceListType_Current, devInstPathToFind: USB\VID_15A2&PID_0080\5&20C67EFD&0&1, _deviceInstanceID: USB\VID_15A2&PID_0080\5&20C67EFD&0&1
ModuleID[2] LevelID[10]: DeviceClass::FindDeviceByUsbPath--DeviceListType_Current, Find the device
ModuleID[2] LevelID[10]: DeviceManager::OnMsgDeviceEvent() - DEVICE_REMOVAL_EVT,[MxHidDeviceClass] vid_15a2&pid_0080, Hub:1-Port:1
ModuleID[2] LevelID[10]: DeviceManager::OnMsgDeviceEvent() - DEVICE_REMOVAL_EVT, Notify
ModuleID[2] LevelID[10]: CmdOpreation[0]--OnDeviceChangeNotify, Volume Arrive/Remove or Device Arrive/Remove
ModuleID[2] LevelID[10]: CmdOpreation[0]--OnDeviceChangeNotify, m_p_usb_port is not NULL, so only refresh
ModuleID[2] LevelID[10]: CmdOpreation[0]--OnDeviceChangeNotify, Volume/Device Remove
ModuleID[2] LevelID[1]: CmdOpreation[0]--set m_hDeviceRemoveEvent.
ModuleID[2] LevelID[10]: CmdOpreation[0]--WaitforEvents device remove1
ModuleID[2] LevelID[10]: DeviceManager::OnMsgDeviceEvent()-DEVICE_REMOVAL_EVT, hDevCanDeleteEvent has been set
ModuleID[2] LevelID[10]: delete MxHidDevice[06A90A90]

0 Kudos