在移植u-boot的读16bit的ECC校验的时候,很是费解。写是成功的了,但是似乎校验是有问题的:
校验码是有了:
NAND write: device 0 offset 0x400000, size 0x2000
8192 bytes written: OK
Page 00400000 dump:
OOB:
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff dc e7 f0 25
d2 d5 03 f8 57 43 61 20
6d b6 e5 79 ab 0b 9d f5
09 3e a0 b5 7a b0 ff ff
dc e7 f0 25 d2 d5 03 f8
57 43 61 20 6d b6 e5 79
ab 0b 9d f5 09 3e a0 b5
7a b0 ff ff dc e7 f0 25
d2 d5 03 f8 57 43 61 20
6d b6 e5 79 ab 0b 9d f5
09 3e a0 b5 7a b0 ff ff
dc e7 f0 25 d2 d5 03 f8
57 43 61 20 6d b6 e5 79
ab 0b 9d f5 09 3e a0 b5
7a b0 ff ff dc e7 f0 25
d2 d5 03 f8 57 43 61 20
6d b6 e5 79 ab 0b 9d f5
09 3e a0 b5 7a b0 ff ff
dc e7 f0 25 d2 d5 03 f8
57 43 61 20 6d b6 e5 79
ab 0b 9d f5 09 3e a0 b5
7a b0 ff ff dc e7 f0 25
d2 d5 03 f8 57 43 61 20
6d b6 e5 79 ab 0b 9d f5
09 3e a0 b5 7a b0 ff ff
dc e7 f0 25 d2 d5 03 f8
57 43 61 20 6d b6 e5 79
ab 0b 9d f5 09 3e a0 b5
7a b0 ff ff dc e7 f0 25
d2 d5 03 f8 57 43 61 20
6d b6 e5 79 ab 0b 9d f5
09 3e a0 b5 7a b0 ff ff
dc e7 f0 25 d2 d5 03 f8
57 43 61 20 6d b6 e5 79
ab 0b 9d f5 09 3e a0 b5
7a b0 ff ff dc e7 f0 25
d2 d5 03 f8 57 43 61 20
6d b6 e5 79 ab 0b 9d f5
09 3e a0 b5 7a b0 ff ff
dc e7 f0 25 d2 d5 03 f8
57 43 61 20 6d b6 e5 79
ab 0b 9d f5 09 3e a0 b5
7a b0 ff ff dc e7 f0 25
d2 d5 03 f8 57 43 61 20
6d b6 e5 79 ab 0b 9d f5
09 3e a0 b5 7a b0 ff ff
dc e7 f0 25 d2 d5 03 f8
57 43 61 20 6d b6 e5 79
ab 0b 9d f5 09 3e a0 b5
7a b0 ff ff dc e7 f0 25
d2 d5 03 f8 57 43 61 20
6d b6 e5 79 ab 0b 9d f5
09 3e a0 b5 7a b0 ff ff
dc e7 f0 25 d2 d5 03 f8
57 43 61 20 6d b6 e5 79
ab 0b 9d f5 09 3e a0 b5
7a b0 ff ff 00 ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
[Ver130726-TINY210v2]#
校验的成功不成功很难判断:
[Ver130726-TINY210v2]# nand read 21000000 400000 500000
NAND read: device 0 offset 0x400000, size 0x500000
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
s3c-nand: 1 bit(s) error detected, corrected successfully
5242880 bytes read: OK
[Ver130726-TINY210v2]# bootm
## Booting kernel from Legacy Image at 21000000 ...
Image Name: Linux-3.0.8-FriendlyARM
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4811560 Bytes = 4.6 MiB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... Bad Data CRC
ERROR: can't get kernel image!
[Ver130726-TINY210v2]#
不过打这段字的时候似乎有点门路了,向以前验证BL1代码的读ecc的方法来做,512byte+校验码全部输出,来人工看看结果!