jzkn 发表于 2014-4-14 11:57:44

请教关于三星K9F1G08U0E的驱动问题

   公司一块板子使用的是ATMEL 9260+2片现代NOR FLASH+1片三星K9F1G08U0E的nand flash。之前NAND用的是K9F1G08U0D版本,软件也工作正常。最近代理商说U0D要停产,更换为U0E,引脚兼容,就是时序有点变化。结果更换NAND后,板子就启动不了了。应该是uboot不支持该型号的nand导致内核不能正常解压运行。
   之前负责UBOOT移植的同事辞职了,公司目前找不到人来搞这个,请教大神如果要该驱动的话或者修改配置文件,该怎样做?不甚感激。。。。
附件是两种NAND的区别,左边是U0D,42nm制程,右边是U0E,21nm制程。时序上稍微有所不同,其他没变化。

owenzuiai 发表于 2014-4-21 10:01:53

一块板还是几块板都这样

jzkn 发表于 2014-4-21 10:08:26

owenzuiai 发表于 2014-4-21 10:01
一块板还是几块板都这样

好几块都这样,启动uboot后写进去能正常运行,重启后就死了。更换为U0D的旧NAND就可以正常运行。麻烦看看下面的打印。
正常启动打如下:
AT91Bootstrap loading from nandflash 0x20000...


U-Boot 2012.10 (Mar 02 2013 - 10:58:05)

CPU: AT91SAM9260
Crystal frequency:   18.432 MHz
CPU clock      :198.656 MHz
Master clock   :   99.328 MHz
DRAM:32 MiB
WARNING: Caches not enabled
NAND:128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   macb0

NAND read: device 0 offset 0x7700000, size 0x2
2 bytes read: OK

NAND read: device 0 offset 0x7700000, size 0x2
2 bytes read: OK
Hit any key to stop autoboot:0

NAND read: device 0 offset 0x100000, size 0x400000
4194304 bytes read: OK
## Booting kernel from Legacy Image at 20008000 ...
   Image Name:   Linux-2.6.38.2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1540396 Bytes = 1.5 MiB
   Load Address: 20008000
   Entry Point:20008040
   Verifying Checksum ... OK
   XIP Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.38.2 (zcj@project-manager) (gcc version 4.2.2) #29 Sat Mar 23 16:16:54 CST 2013
