把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_H2425 #define CONFIG_FASTBOOT_PRODUCT_NAME_STR "Cynoware i.mx6dq Device"26 #include "mx6q_sabresd.h" //最重要的文件27 #include "mx6_sabresd_android.h"2829 #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\0" \"ethprime=FEC0\0" \"uboot=u-boot.bin\0" \"kernel=uImage\0" \"nfsroot=/opt/eldk/arm\0" \"bootargs_base=setenv bootargs console=ttymxc0,115200\0"\"bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs "\"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0"\"bootcmd_net=run bootargs_base bootargs_nfs; " \"tftpboot ${loadaddr} ${kernel}; bootm\0" \"bootargs_mmc=setenv bootargs ${bootargs} ip=dhcp " \"root=/dev/mmcblk0p1 rootwait\0" \"bootcmd_mmc=run bootargs_base bootargs_mmc; " \"mmc dev 3; " \"mmc read ${loadaddr} 0x800 0x2000; bootm\0" \"bootcmd=run bootcmd_net\0" \再进入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\0" \"ethprime=FEC0\0" \"fastboot_dev=mmc3\0" \"bootcmd=run hw_${hw_name}; run hw_${hw_name}_${hw_version}; run set_bootargs; booti mmc3\0"\"bootcmd_android_recovery=run hw_${hw_name}; run hw_${hw_name}_${hw_version}; run set_bootargs; booti mmc3 recovery\0"\"splashimage=0x30000000\0" \"splashpos=m,m\0" \"lvds_num=0\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\0" \"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\0" \"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\0" \"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\0" \"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\0" \"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\0" \"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\0" \"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}\0"\"hw_general=setenv lvds_num; run screen0\0" \"hw_P140=setenv lvds_num 0; run screen2\0" \"hw_S10=setenv lvds_num 0; run screen1\0" \"hw_P10=run hw_S10\0" \"hw_C6=set lvds_num; run screen5\0" \"hw_name=general\0" \"hw_version=0\0"#endif//xh: remove fb0base=... according to https://freescale.hosted.jivesoftware.com/thread/325541
/
CONFIG_CMD_FAT=y
CONFIG_HARD_I2C=yCONFIG_IMX_OTP=yCONFIG_CMD_ITEST=yCONFIG_ETH_PRIME=yCONFIG_CMD_BDI=yCONFIG_MX6Q=yCONFIG_SYS_GBL_DATA_SIZE=128CONFIG_SYS_LOAD_ADDR="CONFIG_LOADADDR"CONFIG_DISPLAY_BOARDINFO=yCONFIG_STACKSIZE="(128 * 1024)"CONFIG_SYS_HELP_CMD_WIDTH=8CONFIG_NR_DRAM_BANKS=yCONFIG_CMD_CONSOLE=yCONFIG_FEC0_PINMUX="-1"CONFIG_GET_FEC_MAC_ADDR_FROM_IIM=yCONFIG_MMC=yCONFIG_REVISION_TAG=yCONFIG_ARM=yCONFIG_FASTBOOT_INTERFACE_STR="Android fastboot"CONFIG_MX6Q_SABRESD=yCONFIG_ENV_OFFSET="(768 * 1024)"CONFIG_MXC=yCONFIG_ENV_OVERWRITE=yCONFIG_CMD_NET=yCONFIG_CMD_NFS=yCONFIG_ENV_SIZE="CONFIG_ENV_SECT_SIZE"CONFIG_CMD_PING=yCONFIG_SYS_MALLOC_LEN="(2 * 1024 * 1024)"CONFIG_SYS_NO_FLASH=yCONFIG_INITRD_TAG=yCONFIG_SYS_MMC_ENV_DEV=2CONFIG_FASTBOOT_STORAGE_EMMC_SATA=yCONFIG_CMD_CLOCK=yCONFIG_CMD_FLASH=yCONFIG_CMD_SAVEENV=yCONFIG_IMX_PWM=yCONFIG_FSL_ENV_IN_MMC=yCONFIG_CMD_IMXOTP=yCONFIG_DYNAMIC_MMC_DEVNO=yCONFIG_IMX_ECSPI=yCONFIG_SYS_BAUDRATE_TABLE="{9600, 19200, 38400, 57600, 115200}"CONFIG_FASTBOOT_SERIAL_NUM=12345CONFIG_FEC0_MIIBASE="-1"CONFIG_FLASH_HEADER=yCONFIG_MXC_GPIO=yCONFIG_CMD_SETGETDCR=yCONFIG_CMD_EXT2=yCONFIG_FEC0_IOBASE="ENET_BASE_ADDR"CONFIG_FASTBOOT_PRODUCT_NAME_STR="Cynoware i.mx6dq Device"CONFIG_SERIAL_TAG=yCONFIG_ANDROID_SYSTEM_PARTITION_MMC=5CONFIG_FASTBOOT_MANUFACTURER_STR="Freescale"CONFIG_NET_MULTI=yCONFIG_DOS_PARTITION=yCONFIG_FASTBOOT_TRANSFER_BUF="0x2c000000"CONFIG_RD_LOADADDR="0x11000000"CONFIG_CMD_FPGA=yCONFIG_SYS_FSL_ESDHC_ADDR=0CONFIG_CMD_REGUL=yCONFIG_L2_OFF=yCONFIG_SYS_I2C_SLAVE="0x8"CONFIG_ANDROID_RECOVERY=yCONFIG_CMD_ECHO=yCONFIG_GENERIC_MMC=yCONFIG_PRIME="FEC0"CONFIG_EXTRA_ENV_SETTINGS="netdev=eth0\0ethprime=FEC0\0fastboot_dev=mmc3\0bootcmd=run hw_${hw_name}; run hw_${hw_name}_${hw_version}; run set_bootargs; booti mmc3\0bootcmd_android_recovery=run hw_${hw_name}; run hw_${hw_name}_${hw_version}; run set_bootargs; booti mmc3 recovery\0splashimage=0x30000000\0splashpos=m,m\0lvds_num=0\0screen0=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\0screen1=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\0screen2=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\0screen3=setenv video video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=10M vmalloc=400M ldb=sin0\0screen4=setenv video video=mxcfb0:dev=ldb,1440x900M@60,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=28M vmalloc=512M ldb=spl0\0screen5=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\0screen6=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\0set_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}\0hw_general=setenv lvds_num; run screen0\0hw_P140=setenv lvds_num 0; run screen2\0hw_S10=setenv lvds_num 0; run screen1\0hw_P10=run hw_S10\0hw_C6=set lvds_num; run screen5\0hw_name=general\0hw_version=0\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=yCONFIG_SYS_DEF_EEPROM_ADDR=0CONFIG_SYS_MEMTEST_END="0x10010000"CONFIG_CMD_I2C=yCONFIG_ARCH_CPU_INIT=yCONFIG_CMD_IMX_DOWNLOAD_MODE=yCONFIG_BAUDRATE=115200CONFIG_SYS_MEMTEST_START="0x10000000"CONFIG_CMD_LOADB=yCONFIG_FEC0_PHY_ADDR="0xFF"CONFIG_CMD_LOADS=yCONFIG_CMD_IMI=yCONFIG_IMX_UDC=yCONFIG_ARMV7=yCONFIG_FASTBOOT_CONFIGURATION_STR="Android fastboot"CONFIG_RMII=yCONFIG_BOOTP_SUBNETMASK=yCONFIG_ANDROID_RECOVERY_BOOTARGS_MMC="NULL"CONFIG_FASTBOOT=yCONFIG_FASTBOOT_SATA_NO=0CONFIG_UART_BASE_ADDR="UART1_BASE_ADDR"CONFIG_CMD_SOURCE=yCONFIG_SPI_FLASH_IMX_M25PXX=yCONFIG_CMD_BOOTD=yCONFIG_MXC_FEC=yCONFIG_MMC_8BIT_PORTS="0xC"CONFIG_SYS_LONGHELP=yCONFIG_REF_CLK_FREQ="CONFIG_MX6_HCLK_FREQ"CONFIG_FASTBOOT_PRODUCT_ID="0x0d02"CONFIG_CMD_SPI=yCONFIG_VIDEO_MX5=yCONFIG_CORE_REGULATOR_NAME="vdd1p1"CONFIG_CMD_XIMG=yCONFIG_BOOTDELAY=3CONFIG_ANDROID_MAIN_MMC_BUS=3CONFIG_BMP_8BPP=yCONFIG_SYS_CBSIZE=1024CONFIG_FASTBOOT_VENDOR_ID="0x18d1"CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC="booti mmc3 recovery"CONFIG_ANDROID_RECOVERY_BOOTCMD_SD="booti mmc2 recovery"CONFIG_CMD_MISC=yCONFIG_ANDROID_CACHE_PARTITION_MMC=6CONFIG_ANDROID_RECOVERY_CMD_FILE="/recovery/command"CONFIG_SYS_64BIT_VSPRINTF=yCONFIG_FSL_SF=yCONFIG_DISCOVER_PHY=yCONFIG_SYS_I2C_SPEED=100000CONFIG_DISPLAY_CPUINFO=yCONFIG_CMD_BMP=yCONFIG_MXC_UART=yCONFIG_ENV_SECT_SIZE="(8 * 1024)"CONFIG_SPLASH_SCREEN=yCONFIG_IPU_V3H=yCONFIG_USB_DEVICE=yCONFIG_BOOTP_DNS=yCONFIG_CMD_MEMORY=yCONFIG_SYS_MAXARGS=32CONFIG_ANDROID_BOOT_PARTITION_MMC=yCONFIG_CMD_RUN=yCONFIG_IPADDR="192.168.1.103"CONFIG_SYS_PBSIZE="(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)"CONFIG_ANDROID_RECOVERY_PARTITION_MMC=2CONFIG_I2C_MXC=yCONFIG_CMDLINE_EDITING=yCONFIG_SYS_CONSOLE_IS_IN_ENV=yCONFIG_ANATOP_REGULATOR=yCONFIG_IMX_MMC=yCONFIG_NET_RETRY_COUNT=100CONFIG_IPU_CLKRATE=260000000CONFIG_SETUP_MEMORY_TAGS=yCONFIG_LOADADDR="0x10800000"CONFIG_CMD_BOOTI=yCONFIG_GET_DDR_TARGET_DELAY=yCONFIG_SYS_BARGSIZE="CONFIG_SYS_CBSIZE"CONFIG_AUTO_COMPLETE=yCONFIG_PERIPH_REGULATOR_NAME="vdd1p1"CONFIG_ENV_IS_IN_MMC=yCONFIG_SYS_HZ=1000CONFIG_CMD_MMC=yCONFIG_SYS_WHITE_ON_BLACK=yCONFIG_MX6_HCLK_FREQ=24000000CONFIG_CMD_SF=yCONFIG_SPI_FLASH_CS=0CONFIG_SYS_CONSOLE_ENV_OVERWRITE=yCONFIG_CMD_DHCP=yCONFIG_SYS_FSL_USDHC_NUM=4CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=yCONFIG_BOOTP_GATEWAY=yCONFIG_MX6_CLK32=32768CONFIG_CMDLINE_TAG=yCONFIG_PARTITIONS=yCONFIG_CMD_ENV=yCONFIG_ARP_TIMEOUT="200UL"CONFIG_SKIP_RELOCATE_UBOOT=yCONFIG_SYS_PROMPT="MX6Q SABRESD U-Boot > "CONFIG_LCD=yCONFIG_CONS_INDEX=yCONFIG_SERVERIP="192.168.1.101"CONFIG_CMD_MII=yCONFIG_SYS_I2C_PORT="I2C1_BASE_ADDR"CONFIG_FLASH_HEADER_OFFSET="0x400"