[转]u-boot-2010.12移植到2440(一,编译)

2024-01-07 02:08
文章标签 编译 移植 boot 2440 2010.12

本文主要是介绍[转]u-boot-2010.12移植到2440(一,编译),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

u-boot-2010.12移植到2440(一,编译)

转自

http://my.chinaunix.net/space.php?uid=24319701&do=blog&id=125381

 

2010 年初曾经将 uboot 2009.11.1 移植到我们自己做的一块 2440 单板上,该单板具有 64M SDRAM  64M nand FLASH ,网卡为 DM9000 。最新版本的 uboot 源码有较大的变化,此次计划利用几天时间将最新版本的 u-boot-2010.12 移植到该单板 上,在此记录移植过程及遇到的问题以备忘并供朋友参考。


移植的第一步当然是下载最新版本的uboot源码,下载地址如下:
ftp://ftp.denx.de/pub/u-boot/u-boot-2010.12.tar.bz2
进入相应路径:
cd /home/bsc
解压缩:
tar jxvf u-boot-2010.12.tar.bz2
进入生成的文件夹,在uboot主目录:
cd u-boot-2010.12
首先编译下看看是否可以编译成功(交叉编译器为4.3.2):

make distclean              /*清除已经形成的链接,修改顶层Makefile文件必须执行*/
make smdk2410_config

[root@localhost u-boot-2010.12]# make smdk2410_config

awk '(NF && $1 !~ /^#/) { print $1 ": " $1 "_config; $(MAKE)" }' boards.cfg > .boards.depend

Configuring for smdk2410 board...

 [root@localhost u-boot-2010.12]# make smdk2410_config

Generating include/autoconf.mk

Generating include/autoconf.mk.dep

Configuring for smdk2410 board...

[root@localhost u-boot-2010.12]#
然后make all
make测试一下,产生如下错误
board.c: In function '__dram_init_banksize':
board.c:233: error: 'CONFIG_SYS_SDRAM_BASE' undeclared (first use in this function)
board.c:233: error: (Each undeclared identifier is reported only once
board.c:233: error: for each function it appears in.)
board.c: In function 'board_init_f':
board.c:279: error: 'CONFIG_SYS_INIT_SP_ADDR' undeclared (first use in this function)
board.c:312: error: 'CONFIG_SYS_SDRAM_BASE' undeclared (first use in this function)
make[1]: *** [board.o] Error 1
make[1]: Leaving directory `/home/bsc/u-boot-2010.12/arch/arm/lib'
make: *** [arch/arm/lib/libarm.o] Error 2
宏未定义,可能是新版ubootbug
smdk2410.h中添加
#define CONFIG_SYS_SDRAM_BASE             0x00000000
#define CONFIG_SYS_INIT_SP_ADDR              (CONFIG_SYS_TEXT_BASE - GENERATED_GBL_DATA_SIZE)

修改完毕再次编译出现如下错误:

arch/arm/lib/libarm.o: In function `arch_lmb_reserve':

