主题 : 分析一下tiny210v2的16bitECC校验(已经实现u-boot for tiny210v2) 复制链接 | 浏览器收藏 | 打印
:)
级别: 骑士
UID: 61588
精华: 5
发帖: 248
金钱: 1500 两
威望: 300 点
贡献值: 5 点
综合积分: 596 分
注册时间: 2012-01-02
最后登录: 2018-03-05
40楼  发表于: 2013-08-04 21:50

 回 35楼(mhjong) 的帖子

480多参与校正 ,我也这样测试过。
:)
级别: 骑士
UID: 61588
精华: 5
发帖: 248
金钱: 1500 两
威望: 300 点
贡献值: 5 点
综合积分: 596 分
注册时间: 2012-01-02
最后登录: 2018-03-05
41楼  发表于: 2013-08-04 21:51

 回 38楼(fshh520) 的帖子

感谢分享!我测试一下。
:)
级别: 骑士
UID: 61588
精华: 5
发帖: 248
金钱: 1500 两
威望: 300 点
贡献值: 5 点
综合积分: 596 分
注册时间: 2012-01-02
最后登录: 2018-03-05
42楼  发表于: 2013-08-04 22:29

 回 35楼(mhjong) 的帖子

这么有兴趣对16BIT ECC 何不来点实际的。请关注一下https://github.com/kangear/tiny210v2-uboot/tree/16bit-ecc
这个是Fix u-boot对16BIT ECC校验的分支。
主要是drivers/mtd/nand/s5pc1xx_nand.c 的移植。一起来讨论吧。:)
可以git clone https://github.com/kangear/tiny210v2-uboot -b 16bit-ecc 得到这个分支的源代码。
级别: 新手上路
UID: 93699
精华: 0
发帖: 30
金钱: 150 两
威望: 30 点
贡献值: 0 点
综合积分: 60 分
注册时间: 2013-06-29
最后登录: 2013-10-23
43楼  发表于: 2013-08-06 09:13
学习拉,谢谢
级别: 新手上路
UID: 78842
精华: 0
发帖: 24
金钱: 120 两
威望: 24 点
贡献值: 0 点
综合积分: 48 分
注册时间: 2012-09-26
最后登录: 2018-05-06
44楼  发表于: 2013-08-07 20:54
学习学习
级别: 新手上路
UID: 93759
精华: 0
发帖: 20
金钱: 100 两
威望: 20 点
贡献值: 0 点
综合积分: 40 分
注册时间: 2013-06-30
最后登录: 2014-03-26
45楼  发表于: 2013-08-08 17:47
我写了个驱动把ECC功能导出到用户态来,做各种测试就方便多了。

512个AA,16位ECC
复制代码
  1. [root@alarm ~]# python2 -c 'print "\xAA"*512' |./ecc -l 512 -s 16|hexdump -C
  2. 00000000  dc e7 f0 25 d2 d5 03 f8  57 43 61 20 6d b6 e5 79  |...%....WCa m..y|
  3. 00000010  ab 0b 9d f5 09 3e a0 b5  7a b0                    |.....>..z.|
  4. 0000001a


512个FF,16位ECC
复制代码
  1. [root@alarm ~]# python2 -c 'print "\xFF"*512' |./ecc -l 512 -s 16|hexdump -C  
  2. 00000000  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
  3. 00000010  ff ff ff ff ff ff ff ff  ff ff                    |..........|
  4. 0000001a


32个FF,16位ECC
复制代码
  1. [root@alarm ~]# python2 -c 'print "\xFF"*32' |./ecc -l 32 -s 16|hexdump -C      
  2. 00000000  e2 3e fe b5 6f f2 cd 78  a9 6e cd 57 09 f4 0e d8  |.>..o..x.n.W....|
  3. 00000010  9e 2e 8f 77 90 a9 85 e9  0a 74                    |...w.....t|
  4. 0000001a
:)
级别: 骑士
UID: 61588
精华: 5
发帖: 248
金钱: 1500 两
威望: 300 点
贡献值: 5 点
综合积分: 596 分
注册时间: 2012-01-02
最后登录: 2018-03-05
46楼  发表于: 2013-08-09 08:43

 回 4楼(mhjong) 的帖子

你厉害!
:)
级别: 骑士
UID: 61588
精华: 5
发帖: 248
金钱: 1500 两
威望: 300 点
贡献值: 5 点
综合积分: 596 分
注册时间: 2012-01-02
最后登录: 2018-03-05
47楼  发表于: 2013-08-09 08:52

 回 45楼(mhjong) 的帖子

在移植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+校验码全部输出,来人工看看结果!
级别: 新手上路
UID: 93759
精华: 0
发帖: 20
金钱: 100 两
威望: 20 点
贡献值: 0 点
综合积分: 40 分
注册时间: 2013-06-30
最后登录: 2014-03-26
48楼  发表于: 2013-08-09 18:11
还是先在linux上调试通过,再移植到u-boot上比较方便
:)
级别: 骑士
UID: 61588
精华: 5
发帖: 248
金钱: 1500 两
威望: 300 点
贡献值: 5 点
综合积分: 596 分
注册时间: 2012-01-02
最后登录: 2018-03-05
49楼  发表于: 2013-08-09 20:18

 回 48楼(mhjong) 的帖子

原来你是这样走的!我喜欢从这头出发,能碰头了,说明两边都通了。