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.

dm8168 Linux搭建 UBI文件第二次断电启动后报错

Other Parts Discussed in Thread: PCF8575

编译uImage的内核是DVRRDK4.0版本,目前遇到的问题时第一次启动都正常,UBI文件系统不会报错,但是第二次就会一直刷

UBI: run torture test for PEB 1993
UBI: PEB 1993 passed torture test, do not mark it as bad
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:512, read 512 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1993:512, read 512 bytes

第三次启动就会刷几次上面的打印后内核崩溃

下面是第三次启动的log:

TI8168-GP rev 2.1

ARM clk: 987MHz
DDR clk: 398MHz

I2C: ready
DRAM: 1 GiB
NAND: HW ECC BCH8 Selected
256 MiB
MMC: OMAP SD/MMC: 0
Net: Detected MACID:7c:66:9d:6c:b8:8a
Ethernet PHY: GENERIC @ 0x02
DaVinci EMAC
Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x280000, size 0x230000
2293760 bytes read: OK
## Booting kernel from Legacy Image at 82000000 ...
Image Name: Linux-2.6.37
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2108872 Bytes = 2 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Linux version 2.6.37 (root@password123) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #10 Wed Jul 20 11:38:11 CST 2016
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: ti8168evm
ti81xx_reserve: ### Reserved DDR region @dff00000
reserved size = 52428800 at 0x0
FB: Reserving 52428800 bytes SDRAM for VRAM
Memory policy: ECC disabled, Data cache writeback
Ignoring RAM at c0000000-dfffffff (vmalloc region overlap).
OMAP chip is TI8168 2.1
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: console=ttyO0,115200n8 ubi.mtd=4 root=ubi0:rootfs rootfstype=ubifs libata.force=1.5G 
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB 460MB 1MB = 973MB total
Memory: 515200k/515200k available, 9088k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
vmalloc : 0xe0800000 - 0xf8000000 ( 376 MB)
lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.init : 0xc0008000 - 0xc003f000 ( 220 kB)
.text : 0xc003f000 - 0xc0402000 (3852 kB)
.data : 0xc0402000 - 0xc043d000 ( 236 kB)
SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:407
IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
Total of 128 interrupts on 1 active controller
GPMC revision 6.0
Trying to install interrupt handler for IRQ400
Trying to install interrupt handler for IRQ401
Trying to install interrupt handler for IRQ402
Trying to install interrupt handler for IRQ403
Trying to install interrupt handler for IRQ404
Trying to install interrupt handler for IRQ405
Trying to install interrupt handler for IRQ406
Trying to install type control for IRQ407
Trying to set irq flags for IRQ407
OMAP clockevent source: GPTIMER1 at 27000000 Hz
Console: colour dummy device 80x30
Calibrating delay loop... 986.31 BogoMIPS (lpj=4931584)
pid_max: default: 32768 minimum: 301
Security Framework initialized
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
TI81XX: Map 0xdff00000 to 0xfe500000 for dram barrier
TI81XX: Map 0x40300000 to 0xfe600000 for sram barrier
omap_voltage_early_init: voltage driver support not added
regulator: core version 0.5
regulator: dummy: 
NET: Registered protocol family 16
omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
omap_voltage_add_dev: VDD specified does not exist!
OMAP GPIO hardware version 0.1
OMAP GPIO hardware version 0.1
omap_mux_init: Add partition: #1: core, flags: 0
_omap_mux_get_by_name: Could not find signal i2c2_scl.i2c2_scl
_omap_mux_get_by_name: Could not find signal i2c2_sda.i2c2_sda
NOR: Can't request GPMC CS
registered ti816x_gpio_vr device
registered ti816x_sr device
pm_dbg_init: only OMAP3 supported
registered ti81xx_vpss device
ti81xx_pcie: Invoking PCI BIOS...
ti81xx_pcie: Setting up Host Controller...
ti81xx_pcie: Register base mapped @0xe0820000
ti81xx_pcie: Starting PCI scan...
PCI: bus0: Fast back to back transfers enabled
ti81xx_pcie: PCI scan done.
bio: create slab <bio-0> at 0
regulator: VFB: 800 <--> 1025 mV at 800 mV 
vgaarb: loaded
SCSI subsystem initialized
omap_i2c omap_i2c.1: bus 1 rev4.0 at 100 kHz
I2C: Read failed at pcf8575_cir_enable 673 with error code: -121
I2C: Transfer failed at pcf8575_cir_enable 679 with error code: -121
omap_i2c omap_i2c.2: bus 2 rev4.0 at 100 kHz
Switching to clocksource gp timer
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
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 udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
PMU: registered new PMU device of type 0
omap-iommu omap-iommu.0: ducati registered
omap-iommu omap-iommu.1: sys registered
msgmni has been set to 1006
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
omap_uart.0: ttyO0 at MMIO 0x48020000 (irq = 72) is a OMAP UART0
console [ttyO0] enabled
omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
brd: module loaded
loop: module loaded
ahci probe: devid name is ahci
ahci CAP register dump =0x6726ff81
Modified ahci CAP register dump =0x6f26ff81
ahci ahci.0: forcing PORTS_IMPL to 0x3
ahci: SSS flag set, parallel bus scan disabled
ahci ahci.0: AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl platform mode
ahci ahci.0: flags: ncq sntf stag pm led clo only pmp pio slum part ccc 
scsi0 : ahci_platform
scsi1 : ahci_platform
ata1: FORCE: PHY spd limit set to 1.5Gbps
ata1: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x100 irq 16
ata2: FORCE: PHY spd limit set to 1.5Gbps
ata2: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x180 irq 16
m25p80 spi1.0: found w25x32, expected m25p80
m25p80 spi1.0: w25x32 (4096 Kbytes)
Creating 1 MTD partitions on "spi_flash":
0x000000000000-0x000000400000 : "User Space"
omap2-nand driver initializing
ONFI flash detected
ONFI param page 0 valid
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)
Creating 4 MTD partitions on "omap2-nand.0":
0x000000000000-0x000000260000 : "bootloader"
0x000000260000-0x000000280000 : "env"
0x000000280000-0x0000006c0000 : "kernel"
0x0000006c0000-0x000010000000 : "filesystem"
UBI: attaching mtd4 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 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:512, read 512 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 37:0, read 64 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 37:512, read 512 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 38:0, read 64 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 38:512, read 512 bytes
ata1: SATA link down (SStatus 0 SControl 310)
UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 182:0, read 64 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 182:512, read 512 bytes
ata2: SATA link down (SStatus 0 SControl 310)
UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 545:0, read 64 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 545:512, read 512 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1993:0, read 64 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1993:512, read 512 bytes
UBI: max. sequence number: 17
UBI: attached mtd4 to ubi0
UBI: MTD device name: "filesystem"
UBI: MTD device size: 249 MiB
UBI: number of good PEBs: 1994
UBI: number of bad PEBs: 0
UBI: number of corrupted PEBs: 0
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 1
UBI: available PEBs: 0
UBI: total number of reserved PEBs: 1994
UBI: number of PEBs reserved for bad PEB handling: 19
UBI: max/mean erase counter: 17/0
UBI: image sequence number: 0
UBI: background thread "ubi_bgt0d" started, PID 38
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:512, read 512 bytes
davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
davinci_mdio davinci_mdio.0: detected phy mask ffffffeb
davinci_mdio.0: probed
davinci_mdio davinci_mdio.0: phy[2]: device 0:02, driver unknown
davinci_mdio davinci_mdio.0: phy[4]: device 0:04, driver unknown
mice: PS/2 mouse device common for all mice
rtc-ds1307 2-0068: rtc core: registered ds1388 as rtc0
omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc1
i2c /dev entries driver
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1993:512, read 512 bytes
UBI: run torture test for PEB 1993
i2c i2c-1: max6650: chip found at 0x1f.
max6650 1-001f: Fan voltage is set to 12V.
max6650 1-001f: Prescaler is set to 4.
i2c i2c-1: max6650: chip found at 0x48.
max6650 1-0048: Fan voltage is set to 12V.
max6650 1-0048: Prescaler is set to 4.
UBI: PEB 1993 passed torture test, do not mark it as bad
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:512, read 512 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1993:512, read 512 bytes
i2c i2c-1: max6650: chip found at 0x4b.
UBI: run torture test for PEB 1993
max6650 1-004b: Fan voltage is set to 12V.
max6650 1-004b: Prescaler is set to 4.
OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
TCP cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
omap_voltage_late_init: Voltage driver support not added
Power Management for TI81XX.
smartreflex smartreflex: Driver initialized
rtc-ds1307 2-0068: setting system clock to 2016-07-20 11:41:13 UTC (1469014873)
UBI: PEB 1993 passed torture test, do not mark it as bad
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:512, read 512 bytes
mmc0: new high speed MMC card at address 0001
mmcblk0: mmc0:0001 MMC08G 7.26 GiB 
mmcblk0: p1
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1993:512, read 512 bytes
UBI: run torture test for PEB 1993
UBI: PEB 1993 passed torture test, do not mark it as bad
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:512, read 512 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1993:512, read 512 bytes
UBI: run torture test for PEB 1993
UBI error: ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 3:2048, read 129024 bytes
UBI: PEB 1993 passed torture test, do not mark it as bad
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:512, read 512 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1993:512, read 512 bytes
UBI: run torture test for PEB 1993
UBI error: ubi_io_read: error -74 (ECC error) while reading 129024 bytes from PEB 4:2048, read 129024 bytes
UBIFS: recovery needed
UBI: PEB 1993 passed torture test, do not mark it as bad
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:512, read 512 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 11 bytes from PEB 10:4096, read 11 bytes
UBIFS error (pid 1): ubifs_leb_read: reading 11 bytes from LEB 8:2048 failed, error -74
VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00 4096 mtdblock0 (driver?)
1f01 2432 mtdblock1 (driver?)
1f02 128 mtdblock2 (driver?)
1f03 4352 mtdblock3 (driver?)
1f04 255232 mtdblock4 (driver?)
b300 7618560 mmcblk0 driver: mmcblk
b301 7618552 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Backtrace: 
[<c004dbdc>] (dump_backtrace+0x0/0x110) from [<c0306ad4>] (dump_stack+0x18/0x1c)
r7:df812000 r6:c0076ce4 r5:c002d684 r4:c043db90
[<c0306abc>] (dump_stack+0x0/0x1c) from [<c0306b38>] (panic+0x60/0x17c)
[<c0306ad8>] (panic+0x0/0x17c) from [<c00092b0>] (mount_block_root+0x1e0/0x220)
r3:00000000 r2:00000000 r1:df83bf78 r0:c03a173c
[<c00090d0>] (mount_block_root+0x0/0x220) from [<c0009450>] (prepare_namespace+0x94/0x1d4)
[<c00093bc>] (prepare_namespace+0x0/0x1d4) from [<c00087c4>] (kernel_init+0x114/0x154)
r5:c00086b0 r4:c043d000
[<c00086b0>] (kernel_init+0x0/0x154) from [<c0076ce4>] (do_exit+0x0/0x5e4)
r5:c00086b0 r4:00000000

ubi文件系统的制作:

mkfs.ubifs -r allfs -m 2048 -e 129024 -c 1400 -o ubifs.img
ubinize -o out/allfs.img -m 2048 -p 128KiB -s 512 allfs.cfg
rm -f ubifs.img

ubi文件系统配置

mode=ubi
image=ubifs.img
vol_id=0
vol_size=100MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize

注:在driver/mtd/nand中,我将原来的nand_base.c和omap2.c替换成了2.6.37内核的文件。

附件中是我nand文件夹

望得到解决。

nand.rar