把autoconfig.mk和/include/configs/
$(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h //这个地方指定了autoconfig.mk的由来
@$(XECHO) Generating $@ ;
set -e ;
: Generate the dependancies ;
$(CC) -x c -DDO_DEPS_ONLY -M $(HOSTCFLAGS) $(CPPFLAGS)
-MQ $(obj)include/autoconf.mk include/common.h > $@
$(obj)include/autoconf.mk: $(obj)include/config.h //主要由config.h中的头文件包含而来
@$(XECHO) Generating $@ ;
set -e ;
: Extract the config macros ;
$(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h |
sed -n -f tools/scripts/define2mk.sed > $@.tmp &&
mv $@.tmp $@
在我的/include/config.h文件的内容是:
1 /* Automatically generated - do not edit */
2 #include <configs/mx6q_sabresd_android_2G.h>
3 #include <asm/config.h>
顺藤摸瓜,进入mx6q_sabresd_android_1G.h文件,内容如下
22 #ifndef MX6Q_SABRESD_ANDROID_H
23 #define MX6Q_SABRESD_ANDROID_H
24
25 #define CONFIG_FASTBOOT_PRODUCT_NAME_STR "Cynoware i.mx6dq Device"
26 #include "mx6q_sabresd.h" //最重要的文件
27 #include "mx6_sabresd_android.h"
28
29 #endif
再进入mx6q_sabresd.h文件如下为选取的部分CONFIG_定义
#define CONFIG_CMD_PING
#define CONFIG_CMD_DHCP
#define CONFIG_CMD_MII
#define CONFIG_CMD_NET
#define CONFIG_NET_RETRY_COUNT 100
#define CONFIG_NET_MULTI 1
#define CONFIG_BOOTP_SUBNETMASK
#define CONFIG_BOOTP_GATEWAY
#define CONFIG_BOOTP_DNS
#define CONFIG_CMD_SPI
#define CONFIG_CMD_I2C
#define CONFIG_CMD_IMXOTP
/* Enable below configure when supporting nand */
#define CONFIG_CMD_SF
#define CONFIG_CMD_MMC
#define CONFIG_CMD_ENV
#define CONFIG_CMD_REGUL
#define CONFIG_CMD_CLOCK
#define CONFIG_REF_CLK_FREQ CONFIG_MX6_HCLK_FREQ
/* #define CONFIG_CMD_SATA */
#undef CONFIG_CMD_IMLS
#define CONFIG_CMD_IMX_DOWNLOAD_MODE
#define CONFIG_BOOTDELAY 3
#define CONFIG_PRIME "FEC0"
#define CONFIG_LOADADDR 0x10800000 /* loadaddr env var */
#define CONFIG_RD_LOADADDR (0x1300000)
#define CONFIG_EXTRA_ENV_SETTINGS
"netdev=eth0 "
"ethprime=FEC0 "
"uboot=u-boot.bin "
"kernel=uImage "
"nfsroot=/opt/eldk/arm "
"bootargs_base=setenv bootargs console=ttymxc0,115200 "
"bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs "
"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp "
"bootcmd_net=run bootargs_base bootargs_nfs; "
"tftpboot ${loadaddr} ${kernel}; bootm "
"bootargs_mmc=setenv bootargs ${bootargs} ip=dhcp "
"root=/dev/mmcblk0p1 rootwait "
"bootcmd_mmc=run bootargs_base bootargs_mmc; "
"mmc dev 3; "
"mmc read ${loadaddr} 0x800 0x2000; bootm "
"bootcmd=run bootcmd_net "
再进入mx6_sabresd_android.h文件分析
#ifndef MX6Q_SABRESD_ANDROID_INC_H
#define MX6Q_SABRESD_ANDROID_INC_H
#define CONFIG_USB_DEVICE
#define CONFIG_IMX_UDC 1
#define CONFIG_FASTBOOT 1
#define CONFIG_FASTBOOT_STORAGE_EMMC_SATA
#define CONFIG_FASTBOOT_VENDOR_ID 0x18d1
#define CONFIG_FASTBOOT_PRODUCT_ID 0x0d02
#define CONFIG_FASTBOOT_BCD_DEVICE 0x311
#define CONFIG_FASTBOOT_MANUFACTURER_STR "Freescale"
#define CONFIG_FASTBOOT_INTERFACE_STR "Android fastboot"
#define CONFIG_FASTBOOT_CONFIGURATION_STR "Android fastboot"
#define CONFIG_FASTBOOT_SERIAL_NUM "12345"
#define CONFIG_FASTBOOT_SATA_NO 0
/* For system.img growing up more than 256MB, more buffer needs
* to receive the system.img*/
#define CONFIG_FASTBOOT_TRANSFER_BUF 0x2c000000
#define CONFIG_FASTBOOT_TRANSFER_BUF_SIZE 0x14000000 /* 320M byte */
#define CONFIG_CMD_BOOTI
#define CONFIG_ANDROID_RECOVERY
/* which mmc bus is your main storage ? */
#define CONFIG_ANDROID_MAIN_MMC_BUS 3
#define CONFIG_ANDROID_BOOT_PARTITION_MMC 1
#define CONFIG_ANDROID_SYSTEM_PARTITION_MMC 5
#define CONFIG_ANDROID_RECOVERY_PARTITION_MMC 2
#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6
#define CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC NULL
#define CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC
"booti mmc3 recovery"
#define CONFIG_ANDROID_RECOVERY_BOOTCMD_SD
"booti mmc2 recovery"
#define CONFIG_ANDROID_RECOVERY_CMD_FILE "/recovery/command"
#define CONFIG_INITRD_TAG
#undef CONFIG_LOADADDR
#undef CONFIG_RD_LOADADDR
#undef CONFIG_EXTRA_ENV_SETTINGS
#define CONFIG_LOADADDR 0x10800000 /* loadaddr env var */
#define CONFIG_RD_LOADADDR 0x11000000
#define CONFIG_INITRD_TAG
#define CONFIG_EXTRA_ENV_SETTINGS
"netdev=eth0 "
"ethprime=FEC0 "
"fastboot_dev=mmc3 "
"bootcmd=run hw_${hw_name}; run hw_${hw_name}_${hw_version}; run set_bootargs; booti mmc3 "
"bootcmd_android_recovery=run hw_${hw_name}; run hw_${hw_name}_${hw_version}; run set_bootargs; booti mmc3 recovery "
"splashimage=0x30000000 "
"splashpos=m,m "
"lvds_num=0 "
"screen0=setenv video video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=10M,28M vmalloc=512M ldb=dul1 "
"screen1=setenv video video=mxcfb0:dev=ldb,1024x600M@60,if=RGB666,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=10M,28M vmalloc=512M ldb=dul1 "
"screen2=setenv video video=mxcfb0:dev=ldb,1366x768M@60,if=RGB666,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=14M,28M vmalloc=512M ldb=dul1 "
"screen3=setenv video video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=10M vmalloc=400M ldb=sin0 "
"screen4=setenv video video=mxcfb0:dev=ldb,1440x900M@60,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=28M vmalloc=512M ldb=spl0 "
"screen5=setenv video video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24,bpp=32 video=mxcfb1:dev=hdmi,1024x768M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=10M,28M vmalloc=512M ldb=dul1 "
"screen6=setenv video video=mxcfb0:dev=ldb,LDB-XGA,if=RGB666,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=10M,28M vmalloc=512M ldb=dul1 "
"set_bootargs=setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 androidboot.hardware=freescale init=/init ${video} enable_wait_mode=off calibration hw_name=${hw_name} hw_version=${hw_version} fec_mac=${fec_mac} "
"hw_general=setenv lvds_num; run screen0 "
"hw_P140=setenv lvds_num 0; run screen2 "
"hw_S10=setenv lvds_num 0; run screen1 "
"hw_P10=run hw_S10 "
"hw_C6=set lvds_num; run screen5 "
"hw_name=general "
"hw_version=0 "
#endif
//xh: remove fb0base=... according to https://freescale.hosted.jivesoftware.com/thread/325541
/////////////////////////////////////////
CONFIG_CMD_FAT=y
CONFIG_HARD_I2C=y
CONFIG_IMX_OTP=y
CONFIG_CMD_ITEST=y
CONFIG_ETH_PRIME=y
CONFIG_CMD_BDI=y
CONFIG_MX6Q=y
CONFIG_SYS_GBL_DATA_SIZE=128
CONFIG_SYS_LOAD_ADDR="CONFIG_LOADADDR"
CONFIG_DISPLAY_BOARDINFO=y
CONFIG_STACKSIZE="(128 * 1024)"
CONFIG_SYS_HELP_CMD_WIDTH=8
CONFIG_NR_DRAM_BANKS=y
CONFIG_CMD_CONSOLE=y
CONFIG_FEC0_PINMUX="-1"
CONFIG_GET_FEC_MAC_ADDR_FROM_IIM=y
CONFIG_MMC=y
CONFIG_REVISION_TAG=y
CONFIG_ARM=y
CONFIG_FASTBOOT_INTERFACE_STR="Android fastboot"
CONFIG_MX6Q_SABRESD=y
CONFIG_ENV_OFFSET="(768 * 1024)"
CONFIG_MXC=y
CONFIG_ENV_OVERWRITE=y
CONFIG_CMD_NET=y
CONFIG_CMD_NFS=y
CONFIG_ENV_SIZE="CONFIG_ENV_SECT_SIZE"
CONFIG_CMD_PING=y
CONFIG_SYS_MALLOC_LEN="(2 * 1024 * 1024)"
CONFIG_SYS_NO_FLASH=y
CONFIG_INITRD_TAG=y
CONFIG_SYS_MMC_ENV_DEV=2
CONFIG_FASTBOOT_STORAGE_EMMC_SATA=y
CONFIG_CMD_CLOCK=y
CONFIG_CMD_FLASH=y
CONFIG_CMD_SAVEENV=y
CONFIG_IMX_PWM=y
CONFIG_FSL_ENV_IN_MMC=y
CONFIG_CMD_IMXOTP=y
CONFIG_DYNAMIC_MMC_DEVNO=y
CONFIG_IMX_ECSPI=y
CONFIG_SYS_BAUDRATE_TABLE="{9600, 19200, 38400, 57600, 115200}"
CONFIG_FASTBOOT_SERIAL_NUM=12345
CONFIG_FEC0_MIIBASE="-1"
CONFIG_FLASH_HEADER=y
CONFIG_MXC_GPIO=y
CONFIG_CMD_SETGETDCR=y
CONFIG_CMD_EXT2=y
CONFIG_FEC0_IOBASE="ENET_BASE_ADDR"
CONFIG_FASTBOOT_PRODUCT_NAME_STR="Cynoware i.mx6dq Device"
CONFIG_SERIAL_TAG=y
CONFIG_ANDROID_SYSTEM_PARTITION_MMC=5
CONFIG_FASTBOOT_MANUFACTURER_STR="Freescale"
CONFIG_NET_MULTI=y
CONFIG_DOS_PARTITION=y
CONFIG_FASTBOOT_TRANSFER_BUF="0x2c000000"
CONFIG_RD_LOADADDR="0x11000000"
CONFIG_CMD_FPGA=y
CONFIG_SYS_FSL_ESDHC_ADDR=0
CONFIG_CMD_REGUL=y
CONFIG_L2_OFF=y
CONFIG_SYS_I2C_SLAVE="0x8"
CONFIG_ANDROID_RECOVERY=y
CONFIG_CMD_ECHO=y
CONFIG_GENERIC_MMC=y
CONFIG_PRIME="FEC0"
CONFIG_EXTRA_ENV_SETTINGS="netdev=eth0 ethprime=FEC0 fastboot_dev=mmc3 bootcmd=run hw_${hw_name}; run hw_${hw_name}_${hw_version}; run set_bootargs; booti mmc3 bootcmd_android_recovery=run hw_${hw_name}; run hw_${hw_name}_${hw_version}; run set_bootargs; booti mmc3 recovery splashimage=0x30000000 splashpos=m,m lvds_num=0 screen0=setenv video video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=10M,28M vmalloc=512M ldb=dul1 screen1=setenv video video=mxcfb0:dev=ldb,1024x600M@60,if=RGB666,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=10M,28M vmalloc=512M ldb=dul1 screen2=setenv video video=mxcfb0:dev=ldb,1366x768M@60,if=RGB666,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=14M,28M vmalloc=512M ldb=dul1 screen3=setenv video video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=10M vmalloc=400M ldb=sin0 screen4=setenv video video=mxcfb0:dev=ldb,1440x900M@60,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=28M vmalloc=512M ldb=spl0 screen5=setenv video video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24,bpp=32 video=mxcfb1:dev=hdmi,1024x768M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=10M,28M vmalloc=512M ldb=dul1 screen6=setenv video video=mxcfb0:dev=ldb,LDB-XGA,if=RGB666,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=10M,28M vmalloc=512M ldb=dul1 set_bootargs=setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 androidboot.hardware=freescale init=/init ${video} enable_wait_mode=off calibration hw_name=${hw_name} hw_version=${hw_version} fec_mac=${fec_mac} hw_general=setenv lvds_num; run screen0 hw_P140=setenv lvds_num 0; run screen2 hw_S10=setenv lvds_num 0; run screen1 hw_P10=run hw_S10 hw_C6=set lvds_num; run screen5 hw_name=general hw_version=0 "
CONFIG_FB_BASE="(TEXT_BASE + 0x300000)"
CONFIG_FASTBOOT_BCD_DEVICE="0x311"
CONFIG_NETMASK="255.255.255.0"
CONFIG_FASTBOOT_TRANSFER_BUF_SIZE="0x14000000"
CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_SYS_DEF_EEPROM_ADDR=0
CONFIG_SYS_MEMTEST_END="0x10010000"
CONFIG_CMD_I2C=y
CONFIG_ARCH_CPU_INIT=y
CONFIG_CMD_IMX_DOWNLOAD_MODE=y
CONFIG_BAUDRATE=115200
CONFIG_SYS_MEMTEST_START="0x10000000"
CONFIG_CMD_LOADB=y
CONFIG_FEC0_PHY_ADDR="0xFF"
CONFIG_CMD_LOADS=y
CONFIG_CMD_IMI=y
CONFIG_IMX_UDC=y
CONFIG_ARMV7=y
CONFIG_FASTBOOT_CONFIGURATION_STR="Android fastboot"
CONFIG_RMII=y
CONFIG_BOOTP_SUBNETMASK=y
CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC="NULL"
CONFIG_FASTBOOT=y
CONFIG_FASTBOOT_SATA_NO=0
CONFIG_UART_BASE_ADDR="UART1_BASE_ADDR"
CONFIG_CMD_SOURCE=y
CONFIG_SPI_FLASH_IMX_M25PXX=y
CONFIG_CMD_BOOTD=y
CONFIG_MXC_FEC=y
CONFIG_MMC_8BIT_PORTS="0xC"
CONFIG_SYS_LONGHELP=y
CONFIG_REF_CLK_FREQ="CONFIG_MX6_HCLK_FREQ"
CONFIG_FASTBOOT_PRODUCT_ID="0x0d02"
CONFIG_CMD_SPI=y
CONFIG_VIDEO_MX5=y
CONFIG_CORE_REGULATOR_NAME="vdd1p1"
CONFIG_CMD_XIMG=y
CONFIG_BOOTDELAY=3
CONFIG_ANDROID_MAIN_MMC_BUS=3
CONFIG_BMP_8BPP=y
CONFIG_SYS_CBSIZE=1024
CONFIG_FASTBOOT_VENDOR_ID="0x18d1"
CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC="booti mmc3 recovery"
CONFIG_ANDROID_RECOVERY_BOOTCMD_SD="booti mmc2 recovery"
CONFIG_CMD_MISC=y
CONFIG_ANDROID_CACHE_PARTITION_MMC=6
CONFIG_ANDROID_RECOVERY_CMD_FILE="/recovery/command"
CONFIG_SYS_64BIT_VSPRINTF=y
CONFIG_FSL_SF=y
CONFIG_DISCOVER_PHY=y
CONFIG_SYS_I2C_SPEED=100000
CONFIG_DISPLAY_CPUINFO=y
CONFIG_CMD_BMP=y
CONFIG_MXC_UART=y
CONFIG_ENV_SECT_SIZE="(8 * 1024)"
CONFIG_SPLASH_SCREEN=y
CONFIG_IPU_V3H=y
CONFIG_USB_DEVICE=y
CONFIG_BOOTP_DNS=y
CONFIG_CMD_MEMORY=y
CONFIG_SYS_MAXARGS=32
CONFIG_ANDROID_BOOT_PARTITION_MMC=y
CONFIG_CMD_RUN=y
CONFIG_IPADDR="192.168.1.103"
CONFIG_SYS_PBSIZE="(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)"
CONFIG_ANDROID_RECOVERY_PARTITION_MMC=2
CONFIG_I2C_MXC=y
CONFIG_CMDLINE_EDITING=y
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_ANATOP_REGULATOR=y
CONFIG_IMX_MMC=y
CONFIG_NET_RETRY_COUNT=100
CONFIG_IPU_CLKRATE=260000000
CONFIG_SETUP_MEMORY_TAGS=y
CONFIG_LOADADDR="0x10800000"
CONFIG_CMD_BOOTI=y
CONFIG_GET_DDR_TARGET_DELAY=y
CONFIG_SYS_BARGSIZE="CONFIG_SYS_CBSIZE"
CONFIG_AUTO_COMPLETE=y
CONFIG_PERIPH_REGULATOR_NAME="vdd1p1"
CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_HZ=1000
CONFIG_CMD_MMC=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_MX6_HCLK_FREQ=24000000
CONFIG_CMD_SF=y
CONFIG_SPI_FLASH_CS=0
CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
CONFIG_CMD_DHCP=y
CONFIG_SYS_FSL_USDHC_NUM=4
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
CONFIG_BOOTP_GATEWAY=y
CONFIG_MX6_CLK32=32768
CONFIG_CMDLINE_TAG=y
CONFIG_PARTITIONS=y
CONFIG_CMD_ENV=y
CONFIG_ARP_TIMEOUT="200UL"
CONFIG_SKIP_RELOCATE_UBOOT=y
CONFIG_SYS_PROMPT="MX6Q SABRESD U-Boot > "
CONFIG_LCD=y
CONFIG_CONS_INDEX=y
CONFIG_SERVERIP="192.168.1.101"
CONFIG_CMD_MII=y
CONFIG_SYS_I2C_PORT="I2C1_BASE_ADDR"
CONFIG_FLASH_HEADER_OFFSET="0x400"