QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 25743|回复: 68

U-boot for lumit4510 released.

[复制链接]
发表于 2005-9-25 09:21:13 | 显示全部楼层 |阅读模式
我试着在lumit4510上移植了U-boot,目前网络和串口工作都正常。可以通过FTFP,BOOTP等传输映像文件。但是还是有很多问题,可能是有些初始化的寄存器不对.搞得很冲忙,发上来希望大家可以一起探究!U-boot是目前嵌入式系统非常热门的bootloader哦!!!
[code:1]
U-Boot 1.1.3 (Sep 24 2005 - 17:26:57)

U-Boot code: 007D0000 -> 007E83D0  BSS: -> 007F2624
IRQ Stack: 007aef7c
FIQ Stack: 007adf7c
RAM Configuration:
Bank #0: 00000000 16 MB
Flash:  2 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
lumit4510 #
[/code:1]
输入help
[code:1]lumit4510 # help               
?       - alias for 'help'                          
autoscr - run script from memory                                
base    - print or set address offset                                    
bdinfo  - print Board Info structure                                    
boot    - boot default, i.e., run 'bootcmd'                                          
bootd   - boot default, i.e., run 'bootcmd'                                          
bootm   - boot application image from memory                                            
bootp   - boot image via network using BootP/TFTP protocol                                                         
cmp     - memory compare                        
coninfo - print console devices and information                                               
cp      - memory copy                     
crc32   - checksum calculation                              
echo    - echo args to console                              
erase   - erase FLASH memory                           
flinfo  - print FLASH memory information                                       
go      - start application at address 'addr'                                             
help    - print online help                           
iminfo  - print heade application image
imls    - list all images found in flash
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
tftpboot- boot image via network using TFTP protocol
version - print monitor version
lumit4510 #
[/code:1]
download 映像
[code:1]
lumit4510 # tftp 0x10000 image-with-hello.ram
TFTP from server 192.168.1.2; our IP address is 192.1image-with-hello.ram'.
Load address: 0x10000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##################################
done
Bytes transferred = 1833948 (1bfbdc hex)
lumit4510 #
[/code:1]
ping PC主机
[code:1]
lumit4510 # ping 192.168.1.2
host 192.168.1.2 is alive
lumit4510 #
[/code:1]
 楼主| 发表于 2005-9-25 09:33:50 | 显示全部楼层
