420-v5.19-04-mtd-spinand-gigadevice-add-support-for-GD5F-2-4-GQ5x.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. From 194ec04b3a9e7fa97d1fbef296410631bc3cf1c8 Mon Sep 17 00:00:00 2001
  2. From: Chuanhong Guo <[email protected]>
  3. Date: Sun, 20 Mar 2022 18:00:00 +0800
  4. Subject: [PATCH 4/5] mtd: spinand: gigadevice: add support for GD5F{2,
  5. 4}GQ5xExxG
  6. Add support for:
  7. GD5F2GQ5{U,R}ExxG
  8. GD5F4GQ6{U,R}ExxG
  9. These chips uses 4 dummy bytes for quad io and 2 dummy bytes for dual io.
  10. Besides that and memory layout, they are identical to their 1G variant.
  11. Signed-off-by: Chuanhong Guo <[email protected]>
  12. Signed-off-by: Miquel Raynal <[email protected]>
  13. Link: https://lore.kernel.org/linux-mtd/[email protected]
  14. ---
  15. drivers/mtd/nand/spi/gigadevice.c | 48 +++++++++++++++++++++++++++++++
  16. 1 file changed, 48 insertions(+)
  17. --- a/drivers/mtd/nand/spi/gigadevice.c
  18. +++ b/drivers/mtd/nand/spi/gigadevice.c
  19. @@ -47,6 +47,14 @@ static SPINAND_OP_VARIANTS(read_cache_va
  20. SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
  21. SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
  22. +static SPINAND_OP_VARIANTS(read_cache_variants_2gq5,
  23. + SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
  24. + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
  25. + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 2, NULL, 0),
  26. + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
  27. + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
  28. + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
  29. +
  30. static SPINAND_OP_VARIANTS(write_cache_variants,
  31. SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
  32. SPINAND_PROG_LOAD(true, 0, NULL, 0));
  33. @@ -393,6 +401,46 @@ static const struct spinand_info gigadev
  34. &write_cache_variants,
  35. &update_cache_variants),
  36. SPINAND_HAS_QE_BIT,
  37. + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  38. + gd5fxgq5xexxg_ecc_get_status)),
  39. + SPINAND_INFO("GD5F2GQ5UExxG",
  40. + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x52),
  41. + NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
  42. + NAND_ECCREQ(4, 512),
  43. + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_2gq5,
  44. + &write_cache_variants,
  45. + &update_cache_variants),
  46. + SPINAND_HAS_QE_BIT,
  47. + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  48. + gd5fxgq5xexxg_ecc_get_status)),
  49. + SPINAND_INFO("GD5F2GQ5RExxG",
  50. + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x42),
  51. + NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
  52. + NAND_ECCREQ(4, 512),
  53. + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_2gq5,
  54. + &write_cache_variants,
  55. + &update_cache_variants),
  56. + SPINAND_HAS_QE_BIT,
  57. + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  58. + gd5fxgq5xexxg_ecc_get_status)),
  59. + SPINAND_INFO("GD5F4GQ6UExxG",
  60. + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x55),
  61. + NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 2, 1),
  62. + NAND_ECCREQ(4, 512),
  63. + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_2gq5,
  64. + &write_cache_variants,
  65. + &update_cache_variants),
  66. + SPINAND_HAS_QE_BIT,
  67. + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  68. + gd5fxgq5xexxg_ecc_get_status)),
  69. + SPINAND_INFO("GD5F4GQ6RExxG",
  70. + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x45),
  71. + NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 2, 1),
  72. + NAND_ECCREQ(4, 512),
  73. + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_2gq5,
  74. + &write_cache_variants,
  75. + &update_cache_variants),
  76. + SPINAND_HAS_QE_BIT,
  77. SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
  78. gd5fxgq5xexxg_ecc_get_status)),
  79. };