This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

nand ubi启动问题



Booting from nand ...

NAND read: device 0 offset 0x80000, size 0x40000
 262144 bytes read: OK

NAND read: device 0 offset 0x200000, size 0x800000
 8388608 bytes read: OK
Kernel image @ 0x82000000 [ 0x000000 - 0x3d3a00 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Device Tree to 8fff3000, end 8ffff8d7 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 3.14.26 (star@star-VirtualBox) (gcc version 4.9.3 20150113 (prerelease) (Linaro GCC 4.9-2015.01-3) ) #3 Thu Nov 12 10:18:25 CST 2015
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: TI AM335x EVM
[    0.000000] cma: CMA: reserved 16 MiB at 9e800000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (neon )
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129792
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=9,2048 rootfstype=ubifs rootwait=1
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 488604K/523264K available (5306K kernel code, 420K rwdata, 2028K rodata, 302K init, 5490K bss, 34660K 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]     vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0731bec   (7335 kB)
[    0.000000]       .init : 0xc0732000 - 0xc077db44   ( 303 kB)
[    0.000000]       .data : 0xc077e000 - 0xc07e7130   ( 421 kB)
[    0.000000]        .bss : 0xc07e7130 - 0xc0d43c20   (5491 kB)
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[    0.000000] Total of 128 interrupts on 1 active controller
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000014] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
[    0.000064] OMAP clocksource: timer1 at 24000000 Hz
[    0.000859] Console: colour dummy device 80x30
[    0.000919] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[    0.000928] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.000935] ... MAX_LOCK_DEPTH:          48
[    0.000942] ... MAX_LOCKDEP_KEYS:        8191
[    0.000949] ... CLASSHASH_SIZE:          4096
[    0.000956] ... MAX_LOCKDEP_ENTRIES:     16384
[    0.000963] ... MAX_LOCKDEP_CHAINS:      32768
[    0.000970] ... CHAINHASH_SIZE:          16384
[    0.000977]  memory used by lock dependency info: 3695 kB
[    0.000985]  per task-struct memory footprint: 1152 bytes
[    0.001030] Calibrating delay loop... 795.44 BogoMIPS (lpj=3977216)
[    0.078877] pid_max: default: 32768 minimum: 301
[    0.079153] Security Framework initialized
[    0.079250] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.079263] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.104531] CPU: Testing write buffer coherency: ok
[    0.105901] Setting up static identity map for 0x80510078 - 0x805100e8
[    0.110661] devtmpfs: initialized
[    0.114858] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.156547] omap_hwmod: tptc0 using broken dt data from edma
[    0.156950] omap_hwmod: tptc1 using broken dt data from edma
[    0.157339] omap_hwmod: tptc2 using broken dt data from edma
[    0.166038] omap_hwmod: debugss: _wait_target_disable failed
[    0.226349] pinctrl core: initialized pinctrl subsystem
[    0.231282] regulator-dummy: no parameters
[    0.234932] NET: Registered protocol family 16
[    0.241201] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.247483] cpuidle: using governor ladder
[    0.247511] cpuidle: using governor menu
[    0.258280] syscon 44e10000.control_module: regmap [mem 0x44e10000-0x44e107fb] registered
[    0.262403] platform 49000000.edma: alias fck already exists
[    0.262439] platform 49000000.edma: alias fck already exists
[    0.262460] platform 49000000.edma: alias fck already exists
[    0.266990] OMAP GPIO hardware version 0.1
[    0.297689] omap-gpmc 50000000.gpmc: could not find pctldev for node /pinmux@44e10800/nandflash_pins_default, deferring probe
[    0.297741] platform 50000000.gpmc: Driver omap-gpmc requests probe deferral
[    0.308517] No ATAGs?
[    0.308541] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.363507] bio: create slab <bio-0> at 0
[    0.404759] edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver
[    0.407467] vbat: 5000 mV 
[    0.408759] lis3_reg: no parameters
[    0.410280] wlan-en-regulator: 1800 mV 
[    0.416786] i2c-core: driver [palmas] using legacy suspend method
[    0.416803] i2c-core: driver [palmas] using legacy resume method
[    0.418490] SCSI subsystem initialized
[    0.421059] usbcore: registered new interface driver usbfs
[    0.421531] usbcore: registered new interface driver hub
[    0.422320] usbcore: registered new device driver usb
[    0.424753] omap_i2c 44e0b000.i2c: could not find pctldev for node /pinmux@44e10800/pinmux_i2c0_pins, deferring probe
[    0.424799] platform 44e0b000.i2c: Driver omap_i2c requests probe deferral
[    0.424863] omap_i2c 4802a000.i2c: could not find pctldev for node /pinmux@44e10800/pinmux_i2c1_pins, deferring probe
[    0.424891] platform 4802a000.i2c: Driver omap_i2c requests probe deferral
[    0.430886] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    0.435557] Switched to clocksource timer1
[    0.609650] NET: Registered protocol family 2
[    0.611517] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.611730] TCP bind hash table entries: 4096 (order: 5, 147456 bytes)
[    0.613361] TCP: Hash tables configured (established 4096 bind 4096)
[    0.613566] TCP: reno registered
[    0.613594] UDP hash table entries: 256 (order: 2, 20480 bytes)
[    0.613821] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[    0.614924] NET: Registered protocol family 1
[    0.616514] RPC: Registered named UNIX socket transport module.
[    0.616539] RPC: Registered udp transport module.
[    0.616549] RPC: Registered tcp transport module.
[    0.616559] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.617856] hw perfevents: enabled with ARMv7 Cortex-A8 PMU driver, 5 counters available
[    0.626040] futex hash table entries: 256 (order: 1, 11264 bytes)
[    0.782920] VFS: Disk quotas dquot_6.5.2
[    0.783026] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.784994] NFS: Registering the id_resolver key type
[    0.785418] Key type id_resolver registered
[    0.785436] Key type id_legacy registered
[    0.785679] jffs2: version 2.2. (NAND) (SUMMARY)  漏 2001-2006 Red Hat, Inc.
[    0.786128] msgmni has been set to 986
[    0.789188] io scheduler noop registered
[    0.789209] io scheduler deadline registered
[    0.789270] io scheduler cfq registered (default)
[    0.793404] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[    0.800206] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.809029] omap_uart 44e09000.serial: no wakeirq for uart0
[    0.809667] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 88, base_baud = 3000000) is a OMAP UART0
[    1.506402] console [ttyO0] enabled
[    1.512548] omap_uart 48022000.serial: no wakeirq for uart0
[    1.518868] 48022000.serial: ttyO1 at MMIO 0x48022000 (irq = 89, base_baud = 3000000) is a OMAP UART1
[    1.533553] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
[    1.570792] brd: module loaded
[    1.592017] loop: module loaded
[    1.596071] (stk) :sysfs entries created
[    1.600334] (stk) : debugfs entries created 
[    1.605192] (hci_tty): inside hci_tty_init
[    1.611149] (hci_tty): allocated 251, 0
[    1.621723] mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.635486] usbcore: registered new interface driver asix
[    1.641685] usbcore: registered new interface driver ax88179_178a
[    1.648542] usbcore: registered new interface driver cdc_ether
[    1.655107] usbcore: registered new interface driver smsc95xx
[    1.661576] usbcore: registered new interface driver net1080
[    1.667941] usbcore: registered new interface driver cdc_subset
[    1.674529] usbcore: registered new interface driver zaurus
[    1.680913] usbcore: registered new interface driver cdc_ncm
[    1.689043] usbcore: registered new interface driver cdc_wdm
[    1.695471] usbcore: registered new interface driver usb-storage
[    1.702314] usbcore: registered new interface driver usbtest
[    1.711876] mousedev: PS/2 mouse device common for all mice
[    1.721383] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
[    1.728918] 44e3e000.rtc: already running
[    1.734615] i2c /dev entries driver
[    1.738760] Driver for 1-wire Dallas network protocol.
[    1.749427] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    1.761528] omap_hsmmc 48060000.mmc: unable to get vmmc regulator -517
[    1.769131] platform 48060000.mmc: Driver omap_hsmmc requests probe deferral
[    1.902583] usbcore: registered new interface driver usbhid
[    1.908533] usbhid: USB HID core driver
[    1.913011] platform 44d00000.wkup_m3: Driver wkup_m3 requests probe deferral
[    1.923751] oprofile: using arm/armv7
[    1.928422] TCP: cubic registered
[    1.931893] Initializing XFRM netlink socket
[    1.936523] NET: Registered protocol family 17
[    1.941249] NET: Registered protocol family 15
[    1.946295] Key type dns_resolver registered
[    1.954078] PM: bootloader does not support rtc-only!
[    1.959464] ThumbEE CPU extension supported.
[    1.963973] Registering SWP/SWPB emulation handler
[    1.974821] wlan-en-regulator: disabling
[    1.979049] lis3_reg: disabling
[    1.982332] vbat: disabling
[    1.985250] regulator-dummy: disabling
[    1.990434] omap-gpmc 50000000.gpmc: GPMC revision 6.0
[    1.996281] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[    2.004938] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xd3
[    2.011675] nand: Samsung NAND 1GiB 3,3V 8-bit
[    2.016343] nand: 1024MiB, SLC, page size: 2048, OOB size: 64
[    2.022339] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme
[    2.028298] 10 ofpart partitions found on MTD device omap2-nand.0
[    2.034659] Creating 10 MTD partitions on "omap2-nand.0":
[    2.040342] 0x000000000000-0x000000020000 : "NAND.SPL"
[    2.054506] 0x000000020000-0x000000040000 : "NAND.SPL.backup1"
[    2.065967] 0x000000040000-0x000000060000 : "NAND.SPL.backup2"
[    2.077456] 0x000000060000-0x000000080000 : "NAND.SPL.backup3"
[    2.088559] 0x000000080000-0x0000000c0000 : "NAND.u-boot-spl-os"
[    2.099765] 0x0000000c0000-0x0000001c0000 : "NAND.u-boot"
[    2.110645] 0x0000001c0000-0x0000001e0000 : "NAND.u-boot-env"
[    2.121590] 0x0000001e0000-0x000000200000 : "NAND.u-boot-env.backup1"
[    2.133152] 0x000000200000-0x000000a00000 : "NAND.kernel"
[    2.147463] 0x000000a00000-0x000010000000 : "NAND.file-system"
[    2.274807] tps65910 0-002d: No interrupt support, no core IRQ
[    2.289881] vrtc: 1800 mV 
[    2.293253] vrtc: supplied by vbat
[    2.300508] vio: at 1500 mV 
[    2.303773] vio: supplied by vbat
[    2.310832] vdd_mpu: 912 <--> 1375 mV at 1262 mV 
[    2.316033] vdd_mpu: supplied by vbat
[    2.323294] vdd_core: 912 <--> 1150 mV at 1137 mV 
[    2.328586] vdd_core: supplied by vbat
[    2.335494] vdd3: 5000 mV 
[    2.341165] vdig1: at 1800 mV 
[    2.344594] vdig1: supplied by vbat
[    2.351301] vdig2: at 1800 mV 
[    2.354739] vdig2: supplied by vbat
[    2.361363] vpll: at 1800 mV 
[    2.364686] vpll: supplied by vbat
[    2.371213] vdac: at 1800 mV 
[    2.374560] vdac: supplied by vbat
[    2.381146] vaux1: at 1800 mV 
[    2.384568] vaux1: supplied by vbat
[    2.391172] vaux2: at 3300 mV 
[    2.394610] vaux2: supplied by vbat
[    2.401247] vaux33: at 3300 mV 
[    2.404767] vaux33: supplied by vbat
[    2.411472] vmmc: 1800 <--> 3300 mV at 3300 mV 
[    2.416502] vmmc: supplied by vbat
[    2.422329] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    2.436217] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
[    2.487085]  remoteproc0: wkup_m3 is available
[    2.491744]  remoteproc0: Note: remoteproc is still under development and considered experimental.
[    2.501178]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[    2.513033]  remoteproc0: Direct firmware load failed with error -2
[    2.519650]  remoteproc0: Falling back to user helper
[    2.532941] UBI: attaching mtd9 to ubi0
[    2.647057] UBI: scanning is finished
[    2.650885] UBI: empty MTD device detected
[    2.655324] UBI error: ubi_early_get_peb: no free eraseblocks
[    2.661427] UBI error: ubi_attach_mtd_dev: failed to attach mtd9, error -28
[    2.668787] UBI error: ubi_init: cannot attach mtd9
[    2.735677] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[    2.742057] davinci_mdio 4a101000.mdio: detected phy mask fffffffc
[    2.752334] libphy: 4a101000.mdio: probed
[    2.756622] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver unknown
[    2.764976] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver unknown
[    2.775132] cpsw 4a100000.ethernet: Detected MACID = 1c:ba:8c:f5:6b:e2
[    2.786666] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 01:31:43 UTC (946690303)
[    2.817560] UBIFS error (pid 1): ubifs_mount: cannot open "ubi0:rootfs", error -19
[    2.825495] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19
[    2.833928] Please append a correct "root=" boot option; here are the available partitions:
[    2.842738] 1f00             128 mtdblock0  (driver?)
[    2.848060] 1f01             128 mtdblock1  (driver?)
[    2.853340] 1f02             128 mtdblock2  (driver?)
[    2.858651] 1f03             128 mtdblock3  (driver?)
[    2.863930] 1f04             256 mtdblock4  (driver?)
[    2.869239] 1f05            1024 mtdblock5  (driver?)
[    2.874517] 1f06             128 mtdblock6  (driver?)
[    2.879825] 1f07             128 mtdblock7  (driver?)
[    2.885104] 1f08            8192 mtdblock8  (driver?)
[    2.890413] 1f09          251904 mtdblock9  (driver?)
[    2.895802] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

