Skip to main content

X2600_添加客户自定义配置文件

一 创建整体自定义配置文件

以x2600e芯片为例,客户想创建自己的主配置,比如为 x2600e_custom_defconfig, 建议使用基础板级,基于基础板级添加自己的外设及驱动.

基础板级以存储介质区别nor,nand及emmc,分别为:

nand: x2600e_nand_5.10_defconfig

nor: x2600e_nor_5.10_defconfig

emmc:x2600e_mmc0_5.10_defconfig , x2600e_mmc1_5.10_defconfig

以nand介质为例:

bhu@bhu-PC:~/work/build$ cp configs/x2600e_nand_5.10_defconfig configs/x2600e_custom_defconfig -arf

二 修改uboot 配置

确定主配置使用的uboot配置

bhu@bhu-PC:~/work/build$ grep -nr "uboot" configs/x2600e_nand_5.10_defconfig 
3:APP_uboot_toolchain_dir=../tools/toolchains/mips-gcc720-glibc229
4:APP_uboot_dir=../bootloader/uboot-x2000
5:APP_uboot_config=x2600e_base_xImage_sfc_nand

可以看到使用的uboot配置为x2600e_base_xImage_sfc_nand

在bootloader/uboot-x2000目录下boards.cfg文件查看,通常可能需要修改的是RMEM_MB大小

bhu@bhu-PC:~/work/bootloader/uboot-x2000$ grep -nr "x2600e_base_xImage_sfc_nand" boards.cfg 
798:x2600e_base_xImage_sfc_nand mips xburst2 x2600_base ingenic x2600 x2600_base:SPL_SFC_NAND,MTD_SFCNAND,SPL_OS_BOOT,SPL_PARAMS_FIXER,X2600E_DDR,RMEM_MB=16,LPJ="11476992"

三 修改 kernel 配置

确定主配置使用的kernel配置

bhu@bhu-PC:~/work/build$ grep -nr "kernel" configs/x2600e_nand_5.10_defconfig 
6:APP_kernel_dir=../kernel/kernel
7:APP_kernel_config=x2600_evb_module_base_linux_sfc_nand_defconfig

可知,当前的kernel 配置为:x2600_evb_module_base_linux_sfc_nand_defconfig

修改kernel配置后,需要覆盖当前kernel配置

bhu@bhu-PC:~/work/kernel/kernel$ make menuconfig         //修改kernel配置
configuration written to .config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

bhu@bhu-PC:~/work/kernel/kernel$ cp .config arch/mips/configs/x2600_evb_module_base_linux_sfc_nand_defconfig //覆盖当前kernel配置

四 修改 kernel 加载的 dts 文件

查找当前kernel配置使用的dts文件

bhu@bhu-PC:~/work/kernel/kernel$ grep -nr ".dts" arch/mips/configs/x2600_evb_module_base_linux_sfc_nand_defconfig 
257:CONFIG_DT_X2600_MODULE_BASE_DTS_FILE="x2600_evb_module_base.dts"

当前使用dts文件就是x2600_evb_module_base.dts,位于kernel/kernel/module_drivers/dts目录下

通常修改dts用于uart的添加,h264解码器内存的配置等

五 修改buildroot配置

确定主配置使用的buildroot配置

bhu@bhu-PC:~/work/build$ grep -nr "buildroot" configs/x2600e_nand_5.10_defconfig 
8:APP_br_dir=../buildroot/buildroot24
9:APP_br_config_file=configs/buildroot/buildroot24_xburst2_mini_adb_defconfig
247:# APP_br_root_login_keep_buildroot is not set

可知,当前的buildroo配置为:buildroot24_xburst2_mini_adb_defconfig

修改buildroot配置后,需要覆盖当前buildroot配置

bhu@bhu-PC:~/work/buildroot/buildroot24$ make menuconfig         // 修改buildroot配置
configuration written to /home/bhu/work/buildroot/buildroot24/.config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

bhu@bhu-PC:~/work/buildroot/buildroot24$ cp .config ../../build/configs/buildroot/buildroot24_xburst2_mini_adb_defconfig //覆盖

六 整体编译

修改完配置,重新make配置,整体编译下

bhu@bhu-PC:~/work/build$ make x2600e_custom_defconfig
bhu@bhu-PC:~/work/build$ make