emif_defs.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef _EMIF_DEFS_H_
  23. #define _EMIF_DEFS_H_
  24. #include <asm/arch/hardware.h>
  25. struct davinci_emif_regs {
  26. u_int32_t ercsr;
  27. u_int32_t awccr;
  28. u_int32_t sdbcr;
  29. u_int32_t sdrcr;
  30. u_int32_t ab1cr;
  31. u_int32_t ab2cr;
  32. u_int32_t ab3cr;
  33. u_int32_t ab4cr;
  34. u_int32_t sdtimr;
  35. u_int32_t ddrsr;
  36. u_int32_t ddrphycr;
  37. u_int32_t ddrphysr;
  38. u_int32_t totar;
  39. u_int32_t totactr;
  40. u_int32_t ddrphyid_rev;
  41. u_int32_t sdsretr;
  42. u_int32_t eirr;
  43. u_int32_t eimr;
  44. u_int32_t eimsr;
  45. u_int32_t eimcr;
  46. u_int32_t ioctrlr;
  47. u_int32_t iostatr;
  48. u_int8_t rsvd0[8];
  49. u_int32_t nandfcr;
  50. u_int32_t nandfsr;
  51. u_int8_t rsvd1[8];
  52. u_int32_t nandfecc[4];
  53. u_int8_t rsvd2[60];
  54. u_int32_t nand4biteccload;
  55. u_int32_t nand4bitecc[4];
  56. u_int32_t nanderradd1;
  57. u_int32_t nanderradd2;
  58. u_int32_t nanderrval1;
  59. u_int32_t nanderrval2;
  60. };
  61. #define davinci_emif_regs \
  62. ((struct davinci_emif_regs *)DAVINCI_ASYNC_EMIF_CNTRL_BASE)
  63. #define DAVINCI_NANDFCR_NAND_ENABLE(n) (1 << (n-2))
  64. #define DAVINCI_NANDFCR_4BIT_ECC_SEL_MASK (3 << 4)
  65. #define DAVINCI_NANDFCR_4BIT_ECC_SEL(n) ((n-2) << 4)
  66. #define DAVINCI_NANDFCR_1BIT_ECC_START(n) (1 << (8 + (n-2)))
  67. #define DAVINCI_NANDFCR_4BIT_ECC_START (1 << 12)
  68. #define DAVINCI_NANDFCR_4BIT_CALC_START (1 << 13)
  69. /* Chip Select setup */
  70. #define DAVINCI_ABCR_STROBE_SELECT (1 << 31)
  71. #define DAVINCI_ABCR_EXT_WAIT (1 << 30)
  72. #define DAVINCI_ABCR_WSETUP(n) (n << 26)
  73. #define DAVINCI_ABCR_WSTROBE(n) (n << 20)
  74. #define DAVINCI_ABCR_WHOLD(n) (n << 17)
  75. #define DAVINCI_ABCR_RSETUP(n) (n << 13)
  76. #define DAVINCI_ABCR_RSTROBE(n) (n << 7)
  77. #define DAVINCI_ABCR_RHOLD(n) (n << 4)
  78. #define DAVINCI_ABCR_TA(n) (n << 2)
  79. #define DAVINCI_ABCR_ASIZE_16BIT 1
  80. #define DAVINCI_ABCR_ASIZE_8BIT 0
  81. #endif