omap_gpmc.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. #endif /* __ASM_ARCH_OMAP_GPMC_H */