Chinaunix首页 | 论坛 | 博客
  • 博客访问: 300331
  • 博文数量: 51
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1507
  • 用 户 组: 普通用户
  • 注册时间: 2013-05-23 15:58
个人简介

喜欢Liunx,C,爱好嵌入式技术,爱好Qt 等跨平台技术

文章分类

全部博文(51)

文章存档

2014年(1)

2013年(50)

分类: 嵌入式

2013-06-13 18:48:56

 执行skyeye,通过u-boot引导linux
[root@localhost u-boot-1.1.4]# skyeye

**************************** WARNING **********************************

If you want to run ELF image, you should use -e option to indicate

your elf-format image filename. Or you only want to run binary image,

you need to set the filename of the image and its entry in skyeye.conf.

***********************************************************************


Your elf file is little endian.

arch: arm

cpu info: armv4, arm920t, 41009200, ff00fff0, 2

mach info: name s3c2410x, mach_init addr 0x806bae0

ethmod num=1, mac addr=8:0:3e:26:a:5b, hostip=10.0.0.1

nandflash: dump ./nand.dump

file size:69206016

dbct info: turn on dbct!

uart_mod:0, desc_in:, desc_out:, converter:

SKYEYE: use arm920t mmu ops

Loaded RAM ./u-boot.bin

ERROR: s3c2410x_io_write_word(0x4c000000) = 0x00ffffff

ERROR: s3c2410x_io_write_word(0x4c000008) = 0x00048032


U-Boot 1.1.4 (May 11 2009 - 11:46:42)


U-Boot code: 33F80000 -> 33F9C20C BSS: -> 33FA02E8

RAM Configuration:

Bank #0: 30000000 64 MB

Flash: 512 kB

NAND: 64 MB

*** Warning - bad CRC, using default environment


In: serial

Out: serial

Err: serial

Hit any key to stop autoboot: 0

OK2410 # printenv

bootargs=noinitrd root=/dev/nfs rw nfsroot=10.0.0.1:/tmp/nfs ip=10.0.0.110:10.0.0.1:10.0.0.1:255.255.255.0 init=linuxrc console=ttySAC0,115200 mem=64M

bootcmd=tftp 0x31000000 uImage;bootm 0x31000000 //要记住该环境变量,后面的实例中会用到

bootdelay=3

baudrate=115200

ipaddr=10.0.0.110

serverip=10.0.0.1

netmask=255.255.255.0

stdin=serial

stdout=serial

stderr=serial

ethaddr=08:00:3E:26:0A:5B


Environment size: 341/65532 bytes

OK2410 #

OK2410 # setenv bootargs noinitrd mem=64M root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200

OK2410 # tftp 0x31000000 uImage

OK2410 # bootm 31000000

## Booting image at 31000000 ...

Image Name: linux-2.6.14.7

Created: 2009-05-10 14:48:03 UTC

Image Type: ARM Linux Kernel Image (uncompressed)

Data Size: 1009504 Bytes = 985.8 kB

Load Address: 30008000

Entry Point: 30008000

Verifying Checksum ... OK

OK

Starting kernel ...

Uncompressing Linux.................................................................... done, booting the kernel.


Error: unrecognized/unsupported machine ID (r1 = 0x00000000). //出现错误

Available machine support:

ID (hex) NAME

000000c1 SMDK2410

Please check your kernel config and/or bootloader.

有两种方法可以解决上面的问题。

方法一:修改内核的arch/arm/kernel/head.S

Linux内核启动时出现“unrecognized/unsupported machine ID,原因大致是u-boot传递给内核的machine ID错误,可以手动在内核源代码中添加machine ID

首先,在u-boot命令行中执行bdinfo命令,查看板卡信息。

OK2410 # bdinfo

arch_number = 0x000000C1

env_t = 0x00000000

boot_params = 0x30000100

DRAM bank = 0x00000000

-> start = 0x30000000

-> size = 0x04000000

ethaddr = 08:00:3E:26:0A:5B

ip_addr = 10.0.0.110

baudrate = 115200 bps

OK2410 #

然后,编辑Linux内核的arch/arm/kernel/head.S文件,将s3c2410的参数赋给内核。

[root@localhost linux-2.6.14.7]# gedit arch/arm/kernel/head.S

ENTRY(stext)

/************ me add begin ************/

mov r0, #0

mov r1, #0xc1

ldr r2, =0x30000100

/************ me add end ************/

msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode

@ and irqs disabled

bl __lookup_processor_type @ r5=procinfo r9=cpuid

movs r10, r5 @ invalid processor (r5=0)?

beq __error_p @ yes, error 'p'

bl __lookup_machine_type @ r5=machinfo

movs r8, r5 @ invalid machine (r5=0)?

beq __error_a @ yes, error 'a'

bl __create_page_tables

方法二:修改u-boot,填写ID

[root@localhost u-boot-1.1.4]# gedit common/cmd_boot.c

#if !defined(CONFIG_NIOS)

rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]);

#else


改为:

#if !defined(CONFIG_NIOS)

/************** me add ******************/

if(argc==2)

rc = ((ulong (*)(int, char *[]))addr) (0, gd->bd->bi_arch_number);

else

/*************** me add *****************/

rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]);

#else

该实例采用方法一解决上面的问题。

重新进行内核编译!

阅读(3664) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~