MT7621 NAND OOB misdetect

Peter Naulls peter at chocky.org
Tue Feb 21 08:02:07 PST 2023


On 2/15/23 10:17, Chuanhong Guo wrote:
> Hi!
> 

>>
>> What to try next, thanks!
> 
> It looks like the detected spare size and ECC strength matches between the
> two drivers, according to the u-boot message and kernel log.
> Maybe you can try dumping the nand controller setup registers and compare
> the register values between the two drivers?
> I don't have any other easier ideas now :(
> 

Yes, right.  Well, I did do this with all the "obvious" values, and everything
matches up.

After some considerable effort and some intrusive changes, I did get the legacy
driver working on the current kernel. It correctly detects things, but the data
it's reading with nanddump is clearly coming from "somewhere else" (looks
like a procd memory buffer), and not the actual NAND contents.  Could this be 
fixed? Perhaps, although this is all new to me, and it's old and now hacked up 
code, so I'm not sure it's worth it except perhaps as a baseline, and learning 
how things work.

I do see there are perhaps some DTS hints about NAND layout, so that might be
relevant too, to making the current driver work.

Here's the old driver on the current 5.10.x kernel, just in case - a fair
bit of this debug is my own.

[   16.338256] # MTK NAND # : Use HW ECC
[   16.345553] Device not found, ID: c2f1
[   16.353016] Not Support this Device!
[   16.360479] chip_mode=0000000A
[   16.366548] NAND: chipsize: 134217728 page_shift: 11 pagemask: 65535 
phys_erase_shift: 17 chip_shift: 27
[   16.385434] eccbytes: 96 sparesize: 128
[   16.385442] Support this Device in MTK table! c2f1
[   16.402956] NAND: DMA disabled
[   16.402980] [NAND]select ecc bit:12, sparesize :112 spare_per_sector=28
[   16.422280] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1
[   16.434932] nand: Macronix NAND 128MiB 3,3V 8-bit
[   16.444307] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB 
size: 32
[   16.459383] NAND: chipsize: 134217728 page_shift: 11 pagemask: 65535 
phys_erase_shift: 17 chip_shift: 27
[   16.478265] Block protection check failed
[   16.486255] Scanning device for bad blocks
[   16.762369] NAND: Erase disabled





More information about the openwrt-devel mailing list