Finally figured out the last missing pieces of the 'NAND' puzzle. I came to realize that my custom uboot and kernel I am using with mfgtool is NOT the same that is loaded to the NAND.
The mfgtool distinguish between the mfgtools u-boot/kernel and the uboot/kernel is flashes into NAND. There are 2 respective folder:
mfgtools/Profiles/Linux/OS Firmware/firmware/ uboot and kernel used by the mfgtool to initialize the board
mfgtools/Profiles/Linux/OS Firmware/files files here will be flashed into the NAND (or sd,qspi,emmc,..)
As already mentioned earlier the uboot/kernel that comes with the mfgtool2 package does NOT work with imx6ul EVK NAND configuration. So my fix was simple. I just copied my custom uboot and kernel to the folder 'files'.
Re-flashed the NAND (' mfgtool2-yocto-mx-evk-NAND.vbs') and now after reset I see the uboot messages popping up and the kernel is starting. FINALLY i got to boot from NAND.
I still noticed a mixup with the NAND/MTD/ubifs partition. The problem was sorted quickly and addressed in 'mx6ul_14x14_evk.h'.
This header file defines the NAND partitions for the kernel, which I modified already earlier in the process. But I overlooked that there are 2x NAND partition declarations. Both need to be setup exactly the same. Go figure!. Here is my example ( nand partition setup in blue):
snippet from /u-boot-imx-mfgtool/2016.03-r0/git/include/configs/mx6ul_14x14_evk.h:
#ifdef CONFIG_SYS_BOOT_NAND
#define CONFIG_MFG_NAND_PARTITION "mtdparts=gpmi-nand:64m(boot),16m(kernel),16m(dtb),16m(misc),-(rootfs) "
#else
#define CONFIG_MFG_NAND_PARTITION ""
#endif
#define CONFIG_MFG_ENV_SETTINGS \
"mfgtool_args=setenv bootargs console=${console},${baudrate} " \
CONFIG_BOOTARGS_CMA_SIZE \
"rdinit=/linuxrc " \
"g_mass_storage.stall=0 g_mass_storage.removable=1 " \
"g_mass_storage.file=/fat g_mass_storage.ro=1 " \
"g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF "\
"g_mass_storage.iSerialMxNumber=\"\" "\
CONFIG_MFG_NAND_PARTITION \
"clk_ignore_unused "\
"\0" \
"initrd_addr=0x83800000\0" \
"initrd_high=0xffffffff\0" \
"bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};\0" \
#if defined(CONFIG_SYS_BOOT_NAND)
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_MFG_ENV_SETTINGS \
"panel=TFT43AB\0" \
"fdt_addr=0x83000000\0" \
"fdt_high=0xffffffff\0" \
"console=ttymxc0\0" \
"bootargs=console=ttymxc0,115200 ubi.mtd=4 " \
"root=ubi0:rootfs rootfstype=ubifs " \
CONFIG_BOOTARGS_CMA_SIZE \
"mtdparts=gpmi-nand:64m(boot),16m(kernel),16m(dtb),16m(misc),-(rootfs)\0"\
"bootcmd=nand read ${loadaddr} 0x4000000 0x800000;"\
"nand read ${fdt_addr} 0x5000000 0x100000;"\
"bootz ${loadaddr} - ${fdt_addr}\0"
Note: the NAND partition order should match what you have in ' mfgtool2-yocto-mx-evk-NAND.vbs'.
PS: ubi.mtd=4 this points to the rootfs partition