搜索
bottom↓
回复: 21

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

[复制链接]

出0入0汤圆

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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

阿莫论坛20周年了!感谢大家的支持与爱护!!

你熬了10碗粥,别人一桶水倒进去,淘走90碗,剩下10碗给你,你看似没亏,其实你那10碗已经没有之前的裹腹了,人家的一桶水换90碗,继续卖。说白了,通货膨胀就是,你的钱是挣来的,他的钱是印来的,掺和在一起,你的钱就贬值了。

出0入0汤圆

发表于 2014-4-21 10:01:53 | 显示全部楼层
一块板还是几块板都这样

出0入0汤圆

 楼主| 发表于 2014-4-21 10:08:26 | 显示全部楼层
owenzuiai 发表于 2014-4-21 10:01
一块板还是几块板都这样

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


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

  3. CPU: AT91SAM9260
  4. Crystal frequency:   18.432 MHz
  5. CPU clock        :  198.656 MHz
  6. Master clock     :   99.328 MHz
  7. DRAM:  32 MiB
  8. WARNING: Caches not enabled
  9. NAND:  128 MiB
  10. In:    serial
  11. Out:   serial
  12. Err:   serial
  13. Net:   macb0

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

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

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

  30. Starting kernel ...

  31. Uncompressing Linux... done, booting the kernel.
  32. Linux version 2.6.38.2 (zcj@project-manager) (gcc version 4.2.2) #29 Sat Mar 23 16:16:54 CST 2013
  33. CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
  34. CPU: VIVT data cache, VIVT instruction cache
  35. Machine: Atmel AT91SAM9260-EK
  36. Memory policy: ECC disabled, Data cache writeback
  37. Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
  38. Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
  39. 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
  40. PID hash table entries: 128 (order: -3, 512 bytes)
  41. Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
  42. Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
  43. Memory: 32MB = 32MB total
  44. Memory: 29328k/29328k available, 3440k reserved, 0K highmem
  45. Virtual kernel memory layout:
  46.     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
  47.     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
  48.     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
  49.     vmalloc : 0xc2800000 - 0xfee00000   ( 966 MB)
  50.     lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
  51.     modules : 0xbf000000 - 0xc0000000   (  16 MB)
  52.       .init : 0xc0008000 - 0xc0026000   ( 120 kB)
  53.       .text : 0xc0026000 - 0xc02d375c   (2742 kB)
  54.       .data : 0xc02d4000 - 0xc02f1900   ( 119 kB)
  55. NR_IRQS:192
  56. AT91: 96 gpio irqs in 3 banks
  57. Console: colour dummy device 80x30
  58. console [ttyS0] enabled
  59. Calibrating delay loop... 98.91 BogoMIPS (lpj=494592)
  60. pid_max: default: 32768 minimum: 301
  61. Mount-cache hash table entries: 512
  62. CPU: Testing write buffer coherency: ok
  63. devtmpfs: initialized
  64. NET: Registered protocol family 16
  65. bio: create slab <bio-0> at 0
  66. SCSI subsystem initialized
  67. usbcore: registered new interface driver usbfs
  68. usbcore: registered new interface driver hub
  69. usbcore: registered new device driver usb
  70. i2c-gpio i2c-gpio: using pins 55 (SDA) and 56 (SCL)
  71. Switching to clocksource pit
  72. NET: Registered protocol family 2
  73. IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
  74. TCP established hash table entries: 1024 (order: 1, 8192 bytes)
  75. TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
  76. TCP: Hash tables configured (established 1024 bind 1024)
  77. TCP reno registered
  78. UDP hash table entries: 256 (order: 0, 4096 bytes)
  79. UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
  80. NET: Registered protocol family 1
  81. NetWinder Floating Point Emulator V0.97 (double precision)
  82. JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
  83. msgmni has been set to 57
  84. io scheduler noop registered (default)
  85. atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
  86. atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
  87. atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
  88. atmel_usart.3: ttyS3 at MMIO 0xfffb8000 (irq = 8) is a ATMEL_SERIAL
  89. brd: module loaded
  90. NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
  91. Scanning device for bad blocks
  92. Bad eraseblock 203 at 0x000001960000
  93. Bad eraseblock 329 at 0x000002920000
  94. Bad eraseblock 394 at 0x000003140000
  95. Bad eraseblock 491 at 0x000003d60000
  96. Bad eraseblock 843 at 0x000006960000
  97. 7 cmdlinepart partitions found on MTD device atmel_nand
  98. Creating 7 MTD partitions on "atmel_nand":
  99. 0x000000000000-0x000000020000 : "BootAgent"
  100. 0x000000020000-0x000000100000 : "Uboot"
  101. 0x000000100000-0x000000500000 : "Kernel1"
  102. 0x000000500000-0x000000900000 : "Kernel2"
  103. 0x000000900000-0x000004000000 : "Root1"
  104. 0x000004000000-0x000007700000 : "Root2"
  105. 0x000007700000-0x000008000000 : "data"
  106. UBI: attaching mtd4 to ubi0
  107. UBI: physical eraseblock size:   131072 bytes (128 KiB)
  108. UBI: logical eraseblock size:    129024 bytes
  109. UBI: smallest flash I/O unit:    2048
  110. UBI: sub-page size:              512
  111. UBI: VID header offset:          512 (aligned 512)
  112. UBI: data offset:                2048
  113. UBI: max. sequence number:       215
  114. UBI: attached mtd4 to ubi0
  115. UBI: MTD device name:            "Root1"
  116. UBI: MTD device size:            55 MiB
  117. UBI: number of good PEBs:        436
  118. UBI: number of bad PEBs:         4
  119. UBI: number of corrupted PEBs:   0
  120. UBI: max. allowed volumes:       128
  121. UBI: wear-leveling threshold:    4096
  122. UBI: number of internal volumes: 1
  123. UBI: number of user volumes:     1
  124. UBI: available PEBs:             0
  125. UBI: total number of reserved PEBs: 436
  126. UBI: number of PEBs reserved for bad PEB handling: 4
  127. UBI: max/mean erase counter: 2/1
  128. UBI: image sequence number:  219044452
  129. UBI: background thread "ubi_bgt0d" started, PID 799
  130. mii init .
  131. MACB_mii_bus: probed
  132. eth0: Atmel MACB at 0xfffc4000 irq 21 (00:23:b8:33:45:66)
  133. eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:00, irq=-1)
  134. usbmon: debugfs is not available
  135. ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
  136. at91_ohci at91_ohci: AT91 OHCI
  137. at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
  138. at91_ohci at91_ohci: irq 20, io mem 0x00500000
  139. hub 1-0:1.0: USB hub found
  140. hub 1-0:1.0: 2 ports detected
  141. Initializing USB Mass Storage driver...
  142. usbcore: registered new interface driver usb-storage
  143. USB Mass Storage support registered.
  144. udc: at91_udc version 3 May 2006
  145. mousedev: PS/2 mouse device common for all mice
  146. rtc-ds1307 0-0068: rtc core: registered ds1307 as rtc0
  147. rtc-ds1307 0-0068: 56 bytes nvram
  148. i2c /dev entries driver
  149. AT91SAM9 Watchdog: sorry, watchdog is disabled
  150. at91_wdt: probe of at91_wdt failed with error -5
  151. TCP cubic registered
  152. NET: Registered protocol family 17
  153. rtc-ds1307 0-0068: setting system clock to 2000-01-13 18:07:32 UTC (947786852)
  154. UBIFS: recovery needed
  155. UBIFS: recovery completed
  156. UBIFS: mounted UBI device 0, volume 0, name "Root"
  157. UBIFS: file system size:   50319360 bytes (49140 KiB, 47 MiB, 390 LEBs)
  158. UBIFS: journal size:       6838272 bytes (6678 KiB, 6 MiB, 53 LEBs)
  159. UBIFS: media format:       w4/r0 (latest is w4/r0)
  160. UBIFS: default compressor: lzo
  161. UBIFS: reserved for root:  0 bytes (0 KiB)
  162. VFS: Mounted root (ubifs filesystem) on device 0:12.
  163. devtmpfs: mounted
  164. Freeing init memory: 120K
