20160720_jeffrey - silenceuncrio/diary GitHub Wiki
- 0915 - cpu board 打件 回來
-
0935 -
Boot Device
為NAND
- console 沒任何訊息 - 0940 - MfgTool 燒錄 code
-
1050 - MfgTool
Jumping to OS image.
停住 - MXS NAND: DMA read error - 1135 - M300 CPU Board 1 號 - 3 號 和 4 號
-
1150 - 4 號板
Boot Device
為MicroSD
- 開機 - iCOS 跑起來了 - 1305 - 早上做的事 換成 公板
- 1325 - [U-Boot] MXS NAND: DMA read error
- 1510 - pioneer 分享 openvpn 在 vpn router 上的實作
-
1520 -
mx6ul_14x14_evk.h
DMA 相關部分拿掉 - build 不過 - 1640 - M300 console 是公頭 - 兩個公頭之間 杜邦線
-
1650 - 出錯的點 -
<UBOOT_DIR>/drivers/mtd/nand/mxs_nand.c
-
1800 - 套用 How-To use NAND boot on i.MX6UL EVK board 的
mx6ul_14x14_evk.h
- PASS -
1900 - 修改
ucl2.xml
- 大步前進 - 1920 - M300 的 kernel 和 rootfs 一起燒
cpu board 打件回來囉
Boot Mode
設為 Serial Downloader
的時候, MfgTool 可以認到
Boot Mode
設為 Internal Boot
, Boot Device
為 NAND
的時候
console 沒任何訊息
參考之前的紀錄 - morris NAND Flash issue
SW601{D1,D2,D3,D4} 原本為 {1,1,0,1} 改為 {1,0,0,1}
console 還是沒反應
利用 MfgTool 來燒錄 code 吧
先參考 How-To use NAND boot on i.MX6UL EVK board 來試試看
首先我要有 u-boot.imx
使用 bitbake u-boot-imx -c compile -f
得到 u-boot.imx
另存成 u-boot-imx6ulevk_nand.imx
放到
mfgtools\Profiles\Linux\OS Firmware\firmware\
mfgtools\Profiles\Linux\OS Firmware\files\
下載 imx6ul-14x14-evk-gpmi-weim.dts
放在 M300/fsl-release-bsp/build_small/tmp/work-shared/imx6ulevk/kernel-source/arch/arm/boot/dts/
在 M300/fsl-release-bsp/build_small/tmp/work-shared/imx6ulevk/kernel-source/
執行 make imx6ul-14x14-evk-gpmi-weim.dtb
得到 imx6ul-14x14-evk-gpmi-weim.dtb
在 <BUILD_DIR>/tmp/work/imx6ulevk-poky-linux-gnueabi/linux-imx/3.14.52-r0/build/arch/arm/boot/dts/
另存成 zImage-imx6ul-14x14-evk-gpmi-weim.dtb
放到
mfgtools\Profiles\Linux\OS Firmware\firmware\
mfgtools\Profiles\Linux\OS Firmware\files\
下載 mfgtool2-yocto-mx6ul-evk-nand.vbs
放到 mfgtools\
執行會出錯 - MfgTool.log
DLL version: 2.6.2
Wednesday, July 20, 2016 10:43:29 Start new logging
ModuleID[2] LevelID[1]: Boot command-- file D:\m300\tools\L4.1.15-1.0.0_ga-mfg-tools\mfgtools\Profiles\linux\OS Firmware\firmware\u-boot-imx6sxsabresd_nand.imx failed to open.errcode is 2
ModuleID[2] LevelID[1]: Parse ucl script failed, error code: 4
另存 ucl2.xml
為 ucl2.xml.original
修改 ucl2.xml
- 一步一步確認
<UCL>
...
<LIST name="NAND Flash" desc="Choose NAND as media">
...
<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>
<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
</LIST>
</UCL>
MfgTool 顯示 Jumping to OS image.
之後就停住了
M300 的 console 顯示如下
U-Boot 2015.04-imx_v2015.04_3.14.52_1.1.0_ga+g6cf684a (Jul 20 2016 - 10:17:19)
CPU: Freescale i.MX6UL rev1.1 at 396 MHz
CPU: Temperature 48 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C: ready
DRAM: 512 MiB
NAND: 128 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
MXS NAND: DMA read error
MXS NAND: Error sending command
MXS NAND: Error sending command
MXS NAND: DMA read error
...
有得查了... 還不曉得錯在哪裡...
不管 SW601{D1,D2,D3,D4} 是 {1,1,0,1} 還是 {1,0,0,1} 結果都一樣
mail 給 FAE 先
手上的 M300 CPU Board 編號是 1 號
從 morris 手上再拿個 3 號和 4 號試試
結果都一樣
將 4 號板 Boot Mode
設為 Internal Boot
, Boot Device
為 MicroSD
放入 SD Card, 開機
成功... 連 iCOS 都跑起來了
先 review 早上發生的事
如果早上做的事換成用公板的 CPU Board 來試的話
U-Boot 2015.04-imx_v2015.04_3.14.52_1.1.0_ga+g6cf684a (Jul 20 2016 - 10:17:19)
CPU: Freescale i.MX6UL rev1.0 at 396 MHz
CPU: Temperature 39 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C: ready
DRAM: 512 MiB
NAND: 0 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - readenv() failed, using default environment
Display: TFT43AB (480x272)
Video: 480x272x24
In: serial
Out: serial
Err: serial
Net: FEC1
Boot from USB for mfgtools
Use default environment for mfgtools
Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
Hit any key to stop autoboot: 0
Kernel image @ 0x80800000 [ 0x000000 - 0x552a48 ]
## Loading init Ramdisk from Legacy Image at 83800000 ...
Image Name: fsl-image-mfgtool-initramfs-imx6
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 7565864 Bytes = 7.2 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 83000000
Booting using the fdt blob at 0x83000000
Using Device Tree in place at 83000000, end 8300b875
Starting kernel ...
Booting Linux on physical CPU 0x0
...
發現就算沒有 NAND Flash 還是可以把 RAM 裡面的 kernel 帶起來
看一下 [U-Boot] MXS NAND: DMA read error
剛剛 pioneer 分享 openvpn 在 vpn router 上的實作
porting 到 M300 的工作由 jammy 負責
不過我要幫忙一下 web page 和 cgi 的 porting 部分
確定一些情報
-
mx6ul_14x14_evk.h
裡CONFIG_SYS_USE_NAND
有被 define
繼續看 [U-Boot] MXS NAND: DMA read error
看了也不確定要改啥
啥 patch 說要改什麼向下面這樣的
/*
* NAND
*/
#define CONFIG_CMD_NAND
#define CONFIG_NAND_MXS
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_SYS_NAND_BASE 0x60000000
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
目前 mx6ul_14x14_evk.h
相關部分如下
#ifdef CONFIG_SYS_USE_NAND
#define CONFIG_CMD_NAND
#define CONFIG_CMD_NAND_TRIMFFS
/* NAND stuff */
#define CONFIG_NAND_MXS
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_SYS_NAND_BASE 0x40000000
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_ONFI_DETECTION
/* DMA stuff, needed for GPMI/MXS NAND support */
#define CONFIG_APBH_DMA
#define CONFIG_APBH_DMA_BURST
#define CONFIG_APBH_DMA_BURST8
#endif
既然說是 MXS NAND: DMA read error
那我就把 mx6ul_14x14_evk.h
DMA 相關部分拿掉
#ifdef CONFIG_SYS_USE_NAND
...
/* DMA stuff, needed for GPMI/MXS NAND support */
#if 0
/* try to fix issue - MXS NAND: DMA read error */
#define CONFIG_APBH_DMA
#define CONFIG_APBH_DMA_BURST
#define CONFIG_APBH_DMA_BURST8
#endif
#endif
使用 bitbake u-boot-imx -c compile -vf
build 不過
看一下 log.do_compile.pid
- 一堆 undefined reference
...
: In function `
mxs_nand_read_buf
':
/home/jeffrey/M300/fsl-release-bsp/build_small/tmp/work/imx6ulevk-poky-linux-gnueabi/u-boot-imx/2015.04-r0/git/mx6ul_14x14_evk_nand_config/../drivers/mtd/nand/mxs_nand.c:
527
: undefined reference to `
mxs_dma_desc_append
'
/home/jeffrey/M300/fsl-release-bsp/build_small/tmp/work/imx6ulevk-poky-linux-gnueabi/u-boot-imx/2015.04-r0/git/mx6ul_14x14_evk_nand_config/../drivers/mtd/nand/mxs_nand.c:551: undefined reference to `mxs_dma_desc_append'
/home/jeffrey/M300/fsl-release-bsp/build_small/tmp/work/imx6ulevk-poky-linux-gnueabi/u-boot-imx/2015.04-r0/git/mx6ul_14x14_evk_nand_config/../drivers/mtd/nand/mxs_nand.c:557: undefined reference to `mxs_dma_go'
...
目前 M300 的 console 是公頭
兩個公頭之間先拿個杜邦線像下面的圖示連一下方便 jammy 繼續追 ethernet 的問題
繼續
感覺不能只是單純的把 mx6ul_14x14_evk.h
DMA 相關部分拿掉
出錯的點如下
<UBOOT_DIR>/drivers/mtd/nand/mxs_nand.c
/*
* Read data from NAND.
*/
static void mxs_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int length)
{
...
/* Execute the DMA chain. */
ret = mxs_dma_go(channel);
if (ret) {
printf("MXS NAND: DMA read error\n");
goto rtn;
}
...
}
套用 How-To use NAND boot on i.MX6UL EVK board 的 mx6ul_14x14_evk.h
試試吧
U-Boot 2015.04-imx_v2015.04_3.14.52_1.1.0_ga+g6cf684a (Jul 20 2016 - 17:58:13)
CPU: Freescale i.MX6UL rev1.1 at 396 MHz
CPU: Temperature 43 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C: ready
DRAM: 512 MiB
NAND: 128 MiB
MMC: FSL_SDHC: 0
*** Warning - bad CRC, using default environment
Display: TFT43AB (480x272)
Video: 480x272x24
In: serial
Out: serial
Err: serial
Net: FEC1
Error: FEC1 address not set.
Boot from USB for mfgtools
Use default environment for mfgtools
Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
Hit any key to stop autoboot: 0
Kernel image @ 0x80800000 [ 0x000000 - 0x552a48 ]
## Loading init Ramdisk from Legacy Image at 83800000 ...
Image Name: fsl-image-mfgtool-initramfs-imx6
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 7565864 Bytes = 7.2 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 83000000
Booting using the fdt blob at 0x83000000
Using Device Tree in place at 83000000, end 8300b875
Starting kernel ...
...
PASS 過了
why???
修改 ucl2.xml
- 大步前進
連 M300 的 kernel 和 rootfs 也一起燒看看吧...