QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: zbluecn

成功在skyeye 上实现U-Boot 的Nand命令并从Nand中启动Linux

[复制链接]
发表于 2008-4-12 22:03:46 | 显示全部楼层
启动信息如下:

[root@localhost u-boot-1.1.4]# skyeye -c u-boot.conf

**************************** 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.
***********************************************************************

big_endian is false.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x808131c
ethmod num=1, mac addr=0:4:3:2:1:f, 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
Loaded RAM   ./initrd.img

dbct translate block use memory 0x03ffff03 bytes.
ERROR: s3c2410x_io_write_word(0x4c000000) = 0x00ffffff
ERROR: s3c2410x_io_write_word(0x4c00000 = 0x00048032


U-Boot 1.1.4 (Mar 23 2008 - 18:47:45)

U-Boot code: 33F80000 -> 33F9BF0C  BSS: -> 33F9FFE4
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
SMDK2410 # tftp 0x33000000 uImage
TFTP from server 10.0.0.1; our IP address is 10.0.0.110
Filename 'uImage'.
Load address: 0x33000000
Loading: #################################################################
         #################################################################
         #################################################################
         ####
done
Bytes transferred = 1015092 (f7d34 hex)
SMDK2410 # nand erase 30000 F8000

NAND erase: device 0 offset 196608, size 1015808 ... OK
SMDK2410 # nand write 33000000 30000 f7d34

NAND write: device 0 offset 196608, size 1015092 ...  1015092 bytes written: OK
SMDK2410 # [root@localhost u-boot-1.1.4]# skyeye -c u-boot.conf

**************************** 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.
***********************************************************************

big_endian is false.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x808131c
ethmod num=1, mac addr=0:4:3:2:1:f, 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
Loaded RAM   ./initrd.img
dbct translate block use memory 0x03ffff03 bytes.
ERROR: s3c2410x_io_write_word(0x4c000000) = 0x00ffffff
ERROR: s3c2410x_io_write_word(0x4c00000 = 0x00048032


U-Boot 1.1.4 (Mar 23 2008 - 18:47:45)

U-Boot code: 33F80000 -> 33F9BF0C  BSS: -> 33F9FFE4
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
SMDK2410 # nand read 33000000 30000 f7d34

NAND read: device 0 offset 196608, size 1015092 ...  1015092 bytes read: OK
SMDK2410 # bootm
## Booting image at 33000000 ...
   Image Name:   Linux-2.6.14
   Created:      2008-04-12  13:42:43 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1015028 Bytes = 991.2 kB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux.................................................................... done, booting the kernel.
Linux version 2.6.14 ([email protected]) (gcc version 3.4.1) #6 Sat Apr 12 21:42:34 CST 2008
CPU: ARM920Tid(wb) [41009200] revision 0 (ARMvundefined/unknown)
Machine: SMDK2410
Warning: bad configuration page, trying to continue
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410 (id 0x32410000)
S3C2410: core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz
S3C2410 Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists
Kernel command line: noinitrd console=ttySAC0 root=/dev/mtdblock2 rootfstype=yaffs init=/linuxrc devfs=mount ramdisk_size=2048 rw
irq: clearing pending status 00004000
irq: clearing pending status 00008000
irq: clearing pending status 00800000
irq: clearing pending status 10000000
irq: clearing subpending status 00000093
PID hash table entries: 128 (order: 7, 2048 bytes)
timer tcon=00500000, tcnt a509, tcfg 00000200,00000000, usec 00001e4c
Console: colour dummy device 80x30
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 16MB = 16MB total
Memory: 13996KB available (1689K code, 379K data, 96K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
softlockup thread 0 started up.
NET: Registered protocol family 16
S3C2410: Initialising architecture
S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics
DMA channel 0 at c1800000, irq 33
DMA channel 1 at c1800040, irq 34
DMA channel 2 at c1800080, irq 35
DMA channel 3 at c18000c0, irq 36
NetWinder Floating Point Emulator V0.97 (double precision)
devfs: 2004-01-31 Richard Gooch ([email protected])
devfs: boot_options: 0x1
Console: switching to colour frame buffer device 80x25
fb0: Virtual frame buffer device, using 1024K of video memory
S3C2410 RTC, (c) 2004 Simtec Electronics
s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize
loop: loaded (max 8 devices)
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)
eth0: CS8900A rev D at 0xe0000300 irq=53, no eeprom , addr: 08: 0:3E:26:0A:5B
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand: mapped registers at c1980000
s3c2410-nand: timing: Tacls 10ns, Twrph0 30ns, Twrph1 10ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00100000 : "bootloader"
0x00100000-0x00400000 : "kernel"
0x00400000-0x02c00000 : "root"
0x02d00000-0x03c00000 : "user"
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP route cache hash table entries: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
VFS: Cannot open root device "mtdblock2" or unknown-block(31,2)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
[root@localhost u-boot-1.1.4]#
回复

使用道具 举报

发表于 2008-4-12 22:05:22 | 显示全部楼层

续问。。。

Default kernel command string为:

noinitrd console=ttySAC0 root=/dev/mtdblock2 rootfstype=yaffs init=/linuxrc devfs=mount ramdisk_size=2048 rw

u-boot.conf内容为:

# skyeye config file for S3C2410X
cpu: arm920t
mach: s3c2410x
# physical memory
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00800000, file=./u-boot.bin ,boot=yes
mem_bank: map=M, type=RW, addr=0xc0800000, size=0x00800000, file=./initrd.img----地址不是很确定
mem_bank: map=M, type=RW, addr=0x30000000, size=0x00800000
mem_bank: map=M, type=RW, addr=0x30800000, size=0x00800000
mem_bank: map=M, type=RW, addr=0x31000000, size=0x03000000

# all peripherals I/O mapping area
mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000
mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
net: type=cs8900a, base=0x19000300, size=0x20,int=9, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1
nandflash: type=s3c2410x,name=K9F1208U0B,dump=./nand.dump
#lcd:type=s3c2410x, mod=gtk
dbct:state=on
~

[root@localhost u-boot-1.1.4]# vi /usr/src/kernels/linux-2.6.14/arch/arm/mach-s3c2410/devs.c
/*1.建立Nand Flash分区表*/
/* 一个Nand Flash总共64MB, 按如下大小进行分区 */
/*
name: 代表分区名字
size: 代表flash分区大小(单位:字节)
offset: 代表flash分区的起始地址(相对于0x0的偏移)
*/
static struct mtd_partition partition_info[] = {
    { /* 1MB */
        name: "bootloader",
        size: 0x00100000,
        offset: 0x0,
    },
    { /* 3MB */
        name: "kernel",
        size: 0x00300000,
        offset: 0x00100000,
    },
    { /* 40MB */
        name: "root",
        size: 0x02800000,
        offset: 0x00400000,
    },
    { /* 20MB */
        name: "user",
        size: 0x00f00000,
        offset: 0x02d00000,
    }
};

内核配置是按照LZ的“http://blog.csdn.net/zblue78/archive/2008/02/20/2109827.aspx”中配置的

恳请大侠帮忙啊!!!
回复

使用道具 举报

发表于 2008-4-13 22:31:53 | 显示全部楼层

Default kernel command string

noinitrd console=ttySAC0 root=/dev/mtdblock2 init=/linuxrc ramdisk_size=2048 rw
这个试过了吗?
回复

使用道具 举报

发表于 2008-4-14 00:10:16 | 显示全部楼层

回复 #18 crook 的帖子

NET: Registered protocol family 1
Reading data from NAND FLASH without ECC is not recommended
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
回复

使用道具 举报

发表于 2008-4-29 00:09:48 | 显示全部楼层
这样的文章很稀有
珍惜啊
回复

使用道具 举报

发表于 2008-4-30 21:18:22 | 显示全部楼层

我怎么作不出来啊 我的那里出了问题呢?

先赞一个  
我按lz说的方法去作了,可是在没有添加nand部分时执行的还好,即第7步之前正常。
但做到第10步的时候就不行了呢,
结果是
:~/arm/rom3$ ls
nand.dump  skyeye.conf  skyeye.conf~  u-boot  u-boot.bin
:~/arm/rom3$ sudo 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.
***********************************************************************

big_endian is false.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x805f420
ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1
failed to setup_module (name:net, type:cs8900a)
nandflash: dump ./nand.dump
tapif_init: icotl TUNSETIFF errorfile size:69206016
dbct info: Note: DBCT not compiled in. This option will be ignored
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
Loaded RAM   ./u-boot.bin




到这里就进行不下去了。这是为什么阿 ,其他的和你做的一样,SKYEYE。CONF也是一样的。
这样执行也不行
shinety@shinety:~/arm/rom3$ sudo 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.
***********************************************************************

big_endian is false.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x805f420
ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1
failed to setup_module (name:net, type:cs8900a)
nandflash: dump ./nand.dump
tapif_init: icotl TUNSETIFF errorfile size:69206016
dbct info: Note: DBCT not compiled in. This option will be ignored
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
Loaded RAM   ./u-boot.bin

[12]+  Stopped                 sudo skyeye
shinety@shinety:~/arm/rom3$ sudo skyeye -e u-boot
big_endian is false.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x805f420
ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1
failed to setup_module (name:net, type:cs8900a)
nandflash: dump ./nand.dump
tapif_init: icotl TUNSETIFF errorfile size:69206016
dbct info: Note: DBCT not compiled in. This option will be ignored
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
Loaded RAM   ./u-boot.bin
start addr is set to 0x33f80000 by exec file.
SKYEYE:NumInstrs 26021, mem_write_byte addr = 3400006d no bank


我在想是不是地址有问题。lz觉得我这边有什么不对的阿?

[ 本帖最后由 shinety53 于 2008-4-30 21:41 编辑 ]
回复

使用道具 举报

发表于 2008-6-26 14:16:11 | 显示全部楼层
r看看,做实验,发现很多问题!
回复

使用道具 举报

发表于 2008-6-26 14:55:46 | 显示全部楼层
原帖由 shinety53 于 2008-4-30 21:18 发表
先赞一个  
我按lz说的方法去作了,可是在没有添加nand部分时执行的还好,即第7步之前正常。
但做到第10步的时候就不行了呢,
结果是
:~/arm/rom3$ ls
nand.dump  skyeye.conf  skyeye.conf~  u-boot  u-b ...



用skyeye 提供的mknandflashdump程序将 我们的u-boot.bin文件镜像到nand.dump 文件中

mknandflashdump u-boot.bin nand.dump 0

没有做这个?
回复

使用道具 举报

发表于 2008-6-26 17:26:09 | 显示全部楼层
请问楼主是怎么用skyeye就跟踪代码的。给个详细点步骤好吗?谢谢!!
回复

使用道具 举报

发表于 2008-11-13 18:52:03 | 显示全部楼层
lz的conf如下,有几点不懂想请教:

# physical memory
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00800000,
file=./u-boot.bin ,boot=yes
请问这里指定的是nand flash吗?
如果是nor flash,怎么指定是从nand flash启动的呢?
如果是nand flash的话,2410中nand flash实际上不是连接到memory bank上的,为什么要这样指定?


我想仿照您的方法在skyeye for 2410中启动vivi,但是没有成功,故有以上疑惑。望指教,谢谢!
回复

使用道具 举报

发表于 2008-11-14 09:15:14 | 显示全部楼层
想s3c2410这样的芯片之所以可以在NAND上启动,是由于s3c2410有一个叫做stepping stone的内置SRAM,将loader代码烧在NAND上,加电后,该芯片可以自动将NAND的起始4k的内容拷贝到SRAM里,然后在RAM里执行。
回复

使用道具 举报

发表于 2009-4-17 15:08:43 | 显示全部楼层
修改 command/cmd_nand.c
中的NanD_ReadBuf函数
注释掉NanD_Command (nand, NAND_CMD_READ0);这一行
俺的是u-boot1.2.0竟然没有这个函数,自己弄了好久,不知该怎么改。
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-11-22 10:22 , Processed in 0.070454 second(s), 14 queries .

© 2021 Powered by Discuz! X3.5.

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