转自 http://blog.csdn.net/kris_fei/article/details/50518586
u-boot版本: v2015.04
branch: imx_v2015.04_3.14.52_1.1.0_ga
我们硬件参考的是sabresd demo板子,由于此branch没有对应mx6qsabresd目录,
所以参考mx6sabresd来移植了,经验证也可以开机。
以下是移植步骤:
1.
[cpp] view plain copy
- #cp -rf board/freescale/mx6sabresd board/freescale/mx6qecovacs
2.
[cpp] view plain copy
- #cp include/configs/mx6sabresd.h include/configs/mx6qecovacs.h
3.
[cpp] view plain copy
- #cp configs/mx6qsabresdandroid_defconfig configs/mx6qecovacsandroid_defconfig
修改内容为
[cpp] view plain copy
- CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qecovacs/mx6qecovacs.cfg,MX6Q,ANDROID_SUPPORT"
- CONFIG_ARM=y
- CONFIG_TARGET_MX6QECOVACS=y
- CONFIG_SYS_MALLOC_F=y
- CONFIG_SYS_MALLOC_F_LEN=0x400
- CONFIG_DM=y
- CONFIG_DM_THERMAL=y
4.
[cpp] view plain copy
- #mv board/freescale/mx6qecovacs/mx6sabresd.c board/freescale/mx6qecovacs/mx6qecovacs.c
[cpp] view plain copy
- #cp board/freescale/mx6qecovacs/mx6dl.cfg board/freescale/mx6qecovacs/mx6qecovacs.cfg
5.
修改board/freescale/mx6qecovacs/Makefile
[cpp] view plain copy
- obj-y := mx6sabresd.o
为
[cpp] view plain copy
- obj-y := mx6qecovacs.o
6.
修改board/freescale/mx6qecovacs/Kconfig
[cpp] view plain copy
- if TARGET_MX6QECOVACS
- config SYS_BOARD
- default "mx6qecovacs"
-
- config SYS_VENDOR
- default "freescale"
-
- config SYS_SOC
- default "mx6"
-
- config SYS_CONFIG_NAME
- default "mx6qecovacs"
-
- endif
7.
添加如下内容到 arch/arm/Kconfig
[cpp] view plain copy
- config TARGET_MX6QECOVACS
- bool "Support mx6qecovacs"
- select CPU_V7
- select SUPPORT_SPL
以及
[cpp] view plain copy
- source "board/freescale/mx6qecovacs/Kconfig"
8.
板子使用uart2,所以修改include/configs/mx6qecovacs.h
[cpp] view plain copy
- #define CONFIG_MXC_UART_BASE UART4_BASE
为
[cpp] view plain copy
- #define CONFIG_MXC_UART_BASE UART2_BASE
修改board/freescale/mx6qecovacs/mx6qecovacs.c
[cpp] view plain copy
- static void setup_iomux_uart(void)
- {
-
- imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));
- }
- static iomux_v3_cfg_t const uart2_pads[] = {
- MX6_PAD_GPIO_7__UART2_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
- MX6_PAD_GPIO_8__UART2_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
- };
9.
编写编译脚本build_u_boot.sh
[cpp] view plain copy
- #!/bin/bash
- export ARCH=arm
- export CROSS_COMPILE=~/daogou/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
- make distclean
- make mx6qecovacsandroid_config
- make
10.
download u-boot到SD card.
[cpp] view plain copy
- # sudo dd if=u-boot.imx of=/dev/sdx bs=1K seek=1; sync
开机: