.. | .. |
---|
52 | 52 | { 0xC2, 0x96, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, |
---|
53 | 53 | /* MX35UF2GE4AD */ |
---|
54 | 54 | { 0xC2, 0xA6, 0x00, 4, 0x40, 1, 2048, 0x0C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, |
---|
| 55 | + /* MX35UF4GE4AD */ |
---|
| 56 | + { 0xC2, 0xB7, 0x00, 8, 0x40, 1, 2048, 0x0C, 20, 0x8, 1, { 0x04, 0x08, 0x14, 0x18 }, &sfc_nand_get_ecc_status0 }, |
---|
55 | 57 | |
---|
56 | 58 | /* GD5F1GQ4UAYIG */ |
---|
57 | 59 | { 0xC8, 0xF1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, |
---|
.. | .. |
---|
129 | 131 | /* F35SQA512M */ |
---|
130 | 132 | { 0xCD, 0x70, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, |
---|
131 | 133 | /* F35UQA512M */ |
---|
132 | | - { 0xCD, 0x70, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, |
---|
| 134 | + { 0xCD, 0x60, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, |
---|
133 | 135 | |
---|
134 | 136 | /* DS35Q1GA-IB */ |
---|
135 | 137 | { 0xE5, 0x71, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, |
---|
.. | .. |
---|
204 | 206 | { 0xEA, 0xC1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, |
---|
205 | 207 | /* TX25G01 */ |
---|
206 | 208 | { 0xA1, 0xF1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status8 }, |
---|
| 209 | + /* S35ML02G3 */ |
---|
| 210 | + { 0x01, 0x25, 0x00, 4, 0x40, 2, 1024, 0x4C, 19, 0x4, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status9 }, |
---|
207 | 211 | /* S35ML04G3 */ |
---|
208 | 212 | { 0x01, 0x35, 0x00, 4, 0x40, 2, 2048, 0x4C, 20, 0x4, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status9 }, |
---|
209 | 213 | }; |
---|
.. | .. |
---|
859 | 863 | if (p_nand_info->id0 == MID_GIGADEV) { |
---|
860 | 864 | sfc_nand_read_cache(addr, (u32 *)sfc_nand_dev.recheck_buffer, 0, data_area_size); |
---|
861 | 865 | if (memcmp(sfc_nand_dev.recheck_buffer, p_page_buf, data_area_size)) { |
---|
862 | | - rkflash_print_error("%s %x cache bitflip\n", __func__, addr); |
---|
| 866 | + rkflash_print_error("%s cache bitflip1\n", __func__); |
---|
863 | 867 | msleep(1000); |
---|
864 | 868 | sfc_request(&op, plane, p_page_buf, page_size); |
---|
865 | 869 | } |
---|
.. | .. |
---|
962 | 966 | u32 sec_per_page = p_nand_info->sec_per_page; |
---|
963 | 967 | u32 data_size = sec_per_page * SFC_NAND_SECTOR_SIZE; |
---|
964 | 968 | struct nand_mega_area *meta = &p_nand_info->meta; |
---|
| 969 | + int retries = 0; |
---|
965 | 970 | |
---|
| 971 | +retry: |
---|
966 | 972 | ret = sfc_nand_read_page_raw(cs, addr, gp_page_buf); |
---|
967 | 973 | memcpy(p_data, gp_page_buf, data_size); |
---|
968 | 974 | p_spare[0] = gp_page_buf[(data_size + meta->off0) / 4]; |
---|
.. | .. |
---|
984 | 990 | |
---|
985 | 991 | if (p_spare) |
---|
986 | 992 | rkflash_print_hex("spare:", p_spare, 4, 2); |
---|
| 993 | + if (ret == SFC_NAND_ECC_ERROR && retries < 1) { |
---|
| 994 | + retries++; |
---|
| 995 | + goto retry; |
---|
| 996 | + } |
---|
987 | 997 | } |
---|
988 | 998 | |
---|
989 | 999 | return ret; |
---|