msp_regs.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. /*
  2. * Defines for the address space, registers and register configuration
  3. * (bit masks, access macros etc) for the PMC-Sierra line of MSP products.
  4. * This file contains addess maps for all the devices in the line of
  5. * products but only has register definitions and configuration masks for
  6. * registers which aren't definitely associated with any device. Things
  7. * like clock settings, reset access, the ELB etc. Individual device
  8. * drivers will reference the appropriate XXX_BASE value defined here
  9. * and have individual registers offset from that.
  10. *
  11. * Copyright (C) 2005-2007 PMC-Sierra, Inc. All rights reserved.
  12. * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com
  13. *
  14. * ########################################################################
  15. *
  16. * This program is free software; you can distribute it and/or modify it
  17. * under the terms of the GNU General Public License (Version 2) as
  18. * published by the Free Software Foundation.
  19. *
  20. * This program is distributed in the hope it will be useful, but WITHOUT
  21. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  22. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  23. * for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License along
  26. * with this program; if not, write to the Free Software Foundation, Inc.,
  27. * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  28. *
  29. * ########################################################################
  30. */
  31. #include <asm/addrspace.h>
  32. #include <linux/types.h>
  33. #ifndef _ASM_MSP_REGS_H
  34. #define _ASM_MSP_REGS_H
  35. /*
  36. ########################################################################
  37. # Address space and device base definitions #
  38. ########################################################################
  39. */
  40. /*
  41. ***************************************************************************
  42. * System Logic and Peripherals (ELB, UART0, etc) device address space *
  43. ***************************************************************************
  44. */
  45. #define MSP_SLP_BASE 0x1c000000
  46. /* System Logic and Peripherals */
  47. #define MSP_RST_BASE (MSP_SLP_BASE + 0x10)
  48. /* System reset register base */
  49. #define MSP_RST_SIZE 0x0C /* System reset register space */
  50. #define MSP_WTIMER_BASE (MSP_SLP_BASE + 0x04C)
  51. /* watchdog timer base */
  52. #define MSP_ITIMER_BASE (MSP_SLP_BASE + 0x054)
  53. /* internal timer base */
  54. #define MSP_UART0_BASE (MSP_SLP_BASE + 0x100)
  55. /* UART0 controller base */
  56. #define MSP_BCPY_CTRL_BASE (MSP_SLP_BASE + 0x120)
  57. /* Block Copy controller base */
  58. #define MSP_BCPY_DESC_BASE (MSP_SLP_BASE + 0x160)
  59. /* Block Copy descriptor base */
  60. /*
  61. ***************************************************************************
  62. * PCI address space *
  63. ***************************************************************************
  64. */
  65. #define MSP_PCI_BASE 0x19000000
  66. /*
  67. ***************************************************************************
  68. * MSbus device address space *
  69. ***************************************************************************
  70. */
  71. #define MSP_MSB_BASE 0x18000000
  72. /* MSbus address start */
  73. #define MSP_PER_BASE (MSP_MSB_BASE + 0x400000)
  74. /* Peripheral device registers */
  75. #define MSP_MAC0_BASE (MSP_MSB_BASE + 0x600000)
  76. /* MAC A device registers */
  77. #define MSP_MAC1_BASE (MSP_MSB_BASE + 0x700000)
  78. /* MAC B device registers */
  79. #define MSP_MAC_SIZE 0xE0 /* MAC register space */
  80. #define MSP_SEC_BASE (MSP_MSB_BASE + 0x800000)
  81. /* Security Engine registers */
  82. #define MSP_MAC2_BASE (MSP_MSB_BASE + 0x900000)
  83. /* MAC C device registers */
  84. #define MSP_ADSL2_BASE (MSP_MSB_BASE + 0xA80000)
  85. /* ADSL2 device registers */
  86. #define MSP_USB0_BASE (MSP_MSB_BASE + 0xB00000)
  87. /* USB0 device registers */
  88. #define MSP_USB1_BASE (MSP_MSB_BASE + 0x300000)
  89. /* USB1 device registers */
  90. #define MSP_CPUIF_BASE (MSP_MSB_BASE + 0xC00000)
  91. /* CPU interface registers */
  92. /* Devices within the MSbus peripheral block */
  93. #define MSP_UART1_BASE (MSP_PER_BASE + 0x030)
  94. /* UART1 controller base */
  95. #define MSP_SPI_BASE (MSP_PER_BASE + 0x058)
  96. /* SPI/MPI control registers */
  97. #define MSP_TWI_BASE (MSP_PER_BASE + 0x090)
  98. /* Two-wire control registers */
  99. #define MSP_PTIMER_BASE (MSP_PER_BASE + 0x0F0)
  100. /* Programmable timer control */
  101. /*
  102. ***************************************************************************
  103. * Physical Memory configuration address space *
  104. ***************************************************************************
  105. */
  106. #define MSP_MEM_CFG_BASE 0x17f00000
  107. #define MSP_MEM_INDIRECT_CTL_10 0x10
  108. /*
  109. * Notes:
  110. * 1) The SPI registers are split into two blocks, one offset from the
  111. * MSP_SPI_BASE by 0x00 and the other offset from the MSP_SPI_BASE by
  112. * 0x68. The SPI driver definitions for the register must be aware
  113. * of this.
  114. * 2) The block copy engine register are divided into two regions, one
  115. * for the control/configuration of the engine proper and one for the
  116. * values of the descriptors used in the copy process. These have
  117. * different base defines (CTRL_BASE vs DESC_BASE)
  118. * 3) These constants are for physical addresses which means that they
  119. * work correctly with "ioremap" and friends. This means that device
  120. * drivers will need to remap these addresses using ioremap and perhaps
  121. * the readw/writew macros. Or they could use the regptr() macro
  122. * defined below, but the readw/writew calls are the correct thing.
  123. * 4) The UARTs have an additional status register offset from the base
  124. * address. This register isn't used in the standard 8250 driver but
  125. * may be used in other software. Consult the hardware datasheet for
  126. * offset details.
  127. * 5) For some unknown reason the security engine (MSP_SEC_BASE) registers
  128. * start at an offset of 0x84 from the base address but the block of
  129. * registers before this is reserved for the security engine. The
  130. * driver will have to be aware of this but it makes the register
  131. * definitions line up better with the documentation.
  132. */
  133. /*
  134. ########################################################################
  135. # System register definitions. Not associated with a specific device #
  136. ########################################################################
  137. */
  138. /*
  139. * This macro maps the physical register number into uncached space
  140. * and (for C code) casts it into a u32 pointer so it can be dereferenced
  141. * Normally these would be accessed with ioremap and readX/writeX, but
  142. * these are convenient for a lot of internal kernel code.
  143. */
  144. #ifdef __ASSEMBLER__
  145. #define regptr(addr) (KSEG1ADDR(addr))
  146. #else
  147. #define regptr(addr) ((volatile u32 *const)(KSEG1ADDR(addr)))
  148. #endif
  149. /*
  150. ***************************************************************************
  151. * System Logic and Peripherals (RESET, ELB, etc) registers *
  152. ***************************************************************************
  153. */
  154. /* System Control register definitions */
  155. #define DEV_ID_REG regptr(MSP_SLP_BASE + 0x00)
  156. /* Device-ID RO */
  157. #define FWR_ID_REG regptr(MSP_SLP_BASE + 0x04)
  158. /* Firmware-ID Register RW */
  159. #define SYS_ID_REG0 regptr(MSP_SLP_BASE + 0x08)
  160. /* System-ID Register-0 RW */
  161. #define SYS_ID_REG1 regptr(MSP_SLP_BASE + 0x0C)
  162. /* System-ID Register-1 RW */
  163. /* System Reset register definitions */
  164. #define RST_STS_REG regptr(MSP_SLP_BASE + 0x10)
  165. /* System Reset Status RO */
  166. #define RST_SET_REG regptr(MSP_SLP_BASE + 0x14)
  167. /* System Set Reset WO */
  168. #define RST_CLR_REG regptr(MSP_SLP_BASE + 0x18)
  169. /* System Clear Reset WO */
  170. /* System Clock Registers */
  171. #define PCI_SLP_REG regptr(MSP_SLP_BASE + 0x1C)
  172. /* PCI clock generator RW */
  173. #define URT_SLP_REG regptr(MSP_SLP_BASE + 0x20)
  174. /* UART clock generator RW */
  175. /* reserved (MSP_SLP_BASE + 0x24) */
  176. /* reserved (MSP_SLP_BASE + 0x28) */
  177. #define PLL1_SLP_REG regptr(MSP_SLP_BASE + 0x2C)
  178. /* PLL1 clock generator RW */
  179. #define PLL0_SLP_REG regptr(MSP_SLP_BASE + 0x30)
  180. /* PLL0 clock generator RW */
  181. #define MIPS_SLP_REG regptr(MSP_SLP_BASE + 0x34)
  182. /* MIPS clock generator RW */
  183. #define VE_SLP_REG regptr(MSP_SLP_BASE + 0x38)
  184. /* Voice Eng clock generator RW */
  185. /* reserved (MSP_SLP_BASE + 0x3C) */
  186. #define MSB_SLP_REG regptr(MSP_SLP_BASE + 0x40)
  187. /* MS-Bus clock generator RW */
  188. #define SMAC_SLP_REG regptr(MSP_SLP_BASE + 0x44)
  189. /* Sec & MAC clock generator RW */
  190. #define PERF_SLP_REG regptr(MSP_SLP_BASE + 0x48)
  191. /* Per & TDM clock generator RW */
  192. /* Interrupt Controller Registers */
  193. #define SLP_INT_STS_REG regptr(MSP_SLP_BASE + 0x70)
  194. /* Interrupt status register RW */
  195. #define SLP_INT_MSK_REG regptr(MSP_SLP_BASE + 0x74)
  196. /* Interrupt enable/mask RW */
  197. #define SE_MBOX_REG regptr(MSP_SLP_BASE + 0x78)
  198. /* Security Engine mailbox RW */
  199. #define VE_MBOX_REG regptr(MSP_SLP_BASE + 0x7C)
  200. /* Voice Engine mailbox RW */
  201. /* ELB Controller Registers */
  202. #define CS0_CNFG_REG regptr(MSP_SLP_BASE + 0x80)
  203. /* ELB CS0 Configuration Reg */
  204. #define CS0_ADDR_REG regptr(MSP_SLP_BASE + 0x84)
  205. /* ELB CS0 Base Address Reg */
  206. #define CS0_MASK_REG regptr(MSP_SLP_BASE + 0x88)
  207. /* ELB CS0 Mask Register */
  208. #define CS0_ACCESS_REG regptr(MSP_SLP_BASE + 0x8C)
  209. /* ELB CS0 access register */
  210. #define CS1_CNFG_REG regptr(MSP_SLP_BASE + 0x90)
  211. /* ELB CS1 Configuration Reg */
  212. #define CS1_ADDR_REG regptr(MSP_SLP_BASE + 0x94)
  213. /* ELB CS1 Base Address Reg */
  214. #define CS1_MASK_REG regptr(MSP_SLP_BASE + 0x98)
  215. /* ELB CS1 Mask Register */
  216. #define CS1_ACCESS_REG regptr(MSP_SLP_BASE + 0x9C)
  217. /* ELB CS1 access register */
  218. #define CS2_CNFG_REG regptr(MSP_SLP_BASE + 0xA0)
  219. /* ELB CS2 Configuration Reg */
  220. #define CS2_ADDR_REG regptr(MSP_SLP_BASE + 0xA4)
  221. /* ELB CS2 Base Address Reg */
  222. #define CS2_MASK_REG regptr(MSP_SLP_BASE + 0xA8)
  223. /* ELB CS2 Mask Register */
  224. #define CS2_ACCESS_REG regptr(MSP_SLP_BASE + 0xAC)
  225. /* ELB CS2 access register */
  226. #define CS3_CNFG_REG regptr(MSP_SLP_BASE + 0xB0)
  227. /* ELB CS3 Configuration Reg */
  228. #define CS3_ADDR_REG regptr(MSP_SLP_BASE + 0xB4)
  229. /* ELB CS3 Base Address Reg */
  230. #define CS3_MASK_REG regptr(MSP_SLP_BASE + 0xB8)
  231. /* ELB CS3 Mask Register */
  232. #define CS3_ACCESS_REG regptr(MSP_SLP_BASE + 0xBC)
  233. /* ELB CS3 access register */
  234. #define CS4_CNFG_REG regptr(MSP_SLP_BASE + 0xC0)
  235. /* ELB CS4 Configuration Reg */
  236. #define CS4_ADDR_REG regptr(MSP_SLP_BASE + 0xC4)
  237. /* ELB CS4 Base Address Reg */
  238. #define CS4_MASK_REG regptr(MSP_SLP_BASE + 0xC8)
  239. /* ELB CS4 Mask Register */
  240. #define CS4_ACCESS_REG regptr(MSP_SLP_BASE + 0xCC)
  241. /* ELB CS4 access register */
  242. #define CS5_CNFG_REG regptr(MSP_SLP_BASE + 0xD0)
  243. /* ELB CS5 Configuration Reg */
  244. #define CS5_ADDR_REG regptr(MSP_SLP_BASE + 0xD4)
  245. /* ELB CS5 Base Address Reg */
  246. #define CS5_MASK_REG regptr(MSP_SLP_BASE + 0xD8)
  247. /* ELB CS5 Mask Register */
  248. #define CS5_ACCESS_REG regptr(MSP_SLP_BASE + 0xDC)
  249. /* ELB CS5 access register */
  250. /* reserved 0xE0 - 0xE8 */
  251. #define ELB_1PC_EN_REG regptr(MSP_SLP_BASE + 0xEC)
  252. /* ELB single PC card detect */
  253. /* reserved 0xF0 - 0xF8 */
  254. #define ELB_CLK_CFG_REG regptr(MSP_SLP_BASE + 0xFC)
  255. /* SDRAM read/ELB timing Reg */
  256. /* Extended UART status registers */
  257. #define UART0_STATUS_REG regptr(MSP_UART0_BASE + 0x0c0)
  258. /* UART Status Register 0 */
  259. #define UART1_STATUS_REG regptr(MSP_UART1_BASE + 0x170)
  260. /* UART Status Register 1 */
  261. /* Performance monitoring registers */
  262. #define PERF_MON_CTRL_REG regptr(MSP_SLP_BASE + 0x140)
  263. /* Performance monitor control */
  264. #define PERF_MON_CLR_REG regptr(MSP_SLP_BASE + 0x144)
  265. /* Performance monitor clear */
  266. #define PERF_MON_CNTH_REG regptr(MSP_SLP_BASE + 0x148)
  267. /* Perf monitor counter high */
  268. #define PERF_MON_CNTL_REG regptr(MSP_SLP_BASE + 0x14C)
  269. /* Perf monitor counter low */
  270. /* System control registers */
  271. #define SYS_CTRL_REG regptr(MSP_SLP_BASE + 0x150)
  272. /* System control register */
  273. #define SYS_ERR1_REG regptr(MSP_SLP_BASE + 0x154)
  274. /* System Error status 1 */
  275. #define SYS_ERR2_REG regptr(MSP_SLP_BASE + 0x158)
  276. /* System Error status 2 */
  277. #define SYS_INT_CFG_REG regptr(MSP_SLP_BASE + 0x15C)
  278. /* System Interrupt config */
  279. /* Voice Engine Memory configuration */
  280. #define VE_MEM_REG regptr(MSP_SLP_BASE + 0x17C)
  281. /* Voice engine memory config */
  282. /* CPU/SLP Error Status registers */
  283. #define CPU_ERR1_REG regptr(MSP_SLP_BASE + 0x180)
  284. /* CPU/SLP Error status 1 */
  285. #define CPU_ERR2_REG regptr(MSP_SLP_BASE + 0x184)
  286. /* CPU/SLP Error status 1 */
  287. /* Extended GPIO registers */
  288. #define EXTENDED_GPIO1_REG regptr(MSP_SLP_BASE + 0x188)
  289. #define EXTENDED_GPIO2_REG regptr(MSP_SLP_BASE + 0x18c)
  290. #define EXTENDED_GPIO_REG EXTENDED_GPIO1_REG
  291. /* Backward-compatibility */
  292. /* System Error registers */
  293. #define SLP_ERR_STS_REG regptr(MSP_SLP_BASE + 0x190)
  294. /* Int status for SLP errors */
  295. #define SLP_ERR_MSK_REG regptr(MSP_SLP_BASE + 0x194)
  296. /* Int mask for SLP errors */
  297. #define SLP_ELB_ERST_REG regptr(MSP_SLP_BASE + 0x198)
  298. /* External ELB reset */
  299. #define SLP_BOOT_STS_REG regptr(MSP_SLP_BASE + 0x19C)
  300. /* Boot Status */
  301. /* Extended ELB addressing */
  302. #define CS0_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A0)
  303. /* CS0 Extended address */
  304. #define CS1_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A4)
  305. /* CS1 Extended address */
  306. #define CS2_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1A8)
  307. /* CS2 Extended address */
  308. #define CS3_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1AC)
  309. /* CS3 Extended address */
  310. /* reserved 0x1B0 */
  311. #define CS5_EXT_ADDR_REG regptr(MSP_SLP_BASE + 0x1B4)
  312. /* CS5 Extended address */
  313. /* PLL Adjustment registers */
  314. #define PLL_LOCK_REG regptr(MSP_SLP_BASE + 0x200)
  315. /* PLL0 lock status */
  316. #define PLL_ARST_REG regptr(MSP_SLP_BASE + 0x204)
  317. /* PLL Analog reset status */
  318. #define PLL0_ADJ_REG regptr(MSP_SLP_BASE + 0x208)
  319. /* PLL0 Adjustment value */
  320. #define PLL1_ADJ_REG regptr(MSP_SLP_BASE + 0x20C)
  321. /* PLL1 Adjustment value */
  322. /*
  323. ***************************************************************************
  324. * Peripheral Register definitions *
  325. ***************************************************************************
  326. */
  327. /* Peripheral status */
  328. #define PER_CTRL_REG regptr(MSP_PER_BASE + 0x50)
  329. /* Peripheral control register */
  330. #define PER_STS_REG regptr(MSP_PER_BASE + 0x54)
  331. /* Peripheral status register */
  332. /* SPI/MPI Registers */
  333. #define SMPI_TX_SZ_REG regptr(MSP_PER_BASE + 0x58)
  334. /* SPI/MPI Tx Size register */
  335. #define SMPI_RX_SZ_REG regptr(MSP_PER_BASE + 0x5C)
  336. /* SPI/MPI Rx Size register */
  337. #define SMPI_CTL_REG regptr(MSP_PER_BASE + 0x60)
  338. /* SPI/MPI Control register */
  339. #define SMPI_MS_REG regptr(MSP_PER_BASE + 0x64)
  340. /* SPI/MPI Chip Select reg */
  341. #define SMPI_CORE_DATA_REG regptr(MSP_PER_BASE + 0xC0)
  342. /* SPI/MPI Core Data reg */
  343. #define SMPI_CORE_CTRL_REG regptr(MSP_PER_BASE + 0xC4)
  344. /* SPI/MPI Core Control reg */
  345. #define SMPI_CORE_STAT_REG regptr(MSP_PER_BASE + 0xC8)
  346. /* SPI/MPI Core Status reg */
  347. #define SMPI_CORE_SSEL_REG regptr(MSP_PER_BASE + 0xCC)
  348. /* SPI/MPI Core Ssel reg */
  349. #define SMPI_FIFO_REG regptr(MSP_PER_BASE + 0xD0)
  350. /* SPI/MPI Data FIFO reg */
  351. /* Peripheral Block Error Registers */
  352. #define PER_ERR_STS_REG regptr(MSP_PER_BASE + 0x70)
  353. /* Error Bit Status Register */
  354. #define PER_ERR_MSK_REG regptr(MSP_PER_BASE + 0x74)
  355. /* Error Bit Mask Register */
  356. #define PER_HDR1_REG regptr(MSP_PER_BASE + 0x78)
  357. /* Error Header 1 Register */
  358. #define PER_HDR2_REG regptr(MSP_PER_BASE + 0x7C)
  359. /* Error Header 2 Register */
  360. /* Peripheral Block Interrupt Registers */
  361. #define PER_INT_STS_REG regptr(MSP_PER_BASE + 0x80)
  362. /* Interrupt status register */
  363. #define PER_INT_MSK_REG regptr(MSP_PER_BASE + 0x84)
  364. /* Interrupt Mask Register */
  365. #define GPIO_INT_STS_REG regptr(MSP_PER_BASE + 0x88)
  366. /* GPIO interrupt status reg */
  367. #define GPIO_INT_MSK_REG regptr(MSP_PER_BASE + 0x8C)
  368. /* GPIO interrupt MASK Reg */
  369. /* POLO GPIO registers */
  370. #define POLO_GPIO_DAT1_REG regptr(MSP_PER_BASE + 0x0E0)
  371. /* Polo GPIO[8:0] data reg */
  372. #define POLO_GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x0E4)
  373. /* Polo GPIO[7:0] config reg */
  374. #define POLO_GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x0E8)
  375. /* Polo GPIO[15:8] config reg */
  376. #define POLO_GPIO_OD1_REG regptr(MSP_PER_BASE + 0x0EC)
  377. /* Polo GPIO[31:0] output drive */
  378. #define POLO_GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x170)
  379. /* Polo GPIO[23:16] config reg */
  380. #define POLO_GPIO_DAT2_REG regptr(MSP_PER_BASE + 0x174)
  381. /* Polo GPIO[15:9] data reg */
  382. #define POLO_GPIO_DAT3_REG regptr(MSP_PER_BASE + 0x178)
  383. /* Polo GPIO[23:16] data reg */
  384. #define POLO_GPIO_DAT4_REG regptr(MSP_PER_BASE + 0x17C)
  385. /* Polo GPIO[31:24] data reg */
  386. #define POLO_GPIO_DAT5_REG regptr(MSP_PER_BASE + 0x180)
  387. /* Polo GPIO[39:32] data reg */
  388. #define POLO_GPIO_DAT6_REG regptr(MSP_PER_BASE + 0x184)
  389. /* Polo GPIO[47:40] data reg */
  390. #define POLO_GPIO_DAT7_REG regptr(MSP_PER_BASE + 0x188)
  391. /* Polo GPIO[54:48] data reg */
  392. #define POLO_GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C)
  393. /* Polo GPIO[31:24] config reg */
  394. #define POLO_GPIO_CFG5_REG regptr(MSP_PER_BASE + 0x190)
  395. /* Polo GPIO[39:32] config reg */
  396. #define POLO_GPIO_CFG6_REG regptr(MSP_PER_BASE + 0x194)
  397. /* Polo GPIO[47:40] config reg */
  398. #define POLO_GPIO_CFG7_REG regptr(MSP_PER_BASE + 0x198)
  399. /* Polo GPIO[54:48] config reg */
  400. #define POLO_GPIO_OD2_REG regptr(MSP_PER_BASE + 0x19C)
  401. /* Polo GPIO[54:32] output drive */
  402. /* Generic GPIO registers */
  403. #define GPIO_DATA1_REG regptr(MSP_PER_BASE + 0x170)
  404. /* GPIO[1:0] data register */
  405. #define GPIO_DATA2_REG regptr(MSP_PER_BASE + 0x174)
  406. /* GPIO[5:2] data register */
  407. #define GPIO_DATA3_REG regptr(MSP_PER_BASE + 0x178)
  408. /* GPIO[9:6] data register */
  409. #define GPIO_DATA4_REG regptr(MSP_PER_BASE + 0x17C)
  410. /* GPIO[15:10] data register */
  411. #define GPIO_CFG1_REG regptr(MSP_PER_BASE + 0x180)
  412. /* GPIO[1:0] config register */
  413. #define GPIO_CFG2_REG regptr(MSP_PER_BASE + 0x184)
  414. /* GPIO[5:2] config register */
  415. #define GPIO_CFG3_REG regptr(MSP_PER_BASE + 0x188)
  416. /* GPIO[9:6] config register */
  417. #define GPIO_CFG4_REG regptr(MSP_PER_BASE + 0x18C)
  418. /* GPIO[15:10] config register */
  419. #define GPIO_OD_REG regptr(MSP_PER_BASE + 0x190)
  420. /* GPIO[15:0] output drive */
  421. /*
  422. ***************************************************************************
  423. * CPU Interface register definitions *
  424. ***************************************************************************
  425. */
  426. #define PCI_FLUSH_REG regptr(MSP_CPUIF_BASE + 0x00)
  427. /* PCI-SDRAM queue flush trigger */
  428. #define OCP_ERR1_REG regptr(MSP_CPUIF_BASE + 0x04)
  429. /* OCP Error Attribute 1 */
  430. #define OCP_ERR2_REG regptr(MSP_CPUIF_BASE + 0x08)
  431. /* OCP Error Attribute 2 */
  432. #define OCP_STS_REG regptr(MSP_CPUIF_BASE + 0x0C)
  433. /* OCP Error Status */
  434. #define CPUIF_PM_REG regptr(MSP_CPUIF_BASE + 0x10)
  435. /* CPU policy configuration */
  436. #define CPUIF_CFG_REG regptr(MSP_CPUIF_BASE + 0x10)
  437. /* Misc configuration options */
  438. /* Central Interrupt Controller Registers */
  439. #define MSP_CIC_BASE (MSP_CPUIF_BASE + 0x8000)
  440. /* Central Interrupt registers */
  441. #define CIC_EXT_CFG_REG regptr(MSP_CIC_BASE + 0x00)
  442. /* External interrupt config */
  443. #define CIC_STS_REG regptr(MSP_CIC_BASE + 0x04)
  444. /* CIC Interrupt Status */
  445. #define CIC_VPE0_MSK_REG regptr(MSP_CIC_BASE + 0x08)
  446. /* VPE0 Interrupt Mask */
  447. #define CIC_VPE1_MSK_REG regptr(MSP_CIC_BASE + 0x0C)
  448. /* VPE1 Interrupt Mask */
  449. #define CIC_TC0_MSK_REG regptr(MSP_CIC_BASE + 0x10)
  450. /* Thread Context 0 Int Mask */
  451. #define CIC_TC1_MSK_REG regptr(MSP_CIC_BASE + 0x14)
  452. /* Thread Context 1 Int Mask */
  453. #define CIC_TC2_MSK_REG regptr(MSP_CIC_BASE + 0x18)
  454. /* Thread Context 2 Int Mask */
  455. #define CIC_TC3_MSK_REG regptr(MSP_CIC_BASE + 0x18)
  456. /* Thread Context 3 Int Mask */
  457. #define CIC_TC4_MSK_REG regptr(MSP_CIC_BASE + 0x18)
  458. /* Thread Context 4 Int Mask */
  459. #define CIC_PCIMSI_STS_REG regptr(MSP_CIC_BASE + 0x18)
  460. #define CIC_PCIMSI_MSK_REG regptr(MSP_CIC_BASE + 0x18)
  461. #define CIC_PCIFLSH_REG regptr(MSP_CIC_BASE + 0x18)
  462. #define CIC_VPE0_SWINT_REG regptr(MSP_CIC_BASE + 0x08)
  463. /*
  464. ***************************************************************************
  465. * Memory controller registers *
  466. ***************************************************************************
  467. */
  468. #define MEM_CFG1_REG regptr(MSP_MEM_CFG_BASE + 0x00)
  469. #define MEM_SS_ADDR regptr(MSP_MEM_CFG_BASE + 0x00)
  470. #define MEM_SS_DATA regptr(MSP_MEM_CFG_BASE + 0x04)
  471. #define MEM_SS_WRITE regptr(MSP_MEM_CFG_BASE + 0x08)
  472. /*
  473. ***************************************************************************
  474. * PCI controller registers *
  475. ***************************************************************************
  476. */
  477. #define PCI_BASE_REG regptr(MSP_PCI_BASE + 0x00)
  478. #define PCI_CONFIG_SPACE_REG regptr(MSP_PCI_BASE + 0x800)
  479. #define PCI_JTAG_DEVID_REG regptr(MSP_SLP_BASE + 0x13c)
  480. /*
  481. ########################################################################
  482. # Register content & macro definitions #
  483. ########################################################################
  484. */
  485. /*
  486. ***************************************************************************
  487. * DEV_ID defines *
  488. ***************************************************************************
  489. */
  490. #define DEV_ID_PCI_DIS (1 << 26) /* Set if PCI disabled */
  491. #define DEV_ID_PCI_HOST (1 << 20) /* Set if PCI host */
  492. #define DEV_ID_SINGLE_PC (1 << 19) /* Set if single PC Card */
  493. #define DEV_ID_FAMILY (0xff << 8) /* family ID code */
  494. #define POLO_ZEUS_SUB_FAMILY (0x7 << 16) /* sub family for Polo/Zeus */
  495. #define MSPFPGA_ID (0x00 << 8) /* you are on your own here */
  496. #define MSP5000_ID (0x50 << 8)
  497. #define MSP4F00_ID (0x4f << 8) /* FPGA version of MSP4200 */
  498. #define MSP4E00_ID (0x4f << 8) /* FPGA version of MSP7120 */
  499. #define MSP4200_ID (0x42 << 8)
  500. #define MSP4000_ID (0x40 << 8)
  501. #define MSP2XXX_ID (0x20 << 8)
  502. #define MSPZEUS_ID (0x10 << 8)
  503. #define MSP2004_SUB_ID (0x0 << 16)
  504. #define MSP2005_SUB_ID (0x1 << 16)
  505. #define MSP2006_SUB_ID (0x1 << 16)
  506. #define MSP2007_SUB_ID (0x2 << 16)
  507. #define MSP2010_SUB_ID (0x3 << 16)
  508. #define MSP2015_SUB_ID (0x4 << 16)
  509. #define MSP2020_SUB_ID (0x5 << 16)
  510. #define MSP2100_SUB_ID (0x6 << 16)
  511. /*
  512. ***************************************************************************
  513. * RESET defines *
  514. ***************************************************************************
  515. */
  516. #define MSP_GR_RST (0x01 << 0) /* Global reset bit */
  517. #define MSP_MR_RST (0x01 << 1) /* MIPS reset bit */
  518. #define MSP_PD_RST (0x01 << 2) /* PVC DMA reset bit */
  519. #define MSP_PP_RST (0x01 << 3) /* PVC reset bit */
  520. /* reserved */
  521. #define MSP_EA_RST (0x01 << 6) /* Mac A reset bit */
  522. #define MSP_EB_RST (0x01 << 7) /* Mac B reset bit */
  523. #define MSP_SE_RST (0x01 << 8) /* Security Eng reset bit */
  524. #define MSP_PB_RST (0x01 << 9) /* Per block reset bit */
  525. #define MSP_EC_RST (0x01 << 10) /* Mac C reset bit */
  526. #define MSP_TW_RST (0x01 << 11) /* TWI reset bit */
  527. #define MSP_SPI_RST (0x01 << 12) /* SPI/MPI reset bit */
  528. #define MSP_U1_RST (0x01 << 13) /* UART1 reset bit */
  529. #define MSP_U0_RST (0x01 << 14) /* UART0 reset bit */
  530. /*
  531. ***************************************************************************
  532. * UART defines *
  533. ***************************************************************************
  534. */
  535. #define MSP_BASE_BAUD 25000000
  536. #define MSP_UART_REG_LEN 0x20
  537. /*
  538. ***************************************************************************
  539. * ELB defines *
  540. ***************************************************************************
  541. */
  542. #define PCCARD_32 0x02 /* Set if is PCCARD 32 (Cardbus) */
  543. #define SINGLE_PCCARD 0x01 /* Set to enable single PC card */
  544. /*
  545. ***************************************************************************
  546. * CIC defines *
  547. ***************************************************************************
  548. */
  549. /* CIC_EXT_CFG_REG */
  550. #define EXT_INT_POL(eirq) (1 << (eirq + 8))
  551. #define EXT_INT_EDGE(eirq) (1 << eirq)
  552. #define CIC_EXT_SET_TRIGGER_LEVEL(reg, eirq) (reg &= ~EXT_INT_EDGE(eirq))
  553. #define CIC_EXT_SET_TRIGGER_EDGE(reg, eirq) (reg |= EXT_INT_EDGE(eirq))
  554. #define CIC_EXT_SET_ACTIVE_HI(reg, eirq) (reg |= EXT_INT_POL(eirq))
  555. #define CIC_EXT_SET_ACTIVE_LO(reg, eirq) (reg &= ~EXT_INT_POL(eirq))
  556. #define CIC_EXT_SET_ACTIVE_RISING CIC_EXT_SET_ACTIVE_HI
  557. #define CIC_EXT_SET_ACTIVE_FALLING CIC_EXT_SET_ACTIVE_LO
  558. #define CIC_EXT_IS_TRIGGER_LEVEL(reg, eirq) \
  559. ((reg & EXT_INT_EDGE(eirq)) == 0)
  560. #define CIC_EXT_IS_TRIGGER_EDGE(reg, eirq) (reg & EXT_INT_EDGE(eirq))
  561. #define CIC_EXT_IS_ACTIVE_HI(reg, eirq) (reg & EXT_INT_POL(eirq))
  562. #define CIC_EXT_IS_ACTIVE_LO(reg, eirq) \
  563. ((reg & EXT_INT_POL(eirq)) == 0)
  564. #define CIC_EXT_IS_ACTIVE_RISING CIC_EXT_IS_ACTIVE_HI
  565. #define CIC_EXT_IS_ACTIVE_FALLING CIC_EXT_IS_ACTIVE_LO
  566. /*
  567. ***************************************************************************
  568. * Memory Controller defines *
  569. ***************************************************************************
  570. */
  571. /* Indirect memory controller registers */
  572. #define DDRC_CFG(n) (n)
  573. #define DDRC_DEBUG(n) (0x04 + n)
  574. #define DDRC_CTL(n) (0x40 + n)
  575. /* Macro to perform DDRC indirect write */
  576. #define DDRC_INDIRECT_WRITE(reg, mask, value) \
  577. ({ \
  578. *MEM_SS_ADDR = (((mask) & 0xf) << 8) | ((reg) & 0xff); \
  579. *MEM_SS_DATA = (value); \
  580. *MEM_SS_WRITE = 1; \
  581. })
  582. /*
  583. ***************************************************************************
  584. * SPI/MPI Mode *
  585. ***************************************************************************
  586. */
  587. #define SPI_MPI_RX_BUSY 0x00008000 /* SPI/MPI Receive Busy */
  588. #define SPI_MPI_FIFO_EMPTY 0x00004000 /* SPI/MPI Fifo Empty */
  589. #define SPI_MPI_TX_BUSY 0x00002000 /* SPI/MPI Transmit Busy */
  590. #define SPI_MPI_FIFO_FULL 0x00001000 /* SPI/MPU FIFO full */
  591. /*
  592. ***************************************************************************
  593. * SPI/MPI Control Register *
  594. ***************************************************************************
  595. */
  596. #define SPI_MPI_RX_START 0x00000004 /* Start receive command */
  597. #define SPI_MPI_FLUSH_Q 0x00000002 /* Flush SPI/MPI Queue */
  598. #define SPI_MPI_TX_START 0x00000001 /* Start Transmit Command */
  599. #endif /* !_ASM_MSP_REGS_H */