CPU: ARM926EJ-S revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9260-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on.Total pages: 8128
Kernel command line: console=ttySAC0,115200 mem=32M mtdparts=atmel_nand:128K(BootAgent)ro,896K(Uboot)ro,4M(Kernel1),4M(Kernel2),55M(Root1),55M(Root2),-(data) ubi.mtd=4 root=ubi0:Root rootfstype=ubifs rw
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 29328k/29328k available, 3440k reserved, 0K highmem
Virtual kernel memory layout:
    vector: 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap: 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA   : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc2800000 - 0xfee00000   ( 966 MB)
    lowmem: 0xc0000000 - 0xc2000000   (32 MB)
    modules : 0xbf000000 - 0xc0000000   (16 MB)
      .init : 0xc0008000 - 0xc0026000   ( 120 kB)
      .text : 0xc0026000 - 0xc02d375c   (2742 kB)
      .data : 0xc02d4000 - 0xc02f1900   ( 119 kB)
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
Console: colour dummy device 80x30
console enabled
Calibrating delay loop... 98.91 BogoMIPS (lpj=494592)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
NET: Registered protocol family 16
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
i2c-gpio i2c-gpio: using pins 55 (SDA) and 56 (SCL)
Switching to clocksource pit
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
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
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 57
io scheduler noop registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
atmel_usart.3: ttyS3 at MMIO 0xfffb8000 (irq = 8) is a ATMEL_SERIAL
brd: module loaded
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 203 at 0x000001960000
Bad eraseblock 329 at 0x000002920000
Bad eraseblock 394 at 0x000003140000
Bad eraseblock 491 at 0x000003d60000
Bad eraseblock 843 at 0x000006960000
7 cmdlinepart partitions found on MTD device atmel_nand
Creating 7 MTD partitions on "atmel_nand":
0x000000000000-0x000000020000 : "BootAgent"
0x000000020000-0x000000100000 : "Uboot"
0x000000100000-0x000000500000 : "Kernel1"
0x000000500000-0x000000900000 : "Kernel2"
0x000000900000-0x000004000000 : "Root1"
0x000004000000-0x000007700000 : "Root2"
0x000007700000-0x000008000000 : "data"
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: max. sequence number:       215
UBI: attached mtd4 to ubi0
UBI: MTD device name:            "Root1"
UBI: MTD device size:            55 MiB
UBI: number of good PEBs:      436
UBI: number of bad PEBs:         4
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: 436
UBI: number of PEBs reserved for bad PEB handling: 4
UBI: max/mean erase counter: 2/1
UBI: image sequence number:219044452
UBI: background thread "ubi_bgt0d" started, PID 799
mii init .
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffc4000 irq 21 (00:23:b8:33:45:66)
eth0: attached PHY driver (mii_bus:phy_addr=ffffffff:00, irq=-1)
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
udc: at91_udc version 3 May 2006
mousedev: PS/2 mouse device common for all mice
rtc-ds1307 0-0068: rtc core: registered ds1307 as rtc0
rtc-ds1307 0-0068: 56 bytes nvram
i2c /dev entries driver
AT91SAM9 Watchdog: sorry, watchdog is disabled
at91_wdt: probe of at91_wdt failed with error -5
TCP cubic registered
NET: Registered protocol family 17
rtc-ds1307 0-0068: setting system clock to 2000-01-13 18:07:32 UTC (947786852)
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "Root"
UBIFS: file system size:   50319360 bytes (49140 KiB, 47 MiB, 390 LEBs)
UBIFS: journal size:       6838272 bytes (6678 KiB, 6 MiB, 53 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:12.
devtmpfs: mounted
Freeing init memory: 120K




异常启动打印如下:

AT91Bootstrap loading from nandflash 0x20000...


U-Boot 2012.10 (Mar 02 2013 - 10:58:05)

CPU: AT91SAM9260
Crystal frequency:   18.432 MHz
CPU clock      :198.656 MHz
Master clock   :   99.328 MHz
DRAM:32 MiB
WARNING: Caches not enabled
NAND:128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   macb0

NAND read: device 0 offset 0x7700000, size 0x2
2 bytes read: OK

NAND read: device 0 offset 0x7700000, size 0x2
2 bytes read: OK
Hit any key to stop autoboot:0

NAND read: device 0 offset 0x100000, size 0x400000
4194304 bytes read: OK
## Booting kernel from Legacy Image at 20008000 ...
   Image Name:   Linux-2.6.38.2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1540396 Bytes = 1.5 MiB
   Load Address: 20008000
   Entry Point:20008040
   Verifying Checksum ... OK
   XIP Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.38.2 (zcj@project-manager) (gcc version 4.2.2) #29 Sat Mar 23 16:16:54 CST 2013
CPU: ARM926EJ-S revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9260-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on.Total pages: 8128
Kernel command line: console=ttySAC0,115200 mem=32M mtdparts=atmel_nand:128K(BootAgent)ro,896K(Uboot)ro,4M(Kernel1),4M(Kernel2),55M(Root1),55M(Root2),-(data) ubi.mtd=4 root=ubi0:Root rootfstype=ubifs rw
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 29328k/29328k available, 3440k reserved, 0K highmem
Virtual kernel memory layout:
    vector: 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap: 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA   : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc2800000 - 0xfee00000   ( 966 MB)
    lowmem: 0xc0000000 - 0xc2000000   (32 MB)
    modules : 0xbf000000 - 0xc0000000   (16 MB)
      .init : 0xc0008000 - 0xc0026000   ( 120 kB)
      .text : 0xc0026000 - 0xc02d375c   (2742 kB)
      .data : 0xc02d4000 - 0xc02f1900   ( 119 kB)
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
Console: colour dummy device 80x30
console enabled
Calibrating delay loop... 99.12 BogoMIPS (lpj=495616)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
NET: Registered protocol family 16
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
i2c-gpio i2c-gpio: using pins 55 (SDA) and 56 (SCL)
Switching to clocksource pit
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
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
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 57
io scheduler noop registered (default)
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
atmel_usart.3: ttyS3 at MMIO 0xfffb8000 (irq = 8) is a ATMEL_SERIAL
brd: module loaded
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
7 cmdlinepart partitions found on MTD device atmel_nand
Creating 7 MTD partitions on "atmel_nand":
0x000000000000-0x000000020000 : "BootAgent"
0x000000020000-0x000000100000 : "Uboot"
0x000000100000-0x000000500000 : "Kernel1"
0x000000500000-0x000000900000 : "Kernel2"
0x000000900000-0x000004000000 : "Root1"
0x000004000000-0x000007700000 : "Root2"
0x000007700000-0x000008000000 : "data"
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
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:512, read 512 bytes
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read 64 bytes
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1:512, read 512 bytes
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 79:0, read 64 bytes
uncorrectable error :
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 79:512, read 512 bytes
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 80:0, read 64 bytes
uncorrectable error :
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 80:512, read 512 bytes
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 152:0, read 64 bytes
uncorrectable error :
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 152:512, read 512 bytes
UBI: max. sequence number:       0
UBI error: ubi_read_volume_table: the layout volume was not found
UBI error: ubi_init: cannot attach mtd4
mii init .
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffc4000 irq 21 (00:23:b8:33:45:66)
eth0: attached PHY driver (mii_bus:phy_addr=ffffffff:00, irq=-1)
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
udc: at91_udc version 3 May 2006
mousedev: PS/2 mouse device common for all mice
rtc-ds1307 0-0068: rtc core: registered ds1307 as rtc0
rtc-ds1307 0-0068: 56 bytes nvram
i2c /dev entries driver
AT91SAM9 Watchdog: sorry, watchdog is disabled
at91_wdt: probe of at91_wdt failed with error -5
TCP cubic registered
NET: Registered protocol family 17
rtc-ds1307 0-0068: setting system clock to 2000-01-13 02:42:36 UTC (947731356)
VFS: Cannot open root device "ubi0:Root" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00             128 mtdblock0(driver?)
1f01             896 mtdblock1(driver?)
1f02            4096 mtdblock2(driver?)
1f03            4096 mtdblock3(driver?)
1f04         56320 mtdblock4(driver?)
1f05         56320 mtdblock5(driver?)
1f06            9216 mtdblock6(driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<c0031cd8>] (unwind_backtrace+0x0/0xf0) from [<c003d9e0>] (panic+0x54/0x194)
[<c003d9e0>] (panic+0x54/0x194) from [<c0009064>] (mount_block_root+0x24c/0x2a4)
[<c0009064>] (mount_block_root+0x24c/0x2a4) from [<c00091b4>] (prepare_namespace+0x8c/0x1d4)
[<c00091b4>] (prepare_namespace+0x8c/0x1d4) from [<c00088b8>] (kernel_init+0x104/0x148)
[<c00088b8>] (kernel_init+0x104/0x148) from [<c002d7b8>] (kernel_thread_exit+0x0/0x8)



看的出来时UBI那里开始出现问题。uboot能启动,内核也能解压,但是文件系统这里出了毛病,真是奇怪。

xuanfong1 发表于 2014-4-21 10:09:10

大神,路过帮顶,学无止境。

cht-rtos 发表于 2014-4-21 10:13:31

环境变量那块怎么报了一个crc错误?环境变量有问题?

jzkn 发表于 2014-4-21 10:25:38

cht-rtos 发表于 2014-4-21 10:13
环境变量那块怎么报了一个crc错误?环境变量有问题?

刚才用beyondcompare看了下两个打印信息。确实第一处不同就是“*** Warning - bad CRC, using default environment“这里。至于原因我也不懂啊,我没搞过这个,⊙﹏⊙b汗

容我再学习一下启动过程,哎,一点一点搞吧。

zhangshixing 发表于 2014-4-21 17:23:15

我也碰到这个问题啊。换了一个4Gb Nandflash,就读出正常,第二次启动就报ECC错误。难道时序要改下吗。

jzkn 发表于 2014-4-22 09:02:32

本帖最后由 jzkn 于 2014-4-22 09:06 编辑

zhangshixing 发表于 2014-4-21 17:23
我也碰到这个问题啊。换了一个4Gb Nandflash,就读出正常,第二次启动就报ECC错误。难道时序要改下吗。 ...

网上看了很多资料。有很多原因及解决办法,我给你列一下,但是不保证都对的上号:
1、CPU频率过高,原为192M,改为129M后正常。
2、NANDFLASH分区不正确。
3、ECC校验在内核中关掉后试试。
4、写的时候先整片擦除再写入。


你能说说你的详细情况吗?我们NAND大小都是一样的(128MiB),只是芯片尾缀不一样,参数上写程时间和擦除时间以及局部写入次数不同,看上去应该能完全兼容。结果重启后就不行了。
搜了很多UBI error: ubi_io_read: error -74 (ECC error) 的网页,还是没找到完整的解决办法。哎。。

jzkn 发表于 2014-4-22 12:47:37

zuoyi001 发表于 2014-4-22 11:48
看一下BootStrap中的所支持的NAND Flash的ID!

U0D和U0E的ID都是0xECF1。规格完全一样,除了tPROG和tBER和NOP三个参数不太一样。
uboot都能起来,已经进入文件系统部分了,应该跟bootstrap没关系。

sinc_mark 发表于 2014-4-23 08:12:10

纯粹建议:
可以先试试通过nfs挂载系统,进入系统后在系统下烧录根文件系统,之后再启动试试看!

owenzuiai 发表于 2014-4-26 00:10:26

可以换镁光同类1g的,应该能兼容

sinc_mark 发表于 2014-4-26 09:13:50

楼主的事情解决了吗?我现在也出了ubi_read_io   err74 ,但我是在uboot下分区的时候出现这个问题的,暂时还没找出问题的解决办法!

maimaige 发表于 2014-4-26 09:46:48

这个问题,谁解决了,公布一下,

jzkn 发表于 2014-4-28 09:13:17

本帖最后由 jzkn 于 2014-4-28 09:58 编辑

目前我们是这样解决的:
   更换SPANSION的同规格NAND-S34ML01G1,完全兼容。由于我们的bootloader之前没有作兼容处理,修改后就能完美启动并运行了。
关于三星的U0E:
    我目前能确定的是,肯定与芯片的NOP参数有关。U0C/D的NOP是4,所以在做UBIFS的时候UBINIZE 的参数-s 512表示一个页面可以分成4个子页来写,每个子页就是512,但是U0E的NOP是1,所以应该说就不支持子页操作了。这个时候就需要去掉-s选项,采用默认值2048也就是与页面大小一致(去掉-s与-s 2048效果一样)。
   做文件系统的参数也需要修改:之前的VID header offset是512且512字节对齐,它与EC头部(Erase Count)一起会占用一个页面2048,所以这个时候物理擦除块是128K=131072 ,逻辑擦除块是128-2=126K=129024。这时的UBI制作命令如下:
mkfs.ubifs -o ubifs.img -r target_root -m 2048 -e 129024 -c 400//-e*-c=可访问的空间大小 -m:页面大小,-e:逻辑擦除块大小,-c:最大逻辑擦除块数目
ubinize -o ubivol.img -m 2048 -p 128KiB -s 512 ubinize.cfg          //-m:同上,-p:物理擦除块大小,-s:--sub-page-size=<bytes>minimum input/output unit used for UBIheaders, e.g. sub-page size in case of NAND flash (equivalent to the minimum input/output unit size by default)子页大小
针对U0E修改后的UBI制作命令如下:
mkfs.ubifs -o ubifs.img -r target_root -m 2048 -e 126976 -c 400
ubinize -o ubivol.img -m 2048 -p 128KiBubinize.cfg
可以看出去掉了-s选项及修改了-e选项的值。因为此时ubi头部(EC+VID)各占用2048,总共就是4K的空间,所以逻辑擦除块就变成了128-4=124KB=126976.

    重做文件系统并烧写后,重启就会出现“UBI error: validate_ec_hdr: bad VID header offset 2048, expected 512”这样的打印信息。这是因为内核的nand驱动没有关掉子页操作。因此需要在内核里面去关掉SUB_PAGE WRITE这个功能。但是menuconfig里面没有选项,只有去源码改:drivers/mtd/nand/nand_ids.c73行#define LP_OPTIONS中添加|NAND_NO_SUBPAGE_WRITE。
还需要修改include/linux/mtd/nand.h 205行#define NAND_SAMSUNG_LP_OPTIONS添加|NAND_NO_SUBPAGE_WRITE.这样内核启动后就没有sub page size的打印了。

   这样做完后重新生成内核,但是仍然有错误(烧写完成的那一次能成功启动,重启后就不行了),目前我的最新打印错误出现在ubifs,也是ECC 74错误,打印信息见后。因为手里事情比较多,这个研究可能要拖一下了,欢迎有同样问题的朋友继续讨论。
Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.38.2 (zcj@project-manager) (gcc version 4.2.2) #1 Thu Apr 24 11:18:23 CST 2014
CPU: ARM926EJ-S revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9260-EK
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
Built 1 zonelists in Zone order, mobility grouping on.Total pages: 8128
Kernel command line: console=ttySAC0,115200 mem=32M mtdparts=atmel_nand:128K(BootAgent)ro,896K(Uboot)ro,4M(Kernel1),4M(Kernel2),55M(Root1),55M(Root2),-(data) ubi.mtd=4 root=ubi0:Root rootfstype=ubifs rw
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 28824k/28824k available, 3944k reserved, 0K highmem
Virtual kernel memory layout:
    vector: 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap: 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA   : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc2800000 - 0xfee00000   ( 966 MB)
    lowmem: 0xc0000000 - 0xc2000000   (32 MB)
    modules : 0xbf000000 - 0xc0000000   (16 MB)
      .init : 0xc0008000 - 0xc0027000   ( 124 kB)
      .text : 0xc0027000 - 0xc0349a74   (3211 kB)
      .data : 0xc034a000 - 0xc0369140   ( 125 kB)
NR_IRQS:192
AT91: 96 gpio irqs in 3 banks
Console: colour dummy device 80x30
console enabled
Calibrating delay loop... 99.12 BogoMIPS (lpj=495616)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
AT91: Power Management
AT91: Starting after general reset
bio: create slab <bio-0> at 0
Switching to clocksource pit
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
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)
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
ROMFS MTD (C) 2007 Red Hat, Inc.
fuse init (API version 7.16)
msgmni has been set to 56
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)
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
atmel_usart.3: ttyS3 at MMIO 0xfffb8000 (irq = 8) is a ATMEL_SERIAL
brd: module loaded
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
7 cmdlinepart partitions found on MTD device atmel_nand
Creating 7 MTD partitions on "atmel_nand":
0x000000000000-0x000000020000 : "BootAgent"
0x000000020000-0x000000100000 : "Uboot"
0x000000100000-0x000000500000 : "Kernel1"
0x000000500000-0x000000900000 : "Kernel2"
0x000000900000-0x000004000000 : "Root1"
0x000004000000-0x000007700000 : "Root2"
0x000007700000-0x000008000000 : "data"
UBI: attaching mtd4 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: max. sequence number:       4
UBI: attached mtd4 to ubi0
UBI: MTD device name:            "Root1"
UBI: MTD device size:            55 MiB
UBI: number of good PEBs:      440
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: 440
UBI: number of PEBs reserved for bad PEB handling: 4
UBI: max/mean erase counter: 1/0
UBI: image sequence number:2070082422
mii init .
UBI: background thread "ubi_bgt0d" started, PID 32
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfffc4000 irq 21 (00:23:b8:33:45:66)
eth0: attached PHY driver (mii_bus:phy_addr=ffffffff:00, irq=-1)
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
rtc-ds1307 0-0068: rtc core: registered ds1307 as rtc0
rtc-ds1307 0-0068: 56 bytes nvram
at91_i2c at91_i2c: AT91 i2c bus driver.
TCP cubic registered
NET: Registered protocol family 17
VFP support v0.3: not present
rtc-ds1307 0-0068: setting system clock to 2000-01-01 21:55:37 UTC (946763737)
uncorrectable error :
uncorrectable error :
uncorrectable error :
uncorrectable error :
uncorrectable error :
uncorrectable error :
uncorrectable error :
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096, read 126976 bytes
uncorrectable error :
uncorrectable error :
uncorrectable error :
uncorrectable error :
uncorrectable error :
uncorrectable error :
uncorrectable error :
uncorrectable error :
UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096, read 126976 bytes
UBIFS error (pid 1): ubifs_recover_master_node: failed to recover master node
List of all partitions:
1f00             128 mtdblock0(driver?)
1f01             896 mtdblock1(driver?)
1f02            4096 mtdblock2(driver?)
1f03            4096 mtdblock3(driver?)
1f04         56320 mtdblock4(driver?)
1f05         56320 mtdblock5(driver?)
1f06            9216 mtdblock6(driver?)
No filesystem could mount root, tried:ubifs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<c0037d7c>] (unwind_backtrace+0x0/0xf0) from [<c0044230>] (panic+0x54/0x194)
[<c0044230>] (panic+0x54/0x194) from [<c0009090>] (mount_block_root+0x1c4/0x20c)
[<c0009090>] (mount_block_root+0x1c4/0x20c) from [<c0009228>] (prepare_namespace+0x8c/0x1c8)
[<c0009228>] (prepare_namespace+0x8c/0x1c8) from [<c00088b8>] (kernel_init+0x104/0x148)
[<c00088b8>] (kernel_init+0x104/0x148) from [<c0033378>] (kernel_thread_exit+0x0/0x8)