复制代码





异常启动打印如下:

  1. [color=DarkRed]AT91Bootstrap loading from nandflash 0x20000...


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

  3. CPU: AT91SAM9260
  4. Crystal frequency:   18.432 MHz
  5. CPU clock        :  198.656 MHz
  6. Master clock     :   99.328 MHz
  7. DRAM:  32 MiB
  8. WARNING: Caches not enabled
  9. NAND:  128 MiB
  10. *** Warning - bad CRC, using default environment

  11. In:    serial
  12. Out:   serial
  13. Err:   serial
  14. Net:   macb0

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

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

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

  31. Starting kernel ...

  32. Uncompressing Linux... done, booting the kernel.
  33. Linux version 2.6.38.2 (zcj@project-manager) (gcc version 4.2.2) #29 Sat Mar 23 16:16:54 CST 2013
  34. CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
  35. CPU: VIVT data cache, VIVT instruction cache
  36. Machine: Atmel AT91SAM9260-EK
  37. Memory policy: ECC disabled, Data cache writeback
  38. Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
  39. Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
  40. 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
  41. PID hash table entries: 128 (order: -3, 512 bytes)
  42. Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
  43. Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
  44. Memory: 32MB = 32MB total
  45. Memory: 29328k/29328k available, 3440k reserved, 0K highmem
  46. Virtual kernel memory layout:
  47.     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
  48.     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
  49.     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
  50.     vmalloc : 0xc2800000 - 0xfee00000   ( 966 MB)
  51.     lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
  52.     modules : 0xbf000000 - 0xc0000000   (  16 MB)
  53.       .init : 0xc0008000 - 0xc0026000   ( 120 kB)
  54.       .text : 0xc0026000 - 0xc02d375c   (2742 kB)
  55.       .data : 0xc02d4000 - 0xc02f1900   ( 119 kB)
  56. NR_IRQS:192
  57. AT91: 96 gpio irqs in 3 banks
  58. Console: colour dummy device 80x30
  59. console [ttyS0] enabled
  60. Calibrating delay loop... 99.12 BogoMIPS (lpj=495616)
  61. pid_max: default: 32768 minimum: 301
  62. Mount-cache hash table entries: 512
  63. CPU: Testing write buffer coherency: ok
  64. devtmpfs: initialized
  65. NET: Registered protocol family 16
  66. bio: create slab <bio-0> at 0
  67. SCSI subsystem initialized
  68. usbcore: registered new interface driver usbfs
  69. usbcore: registered new interface driver hub
  70. usbcore: registered new device driver usb
  71. i2c-gpio i2c-gpio: using pins 55 (SDA) and 56 (SCL)
  72. Switching to clocksource pit
  73. NET: Registered protocol family 2
  74. IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
  75. TCP established hash table entries: 1024 (order: 1, 8192 bytes)
  76. TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
  77. TCP: Hash tables configured (established 1024 bind 1024)
  78. TCP reno registered
  79. UDP hash table entries: 256 (order: 0, 4096 bytes)
  80. UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
  81. NET: Registered protocol family 1
  82. NetWinder Floating Point Emulator V0.97 (double precision)
  83. JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
  84. msgmni has been set to 57
  85. io scheduler noop registered (default)
  86. atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
  87. atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
  88. atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
  89. atmel_usart.3: ttyS3 at MMIO 0xfffb8000 (irq = 8) is a ATMEL_SERIAL
  90. brd: module loaded
  91. NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
  92. Scanning device for bad blocks
  93. 7 cmdlinepart partitions found on MTD device atmel_nand
  94. Creating 7 MTD partitions on "atmel_nand":
  95. 0x000000000000-0x000000020000 : "BootAgent"
  96. 0x000000020000-0x000000100000 : "Uboot"
  97. 0x000000100000-0x000000500000 : "Kernel1"
  98. 0x000000500000-0x000000900000 : "Kernel2"
  99. 0x000000900000-0x000004000000 : "Root1"
  100. 0x000004000000-0x000007700000 : "Root2"
  101. 0x000007700000-0x000008000000 : "data"
  102. UBI: attaching mtd4 to ubi0
  103. UBI: physical eraseblock size:   131072 bytes (128 KiB)
  104. UBI: logical eraseblock size:    129024 bytes
  105. UBI: smallest flash I/O unit:    2048
  106. UBI: sub-page size:              512
  107. UBI: VID header offset:          512 (aligned 512)
  108. UBI: data offset:                2048
  109. uncorrectable error :
  110. UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 0:0, read 64 bytes
  111. uncorrectable error :
  112. UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 0:512, read 512 bytes
  113. uncorrectable error :
  114. UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 1:0, read 64 bytes
  115. uncorrectable error :
  116. UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1:512, read 512 bytes
  117. uncorrectable error :
  118. UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 79:0, read 64 bytes
  119. uncorrectable error :
  120. uncorrectable error :
  121. UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 79:512, read 512 bytes
  122. uncorrectable error :
  123. UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 80:0, read 64 bytes
  124. uncorrectable error :
  125. uncorrectable error :
  126. UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 80:512, read 512 bytes
  127. uncorrectable error :
  128. UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 152:0, read 64 bytes
  129. uncorrectable error :
  130. uncorrectable error :
  131. UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 152:512, read 512 bytes
  132. UBI: max. sequence number:       0
  133. UBI error: ubi_read_volume_table: the layout volume was not found
  134. UBI error: ubi_init: cannot attach mtd4
  135. mii init .
  136. MACB_mii_bus: probed
  137. eth0: Atmel MACB at 0xfffc4000 irq 21 (00:23:b8:33:45:66)
  138. eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:00, irq=-1)
  139. usbmon: debugfs is not available
  140. ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
  141. at91_ohci at91_ohci: AT91 OHCI
  142. at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
  143. at91_ohci at91_ohci: irq 20, io mem 0x00500000
  144. hub 1-0:1.0: USB hub found
  145. hub 1-0:1.0: 2 ports detected
  146. Initializing USB Mass Storage driver...
  147. usbcore: registered new interface driver usb-storage
  148. USB Mass Storage support registered.
  149. udc: at91_udc version 3 May 2006
  150. mousedev: PS/2 mouse device common for all mice
  151. rtc-ds1307 0-0068: rtc core: registered ds1307 as rtc0
  152. rtc-ds1307 0-0068: 56 bytes nvram
  153. i2c /dev entries driver
  154. AT91SAM9 Watchdog: sorry, watchdog is disabled
  155. at91_wdt: probe of at91_wdt failed with error -5
  156. TCP cubic registered
  157. NET: Registered protocol family 17
  158. rtc-ds1307 0-0068: setting system clock to 2000-01-13 02:42:36 UTC (947731356)
  159. VFS: Cannot open root device "ubi0:Root" or unknown-block(0,0)
  160. Please append a correct "root=" boot option; here are the available partitions:
  161. 1f00             128 mtdblock0  (driver?)
  162. 1f01             896 mtdblock1  (driver?)
  163. 1f02            4096 mtdblock2  (driver?)
  164. 1f03            4096 mtdblock3  (driver?)
  165. 1f04           56320 mtdblock4  (driver?)
  166. 1f05           56320 mtdblock5  (driver?)
  167. 1f06            9216 mtdblock6  (driver?)
  168. Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
  169. [<c0031cd8>] (unwind_backtrace+0x0/0xf0) from [<c003d9e0>] (panic+0x54/0x194)
  170. [<c003d9e0>] (panic+0x54/0x194) from [<c0009064>] (mount_block_root+0x24c/0x2a4)
  171. [<c0009064>] (mount_block_root+0x24c/0x2a4) from [<c00091b4>] (prepare_namespace+0x8c/0x1d4)
  172. [<c00091b4>] (prepare_namespace+0x8c/0x1d4) from [<c00088b8>] (kernel_init+0x104/0x148)
  173. [<c00088b8>] (kernel_init+0x104/0x148) from [<c002d7b8>] (kernel_thread_exit+0x0/0x8)[/color]
