omap_gpmc.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * (C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
  3. * Rohit Choraria <rohitkc@ti.com>
  4. *
  5. * (C) Copyright 2013 Andreas Bießmann <andreas.devel@googlemail.com>
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #ifndef __ASM_OMAP_GPMC_H
  26. #define __ASM_OMAP_GPMC_H
  27. #include <asm/arch/omap_gpmc.h>
  28. #define GPMC_BUF_EMPTY 0
  29. #define GPMC_BUF_FULL 1
  30. #define ECCCLEAR (0x1 << 8)
  31. #define ECCRESULTREG1 (0x1 << 0)
  32. #define ECCSIZE512BYTE 0xFF
  33. #define ECCSIZE1 (ECCSIZE512BYTE << 22)
  34. #define ECCSIZE0 (ECCSIZE512BYTE << 12)
  35. #define ECCSIZE0SEL (0x000 << 0)
  36. /* Generic ECC Layouts */
  37. /* Large Page x8 NAND device Layout */
  38. #ifdef GPMC_NAND_ECC_LP_x8_LAYOUT
  39. #define GPMC_NAND_HW_ECC_LAYOUT {\
  40. .eccbytes = 12,\
  41. .eccpos = {1, 2, 3, 4, 5, 6, 7, 8,\
  42. 9, 10, 11, 12},\
  43. .oobfree = {\
  44. {.offset = 13,\
  45. .length = 51 } } \
  46. }
  47. #endif
  48. /* Large Page x16 NAND device Layout */
  49. #ifdef GPMC_NAND_ECC_LP_x16_LAYOUT
  50. #define GPMC_NAND_HW_ECC_LAYOUT {\
  51. .eccbytes = 12,\
  52. .eccpos = {2, 3, 4, 5, 6, 7, 8, 9,\
  53. 10, 11, 12, 13},\
  54. .oobfree = {\
  55. {.offset = 14,\
  56. .length = 50 } } \
  57. }
  58. #endif
  59. /* Small Page x8 NAND device Layout */
  60. #ifdef GPMC_NAND_ECC_SP_x8_LAYOUT
  61. #define GPMC_NAND_HW_ECC_LAYOUT {\
  62. .eccbytes = 3,\
  63. .eccpos = {1, 2, 3},\
  64. .oobfree = {\
  65. {.offset = 4,\
  66. .length = 12 } } \
  67. }
  68. #endif
  69. /* Small Page x16 NAND device Layout */
  70. #ifdef GPMC_NAND_ECC_SP_x16_LAYOUT
  71. #define GPMC_NAND_HW_ECC_LAYOUT {\
  72. .eccbytes = 3,\
  73. .eccpos = {2, 3, 4},\
  74. .oobfree = {\
  75. {.offset = 5,\
  76. .length = 11 } } \
  77. }
  78. #endif
  79. #endif /* __ASM_OMAP_GPMC_H */