samsung_onenand.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Copyright (C) 2005-2009 Samsung Electronics
  3. * Minkyu Kang <mk7.kang@samsung.com>
  4. * Kyungmin Park <kyungmin.park@samsung.com>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #ifndef __SAMSUNG_ONENAND_H__
  9. #define __SAMSUNG_ONENAND_H__
  10. /*
  11. * OneNAND Controller
  12. */
  13. #ifndef __ASSEMBLY__
  14. struct samsung_onenand {
  15. unsigned int mem_cfg; /* 0x0000 */
  16. unsigned char res1[0xc];
  17. unsigned int burst_len; /* 0x0010 */
  18. unsigned char res2[0xc];
  19. unsigned int mem_reset; /* 0x0020 */
  20. unsigned char res3[0xc];
  21. unsigned int int_err_stat; /* 0x0030 */
  22. unsigned char res4[0xc];
  23. unsigned int int_err_mask; /* 0x0040 */
  24. unsigned char res5[0xc];
  25. unsigned int int_err_ack; /* 0x0050 */
  26. unsigned char res6[0xc];
  27. unsigned int ecc_err_stat; /* 0x0060 */
  28. unsigned char res7[0xc];
  29. unsigned int manufact_id; /* 0x0070 */
  30. unsigned char res8[0xc];
  31. unsigned int device_id; /* 0x0080 */
  32. unsigned char res9[0xc];
  33. unsigned int data_buf_size; /* 0x0090 */
  34. unsigned char res10[0xc];
  35. unsigned int boot_buf_size; /* 0x00A0 */
  36. unsigned char res11[0xc];
  37. unsigned int buf_amount; /* 0x00B0 */
  38. unsigned char res12[0xc];
  39. unsigned int tech; /* 0x00C0 */
  40. unsigned char res13[0xc];
  41. unsigned int fba; /* 0x00D0 */
  42. unsigned char res14[0xc];
  43. unsigned int fpa; /* 0x00E0 */
  44. unsigned char res15[0xc];
  45. unsigned int fsa; /* 0x00F0 */
  46. unsigned char res16[0x3c];
  47. unsigned int sync_mode; /* 0x0130 */
  48. unsigned char res17[0xc];
  49. unsigned int trans_spare; /* 0x0140 */
  50. unsigned char res18[0x3c];
  51. unsigned int err_page_addr; /* 0x0180 */
  52. unsigned char res19[0x1c];
  53. unsigned int int_pin_en; /* 0x01A0 */
  54. unsigned char res20[0x1c];
  55. unsigned int acc_clock; /* 0x01C0 */
  56. unsigned char res21[0x1c];
  57. unsigned int err_blk_addr; /* 0x01E0 */
  58. unsigned char res22[0xc];
  59. unsigned int flash_ver_id; /* 0x01F0 */
  60. unsigned char res23[0x6c];
  61. unsigned int watchdog_cnt_low; /* 0x0260 */
  62. unsigned char res24[0xc];
  63. unsigned int watchdog_cnt_hi; /* 0x0270 */
  64. unsigned char res25[0xc];
  65. unsigned int sync_write; /* 0x0280 */
  66. unsigned char res26[0x1c];
  67. unsigned int cold_reset; /* 0x02A0 */
  68. unsigned char res27[0xc];
  69. unsigned int ddp_device; /* 0x02B0 */
  70. unsigned char res28[0xc];
  71. unsigned int multi_plane; /* 0x02C0 */
  72. unsigned char res29[0x1c];
  73. unsigned int trans_mode; /* 0x02E0 */
  74. unsigned char res30[0x1c];
  75. unsigned int ecc_err_stat2; /* 0x0300 */
  76. unsigned char res31[0xc];
  77. unsigned int ecc_err_stat3; /* 0x0310 */
  78. unsigned char res32[0xc];
  79. unsigned int ecc_err_stat4; /* 0x0320 */
  80. unsigned char res33[0x1c];
  81. unsigned int dev_page_size; /* 0x0340 */
  82. unsigned char res34[0x4c];
  83. unsigned int int_mon_status; /* 0x0390 */
  84. };
  85. #endif
  86. #define ONENAND_MEM_RESET_HOT 0x3
  87. #define ONENAND_MEM_RESET_COLD 0x2
  88. #define ONENAND_MEM_RESET_WARM 0x1
  89. #define INT_ERR_ALL 0x3fff
  90. #define CACHE_OP_ERR (1 << 13)
  91. #define RST_CMP (1 << 12)
  92. #define RDY_ACT (1 << 11)
  93. #define INT_ACT (1 << 10)
  94. #define UNSUP_CMD (1 << 9)
  95. #define LOCKED_BLK (1 << 8)
  96. #define BLK_RW_CMP (1 << 7)
  97. #define ERS_CMP (1 << 6)
  98. #define PGM_CMP (1 << 5)
  99. #define LOAD_CMP (1 << 4)
  100. #define ERS_FAIL (1 << 3)
  101. #define PGM_FAIL (1 << 2)
  102. #define INT_TO (1 << 1)
  103. #define LD_FAIL_ECC_ERR (1 << 0)
  104. #define TSRF (1 << 0)
  105. /* common initialize function */
  106. extern void s3c_onenand_init(struct mtd_info *);
  107. extern int s5pc110_chip_probe(struct mtd_info *);
  108. extern int s5pc210_chip_probe(struct mtd_info *);
  109. #endif