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