开发环境:主机:Window XP SP2;linux:VMware7.01+ubuntu9.10;目标板:扬创utu2440-F开发板
交叉编译器:arm-linux-gcc4.3.2(一开始用的是编译内核的版本arm-linux-gcc3.4.1,但出现了软浮点问题,于是换成了现在用的版本,当然本人编译内核的时候还是用3.4.1版本)。
摘要:在上一篇中,移植和配置了CS8900A网卡芯片,使u-boot-2011.03的网络可以正常使用了,并可用tftp正常下载内核了。但在u-boot-2011.03命令行中,运行go或bootm命令启动下载到SDRAM中的内核时,在”Starting kernel …”地方死机了。因此,本文重点解决这个问题,使u-boot能正确引导内核。
1. 修改板级配置文件include/conskfigs/reille2440.h:
在其中IP地址配置下面添加如下配置定义(红色为增加的定义,以下同):
#define CONFIG_BOOTDELAY 3
/*#define CONFIG_BOOTARGS “root=ramfs devfs=mount console=ttySA0,9600” */
/*#define CONFIG_ETHADDR 08:00:3e:26:0a:5b ethaddr=00:0c:20:02:0a:5b */
#define CONFIG_ETHADDR 00:0c:20:02:0a:5b
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 192.168.1.168
#define CONFIG_SERVERIP 192.168.1.125
/*#define CONFIG_BOOTFILE “elinos-lart” */
/*#define CONFIG_BOOTCOMMAND “tftp; bootm” */
/***************added by guoyirong 2011.06.19**************/
#define CONFIG_SETUP_MEMORY_TAGS 1 // 如果没有定义这个参数,则uboot参数必须加入men=内存大小
#define CONFIG_INITRD_TAG 1
#define CONFIG_CMDLINE_TAG 1 // 设置bootargs出入内核必须
#define CONFIG_BOOTARGS /
“noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0”
/*
#define CONFIG_BOOTCOMMAND /
“tftp 30008000 uImage;bootm 30008000”
*/
/**********************************************************/
2. 修改文件arch/arm/lib/bootm.c
在announce_and_cleanup()函数中更改如下:
static void announce_and_cleanup(void)
{
printf(“/nStarting kernel …/n/n”);
#ifdef CONFIG_USB_DEVICE
{
extern void udc_disconnect(void);
udc_disconnect();
}
#endif
#ifndef CONFIG_REILLE2440 // added by guoyirong 2011.06.19
cleanup_before_linux();
#endif
}
实际上这里才是导致在”Starting kernel …”地方死机了的地方,但如果仅仅做这一步而没有做第一步,则会出现解压内核后就停止了的现象。
3. 重新编译
重新编译u-boot,并把u-boot下载运行,同时把内核用tftp下载到0x30008000外,然后执行bootm命令,则可成功引导内核了,测试过程如蓝色标记处:
utu-bootloader=>>> tftp 33000000 u-boot.bin
TFTP from server 192.168.1.125; our IP address is 192.168.1.168
Filename ‘u-boot.bin’.
Load address: 0x33000000
Loading: #########################
done
Bytes transferred = 126024 (1ec48 hex)
utu-bootloader=>>>go 33000000
## Starting application at 0x33000000 …
U-Boot 2011.03 (Jun 19 2011 – 14:40:52)
DRAM: 64 MiB
Flash: 512 KiB
*** Warning – bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net: CS8900-0
[reille2440]#
[reille2440]#
[reille2440]#
[reille2440]# printenv
baudrate=115200
bootargs=noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0
bootdelay=3
ethact=CS8900-0
ethaddr=00:0c:20:02:0a:5b
ipaddr=192.168.1.168
netmask=255.255.255.0
serverip=192.168.1.125
stderr=serial
stdin=serial
stdout=serial
Environment size: 268/65532 bytes
[reille2440]# setenv bootargs ‘console=ttySAC0 root=/dev/nfs nfsroot=192.168.1.125:/home/reille/net_service/root_nfs/rootfs ip=192.168.1.168:192.168.1.1:192.168.1.1:255.255.255.0:www.yctek.com:eth0:off’
[reille2440]# tftp 30008000 uImage
Using CS8900-0 device
TFTP from server 192.168.1.125; our IP address is 192.168.1.168
Filename ‘uImage’.
Load address: 0x30008000
Loading: #################################################################
##############################################################
done
Bytes transferred = 1856616 (1c5468 hex)
[reille2440]# bootm
## Booting kernel from Legacy Image at 30008000 …
Image Name: Linux-2.6.30.4reille
Created: 2011-06-05 7:17:33 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1856552 Bytes = 1.8 MiB
Load Address: 30008000
Entry Point: 30008040
Verifying Checksum … OK
XIP Kernel Image … OK
OK
Starting kernel …
Uncompressing Linux……………………………………………………………………………………………………… done, booting the kernel.
Linux version 2.6.30.4reille (reille@ubuntu) (gcc version 3.4.1) #14 Sun Jun 5 15:17:23 CST 2011
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: reille2440 dev board
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: console=ttySAC0 root=/dev/nfs nfsroot=192.168.1.125:/home/reille/net_service/root_nfs/keli_rootfs ip=192.168.1.168:192.168.1.1:192.168.1.1:255.255.255.0:www.yctek.com:eth0:off
NR_IRQS:85
irq: clearing pending ext status 00000200
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80×30
console [ttySAC0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 60980KB available (3348K code, 406K data, 104K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop… 201.93 BogoMIPS (lpj=504832)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 296 bytes
NET: Registered protocol family 16
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
yaffs Jun 3 2011 16:12:41 Installing.
msgmni has been set to 119
alg: No test for stdrng (krng)
io scheduler noop registered (default)
s3c2440-uart.0: ttyS0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: ttyS1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: ttyS2 at MMIO 0x50008000 (irq = 76) is a S3C2440
loop: module loaded
Driver ‘sd’ needs updating – please use bus_type methods
eth0 (): not using net_device_ops yet
Cirrus Logic CS8900A driver for Linux (Modified for reille2440)
eth0: CS8900A rev E at 0xe0000300 irq=53, no eeprom , addr: 08: 0:3E:26:0A:5B
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=1, 9ns Twrph0=4 39ns, Twrph1=1 9ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 4 MTD partitions on “NAND 64MiB 3,3V 8-bit”:
0x000000000000-0x000000060000 : “uboot”
0x000000060000-0x000000260000 : “kernel”
0x000000260000-0x000000460000 : “rootfs”
0x000000460000-0x000004058000 : “user”
mtd: partition “user” extends beyond the end of device “NAND 64MiB 3,3V 8-bit” — size truncated to 0x3ba0000
ohci_hcd: USB 1.1 ‘Open’ Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: S3C24XX OHCI
usb usb1: Manufacturer: Linux 2.6.30.4reille ohci_hcd
usb usb1: SerialNumber: s3c24xx
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver…
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
usbserial: USB Serial Driver core
USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver option
option: v0.7.2:USB Driver for GSM modems
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
i2c /dev entries driver
Linux video capture interface: v2.00
zc0301: V4L2 driver for ZC0301[P] Image Processor and Control Chip v1:1.10
usbcore: registered new interface driver zc0301
gspca: main v2.5.0 registered
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v0.1.0)
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.20.
No device for DAI UDA134X
No device for DAI s3c24xx-i2s
ALSA device list:
No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
IP-Config: Complete:
device=eth0, addr=192.168.1.168, mask=255.255.255.0, gw=192.168.1.1,
host=www, domain=, nis-domain=yctek.com,
bootserver=192.168.1.1, rootserver=192.168.1.125, rootpath=
Looking up port of RPC 100003/2 on 192.168.1.125
Looking up port of RPC 100005/1 on 192.168.1.125
VFS: Mounted root (nfs filesystem) on device 0:11.
Freeing init memory: 104K
Mount Pseudo Filesystem ……
推荐阅读相关文章:
- u-boot-2011.03移植系列专题汇总
- 移植u-boot-2011.03到S3C2440(utu2440)方法与步骤###1. 配置和初步编译
- 移植u-boot-2011.03到S3C2440(utu2440)的方法与步骤###8. u-boot引导启动nand flash中内核和cramfs格式根文件系统及用户文件系统yaffs2支持
- 移植u-boot-2011.03到S3C2440(utu2440)的方法与步骤###7.NAND FLASH部分移植和支持NAND FLASH启动和读写
- 移植u-boot-2011.03到S3C2440(utu2440)的方法与步骤###6.使用AXD和JLINK调试u-boot方法与步骤
- 移植u-boot-2011.03到S3C2440(utu2440)的方法与步骤###5.使用JLINK间接烧写u-boot至FLASH的方法与步骤
- 移植u-boot-2011.03到S3C2440(utu2440)的方法与步骤###3.移植和配置CS8900网卡
- 移植sqlite到嵌入式linux平台
Very true! Makes a change to see smeoone spell it out like that. 🙂