Open den4gh opened 6 years ago
I was changed the Nand to Micron MT29F32G08CBACAWP and maked corect dt files and its work.
[ 1.242975] nand: Micron MT29F32G08CBACAWP [ 1.247071] nand: 4096 MiB, MLC, erase size: 1024 KiB, page size: 4096, OOB size: 224 [ 1.256275] Bad block table found at page 1048320, version 0x00 [ 1.263211] Bad block table not found for chip 0 [ 1.268087] nand_bbt: ECC error in BBT at 0x0000fff00005 [ 1.273415] Scanning device for bad blocks [ 1.278004] Bad eraseblock 0 at 0x000000000000 [ 1.321202] Bad eraseblock 90 at 0x000005a00000 [ 1.326150] Bad eraseblock 91 at 0x000005b00000 [ 1.621227] Bad eraseblock 675 at 0x00002a300000 [ 1.683093] Bad eraseblock 790 at 0x000031600000 [ 1.696180] Bad eraseblock 807 at 0x000032700000 [ 1.826571] Bad eraseblock 1060 at 0x000042400000 [ 2.013759] Bad eraseblock 1427 at 0x000059300000 [ 2.072163] Bad eraseblock 1535 at 0x00005ff00000 [ 2.107273] Bad eraseblock 1596 at 0x000063c00000 [ 2.130886] Bad eraseblock 1634 at 0x000066200000 [ 2.267804] Bad eraseblock 1900 at 0x000076c00000 [ 2.286960] Bad eraseblock 1929 at 0x000078900000 [ 2.334454] Bad eraseblock 2015 at 0x00007df00000 [ 3.057294] Bad block table written to 0x0000fff00000, version 0x01 [ 3.067386] Bad block table written to 0x0000ffe00000, version 0x01 [ 3.079989] 5 ofpart partitions found on MTD device 1c03000.nand [ 3.086005] Creating 5 MTD partitions on "1c03000.nand": [ 3.091367] 0x000000000000-0x000000200000 : "boot0" [ 3.096814] 0x000000200000-0x000000800000 : "test" [ 3.102050] 0x000000800000-0x000000a00000 : "uboot" [ 3.107268] 0x000000a00000-0x000002a00000 : "boot" [ 3.112533] 0x000002a00000-0x000080000000 : "rootfs" [ 3.121934] libphy: Fixed MDIO Bus: probed
hmm.. I will try to find other 29F32G08CBADA maybe its faulty...
Hello! I need help. Sorry fo my English. I have a board like a cubietrack. I try to use Micron 29F32G08CBADA I compiled mainline U-Boot 2017.09 and Linux kernel version 4.13.0 Nand is work in u-boot. But is not work in a linux kernel! I followed the directions by NAND_Howto I read many other information. when i try to any write operations in linux I get the input/output error: [root@alarm ~]# flash_erase /dev/mtd3 0 0 Erasing 2048 Kibyte @ 0 -- 167944 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 0 (mtd3) error 5 (Input/output error) flash_erase: error!: /dev/mtd3: MTD Erase failure error 5 (Input/output error) Erasing 2048 Kibyte @ b6faecb000000006 -- 167944 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 1 (m) error 5 (Input/output error) flash_erase: error!: /dev/mtd3: MTD Erase failure error 5 (Input/output error) Erasing 2048 Kibyte @ b6faecb00000000c -- 167944 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 2 (m) error 5 (Input/output error) flash_erase: error!: /dev/mtd3: MTD Erase failure error 5 (Input/output error) ...
some log`s:
U-Boot 2017.09-rc3-00062-g6ef2f90-dirty (Sep 06 2017 - 02:31:55 +0700) Allwinner Technology
CPU: Allwinner A20 (SUN7I) Model: Cubietech Cubietruck I2C: ready DRAM: 512 MiB NAND: 4096 MiB
=> nand info Device 0: nand0, sector size 2048 KiB Page size 8192 b OOB size 744 b Erase size 2097152 b subpagesize 8192 b options 0x40001000 bbt options 0x00060000 => nand bad
Device 0 bad blocks: 0e400000 70000000 79000000 bd000000 fe400000 ff800000 ffa00000 ffc00000 ffe00000
=> mtdparts
device nand0, # parts = 5
: name size offset mask_flags
0: boot0 0x00200000 0x00000000 0 1: test 0x00600000 0x00200000 0 2: uboot 0x00200000 0x00800000 0 3: boot 0x02000000 0x00a00000 0 4: rootfs 0xfd600000 0x02a00000 0 active partition: nand0,0 - (boot0) 0x00200000 @ 0x00000000 defaults: mtdids : nand0=sunxi-nand mtdparts: mtdparts=sunxi-nand:2m(boot0),6m(test),2m(uboot),32m(boot),-(rootfs)
=> ubi part nand0,4 ubi0: attaching mtd1 ubi0: scanning is finished ubi0: attached mtd1 (name "mtd=4", size 4054 MiB) ubi0: PEB size: 2097152 bytes (2048 KiB), LEB size: 2080768 bytes ubi0: min./max. I/O unit sizes: 8192/8192, sub-page size 8192 ubi0: VID header offset: 8192 (aligned 8192), data offset: 16384 ubi0: good PEBs: 2018, bad PEBs: 9, corrupted PEBs: 0 128
ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0 ubi0: available PEBs: 1966, total reserved PEBs: 52, PEBs reserved for bad PEB handling: 31
=> ubi create myvol1 0x2000000 s 0
Creating static volume myvol1 of size 33554432
=> ubi info UBI: MTD device name: "mtd=4"
UBI: MTD device size: 4054 MiB
UBI: physical eraseblock size: 2097152 bytes (2048 KiB)
UBI: logical eraseblock size: 2080768 bytes
UBI: number of good PEBs: 2018
UBI: number of bad PEBs: 9
UBI: smallest flash I/O unit: 8192
UBI: VID header offset: 8192 (aligned 8192)
UBI: data offset: 16384
UBI: max. allowed volumes: 128
UBI: wear-leveling threshold: 4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 2
UBI: available PEBs: 1949
UBI: total number of reserved PEBs: 69
UBI: number of PEBs reserved for bad PEB handling: 31
UBI: max/mean erase counter: 2/1
=> ubi create myvol2 0x2000000 d 0
Creating dynamic volume myvol2 of size 33554432
exit not allowed from main input shell.
=> ubi remove myvol2
Volume myvol2 not found!
=> ubi create myvol2 0x2000000 d 1
Creating dynamic volume myvol2 of size 33554432
=> ubi info l Volume information dump:
vol_id 0
reserved_pebs 17
alignment 1
data_pad 0
vol_type 4
name_len 6
usable_leb_size 2080768
used_ebs 0
used_bytes 0
last_eb_bytes 2080768
corrupted 0
upd_marker 0
name myvol1
Volume information dump:
vol_id 1
reserved_pebs 17
alignment 1
data_pad 0
vol_type 3
name_len 6
usable_leb_size 2080768
used_ebs 17
used_bytes 35373056
last_eb_bytes 2080768
corrupted 0
upd_marker 0
name myvol2
Volume information dump:
vol_id 2147479551
reserved_pebs 2
alignment 1
data_pad 0
vol_type 3
name_len 13
usable_leb_size 2080768
used_ebs 2
used_bytes 4161536
last_eb_bytes 2
corrupted 0
upd_marker 0
name layout volume
in U-BOOT all works good!
My devicetree additions is the same in u-boot and linux kernel: I add to sun7i-a20.dtsi //soc@01c00000 { // ... nfc: nand@01c03000 { compatible = "allwinner,sun4i-a10-nand"; reg = <0x01c03000 0x1000>; interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ahb_gates 13>, <&nand_clk>; clock-names = "ahb", "mod"; dmas = <&dma SUN4I_DMA_DEDICATED 3>; dma-names = "rxtx"; status = "disabled";
address-cells = <1>;
I add to sun7i-a20-cubietruck.dts
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.13.0-rc3-g26c5ceb-dirty (gcc version 6.3.1 20170109 (Linaro GCC 6.3-2017 [ 0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d [ 0.000000] CPU: div instructions available: patching division code
[ 1.234372] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x44 [ 1.240801] nand: Micron MT29F32G08CBADA3W [ 1.244897] nand: 4096 MiB, MLC, erase size: 2048 KiB, page size: 8192, OOB size: 744 [ 1.264020] Bad block table not found for chip 0 [ 1.278608] Bad block table not found for chip 0 [ 1.283237] Scanning device for bad blocks [ 1.307904] Bad eraseblock 21 at 0x000002a00000 [ 1.313368] Bad eraseblock 22 at 0x000002c00000 ... [ 12.581254] Bad eraseblock 2044 at 0x0000ff800000 [ 12.587820] Bad eraseblock 2046 at 0x0000ffc00000 [ 12.593470] Bad eraseblock 2047 at 0x0000ffe00000 [ 12.598269] nand_bbt: error while erasing BBT block -5 [ 12.604362] nand_bbt: error -30 while marking block 2045 bad [ 12.610031] No space left to write bad block table [ 12.614816] nand_bbt: error while writing bad block table -28 [ 12.620591] sunxi_nand 1c03000.nand: nand_scan_tail failed: -28 [ 12.626504] sunxi_nand 1c03000.nand: failed to init nand chips [ 12.632486] sunxi_nand: probe of 1c03000.nand failed with error -28 [ 12.639744] libphy: Fixed MDIO Bus: probed
[root@alarm ~]# ls /dev/mtd
ls: cannot access '/dev/mtd': No such file or directory
then I coment in sun7i-a20-cubietruck.dts //nand-on-flash-bbt; and coment in /drivers/mtd/nand/nand_base.c in nand_erase_nand(..) function
Starting kernel ... [ 12.491595] Bad eraseblock 2047 at 0x0000ffe00000
[ 12.502590] 5 ofpart partitions found on MTD device 1c03000.nand
[ 12.508661] Creating 5 MTD partitions on "1c03000.nand":
[ 12.513984] 0x000000000000-0x000000200000 : "boot0"
[ 12.519434] 0x000000200000-0x000000800000 : "test"
[ 12.524601] 0x000000800000-0x000000a00000 : "uboot"
[ 12.529924] 0x000000a00000-0x000002a00000 : "boot"
[ 12.535097] 0x000002a00000-0x0000f0000000 : "rootfs"
[ 12.544322] libphy: Fixed MDIO Bus: probed
[root@alarm ~]# mtdinfo -a
mtd0
Name: boot0
Type: mlc-nand
Eraseblock size: 2097152 bytes, 2.0 MiB
Amount of eraseblocks: 1 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 8192 bytes
Sub-page size: 8192 bytes
OOB size: 744 bytes
Character device major/minor: 90:0
Bad blocks are allowed: true
Device is writable: true
mtd1
Name: test
Type: mlc-nand
Eraseblock size: 2097152 bytes, 2.0 MiB
Amount of eraseblocks: 3 (6291456 bytes, 6.0 MiB)
Minimum input/output unit size: 8192 bytes
Sub-page size: 8192 bytes
OOB size: 744 bytes
Character device major/minor: 90:2
Bad blocks are allowed: true
Device is writable: true
mtd2
Name: uboot
Type: mlc-nand
Eraseblock size: 2097152 bytes, 2.0 MiB
Amount of eraseblocks: 1 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 8192 bytes
Sub-page size: 8192 bytes
OOB size: 744 bytes
Character device major/minor: 90:4
Bad blocks are allowed: true
Device is writable: true
mtd3
Name: boot
Type: mlc-nand
Eraseblock size: 2097152 bytes, 2.0 MiB
Amount of eraseblocks: 16 (33554432 bytes, 32.0 MiB)
Minimum input/output unit size: 8192 bytes
Sub-page size: 8192 bytes
OOB size: 744 bytes
Character device major/minor: 90:6
Bad blocks are allowed: true
Device is writable: true
mtd4
Name: rootfs
Type: mlc-nand
Eraseblock size: 2097152 bytes, 2.0 MiB
Amount of eraseblocks: 1899 (3982491648 bytes, 3.7 GiB)
Minimum input/output unit size: 8192 bytes
Sub-page size: 8192 bytes
OOB size: 744 bytes
Character device major/minor: 90:8
Bad blocks are allowed: true
Device is writable: true
[root@alarm ~]# mtdinfo -a -u
Count of MTD devices: 5
Present MTD devices: mtd0, mtd1, mtd2, mtd3, mtd4
Sysfs interface supported: yes
mtd0
Name: boot0
Type: mlc-nand
Eraseblock size: 2097152 bytes, 2.0 MiB
Amount of eraseblocks: 1 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 8192 bytes
Sub-page size: 8192 bytes
OOB size: 744 bytes
Character device major/minor: 90:0
Bad blocks are allowed: true
Device is writable: true
Default UBI VID header offset: 8192
Default UBI data offset: 16384
Default UBI LEB size: 2080768 bytes, 2.0 MiB
Maximum UBI volumes count: 128
mtd1
Name: test
Type: mlc-nand
Eraseblock size: 2097152 bytes, 2.0 MiB
Amount of eraseblocks: 3 (6291456 bytes, 6.0 MiB)
Minimum input/output unit size: 8192 bytes
Sub-page size: 8192 bytes
OOB size: 744 bytes
Character device major/minor: 90:2
Bad blocks are allowed: true
Device is writable: true
Default UBI VID header offset: 8192
Default UBI data offset: 16384
Default UBI LEB size: 2080768 bytes, 2.0 MiB
Maximum UBI volumes count: 128
mtd2
Name: uboot
Type: mlc-nand
Eraseblock size: 2097152 bytes, 2.0 MiB
Amount of eraseblocks: 1 (2097152 bytes, 2.0 MiB)
Minimum input/output unit size: 8192 bytes
Sub-page size: 8192 bytes
OOB size: 744 bytes
Character device major/minor: 90:4
Bad blocks are allowed: true
Device is writable: true
Default UBI VID header offset: 8192
Default UBI data offset: 16384
Default UBI LEB size: 2080768 bytes, 2.0 MiB
Maximum UBI volumes count: 128
mtd3
Name: boot
Type: mlc-nand
Eraseblock size: 2097152 bytes, 2.0 MiB
Amount of eraseblocks: 16 (33554432 bytes, 32.0 MiB)
Minimum input/output unit size: 8192 bytes
Sub-page size: 8192 bytes
OOB size: 744 bytes
Character device major/minor: 90:6
Bad blocks are allowed: true
Device is writable: true
Default UBI VID header offset: 8192
Default UBI data offset: 16384
Default UBI LEB size: 2080768 bytes, 2.0 MiB
Maximum UBI volumes count: 128
mtd4
Name: rootfs
Type: mlc-nand
Eraseblock size: 2097152 bytes, 2.0 MiB
Amount of eraseblocks: 1899 (3982491648 bytes, 3.7 GiB)
Minimum input/output unit size: 8192 bytes
Sub-page size: 8192 bytes
OOB size: 744 bytes
Character device major/minor: 90:8
Bad blocks are allowed: true
Device is writable: true
Default UBI VID header offset: 8192
Default UBI data offset: 16384
Default UBI LEB size: 2080768 bytes, 2.0 MiB
Maximum UBI volumes count: 128
[root@alarm ~]# flash_erase /dev/mtd3 0 0 Erasing 2048 Kibyte @ 0 -- 167944 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 0 (mtd3) error 5 (Input/output error) flash_erase: error!: /dev/mtd3: MTD Erase failure error 5 (Input/output error) Erasing 2048 Kibyte @ b6faecb000000006 -- 167944 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 1 (m) error 5 (Input/output error) flash_erase: error!: /dev/mtd3: MTD Erase failure error 5 (Input/output error) Erasing 2048 Kibyte @ b6faecb00000000c -- 167944 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 2 (m) error 5 (Input/output error) flash_erase: error!: /dev/mtd3: MTD Erase failure error 5 (Input/output error) ... ubiformat and dd leads to the same error.
Please tell me what am I doing wrong? Maybe the NAND is faulty?
Sincerely, Denis Romanenko