Hi,
sadly my bricked router is not booting from any dump I provide and flash to the NAND and my options are coming to the end, since the soldering points are getting damaged on the board already.
I already gathered some info on how the NAND layout should look like, but something is not ok with the configuration of the pages/oob, or maybe the tools I have for the NAND flasher are incorrect somehow.
I only have a full NAND image without the oob data i.e. "dd" of the full NAND.
If someone knows how exactly the NAND layout is to be constructed for MT7621, or just having a dump at hand with oob data included, please let me know, so I can try and correct my image.
So far, I collected this info about the structure, specifically for the MT7621 (it is even in the driver like this):
/*
* Raw page layout:
* ---------------------------------------------------------------------------------
* DAT0 | FDM0 | ECC0 | DAT1 | FDM1 | ECC1 | DAT2 | FDM2 | ECC2 | DAT3 | FDM3 | ECC3
* 512B | 8B | 8+B | 512B | 8B | 8+B | 512B | 8B | 8+B | 512B | 8B | 8+B
* ---------------------------------------------------------------------------------
*
* Formatted page layout:
* ---------------------------------------------------------------------------------
* DAT0 | DAT1 | DAT2 | DAT3 | FDM0 | FDM1 | FDM2 | FDM3 | ECC0 | ECC1 | ECC2 | ECC3
* 512B | 512B | 512B | 512B | 8B | 8B | 8B | 8B | 8+B | 8+B | 8+B | 8+B
* ---------------------------------------------------------------------------------
*/
The utility I use to extend the raw image with oob data then is set to:
page size: 2048 bytes
spare size: 64 bytes
ECC bits: 4
ECC method: Binary BHC
ECC data size: 7 bytes
Reverse byte order: no (<- ???)
This will be the divided into the following subpages and sub-oob data (as above in the table):
Data1 (512 bytes)
empty (8 bytes)
ECC data1 (7 bytes) + empty (1 bytes)
Data2 (512 bytes)
empty (8 bytes)
ECC data2 (7 bytes) + empty (1 bytes)
Data3 (512 bytes)
empty (8 bytes)
ECC data3 (7 bytes) + empty (1 bytes)
Data4 (512 bytes)
empty (8 bytes)
ECC data4 (7 bytes) + empty (1 bytes)
The empty 8 bytes should be for the bad block indication (FDM) I believe, but since my replacement chips I use have so far no bad blocks at all, this are can be empty (correct me if wrong?)
Since the tool creates 7 bytes ECC, the last byte should be unused (correct me again if wrong).
Also have to tell, that wherever I talk about empty byte(s), they are not touched by the util, thus these bytes will be 0xFF. Can this be a problem too i.e. should I provide somehow 0x00-s instead?
Don't hesitate to correct what I'm thinking, or if having a dump with oob, please share it with me.
Thanx for your help!