复制代码




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

出0入0汤圆

发表于 2014-4-21 10:09:10 | 显示全部楼层
大神,路过帮顶,学无止境。

出0入0汤圆

发表于 2014-4-21 10:13:31 | 显示全部楼层
环境变量那块怎么报了一个crc错误?环境变量有问题?

出0入0汤圆

 楼主| 发表于 2014-4-21 10:25:38 | 显示全部楼层
cht-rtos 发表于 2014-4-21 10:13
环境变量那块怎么报了一个crc错误?环境变量有问题?

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

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

出0入0汤圆

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

出0入0汤圆

 楼主| 发表于 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) 的网页,还是没找到完整的解决办法。哎。。

出0入0汤圆

 楼主| 发表于 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没关系。

出0入0汤圆

发表于 2014-4-23 08:12:10 | 显示全部楼层
纯粹建议:
可以先试试通过nfs挂载系统,进入系统后在系统下烧录根文件系统,之后再启动试试看!

出0入0汤圆

发表于 2014-4-26 00:10:26 | 显示全部楼层
可以换镁光同类1g的,应该能兼容

出0入0汤圆

发表于 2014-4-26 09:13:50 | 显示全部楼层
楼主的事情解决了吗?我现在也出了ubi_read_io   err  74 ,但我是在uboot下分区的时候出现这个问题的,暂时还没找出问题的解决办法!

