i.mx6q u-boot2016.03移植笔记

使用主板:迅为i.mx6q开发板,2G DDR

参考文献:

fsl-yocto-L4.1.15_2.0.0-ga

IMXBSPPG Rev. 1, 01/2017

1.参考i.MX_BSP_Porting_Guide.pdf移植,说明比较详细,参考的是官方imx6sabresd开发板

2.修改DCD TABLE,此处参考迅为i.mx6q开发板提供的u-boot 2009版本源码,u-boot 2009和u-boot 2016对DCD配置写法有区别,但数值完全可以一致

3.按照i.MX_BSP_Porting_Guide.pdf编写build_u-boot.sh并执行

4.首次运行出现以下错误

Can't find PMIC:PFUZE100
initcall sequence 8ff97484 failed at call 178041ac (err=-19)
### ERROR ### Please RESET the board ###

原因是开发板没有用nxp的pmic所以检测不到pmic,修改方法如下:

a.include/configs/mx6_common.h 去掉#define CONFIG_LDO_BYPASS_CHECK

b.修改include/configs/mx6sabre_common.h 去掉pmic下的4个#define

c.屏蔽/board/freecale//.c中的power_init_board函数

5.烧写SD,u-boot文件夹下,命令如下

sudo dd if=u-boot.imx of=/dev/sdx bs=512 seek=2 conv=fsync

6.开发板拨码SD启动,插入SD卡,开电源

U-Boot 2016.03 (Sep 22 2018 - 16:49:18 +0800)

CPU:   Freescale i.MX6Q rev1.5 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 45C
Reset cause: POR
Board: MX6-SabreSD
I2C:   ready
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
MMC: no card present
*** Warning - MMC init failed, using default environment

No panel detected: default to Hannstar-XGA
Display: Hannstar-XGA (1024x768)
In:    serial
Out:   serial
Err:   serial
MMC: no card present
Net:   Board Net Initialization Failed
No ethernet found.
Normal Boot
Hit any key to stop autoboot:  0
MMC: no card present
MMC: no card present
Booting from net ...
No ethernet found.
No ethernet found.
Bad Linux ARM zImage magic!
=>

7 修改include/configs/.h中的define,参考i.MX Linux user's guide中几个usdhc的定义

#define CONFIG_MMCROOT        "/dev/mmcblk1p2"  /* SDHC2 */

#define CONFIG_SYS_MMC_ENV_DEV        1

8.修改SD卡引脚配置

static iomux_v3_cfg_t const usdhc2_pads[] = {
    MX6_PAD_SD2_CLK__SD2_CLK    | MUX_PAD_CTRL(USDHC_PAD_CTRL),
    MX6_PAD_SD2_CMD__SD2_CMD    | MUX_PAD_CTRL(USDHC_PAD_CTRL),
    MX6_PAD_SD2_DAT0__SD2_DATA0    | MUX_PAD_CTRL(USDHC_PAD_CTRL),
    MX6_PAD_SD2_DAT1__SD2_DATA1    | MUX_PAD_CTRL(USDHC_PAD_CTRL),
    MX6_PAD_SD2_DAT2__SD2_DATA2    | MUX_PAD_CTRL(USDHC_PAD_CTRL),
    MX6_PAD_SD2_DAT3__SD2_DATA3    | MUX_PAD_CTRL(USDHC_PAD_CTRL),
    //MX6_PAD_NANDF_D4__SD2_DATA4    | MUX_PAD_CTRL(USDHC_PAD_CTRL),
    //MX6_PAD_NANDF_D5__SD2_DATA5    | MUX_PAD_CTRL(USDHC_PAD_CTRL),
    //MX6_PAD_NANDF_D6__SD2_DATA6    | MUX_PAD_CTRL(USDHC_PAD_CTRL),
    //MX6_PAD_NANDF_D7__SD2_DATA7    | MUX_PAD_CTRL(USDHC_PAD_CTRL),
    MX6_PAD_NANDF_D2__GPIO2_IO02    | MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */
};

9.遇到No Card prent问题,检测不到SD卡插入,修改board_mmc_getcd函数适应itopeet  i.mx6Q

至此u-boot可正常检测出SD卡:

=> mmc info
Device: FSL_SDHC
Manufacturer ID: 12
OEM: 3456
Name: SDTran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes

 

你可能感兴趣的:(i.mx6q)