1
0

912-ar300m-add-FW-PM-spinand.patch 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. --- a/drivers/mtd/nand/ath79_spinand.c
  2. +++ b/drivers/mtd/nand/ath79_spinand.c
  3. @@ -441,6 +441,9 @@ static int ath79_spinand_read_from_cache
  4. cmd.cmd = ATH79_SPINAND_CMD_READ_RDM;
  5. cmd.n_addr = 3;
  6. + cmd.addr[0] = 0;
  7. + cmd.addr[1] = (u8)(offset >> 8);
  8. + cmd.addr[2] = (u8)(offset >> 0);
  9. cmd.n_dummy = 0;
  10. cmd.n_rx = len;
  11. cmd.rx_buf = rbuf;
  12. @@ -776,9 +779,9 @@ static void ath79_spinand_cmdfunc(struct
  13. state->buf);
  14. break;
  15. case NAND_CMD_READOOB:
  16. - state->buf_ptr = 0;
  17. - ath79_spinand_read_page(info->spi, page, mtd->writesize,
  18. - mtd->oobsize, state->buf);
  19. + state->buf_ptr = mtd->writesize;
  20. + ath79_spinand_read_page(info->spi, page, 0x0,
  21. + mtd->writesize + mtd->oobsize, state->buf);
  22. break;
  23. case NAND_CMD_RNDOUT:
  24. state->buf_ptr = column;
  25. @@ -1005,6 +1008,21 @@ static struct ath79_spinand_priv ath79_s
  26. 0x07, /* ecc error code */
  27. SZ_512, /* ecc size */
  28. 16, /* ecc bytes */
  29. + 1, /* ecc strength */
  30. + &ath79_spinand_oob_128_gd, /* ecc layout */
  31. + &ath79_badblock_pattern_default, /* bad block pattern */
  32. + ath79_spinand_eccsr_gd, /* get ecc status */
  33. + ath79_spinand_read_rdm_addr_gd, /* wrap address for 03h command */
  34. + ath79_spinand_program_load_gd, /* program load data to cache */
  35. + ath79_spinand_erase_block_erase_common, /* erase block */
  36. + ath79_spinand_page_read_to_cache_common,/* page read to cache */
  37. + ath79_spinand_program_execute_common, /* program execute */
  38. + },
  39. + { /* FW PN Device */
  40. + NAND_MFR_FWDEVICE, /* manufacturer */
  41. + 0x07, /* ecc error code */
  42. + SZ_512, /* ecc size */
  43. + 16, /* ecc bytes */
  44. 1, /* ecc strength */
  45. &ath79_spinand_oob_128_gd, /* ecc layout */
  46. &ath79_badblock_pattern_default, /* bad block pattern */
  47. --- a/drivers/mtd/nand/nand_ids.c
  48. +++ b/drivers/mtd/nand/nand_ids.c
  49. @@ -55,6 +55,9 @@ struct nand_flash_dev nand_flash_ids[] =
  50. {"GD5F1GQ4U 1G 3.3V 8-bit",
  51. { .id = {0xc8, 0xb1} },
  52. SZ_2K, SZ_128, SZ_128K, 0, 2, 128, NAND_ECC_INFO(4, SZ_512) },
  53. + {"PN256GO1 1G 3.3V 8-bit",
  54. + { .id = {0xa1, 0xe1} },
  55. + SZ_2K, SZ_128, SZ_128K, 0, 2, 128, NAND_ECC_INFO(4, SZ_512) },
  56. {"GD5F2GQ4U 2G 3.3V 8-bit",
  57. { .id = {0xc8, 0xb2} },
  58. SZ_2K, SZ_256, SZ_128K, 0, 2, 128, NAND_ECC_INFO(4, SZ_512) },
  59. @@ -128,6 +131,7 @@ struct nand_flash_dev nand_flash_ids[] =
  60. EXTENDED_ID_NAND("NAND 128MiB 3,3V 8-bit", 0xF1, 128, LP_OPTIONS),
  61. EXTENDED_ID_NAND("NAND 128MiB 3,3V 8-bit", 0xD1, 128, LP_OPTIONS),
  62. EXTENDED_ID_NAND("NAND 128MiB 1,8V 16-bit", 0xB1, 128, LP_OPTIONS16),
  63. + EXTENDED_ID_NAND("NAND 128MiB 3,3V 16-bit", 0xE1, 128, LP_OPTIONS16),
  64. EXTENDED_ID_NAND("NAND 128MiB 3,3V 16-bit", 0xC1, 128, LP_OPTIONS16),
  65. EXTENDED_ID_NAND("NAND 128MiB 1,8V 16-bit", 0xAD, 128, LP_OPTIONS16),
  66. @@ -207,6 +211,7 @@ struct nand_manufacturers nand_manuf_ids
  67. {NAND_MFR_GIGADEVICE, "Giga Device"},
  68. {NAND_MFR_WINBOND, "Winbond"},
  69. {NAND_MFR_HEYANGTEK, "HeYang Tek"},
  70. + {NAND_MFR_FWDEVICE, "FW Device"},
  71. {0x0, "Unknown"}
  72. };
  73. --- a/include/linux/mtd/nand.h
  74. +++ b/include/linux/mtd/nand.h
  75. @@ -735,6 +735,7 @@ struct nand_chip {
  76. #define NAND_MFR_GIGADEVICE 0xc8
  77. #define NAND_MFR_WINBOND 0xef
  78. #define NAND_MFR_HEYANGTEK 0xc9
  79. +#define NAND_MFR_FWDEVICE 0xA1
  80. #define NAND_MFR_EON 0x92
  81. #define NAND_MFR_SANDISK 0x45
  82. #define NAND_MFR_INTEL 0x89