at91_mc.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (C) 2009 Jens Scharsig (js_at_ng@scharsoft.de)
  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 AT91_MC_H
  23. #define AT91_MC_H
  24. #define AT91_ASM_MC_EBI_CSA (AT91_MC_BASE + 0x60)
  25. #define AT91_ASM_MC_EBI_CFG (AT91_MC_BASE + 0x64)
  26. #define AT91_ASM_MC_SMC_CSR0 (AT91_MC_BASE + 0x70)
  27. #define AT91_ASM_MC_SDRAMC_MR (AT91_MC_BASE + 0x90)
  28. #define AT91_ASM_MC_SDRAMC_TR (AT91_MC_BASE + 0x94)
  29. #define AT91_ASM_MC_SDRAMC_CR (AT91_MC_BASE + 0x98)
  30. #ifndef __ASSEMBLY__
  31. typedef struct at91_ebi {
  32. u32 csa; /* 0x00 Chip Select Assignment Register */
  33. u32 cfgr; /* 0x04 Configuration Register */
  34. u32 reserved[2];
  35. } __attribute__ ((packed)) at91_ebi_t;
  36. #define AT91_EBI_CSA_CS0A 0x0001
  37. #define AT91_EBI_CSA_CS1A 0x0002
  38. #define AT91_EBI_CSA_CS3A 0x0008
  39. #define AT91_EBI_CSA_CS4A 0x0010
  40. typedef struct at91_sdramc {
  41. u32 mr; /* 0x00 SDRAMC Mode Register */
  42. u32 tr; /* 0x04 SDRAMC Refresh Timer Register */
  43. u32 cr; /* 0x08 SDRAMC Configuration Register */
  44. u32 ssr; /* 0x0C SDRAMC Self Refresh Register */
  45. u32 lpr; /* 0x10 SDRAMC Low Power Register */
  46. u32 ier; /* 0x14 SDRAMC Interrupt Enable Register */
  47. u32 idr; /* 0x18 SDRAMC Interrupt Disable Register */
  48. u32 imr; /* 0x1C SDRAMC Interrupt Mask Register */
  49. u32 icr; /* 0x20 SDRAMC Interrupt Status Register */
  50. u32 reserved[3];
  51. } __attribute__ ((packed)) at91_sdramc_t;
  52. typedef struct at91_smc {
  53. u32 csr[8]; /* 0x00 SDRAMC Mode Register */
  54. } __attribute__ ((packed)) at91_smc_t;
  55. #define AT91_SMC_CSR_RWHOLD(x) ((x & 0x7) << 28)
  56. #define AT91_SMC_CSR_RWSETUP(x) ((x & 0x7) << 24)
  57. #define AT91_SMC_CSR_ACSS_STANDARD 0x00000000
  58. #define AT91_SMC_CSR_ACSS_1CYCLE 0x00010000
  59. #define AT91_SMC_CSR_ACSS_2CYCLE 0x00020000
  60. #define AT91_SMC_CSR_ACSS_3CYCLE 0x00030000
  61. #define AT91_SMC_CSR_DRP 0x00008000
  62. #define AT91_SMC_CSR_DBW_8 0x00004000
  63. #define AT91_SMC_CSR_DBW_16 0x00002000
  64. #define AT91_SMC_CSR_BAT_8 0x00000000
  65. #define AT91_SMC_CSR_BAT_16 0x00001000
  66. #define AT91_SMC_CSR_TDF(x) ((x & 0xF) << 8)
  67. #define AT91_SMC_CSR_WSEN 0x00000080
  68. #define AT91_SMC_CSR_NWS(x) (x & 0x7F)
  69. typedef struct at91_bfc {
  70. u32 mr; /* 0x00 SDRAMC Mode Register */
  71. } __attribute__ ((packed)) at91_bfc_t;
  72. typedef struct at91_mc {
  73. u32 rcr; /* 0x00 MC Remap Control Register */
  74. u32 asr; /* 0x04 MC Abort Status Register */
  75. u32 aasr; /* 0x08 MC Abort Address Status Reg */
  76. u32 mpr; /* 0x0C MC Master Priority Register */
  77. u32 reserved1[20]; /* 0x10-0x5C */
  78. at91_ebi_t ebi; /* 0x60 - 0x6C EBI */
  79. at91_smc_t smc; /* 0x70 - 0x8C SMC User Interface */
  80. at91_sdramc_t sdramc; /* 0x90 - 0xBC SDRAMC User Interface */
  81. at91_bfc_t bfc; /* 0xC0 BFC User Interface */
  82. u32 reserved2[15];
  83. } __attribute__ ((packed)) at91_mc_t;
  84. #endif
  85. #endif