omap_gpmc.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef __ASM_OMAP_GPMC_H
  10. #define __ASM_OMAP_GPMC_H
  11. #define GPMC_BUF_EMPTY 0
  12. #define GPMC_BUF_FULL 1
  13. /* Generic ECC Layouts */
  14. /* Large Page x8 NAND device Layout */
  15. #ifdef GPMC_NAND_ECC_LP_x8_LAYOUT
  16. #define GPMC_NAND_HW_ECC_LAYOUT {\
  17. .eccbytes = 12,\
  18. .eccpos = {1, 2, 3, 4, 5, 6, 7, 8,\
  19. 9, 10, 11, 12},\
  20. .oobfree = {\
  21. {.offset = 13,\
  22. .length = 51 } } \
  23. }
  24. #endif
  25. /* Large Page x16 NAND device Layout */
  26. #ifdef GPMC_NAND_ECC_LP_x16_LAYOUT
  27. #define GPMC_NAND_HW_ECC_LAYOUT {\
  28. .eccbytes = 12,\
  29. .eccpos = {2, 3, 4, 5, 6, 7, 8, 9,\
  30. 10, 11, 12, 13},\
  31. .oobfree = {\
  32. {.offset = 14,\
  33. .length = 50 } } \
  34. }
  35. #endif
  36. /* Small Page x8 NAND device Layout */
  37. #ifdef GPMC_NAND_ECC_SP_x8_LAYOUT
  38. #define GPMC_NAND_HW_ECC_LAYOUT {\
  39. .eccbytes = 3,\
  40. .eccpos = {1, 2, 3},\
  41. .oobfree = {\
  42. {.offset = 4,\
  43. .length = 12 } } \
  44. }
  45. #endif
  46. /* Small Page x16 NAND device Layout */
  47. #ifdef GPMC_NAND_ECC_SP_x16_LAYOUT
  48. #define GPMC_NAND_HW_ECC_LAYOUT {\
  49. .eccbytes = 3,\
  50. .eccpos = {2, 3, 4},\
  51. .oobfree = {\
  52. {.offset = 5,\
  53. .length = 11 } } \
  54. }
  55. #endif
  56. enum omap_ecc {
  57. /* 1-bit ECC calculation by Software, Error detection by Software */
  58. OMAP_ECC_HAM1_CODE_SW = 1, /* avoid un-initialized int can be 0x0 */
  59. /* 1-bit ECC calculation by GPMC, Error detection by Software */
  60. /* ECC layout compatible to legacy ROMCODE. */
  61. OMAP_ECC_HAM1_CODE_HW,
  62. /* 4-bit ECC calculation by GPMC, Error detection by Software */
  63. OMAP_ECC_BCH4_CODE_HW_DETECTION_SW,
  64. /* 4-bit ECC calculation by GPMC, Error detection by ELM */
  65. OMAP_ECC_BCH4_CODE_HW,
  66. /* 8-bit ECC calculation by GPMC, Error detection by Software */
  67. OMAP_ECC_BCH8_CODE_HW_DETECTION_SW,
  68. /* 8-bit ECC calculation by GPMC, Error detection by ELM */
  69. OMAP_ECC_BCH8_CODE_HW,
  70. };
  71. #endif /* __ASM_OMAP_GPMC_H */