uboot烧写yaffs2文件系统.docx
- 文档编号:12808747
- 上传时间:2023-04-22
- 格式:DOCX
- 页数:13
- 大小:25.19KB
uboot烧写yaffs2文件系统.docx
《uboot烧写yaffs2文件系统.docx》由会员分享,可在线阅读,更多相关《uboot烧写yaffs2文件系统.docx(13页珍藏版)》请在冰豆网上搜索。
uboot烧写yaffs2文件系统
u-boot烧写yaffs2文件系统
u-boot烧写yaffs2文件系统
以前移植的U-boot一直都支持Yaffs2文件系统的烧写,但是我一直都没有时间测试,其中的Bug也是网友发现后修正的。
虽然现在又有新的UBI文件系统,但是UBI是在Linux2.6.28以后才被支持的,所以yaffs2还是需要的。
前几天因为项目需要,我又试了一次Yaffs2的烧写引导,在这里记录下来,以备后用。
一、下载Yaffs2映像制作工具。
mkyaffs2image就在yaffs2的源码包里:
Yaffs源码下载
下载源码解压之后,在utils文件夹下的两个C文件就是yaffs和yaffs2文件映像制作工具,这里只将yaffs2了。
512B/page的nand已经比较少了。
二、打上补丁
为了正确制作Yaffs2文件系统映像,必须打上一下补丁:
文件:
yaffs2_tekkaman_utils.patch.tar.bz2
大小:
6KB
下载:
下载
将补丁拷贝到Yaffs2源码目录下,并执行:
patch-p1<./yaffs2_tekkaman_utils.patch
补丁参考:
这个补丁增加了oob的两字节偏移和oob中ECC的产生。
否则新的内核和yaffs2文件系统挂载会出错。
由于大小端的转换还有问题,所以被我去掉了。
三、编译
直接在utils目录下“make”就可以了。
四、制作yaffs2映像文件
制作命令很简单:
mkyaffs2image[dir][image_file_name]
[dir]:
是你要制做的文件系统内容所在的目录
[image_file_name]:
是生成的映像名。
五、用U-boot烧入nandflash。
添加yaffs2烧写功能的补丁是没有硬件依赖的,不单单在2440上可以用,应该可以说是在被Uboot支持的、可以操作NandFlash中的oob的CPU上应该都可以用。
我在别的CPU上已做了实验,没有问题。
yaffs2烧写功能的补丁:
文件:
u-boot_yaffs2img.patch.tar.bz2
大小:
2KB
下载:
下载
要烧写的位置和内核分区有关。
先擦除后烧写。
[u-boot@MINI2440]#tftp192.168.0.1:
rootfs.yaffs2
dm9000i/o:
0x20000300,id:
0x90000a46
DM9000:
runningin16bitmode
MAC:
08:
08:
11:
18:
12:
27
operatingat100Mfullduplexmode
Usingdm9000device
TFTPfromserver192.168.1.100;ourIPaddressis192.168.1.101
Filename'rootfs.yaffs2'.
Loadaddress:
0x30008000
Loading:
T#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
######
done
Bytestransferred=14397504(dbb040hex)
[u-boot@MINI2440]#nanderase0x560000 6000000
(我是128MB的Nand)
[u-boot@MINI2440]#nandwrite.yaffs300080000x5600003b22c00
NANDwrite:
device0offset0x580000,size0x3b22c00
Skipthefirstgoodblock58000000000000
Writingat0x12e000000020000--100%iscomplete.13961216byteswritten:
OK
六、更新内核启动参数,并启动测试。
[u-boot@MINI2440]#setenvbootargsnoinitrdroot=/dev/mtdblock3rootfstype=yaffs2rwconsole=ttySAC0,115200init=/linuxrcmem=64M
[u-boot@MINI2440]#saveenv
SavingEnvironmenttoNAND...
ErasingNand...
Erasingat0x6000000000002--0%complete.
WritingtoNand...done
[u-boot@MINI2440]#tftp30008000192.168.1.100:
zImage.img;bootm
dm9000i/o:
0x20000300,id:
0x90000a46
DM9000:
runningin16bitmode
MAC:
08:
08:
11:
18:
12:
27
operatingat100Mfullduplexmode
Usingdm9000device
TFTPfromserver192.168.1.100;ourIPaddressis192.168.1.101
Filename'zImage.img'.
Loadaddress:
0x30008000
Loading:
T#################################################################
#################################################################
################
done
Bytestransferred=2140320(20a8a0hex)
##BootingkernelfromLegacyImageat30008000...
ImageName:
tekkaman
Created:
2010-04-25 9:
12:
36UTC
ImageType:
ARMLinuxKernelImage(uncompressed)
DataSize:
2140256Bytes= 2MB
LoadAddress:
30008000
EntryPoint:
30008040
VerifyingChecksum...OK
XIPKernelImage...OK
OK
Startingkernel...
UncompressingLinux...done,bootingthekernel.
Linuxversion2.6.33.1(tekkaman@MAGI-Linux)(gccversion4.3.2(crosstool-NG-1.6.1-tekkaman))#18SunApr2517:
11:
42CST2010
CPU:
ARM920T[41129200]revision0(ARMv4T),cr=c0007177
CPU:
VIVTdatacache,VIVTinstructioncache
Machine:
MINI2440
Memorypolicy:
ECCdisabled,Datacachewriteback
CPUS3C2440A(id0x32440001)
S3C24XXClocks,Copyright2004SimtecElectronics
S3C244X:
core405.000MHz,memory101.250MHz,peripheral50.625MHz
CLOCK:
Slowmode(1.500MHz),fast,MPLLon,UPLLon
Built1zonelistsinZoneorder,mobilitygroupingon. Totalpages:
16256
Kernelcommandline:
noinitrdroot=/dev/mtdblock3rootfstype=yaffs2rwconsole=ttySAC0,115200init=/linuxrcmem=64M
PIDhashtableentries:
256(order:
-2,1024bytes)
Dentrycachehashtableentries:
8192(order:
3,32768bytes)
Inode-cachehashtableentries:
4096(order:
2,16384bytes)
Memory:
64MB=64MBtotal
Memory:
60444KBavailable(3764Kcode,412Kdata,140Kinit,0Khighmem)
SLUB:
Genslabs=11,HWalign=32,Order=0-3,MinObjects=0,CPUs=1,Nodes=1
HierarchicalRCUimplementation.
NR_IRQS:
85
irq:
clearingpendingstatus02000000
irq:
clearingsubpendingstatus00000003
irq:
clearingsubpendingstatus00000002
Console:
colourdummydevice80x30
console[ttySAC0]enabled
Calibratingdelayloop...201.93BogoMIPS(lpj=504832)
Mount-cachehashtableentries:
512
CPU:
Testingwritebuffercoherency:
ok
NET:
Registeredprotocolfamily16
MINI2440:
Optionstringmini2440=0t
MINI2440:
't'ignored,touchscreennotcompiledin
MINI2440:
LCD[0:
240x320]1:
800x4802:
1024x768
S3C2440:
Initialisingarchitecture
S3C2440:
IRQSupport
S3C24XXDMADriver,Copyright2003-2006SimtecElectronics
DMAchannel0atc4808000,irq33
DMAchannel1atc4808040,irq34
DMAchannel2atc4808080,irq35
DMAchannel3atc48080c0,irq36
S3C244X:
ClockSupport,DVSoff
bio:
createslab
usbcore:
registerednewinterfacedriverusbfs
usbcore:
registerednewinterfacedriverhub
usbcore:
registerednewdevicedriverusb
s3c-i2cs3c2440-i2c:
slaveaddress0x10
s3c-i2cs3c2440-i2c:
busfrequencysetto98KHz
s3c-i2cs3c2440-i2c:
i2c-0:
S3CI2Cadapter
AdvancedLinuxSoundArchitectureDriverVersion1.0.21.
NET:
Registeredprotocolfamily2
IProutecachehashtableentries:
1024(order:
0,4096bytes)
TCPestablishedhashtableentries:
2048(order:
2,16384bytes)
TCPbindhashtableentries:
2048(order:
1,8192bytes)
TCP:
Hashtablesconfigured(established2048bind2048)
TCPrenoregistered
UDPhashtableentries:
256(order:
0,4096bytes)
UDP-Litehashtableentries:
256(order:
0,4096bytes)
NET:
Registeredprotocolfamily1
RPC:
Registeredudptransportmodule.
RPC:
Registeredtcptransportmodule.
RPC:
RegisteredtcpNFSv4.1backchanneltransportmodule.
JFFS2version2.2.(NAND)©2001-2006RedHat,Inc.
ROMFSMTD(C)2007RedHat,Inc.
yaffsApr25201017:
05:
23Installing.
msgmnihasbeensetto118
alg:
Notestforstdrng(krng)
ioschedulernoopregistered
ioschedulerdeadlineregistered
ioschedulercfqregistered(default)
Console:
switchingtocolourframebufferdevice60x53
fb0:
s3c2410fbframebufferdevice
s3c2440-uart.0:
s3c2410_serial0atMMIO0x50000000(irq=70)isaS3C2440
s3c2440-uart.1:
s3c2410_serial1atMMIO0x50004000(irq=73)isaS3C2440
s3c2440-uart.2:
s3c2410_serial2atMMIO0x50008000(irq=76)isaS3C2440
brd:
moduleloaded
at240-0050:
1024byte24c08EEPROM(writable)
S3C24XXNANDDriver,(c)2004SimtecElectronics
s3c24xx-nands3c2440-nand:
Tacls=1,9nsTwrph0=329ns,Twrph1=219ns
s3c24xx-nands3c2440-nand:
NANDsoftECC
NANDdevice:
ManufacturerID:
0xec,ChipID:
0xf1(SamsungNAND128MiB3,3V8-bit)
Creating4MTDpartitionson"NAND128MiB3,3V8-bit":
0x000000000000-0x000000060000:
"u-boot"
ftl_cs:
FTLheadernotfound.
0x000000060000-0x000000080000:
"u-boot-env"
ftl_cs:
FTLheadernotfound.
0x000000080000-0x000000580000:
"kernel"
ftl_cs:
FTLheadernotfound.
0x000000580000-0x000008000000:
"root"
ftl_cs:
FTLheadernotfound.
dm9000EthernetDriver,V1.31
eth0:
dm9000eatc486e300,c4872304IRQ51MAC:
08:
08:
11:
18:
12:
27(chip)
ohci_hcd:
USB1.1'Open'HostController(OHCI)Driver
s3c2410-ohcis3c2410-ohci:
S3C24XXOHCI
s3c2410-ohcis3c2410-ohci:
newUSBbusregistered,assignedbusnumber1
s3c2410-ohcis3c2410-ohci:
irq42,iomem0x49000000
hub1-0:
1.0:
USBhubfound
hub1-0:
1.0:
2portsdetected
usbcore:
registerednewinterfacedriverlibusual
s3c2440-usbgadgets3c2440-usbgadget:
S3C2440:
increasingFIFOto128bytes
mice:
PS/2mousedevicecommonforallmice
input:
gpio-keysas/devices/platform/gpio-keys/input/input0
S3C24XXRTC,(c)2004,2006SimtecElectronics
s3c2410-rtcs3c2410-rtc:
rtcdisabled,re-enabling
s3c2410-rtcs3c2410-rtc:
rtccore:
registereds3casrtc0
i2c/deventriesdriver
S3C2410WatchdogTimer,(c)2004SimtecElectronics
s3c2410-wdts3c2410-wdt:
watchdoginactive,resetdisabled,irqenabled
cpuidle:
usinggovernorladder
sdhci:
SecureDigitalHostControllerInterfacedriver
sdhci:
Copyright(c)PierreOssman
s3c-sdis3c2440-sdi:
powereddown.
s3c-sdis3c2440-sdi:
mmc0-usingpio,swSDIOIRQ
Registeredleddevice:
led1
Registeredleddevice:
led2
Registeredleddevice:
led3
Registeredleddevice:
led4
usbcore:
registerednewinterfacedriverhiddev
usbcore:
registerednewinterfacedriverusbhid
usbhid:
USBHIDcoredriver
NodeviceforDAIUDA134X
NodeviceforDAIs3c24xx-i2s
S3C24XX_UDA134XSoCAudiodriver
UDA134XSoCAudioCodec
asoc:
UDA134X<->s3c24xx-i2smappingok
ALSAdevicelist:
#0:
S3C24XX_UDA134X(UDA134X)
TCPcubicregistered
NET:
Registeredprotocolfamily17
s3c2410-rtcs3c2410-rtc:
settingsystemclockto2010-04-2822:
58:
01UTC(1272495481)
yaffs
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- uboot yaffs2 文件系统