本人电子专业研究生毕业,挣点零花钱,承接毕业设计或者课题项目,涉及树莓派,图像识别、视频传输、python语音识别、esp32单片机、qt界面、python、嵌入式Linux。有兴趣可以联系我:15555360357
主题:IX6ULL U-boot移植记录(参考官方文档i.MX_BSP_Porting_Guide)
硬件平台:野火IMX6ULL
软件:ubuntu19.04
交叉编译器:gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf
U-Boot:uboot-imx-rel_imx_4.1.15_2.1.0_ga
kernel:linux-imx-rel_imx_4.1.15_2.1.0_ga
日期:2019-11-5
- 目的:把NXP官方的IMX6IMX6ULL参考板移植U-boot到用户IMX6ULL。
- 过程
2.1 U-boot版本选择
U-Boot v2016.03版本
2.2 准备代码
2.2.1 拷贝板级文件
2.2.2 拷贝对应头文件cp board/freescale/mx6ullevk board/freescale/mx6ull_yh -rf
需要注意的地方:cp include/configs/mx6ullevk.h include/configs/mx6ull_yh.h
CONFIG_LOADADDR:zImage加载地址
CONFIG_SYS_MALLOC_LEN:堆大小
CONFIG_STACKSIZE:栈大小
CONFIG_NR_DRAM_BANKS:ddr块个数
PHYS_SDRAM_SIZE:配置ddr内存大小(单位MB)
PHYS_SDRAM:ddr内存物理地址
fdt_file:根据配置定义CONFIG_DEFAULT_FDT_FILE <customer>.dtb或者直接定义fdt_file=<customer>.dtb
2.2.3 为用户自己的板子创建新的配置文件,在configs目录中使用命令
2.2.4 板级文件重命名cp mx6ull_14x14_evk_emmc_defconfig mx6ull_yh_emmc_defconfig并修改mx6ull_yh_emmc_defconfig中内容如下: CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ull_yh/imximage.cfg,,MX6ULL_EVK_EMMC_REWORK" CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_TARGET_MX6ULL_YH=y CONFIG_CMD_GPIO=y
2.2.5 修改板级的Makefilemv board/freescale/mx6ullevk/mx6ullevk.c board/freescale/mx6ull_yh/mx6ull_yh.c
2.2.6 修改板级board/freescale/mx6ull_yh/Kconfig,文件内容如下:obj-y := mx6ull_yh.o
还需要修改board/freescale/mx6ull_yh/imximage.cfg为如下内容:if TARGET_MX6ULL_YH config SYS_BOARD default "mx6ull_yh" config SYS_VENDOR default "freescale" config SYS_CONFIG_NAME default "mx6ull_yh" endif
PLUGIN board/freescale/mx6ull_yh/plugin.bin 0x00907000
还需要修改arch/arm/cpu/armv7/mx6/Kconfig中,找到如下内容
修改成如下形式:config TARGET_MX6ULL_14X14_EVK bool "Support mx6ull_14x14_evk" select MX6ULL select DM select DM_THERMAL
并且在最后面找到source "board/freescale/mx6ullevk/Kconfig"修改为config TARGET_MX6ULL_YH bool "Support mx6ull_yh" select MX6ULL select DM select DM_THERMAL
2.2.7 修改 board/freescale/mx6ull_yh/MAINTAINERS 文件为如下内容:source "board/freescale/mx6ull_yh/Kconfig"
2.2.8 在u-boot顶层目录下创建run.sh 并chmod 777 run.sh,文件内容如下MX6ULLEVK BOARD M: Peng Fan <peng.fan@nxp.com> S: Maintained F: board/freescale/mx6ull_yh/ F: include/configs/mx6ull_yh.h F: configs/my6ull_yh_emmc_defconfig
#!/bin/bash make distclean make ARCH=arm CROSS_COMPILE=arm-linux-gnueabifh- mx6ull_yh_emmc_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j2 V=1
然后使用 sudo dd if=u-boot.imx of=/dev/sdc bs=1k seek=1; sync 命令烧写进sd卡,我的电脑上显示dev/sdc是sd卡。
最后附上自己基于nxp官方uboot制作的补丁,补丁文件和nxp官方uboot见下方链接,使用命令:cd uboot_目录 patch -p1 < ../uboot_yh.patch
链接:https://pan.baidu.com/s/1QLmSePy2Zh_ZfwsYSUCGEA 提取码:gm9t