@@ -74,10 +74,6 @@ struct doc_priv {
74
74
int (* late_init )(struct mtd_info * mtd );
75
75
};
76
76
77
- /* This is the syndrome computed by the HW ecc generator upon reading an empty
78
- page, one with all 0xff for data and stored ecc code. */
79
- static u_char empty_read_syndrome [6 ] = { 0x26 , 0xff , 0x6d , 0x47 , 0x73 , 0x7a };
80
-
81
77
/* This is the ecc value computed by the HW ecc generator upon writing an empty
82
78
page, one with all 0xff for data. */
83
79
static u_char empty_write_ecc [6 ] = { 0x4b , 0x00 , 0xe2 , 0x0e , 0x93 , 0xf7 };
@@ -912,7 +908,6 @@ static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat,
912
908
void __iomem * docptr = doc -> virtadr ;
913
909
uint8_t calc_ecc [6 ];
914
910
volatile u_char dummy ;
915
- int emptymatch = 1 ;
916
911
917
912
/* flush the pipeline */
918
913
if (DoC_is_2000 (doc )) {
@@ -936,37 +931,9 @@ static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat,
936
931
calc_ecc [i ] = ReadDOC_ (docptr , DoC_Mplus_ECCSyndrome0 + i );
937
932
else
938
933
calc_ecc [i ] = ReadDOC_ (docptr , DoC_ECCSyndrome0 + i );
939
- if (calc_ecc [i ] != empty_read_syndrome [i ])
940
- emptymatch = 0 ;
941
- }
942
- /* If emptymatch=1, the read syndrome is consistent with an
943
- all-0xff data and stored ecc block. Check the stored ecc. */
944
- if (emptymatch ) {
945
- for (i = 0 ; i < 6 ; i ++ ) {
946
- if (read_ecc [i ] == 0xff )
947
- continue ;
948
- emptymatch = 0 ;
949
- break ;
950
- }
951
934
}
952
- /* If emptymatch still =1, check the data block. */
953
- if (emptymatch ) {
954
- /* Note: this somewhat expensive test should not be triggered
955
- often. It could be optimized away by examining the data in
956
- the readbuf routine, and remembering the result. */
957
- for (i = 0 ; i < 512 ; i ++ ) {
958
- if (dat [i ] == 0xff )
959
- continue ;
960
- emptymatch = 0 ;
961
- break ;
962
- }
963
- }
964
- /* If emptymatch still =1, this is almost certainly a freshly-
965
- erased block, in which case the ECC will not come out right.
966
- We'll suppress the error and tell the caller everything's
967
- OK. Because it is. */
968
- if (!emptymatch )
969
- ret = doc_ecc_decode (rs_decoder , dat , calc_ecc );
935
+
936
+ ret = doc_ecc_decode (rs_decoder , dat , calc_ecc );
970
937
if (ret > 0 )
971
938
printk (KERN_ERR "doc200x_correct_data corrected %d errors\n" , ret );
972
939
}
@@ -1586,6 +1553,7 @@ static int __init doc_probe(unsigned long physadr)
1586
1553
nand -> ecc .size = 512 ;
1587
1554
nand -> ecc .bytes = 6 ;
1588
1555
nand -> ecc .strength = 2 ;
1556
+ nand -> ecc .options = NAND_ECC_GENERIC_ERASED_CHECK ;
1589
1557
nand -> bbt_options = NAND_BBT_USE_FLASH ;
1590
1558
/* Skip the automatic BBT scan so we can run it manually */
1591
1559
nand -> options |= NAND_SKIP_BBTSCAN ;
0 commit comments