I created a u-boot for my custom board using the i.MX6ull processor. I need it to work with NAND flash.
It boots from USB, and I am starting with the default NAND script. Because it got the error, I added a few commands with my own script. I added nand info and printenv:
FB: ucmd if env exists nandfit_part; then nand erase.part nandfit; nand write ${fastboot_buffer} nandfit ${fastboot_bytes}; else true; fi;
FB: ucmd nand info
FB: ucmd printenv
FB: ucmd nandbcb init ${fastboot_buffer} nandboot ${fastboot_bytes}
FB: Done
Is nandboot documented anywhere?
Here is the output of NAND info, which seems right to me:
Device 0: nand0, sector size 256 KiB
Page size 4096 b
OOB size 256 b
Erase size 262144 b
subpagesize 4096 b
options 0x40004200
bbt options 0x00060000
Here is the output of printenv, which is probably showing what is wrong, if I knew where to look:
baudrate=115200
bootargs=console=ttymxc0,115200 rdinit=/linuxrc clk_ignore_unused
bootcmd=nand read ${loadaddr} 0x180000 0x1000000;nand read ${fdt_addr} 0x1180000 0x80000;if test ${tee} = yes; then nand read ${tee_addr} 0x1200000 0x100000;bootm ${tee_addr} - ${fdt_addr};else bootz ${loadaddr} - ${fdt_addr};fi
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;
bootdelay=5
console=ttymxc0
emmc_ack=1
emmc_dev=1
ethprime=eth1
fastboot_buffer=0x80800000
fastboot_bytes=9fc00
fdt_addr=0x83000000
fdt_high=0xffffffff
filesize=9fc00
initrd_addr=0x86800000
initrd_high=0xffffffff
kboot=bootz
loadaddr=0x80800000
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk_ignore_unused
mtdparts=mtdparts=gpmi-nand:1m(u-boot),256k(env1),256k(env2),16m(nandkernel),512k(nanddtb),1m(nandtee),-(nandrootfs)
nand_erasesize=40000
nand_oobsize=100
nand_writesize=1000
sd_dev=1
serial#=201a79d2677f0fb5
splashimage=0x8c000000
tee=yes
tee_addr=0x84000000
Solved! Go to Solution.
I figured this out. To get the partition related stuff to work, you need:
CONFIG_MTD_PARTITIONS=y
In the U-Boot configuration. I had been looking in configs/mx6ul_14x14_evk_optee_defconfig and this does not have MTD partitions turned on.
I figured this out. To get the partition related stuff to work, you need:
CONFIG_MTD_PARTITIONS=y
In the U-Boot configuration. I had been looking in configs/mx6ul_14x14_evk_optee_defconfig and this does not have MTD partitions turned on.
I added four environmental variables to the uuu.auto script and it boots successfully:
FB: ucmd setenv partition nand0,0
FB: ucmd setenv mtddevname nandboot
FB: ucmd setenv mtddevnum 0
FB: ucmd setenv mtdids "nand0=gpmi-nand"
So now I need to figure out what is wrong with my U-Boot build that these are not in my environment.
I assume there must be something wrong with the U-Boot configuration file?