出0入0汤圆

发表于 2014-4-26 09:46:48 | 显示全部楼层
这个问题,谁解决了,公布一下,

出0入0汤圆

 楼主| 发表于 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 UBI  headers, 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 128KiB  ubinize.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.c  73行#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错误,打印信息见后。因为手里事情比较多,这个研究可能要拖一下了,欢迎有同样问题的朋友继续讨论。
  1. Starting kernel ...

  2. Uncompressing Linux... done, booting the kernel.
  3. Linux version 2.6.38.2 (zcj@project-manager) (gcc version 4.2.2) #1 Thu Apr 24 11:18:23 CST 2014
  4. CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
  5. CPU: VIVT data cache, VIVT instruction cache
  6. Machine: Atmel AT91SAM9260-EK
  7. Memory policy: ECC disabled, Data cache writeback
  8. Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
  9. Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
  10. 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
  11. PID hash table entries: 128 (order: -3, 512 bytes)
  12. Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
  13. Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
  14. Memory: 32MB = 32MB total
  15. Memory: 28824k/28824k available, 3944k reserved, 0K highmem
  16. Virtual kernel memory layout:
  17.     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
  18.     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
  19.     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
  20.     vmalloc : 0xc2800000 - 0xfee00000   ( 966 MB)
  21.     lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
  22.     modules : 0xbf000000 - 0xc0000000   (  16 MB)
  23.       .init : 0xc0008000 - 0xc0027000   ( 124 kB)
  24.       .text : 0xc0027000 - 0xc0349a74   (3211 kB)
  25.       .data : 0xc034a000 - 0xc0369140   ( 125 kB)
  26. NR_IRQS:192
  27. AT91: 96 gpio irqs in 3 banks
  28. Console: colour dummy device 80x30
  29. console [ttyS0] enabled
  30. Calibrating delay loop... 99.12 BogoMIPS (lpj=495616)
  31. pid_max: default: 32768 minimum: 301
  32. Mount-cache hash table entries: 512
  33. CPU: Testing write buffer coherency: ok
  34. NET: Registered protocol family 16
  35. AT91: Power Management
  36. AT91: Starting after general reset
  37. bio: create slab <bio-0> at 0
  38. Switching to clocksource pit
  39. NET: Registered protocol family 2
  40. IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
  41. TCP established hash table entries: 1024 (order: 1, 8192 bytes)
  42. TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
  43. TCP: Hash tables configured (established 1024 bind 1024)
  44. TCP reno registered
  45. UDP hash table entries: 256 (order: 0, 4096 bytes)
  46. UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
  47. NET: Registered protocol family 1
  48. RPC: Registered udp transport module.
  49. RPC: Registered tcp transport module.
  50. RPC: Registered tcp NFSv4.1 backchannel transport module.
  51. NetWinder Floating Point Emulator V0.97 (double precision)
  52. squashfs: version 4.0 (2009/01/31) Phillip Lougher
  53. Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
  54. ROMFS MTD (C) 2007 Red Hat, Inc.
  55. fuse init (API version 7.16)
  56. msgmni has been set to 56
  57. Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
  58. io scheduler noop registered
  59. io scheduler deadline registered
  60. io scheduler cfq registered (default)
  61. atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
  62. atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
  63. atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
  64. atmel_usart.3: ttyS3 at MMIO 0xfffb8000 (irq = 8) is a ATMEL_SERIAL
  65. brd: module loaded
  66. NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
  67. Scanning device for bad blocks
  68. 7 cmdlinepart partitions found on MTD device atmel_nand
  69. Creating 7 MTD partitions on "atmel_nand":
  70. 0x000000000000-0x000000020000 : "BootAgent"
  71. 0x000000020000-0x000000100000 : "Uboot"
  72. 0x000000100000-0x000000500000 : "Kernel1"
  73. 0x000000500000-0x000000900000 : "Kernel2"
  74. 0x000000900000-0x000004000000 : "Root1"
  75. 0x000004000000-0x000007700000 : "Root2"
  76. 0x000007700000-0x000008000000 : "data"
  77. UBI: attaching mtd4 to ubi0
  78. UBI: physical eraseblock size:   131072 bytes (128 KiB)
  79. UBI: logical eraseblock size:    126976 bytes
  80. UBI: smallest flash I/O unit:    2048
  81. UBI: VID header offset:          2048 (aligned 2048)
  82. UBI: data offset:                4096
  83. UBI: max. sequence number:       4
  84. UBI: attached mtd4 to ubi0
  85. UBI: MTD device name:            "Root1"
  86. UBI: MTD device size:            55 MiB
  87. UBI: number of good PEBs:        440
  88. UBI: number of bad PEBs:         0
  89. UBI: number of corrupted PEBs:   0
  90. UBI: max. allowed volumes:       128
  91. UBI: wear-leveling threshold:    4096
  92. UBI: number of internal volumes: 1
  93. UBI: number of user volumes:     1
  94. UBI: available PEBs:             0
  95. UBI: total number of reserved PEBs: 440
  96. UBI: number of PEBs reserved for bad PEB handling: 4
  97. UBI: max/mean erase counter: 1/0
  98. UBI: image sequence number:  2070082422
  99. mii init .
  100. UBI: background thread "ubi_bgt0d" started, PID 32
  101. MACB_mii_bus: probed
  102. eth0: Atmel MACB at 0xfffc4000 irq 21 (00:23:b8:33:45:66)
  103. eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:00, irq=-1)
  104. mousedev: PS/2 mouse device common for all mice
  105. i2c /dev entries driver
  106. rtc-ds1307 0-0068: rtc core: registered ds1307 as rtc0
  107. rtc-ds1307 0-0068: 56 bytes nvram
  108. at91_i2c at91_i2c: AT91 i2c bus driver.
  109. TCP cubic registered
  110. NET: Registered protocol family 17
  111. VFP support v0.3: not present
  112. rtc-ds1307 0-0068: setting system clock to 2000-01-01 21:55:37 UTC (946763737)
  113. uncorrectable error :
  114. uncorrectable error :
  115. uncorrectable error :
  116. uncorrectable error :
  117. uncorrectable error :
  118. uncorrectable error :
  119. uncorrectable error :
  120. uncorrectable error :
  121. UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096, read 126976 bytes
  122. uncorrectable error :
  123. uncorrectable error :
  124. uncorrectable error :
  125. uncorrectable error :
  126. uncorrectable error :
  127. uncorrectable error :
  128. uncorrectable error :
  129. uncorrectable error :
  130. UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 3:4096, read 126976 bytes
  131. UBIFS error (pid 1): ubifs_recover_master_node: failed to recover master node
  132. List of all partitions:
  133. 1f00             128 mtdblock0  (driver?)
  134. 1f01             896 mtdblock1  (driver?)
  135. 1f02            4096 mtdblock2  (driver?)
  136. 1f03            4096 mtdblock3  (driver?)
  137. 1f04           56320 mtdblock4  (driver?)
  138. 1f05           56320 mtdblock5  (driver?)
  139. 1f06            9216 mtdblock6  (driver?)
  140. No filesystem could mount root, tried:  ubifs
  141. Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
  142. [<c0037d7c>] (unwind_backtrace+0x0/0xf0) from [<c0044230>] (panic+0x54/0x194)
  143. [<c0044230>] (panic+0x54/0x194) from [<c0009090>] (mount_block_root+0x1c4/0x20c)
  144. [<c0009090>] (mount_block_root+0x1c4/0x20c) from [<c0009228>] (prepare_namespace+0x8c/0x1c8)
  145. [<c0009228>] (prepare_namespace+0x8c/0x1c8) from [<c00088b8>] (kernel_init+0x104/0x148)
  146. [<c00088b8>] (kernel_init+0x104/0x148) from [<c0033378>] (kernel_thread_exit+0x0/0x8)
