2015/12/2

uboot - imx6

device/fsl/sabresd_6dq/BoardConfig.mk
TARGET_BOOTLOADER_CONFIG := imx6q:mx6qsabresdandroid_config imx6dl:mx6dlsabresdandroid_config
TARGET_BOARD_DTS_CONFIG := imx6q:imx6q-sabresd.dtb imx6dl:imx6dl-sabresd.dtb imx6q-ldo:imx6q-sabresd-ldo.dtb

Makefile:
BOOTLOADER_CROSS_TOOLCHAIN := `pwd`/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
BOOTLOADER_ENV := ARCH=arm CROSS_COMPILE=$(BOOTLOADER_CROSS_TOOLCHAIN)
HOST_PROCESSOR := $(shell cat /proc/cpuinfo | grep processor | wc -l)
TARGET_BOOTLOADER_IMAGE := $(PRODUCT_OUT)/u-boot.imx

BOOTLOADER_PATH := bootable/bootloader/uboot-imx/
BOOTLOADER_CONFIG_FILE := $(BOOTLOADER_PATH)/include/config.h

bootloader: $(TARGET_BOOTLOADER_IMAGE)

$(TARGET_BOOTLOADER_IMAGE):
        for ubootplat in $(TARGET_BOOTLOADER_CONFIG); do \
                UBOOT_PLATFORM=`echo $$ubootplat | cut -d':' -f1`; \
                UBOOT_CONFIG=`echo $$ubootplat | cut -d':' -f2`; \
        echo $(UBOOT_PLATFORM); \
        echo $(UBOOT_CONFIG); \
                $(MAKE) -C bootable/bootloader/uboot-imx/ distclean $(BOOTLOADER_ENV); \
                $(MAKE) -C bootable/bootloader/uboot-imx/ $$UBOOT_CONFIG $(BOOTLOADER_ENV); \
                $(MAKE) -C bootable/bootloader/uboot-imx/ $(BOOTLOADER_ENV); \
                install -D bootable/bootloader/uboot-imx/u-boot.imx $(PRODUCT_OUT)/u-boot-$$UBOOT_PLATFORM.imx; \
                install -D bootable/bootloader/uboot-imx/u-boot.imx $@; \
        done

所以不管 lunch 選的是什麼,bootloader 一定會 build 兩個 target (imx6q, imx6dl) 出來。
所以:
  • imx6q : mx6qsabresdandroid_config
  • imx6dl: mx6dlsabresdandroid_config

make 的 command 就是:
export ARCH=arm
export CROSS_COMPILE=`pwd`/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-

cd bootable/bootlaoder/uboot-imx
make distclean
make mx6dlsabresdandroid_config
uboot 的 README 說:
Selection of Processor Architecture and Board Type:
---------------------------------------------------

For all supported boards there are ready-to-use default
configurations available; just type "make _config".

Example: For a TQM823L module type:

        cd u-boot
        make TQM823L_config

For the Cogent platform, you need to specify the CPU type as well;
e.g. "make cogent_mpc8xx_config". And also configure the cogent
directory according to the instructions in cogent/README.


Configuration Options:
----------------------

Configuration depends on the combination of board and CPU type; all
such information is kept in a configuration file
"include/configs/.h".

Example: For a TQM823L module, all configuration settings are in
"include/configs/TQM823L.h".
所以 make mx6dlsabresdandroid_config , board_name 就是 mx6dlsabreshandroid

刪除 target out folder 的 u-boot-*, 之後 make bootloader, 才會重新 build
可以看到 make log 有:
Configuring for mx6qsabresdandroid - 
Board: mx6sabresd, 
Options: 
IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,
MX6Q,
DEFAULT_FDT_FILE="imx6q-sabresd.dtb",
DDR_MB=1024,
SYS_USE_SPINOR,
ANDROID_SUPPORT
Configuring for mx6dlsabresdandroid - 
Board: mx6sabresd, 
Options: 
IMX_CONFIG=board/freescale/mx6sabresd/mx6dl_4x_mt41j128.cfg,
MX6DL,
DEFAULT_FDT_FILE="imx6dl-sabresd.dtb",
DDR_MB=1024,
SYS_USE_SPINOR,
ANDROID_SUPPORT

沒有留言:

張貼留言