.. | .. |
---|
80 | 80 | .free = fm25s01_ooblayout_free, |
---|
81 | 81 | }; |
---|
82 | 82 | |
---|
| 83 | +/* |
---|
| 84 | + * ecc bits: 0xC0[4,6] |
---|
| 85 | + * [0b000], No bit errors were detected; |
---|
| 86 | + * [0b001] and [0b011], 1~6 Bit errors were detected and corrected. Not |
---|
| 87 | + * reach Flipping Bits; |
---|
| 88 | + * [0b101], Bit error count equals the bit flip |
---|
| 89 | + * detection threshold |
---|
| 90 | + * [0b010], Multiple bit errors were detected and |
---|
| 91 | + * not corrected. |
---|
| 92 | + * others, Reserved. |
---|
| 93 | + */ |
---|
| 94 | +static int fm25s01bi3_ecc_ecc_get_status(struct spinand_device *spinand, |
---|
| 95 | + u8 status) |
---|
| 96 | +{ |
---|
| 97 | + struct nand_device *nand = spinand_to_nand(spinand); |
---|
| 98 | + u8 eccsr = (status & GENMASK(6, 4)) >> 4; |
---|
| 99 | + |
---|
| 100 | + if (eccsr <= 1 || eccsr == 3) |
---|
| 101 | + return eccsr; |
---|
| 102 | + else if (eccsr == 5) |
---|
| 103 | + return nanddev_get_ecc_requirements(nand)->strength; |
---|
| 104 | + else |
---|
| 105 | + return -EBADMSG; |
---|
| 106 | +} |
---|
| 107 | + |
---|
83 | 108 | static const struct spinand_info fmsh_spinand_table[] = { |
---|
84 | 109 | SPINAND_INFO("FM25S01A", |
---|
85 | 110 | SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xE4), |
---|
.. | .. |
---|
97 | 122 | SPINAND_INFO_OP_VARIANTS(&read_cache_variants, |
---|
98 | 123 | &write_cache_variants, |
---|
99 | 124 | &update_cache_variants), |
---|
100 | | - 1, |
---|
| 125 | + SPINAND_HAS_QE_BIT, |
---|
101 | 126 | SPINAND_ECCINFO(&fm25s01a_ooblayout, NULL)), |
---|
102 | 127 | SPINAND_INFO("FM25S01", |
---|
103 | 128 | SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xA1), |
---|
104 | | - NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), |
---|
| 129 | + NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1), |
---|
105 | 130 | NAND_ECCREQ(1, 512), |
---|
106 | 131 | SPINAND_INFO_OP_VARIANTS(&read_cache_variants, |
---|
107 | 132 | &write_cache_variants, |
---|
.. | .. |
---|
110 | 135 | SPINAND_ECCINFO(&fm25s01_ooblayout, NULL)), |
---|
111 | 136 | SPINAND_INFO("FM25LS01", |
---|
112 | 137 | SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xA5), |
---|
113 | | - NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), |
---|
| 138 | + NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1), |
---|
114 | 139 | NAND_ECCREQ(1, 512), |
---|
115 | 140 | SPINAND_INFO_OP_VARIANTS(&read_cache_variants, |
---|
116 | 141 | &write_cache_variants, |
---|
117 | 142 | &update_cache_variants), |
---|
118 | 143 | 0, |
---|
119 | 144 | SPINAND_ECCINFO(&fm25s01_ooblayout, NULL)), |
---|
| 145 | + SPINAND_INFO("FM25S01BI3", |
---|
| 146 | + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xD4), |
---|
| 147 | + NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1), |
---|
| 148 | + NAND_ECCREQ(8, 512), |
---|
| 149 | + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, |
---|
| 150 | + &write_cache_variants, |
---|
| 151 | + &update_cache_variants), |
---|
| 152 | + SPINAND_HAS_QE_BIT, |
---|
| 153 | + SPINAND_ECCINFO(&fm25s01_ooblayout, fm25s01bi3_ecc_ecc_get_status)), |
---|
120 | 154 | }; |
---|
121 | 155 | |
---|
122 | 156 | static const struct spinand_manufacturer_ops fmsh_spinand_manuf_ops = { |
---|