附件是u-boot.bin二进制文件,可以用flash烧写工具烧进lumit4510,然后可以reset一下板子。源码包好像太大,不能在这里上传,我会上传到公用FTP。help出来的命令应该基本都能用,但我都还不清楚有些命令该怎么用!
如内存察看
[code:1]
lumit4510 # md 0x00
00000000: ea000014 e59ff014 e59ff014 e59ff014    ................
00000010: e59ff014 e59ff014 e59ff014 e59ff014    ................
00000020: 007d0120 007d0180 007d01e0 007d0240     .}...}...}.@.}.
00000030: 007d02a0 007d0300 007d0340 ea000144    ..}...}.@.}.D...
00000040: 001c7be0 001c8724 001e6ea0 001c8720    .{..$....n.. ...
00000050: 001c2000 36365036 eb000026 e33a0000    . ..6P66&.....:.
00000060: 03a00070 0a000021 eb000035 e3370000    p...!...5.....7.
00000070: 03a00061 0a00001d e28fe020 e28af00c    a....... .......
00000080: 000080c0 001c8728 001c7be0 001e6ea0    ....(....{...n..
00000090: 001c8724 001c8720 001c2d50 001c2000    $... ...P-... ..
000000a0: e51fe028 e1a0f00e 00000000 00000000    (...............
000000b0: 00000000 00000000 00000000 00000000    ................
000000c0: e24f3044 e89321f4 e582c000 e3a0b000    D0O..!..........
000000d0: e1540005 3484b004 3afffffc e5869000    ..T....4...:....
000000e0: e5871000 e3c02002 e8880005 ea000118    ..... ..........
000000f0: e1a00000 eafffffd e28f5030 e8950680    ........0P.....[/code:1]
回复

使用道具 举报

 楼主| 发表于 2005-9-25 09:36:29 | 显示全部楼层
97k的文件还是传不了,怎么回事!?
回复

使用道具 举报

 楼主| 发表于 2005-9-25 09:44:10 | 显示全部楼层
可以在
http://159.226.40.150/ftp_root/upload/lumit/CoryXie/
找到源码包和u-boot.bin,可以看看lumit4510-modification.list.
PC上的TFTPD32也在那里!
回复

使用道具 举报

 楼主| 发表于 2005-9-25 09:47:35 | 显示全部楼层
可以在http://159.226.40.150/ftp_root/upload/lumit/CoryXie/lumit4510-u-boot(24Sep05,Cory).tar.gz找到源码包和u-boot.bin,可以看看lumit4510-modification.list.
PC上的TFTPD32也在那里!
回复

使用道具 举报

 楼主| 发表于 2005-9-26 18:39:35 | 显示全部楼层

下载uClinux映像并运行,出现Exception

我将image.ram用U-boot自带的mkimage工具生成了uImage.bin,下载并运行出现了异常。那位高手以前做过,给点建议吧,谢谢!
[code:1]
U-Boot 1.1.3 (Sep 25 2005 - 23:11:13)
                                                                                
U-Boot code: 007D0000 -> 007E83F0  BSS: -> 007F2644
IRQ Stack: 007aef7c
FIQ Stack: 007adf7c
RAM Configuration:
Bank #0: 00000000 16 MB
Flash:  2 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
lumit4510 #
                                                                                
U-Boot 1.1.3 (Sep 25 2005 - 23:11:13)
                                                                                
U-Boot code: 007D0000 -> 007E83F0  BSS: -> 007F2644
IRQ Stack: 007aef7c
FIQ Stack: 007adf7c
RAM Configuration:
Bank #0: 00000000 16 MB
Flash:  2 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
TFTP from server 192.168.1.2; our IP address is 192.168.1.5
Filename 'uImage'.
Load address: 0x100000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #########################################################
done
Bytes transferred = 1620780 (18bb2c hex)
lumit4510 # bootm 100000
## Booting image at 00100000 ...
   Image Name:   Linux 2.4.x Kernel Image
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1620716 Bytes =  1.5 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
                                                                                
Starting kernel ...
                                                                                
Linux version 2.4.20-uc0 ([email protected]) (gcc version 2.95.34Processor: Samsung S3C4510B revision 6
Architecture: SNDS100
On node 0 totalpages: 4096
zone(0): 0 pages.
zone(1): 4096 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0
Calibrating delay loop... 49.86 BogoMIPS
Memory: 16MB = 16MB total
Memory: 14452KB available (1510K code, 157K data, 40K init)
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Unhandled fault: alignment exception (13) at 0x00000001
fault-common.c(97): start_code=0x7d01e0, start_stack=0xc000000)
Internal error: Oops: 0
CPU: 0
pc : [<0001bee0>]    lr : [<0001bed4>]    Not tainted
sp : 001f7ee8  ip : 00000000  fp : 001f7f34
r10: fffffff5  r9 : 00000078  r8 : 00010f00
r7 : 001f6000  r6 : 00194644  r5 : 00ffe000  r4 : 001f6000
r3 : e3520002  r2 : e3520002  r1 : 001f6000  r0 : 00ffe000
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  Segment kernel
Control: 0
Process swapper (pid: 1, stackpage=001f7000)
Stack:
001f7ec0:                                                        0001bed4 0001b
001f7ee0: 60000013 ffffffff 00194640 007aefb8  00000000 001f7f50 007accdf 00064
001f7f00: 0000044b 0018f5e0 0000044b 000113dc  0001142c 00194644 001f6000 00014
001f7f20: 00000078 007aefb8 001f7f44 001f7f38  000183a8 0001be64 00000000 001f7
001f7f40: 000149a0 0001839c 000113dc 0001d774  00010f00 00000000 00010e00 0002c
001f7f60: 000113dc 0001142c 00194644 00000000  001b3138 00194640 007aefb8 001f7
001f7f80: 00000000 007accdf 10020000 00015d4c  20000013 00010f00 001f7fb4 001f7
001f7fa0: 0000c6a0 00015d3c 001f7fcc 001f7fb8  000086ac 0000c684 0019d0bc 001b3
001f7fc0: 001f7fdc 001f7fd0 000086ec 000086a0  001f7ffc 001f7fe0 0001204c 00008
001f7fe0: 0019d0bc 001b3138 00194644 00000000  00000000 001f8000 00015d64 00012
Backtrace:
Function entered at [<0001be54>] from [<000183a8>]
Function entered at [<0001838c>] from [<000149a0>]
Code: e5952218 e28aa001 (e5931004) e1a07004 e1510002
Kernel panic: Attempted to kill init!

[/code:1]
回复

使用道具 举报

发表于 2005-9-26 22:17:18 | 显示全部楼层
大虾,你太厉害了,能否把你生成的可执行文件,给我发一份阿,[email protected]
你是一个马力十足的坦克,向你学习!,呵...
回复

使用道具 举报

 楼主| 发表于 2005-9-26 23:31:46 | 显示全部楼层
谢谢,过奖啊,我只是学习而已,目前启动uImage还有问题,还没搞懂呢!有高手给点建议吧!我已经传到服务器了,请到上面的链接去下载源码包,里面已经编译出来一个u-boot.bin.
回复

使用道具 举报

 楼主| 发表于 2005-9-27 01:52:29 | 显示全部楼层

搞了两个小时,终于搞通了!!!

下面是在Read Hat 9上通过TFTP方式加载并运行UClinux的过程。
[code:1]
U-Boot 1.1.3 (Sep 26 2005 - 22:55:53)
                                                                                                                                               
U-Boot code: 007D0000 -> 007E83F0  BSS: -> 007F2644
IRQ Stack: 007aef7c
FIQ Stack: 007adf7c
RAM Configuration:
Bank #0: 00000000 16 MB
Flash:  2 MB
*** Warning - bad CRC, using default environment
                                                                                                                                               
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
TFTP from server 192.168.1.2; our IP address is 192.168.1.5
Filename 'uImage.bin'.
Load address: 0x100000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #########################################################
done
Bytes transferred = 1620780 (18bb2c hex)
lumit4510 # bootm 100000
## Booting image at 00100000 ...
   Image Name:   Linux 2.4.x Kernel Image
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1620716 Bytes =  1.5 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
                                                                                                                                               
Starting kernel ...
                                                                                                                                               
Linux version 2.4.20-uc0 ([email protected]) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fid4Processor: Samsung S3C4510B revision 6
Architecture: SNDS100
On node 0 totalpages: 4096
zone(0): 0 pages.
zone(1): 4096 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0
Calibrating delay loop... 49.86 BogoMIPS
Memory: 16MB = 16MB total
Memory: 14452KB available (1510K code, 157K data, 40K init)
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Samsung S3C4510 Serial driver version 0.9 (2001-12-27) with no serial options enabled
ttyS00 at 0x3ffd000 (irq = 5) is a S3C4510B
ttyS01 at 0x3ffe000 (irq = 7) is a S3C4510B
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: BE7E8-18BBE7 [VIRTUAL BE7E8-18BBE7] (RO)
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
Samsung S3C4510 Ethernet driver version 0.1 (2002-02-20) <[email protected]>
eth0: 00:40:95:36:35:34
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 1024 bind 1024)
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 40K
Shell invoked to run file: /etc/rc
Command: hostname Samsung
Command: /bin/expand /etc/ramfs.img /dev/ram0
Command: /bin/expand /etc/ramfs2048.img /dev/ram1
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram0 /var
Command: mount -t ext2 /dev/ram1 /ramdisk
Command: chmod 777 /ramdisk
Command: mkdir /var/config
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: ifconfig lo 127.0.0.1
Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo
Command: ifconfig eth0 192.168.168.101 netmask 255.255.255.0 up
Command: cat /etc/motd
Welcome to
          ____ _  _
         /  __| ||_|
    _   _| |  | | _ ____  _   _  _  _
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|
                                                                                                                                               
For further information check:
http://www.uclinux.org/
                                                                                                                                               
Execution Finished, Exiting
                                                                                                                                               
Sash command shell (version 1.1.1)
/>
CTRL-A Z for help | 19200 8N1 | NOR | Minicom 2.00.0 | VT102 |      Offline

[/code:1]
回复

使用道具 举报

 楼主| 发表于 2005-9-27 01:58:35 | 显示全部楼层
源代码和u-boot.bin都已经放在服务器上。请大家帮我测试一下,我现在还不太清楚一些命令该怎么用呢,主要是关心移植问题去了。下面是我的修改列表,主要是参考前人的工作啦!
[code:1]
1.In include/asm-arm/processor.h,line 52,rename "arm;" to "Arm"
union debug_insn {
        u32        Arm;
        u16        thumb;
};

Reason:
Error:
//////////////////////////////////////////////////////////////////////////////////////
In file included from cfi_flash.c:48:
/u/code/denx/u-boot/include/asm/processor.h:52: parse error before `1'
/u/code/denx/u-boot/include/asm/processor.h:52: warning: no semicolon
at end of struct or union
/u/code/denx/u-boot/include/asm/processor.h:54: parse error before `}'
/u/code/denx/u-boot/include/asm/processor.h:58: field `insn' has incomplete type
////////////////////////////////////////////////////////////////////////////////////////
I think,  at least for that version of the toolchain,  it implicitly
defines "arm",  and I suspect it defines it to be "1",  thus the errors
you are seeing.  You may be able to add a -Uarm to eth build line.
It did solve the problem. Thank you!

> Would you please explain a little bit more why the toolchain
> implicitly defines "arm"? Should or should not for a toolchain to
> define this? Or we can simply re-name "arm" in struct debug_insn to
> another name?

Most compilers predefine a number of things to help coders port/identify
what the code is being built for.  For example,  on a coldfire target
__mcf5200 may be defined.  Have a look at:

        http://www.ucdot.org/article.pl?sid=02/10/02/035241

I don't think the newer gcc's define "arm" and I cannot recall why the
current 2.95.3 compiler does,  but if you can easily change the name of
that field in the structure it would be the safest option IMO,

Cheers,
Davidm
2.copy evb4510.h to lumit4510.h ,modified to add flash support for SST39VF1601 from B2.h.
addjusted some values to suit lumit4510 board.
/*added to support sst39vf1601, start(24Sep05,Cory)*/
#define CFG_FLASH_WORD_SIZE                unsigned short        /* flash word size (width)        */
#define CFG_FLASH_ADDR0                0x5555        /* 1st address for flash config cycles        */
#define CFG_FLASH_ADDR1                0x2AAA        /* 2nd address for flash config cycles

/*
* The following defines are added for buggy IOP480 byte interface.
* All other boards should use the standard values (CPCI405 etc.)
*/
#define CFG_FLASH_READ0                0x0000        /* 0 is standard                        */
#define CFG_FLASH_READ1                0x0001        /* 1 is standard                        */
#define CFG_FLASH_READ2                0x0002        /* 2 is standard                        */

#define FLASH_BASE0_PRELIM CFG_FLASH_BASE         /* FLASH bank #0        */
/*added to support sst39vf1601, end(24Sep05,Cory)*/
3.enabled kernel boot args.
#define CONFIG_BOOTARGS            "console=ttyS0,19200 initrd=0x100a0040,530K root=/dev/ram0 keepinitrd"

4.replaced the flash.c from evb4510 to a flash.c found at:
http://www.linuxforum.net/forum/showflat.php?Cat=&Board=embedded&Number=569867&page=3&view=collapsed&sb=5&o=0&fpart=all

5.modified some register values to suit lumit4510 board SDRAM and flash configuration in lowlevel_init.S
according to liming's tftp bootloader for lumit4510.Thanks for his great work.

[/code:1]
回复

使用道具 举报

发表于 2005-9-27 08:32:41 | 显示全部楼层
高手,你给的那个网址,我怎么下载不下来,也找不到阿?呵。。还有个问题,请教一下你,你修改u-boot,修改了那些文件阿?
回复

使用道具 举报

 楼主| 发表于 2005-9-27 09:43:57 | 显示全部楼层
所有的东西,包括昨晚上2点左右上传的最新版本都在
http://159.226.40.150/ftp_root/upload/lumit/CoryXie/
下面,不会有错的。上面说的第一个地址的却是错的。

1.我在/u-boot-1.1.3/board/下面添加了lumit4510目录,并在这个目录下面修改了来自
evb4510目录的lowlevel_init.S,替换了flsh.c。
2.在/u-boot-1.1.3/include/configs/下面添加了lumit4510.h,这个文件大多数内容来自
evb4510.h,但是修改了一些参数值,添加了支持flsh.c的宏定义。
3.在/u-boot-1.1.3/下面的Makefile中添加了
lumit4510_config :        unconfig
        @./mkconfig $(@:_config=) arm arm720t lumit4510
所以进入/u-boot-1.1.3/就可以使用
#make lumit4510_config
#make
来生成u-boot.bin等。
其他的关于网络和串口的东西都使用evb4510的,所以没有修改,居然能用,因此难度并不大。稍微麻烦一点的就是对lowlevel_init.S的修改,要看懂这段汇编代码的工作原理才行。
目前,好像go命令执行还有问题,我也还不知道对不对,checking!
回复

使用道具 举报

 楼主| 发表于 2005-9-27 09:53:59 | 显示全部楼层
上面的启动步骤有
*** Warning - bad CRC, using default environment
的解决办法:

Question:
I have ported U-Boot to a custom board. It seems to boot OK, but it prints:

*** Warning - bad CRC, using default environment
Why?

Answer:
Most probably everything is OK. The message is printed because the flash sector or ERPROM containing the environment variables has never been initialized yet. The message will go away as soon as you save the envrionment variables using the saveenv command.
回复

使用道具 举报

发表于 2005-9-27 10:16:55 | 显示全部楼层
恩,多谢大侠的freedom精神,我已经下载下来了,我先到板子上试,有问题,再向你咨询了,呵。。非常感谢你的辛勤劳动!
回复

使用道具 举报

发表于 2005-9-28 14:48:08 | 显示全部楼层
我是初学linux,我把源程序下下来了,存放路径/root/u-boot_lumit4510_Cory/u-boot-1.1.3,如何编译,配置?大侠指点一下,先谢过了!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-19 22:10 , Processed in 0.094053 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表