at91_matrix.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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_MATRIX_H
  23. #define AT91_MATRIX_H
  24. #ifdef __ASSEMBLY__
  25. #if defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9G20)
  26. #define AT91_ASM_MATRIX_CSA0 (AT91_MATRIX_BASE + 0x11C)
  27. #elif defined(CONFIG_AT91SAM9261)
  28. #define AT91_ASM_MATRIX_CSA0 (AT91_MATRIX_BASE + 0x30)
  29. #elif defined(CONFIG_AT91SAM9263)
  30. #define AT91_ASM_MATRIX_CSA0 (AT91_MATRIX_BASE + 0x120)
  31. #elif defined(CONFIG_AT91SAM9G45)
  32. #define AT91_ASM_MATRIX_CSA0 (AT91_MATRIX_BASE + 0x128)
  33. #else
  34. #error AT91_ASM_MATRIX_CSA0 is not definied for current CPU
  35. #endif
  36. #define AT91_ASM_MATRIX_MCFG AT91_MATRIX_BASE
  37. #else
  38. #if defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9G20)
  39. #define AT91_MATRIX_MASTERS 6
  40. #define AT91_MATRIX_SLAVES 5
  41. #elif defined(CONFIG_AT91SAM9261)
  42. #define AT91_MATRIX_MASTERS 1
  43. #define AT91_MATRIX_SLAVES 5
  44. #elif defined(CONFIG_AT91SAM9263)
  45. #define AT91_MATRIX_MASTERS 9
  46. #define AT91_MATRIX_SLAVES 7
  47. #elif defined(CONFIG_AT91SAM9G45)
  48. #define AT91_MATRIX_MASTERS 11
  49. #define AT91_MATRIX_SLAVES 8
  50. #else
  51. #error CPU not supported. Please update at91_matrix.h
  52. #endif
  53. typedef struct at91_priority {
  54. u32 a;
  55. u32 b;
  56. } at91_priority_t;
  57. typedef struct at91_matrix {
  58. u32 mcfg[AT91_MATRIX_MASTERS];
  59. #if defined(CONFIG_AT91SAM9261)
  60. u32 scfg[AT91_MATRIX_SLAVES];
  61. u32 res61_1[3];
  62. u32 tcr;
  63. u32 res61_2[2];
  64. u32 csa;
  65. u32 pucr;
  66. u32 res61_3[114];
  67. #else
  68. u32 reserve1[16 - AT91_MATRIX_MASTERS];
  69. u32 scfg[AT91_MATRIX_SLAVES];
  70. u32 reserve2[16 - AT91_MATRIX_SLAVES];
  71. at91_priority_t pr[AT91_MATRIX_SLAVES];
  72. u32 reserve3[32 - (2 * AT91_MATRIX_SLAVES)];
  73. u32 mrcr; /* 0x100 Master Remap Control */
  74. u32 reserve4[3];
  75. #if defined(CONFIG_AT91SAM9G45)
  76. u32 ccr[52] /* 0x110 - 0x1E0 Chip Configuration */
  77. u32 womr; /* 0x1E4 Write Protect Mode */
  78. u32 wpsr; /* 0x1E8 Write Protect Status */
  79. u32 resg45_1[10];
  80. #elif defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9G20)
  81. u32 res60_1[3];
  82. u32 csa;
  83. u32 res60_2[56];
  84. #elif defined(CONFIG_AT91SAM9263)
  85. u32 res63_1;
  86. u32 tcmr;
  87. u32 res63_2[2];
  88. u32 csa[2];
  89. u32 res63_3[54];
  90. #else
  91. u32 reserve5[60];
  92. #endif
  93. #endif
  94. } at91_matrix_t;
  95. #endif /* __ASSEMBLY__ */
  96. #define AT91_MATRIX_CSA_DBPUC 0x00000100
  97. #define AT91_MATRIX_CSA_VDDIOMSEL_1_8V 0x00000000
  98. #define AT91_MATRIX_CSA_VDDIOMSEL_3_3V 0x00010000
  99. #define AT91_MATRIX_CSA_EBI_CS1A 0x00000002
  100. #define AT91_MATRIX_CSA_EBI_CS3A 0x00000008
  101. #define AT91_MATRIX_CSA_EBI_CS4A 0x00000010
  102. #define AT91_MATRIX_CSA_EBI_CS5A 0x00000020
  103. #define AT91_MATRIX_CSA_EBI1_CS2A 0x00000008
  104. #endif