u-boot-2016.05移植:(1)、建立新板并配置,使能正常编译通过
2018-03-19 10:24
525 查看
转载地址:http://blog.csdn.net/sinat_24088685/article/details/52060169
(1)、建立新板并配置,使能正常编译通过
移植u-boot-2016.05到JZ2440开发板(在smdk2410基础上修改):
1、在include/configs中复制smdk2410.h拷贝为smdk2440.h。
2、在board/samsung中复制smdk2410文件夹拷贝为smdk2440,进入smdk2440文件夹,将smdk2410.c重命名为smdk2440.c,并将该文件夹下的Makefile文件中smdk2410.o改为smdk2440.o。
3、修改顶层Makefile文件,添加:
2
4、在configs文件夹下复制smdk2410_defconfig拷贝为smdk2440_defconfig,并将其中的2410替换为2440。
5、在arch/arm/Kconfig中添加:
2
3
4
4、经过上面的修改,运行配置命令make smdk2440_defconfig,然后尝试make,出现下面的错误:
2
错误显示:在include/config.h中出现的configs/.h并不能找到,对比编译2410生成的config.h文件,可见是config.h文件生成错误。要解决问题首先我们要找到生成config.h文件的地方,在顶层Makefile文件中找了很久都没找到生成config.h文件的地方,然后就有点无从下手了,偶然想到既然config.h是生成的文件,那么其中的注释
搜索
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
由此可见,之所以在config.h中出现configs/.h,是因为CONFIG_SYS_CONFIG_NAME为空的原因。
参阅doc/README.kconfig文件中建新板步骤:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
可见,要正确生成include/config.h文件,需要配置board/samsung/smdk2440/Kconfig文件,将其中的2410改为2440。
(1)、建立新板并配置,使能正常编译通过
移植u-boot-2016.05到JZ2440开发板(在smdk2410基础上修改):
1、在include/configs中复制smdk2410.h拷贝为smdk2440.h。
2、在board/samsung中复制smdk2410文件夹拷贝为smdk2440,进入smdk2440文件夹,将smdk2410.c重命名为smdk2440.c,并将该文件夹下的Makefile文件中smdk2410.o改为smdk2440.o。
3、修改顶层Makefile文件,添加:
ARCH=arm CROSS_COMPILE ?= arm-linux-1
2
4、在configs文件夹下复制smdk2410_defconfig拷贝为smdk2440_defconfig,并将其中的2410替换为2440。
5、在arch/arm/Kconfig中添加:
config TARGET_SMDK2440 bool "Support smdk2440" select CPU_ARM920T1
2
3
4
source "board/samsung/smdk2440/Kconfig"1
4、经过上面的修改,运行配置命令make smdk2440_defconfig,然后尝试make,出现下面的错误:
include/config.h:5:22: error: configs/.h: No such file or directory1
2
错误显示:在include/config.h中出现的configs/.h并不能找到,对比编译2410生成的config.h文件,可见是config.h文件生成错误。要解决问题首先我们要找到生成config.h文件的地方,在顶层Makefile文件中找了很久都没找到生成config.h文件的地方,然后就有点无从下手了,偶然想到既然config.h是生成的文件,那么其中的注释
/* Automatically generated - do not edit */应该是通过echo命令输出到config.h文件的,搜索
Automatically generated - do not edit就应该可以找到生成config.h的地方。
搜索
Automatically generated - do not edit,找到scripts/Makefile.autoconf文件,发现config.h正是在它里面生成的:
... # include/config.h # Prior to Kconfig, it was generated by mkconfig. Now it is created here. define filechk_config_h (echo "/* Automatically generated - do not edit */"; \ for i in $$(echo $(CONFIG_SYS_EXTRA_OPTIONS) | sed 's/,/ /g'); do \ echo \#define CONFIG_$$i \ | sed '/=/ {s/=/ /;q; } ; { s/$$/ 1/; }'; \ done; \ echo \#define CONFIG_BOARDDIR board/$(if $(VENDOR),$(VENDOR)/)$(BOARD);\ echo \#include \<config_defaults.h\>; \ echo \#include \<config_uncmd_spl.h\>; \ echo \#include \<configs/$(CONFIG_SYS_CONFIG_NAME).h\>; \ echo \#include \<asm/config.h\>; \ echo \#include \<config_fallbacks.h\>;) endef ...1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
由此可见,之所以在config.h中出现configs/.h,是因为CONFIG_SYS_CONFIG_NAME为空的原因。
参阅doc/README.kconfig文件中建新板步骤:
Tips to add/remove boards ------------------------- When adding a new board, the following steps are generally needed: [1] Add a header file include/configs/<target>.h [2] Make sure to define necessary CONFIG_SYS_* in Kconfig: Define CONFIG_SYS_CPU="cpu" to compile arch/<arch>/cpu/<cpu> Define CONFIG_SYS_SOC="soc" to compile arch/<arch>/cpu/<cpu>/<soc> Define CONFIG_SYS_VENDOR="vendor" to compile board/<vendor>/common/* and board/<vendor>/<board>/* Define CONFIG_SYS_BOARD="board" to compile board/<board>/* (or board/<vendor>/<board>/* if CONFIG_SYS_VENDOR is defined) Define CONFIG_SYS_CONFIG_NAME="target" to include include/configs/<target>.h [3] Add a new entry to the board select menu in Kconfig. The board select menu is located in arch/<arch>/Kconfig or arch/<arch>/*/Kconfig. [4] Add a MAINTAINERS file It is generally placed at board/<board>/MAINTAINERS or board/<vendor>/<board>/MAINTAINERS [5] Add configs/<target>_defconfig When removing an obsolete board, the following steps are generally needed: [1] Remove configs/<target>_defconfig [2] Remove include/configs/<target>.h if it is not used by any other boards [3] Remove board/<vendor>/<board>/* or board/<board>/* if it is not used by any other boards [4] Update MAINTAINERS if necessary [5] Remove the unused entry from the board select menu in Kconfig [6] Add an entry to doc/README.scrapyard1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
可见,要正确生成include/config.h文件,需要配置board/samsung/smdk2440/Kconfig文件,将其中的2410改为2440。
相关文章推荐
- u-boot-2016.05移植:(1)、建立新板并配置,使能正常编译通过
- u-boot-2016.05移植:(1)、建立新板并配置,使能正常编译通过
- u-boot-2009.11移植(适用于TQ2440和MINI2440)第一篇:建立开发板文件,测试编译环境
- x210v3开发板u-boot-2012.10移植之四---完善开发板配置,建立x210v3_config配置
- u-boot2010.03 移植篇(一)-----建立编译目标
- u-boot2010.03 移植篇(一)-----建立编译目标
- FL2440之U-Boot移植记录(二) uboot的编译配置
- u-boot-2016.05移植:(2)、修改时钟 初始化sdram 重定位u-boot 配置smdk2440.h 修改u-boot.lds
- UBOOT-2012-10在OK6410平台的移植(三)uboot 2012.10编译配置
- u-boot2010.03 移植篇(一)-----建立编译目标
- UBOOT-2012-10在OK6410平台的移植(三)uboot 2012.10编译配置
- u-boot2010.03 移植篇(一) 建立编译目标
- u-boot-2011.06在基于s3c2440开发板的移植之编译配置
- 2013.04-rc2uboot移植(建立编译模板)
- OK6410 u-boot-2012.04.01移植一配置编译单板
- 移植u-boot-2011.03到S3C2440(utu2440)方法与步骤###1. 配置和初步编译
- u-boot2010.03 移植篇(一)-----建立编译目标
- 1.u-boot-2017.01移植到三星S5PV210教程之单板配置
- QT 5.7.0 移植之 tslib 编译配置
- itop4412 uboot 学习详细记录四丶Exynos4412 编译Makefile的配置文件config.mk分析)