sta2x11-mfd.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. /*
  2. * Copyright (c) 2009-2011 Wind River Systems, Inc.
  3. * Copyright (c) 2011 ST Microelectronics (Alessandro Rubini)
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. * See the GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *
  18. * The STMicroelectronics ConneXt (STA2X11) chip has several unrelated
  19. * functions in one PCI endpoint functions. This driver simply
  20. * registers the platform devices in this iomemregion and exports a few
  21. * functions to access common registers
  22. */
  23. #ifndef __STA2X11_MFD_H
  24. #define __STA2X11_MFD_H
  25. #include <linux/types.h>
  26. #include <linux/pci.h>
  27. enum sta2x11_mfd_plat_dev {
  28. sta2x11_sctl = 0,
  29. sta2x11_gpio,
  30. sta2x11_scr,
  31. sta2x11_time,
  32. sta2x11_apbreg,
  33. sta2x11_apb_soc_regs,
  34. sta2x11_vic,
  35. sta2x11_n_mfd_plat_devs,
  36. };
  37. #define STA2X11_MFD_SCTL_NAME "sta2x11-sctl"
  38. #define STA2X11_MFD_GPIO_NAME "sta2x11-gpio"
  39. #define STA2X11_MFD_SCR_NAME "sta2x11-scr"
  40. #define STA2X11_MFD_TIME_NAME "sta2x11-time"
  41. #define STA2X11_MFD_APBREG_NAME "sta2x11-apbreg"
  42. #define STA2X11_MFD_APB_SOC_REGS_NAME "sta2x11-apb-soc-regs"
  43. #define STA2X11_MFD_VIC_NAME "sta2x11-vic"
  44. extern u32
  45. __sta2x11_mfd_mask(struct pci_dev *, u32, u32, u32, enum sta2x11_mfd_plat_dev);
  46. /*
  47. * The MFD PCI block includes the GPIO peripherals and other register blocks.
  48. * For GPIO, we have 32*4 bits (I use "gsta" for "gpio sta2x11".)
  49. */
  50. #define GSTA_GPIO_PER_BLOCK 32
  51. #define GSTA_NR_BLOCKS 4
  52. #define GSTA_NR_GPIO (GSTA_GPIO_PER_BLOCK * GSTA_NR_BLOCKS)
  53. /* Pinconfig is set by the board definition: altfunc, pull-up, pull-down */
  54. struct sta2x11_gpio_pdata {
  55. unsigned pinconfig[GSTA_NR_GPIO];
  56. };
  57. /* Macros below lifted from sh_pfc.h, with minor differences */
  58. #define PINMUX_TYPE_NONE 0
  59. #define PINMUX_TYPE_FUNCTION 1
  60. #define PINMUX_TYPE_OUTPUT_LOW 2
  61. #define PINMUX_TYPE_OUTPUT_HIGH 3
  62. #define PINMUX_TYPE_INPUT 4
  63. #define PINMUX_TYPE_INPUT_PULLUP 5
  64. #define PINMUX_TYPE_INPUT_PULLDOWN 6
  65. /* Give names to GPIO pins, like PXA does, taken from the manual */
  66. #define STA2X11_GPIO0 0
  67. #define STA2X11_GPIO1 1
  68. #define STA2X11_GPIO2 2
  69. #define STA2X11_GPIO3 3
  70. #define STA2X11_GPIO4 4
  71. #define STA2X11_GPIO5 5
  72. #define STA2X11_GPIO6 6
  73. #define STA2X11_GPIO7 7
  74. #define STA2X11_GPIO8_RGBOUT_RED7 8
  75. #define STA2X11_GPIO9_RGBOUT_RED6 9
  76. #define STA2X11_GPIO10_RGBOUT_RED5 10
  77. #define STA2X11_GPIO11_RGBOUT_RED4 11
  78. #define STA2X11_GPIO12_RGBOUT_RED3 12
  79. #define STA2X11_GPIO13_RGBOUT_RED2 13
  80. #define STA2X11_GPIO14_RGBOUT_RED1 14
  81. #define STA2X11_GPIO15_RGBOUT_RED0 15
  82. #define STA2X11_GPIO16_RGBOUT_GREEN7 16
  83. #define STA2X11_GPIO17_RGBOUT_GREEN6 17
  84. #define STA2X11_GPIO18_RGBOUT_GREEN5 18
  85. #define STA2X11_GPIO19_RGBOUT_GREEN4 19
  86. #define STA2X11_GPIO20_RGBOUT_GREEN3 20
  87. #define STA2X11_GPIO21_RGBOUT_GREEN2 21
  88. #define STA2X11_GPIO22_RGBOUT_GREEN1 22
  89. #define STA2X11_GPIO23_RGBOUT_GREEN0 23
  90. #define STA2X11_GPIO24_RGBOUT_BLUE7 24
  91. #define STA2X11_GPIO25_RGBOUT_BLUE6 25
  92. #define STA2X11_GPIO26_RGBOUT_BLUE5 26
  93. #define STA2X11_GPIO27_RGBOUT_BLUE4 27
  94. #define STA2X11_GPIO28_RGBOUT_BLUE3 28
  95. #define STA2X11_GPIO29_RGBOUT_BLUE2 29
  96. #define STA2X11_GPIO30_RGBOUT_BLUE1 30
  97. #define STA2X11_GPIO31_RGBOUT_BLUE0 31
  98. #define STA2X11_GPIO32_RGBOUT_VSYNCH 32
  99. #define STA2X11_GPIO33_RGBOUT_HSYNCH 33
  100. #define STA2X11_GPIO34_RGBOUT_DEN 34
  101. #define STA2X11_GPIO35_ETH_CRS_DV 35
  102. #define STA2X11_GPIO36_ETH_TXD1 36
  103. #define STA2X11_GPIO37_ETH_TXD0 37
  104. #define STA2X11_GPIO38_ETH_TX_EN 38
  105. #define STA2X11_GPIO39_MDIO 39
  106. #define STA2X11_GPIO40_ETH_REF_CLK 40
  107. #define STA2X11_GPIO41_ETH_RXD1 41
  108. #define STA2X11_GPIO42_ETH_RXD0 42
  109. #define STA2X11_GPIO43_MDC 43
  110. #define STA2X11_GPIO44_CAN_TX 44
  111. #define STA2X11_GPIO45_CAN_RX 45
  112. #define STA2X11_GPIO46_MLB_DAT 46
  113. #define STA2X11_GPIO47_MLB_SIG 47
  114. #define STA2X11_GPIO48_SPI0_CLK 48
  115. #define STA2X11_GPIO49_SPI0_TXD 49
  116. #define STA2X11_GPIO50_SPI0_RXD 50
  117. #define STA2X11_GPIO51_SPI0_FRM 51
  118. #define STA2X11_GPIO52_SPI1_CLK 52
  119. #define STA2X11_GPIO53_SPI1_TXD 53
  120. #define STA2X11_GPIO54_SPI1_RXD 54
  121. #define STA2X11_GPIO55_SPI1_FRM 55
  122. #define STA2X11_GPIO56_SPI2_CLK 56
  123. #define STA2X11_GPIO57_SPI2_TXD 57
  124. #define STA2X11_GPIO58_SPI2_RXD 58
  125. #define STA2X11_GPIO59_SPI2_FRM 59
  126. #define STA2X11_GPIO60_I2C0_SCL 60
  127. #define STA2X11_GPIO61_I2C0_SDA 61
  128. #define STA2X11_GPIO62_I2C1_SCL 62
  129. #define STA2X11_GPIO63_I2C1_SDA 63
  130. #define STA2X11_GPIO64_I2C2_SCL 64
  131. #define STA2X11_GPIO65_I2C2_SDA 65
  132. #define STA2X11_GPIO66_I2C3_SCL 66
  133. #define STA2X11_GPIO67_I2C3_SDA 67
  134. #define STA2X11_GPIO68_MSP0_RCK 68
  135. #define STA2X11_GPIO69_MSP0_RXD 69
  136. #define STA2X11_GPIO70_MSP0_RFS 70
  137. #define STA2X11_GPIO71_MSP0_TCK 71
  138. #define STA2X11_GPIO72_MSP0_TXD 72
  139. #define STA2X11_GPIO73_MSP0_TFS 73
  140. #define STA2X11_GPIO74_MSP0_SCK 74
  141. #define STA2X11_GPIO75_MSP1_CK 75
  142. #define STA2X11_GPIO76_MSP1_RXD 76
  143. #define STA2X11_GPIO77_MSP1_FS 77
  144. #define STA2X11_GPIO78_MSP1_TXD 78
  145. #define STA2X11_GPIO79_MSP2_CK 79
  146. #define STA2X11_GPIO80_MSP2_RXD 80
  147. #define STA2X11_GPIO81_MSP2_FS 81
  148. #define STA2X11_GPIO82_MSP2_TXD 82
  149. #define STA2X11_GPIO83_MSP3_CK 83
  150. #define STA2X11_GPIO84_MSP3_RXD 84
  151. #define STA2X11_GPIO85_MSP3_FS 85
  152. #define STA2X11_GPIO86_MSP3_TXD 86
  153. #define STA2X11_GPIO87_MSP4_CK 87
  154. #define STA2X11_GPIO88_MSP4_RXD 88
  155. #define STA2X11_GPIO89_MSP4_FS 89
  156. #define STA2X11_GPIO90_MSP4_TXD 90
  157. #define STA2X11_GPIO91_MSP5_CK 91
  158. #define STA2X11_GPIO92_MSP5_RXD 92
  159. #define STA2X11_GPIO93_MSP5_FS 93
  160. #define STA2X11_GPIO94_MSP5_TXD 94
  161. #define STA2X11_GPIO95_SDIO3_DAT3 95
  162. #define STA2X11_GPIO96_SDIO3_DAT2 96
  163. #define STA2X11_GPIO97_SDIO3_DAT1 97
  164. #define STA2X11_GPIO98_SDIO3_DAT0 98
  165. #define STA2X11_GPIO99_SDIO3_CLK 99
  166. #define STA2X11_GPIO100_SDIO3_CMD 100
  167. #define STA2X11_GPIO101 101
  168. #define STA2X11_GPIO102 102
  169. #define STA2X11_GPIO103 103
  170. #define STA2X11_GPIO104 104
  171. #define STA2X11_GPIO105_SDIO2_DAT3 105
  172. #define STA2X11_GPIO106_SDIO2_DAT2 106
  173. #define STA2X11_GPIO107_SDIO2_DAT1 107
  174. #define STA2X11_GPIO108_SDIO2_DAT0 108
  175. #define STA2X11_GPIO109_SDIO2_CLK 109
  176. #define STA2X11_GPIO110_SDIO2_CMD 110
  177. #define STA2X11_GPIO111 111
  178. #define STA2X11_GPIO112 112
  179. #define STA2X11_GPIO113 113
  180. #define STA2X11_GPIO114 114
  181. #define STA2X11_GPIO115_SDIO1_DAT3 115
  182. #define STA2X11_GPIO116_SDIO1_DAT2 116
  183. #define STA2X11_GPIO117_SDIO1_DAT1 117
  184. #define STA2X11_GPIO118_SDIO1_DAT0 118
  185. #define STA2X11_GPIO119_SDIO1_CLK 119
  186. #define STA2X11_GPIO120_SDIO1_CMD 120
  187. #define STA2X11_GPIO121 121
  188. #define STA2X11_GPIO122 122
  189. #define STA2X11_GPIO123 123
  190. #define STA2X11_GPIO124 124
  191. #define STA2X11_GPIO125_UART2_TXD 125
  192. #define STA2X11_GPIO126_UART2_RXD 126
  193. #define STA2X11_GPIO127_UART3_TXD 127
  194. /*
  195. * The APB bridge has its own registers, needed by our users as well.
  196. * They are accessed with the following read/mask/write function.
  197. */
  198. static inline u32
  199. sta2x11_apbreg_mask(struct pci_dev *pdev, u32 reg, u32 mask, u32 val)
  200. {
  201. return __sta2x11_mfd_mask(pdev, reg, mask, val, sta2x11_apbreg);
  202. }
  203. /* CAN and MLB */
  204. #define APBREG_BSR 0x00 /* Bridge Status Reg */
  205. #define APBREG_PAER 0x08 /* Peripherals Address Error Reg */
  206. #define APBREG_PWAC 0x20 /* Peripheral Write Access Control reg */
  207. #define APBREG_PRAC 0x40 /* Peripheral Read Access Control reg */
  208. #define APBREG_PCG 0x60 /* Peripheral Clock Gating Reg */
  209. #define APBREG_PUR 0x80 /* Peripheral Under Reset Reg */
  210. #define APBREG_EMU_PCG 0xA0 /* Emulator Peripheral Clock Gating Reg */
  211. #define APBREG_CAN (1 << 1)
  212. #define APBREG_MLB (1 << 3)
  213. /* SARAC */
  214. #define APBREG_BSR_SARAC 0x100 /* Bridge Status Reg */
  215. #define APBREG_PAER_SARAC 0x108 /* Peripherals Address Error Reg */
  216. #define APBREG_PWAC_SARAC 0x120 /* Peripheral Write Access Control reg */
  217. #define APBREG_PRAC_SARAC 0x140 /* Peripheral Read Access Control reg */
  218. #define APBREG_PCG_SARAC 0x160 /* Peripheral Clock Gating Reg */
  219. #define APBREG_PUR_SARAC 0x180 /* Peripheral Under Reset Reg */
  220. #define APBREG_EMU_PCG_SARAC 0x1A0 /* Emulator Peripheral Clock Gating Reg */
  221. #define APBREG_SARAC (1 << 2)
  222. /*
  223. * The system controller has its own registers. Some of these are accessed
  224. * by out users as well, using the following read/mask/write/function
  225. */
  226. static inline
  227. u32 sta2x11_sctl_mask(struct pci_dev *pdev, u32 reg, u32 mask, u32 val)
  228. {
  229. return __sta2x11_mfd_mask(pdev, reg, mask, val, sta2x11_sctl);
  230. }
  231. #define SCTL_SCCTL 0x00 /* System controller control register */
  232. #define SCTL_ARMCFG 0x04 /* ARM configuration register */
  233. #define SCTL_SCPLLCTL 0x08 /* PLL control status register */
  234. #define SCTL_SCPLLCTL_AUDIO_PLL_PD BIT(1)
  235. #define SCTL_SCPLLCTL_FRAC_CONTROL BIT(3)
  236. #define SCTL_SCPLLCTL_STRB_BYPASS BIT(6)
  237. #define SCTL_SCPLLCTL_STRB_INPUT BIT(8)
  238. #define SCTL_SCPLLFCTRL 0x0c /* PLL frequency control register */
  239. #define SCTL_SCPLLFCTRL_AUDIO_PLL_NDIV_MASK 0xff
  240. #define SCTL_SCPLLFCTRL_AUDIO_PLL_NDIV_SHIFT 10
  241. #define SCTL_SCPLLFCTRL_AUDIO_PLL_IDF_MASK 7
  242. #define SCTL_SCPLLFCTRL_AUDIO_PLL_IDF_SHIFT 21
  243. #define SCTL_SCPLLFCTRL_AUDIO_PLL_ODF_MASK 7
  244. #define SCTL_SCPLLFCTRL_AUDIO_PLL_ODF_SHIFT 18
  245. #define SCTL_SCPLLFCTRL_DITHER_DISABLE_MASK 0x03
  246. #define SCTL_SCPLLFCTRL_DITHER_DISABLE_SHIFT 4
  247. #define SCTL_SCRESFRACT 0x10 /* PLL fractional input register */
  248. #define SCTL_SCRESFRACT_MASK 0x0000ffff
  249. #define SCTL_SCRESCTRL1 0x14 /* Peripheral reset control 1 */
  250. #define SCTL_SCRESXTRL2 0x18 /* Peripheral reset control 2 */
  251. #define SCTL_SCPEREN0 0x1c /* Peripheral clock enable register 0 */
  252. #define SCTL_SCPEREN1 0x20 /* Peripheral clock enable register 1 */
  253. #define SCTL_SCPEREN2 0x24 /* Peripheral clock enable register 2 */
  254. #define SCTL_SCGRST 0x28 /* Peripheral global reset */
  255. #define SCTL_SCPCIECSBRST 0x2c /* PCIe PAB CSB reset status register */
  256. #define SCTL_SCPCIPMCR1 0x30 /* PCI power management control 1 */
  257. #define SCTL_SCPCIPMCR2 0x34 /* PCI power management control 2 */
  258. #define SCTL_SCPCIPMSR1 0x38 /* PCI power management status 1 */
  259. #define SCTL_SCPCIPMSR2 0x3c /* PCI power management status 2 */
  260. #define SCTL_SCPCIPMSR3 0x40 /* PCI power management status 3 */
  261. #define SCTL_SCINTREN 0x44 /* Interrupt enable */
  262. #define SCTL_SCRISR 0x48 /* RAW interrupt status */
  263. #define SCTL_SCCLKSTAT0 0x4c /* Peripheral clocks status 0 */
  264. #define SCTL_SCCLKSTAT1 0x50 /* Peripheral clocks status 1 */
  265. #define SCTL_SCCLKSTAT2 0x54 /* Peripheral clocks status 2 */
  266. #define SCTL_SCRSTSTA 0x58 /* Reset status register */
  267. #define SCTL_SCRESCTRL1_USB_PHY_POR (1 << 0)
  268. #define SCTL_SCRESCTRL1_USB_OTG (1 << 1)
  269. #define SCTL_SCRESCTRL1_USB_HRST (1 << 2)
  270. #define SCTL_SCRESCTRL1_USB_PHY_HOST (1 << 3)
  271. #define SCTL_SCRESCTRL1_SATAII (1 << 4)
  272. #define SCTL_SCRESCTRL1_VIP (1 << 5)
  273. #define SCTL_SCRESCTRL1_PER_MMC0 (1 << 6)
  274. #define SCTL_SCRESCTRL1_PER_MMC1 (1 << 7)
  275. #define SCTL_SCRESCTRL1_PER_GPIO0 (1 << 8)
  276. #define SCTL_SCRESCTRL1_PER_GPIO1 (1 << 9)
  277. #define SCTL_SCRESCTRL1_PER_GPIO2 (1 << 10)
  278. #define SCTL_SCRESCTRL1_PER_GPIO3 (1 << 11)
  279. #define SCTL_SCRESCTRL1_PER_MTU0 (1 << 12)
  280. #define SCTL_SCRESCTRL1_KER_SPI0 (1 << 13)
  281. #define SCTL_SCRESCTRL1_KER_SPI1 (1 << 14)
  282. #define SCTL_SCRESCTRL1_KER_SPI2 (1 << 15)
  283. #define SCTL_SCRESCTRL1_KER_MCI0 (1 << 16)
  284. #define SCTL_SCRESCTRL1_KER_MCI1 (1 << 17)
  285. #define SCTL_SCRESCTRL1_PRE_HSI2C0 (1 << 18)
  286. #define SCTL_SCRESCTRL1_PER_HSI2C1 (1 << 19)
  287. #define SCTL_SCRESCTRL1_PER_HSI2C2 (1 << 20)
  288. #define SCTL_SCRESCTRL1_PER_HSI2C3 (1 << 21)
  289. #define SCTL_SCRESCTRL1_PER_MSP0 (1 << 22)
  290. #define SCTL_SCRESCTRL1_PER_MSP1 (1 << 23)
  291. #define SCTL_SCRESCTRL1_PER_MSP2 (1 << 24)
  292. #define SCTL_SCRESCTRL1_PER_MSP3 (1 << 25)
  293. #define SCTL_SCRESCTRL1_PER_MSP4 (1 << 26)
  294. #define SCTL_SCRESCTRL1_PER_MSP5 (1 << 27)
  295. #define SCTL_SCRESCTRL1_PER_MMC (1 << 28)
  296. #define SCTL_SCRESCTRL1_KER_MSP0 (1 << 29)
  297. #define SCTL_SCRESCTRL1_KER_MSP1 (1 << 30)
  298. #define SCTL_SCRESCTRL1_KER_MSP2 (1 << 31)
  299. #define SCTL_SCPEREN0_UART0 (1 << 0)
  300. #define SCTL_SCPEREN0_UART1 (1 << 1)
  301. #define SCTL_SCPEREN0_UART2 (1 << 2)
  302. #define SCTL_SCPEREN0_UART3 (1 << 3)
  303. #define SCTL_SCPEREN0_MSP0 (1 << 4)
  304. #define SCTL_SCPEREN0_MSP1 (1 << 5)
  305. #define SCTL_SCPEREN0_MSP2 (1 << 6)
  306. #define SCTL_SCPEREN0_MSP3 (1 << 7)
  307. #define SCTL_SCPEREN0_MSP4 (1 << 8)
  308. #define SCTL_SCPEREN0_MSP5 (1 << 9)
  309. #define SCTL_SCPEREN0_SPI0 (1 << 10)
  310. #define SCTL_SCPEREN0_SPI1 (1 << 11)
  311. #define SCTL_SCPEREN0_SPI2 (1 << 12)
  312. #define SCTL_SCPEREN0_I2C0 (1 << 13)
  313. #define SCTL_SCPEREN0_I2C1 (1 << 14)
  314. #define SCTL_SCPEREN0_I2C2 (1 << 15)
  315. #define SCTL_SCPEREN0_I2C3 (1 << 16)
  316. #define SCTL_SCPEREN0_SVDO_LVDS (1 << 17)
  317. #define SCTL_SCPEREN0_USB_HOST (1 << 18)
  318. #define SCTL_SCPEREN0_USB_OTG (1 << 19)
  319. #define SCTL_SCPEREN0_MCI0 (1 << 20)
  320. #define SCTL_SCPEREN0_MCI1 (1 << 21)
  321. #define SCTL_SCPEREN0_MCI2 (1 << 22)
  322. #define SCTL_SCPEREN0_MCI3 (1 << 23)
  323. #define SCTL_SCPEREN0_SATA (1 << 24)
  324. #define SCTL_SCPEREN0_ETHERNET (1 << 25)
  325. #define SCTL_SCPEREN0_VIC (1 << 26)
  326. #define SCTL_SCPEREN0_DMA_AUDIO (1 << 27)
  327. #define SCTL_SCPEREN0_DMA_SOC (1 << 28)
  328. #define SCTL_SCPEREN0_RAM (1 << 29)
  329. #define SCTL_SCPEREN0_VIP (1 << 30)
  330. #define SCTL_SCPEREN0_ARM (1 << 31)
  331. #define SCTL_SCPEREN1_UART0 (1 << 0)
  332. #define SCTL_SCPEREN1_UART1 (1 << 1)
  333. #define SCTL_SCPEREN1_UART2 (1 << 2)
  334. #define SCTL_SCPEREN1_UART3 (1 << 3)
  335. #define SCTL_SCPEREN1_MSP0 (1 << 4)
  336. #define SCTL_SCPEREN1_MSP1 (1 << 5)
  337. #define SCTL_SCPEREN1_MSP2 (1 << 6)
  338. #define SCTL_SCPEREN1_MSP3 (1 << 7)
  339. #define SCTL_SCPEREN1_MSP4 (1 << 8)
  340. #define SCTL_SCPEREN1_MSP5 (1 << 9)
  341. #define SCTL_SCPEREN1_SPI0 (1 << 10)
  342. #define SCTL_SCPEREN1_SPI1 (1 << 11)
  343. #define SCTL_SCPEREN1_SPI2 (1 << 12)
  344. #define SCTL_SCPEREN1_I2C0 (1 << 13)
  345. #define SCTL_SCPEREN1_I2C1 (1 << 14)
  346. #define SCTL_SCPEREN1_I2C2 (1 << 15)
  347. #define SCTL_SCPEREN1_I2C3 (1 << 16)
  348. #define SCTL_SCPEREN1_USB_PHY (1 << 17)
  349. /*
  350. * APB-SOC registers
  351. */
  352. static inline
  353. u32 sta2x11_apb_soc_regs_mask(struct pci_dev *pdev, u32 reg, u32 mask, u32 val)
  354. {
  355. return __sta2x11_mfd_mask(pdev, reg, mask, val, sta2x11_apb_soc_regs);
  356. }
  357. #define PCIE_EP1_FUNC3_0_INTR_REG 0x000
  358. #define PCIE_EP1_FUNC7_4_INTR_REG 0x004
  359. #define PCIE_EP2_FUNC3_0_INTR_REG 0x008
  360. #define PCIE_EP2_FUNC7_4_INTR_REG 0x00c
  361. #define PCIE_EP3_FUNC3_0_INTR_REG 0x010
  362. #define PCIE_EP3_FUNC7_4_INTR_REG 0x014
  363. #define PCIE_EP4_FUNC3_0_INTR_REG 0x018
  364. #define PCIE_EP4_FUNC7_4_INTR_REG 0x01c
  365. #define PCIE_INTR_ENABLE0_REG 0x020
  366. #define PCIE_INTR_ENABLE1_REG 0x024
  367. #define PCIE_EP1_FUNC_TC_REG 0x028
  368. #define PCIE_EP2_FUNC_TC_REG 0x02c
  369. #define PCIE_EP3_FUNC_TC_REG 0x030
  370. #define PCIE_EP4_FUNC_TC_REG 0x034
  371. #define PCIE_EP1_FUNC_F_REG 0x038
  372. #define PCIE_EP2_FUNC_F_REG 0x03c
  373. #define PCIE_EP3_FUNC_F_REG 0x040
  374. #define PCIE_EP4_FUNC_F_REG 0x044
  375. #define PCIE_PAB_AMBA_SW_RST_REG 0x048
  376. #define PCIE_PM_STATUS_0_PORT_0_4 0x04c
  377. #define PCIE_PM_STATUS_7_0_EP1 0x050
  378. #define PCIE_PM_STATUS_7_0_EP2 0x054
  379. #define PCIE_PM_STATUS_7_0_EP3 0x058
  380. #define PCIE_PM_STATUS_7_0_EP4 0x05c
  381. #define PCIE_DEV_ID_0_EP1_REG 0x060
  382. #define PCIE_CC_REV_ID_0_EP1_REG 0x064
  383. #define PCIE_DEV_ID_1_EP1_REG 0x068
  384. #define PCIE_CC_REV_ID_1_EP1_REG 0x06c
  385. #define PCIE_DEV_ID_2_EP1_REG 0x070
  386. #define PCIE_CC_REV_ID_2_EP1_REG 0x074
  387. #define PCIE_DEV_ID_3_EP1_REG 0x078
  388. #define PCIE_CC_REV_ID_3_EP1_REG 0x07c
  389. #define PCIE_DEV_ID_4_EP1_REG 0x080
  390. #define PCIE_CC_REV_ID_4_EP1_REG 0x084
  391. #define PCIE_DEV_ID_5_EP1_REG 0x088
  392. #define PCIE_CC_REV_ID_5_EP1_REG 0x08c
  393. #define PCIE_DEV_ID_6_EP1_REG 0x090
  394. #define PCIE_CC_REV_ID_6_EP1_REG 0x094
  395. #define PCIE_DEV_ID_7_EP1_REG 0x098
  396. #define PCIE_CC_REV_ID_7_EP1_REG 0x09c
  397. #define PCIE_DEV_ID_0_EP2_REG 0x0a0
  398. #define PCIE_CC_REV_ID_0_EP2_REG 0x0a4
  399. #define PCIE_DEV_ID_1_EP2_REG 0x0a8
  400. #define PCIE_CC_REV_ID_1_EP2_REG 0x0ac
  401. #define PCIE_DEV_ID_2_EP2_REG 0x0b0
  402. #define PCIE_CC_REV_ID_2_EP2_REG 0x0b4
  403. #define PCIE_DEV_ID_3_EP2_REG 0x0b8
  404. #define PCIE_CC_REV_ID_3_EP2_REG 0x0bc
  405. #define PCIE_DEV_ID_4_EP2_REG 0x0c0
  406. #define PCIE_CC_REV_ID_4_EP2_REG 0x0c4
  407. #define PCIE_DEV_ID_5_EP2_REG 0x0c8
  408. #define PCIE_CC_REV_ID_5_EP2_REG 0x0cc
  409. #define PCIE_DEV_ID_6_EP2_REG 0x0d0
  410. #define PCIE_CC_REV_ID_6_EP2_REG 0x0d4
  411. #define PCIE_DEV_ID_7_EP2_REG 0x0d8
  412. #define PCIE_CC_REV_ID_7_EP2_REG 0x0dC
  413. #define PCIE_DEV_ID_0_EP3_REG 0x0e0
  414. #define PCIE_CC_REV_ID_0_EP3_REG 0x0e4
  415. #define PCIE_DEV_ID_1_EP3_REG 0x0e8
  416. #define PCIE_CC_REV_ID_1_EP3_REG 0x0ec
  417. #define PCIE_DEV_ID_2_EP3_REG 0x0f0
  418. #define PCIE_CC_REV_ID_2_EP3_REG 0x0f4
  419. #define PCIE_DEV_ID_3_EP3_REG 0x0f8
  420. #define PCIE_CC_REV_ID_3_EP3_REG 0x0fc
  421. #define PCIE_DEV_ID_4_EP3_REG 0x100
  422. #define PCIE_CC_REV_ID_4_EP3_REG 0x104
  423. #define PCIE_DEV_ID_5_EP3_REG 0x108
  424. #define PCIE_CC_REV_ID_5_EP3_REG 0x10c
  425. #define PCIE_DEV_ID_6_EP3_REG 0x110
  426. #define PCIE_CC_REV_ID_6_EP3_REG 0x114
  427. #define PCIE_DEV_ID_7_EP3_REG 0x118
  428. #define PCIE_CC_REV_ID_7_EP3_REG 0x11c
  429. #define PCIE_DEV_ID_0_EP4_REG 0x120
  430. #define PCIE_CC_REV_ID_0_EP4_REG 0x124
  431. #define PCIE_DEV_ID_1_EP4_REG 0x128
  432. #define PCIE_CC_REV_ID_1_EP4_REG 0x12c
  433. #define PCIE_DEV_ID_2_EP4_REG 0x130
  434. #define PCIE_CC_REV_ID_2_EP4_REG 0x134
  435. #define PCIE_DEV_ID_3_EP4_REG 0x138
  436. #define PCIE_CC_REV_ID_3_EP4_REG 0x13c
  437. #define PCIE_DEV_ID_4_EP4_REG 0x140
  438. #define PCIE_CC_REV_ID_4_EP4_REG 0x144
  439. #define PCIE_DEV_ID_5_EP4_REG 0x148
  440. #define PCIE_CC_REV_ID_5_EP4_REG 0x14c
  441. #define PCIE_DEV_ID_6_EP4_REG 0x150
  442. #define PCIE_CC_REV_ID_6_EP4_REG 0x154
  443. #define PCIE_DEV_ID_7_EP4_REG 0x158
  444. #define PCIE_CC_REV_ID_7_EP4_REG 0x15c
  445. #define PCIE_SUBSYS_VEN_ID_REG 0x160
  446. #define PCIE_COMMON_CLOCK_CONFIG_0_4_0 0x164
  447. #define PCIE_MIPHYP_SSC_EN_REG 0x168
  448. #define PCIE_MIPHYP_ADDR_REG 0x16c
  449. #define PCIE_L1_ASPM_READY_REG 0x170
  450. #define PCIE_EXT_CFG_RDY_REG 0x174
  451. #define PCIE_SoC_INT_ROUTER_STATUS0_REG 0x178
  452. #define PCIE_SoC_INT_ROUTER_STATUS1_REG 0x17c
  453. #define PCIE_SoC_INT_ROUTER_STATUS2_REG 0x180
  454. #define PCIE_SoC_INT_ROUTER_STATUS3_REG 0x184
  455. #define DMA_IP_CTRL_REG 0x324
  456. #define DISP_BRIDGE_PU_PD_CTRL_REG 0x328
  457. #define VIP_PU_PD_CTRL_REG 0x32c
  458. #define USB_MLB_PU_PD_CTRL_REG 0x330
  459. #define SDIO_PU_PD_MISCFUNC_CTRL_REG1 0x334
  460. #define SDIO_PU_PD_MISCFUNC_CTRL_REG2 0x338
  461. #define UART_PU_PD_CTRL_REG 0x33c
  462. #define ARM_Lock 0x340
  463. #define SYS_IO_CHAR_REG1 0x344
  464. #define SYS_IO_CHAR_REG2 0x348
  465. #define SATA_CORE_ID_REG 0x34c
  466. #define SATA_CTRL_REG 0x350
  467. #define I2C_HSFIX_MISC_REG 0x354
  468. #define SPARE2_RESERVED 0x358
  469. #define SPARE3_RESERVED 0x35c
  470. #define MASTER_LOCK_REG 0x368
  471. #define SYSTEM_CONFIG_STATUS_REG 0x36c
  472. #define MSP_CLK_CTRL_REG 0x39c
  473. #define COMPENSATION_REG1 0x3c4
  474. #define COMPENSATION_REG2 0x3c8
  475. #define COMPENSATION_REG3 0x3cc
  476. #define TEST_CTL_REG 0x3d0
  477. /*
  478. * SECR (OTP) registers
  479. */
  480. #define STA2X11_SECR_CR 0x00
  481. #define STA2X11_SECR_FVR0 0x10
  482. #define STA2X11_SECR_FVR1 0x14
  483. extern int sta2x11_mfd_get_regs_data(struct platform_device *pdev,
  484. enum sta2x11_mfd_plat_dev index,
  485. void __iomem **regs,
  486. spinlock_t **lock);
  487. #endif /* __STA2X11_MFD_H */