这篇文章在 Hi3516A V100R001C01SPC050\02.Only for Reference\02.software\documents_cn\UBI 文件系统使用指南.pdf 拿出来只为了和上篇文章做一个比较。
一、概述
linux-2.6.27 后,内核加入了一种新型的 FLASH 文件系统 UBI (Unsorted BlockImages)。主要针对 FLASH 的特有属性,通过软件的方式来实现日志管理、坏块管理、损益均衡等技术。本文主要介绍如何在内核中配置使用 UBI 文件系统以及制作对应的 UBI 文件系统根文件系统镜像。同时还介绍了如何转换镜像格式以便于在 u-boot 上进行烧录。
二、下载该文章
三、其他根文件系统
参看:Hi3516A开发--根文件系统
GSG: DM365 DVEVM Software Setup for MontaVista Kernel
参看: DM365 挂载NFS文件系统
其中挂载NFS文件系统,会出现 DM368 boot via NFS 的问题。
================================================================
我试图使用nfs挂载的文件系统启动后我得到以下输出。
TFTP from server 192.168.1.101; our IP address is 192.168.1.100
Filename 'uImage_ipnc_dm368'.
Load address: 0x80700000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
####################################
done
Bytes transferred = 3842560 (3aa200 hex)
## Booting kernel from Legacy Image at 80700000 ...
Image Name: Linux-2.6.37_IPNC_DM365_4.0.0
Image Type: ARM linux Kernel Image (uncompressed)
Data Size: 3842496 Bytes = 3.7 MB
Load Address: 80008000
Entry Point: 80008000
Loading Kernel Image ... OK
OK
Starting kernel ...
[ 0.000000] Linux version 2.6.37_IPNC_DM365_4.0.0 (root@volansys28-desktop) (gcc version 4.3.3 (GCC) ) #1 PREEMPT Wed Aug 22 12:14:32 IST 2012
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] Machine: DaVinci DM36x IPNC
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] DaVinci dm36x_rev1.2 variant 0x8
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 12192
[ 0.000000] Kernel command line: console=ttyS1,115200n8 noinitrd rw ip=192.168.1.101:192.168.1.100:192.168.1.1:255.255.255.0:::off root=/dev/nfs nfsroot=192.168.1.1
01:/home/volansys28/Desktop/IPNC/IPNC_RDK_DM36x_Version4.0.0/PrivateTI_IPNC_RDK_DM36x_v4.0.0/Source/ipnc_rdk/target/filesys,nolock mem=48M cmemk.phys_start="0x83000000
" cmemk.phys_end="0x88000000" cmemk.phys_start_1="0x00001000" cmemk.phys_end_1="0x00008000" cmemk.pools_1="1x28672" cmemk.allowOverlap=1 eth=$(ethaddr)
[ 0.000000] TI DaVinci EMAC: kernel boot params Ethernet address: $(ethaddr)
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Memory: 48MB = 48MB total
[ 0.000000] Memory: 44772k/44772k available, 4380k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] DMA : 0xff000000 - 0xffe00000 ( 14 MB)
[ 0.000000] vmalloc : 0xc3800000 - 0xfea00000 ( 946 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc3000000 ( 48 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .init : 0xc0008000 - 0xc002a000 ( 136 kB)
[ 0.000000] .text : 0xc002a000 - 0xc038b000 (3460 kB)
[ 0.000000] .data : 0xc038c000 - 0xc03b21c0 ( 153 kB)
[ 0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptable hierarchical RCU implementation.
[ 0.000000] RCU-based detection of stalled CPUs is disabled.
[ 0.000000] Verbose stalled-CPUs detection is disabled.
[ 0.000000] NR_IRQS:245
[ 0.000000] Console: colour dummy device 80x30
[ 0.000296] Calibrating delay loop... 215.44 BogoMIPS (lpj=1077248)
[ 0.240080] pid_max: default: 32768 minimum: 301
[ 0.240387] Mount-cache hash table entries: 512
[ 0.241182] CPU: Testing write buffer coherency: ok
[ 0.245698] DaVinci: 8 gpio irqs
[ 0.246312] NET: Registered protocol family 16
[ 0.261346] EVM: (null) video input
[ 0.340860] bio: create slab <bio-0> at 0
[ 0.345465] SCSI subsystem initialized
[ 0.349271] usbcore: registered new interface driver usbfs
[ 0.350971] usbcore: registered new interface driver hub
[ 0.351854] usbcore: registered new device driver usb
[ 0.355091] vpss vpss: dm365_vpss vpss probed
[ 0.355152] vpss vpss: dm365_vpss vpss probe success
[ 0.357019] Advanced Linux Sound Architecture Driver Version 1.0.23.
[ 0.358983] Switching to clocksource timer0_1
[ 0.360102] Switched to NOHz mode on CPU #0
[ 0.422162] NET: Registered protocol family 2
[ 0.422479] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.423267] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.423409] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.423501] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.423533] TCP reno registered
[ 0.423570] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.423633] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.424138] NET: Registered protocol family 1
[ 0.425171] RPC: Registered udp transport module.
[ 0.425213] RPC: Registered tcp transport module.
[ 0.425241] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.498975] Installing knfsd (copyright (C) 1996 [email protected]).
[ 0.499992] JFFS2 version 2.2. (NAND) ?? 2001-2006 Red Hat, Inc.
[ 0.503791] msgmni has been set to 87
[ 0.507652] io scheduler noop registered (default)
[ 0.509450] CSL: Module install successful, device major num = 254
[ 0.509496] CSL: Module version 0.10.00, built on Aug 22 2012 12:06:26
[ 0.509549] I2C: Module install successful, device major num = 253
[ 0.509588] DMA: Module install successful, device major num = 252
[ 0.509616] DRV: Module install successful
[ 0.509639] DRV: Module built on Aug 22 2012 12:06:27
[ 0.509665] DRV: EDMACC.QUEPRI = 00002777
[ 0.509688] DRV: SYSTEM.MSTPRI0 = 00440011
[ 0.509710] DRV: SYSTEM.MSTPRI1 = 00000444
[ 0.509731] DRV: ISP.BCR = 00000002
[ 0.509753] DRV: SYSTEM.MISC = 00000391
[ 0.509776] EDMAK module: built on Aug 22 2012 at 12:06:12
[ 0.509806] Reference Linux version 2.6.37
[ 0.509834] File /home/volansys28/Desktop/IPNC/IPNC_RDK_DM36x_Version4.0.0/PrivateTI_IPNC_RDK_DM36x_v4.0.0/Source/dvsdk_ipnctools/linuxutils_2_26_02_05/packages/t
i/sdo/linuxutils/edma/src/module/edmak.c
[ 0.511310] IRQK module: built on Aug 22 2012 at 12:03:54
[ 0.511359] Reference Linux version 2.6.37
[ 0.511387] File /home/volansys28/Desktop/IPNC/IPNC_RDK_DM36x_Version4.0.0/PrivateTI_IPNC_RDK_DM36x_v4.0.0/Source/dvsdk_ipnctools/linuxutils_2_26_02_05/packages/t
i/sdo/linuxutils/irq/src/module/irqk.c
[ 0.512849] irqk initialized
[ 0.512922] CMEMK module: built on Aug 22 2012 at 12:06:10
[ 0.512961] Reference Linux version 2.6.37
[ 0.512989] File /home/volansys28/Desktop/IPNC/IPNC_RDK_DM36x_Version4.0.0/PrivateTI_IPNC_RDK_DM36x_v4.0.0/Source/dvsdk_ipnctools/linuxutils_2_26_02_05/packages/t
i/sdo/linuxutils/cmem/src/module/cmemk.c
[ 0.517685] allocated heap buffer 0xc4000000 of size 0x5000000
[ 0.517736] CMEM Range Overlaps Kernel Physical - allowing overlap
[ 0.517774] CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x83000000)
[ 0.517920] cmemk initialized
[ 0.517974] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.542249] serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
[ 0.564271] serial8250.0: ttyS1 at MMIO 0x1d06000 (irq = 41) is a 16550A
[ 1.124468] console [ttyS1] enabled
[ 1.131468] brd: module loaded
[ 1.143293] NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung )
[ 1.151963] Bad block table not found for chip 0
[ 1.157977] Bad block table not found for chip 0
[ 1.162795] Scanning device for bad blocks
[ 1.192791] Bad eraseblock 248 at 0x000001f00000
[ 1.197486] Bad eraseblock 249 at 0x000001f20000
[ 1.202251] Bad eraseblock 250 at 0x000001f40000
[ 1.206939] Bad eraseblock 251 at 0x000001f60000
[ 1.211694] Bad eraseblock 252 at 0x000001f80000
[ 1.216380] Bad eraseblock 253 at 0x000001fa0000
[ 1.221129] Bad eraseblock 254 at 0x000001fc0000
[ 1.225815] Bad eraseblock 255 at 0x000001fe0000
[ 1.230580] Bad eraseblock 256 at 0x000002000000
[ 1.235269] Bad eraseblock 257 at 0x000002020000
[ 1.240032] Bad eraseblock 258 at 0x000002040000
[ 1.244721] Bad eraseblock 259 at 0x000002060000
[ 1.249488] Bad eraseblock 260 at 0x000002080000
[ 1.254176] Bad eraseblock 261 at 0x0000020a0000
[ 1.258854] Bad eraseblock 262 at 0x0000020c0000
[ 1.263619] Bad eraseblock 263 at 0x0000020e0000
[ 1.275992] Bad eraseblock 338 at 0x000002a40000
[ 1.354269] Creating 7 MTD partitions on "davinci_nand.0":
[ 1.359917] 0x000000000000-0x000000300000 : "bootloader"
[ 1.369258] 0x000000300000-0x000000500000 : "params"
[ 1.378173] 0x000000500000-0x000000900000 : "kernel"
[ 1.387460] 0x000000900000-0x000003100000 : "filesystem1"
[ 1.397324] 0x000003100000-0x000003300000 : "data1"
[ 1.406677] 0x000003300000-0x000005b00000 : "filesystem2"
[ 1.416666] 0x000005b00000-0x000008000000 : "data2"
[ 1.426003] davinci_nand davinci_nand.0: controller rev. 2.3
[ 1.489144] davinci_mdio davinci_mdio.0: davinci mdio revision 1.4
[ 1.495352] davinci_mdio davinci_mdio.0: detected phy mask fffffffd
[ 1.503076] davinci_mdio.0: probed
[ 1.506519] davinci_mdio davinci_mdio.0: phy[1]: device 0:01, driver unknown
[ 1.514398] i2c /dev entries driver
[ 1.520105] Linux media interface: v0.10
[ 1.524762] Linux video capture interface: v2.00
[ 1.531732] vpbe-osd vpbe-osd: OSD sub device probe success
[ 1.538199] vpbe-venc vpbe-venc: VENC sub device probe success
[ 1.545040] vpbe-v4l2 vpbe-v4l2: vpbe v4l2 device registered
[ 1.551241] Setting default output to Composite
[ 1.555796] Setting default mode to ntsc
[ 1.559945] vpbe-v4l2 vpbe-v4l2: Trying to register VPBE display device.
[ 1.566659] vpbe-v4l2 vpbe-v4l2: layer=c2951a00,layer->video_dev=c2951ae8
[ 1.574361] vpbe-v4l2 vpbe-v4l2: Trying to register VPBE display device.
[ 1.581316] vpbe-v4l2 vpbe-v4l2: layer=c2951c00,layer->video_dev=c2951ce8
[ 1.589956] watchdog watchdog: heartbeat 60 sec
[ 1.599873] Error: Driver 'davinci-mcbsp' is already registered, aborting...
[ 1.609859] asoc: cq93vc-hifi <-> davinci-vcif mapping ok
[ 1.618631] ALSA device list:
[ 1.621936] #0: DaVinci DM365 EVM
[ 1.626706] TCP cubic registered
[ 1.630310] NET: Registered protocol family 17
[ 1.643776] net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, id=181b8b0)
[ 1.669952] IP-Config: Complete:
[ 1.673034] device=eth0, addr=192.168.1.101, mask=255.255.255.0, gw=192.168.1.1,
[ 1.680944] host=192.168.1.101, domain=, nis-domain=(none),
[ 1.686965] bootserver=192.168.1.100, rootserver=192.168.1.101, rootpath=
[ 1.696726] VFS: Unable to mount root fs via NFS, trying floppy.
[ 1.703858] VFS: Cannot open root device "nfs" or unknown-block(2,0)
[ 1.710381] Please append a correct "root=" boot option; here are the available partitions:
[ 1.718782] 1f00 3072 mtdblock0 (driver?)
[ 1.724017] 1f01 2048 mtdblock1 (driver?)
[ 1.729192] 1f02 4096 mtdblock2 (driver?)
[ 1.734278] 1f03 40960 mtdblock3 (driver?)
[ 1.739445] 1f04 2048 mtdblock4 (driver?)
[ 1.744530] 1f05 40960 mtdblock5 (driver?)
[ 1.749684] 1f06 37888 mtdblock6 (driver?)
[ 1.754761] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[ 1.763094] Backtrace:
[ 1.765566] Function entered at [<c002e4ec>] from [<c0311888>]
[ 1.771465] r7:00008000 r6:c2813000 r5:c0023668 r4:c03b2920
[ 1.777166] Function entered at [<c0311870>] from [<c03118f4>]
[ 1.783066] Function entered at [<c031188c>] from [<c0008fcc>]
[ 1.788908] r3:00000000 r2:00000000 r1:c2825f58 r0:c03317d6
[ 1.794677] Function entered at [<c0008de8>] from [<c00090c0>]
[ 1.800574] Function entered at [<c0009014>] from [<c0009244>]
[ 1.806417] r4:c03b2228
[ 1.808961] Function entered at [<c00090e4>] from [<c00084b4>]
[ 1.814858] r5:c0022e04 r4:c03b21d8
[ 1.818461] Function entered at [<c00083a4>] from [<c0042e0c>]
[ 1.824358] r5:c00083a4 r4:00000000
运行卡在这里了。
原因是:NFS无法挂载,无法获取文件系统。
[ 1.696726] VFS: Unable to mount root fs via NFS, trying floppy.
[ 1.703858] VFS: Cannot open root device "nfs" or unknown-block(2,0)
解决方法:进入:vi /etc/exports
添加根文件系统目录,/opt/filesys *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
启动NFS :sudo /etc/init.d/nfs-kernel-server restart
sudo exportfs -a (最好每修改过/etc/exports 后需要执行一次)
根据你的烧写方式烧写ubl、uboot、uImage。
设置bootargs,NFS挂载根文件系统:
setenv bootargs mem=48M console=ttyS0,115200n8 root=/dev/nfs nfsroot=192.168.2.78:/opt/filesys rw ip=192.168.2.194:192.168.2.76:192.168.2.1:255.255.255.0 cmemk.phys_start=0x83000000 cmemk.phys_end=0x88000000 cmemk.phys_start_1=0x00001000 cmemk.phys_end_1=0x00008000cmemk.pools_1=1x28672 cmemk.allowOverlap=1 cmemk.useHeapIfPoolUnavailable=1 eth=$(ethaddr)
再启动就OK了!
标签:0.000000,eraseblock,--,Bad,192.168,Hi3516A,device,使用指南,vpbe From: https://blog.51cto.com/u_15979522/6167184