fsl_nfc.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. *
  3. * (c) 2009 Magnus Lilja <lilja.magnus@gmail.com>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef __FSL_NFC_H
  24. #define __FSL_NFC_H
  25. /*
  26. * Register map and bit definitions for the Freescale NAND Flash
  27. * Controller present in i.MX31 and other devices.
  28. */
  29. struct fsl_nfc_regs {
  30. u32 main_area0[128]; /* @0x000 */
  31. u32 main_area1[128];
  32. u32 main_area2[128];
  33. u32 main_area3[128];
  34. u32 spare_area0[4];
  35. u32 spare_area1[4];
  36. u32 spare_area2[4];
  37. u32 spare_area3[4];
  38. u32 reserved1[64 - 16 + 64 * 5];
  39. u16 bufsiz; /* @ 0xe00 */
  40. u16 reserved2;
  41. u16 buffer_address;
  42. u16 flash_add;
  43. u16 flash_cmd;
  44. u16 configuration;
  45. u16 ecc_status_result;
  46. u16 ecc_rslt_main_area;
  47. u16 ecc_rslt_spare_area;
  48. u16 nf_wr_prot;
  49. u16 unlock_start_blk_add;
  50. u16 unlock_end_blk_add;
  51. u16 nand_flash_wr_pr_st;
  52. u16 nand_flash_config1;
  53. u16 nand_flash_config2;
  54. };
  55. /*
  56. * Set INT to 0, FCMD to 1, rest to 0 in NFC_CONFIG2 Register for Command
  57. * operation
  58. */
  59. #define NFC_CMD 0x1
  60. /*
  61. * Set INT to 0, FADD to 1, rest to 0 in NFC_CONFIG2 Register for Address
  62. * operation
  63. */
  64. #define NFC_ADDR 0x2
  65. /*
  66. * Set INT to 0, FDI to 1, rest to 0 in NFC_CONFIG2 Register for Input
  67. * operation
  68. */
  69. #define NFC_INPUT 0x4
  70. /*
  71. * Set INT to 0, FDO to 001, rest to 0 in NFC_CONFIG2 Register for Data
  72. * Output operation
  73. */
  74. #define NFC_OUTPUT 0x8
  75. /*
  76. * Set INT to 0, FD0 to 010, rest to 0 in NFC_CONFIG2 Register for Read ID
  77. * operation
  78. */
  79. #define NFC_ID 0x10
  80. /*
  81. * Set INT to 0, FDO to 100, rest to 0 in NFC_CONFIG2 Register for Read
  82. * Status operation
  83. */
  84. #define NFC_STATUS 0x20
  85. /*
  86. * Set INT to 1, rest to 0 in NFC_CONFIG2 Register for Read Status
  87. * operation
  88. */
  89. #define NFC_INT 0x8000
  90. #define NFC_SP_EN (1 << 2)
  91. #define NFC_ECC_EN (1 << 3)
  92. #define NFC_INT_MSK (1 << 4)
  93. #define NFC_BIG (1 << 5)
  94. #define NFC_RST (1 << 6)
  95. #define NFC_CE (1 << 7)
  96. #define NFC_ONE_CYCLE (1 << 8)
  97. #endif /* __FSL_NFC_H */