gigadevice.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Author:
  4. * Chuanhong Guo <[email protected]>
  5. */
  6. #include <linux/device.h>
  7. #include <linux/kernel.h>
  8. #include <linux/mtd/spinand.h>
  9. #define SPINAND_MFR_GIGADEVICE 0xC8
  10. #define GD5FXGQ4XA_STATUS_ECC_1_7_BITFLIPS (1 << 4)
  11. #define GD5FXGQ4XA_STATUS_ECC_8_BITFLIPS (3 << 4)
  12. #define GD5FXGQ5XE_STATUS_ECC_1_4_BITFLIPS (1 << 4)
  13. #define GD5FXGQ5XE_STATUS_ECC_4_BITFLIPS (3 << 4)
  14. #define GD5FXGQXXEXXG_REG_STATUS2 0xf0
  15. #define GD5FXGQ4UXFXXG_STATUS_ECC_MASK (7 << 4)
  16. #define GD5FXGQ4UXFXXG_STATUS_ECC_NO_BITFLIPS (0 << 4)
  17. #define GD5FXGQ4UXFXXG_STATUS_ECC_1_3_BITFLIPS (1 << 4)
  18. #define GD5FXGQ4UXFXXG_STATUS_ECC_UNCOR_ERROR (7 << 4)
  19. static SPINAND_OP_VARIANTS(read_cache_variants,
  20. SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
  21. SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
  22. SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
  23. SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
  24. SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
  25. SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
  26. static SPINAND_OP_VARIANTS(read_cache_variants_f,
  27. SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
  28. SPINAND_PAGE_READ_FROM_CACHE_X4_OP_3A(0, 1, NULL, 0),
  29. SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
  30. SPINAND_PAGE_READ_FROM_CACHE_X2_OP_3A(0, 1, NULL, 0),
  31. SPINAND_PAGE_READ_FROM_CACHE_OP_3A(true, 0, 1, NULL, 0),
  32. SPINAND_PAGE_READ_FROM_CACHE_OP_3A(false, 0, 0, NULL, 0));
  33. static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
  34. SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
  35. SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
  36. SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
  37. SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
  38. SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
  39. SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
  40. static SPINAND_OP_VARIANTS(read_cache_variants_2gq5,
  41. SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
  42. SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
  43. SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 2, NULL, 0),
  44. SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
  45. SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
  46. SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
  47. static SPINAND_OP_VARIANTS(write_cache_variants,
  48. SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
  49. SPINAND_PROG_LOAD(true, 0, NULL, 0));
  50. static SPINAND_OP_VARIANTS(update_cache_variants,
  51. SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
  52. SPINAND_PROG_LOAD(false, 0, NULL, 0));
  53. static int gd5fxgq4xa_ooblayout_ecc(struct mtd_info *mtd, int section,
  54. struct mtd_oob_region *region)
  55. {
  56. if (section > 3)
  57. return -ERANGE;
  58. region->offset = (16 * section) + 8;
  59. region->length = 8;
  60. return 0;
  61. }
  62. static int gd5fxgq4xa_ooblayout_free(struct mtd_info *mtd, int section,
  63. struct mtd_oob_region *region)
  64. {
  65. if (section > 3)
  66. return -ERANGE;
  67. if (section) {
  68. region->offset = 16 * section;
  69. region->length = 8;
  70. } else {
  71. /* section 0 has one byte reserved for bad block mark */
  72. region->offset = 1;
  73. region->length = 7;
  74. }
  75. return 0;
  76. }
  77. static const struct mtd_ooblayout_ops gd5fxgq4xa_ooblayout = {
  78. .ecc = gd5fxgq4xa_ooblayout_ecc,
  79. .free = gd5fxgq4xa_ooblayout_free,
  80. };
  81. static int gd5fxgq4xa_ecc_get_status(struct spinand_device *spinand,
  82. u8 status)
  83. {
  84. switch (status & STATUS_ECC_MASK) {
  85. case STATUS_ECC_NO_BITFLIPS:
  86. return 0;
  87. case GD5FXGQ4XA_STATUS_ECC_1_7_BITFLIPS:
  88. /* 1-7 bits are flipped. return the maximum. */
  89. return 7;
  90. case GD5FXGQ4XA_STATUS_ECC_8_BITFLIPS:
  91. return 8;
  92. case STATUS_ECC_UNCOR_ERROR:
  93. return -EBADMSG;
  94. default:
  95. break;
  96. }
  97. return -EINVAL;
  98. }
  99. static int gd5fxgqx_variant2_ooblayout_ecc(struct mtd_info *mtd, int section,
  100. struct mtd_oob_region *region)
  101. {
  102. if (section)
  103. return -ERANGE;
  104. region->offset = 64;
  105. region->length = 64;
  106. return 0;
  107. }
  108. static int gd5fxgqx_variant2_ooblayout_free(struct mtd_info *mtd, int section,
  109. struct mtd_oob_region *region)
  110. {
  111. if (section)
  112. return -ERANGE;
  113. /* Reserve 1 bytes for the BBM. */
  114. region->offset = 1;
  115. region->length = 63;
  116. return 0;
  117. }
  118. /* Valid for Q4/Q5 and Q6 (untested) devices */
  119. static const struct mtd_ooblayout_ops gd5fxgqx_variant2_ooblayout = {
  120. .ecc = gd5fxgqx_variant2_ooblayout_ecc,
  121. .free = gd5fxgqx_variant2_ooblayout_free,
  122. };
  123. static int gd5fxgq4xc_ooblayout_256_ecc(struct mtd_info *mtd, int section,
  124. struct mtd_oob_region *oobregion)
  125. {
  126. if (section)
  127. return -ERANGE;
  128. oobregion->offset = 128;
  129. oobregion->length = 128;
  130. return 0;
  131. }
  132. static int gd5fxgq4xc_ooblayout_256_free(struct mtd_info *mtd, int section,
  133. struct mtd_oob_region *oobregion)
  134. {
  135. if (section)
  136. return -ERANGE;
  137. oobregion->offset = 1;
  138. oobregion->length = 127;
  139. return 0;
  140. }
  141. static const struct mtd_ooblayout_ops gd5fxgq4xc_oob_256_ops = {
  142. .ecc = gd5fxgq4xc_ooblayout_256_ecc,
  143. .free = gd5fxgq4xc_ooblayout_256_free,
  144. };
  145. static int gd5fxgq4uexxg_ecc_get_status(struct spinand_device *spinand,
  146. u8 status)
  147. {
  148. u8 status2;
  149. struct spi_mem_op op = SPINAND_GET_FEATURE_OP(GD5FXGQXXEXXG_REG_STATUS2,
  150. &status2);
  151. int ret;
  152. switch (status & STATUS_ECC_MASK) {
  153. case STATUS_ECC_NO_BITFLIPS:
  154. return 0;
  155. case GD5FXGQ4XA_STATUS_ECC_1_7_BITFLIPS:
  156. /*
  157. * Read status2 register to determine a more fine grained
  158. * bit error status
  159. */
  160. ret = spi_mem_exec_op(spinand->spimem, &op);
  161. if (ret)
  162. return ret;
  163. /*
  164. * 4 ... 7 bits are flipped (1..4 can't be detected, so
  165. * report the maximum of 4 in this case
  166. */
  167. /* bits sorted this way (3...0): ECCS1,ECCS0,ECCSE1,ECCSE0 */
  168. return ((status & STATUS_ECC_MASK) >> 2) |
  169. ((status2 & STATUS_ECC_MASK) >> 4);
  170. case GD5FXGQ4XA_STATUS_ECC_8_BITFLIPS:
  171. return 8;
  172. case STATUS_ECC_UNCOR_ERROR:
  173. return -EBADMSG;
  174. default:
  175. break;
  176. }
  177. return -EINVAL;
  178. }
  179. static int gd5fxgq5xexxg_ecc_get_status(struct spinand_device *spinand,
  180. u8 status)
  181. {
  182. u8 status2;
  183. struct spi_mem_op op = SPINAND_GET_FEATURE_OP(GD5FXGQXXEXXG_REG_STATUS2,
  184. &status2);
  185. int ret;
  186. switch (status & STATUS_ECC_MASK) {
  187. case STATUS_ECC_NO_BITFLIPS:
  188. return 0;
  189. case GD5FXGQ5XE_STATUS_ECC_1_4_BITFLIPS:
  190. /*
  191. * Read status2 register to determine a more fine grained
  192. * bit error status
  193. */
  194. ret = spi_mem_exec_op(spinand->spimem, &op);
  195. if (ret)
  196. return ret;
  197. /*
  198. * 1 ... 4 bits are flipped (and corrected)
  199. */
  200. /* bits sorted this way (1...0): ECCSE1, ECCSE0 */
  201. return ((status2 & STATUS_ECC_MASK) >> 4) + 1;
  202. case STATUS_ECC_UNCOR_ERROR:
  203. return -EBADMSG;
  204. default:
  205. break;
  206. }
  207. return -EINVAL;
  208. }
  209. static int gd5fxgq4ufxxg_ecc_get_status(struct spinand_device *spinand,
  210. u8 status)
  211. {
  212. switch (status & GD5FXGQ4UXFXXG_STATUS_ECC_MASK) {
  213. case GD5FXGQ4UXFXXG_STATUS_ECC_NO_BITFLIPS:
  214. return 0;
  215. case GD5FXGQ4UXFXXG_STATUS_ECC_1_3_BITFLIPS:
  216. return 3;
  217. case GD5FXGQ4UXFXXG_STATUS_ECC_UNCOR_ERROR:
  218. return -EBADMSG;
  219. default: /* (2 << 4) through (6 << 4) are 4-8 corrected errors */
  220. return ((status & GD5FXGQ4UXFXXG_STATUS_ECC_MASK) >> 4) + 2;
  221. }
  222. return -EINVAL;
  223. }
  224. static const struct spinand_info gigadevice_spinand_table[] = {
  225. SPINAND_INFO("GD5F1GQ4xA",
  226. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xf1),
  227. NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
  228. NAND_ECCREQ(8, 512),
  229. SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
  230. &write_cache_variants,
  231. &update_cache_variants),
  232. SPINAND_HAS_QE_BIT,
  233. SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout,
  234. gd5fxgq4xa_ecc_get_status)),
  235. SPINAND_INFO("GD5F2GQ4xA",
  236. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xf2),
  237. NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 1, 1, 1),
  238. NAND_ECCREQ(8, 512),
  239. SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
  240. &write_cache_variants,
  241. &update_cache_variants),
  242. SPINAND_HAS_QE_BIT,
  243. SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout,
  244. gd5fxgq4xa_ecc_get_status)),
  245. SPINAND_INFO("GD5F4GQ4xA",
  246. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xf4),
  247. NAND_MEMORG(1, 2048, 64, 64, 4096, 80, 1, 1, 1),
  248. NAND_ECCREQ(8, 512),
  249. SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
  250. &write_cache_variants,
  251. &update_cache_variants),
  252. SPINAND_HAS_QE_BIT,
  253. SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout,
  254. gd5fxgq4xa_ecc_get_status)),
  255. SPINAND_INFO("GD5F4GQ4RC",
  256. SPINAND_ID(SPINAND_READID_METHOD_OPCODE, 0xa4, 0x68),
  257. NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
  258. NAND_ECCREQ(8, 512),
  259. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_f,
  260. &write_cache_variants,
  261. &update_cache_variants),
  262. SPINAND_HAS_QE_BIT,
  263. SPINAND_ECCINFO(&gd5fxgq4xc_oob_256_ops,
  264. gd5fxgq4ufxxg_ecc_get_status)),
  265. SPINAND_INFO("GD5F4GQ4UC",
  266. SPINAND_ID(SPINAND_READID_METHOD_OPCODE, 0xb4, 0x68),
  267. NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
  268. NAND_ECCREQ(8, 512),
  269. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_f,
  270. &write_cache_variants,
  271. &update_cache_variants),
  272. SPINAND_HAS_QE_BIT,
  273. SPINAND_ECCINFO(&gd5fxgq4xc_oob_256_ops,
  274. gd5fxgq4ufxxg_ecc_get_status)),
  275. SPINAND_INFO("GD5F1GQ4UExxG",
  276. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xd1),
  277. NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
  278. NAND_ECCREQ(8, 512),
  279. SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
  280. &write_cache_variants,
  281. &update_cache_variants),
  282. SPINAND_HAS_QE_BIT,
  283. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  284. gd5fxgq4uexxg_ecc_get_status)),
  285. SPINAND_INFO("GD5F1GQ4RExxG",
  286. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xc1),
  287. NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
  288. NAND_ECCREQ(8, 512),
  289. SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
  290. &write_cache_variants,
  291. &update_cache_variants),
  292. SPINAND_HAS_QE_BIT,
  293. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  294. gd5fxgq4uexxg_ecc_get_status)),
  295. SPINAND_INFO("GD5F2GQ4UExxG",
  296. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xd2),
  297. NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
  298. NAND_ECCREQ(8, 512),
  299. SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
  300. &write_cache_variants,
  301. &update_cache_variants),
  302. SPINAND_HAS_QE_BIT,
  303. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  304. gd5fxgq4uexxg_ecc_get_status)),
  305. SPINAND_INFO("GD5F2GQ4RExxG",
  306. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xc2),
  307. NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
  308. NAND_ECCREQ(8, 512),
  309. SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
  310. &write_cache_variants,
  311. &update_cache_variants),
  312. SPINAND_HAS_QE_BIT,
  313. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  314. gd5fxgq4uexxg_ecc_get_status)),
  315. SPINAND_INFO("GD5F1GQ4UFxxG",
  316. SPINAND_ID(SPINAND_READID_METHOD_OPCODE, 0xb1, 0x48),
  317. NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
  318. NAND_ECCREQ(8, 512),
  319. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_f,
  320. &write_cache_variants,
  321. &update_cache_variants),
  322. SPINAND_HAS_QE_BIT,
  323. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  324. gd5fxgq4ufxxg_ecc_get_status)),
  325. SPINAND_INFO("GD5F1GQ5UExxG",
  326. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x51),
  327. NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
  328. NAND_ECCREQ(4, 512),
  329. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
  330. &write_cache_variants,
  331. &update_cache_variants),
  332. SPINAND_HAS_QE_BIT,
  333. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  334. gd5fxgq5xexxg_ecc_get_status)),
  335. SPINAND_INFO("GD5F1GQ5RExxG",
  336. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x41),
  337. NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
  338. NAND_ECCREQ(4, 512),
  339. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
  340. &write_cache_variants,
  341. &update_cache_variants),
  342. SPINAND_HAS_QE_BIT,
  343. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  344. gd5fxgq5xexxg_ecc_get_status)),
  345. SPINAND_INFO("GD5F2GQ5UExxG",
  346. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x52),
  347. NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
  348. NAND_ECCREQ(4, 512),
  349. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_2gq5,
  350. &write_cache_variants,
  351. &update_cache_variants),
  352. SPINAND_HAS_QE_BIT,
  353. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  354. gd5fxgq5xexxg_ecc_get_status)),
  355. SPINAND_INFO("GD5F2GQ5RExxG",
  356. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x42),
  357. NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
  358. NAND_ECCREQ(4, 512),
  359. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_2gq5,
  360. &write_cache_variants,
  361. &update_cache_variants),
  362. SPINAND_HAS_QE_BIT,
  363. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  364. gd5fxgq5xexxg_ecc_get_status)),
  365. SPINAND_INFO("GD5F4GQ6UExxG",
  366. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x55),
  367. NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 2, 1),
  368. NAND_ECCREQ(4, 512),
  369. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_2gq5,
  370. &write_cache_variants,
  371. &update_cache_variants),
  372. SPINAND_HAS_QE_BIT,
  373. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  374. gd5fxgq5xexxg_ecc_get_status)),
  375. SPINAND_INFO("GD5F4GQ6RExxG",
  376. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x45),
  377. NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 2, 1),
  378. NAND_ECCREQ(4, 512),
  379. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_2gq5,
  380. &write_cache_variants,
  381. &update_cache_variants),
  382. SPINAND_HAS_QE_BIT,
  383. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  384. gd5fxgq5xexxg_ecc_get_status)),
  385. SPINAND_INFO("GD5F1GM7UExxG",
  386. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x91),
  387. NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
  388. NAND_ECCREQ(8, 512),
  389. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
  390. &write_cache_variants,
  391. &update_cache_variants),
  392. SPINAND_HAS_QE_BIT,
  393. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  394. gd5fxgq4uexxg_ecc_get_status)),
  395. SPINAND_INFO("GD5F1GM7RExxG",
  396. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x81),
  397. NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
  398. NAND_ECCREQ(8, 512),
  399. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
  400. &write_cache_variants,
  401. &update_cache_variants),
  402. SPINAND_HAS_QE_BIT,
  403. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  404. gd5fxgq4uexxg_ecc_get_status)),
  405. SPINAND_INFO("GD5F2GM7UExxG",
  406. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x92),
  407. NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
  408. NAND_ECCREQ(8, 512),
  409. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
  410. &write_cache_variants,
  411. &update_cache_variants),
  412. SPINAND_HAS_QE_BIT,
  413. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  414. gd5fxgq4uexxg_ecc_get_status)),
  415. SPINAND_INFO("GD5F2GM7RExxG",
  416. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x82),
  417. NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
  418. NAND_ECCREQ(8, 512),
  419. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
  420. &write_cache_variants,
  421. &update_cache_variants),
  422. SPINAND_HAS_QE_BIT,
  423. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  424. gd5fxgq4uexxg_ecc_get_status)),
  425. SPINAND_INFO("GD5F4GM8UExxG",
  426. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x95),
  427. NAND_MEMORG(1, 2048, 128, 64, 4096, 80, 1, 1, 1),
  428. NAND_ECCREQ(8, 512),
  429. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
  430. &write_cache_variants,
  431. &update_cache_variants),
  432. SPINAND_HAS_QE_BIT,
  433. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  434. gd5fxgq4uexxg_ecc_get_status)),
  435. SPINAND_INFO("GD5F4GM8RExxG",
  436. SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x85),
  437. NAND_MEMORG(1, 2048, 128, 64, 4096, 80, 1, 1, 1),
  438. NAND_ECCREQ(8, 512),
  439. SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
  440. &write_cache_variants,
  441. &update_cache_variants),
  442. SPINAND_HAS_QE_BIT,
  443. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  444. gd5fxgq4uexxg_ecc_get_status)),
  445. };
  446. static const struct spinand_manufacturer_ops gigadevice_spinand_manuf_ops = {
  447. };
  448. const struct spinand_manufacturer gigadevice_spinand_manufacturer = {
  449. .id = SPINAND_MFR_GIGADEVICE,
  450. .name = "GigaDevice",
  451. .chips = gigadevice_spinand_table,
  452. .nchips = ARRAY_SIZE(gigadevice_spinand_table),
  453. .ops = &gigadevice_spinand_manuf_ops,
  454. };