mtgpio_cfg.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /*
  2. * Copyright (c) 2019, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MT_GPIO_CFG_H
  7. #define MT_GPIO_CFG_H
  8. #include <stdint.h>
  9. #include <plat/common/common_def.h>
  10. #define IOCFG_0_BASE 0x11F20000
  11. #define IOCFG_1_BASE 0x11E80000
  12. #define IOCFG_2_BASE 0x11E70000
  13. #define IOCFG_3_BASE 0x11E90000
  14. #define IOCFG_4_BASE 0x11D30000
  15. #define IOCFG_5_BASE 0x11D20000
  16. #define IOCFG_6_BASE 0x11C50000
  17. #define IOCFG_7_BASE 0x11F30000
  18. typedef struct {
  19. int8_t offset;
  20. } PIN_offset;
  21. PIN_offset PULL_offset[] = {
  22. /* 0 */ {6},
  23. /* 1 */ {7},
  24. /* 2 */ {8},
  25. /* 3 */ {9},
  26. /* 4 */ {11},
  27. /* 5 */ {12},
  28. /* 6 */ {13},
  29. /* 7 */ {14},
  30. /* 8 */ {0},
  31. /* 9 */ {26},
  32. /* 10 */ {27},
  33. /* 11 */ {10},
  34. /* 12 */ {17},
  35. /* 13 */ {6},
  36. /* 14 */ {7},
  37. /* 15 */ {8},
  38. /* 16 */ {9},
  39. /* 17 */ {10},
  40. /* 18 */ {11},
  41. /* 19 */ {12},
  42. /* 20 */ {13},
  43. /* 21 */ {14},
  44. /* 22 */ {15},
  45. /* 23 */ {16},
  46. /* 24 */ {17},
  47. /* 25 */ {18},
  48. /* 26 */ {19},
  49. /* 27 */ {20},
  50. /* 28 */ {21},
  51. /* 29 */ {-1},
  52. /* 30 */ {-1},
  53. /* 31 */ {-1},
  54. /* 32 */ {-1},
  55. /* 33 */ {-1},
  56. /* 34 */ {-1},
  57. /* 35 */ {-1},
  58. /* 36 */ {-1},
  59. /* 37 */ {-1},
  60. /* 38 */ {-1},
  61. /* 39 */ {-1},
  62. /* 40 */ {-1},
  63. /* 41 */ {-1},
  64. /* 42 */ {-1},
  65. /* 43 */ {8},
  66. /* 44 */ {9},
  67. /* 45 */ {10},
  68. /* 46 */ {11},
  69. /* 47 */ {12},
  70. /* 48 */ {13},
  71. /* 49 */ {14},
  72. /* 50 */ {0},
  73. /* 51 */ {1},
  74. /* 52 */ {2},
  75. /* 53 */ {3},
  76. /* 54 */ {4},
  77. /* 55 */ {5},
  78. /* 56 */ {6},
  79. /* 57 */ {7},
  80. /* 58 */ {8},
  81. /* 59 */ {9},
  82. /* 60 */ {10},
  83. /* 61 */ {0},
  84. /* 62 */ {1},
  85. /* 63 */ {2},
  86. /* 64 */ {3},
  87. /* 65 */ {4},
  88. /* 66 */ {5},
  89. /* 67 */ {6},
  90. /* 68 */ {7},
  91. /* 69 */ {8},
  92. /* 70 */ {9},
  93. /* 71 */ {10},
  94. /* 72 */ {11},
  95. /* 73 */ {12},
  96. /* 74 */ {13},
  97. /* 75 */ {14},
  98. /* 76 */ {15},
  99. /* 77 */ {16},
  100. /* 78 */ {17},
  101. /* 79 */ {18},
  102. /* 80 */ {19},
  103. /* 81 */ {20},
  104. /* 82 */ {21},
  105. /* 83 */ {22},
  106. /* 84 */ {23},
  107. /* 85 */ {24},
  108. /* 86 */ {25},
  109. /* 87 */ {26},
  110. /* 88 */ {27},
  111. /* 89 */ {24},
  112. /* 90 */ {1},
  113. /* 91 */ {-1},
  114. /* 92 */ {-1},
  115. /* 93 */ {-1},
  116. /* 94 */ {-1},
  117. /* 95 */ {15},
  118. /* 96 */ {17},
  119. /* 97 */ {18},
  120. /* 98 */ {19},
  121. /* 99 */ {20},
  122. /* 100 */ {21},
  123. /* 101 */ {22},
  124. /* 102 */ {23},
  125. /* 103 */ {28},
  126. /* 104 */ {29},
  127. /* 105 */ {30},
  128. /* 106 */ {31},
  129. /* 107 */ {0},
  130. /* 108 */ {1},
  131. /* 109 */ {2},
  132. /* 110 */ {3},
  133. /* 111 */ {4},
  134. /* 112 */ {5},
  135. /* 113 */ {6},
  136. /* 114 */ {7},
  137. /* 115 */ {8},
  138. /* 116 */ {9},
  139. /* 117 */ {10},
  140. /* 118 */ {11},
  141. /* 119 */ {12},
  142. /* 120 */ {13},
  143. /* 121 */ {14},
  144. /* 122 */ {-1},
  145. /* 123 */ {-1},
  146. /* 124 */ {-1},
  147. /* 125 */ {-1},
  148. /* 126 */ {-1},
  149. /* 127 */ {-1},
  150. /* 128 */ {-1},
  151. /* 129 */ {-1},
  152. /* 130 */ {-1},
  153. /* 131 */ {-1},
  154. /* 132 */ {-1},
  155. /* 133 */ {-1},
  156. /* 134 */ {0},
  157. /* 135 */ {1},
  158. /* 136 */ {2},
  159. /* 137 */ {3},
  160. /* 138 */ {4},
  161. /* 139 */ {5},
  162. /* 140 */ {6},
  163. /* 141 */ {7},
  164. /* 142 */ {8},
  165. /* 143 */ {9},
  166. /* 144 */ {11},
  167. /* 145 */ {12},
  168. /* 146 */ {13},
  169. /* 147 */ {14},
  170. /* 148 */ {15},
  171. /* 149 */ {16},
  172. /* 150 */ {18},
  173. /* 151 */ {19},
  174. /* 152 */ {20},
  175. /* 153 */ {21},
  176. /* 154 */ {22},
  177. /* 155 */ {23},
  178. /* 156 */ {24},
  179. /* 157 */ {25},
  180. /* 158 */ {26},
  181. /* 159 */ {27},
  182. /* 160 */ {28},
  183. /* 161 */ {0},
  184. /* 162 */ {1},
  185. /* 163 */ {2},
  186. /* 164 */ {3},
  187. /* 165 */ {4},
  188. /* 166 */ {5},
  189. /* 167 */ {11},
  190. /* 168 */ {12},
  191. /* 169 */ {13},
  192. /* 170 */ {14},
  193. /* 171 */ {15},
  194. /* 172 */ {16},
  195. /* 173 */ {17},
  196. /* 174 */ {18},
  197. /* 175 */ {19},
  198. /* 176 */ {20},
  199. /* 177 */ {10},
  200. /* 178 */ {16},
  201. /* 179 */ {25}
  202. };
  203. #endif /* MT_GPIO_CFG_H */