Helper2416-22——裸机第十一弹——兴奋!YL-boot启动内核+源码
[复制链接]
本帖最后由 yuanlai2010 于 2014-7-30 21:51 编辑
兴奋!YL-boot启动内核
参与Helper2416开发板助学计划心得
当屏幕亮起来的那一刻真的很激动,很兴奋。顿时感觉这几天的付出终于有了收获,同时也给了自己更多的信心,相信自己可以把嵌入式Linux学好。下面就来分享我的这份喜悦!
首先用上一版本的 YL-boot ( 现在我管他叫 YL-boot for SD) 把新的 YL-boot (for nand) 烧写到 nand 的 0 地址处。
接着尝试从NAND启动系统,但是发现并不能像期待的的那样把内核启动起来,后来尝试把nand0x40000开始的连续0x300000字节的数据通过串口打印出来,发现数据全部为0,没办法,那我就尝试通过 YL-boot for SD重新把zImage.43重新烧写到 nand0x40000处的位置,再重nand启动。
哦也!喜悦!屏幕亮了, 串口打印信息截图如下
完整信息如下
******** YL-boot ********
EEWORLD ID: yuanlai2010
******* 2014-07-29 ******
***** Start Kernel ****
Loading Kernel ......
Jumping to Kernel
********** end **********
Uncompressing Linux... done, booting the kernel.
Linux version 3.2.50+ (d02cj@LinuxServer0) (gcc version 4.4.6 (crosstool-NG 1.13.3) ) #407 Mon Feb 24 22:49:49 CST 2014
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2416
Memory policy: ECC disabled, Data cache writeback
CPU S3C2416/S3C2450 (id 0x32450003)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
CPU: MPLL on 800.000 MHz, cpu 400.000 MHz, mem 133.333 MHz, pclk 66.666 MHz
Warning: USB host bus not at 48MHz
CPU: EPLL off 96.000 MHz, usb-bus 12.000 MHz
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: root=/dev/mtdblock2 console=ttySAC0,115200 rootfstype=yaffs2 mem=64m
PID hash table entries: 256 (order: -2, 1024 bytes)
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: 59612k/59612k available, 5924k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xc4800000 - 0xf6000000 ( 792 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc048f598 (4638 kB)
.init : 0xc0490000 - 0xc04d4000 ( 272 kB)
.data : 0xc04d4000 - 0xc04ff500 ( 174 kB)
.bss : 0xc04ff524 - 0xc052c81c ( 181 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:109
irq: clearing subpending status 00000002
Console: colour dummy device 80x30
Calibrating delay loop... 199.47 BogoMIPS (lpj=498688)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C Power Management, Copyright 2004 Simtec Electronics
S3C2416: Initializing architecture
S3C2416: IRQ Support
S3C24XX DMA Driver, Copyright 2003-2006 Simtec Electronics
DMA channel 0 at c4804000, irq 88
DMA channel 1 at c4804100, irq 89
DMA channel 2 at c4804200, irq 90
DMA channel 3 at c4804300, irq 91
DMA channel 4 at c4804400, irq 92
DMA channel 5 at c4804500, irq 93
DMA channel 6 at c4804600, irq 99
DMA channel 7 at c4804700, irq 100
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
input: helper2416_keypad as /devices/platform/helper2416_keypad/input/input0
s3c-i2c s3c2410-i2c: slave address 0x10
s3c-i2c s3c2410-i2c: bus frequency set to 65 KHz
s3c-i2c s3c2410-i2c: i2c-0: S3C I2C adapter
Advanced Linux Sound Architecture Driver Version 1.0.24.
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
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
s3c-adc s3c24xx-adc: attached adc driver
helper2416 pwm device Driver
s3c24xx-pwm s3c24xx-pwm.0: tin at 33333333, tdiv at 33333333, tin=divclk, base 0
s3c24xx-pwm s3c24xx-pwm.1: tin at 33333333, tdiv at 33333333, tin=divclk, base 8
s3c24xx-pwm s3c24xx-pwm.2: tin at 11111111, tdiv at 11111111, tin=divclk, base 12
s3c24xx-pwm s3c24xx-pwm.3: tin at 11111111, tdiv at 11111111, tin=divclk, base 16
nfs4filelayout_init: NFSv4 File Layout Driver Registering...
NTFS driver 2.1.30 [Flags: R/O].
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 116
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
S3C NAND Driver, (c) 2007 Samsung Electronics
S3C NAND Driver is using hardware ECC.
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x000000000000-0x000000040000 : "Bootloader"
0x000000040000-0x000000400000 : "Kernel"
0x000000400000-0x000010000000 : "File System"
LCD TYPE :: S3C_4.3inch LCD will be initialized
S3C_LCD clock got enabled :: 133.333 Mhz
Window[0]- FB1 : map_video_memory: clear ffd80000:0003fc00
FB1 : map_video_memory: dma=33980000 cpu=ffd80000 size=0003fc00
Console: switching to colour frame buffer device 60x34
fb-1068365652: frame buffer device
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
s3c2440-uart.0: ttySAC0 at MMIO 0x50000000 (irq = 70) is a S3C2440
console [ttySAC0] enabled
s3c2440-uart.1: ttySAC1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: ttySAC2 at MMIO 0x50008000 (irq = 76) is a S3C2440
s3c2440-uart.3: ttySAC3 at MMIO 0x5000c000 (irq = 94) is a S3C2440
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
helper2416 adc device Driver
brd: module loaded
loop: module loaded
SCSI Media Changer driver v0.25
CAN device driver interface
mcp251x spi0.0: probed
Invalid chip endian 0x00000000
smc911x: not found (-19).
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
PPP MPPE Compression module registered
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
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
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
mousedev: PS/2 mouse device common for all mice
samsung-ts s3c2410-ts: driver attached, registering input device
input: S3C24XX TouchScreen as /devices/virtual/input/input1
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c-rtc s3c2410-rtc: rtc disabled, re-enabling
s3c-rtc s3c2410-rtc: rtc core: registered s3c as rtc0
i2c /dev entries driver
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133333333 Hz)
s3c-sdhci s3c-sdhci.0: clock source 1: hsmmc (133333333 Hz)
s3c-sdhci s3c-sdhci.0: clock source 2: hsmmc-if (12000000 Hz)
mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using ADMA
s3c-sdhci s3c-sdhci.1: clock source 0: hsmmc (133333333 Hz)
s3c-sdhci s3c-sdhci.1: clock source 1: hsmmc (133333333 Hz)
s3c-sdhci s3c-sdhci.1: clock source 2: hsmmc-if (12000000 Hz)
mmc1: SDHCI controller on samsung-hsmmc [s3c-sdhci.1] using ADMA
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
asoc: wm8731-hifi <-> s3c24xx-iis mapping ok
ALSA device list:
#0: wm8731
TCP cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20090105 abi 8)
NET: Registered protocol family 29
can: raw protocol (rev 20090105)
can: broadcast manager protocol (rev 20090105 t)
Registering the dns_resolver key type
s3c-rtc s3c2410-rtc: setting system clock to 2000-01-01 00:01:01 UTC (946684861)
yaffs: dev is 32505858 name is "mtdblock2" rw
yaffs: passed flags ""
s3c-nand: ECC uncorrectable error detected
s3c-nand: ECC uncorrectable error detected
s3c-nand: ECC uncorrectable error detected
mmc1: new high speed SDHC card at address 0007
mmcblk0: mmc1:0007 SD8GB 7.21 GiB
mmcblk0: p1
VFS: Mounted root (yaffs2 filesystem) on device 31:2.
Freeing init memory: 272K
FAT-fs (mmcblk0p1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[31/Dec/1999:16:01:07 +0000] boa: server version Boa/0.94.13
[31/Dec/1999:16:01:07 +0000] boa: server built Mar 26 2009 at 15:28:42.
[31/Dec/1999:16:01:07 +0000] boa: starting server pid=74, port 80
ifconfig: SIOCSIFADDR: No such device
route: SIOCADDRT: Network is unreachable
Please press Enter to activate this console. 复制代码 特意测试了下从按下复位键到屏幕点亮的所需的时间并作对比,第一张为 YL-boot 的测试时间,第二张为u-boot的测试时间。
o(︶︿︶)o 唉!为什么不比u-boot快呢?
据观察,启动的时间主要耗费在读取内核到SDRAM和内核自解压上。
根据刚开始需要重新烧写zImage.43的现象及测试,大概猜测是u-boot的nand烧写可能没有校验ECC(源码中没看到有,也有可能是我看的不够仔细),而我用的nand读写函数是加入了ECC校验的,导致不能正常读出原来u-boot烧写进去的内核。下一步就是要继续去验证这些问题!八月份开始玩应用和驱动!
最后附上源码,这个只有启动内核的功能。感兴趣的就自己拿去玩吧!
论坛ID:yuanlai2010
发表时间:2014-07-29