jzkn 发表于 2014-4-28 09:19:10

sinc_mark 发表于 2014-4-26 09:13
楼主的事情解决了吗?我现在也出了ubi_read_io   err74 ,但我是在uboot下分区的时候出现这个问题的,暂时 ...

也就是还没进行到内核启动这一步是吗?那你可能要好好研究一下uboot的nand驱动,以及关于分区表那一部分的定义了。请原谅我无法给你更多的信息,因为我也是新手。。。。。
我个人猜测是不是uboot没有识别到你的nand型号?
可以参考下面这个链接:
http://blog.csdn.net/yx_l128125/article/details/7474704

xutiemu 发表于 2014-5-7 09:08:29

正想跟你说,SPansion的能直接替换呢,看你下面的帖子说已经用Spansion的替换了,我这有ML01G的NAND Flash啊,你的flash是跟代理要的,还是买的?

jzkn 发表于 2014-5-19 13:23:45

xutiemu 发表于 2014-5-7 09:08
正想跟你说,SPansion的能直接替换呢,看你下面的帖子说已经用Spansion的替换了,我这有ML01G的NAND Flash ...

公司其他产品在用,直接就拿来替换了。。。。。

gyd0317 发表于 2014-9-8 14:20:17

jzkn 发表于 2014-4-22 09:02
网上看了很多资料。有很多原因及解决办法,我给你列一下,但是不保证都对的上号:
1、CPU频率过高,原为1 ...

