sorry for the silence, I forgot to subscribe to the topic.
thanks for the link, I will try to search for the algorithm there.
but I wrote everything right, in my case, it is the internal ECC in the NAND Micron.
it does not depend on the OS in any way (
I use JTAG and, and simple loader (code from MPC8321 manual) to work with NAND.
I erase flash, read all 0xFF, write 0x800, and read 0x800 data + 0x40 ECC back.
so I wrote above, the bits indicate hardware ECC in NAND, and CPU like MPC8321 - haven't ECC.
on the Internet - there was an ECC Micron algorithm, but it gives me different values ((
Micron is a well-known manufacturer, Linux/Uboot mentions "on die ECC",
so I was hoping that someone might have already solved this ECC or would point out my mistake.
p,s, yea, 2048+64 = 512+512+512+512+4+4+4+4+4+4+4+4+8+8+8+8,
so I post only one 528 block, where 516 bytes - data, 4 bytes - "not used", 8 bytes - ECC.
..oh, need fix my first post. 512->512+4(for data).