完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
说明:这个经验是在参考网上的一些资料的基础上自己一步步摸索出来的,如果嫌看着麻烦,这有补丁,下面是详细过程。
一、创建文件夹及文件 1.tar jxvf u-boot-2016.09.tar.bz2 2.cd ./u-boot-2016.09/board/samsung/ 3.cp smdk2410 smdk2440 -rf 4.cd ../../include/configs/ 5.cp smdk2410.h smdk2440.h 6.cd ../../configs 7.cp smdk2410_defconfig smdk2440_defconfig 二、修改文件 1. cd ./u-boot-2016.09/board/samsung/smdk2440 有如下文件 Kconfig lowlevel_init.S MAINTAINERS Makefile smdk2410.c 1.1修改smdk2410.c为smdk2440.c cp smdk2410.c smdk2440.c rm smdk2410.c 1.2修改makefile obj-y := smdk2410.o 为 obj-y := smdk2440.o 1.3修改MAINTAINERS文件 SMDK2410 BOARD M: David Müller <d.mueller@elsoft.ch> S: Maintained F: board/samsung/smdk2410/ F: include/configs/smdk2410.h F: configs/smdk2410_defconfig 为 SMDK2440 BOARD M: David Müller <d.mueller@elsoft.ch> S: Maintained F: board/samsung/smdk2440/ F: include/configs/smdk2440.h F: configs/smdk2440_defconfig 1.4修改Kconfig文件 if TARGET_SMDK2410 config SYS_BOARD default "smdk2410" config SYS_VENDOR default "samsung" config SYS_SOC default "s3c24x0" config SYS_CONFIG_NAME default "smdk2410" endif 为 if TARGET_SMDK2440 config SYS_BOARD default "smdk2440" config SYS_VENDOR default "samsung" config SYS_SOC default "s3c24x0" config SYS_CONFIG_NAME default "smdk2440" endif 2.cd home/book/workspace/u-boot-2016.09/include/configs,修改smdk2440.h 3.cd home/book/workspace/u-boot-2016.09/configs,修改smdk2440_defconfig CONFIG_ARM=y CONFIG_TARGET_SMDK2410=y CONFIG_BOOTDELAY=5 CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="SMDK2410 # " CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y CONFIG_CMD_PING=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_FAT=y CONFIG_USB=y CONFIG_USB_STORAGE=y 为 CONFIG_ARM=y CONFIG_TARGET_SMDK2440=y CONFIG_BOOTDELAY=5 CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="SMDK2440 # " CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y CONFIG_CMD_PING=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y CONFIG_CMD_FAT=y CONFIG_USB=y CONFIG_USB_STORAGE=y 在uboot根目录下执行make smdk2440_defconfig,通过 4.修改uboot根目录下makefile,在文件开头 VERSION = 2016 PATCHLEVEL = 09 SUBLEVEL = EXTRAVERSION = NAME = 后面添加两行,变为 VERSION = 2016 PATCHLEVEL = 09 SUBLEVEL = EXTRAVERSION = NAME = ARCH = arm CROSS_COMPILE = arm-linux-gcc make时出现错误 CHK include/config/uboot.release CHK include/generated/version_autogenerated.h CHK include/generated/timestamp_autogenerated.h UPD include/generated/timestamp_autogenerated.h CC lib/asm-offsets.s cc1: warning: unknown register name: x18 lib/asm-offsets.c:1: error: bad value (armv8-a) for -march= switch Kbuild:43: recipe for target 'lib/asm-offsets.s' failed make[1]: *** [lib/asm-offsets.s] Error 1 Makefile:1277: recipe for target 'prepare0' failed make: *** [prepare0] Error 2 问题出现在smdk2440_defconfig 打开文件smdk2440_defconfig,执行 grep -rl "SMDK2410" ./ 查找当前文件夹下含有'SMDK2410'的文件 ./.config.old ./.config ./arch/arm/Kconfig ./arch/arm/include/asm/mach-types.h ./configs/smdk2410_defconfig ./board/samsung/smdk2440/lowlevel_init.S ./board/samsung/smdk2440/smdk2440.c ./board/samsung/smdk2410/MAINTAINERS ./board/samsung/smdk2410/Kconfig ./board/samsung/smdk2410/lowlevel_init.S ./board/samsung/smdk2410/smdk2410.c ./include/configs/smdk2440.h ./include/configs/smdk2410.h 以上文件中含有"SMDK2410" 逐个分析 .config文件 # CONFIG_TARGET_SMDK2410 is not set后添加 # CONFIG_TARGET_SMDK2440 is not set ./arch/arm/Kconfig文件 config TARGET_SMDK2410 bool "Support smdk2410" select CPU_ARM920T 后添加 config TARGET_SMDK2440 bool "Support smdk2440" select CPU_ARM920T ./arch/arm/include/asm/mach-types.h中 有 #define MACH_TYPE_SMDK2410 193 也有 #define MACH_TYPE_S3C2440 362 执行grep -rl "MACH_TYPE_SMDK2410" ./之后 ./arch/arm/include/asm/mach-types.h ./board/samsung/smdk2440/smdk2440.c ./board/samsung/smdk2410/smdk2410.c 说明机器码只出现在上述三个文件中,所以在./board/samsung/smdk2440/smdk2440.c中修改机器码 //gd->bd->bi_arch_number = MACH_TYPE_SMDK2410; gd->bd->bi_arch_number = MACH_TYPE_S3C2440;//./arch/arm/include/asm/mach-types.h ./configs/smdk2410_defconfig ./board/samsung/smdk2440/lowlevel_init.S 文件中"SMDK2410"为注释 ./board/samsung/smdk2440/smdk2440.c 文件中"SMDK2410"有注释,有机器码赋值 ./board/samsung/smdk2410/MAINTAINERS ./board/samsung/smdk2410/Kconfig ./board/samsung/smdk2410/lowlevel_init.S ./board/samsung/smdk2410/smdk2410.c ./include/configs/smdk2440.h文件中 改 #define CONFIG_S3C2410 /* specifically a SAMSUNG S3C2410 SoC */ #define CONFIG_SMDK2410 /* on a SAMSUNG SMDK2410 Board */ 为 //#define CONFIG_S3C2410 /* specifically a SAMSUNG S3C2410 SoC */ #define CONFIG_S3C2440 //#define CONFIG_SMDK2410 /* on a SAMSUNG SMDK2410 Board */ #define CONFIG_SMDK2440 ./include/configs/smdk2410.h 执行make,出现错误 In file included from ./include/common.h:18: include/config.h:5:22: error: configs/.h: No such file or directory scripts/Makefile.autoconf:75: recipe for target 'include/autoconf.mk' failed make[1]: *** [include/autoconf.mk] Error 1 make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'。 停止。 提示configs/.h: No such file or directory 找到include/config.h,该文件是自动生成的, 执行make smdk2410_defconfig时生成configs/smdk2410.h 执行make smdk2440_defconfig时生成configs/.h。 说明执行make smdk2440_defconfig有错误,上网查找make smdk2410_defconfig的执行过程,make smdk2410_defconfig根据arch/arm/Kconfig里面的source "board/samsung/smdk2410/Kconfig"找到smdk2410的Kconfig进行配置,由此,在arch/arm/Kconfig的source "board/samsung/smdk2410/Kconfig"后面加上source "board/samsung/smdk2440/Kconfig" 执行make,提示错误 LDS u-boot.lds LD u-boot arm-linux-ld:u-boot.lds:1: ignoring invalid character `#' in expression arm-linux-ld:u-boot.lds:1: syntax error Makefile:1201: recipe for target 'u-boot' failed make: *** [u-boot] Error 1 上网搜索 是smdk2440.h文件中宏定义的注释有问题 改 /*#define CONFIG_S3C2410 */ /* specifically a SAMSUNG S3C2410 SoC */ #define CONFIG_S3C2440 /*#define CONFIG_SMDK2410 */ /* on a SAMSUNG SMDK2410 Board */ #define CONFIG_SMDK2440 为 执行make,通过,成功生成u-boot.bin |
|
相关推荐
1个回答
|
|
打补丁方法:
将u-boot-2016.09-with2440.patch文件与u-boot-2016.09放在同一目录下,执行命令patch -p0 < ./u-boot-2016.09-with2440.patch,即可 |
|
|
|
只有小组成员才能发言,加入小组>>
197个成员聚集在这个小组
加入小组为什么点亮LED的例子放在NORFlash上跑会出现奇怪的现象?
2177 浏览 6 评论
1982 浏览 5 评论
韦东山老师推出的《玩转ARM裸机实战》课程将帮你以上问题一扫而光!
4540 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-20 05:32 , Processed in 0.596680 second(s), Total 79, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号