hardware.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. /*
  2. * This file contains the hardware definitions of the Integrator.
  3. *
  4. * Copyright (C) 1998-1999 ARM Limited.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #ifndef INTEGRATOR_HARDWARE_H
  21. #define INTEGRATOR_HARDWARE_H
  22. /*
  23. * Where in virtual memory the IO devices (timers, system controllers
  24. * and so on)
  25. */
  26. #define IO_BASE 0xF0000000 // VA of IO
  27. #define IO_SIZE 0x0B000000 // How much?
  28. #define IO_START INTEGRATOR_HDR_BASE // PA of IO
  29. /* macro to get at IO space when running virtually */
  30. #ifdef CONFIG_MMU
  31. #define IO_ADDRESS(x) (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE)
  32. #else
  33. #define IO_ADDRESS(x) (x)
  34. #endif
  35. #define __io_address(n) ((void __iomem *)IO_ADDRESS(n))
  36. /*
  37. * Integrator memory map
  38. */
  39. #define INTEGRATOR_BOOT_ROM_LO 0x00000000
  40. #define INTEGRATOR_BOOT_ROM_HI 0x20000000
  41. #define INTEGRATOR_BOOT_ROM_BASE INTEGRATOR_BOOT_ROM_HI /* Normal position */
  42. #define INTEGRATOR_BOOT_ROM_SIZE SZ_512K
  43. /*
  44. * New Core Modules have different amounts of SSRAM, the amount of SSRAM
  45. * fitted can be found in HDR_STAT.
  46. *
  47. * The symbol INTEGRATOR_SSRAM_SIZE is kept, however this now refers to
  48. * the minimum amount of SSRAM fitted on any core module.
  49. *
  50. * New Core Modules also alias the SSRAM.
  51. *
  52. */
  53. #define INTEGRATOR_SSRAM_BASE 0x00000000
  54. #define INTEGRATOR_SSRAM_ALIAS_BASE 0x10800000
  55. #define INTEGRATOR_SSRAM_SIZE SZ_256K
  56. #define INTEGRATOR_FLASH_BASE 0x24000000
  57. #define INTEGRATOR_FLASH_SIZE SZ_32M
  58. #define INTEGRATOR_MBRD_SSRAM_BASE 0x28000000
  59. #define INTEGRATOR_MBRD_SSRAM_SIZE SZ_512K
  60. /*
  61. * SDRAM is a SIMM therefore the size is not known.
  62. */
  63. #define INTEGRATOR_SDRAM_BASE 0x00040000
  64. #define INTEGRATOR_SDRAM_ALIAS_BASE 0x80000000
  65. #define INTEGRATOR_HDR0_SDRAM_BASE 0x80000000
  66. #define INTEGRATOR_HDR1_SDRAM_BASE 0x90000000
  67. #define INTEGRATOR_HDR2_SDRAM_BASE 0xA0000000
  68. #define INTEGRATOR_HDR3_SDRAM_BASE 0xB0000000
  69. /*
  70. * Logic expansion modules
  71. *
  72. */
  73. #define INTEGRATOR_LOGIC_MODULES_BASE 0xC0000000
  74. #define INTEGRATOR_LOGIC_MODULE0_BASE 0xC0000000
  75. #define INTEGRATOR_LOGIC_MODULE1_BASE 0xD0000000
  76. #define INTEGRATOR_LOGIC_MODULE2_BASE 0xE0000000
  77. #define INTEGRATOR_LOGIC_MODULE3_BASE 0xF0000000
  78. /*
  79. * Integrator header card registers
  80. */
  81. #define INTEGRATOR_HDR_ID_OFFSET 0x00
  82. #define INTEGRATOR_HDR_PROC_OFFSET 0x04
  83. #define INTEGRATOR_HDR_OSC_OFFSET 0x08
  84. #define INTEGRATOR_HDR_CTRL_OFFSET 0x0C
  85. #define INTEGRATOR_HDR_STAT_OFFSET 0x10
  86. #define INTEGRATOR_HDR_LOCK_OFFSET 0x14
  87. #define INTEGRATOR_HDR_SDRAM_OFFSET 0x20
  88. #define INTEGRATOR_HDR_INIT_OFFSET 0x24 /* CM9x6 */
  89. #define INTEGRATOR_HDR_IC_OFFSET 0x40
  90. #define INTEGRATOR_HDR_SPDBASE_OFFSET 0x100
  91. #define INTEGRATOR_HDR_SPDTOP_OFFSET 0x200
  92. #define INTEGRATOR_HDR_BASE 0x10000000
  93. #define INTEGRATOR_HDR_ID (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_ID_OFFSET)
  94. #define INTEGRATOR_HDR_PROC (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_PROC_OFFSET)
  95. #define INTEGRATOR_HDR_OSC (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_OSC_OFFSET)
  96. #define INTEGRATOR_HDR_CTRL (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_CTRL_OFFSET)
  97. #define INTEGRATOR_HDR_STAT (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_STAT_OFFSET)
  98. #define INTEGRATOR_HDR_LOCK (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_LOCK_OFFSET)
  99. #define INTEGRATOR_HDR_SDRAM (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_SDRAM_OFFSET)
  100. #define INTEGRATOR_HDR_INIT (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_INIT_OFFSET)
  101. #define INTEGRATOR_HDR_IC (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_IC_OFFSET)
  102. #define INTEGRATOR_HDR_SPDBASE (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_SPDBASE_OFFSET)
  103. #define INTEGRATOR_HDR_SPDTOP (INTEGRATOR_HDR_BASE + INTEGRATOR_HDR_SPDTOP_OFFSET)
  104. #define INTEGRATOR_HDR_CTRL_LED 0x01
  105. #define INTEGRATOR_HDR_CTRL_MBRD_DETECH 0x02
  106. #define INTEGRATOR_HDR_CTRL_REMAP 0x04
  107. #define INTEGRATOR_HDR_CTRL_RESET 0x08
  108. #define INTEGRATOR_HDR_CTRL_HIGHVECTORS 0x10
  109. #define INTEGRATOR_HDR_CTRL_BIG_ENDIAN 0x20
  110. #define INTEGRATOR_HDR_CTRL_FASTBUS 0x40
  111. #define INTEGRATOR_HDR_CTRL_SYNC 0x80
  112. #define INTEGRATOR_HDR_OSC_CORE_10MHz 0x102
  113. #define INTEGRATOR_HDR_OSC_CORE_15MHz 0x107
  114. #define INTEGRATOR_HDR_OSC_CORE_20MHz 0x10C
  115. #define INTEGRATOR_HDR_OSC_CORE_25MHz 0x111
  116. #define INTEGRATOR_HDR_OSC_CORE_30MHz 0x116
  117. #define INTEGRATOR_HDR_OSC_CORE_35MHz 0x11B
  118. #define INTEGRATOR_HDR_OSC_CORE_40MHz 0x120
  119. #define INTEGRATOR_HDR_OSC_CORE_45MHz 0x125
  120. #define INTEGRATOR_HDR_OSC_CORE_50MHz 0x12A
  121. #define INTEGRATOR_HDR_OSC_CORE_55MHz 0x12F
  122. #define INTEGRATOR_HDR_OSC_CORE_60MHz 0x134
  123. #define INTEGRATOR_HDR_OSC_CORE_65MHz 0x139
  124. #define INTEGRATOR_HDR_OSC_CORE_70MHz 0x13E
  125. #define INTEGRATOR_HDR_OSC_CORE_75MHz 0x143
  126. #define INTEGRATOR_HDR_OSC_CORE_80MHz 0x148
  127. #define INTEGRATOR_HDR_OSC_CORE_85MHz 0x14D
  128. #define INTEGRATOR_HDR_OSC_CORE_90MHz 0x152
  129. #define INTEGRATOR_HDR_OSC_CORE_95MHz 0x157
  130. #define INTEGRATOR_HDR_OSC_CORE_100MHz 0x15C
  131. #define INTEGRATOR_HDR_OSC_CORE_105MHz 0x161
  132. #define INTEGRATOR_HDR_OSC_CORE_110MHz 0x166
  133. #define INTEGRATOR_HDR_OSC_CORE_115MHz 0x16B
  134. #define INTEGRATOR_HDR_OSC_CORE_120MHz 0x170
  135. #define INTEGRATOR_HDR_OSC_CORE_125MHz 0x175
  136. #define INTEGRATOR_HDR_OSC_CORE_130MHz 0x17A
  137. #define INTEGRATOR_HDR_OSC_CORE_135MHz 0x17F
  138. #define INTEGRATOR_HDR_OSC_CORE_140MHz 0x184
  139. #define INTEGRATOR_HDR_OSC_CORE_145MHz 0x189
  140. #define INTEGRATOR_HDR_OSC_CORE_150MHz 0x18E
  141. #define INTEGRATOR_HDR_OSC_CORE_155MHz 0x193
  142. #define INTEGRATOR_HDR_OSC_CORE_160MHz 0x198
  143. #define INTEGRATOR_HDR_OSC_CORE_MASK 0x7FF
  144. #define INTEGRATOR_HDR_OSC_MEM_10MHz 0x10C000
  145. #define INTEGRATOR_HDR_OSC_MEM_15MHz 0x116000
  146. #define INTEGRATOR_HDR_OSC_MEM_20MHz 0x120000
  147. #define INTEGRATOR_HDR_OSC_MEM_25MHz 0x12A000
  148. #define INTEGRATOR_HDR_OSC_MEM_30MHz 0x134000
  149. #define INTEGRATOR_HDR_OSC_MEM_33MHz 0x13A000
  150. #define INTEGRATOR_HDR_OSC_MEM_40MHz 0x148000
  151. #define INTEGRATOR_HDR_OSC_MEM_50MHz 0x15C000
  152. #define INTEGRATOR_HDR_OSC_MEM_60MHz 0x170000
  153. #define INTEGRATOR_HDR_OSC_MEM_66MHz 0x17C000
  154. #define INTEGRATOR_HDR_OSC_MEM_MASK 0x7FF000
  155. #define INTEGRATOR_HDR_OSC_BUS_MODE_CM7x0 0x0
  156. #define INTEGRATOR_HDR_OSC_BUS_MODE_CM9x0 0x0800000
  157. #define INTEGRATOR_HDR_OSC_BUS_MODE_CM9x6 0x1000000
  158. #define INTEGRATOR_HDR_OSC_BUS_MODE_CM10x00 0x1800000
  159. #define INTEGRATOR_HDR_OSC_BUS_MODE_MASK 0x1800000
  160. #define INTEGRATOR_HDR_SDRAM_SPD_OK (1 << 5)
  161. /*
  162. * Integrator system registers
  163. */
  164. /*
  165. * System Controller
  166. */
  167. #define INTEGRATOR_SC_ID_OFFSET 0x00
  168. #define INTEGRATOR_SC_OSC_OFFSET 0x04
  169. #define INTEGRATOR_SC_CTRLS_OFFSET 0x08
  170. #define INTEGRATOR_SC_CTRLC_OFFSET 0x0C
  171. #define INTEGRATOR_SC_DEC_OFFSET 0x10
  172. #define INTEGRATOR_SC_ARB_OFFSET 0x14
  173. #define INTEGRATOR_SC_LOCK_OFFSET 0x1C
  174. #define INTEGRATOR_SC_BASE 0x11000000
  175. #define INTEGRATOR_SC_ID (INTEGRATOR_SC_BASE + INTEGRATOR_SC_ID_OFFSET)
  176. #define INTEGRATOR_SC_OSC (INTEGRATOR_SC_BASE + INTEGRATOR_SC_OSC_OFFSET)
  177. #define INTEGRATOR_SC_CTRLS (INTEGRATOR_SC_BASE + INTEGRATOR_SC_CTRLS_OFFSET)
  178. #define INTEGRATOR_SC_CTRLC (INTEGRATOR_SC_BASE + INTEGRATOR_SC_CTRLC_OFFSET)
  179. #define INTEGRATOR_SC_DEC (INTEGRATOR_SC_BASE + INTEGRATOR_SC_DEC_OFFSET)
  180. #define INTEGRATOR_SC_ARB (INTEGRATOR_SC_BASE + INTEGRATOR_SC_ARB_OFFSET)
  181. #define INTEGRATOR_SC_PCIENABLE (INTEGRATOR_SC_BASE + INTEGRATOR_SC_PCIENABLE_OFFSET)
  182. #define INTEGRATOR_SC_LOCK (INTEGRATOR_SC_BASE + INTEGRATOR_SC_LOCK_OFFSET)
  183. #define INTEGRATOR_SC_OSC_SYS_10MHz 0x20
  184. #define INTEGRATOR_SC_OSC_SYS_15MHz 0x34
  185. #define INTEGRATOR_SC_OSC_SYS_20MHz 0x48
  186. #define INTEGRATOR_SC_OSC_SYS_25MHz 0x5C
  187. #define INTEGRATOR_SC_OSC_SYS_33MHz 0x7C
  188. #define INTEGRATOR_SC_OSC_SYS_MASK 0xFF
  189. #define INTEGRATOR_SC_OSC_PCI_25MHz 0x100
  190. #define INTEGRATOR_SC_OSC_PCI_33MHz 0x0
  191. #define INTEGRATOR_SC_OSC_PCI_MASK 0x100
  192. #define INTEGRATOR_SC_CTRL_SOFTRST (1 << 0)
  193. #define INTEGRATOR_SC_CTRL_nFLVPPEN (1 << 1)
  194. #define INTEGRATOR_SC_CTRL_nFLWP (1 << 2)
  195. #define INTEGRATOR_SC_CTRL_URTS0 (1 << 4)
  196. #define INTEGRATOR_SC_CTRL_UDTR0 (1 << 5)
  197. #define INTEGRATOR_SC_CTRL_URTS1 (1 << 6)
  198. #define INTEGRATOR_SC_CTRL_UDTR1 (1 << 7)
  199. /*
  200. * External Bus Interface
  201. */
  202. #define INTEGRATOR_EBI_BASE 0x12000000
  203. #define INTEGRATOR_EBI_CSR0_OFFSET 0x00
  204. #define INTEGRATOR_EBI_CSR1_OFFSET 0x04
  205. #define INTEGRATOR_EBI_CSR2_OFFSET 0x08
  206. #define INTEGRATOR_EBI_CSR3_OFFSET 0x0C
  207. #define INTEGRATOR_EBI_LOCK_OFFSET 0x20
  208. #define INTEGRATOR_EBI_CSR0 (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR0_OFFSET)
  209. #define INTEGRATOR_EBI_CSR1 (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET)
  210. #define INTEGRATOR_EBI_CSR2 (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR2_OFFSET)
  211. #define INTEGRATOR_EBI_CSR3 (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_CSR3_OFFSET)
  212. #define INTEGRATOR_EBI_LOCK (INTEGRATOR_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET)
  213. #define INTEGRATOR_EBI_8_BIT 0x00
  214. #define INTEGRATOR_EBI_16_BIT 0x01
  215. #define INTEGRATOR_EBI_32_BIT 0x02
  216. #define INTEGRATOR_EBI_WRITE_ENABLE 0x04
  217. #define INTEGRATOR_EBI_SYNC 0x08
  218. #define INTEGRATOR_EBI_WS_2 0x00
  219. #define INTEGRATOR_EBI_WS_3 0x10
  220. #define INTEGRATOR_EBI_WS_4 0x20
  221. #define INTEGRATOR_EBI_WS_5 0x30
  222. #define INTEGRATOR_EBI_WS_6 0x40
  223. #define INTEGRATOR_EBI_WS_7 0x50
  224. #define INTEGRATOR_EBI_WS_8 0x60
  225. #define INTEGRATOR_EBI_WS_9 0x70
  226. #define INTEGRATOR_EBI_WS_10 0x80
  227. #define INTEGRATOR_EBI_WS_11 0x90
  228. #define INTEGRATOR_EBI_WS_12 0xA0
  229. #define INTEGRATOR_EBI_WS_13 0xB0
  230. #define INTEGRATOR_EBI_WS_14 0xC0
  231. #define INTEGRATOR_EBI_WS_15 0xD0
  232. #define INTEGRATOR_EBI_WS_16 0xE0
  233. #define INTEGRATOR_EBI_WS_17 0xF0
  234. #define INTEGRATOR_CT_BASE 0x13000000 /* Counter/Timers */
  235. #define INTEGRATOR_IC_BASE 0x14000000 /* Interrupt Controller */
  236. #define INTEGRATOR_RTC_BASE 0x15000000 /* Real Time Clock */
  237. #define INTEGRATOR_UART0_BASE 0x16000000 /* UART 0 */
  238. #define INTEGRATOR_UART1_BASE 0x17000000 /* UART 1 */
  239. #define INTEGRATOR_KBD_BASE 0x18000000 /* Keyboard */
  240. #define INTEGRATOR_MOUSE_BASE 0x19000000 /* Mouse */
  241. /*
  242. * LED's & Switches
  243. */
  244. #define INTEGRATOR_DBG_ALPHA_OFFSET 0x00
  245. #define INTEGRATOR_DBG_LEDS_OFFSET 0x04
  246. #define INTEGRATOR_DBG_SWITCH_OFFSET 0x08
  247. #define INTEGRATOR_DBG_BASE 0x1A000000
  248. #define INTEGRATOR_DBG_ALPHA (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_ALPHA_OFFSET)
  249. #define INTEGRATOR_DBG_LEDS (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_LEDS_OFFSET)
  250. #define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET)
  251. #define INTEGRATOR_AP_GPIO_BASE 0x1B000000 /* GPIO */
  252. #define INTEGRATOR_CP_MMC_BASE 0x1C000000 /* MMC */
  253. #define INTEGRATOR_CP_AACI_BASE 0x1D000000 /* AACI */
  254. #define INTEGRATOR_CP_ETH_BASE 0xC8000000 /* Ethernet */
  255. #define INTEGRATOR_CP_GPIO_BASE 0xC9000000 /* GPIO */
  256. #define INTEGRATOR_CP_SIC_BASE 0xCA000000 /* SIC */
  257. #define INTEGRATOR_CP_CTL_BASE 0xCB000000 /* CP system control */
  258. /* PS2 Keyboard interface */
  259. #define KMI0_BASE INTEGRATOR_KBD_BASE
  260. /* PS2 Mouse interface */
  261. #define KMI1_BASE INTEGRATOR_MOUSE_BASE
  262. /*
  263. * Integrator Interrupt Controllers
  264. *
  265. *
  266. * Offsets from interrupt controller base
  267. *
  268. * System Controller interrupt controller base is
  269. *
  270. * INTEGRATOR_IC_BASE + (header_number << 6)
  271. *
  272. * Core Module interrupt controller base is
  273. *
  274. * INTEGRATOR_HDR_IC
  275. */
  276. #define IRQ_STATUS 0
  277. #define IRQ_RAW_STATUS 0x04
  278. #define IRQ_ENABLE 0x08
  279. #define IRQ_ENABLE_SET 0x08
  280. #define IRQ_ENABLE_CLEAR 0x0C
  281. #define INT_SOFT_SET 0x10
  282. #define INT_SOFT_CLEAR 0x14
  283. #define FIQ_STATUS 0x20
  284. #define FIQ_RAW_STATUS 0x24
  285. #define FIQ_ENABLE 0x28
  286. #define FIQ_ENABLE_SET 0x28
  287. #define FIQ_ENABLE_CLEAR 0x2C
  288. /*
  289. * LED's
  290. */
  291. #define GREEN_LED 0x01
  292. #define YELLOW_LED 0x02
  293. #define RED_LED 0x04
  294. #define GREEN_LED_2 0x08
  295. #define ALL_LEDS 0x0F
  296. #define LED_BANK INTEGRATOR_DBG_LEDS
  297. /*
  298. * Timer definitions
  299. *
  300. * Only use timer 1 & 2
  301. * (both run at 24MHz and will need the clock divider set to 16).
  302. *
  303. * Timer 0 runs at bus frequency
  304. */
  305. #define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE
  306. #define INTEGRATOR_TIMER1_BASE (INTEGRATOR_CT_BASE + 0x100)
  307. #define INTEGRATOR_TIMER2_BASE (INTEGRATOR_CT_BASE + 0x200)
  308. #define INTEGRATOR_CSR_BASE 0x10000000
  309. #define INTEGRATOR_CSR_SIZE 0x10000000
  310. #endif /* INTEGRATOR_HARDWARE_H */