Boot在华恒S3C2410EDU板子上的移植

终于把这个uboot搞定啦。居然拖拖拉拉做了好久:(。感觉做底层的东西不懂那些硬件的东西真困难,还有那些汇编,看的头都大。幸好有光盘里有现成的ppcboot2.0的源码可以参考,哈哈。当然啦,还要多亏hn和winter的耐心帮助啦。3q。现就将我的移植步骤详细说一遍喽!(说明:我是在hharm-edu上移植的哦)
1.到sourceforge.net中下载uboot源码,我用的版本是1.1.4.(和1.1.3没太多区别,修改的地方基本一样)。
2.解压后,修改Makefile中的交叉编译路径。
ifeq ($(ARCH),arm)
CROSS_COMPILE = /opt/host/armv4l/bin/armv4l-unknown-linux-
endif
3.make smdk2410_config ;make 后出现错误,根据提示修改:
(1)将cpu/arm920t/config.mk中的PLATform_CPPFLAGS +=$( -mapcs-32,$(call cc-option,-mabi=apcs-gnu)改为PLATform_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call cc-option,-mabi=apcs-gnu),)
(2)将/include/asm-arm/processor.h中的
union debug_insn {
u32arm;
u16thumb;
};改为
union debug_insn {
u32arm_mode;
u16thumb_mode;
};
4.再make后即可编译通过啦。因为uboot中的2410板子里没有edu上用的那种flash,所以就把ppcboot中的flash文件直接拷过来啦。哈哈。方便。将/ppcboot-2.0.0/board/smdk2410/flash.c和flash-define.h拷到u-boot-1.1.4/board/smdk2410下,再将/ppcboot-2.0.0/include/flash.h拷到u-boot-1.1.4/nclude/下。hoho。flash驱动算是搞定。
5.修改include/configs/smdk2410.h,
去掉#define CONFIG_DRIVER_CS8900 1
#define CS8900_BASE 0x8000300
#define CS8900_BUS16 1

加上#define CONFIG_DRIVER_DM9000 1
#define CONFIG_DM9000_BASE 0x8000300
#define DM9000_IO CONFIG_DM9000_BASE
#define DM9000_DATA (CONFIG_DM9000_BASE+4)
#define CONFIG_DM9000_USE_16BIT
#define COMMAND_LINE "initrd=0x30800000,0x440000 mem=64M root=/dev/ram init=/linuxrc console=ttyS0"
 再修改其它一些配置,不具体写了,修改后如下:
#define CONFIG_COMMANDS /
(CONFIG_CMD_DFL | /
CFG_CMD_CACHE | /
CFG_CMD_PING | /     //加上PING哦,否则不能下载
CFG_CMD_REGINFO  | /
CFG_CMD_DATE | /
CFG_CMD_ELF)

#define CONFIG_ETHADDR08:00:3e:26:0a:5b
#define CONFIG_NETMASK          255.255.255.0
#define CONFIG_IPADDR192.168.2.110
#define CONFIG_SERVERIP192.168.2.111

#define CFG_MAX_FLASH_BANKS1/* max number of memory banks */
#define CONFIG_INTEL_E28F128 1
#ifdef CONFIG_INTEL_E28F128
#define PHYS_FLASH_SIZE0x01000000 /* 16MB */
#define CFG_FLASH_SIZEPHYS_FLASH_SIZE /* 16MB */
#define CFG_MAX_FLASH_SECT(128)/* max number of sectors on one chip */
#define CFG_ENV_ADDR(CFG_FLASH_BASE + 0x020000) /* addr of environment */
#endif

6.Ok。make编译后,生成uboot.bin文件,下载到ram中,go 30008000,出现
#Starting application at 0x30008000…
Start linux..
Setup linux parameters at 0x3000100 然后就不动了:(
我的解决方法是到cpu/arm920t/start.S中
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
//blcpu_init_crit
#endif
注释掉blcpu_init_crit。哈哈,重新编译后就可以在ram中调试啦。看了这段子程序,是调用board/smdk2410/lowlevel_init.S文件,这个文件是用来初始化ram的,估计是在ram中运行,就不能初始化了吧?(恳请大虾解惑)。
一切调试成功后,就可以烧进去了。注意现在就要把blcpu_init_crit前的注释去掉喽。烧到flash中就必须初始化ram,否则烧写后什么显示都没。

下面是我uboot工作状态:
PPCBoot 2.0.0 (Dec 15 2005 - 20:00:18)
                                                                              
PPCBoot code: 33F00000 -> 33F15D5C  BSS: -> 33F191F0
DRAM Configuration:
Bank #0: 30000000 64 MB
Flash Memory Start 0x0
Device ID of the Flash is 18
intel E28F128J3A150 init finished!!!
Flash: 16 MB
Write 18 to Watchdog and it is 18 now
start linux now(y/n):
                                                                              
SMDK2410 # tftp 30008000 u-boot.bin
<DM9000> I/O: 8000300, VID: 90000a46
NetOurIP =c0a802de
NetServerIP = c0a8026f
NetOurGatewayIP = c0a80201
NetOurSubnetMask = ffffff00
ARP broadcast 1
ARP broadcast 2
TFTP from server 192.168.2.111; our IP address is 192.168.2.222
Filename 'u-boot.bin'.
Load address: 0x0
Loading: #####################
done
Bytes transferred = 103676 (194fc hex)
SMDK2410 # go 30008000
## Starting application at 0x30008000 ...
Start linux ..
Setup linux parameters at 0x30000100
                                                                              
                                                                              
U-Boot 1.1.4 (Dec 27 2006 - 13:56:04)
                                                                              
U-Boot code: 33F80000 -> 33F994FC  BSS: -> 33F9D8DC
RAM Configuration:
Bank #0: 30000000 64 MB
Flash Memory Start 0x0
Device ID of the Flash is 18
intel E28F128J3A150 init finished!!!
Flash: 16 MB
*** Warning - bad CRC, using default environment
                                                                              
In:    serial
Out:   serial
Err:   serial
DAILY2410 #
DAILY2410 #
DAILY2410 # printenv
bootdelay=3
baudrate=115200
ethaddr=08:00:3e:26:0a:5b
ipaddr=192.168.2.110
serverip=192.168.2.111
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial
                                                                              
Environment size: 161/65532 bytes
DAILY2410 #

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwgyfy.html