20160725_jeffrey - silenceuncrio/diary GitHub Wiki
- 0925 - review
- 0935 - 安裝 Yocto project cross-compilation toolchain
- 1045 - 整理問題 尋求協助
- 1125 - 在 論壇 https://community.nxp.com/docs/DOC-236994 發問
- 1130 - 看 i.MX6UL boot 相關 部分
- 1315 - BOOT_CFG2[4:3] 的 shipped value 為 2'b00
- 1430 - morris 3 號板 BOOT_CFG2 改成 0x00 - 開機 挑戰失敗
-
1735 - U-Boot -
fuse
review 先
在 m300_ubuntu_15
虛擬機上安裝 Yocto project cross-compilation toolchain
http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/
安裝的是 32 位元的 poky-glibc-i686-core-image-sato-armv7a-neon-toolchain-2.1.sh
jeffrey@jeffrey-VirtualBox:~/Downloads$ ./poky-glibc-i686-core-image-sato-armv7a-neon-toolchain-2.1.sh
Poky (Yocto Project Reference Distro) SDK installer version 2.1
===============================================================
Enter target directory for SDK (default: /opt/poky/2.1):
You are about to install the SDK to "/opt/poky/2.1". Proceed[Y/n]? y
[sudo] password for jeffrey:
Extracting SDK...............................................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
$ . /opt/poky/2.1/environment-setup-armv7a-neon-poky-linux-gnueabi
jeffrey@jeffrey-VirtualBox:~/Downloads$
cd 到 U-Boot 的 source code 目錄下後先 source the environment setup script
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/build_small/tmp/work/imx6ulevk-poky-linux-gnueabi/u-boot-imx/2015.04-r0/git$ source /opt/poky/2.1/environment-
setup-armv7a-neon-poky-linux-gnueabi
然後照著 How-To use NAND boot on i.MX6UL EVK board 來 Build the new u-boot.imx
- make distclean
- make mx6ul_14x14_evk_nand_defconfig
- make
inux-gnueabi
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/build_small/tmp/work/imx6ulevk-poky-linux-gnueabi/u-boot-imx/2015.04-r0/git$ make distclean
CLEAN scripts/basic
CLEAN scripts/kconfig
CLEAN include/config include/generated
CLEAN .config include/autoconf.mk include/autoconf.mk.dep include/config.h
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/build_small/tmp/work/imx6ulevk-poky-linux-gnueabi/u-boot-imx/2015.04-r0/git$ make mx6ul_14x14_evk_nand_defconf
ig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
jeffrey@jeffrey-VirtualBox:~/M300/fsl-release-bsp/build_small/tmp/work/imx6ulevk-poky-linux-gnueabi/u-boot-imx/2015.04-r0/git$ make
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
...
LDS u-boot.lds
LD u-boot
OBJCOPY u-boot.bin
CFGS board/freescale/mx6ul_14x14_evk/imximage.cfg.cfgtmp
MKIMAGE u-boot.imx
OBJCOPY u-boot.srec
ucl2.xml
內容修改如下
<UCL>
<CFG>
<STATE name="BootStrap" dev="MX6SL" vid="15A2" pid="0063"/>
<STATE name="BootStrap" dev="MX6D" vid="15A2" pid="0061"/>
<STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/>
<STATE name="BootStrap" dev="MX6SX" vid="15A2" pid="0071"/>
<STATE name="BootStrap" dev="MX6UL" vid="15A2" pid="007D"/>
<STATE name="BootStrap" dev="MX7D" vid="15A2" pid="0076"/>
<STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/>
</CFG>
<LIST name="NAND Flash" desc="Choose NAND as media">
<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6ul%6uluboot%_%nand%.imx" ifdev="MX6UL">Loading U-boot</CMD>
<CMD state="BootStrap" type="load" file="firmware/zImage" address="0x80800000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Kernel.</CMD>
<CMD state="BootStrap" type="load" file="firmware/%initramfs%" address="0x83800000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Initramfs.</CMD>
<CMD state="BootStrap" type="load" file="firmware/zImage-imx6ul-%6uldtb%-%nanddtb%.dtb" address="0x83000000"
loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL">Loading device tree.</CMD>
<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>
<!--burn the uboot to NAND: -->
<CMD state="Updater" type="push" body="$ mount -t debugfs debugfs /sys/kernel/debug">Mounting debugfs</CMD>
<CMD state="Updater" type="push" body="$ flash_erase /dev/mtd%part_uboot% 0 0">Erasing Boot partition</CMD>
<CMD state="Updater" type="push" body="send" file="files/u-boot-imx6ul%6uluboot%_%nand%.imx" ifdev="MX6UL">Sending u-boot.bin</CMD>
<CMD state="Updater" type="push" body="$ kobs-ng init -x -v --chip_0_device_path=/dev/mtd%part_uboot% $FILE">Flashing Bootloader</CMD>
<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
</LIST>
</UCL>
透過 MfgTool 燒錄的過程記錄在 2016-07-25-MfgTool.log
試著從 NAND Flash 開機
還是失敗
差不多可以整理一下問題然後尋求協助了
已經在論壇上 https://community.nxp.com/docs/DOC-236994 發問
We follow this guide(https://community.nxp.com/docs/DOC-236994) to try to use NAND boot on i.MX6UL EVK board The NAND Flash we used is MX30LF1G18AC - 3V, 1G-bit NAND Flash Memory
The configuration of NAND flash as following: BOOT_CFG1[7] = 1'b1 - Boot fro NAND Inferface BOOT_CFG1[6] = 1'b0 - raw NAND BOOT_CFG1[5:4] = 2'b01 - 64 pages in block BOOT_CFG1[3:2] = 2'b00 - 1 nand device BOOT_CFG1[1:0] = 2'b01 - 2 row address cycles
The MfgTool we used is L4.1.15_1.0.0_ga-mfg-tools.tar.gz
After burned the NAND flash, we change the boot mode to boot from NAND But can not see anything from console(we already make sure the baud rate setting) we can change to boot from MicroSD, so we use U-Boot tool "nand dump" to make sure MfgTool already burned the image we want
Please help us this issue
順便幫 i.MX6UL 的 FAE Mike 還有 NAND Flash 的 FAE Frank update 一下
感覺要看一下跟 i.MX6UL boot 的相關部分
看看從 NAND Flash boot 還要注意些什麼
我們目前 M300 的 CPU Board 的 BOOT_CFG2 為 0x08
跟 公板 一樣
這表示 BOOT_CFG2[4:3] 為 2'b01 - 2 boot search count
拜託 morris 幫我將 BOOT_CFG2 改成 0x00 - BOOT_CFG2[4:3] 為 2'b00
雖然一樣是 2 boot search count
不過 i.MX 6UltraLite Applications Processor Reference Manual
的 8.5.2.1 NAND eFUSE Configuration
提到
BOOT_CFG2[4:3] 的 shipped value 為 2'b00
morris 已經幫我將 3 號板的 BOOT_CFG2 改成 0x00 - BOOT_CFG2[4:3] 為 2'b00
開機... 挑戰失敗...
已經沒頭緒要 try 什麼了
如果從 MicroSD 開機的話
U-Boot 有提供一個工具叫做 fuse
搭配 i.MX 6UltraLite Applications Processor Reference Manual
的 Chapter 35 On-Chip OTP Controller (OCOTP_CTRL)
從 35.5 OCOTP Memory Map/Register Definition
的 OCOTP memory map
可以知道怎麼利用 U-Boot 的 fuse 來存取相對應的 NAND Boot eFuse
例如 BOOT_CFG1
的 addr 為 0x450[7:0]
從 OCOTP memory map
的 Absolute address(hex)
往下找到 21B_C450
找到 35.5.16 Value of OTP Bank0 Word5 (Configuration and Manufacturing Info.) (OCOTP_CFG4)
所以我們知道使用 fuse read 0 5
便可以讀取 0x450[31:0] 的值
使用 fuse prog 0 5 0x12345678
便可以設定 0x450[31:0] 的值
依此類推