问题应该就是你说的subpage的问题,需要修改内核驱动,看到网上有人关掉ecc也能正常

不过不太清楚芯片手册哪个参数来判断支持subpage
网上说U0B也不支持sub-page 但是看手册也是nop max =4

jzkn 发表于 2014-9-9 11:42:03

gyd0317 发表于 2014-9-8 14:20
问题应该就是你说的subpage的问题,需要修改内核驱动,看到网上有人关掉ecc也能正常

不过不太清楚芯片手 ...

NOP就是关于subpage的指标参数。意义上是这么等同的。我当时没有找到原厂的关于NAND的资料,只有供应商提供的楼主位图片。
底层的东西能找到的资料真是少,谷歌被band后更是难搞。

gyd0317 发表于 2014-9-9 13:03:26

jzkn 发表于 2014-9-9 11:42
NOP就是关于subpage的指标参数。意义上是这么等同的。我当时没有找到原厂的关于NAND的资料,只有供应商提 ...

我们问了开发板的技术支持
他们让我们第一次进入文件系统后执行sync命令,
暂时重启了几次没有出现情况,但我的同事以前测试的时候运行的时间长了,还会出现,可能读写的时候又写坏了
页: [1]
查看完整版本: 请教关于三星K9F1G08U0E的驱动问题