使用nand ubi文件系统时遇到的问题,请帮忙分析一下。
  • no free eraseblocks
    
    
    請問有先處理這部分嗎?
    mkfs.ubifs時的參數有對應到你的flash嗎?
    將區塊清空後掛載起來的訊息是?
  • 你好,chang,我又在uboot下直接挂载ubifs时会提示如下信息:

    NAND write: device 0 offset 0x60000, size 0x8f300
     586496 bytes written: OK
    (sanway@star1.1)
    U-Boot SPL 2014.07-00107-gd28f2b9-dirty (Nov 16 2015 - 15:27:36)
    reading args
    spl_load_image_fat_os: error reading image args, err - -1
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2014.07-00107-gd28f2b9-dirty (Nov 16 2015 - 15:27:36)
    
    I2C:   ready
    DRAM:  512 MiB
    NAND:  1024 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Warning - bad CRC, using default environment
    
    Net:   <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Press qw to cmdline...(sanway@star1.1)mtdparts 
    
    device nand0 <nand.0>, # parts = 6
     #: name                size            offset          mask_flags
     0: SPL                 0x00020000      0x00000000      0
     1: u-boot-spl-os       0x00040000      0x00020000      0
     2: u-boot              0x00100000      0x00060000      0
     3: u-boot-env          0x00020000      0x00160000      0
     4: kernel              0x00800000      0x00180000      0
     5: rootfs              0x3f680000      0x00980000      0
    
    active partition: nand0,0 - (SPL) 0x00020000 @ 0x00000000
    
    defaults:
    mtdids  : nand0=nand.0
    mtdparts: mtdparts=nand.0:128k(SPL),256k(u-boot-spl-os),1m(u-boot),128k(u-boot-env),8m(kernel),-(rootfs)
    (sanway@star1.1)u
      ubi ubifsload ubifsls ubifsmount ubifsumount usb usbboot
    (sanway@star1.1)ubi
      ubi ubifsload ubifsls ubifsmount ubifsumount
    (sanway@star1.1)ubi part rootfs
    UBI: attaching mtd1 to ubi0
    UBI: physical eraseblock size:   131072 bytes (128 KiB)
    UBI: logical eraseblock size:    129024 bytes
    UBI: smallest flash I/O unit:    2048
    UBI: sub-page size:              512
    UBI: VID header offset:          512 (aligned 512)
    UBI: data offset:                2048
    UBI: empty MTD device detected
    UBI: create volume table (copy #1)
    UBI: create volume table (copy #2)
    UBI: attached mtd1 to ubi0
    UBI: MTD device name:            "mtd=5"
    UBI: MTD device size:            1014 MiB
    UBI: number of good PEBs:        8112
    UBI: number of bad PEBs:         4
    UBI: max. allowed volumes:       128
    UBI: wear-leveling threshold:    4096
    UBI: number of internal volumes: 1
    UBI: number of user volumes:     0
    UBI: available PEBs:             8027
    UBI: total number of reserved PEBs: 85
    UBI: number of PEBs reserved for bad PEB handling: 81
    UBI: max/mean erase counter: 1/0
    (sanway@star1.1)ubi create rootfs
    No size specified -> Using max size (1035675648)
    Creating dynamic volume rootfs of size 1035675648
    (sanway@star1.1)ubifsmount rootfs
    UBIFS error (pid 0): ubifs_get_sb: cannot open "rootfs", error -22
    UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume 'rootfs' errno=-22!
    
    ubifsmount - mount UBIFS volume
    
    Usage:
    ubifsmount <volume-name>
        - mount 'volume-name' volume
    (sanway@star1.1)

    error -22为参数错误

    请问我这样子操作有问题吗?

  • 請問您是參照TI給的Wiki去做嗎? 具體製作ubifs的步驟與參數是?

    Prebuilt buifs有試過嗎?

  • 建议核查三部分:

    1. NAND的驱动,是否已经在kernel里面进行了配置,一定要核查这一点。

    2. 烧录的地址空间,一定要确认正确。

    3. 你本身的UBIFS的制作,参考:http://www.deyisupport.com/question_answer/dsp_arm/sitara_arm/f/25/t/59921.aspx

  • 谢谢刘工关注,这篇文档在一年前就认真看过了,制作的ubi镜像是没问题的,以前用的3.2的内核都能正常启用,内核配置和烧录地址都有确认过。

    我现在换了ti-processor-sdk-linux-am335x-evm-02.00.00.00-Linux-x86-Install.bin,内核4.1.6,已经可以正确识别启动了,但还是没找到问题在哪儿。

    感觉还是3.14的内核配置哪里忽略了。

  • 等于3.2的和4.1的内核都可以启动,但是3.14的不行?有没有对照过内核配置选项的不同?

  • 也有对照过,使用的都是omap2plus_defconfig配置文件来修改的。

    nand配置那块没什么太大差别。

  • 都是同一个ubifs镜像文件么?检查下内核对文件系统的支持这部分配置有什么不同。

  • 你好,ZHOU and LIU, 这两天有回头研究了一下这问题,发现是gpmc_wen这个信号引起的,我们用这个信号在我们自己的底板上接了cpld,如下图

    如果我把电阻R180去掉,文件系统能正常启动。连上的话就会出现这个问题。
    我又试着把内核里面相关的信息打印出来,发现在扫描mtd9也就是rootfs这个分区的时候,发现全是坏块。如下图:
    能帮忙分析一下,这可能是那个地方引起的问题吗?
  • 你现在cpld里面有程序吗?

    可以先初始化一下cpld试试

  • 问题已经找到,还是dts配置的问题,我们cpld用了cs1,cs2,cs3三个段,而dts里面cs3其他地方也用到,信号一直拉低,

    导致nand读写异常,内核判断mtd的分区全是坏块。

    感谢大家的回复!