/home/bsc/u-boot-2010.12/arch/arm/lib/bootm.c:74: undefined reference to `get_sp'

arm-linux-ld: BFD (Sourcery G++ Lite 2008q3-72) 2.18.50.20080215 assertion fail /scratch/julian/lite-respin/linux/obj/binutils-src-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/bfd/elf32-arm.c:9537

arm-linux-ld: BFD (Sourcery G++ Lite 2008q3-72) 2.18.50.20080215 assertion fail /scratch/julian/lite-respin/linux/obj/binutils-src-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/bfd/elf32-arm.c:9771

/bin/sh: line 1: 27564 Segmentation fault      arm-linux-ld -Bstatic -T u-boot.lds -pie -Ttext 0x33F80000 $UNDEF_SYM arch/arm/cpu/arm920t/start.o --start-group api/libapi.o arch/arm/cpu/arm920t/libarm920t.o arch/arm/cpu/arm920t/s3c24x0/libs3c24x0.o arch/arm/lib/libarm.o common/libcommon.o disk/libdisk.o drivers/bios_emulator/libatibiosemu.o drivers/block/libblock.o drivers/dma/libdma.o drivers/fpga/libfpga.o drivers/gpio/libgpio.o drivers/hwmon/libhwmon.o drivers/i2c/libi2c.o drivers/input/libinput.o drivers/misc/libmisc.o drivers/mmc/libmmc.o drivers/mtd/libmtd.o drivers/mtd/nand/libnand.o drivers/mtd/onenand/libonenand.o drivers/mtd/spi/libspi_flash.o drivers/mtd/ubi/libubi.o drivers/net/libnet.o drivers/net/phy/libphy.o drivers/pci/libpci.o drivers/pcmcia/libpcmcia.o drivers/power/libpower.o drivers/rtc/librtc.o drivers/serial/libserial.o drivers/spi/libspi.o drivers/twserial/libtws.o drivers/usb/gadget/libusb_gadget.o drivers/usb/host/libusb_host.o drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o drivers/video/libvideo.o drivers/watchdog/libwatchdog.o fs/cramfs/libcramfs.o fs/ext2/libext2fs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o fs/reiserfs/libreiserfs.o fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o lib/libfdt/libfdt.o lib/libgeneric.o lib/lzma/liblzma.o lib/lzo/liblzo.o net/libnet.o post/libpost.o board/samsung/smdk2410/libsmdk2410.o --end-group /home/bsc/u-boot-2010.12/arch/arm/lib/eabi_compat.o -L /usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t -lgcc -Map u-boot.map -o u-boot

make: *** [u-boot] Error 139

查看bootm.c:代码,发现里面明明存在get_sp()函数,支持在一些宏定义条件下。可能是这些宏未定义导致该函数未编译。查到网上一个patch

[PATCH] arm: get_sp() should always be compiled

<ratbert.chuang <at> gmail.com>
2010-11-01 07:55:27 GMT

From: Po-Yu Chuang <ratbert <at> faraday-tech.com>

get_sp() was incorrectly excluded if none of

  CONFIG_SETUP_MEMORY_TAGS

  CONFIG_CMDLINE_TAG

  CONFIG_INITRD_TAG

  CONFIG_SERIAL_TAG

  CONFIG_REVISION_TAG

were defined.

 

Signed-off-by: Po-Yu Chuang <ratbert <at> faraday-tech.com>

---

 arch/arm/lib/bootm.c |    4 +---

 1 files changed, 1 insertions(+), 3 deletions(-)

 

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c

index a1649ee..7734953 100644

--- a/arch/arm/lib/bootm.c

+++ b/arch/arm/lib/bootm.c

@@ -327,12 +327,12 @@ void setup_revision_tag(struct tag **in_params)

 }

 #endif  /* CONFIG_REVISION_TAG */

 

-

 static void setup_end_tag (bd_t *bd)

 {

        params->hdr.tag = ATAG_NONE;

        params->hdr.size = 0;

 }

+#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */

 

 static ulong get_sp(void)

 {

@@ -341,5 +341,3 @@ static ulong get_sp(void)

        asm("mov %0, sp" : "=r"(ret) : );

        return ret;

 }

-

-#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */

修改完毕后,再次编译通过(从编译过程来看,新版本的BUG还不少)。

 

这篇关于[转]u-boot-2010.12移植到2440(一,编译)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/578374

相关文章

Spring Boot整合消息队列RabbitMQ的实现示例

《SpringBoot整合消息队列RabbitMQ的实现示例》本文主要介绍了SpringBoot整合消息队列RabbitMQ的实现示例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的... 目录RabbitMQ 简介与安装1. RabbitMQ 简介2. RabbitMQ 安装Spring

Spring Boot 中正确地在异步线程中使用 HttpServletRequest的方法

《SpringBoot中正确地在异步线程中使用HttpServletRequest的方法》文章讨论了在SpringBoot中如何在异步线程中正确使用HttpServletRequest的问题,... 目录前言一、问题的来源:为什么异步线程中无法访问 HttpServletRequest?1. 请求上下文与线

在 Spring Boot 中使用异步线程时的 HttpServletRequest 复用问题记录

《在SpringBoot中使用异步线程时的HttpServletRequest复用问题记录》文章讨论了在SpringBoot中使用异步线程时,由于HttpServletRequest复用导致... 目录一、问题描述:异步线程操作导致请求复用时 Cookie 解析失败1. 场景背景2. 问题根源二、问题详细分

Spring Boot 3 整合 Spring Cloud Gateway实践过程

《SpringBoot3整合SpringCloudGateway实践过程》本文介绍了如何使用SpringCloudAlibaba2023.0.0.0版本构建一个微服务网关,包括统一路由、限... 目录引子为什么需要微服务网关实践1.统一路由2.限流防刷3.登录鉴权小结引子当前微服务架构已成为中大型系统的标

spring-boot-starter-thymeleaf加载外部html文件方式

《spring-boot-starter-thymeleaf加载外部html文件方式》本文介绍了在SpringMVC中使用Thymeleaf模板引擎加载外部HTML文件的方法,以及在SpringBoo... 目录1.Thymeleaf介绍2.springboot使用thymeleaf2.1.引入spring

IDEA编译报错“java: 常量字符串过长”的原因及解决方法

《IDEA编译报错“java:常量字符串过长”的原因及解决方法》今天在开发过程中,由于尝试将一个文件的Base64字符串设置为常量,结果导致IDEA编译的时候出现了如下报错java:常量字符串过长,... 目录一、问题描述二、问题原因2.1 理论角度2.2 源码角度三、解决方案解决方案①:StringBui

在 Spring Boot 中使用 @Autowired和 @Bean注解的示例详解

《在SpringBoot中使用@Autowired和@Bean注解的示例详解》本文通过一个示例演示了如何在SpringBoot中使用@Autowired和@Bean注解进行依赖注入和Bean... 目录在 Spring Boot 中使用 @Autowired 和 @Bean 注解示例背景1. 定义 Stud

Spring Boot整合log4j2日志配置的详细教程

《SpringBoot整合log4j2日志配置的详细教程》:本文主要介绍SpringBoot项目中整合Log4j2日志框架的步骤和配置,包括常用日志框架的比较、配置参数介绍、Log4j2配置详解... 目录前言一、常用日志框架二、配置参数介绍1. 日志级别2. 输出形式3. 日志格式3.1 PatternL

如何使用Spring boot的@Transactional进行事务管理

《如何使用Springboot的@Transactional进行事务管理》这篇文章介绍了SpringBoot中使用@Transactional注解进行声明式事务管理的详细信息,包括基本用法、核心配置... 目录一、前置条件二、基本用法1. 在方法上添加注解2. 在类上添加注解三、核心配置参数1. 传播行为(

Spring Boot Actuator使用说明

《SpringBootActuator使用说明》SpringBootActuator是一个用于监控和管理SpringBoot应用程序的强大工具,通过引入依赖并配置,可以启用默认的监控接口,... 目录项目里引入下面这个依赖使用场景总结说明:本文介绍Spring Boot Actuator的使用,关于Spri