复制代码

出0入0汤圆

 楼主| 发表于 2014-4-28 09:19:10 | 显示全部楼层
sinc_mark 发表于 2014-4-26 09:13
楼主的事情解决了吗?我现在也出了ubi_read_io   err  74 ,但我是在uboot下分区的时候出现这个问题的,暂时 ...

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

出0入0汤圆

发表于 2014-5-7 09:08:29 | 显示全部楼层
正想跟你说,SPansion的能直接替换呢,看你下面的帖子说已经用Spansion的替换了,我这有ML01G的NAND Flash啊,你的flash是跟代理要的,还是买的?

出0入0汤圆

 楼主| 发表于 2014-5-19 13:23:45 | 显示全部楼层
xutiemu 发表于 2014-5-7 09:08
正想跟你说,SPansion的能直接替换呢,看你下面的帖子说已经用Spansion的替换了,我这有ML01G的NAND Flash ...

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

出0入0汤圆

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

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

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

出0入0汤圆

 楼主| 发表于 2014-9-9 11:42:03 | 显示全部楼层
gyd0317 发表于 2014-9-8 14:20
问题应该就是你说的subpage的问题,需要修改内核驱动,看到网上有人关掉ecc也能正常

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

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

出0入0汤圆

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

我们问了开发板的技术支持
他们让我们第一次进入文件系统后执行sync命令,
暂时重启了几次没有出现情况,但我的同事以前测试的时候运行的时间长了,还会出现,可能读写的时候又写坏了
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-10-3 01:33

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表