omap_gpmc.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * (C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
  3. * Rohit Choraria <rohitkc@ti.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 __ASM_ARCH_OMAP_GPMC_H
  24. #define __ASM_ARCH_OMAP_GPMC_H
  25. #define GPMC_BUF_EMPTY 0
  26. #define GPMC_BUF_FULL 1
  27. #define ECCCLEAR (0x1 << 8)
  28. #define ECCRESULTREG1 (0x1 << 0)
  29. #define ECCSIZE512BYTE 0xFF
  30. #define ECCSIZE1 (ECCSIZE512BYTE << 22)
  31. #define ECCSIZE0 (ECCSIZE512BYTE << 12)
  32. #define ECCSIZE0SEL (0x000 << 0)
  33. /* Generic ECC Layouts */
  34. /* Large Page x8 NAND device Layout */
  35. #ifdef GPMC_NAND_ECC_LP_x8_LAYOUT
  36. #define GPMC_NAND_HW_ECC_LAYOUT {\
  37. .eccbytes = 12,\
  38. .eccpos = {1, 2, 3, 4, 5, 6, 7, 8,\
  39. 9, 10, 11, 12},\
  40. .oobfree = {\
  41. {.offset = 13,\
  42. .length = 51 } } \
  43. }
  44. #endif
  45. /* Large Page x16 NAND device Layout */
  46. #ifdef GPMC_NAND_ECC_LP_x16_LAYOUT
  47. #define GPMC_NAND_HW_ECC_LAYOUT {\
  48. .eccbytes = 12,\
  49. .eccpos = {2, 3, 4, 5, 6, 7, 8, 9,\
  50. 10, 11, 12, 13},\
  51. .oobfree = {\
  52. {.offset = 14,\
  53. .length = 50 } } \
  54. }
  55. #endif
  56. /* Small Page x8 NAND device Layout */
  57. #ifdef GPMC_NAND_ECC_SP_x8_LAYOUT
  58. #define GPMC_NAND_HW_ECC_LAYOUT {\
  59. .eccbytes = 3,\
  60. .eccpos = {1, 2, 3},\
  61. .oobfree = {\
  62. {.offset = 4,\
  63. .length = 12 } } \
  64. }
  65. #endif
  66. /* Small Page x16 NAND device Layout */
  67. #ifdef GPMC_NAND_ECC_SP_x16_LAYOUT
  68. #define GPMC_NAND_HW_ECC_LAYOUT {\
  69. .eccbytes = 3,\
  70. .eccpos = {2, 3, 4},\
  71. .oobfree = {\
  72. {.offset = 5,\
  73. .length = 11 } } \
  74. }
  75. #endif
  76. #define GPMC_NAND_HW_BCH4_ECC_LAYOUT {\
  77. .eccbytes = 32,\
  78. .eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
  79. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
  80. 28, 29, 30, 31, 32, 33},\
  81. .oobfree = {\
  82. {.offset = 34,\
  83. .length = 30 } } \
  84. }
  85. #define GPMC_NAND_HW_BCH8_ECC_LAYOUT {\
  86. .eccbytes = 56,\
  87. .eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
  88. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
  89. 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
  90. 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
  91. 52, 53, 54, 55, 56, 57},\
  92. .oobfree = {\
  93. {.offset = 58,\
  94. .length = 6 } } \
  95. }
  96. #define GPMC_NAND_HW_BCH16_ECC_LAYOUT {\
  97. .eccbytes = 104,\
  98. .eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
  99. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
  100. 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
  101. 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
  102. 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,\
  103. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,\
  104. 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,\
  105. 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,\
  106. 100, 101, 102, 103, 104, 105},\
  107. .oobfree = {\
  108. {.offset = 106,\
  109. .length = 8 } } \
  110. }
  111. #endif /* __ASM_ARCH_OMAP_GPMC_H */