mach-rtl83xx.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2006-2012 Tony Wu ([email protected])
  4. * Copyright (C) 2020 B. Koblitz
  5. */
  6. #ifndef _MACH_RTL838X_H_
  7. #define _MACH_RTL838X_H_
  8. #include <asm/types.h>
  9. /*
  10. * Register access macros
  11. */
  12. #define RTL838X_SW_BASE ((volatile void *) 0xBB000000)
  13. #define rtl83xx_r32(reg) readl(reg)
  14. #define rtl83xx_w32(val, reg) writel(val, reg)
  15. #define rtl83xx_w32_mask(clear, set, reg) rtl83xx_w32((rtl83xx_r32(reg) & ~(clear)) | (set), reg)
  16. #define rtl83xx_r8(reg) readb(reg)
  17. #define rtl83xx_w8(val, reg) writeb(val, reg)
  18. #define sw_r32(reg) readl(RTL838X_SW_BASE + reg)
  19. #define sw_w32(val, reg) writel(val, RTL838X_SW_BASE + reg)
  20. #define sw_w32_mask(clear, set, reg) \
  21. sw_w32((sw_r32(reg) & ~(clear)) | (set), reg)
  22. #define sw_r64(reg) ((((u64)readl(RTL838X_SW_BASE + reg)) << 32) | \
  23. readl(RTL838X_SW_BASE + reg + 4))
  24. #define sw_w64(val, reg) do { \
  25. writel((u32)((val) >> 32), RTL838X_SW_BASE + reg); \
  26. writel((u32)((val) & 0xffffffff), \
  27. RTL838X_SW_BASE + reg + 4); \
  28. } while (0)
  29. /*
  30. * SPRAM
  31. */
  32. #define RTL838X_ISPRAM_BASE 0x0
  33. #define RTL838X_DSPRAM_BASE 0x0
  34. /*
  35. * IRQ Controller
  36. */
  37. #define RTL838X_IRQ_CPU_BASE 0
  38. #define RTL838X_IRQ_CPU_NUM 8
  39. #define RTL838X_IRQ_ICTL_BASE (RTL838X_IRQ_CPU_BASE + RTL838X_IRQ_CPU_NUM)
  40. #define RTL838X_IRQ_ICTL_NUM 32
  41. #define RTL83XX_IRQ_UART0 31
  42. #define RTL83XX_IRQ_UART1 30
  43. #define RTL83XX_IRQ_TC0 29
  44. #define RTL83XX_IRQ_TC1 28
  45. #define RTL83XX_IRQ_OCPTO 27
  46. #define RTL83XX_IRQ_HLXTO 26
  47. #define RTL83XX_IRQ_SLXTO 25
  48. #define RTL83XX_IRQ_NIC 24
  49. #define RTL83XX_IRQ_GPIO_ABCD 23
  50. #define RTL83XX_IRQ_GPIO_EFGH 22
  51. #define RTL83XX_IRQ_RTC 21
  52. #define RTL83XX_IRQ_SWCORE 20
  53. #define RTL83XX_IRQ_WDT_IP1 19
  54. #define RTL83XX_IRQ_WDT_IP2 18
  55. /*
  56. * MIPS32R2 counter
  57. */
  58. #define RTL838X_COMPARE_IRQ (RTL838X_IRQ_CPU_BASE + 7)
  59. /*
  60. * ICTL
  61. * Base address 0xb8003000UL
  62. */
  63. #define RTL838X_ICTL1_IRQ (RTL838X_IRQ_CPU_BASE + 2)
  64. #define RTL838X_ICTL2_IRQ (RTL838X_IRQ_CPU_BASE + 3)
  65. #define RTL838X_ICTL3_IRQ (RTL838X_IRQ_CPU_BASE + 4)
  66. #define RTL838X_ICTL4_IRQ (RTL838X_IRQ_CPU_BASE + 5)
  67. #define RTL838X_ICTL5_IRQ (RTL838X_IRQ_CPU_BASE + 6)
  68. #define GIMR (0x00)
  69. #define UART0_IE (1 << 31)
  70. #define UART1_IE (1 << 30)
  71. #define TC0_IE (1 << 29)
  72. #define TC1_IE (1 << 28)
  73. #define OCPTO_IE (1 << 27)
  74. #define HLXTO_IE (1 << 26)
  75. #define SLXTO_IE (1 << 25)
  76. #define NIC_IE (1 << 24)
  77. #define GPIO_ABCD_IE (1 << 23)
  78. #define GPIO_EFGH_IE (1 << 22)
  79. #define RTC_IE (1 << 21)
  80. #define WDT_IP1_IE (1 << 19)
  81. #define WDT_IP2_IE (1 << 18)
  82. #define GISR (0x04)
  83. #define UART0_IP (1 << 31)
  84. #define UART1_IP (1 << 30)
  85. #define TC0_IP (1 << 29)
  86. #define TC1_IP (1 << 28)
  87. #define OCPTO_IP (1 << 27)
  88. #define HLXTO_IP (1 << 26)
  89. #define SLXTO_IP (1 << 25)
  90. #define NIC_IP (1 << 24)
  91. #define GPIO_ABCD_IP (1 << 23)
  92. #define GPIO_EFGH_IP (1 << 22)
  93. #define RTC_IP (1 << 21)
  94. #define WDT_IP1_IP (1 << 19)
  95. #define WDT_IP2_IP (1 << 18)
  96. #define IRR0 (0x08)
  97. #define IRR0_SETTING ((UART0_RS << 28) | \
  98. (UART1_RS << 24) | \
  99. (TC0_RS << 20) | \
  100. (TC1_RS << 16) | \
  101. (OCPTO_RS << 12) | \
  102. (HLXTO_RS << 8) | \
  103. (SLXTO_RS << 4) | \
  104. (NIC_RS << 0) \
  105. )
  106. #define IRR1 (0x0c)
  107. #define IRR1_SETTING_RTL838X ((GPIO_ABCD_RS << 28) | \
  108. (GPIO_EFGH_RS << 24) | \
  109. (RTC_RS << 20) | \
  110. (SWCORE_RS << 16) \
  111. )
  112. #define IRR1_SETTING_RTL839X ((GPIO_ABCD_RS << 28) | \
  113. (SWCORE_RS << 16) \
  114. )
  115. #define IRR2 (0x10)
  116. #define IRR2_SETTING 0
  117. #define IRR3 (0x14)
  118. #define IRR3_SETTING 0
  119. /* Interrupt Routing Selection */
  120. #define UART0_RS 2
  121. #define UART1_RS 1
  122. #define TC0_RS 5
  123. #define TC1_RS 1
  124. #define OCPTO_RS 1
  125. #define HLXTO_RS 1
  126. #define SLXTO_RS 1
  127. #define NIC_RS 4
  128. #define GPIO_ABCD_RS 4
  129. #define GPIO_EFGH_RS 4
  130. #define RTC_RS 4
  131. #define SWCORE_RS 3
  132. #define WDT_IP1_RS 4
  133. #define WDT_IP2_RS 5
  134. /* Interrupt IRQ Assignments */
  135. #define UART0_IRQ 31
  136. #define UART1_IRQ 30
  137. #define TC0_IRQ 29
  138. #define TC1_IRQ 28
  139. #define OCPTO_IRQ 27
  140. #define HLXTO_IRQ 26
  141. #define SLXTO_IRQ 25
  142. #define NIC_IRQ 24
  143. #define GPIO_ABCD_IRQ 23
  144. #define GPIO_EFGH_IRQ 22
  145. #define RTC_IRQ 21
  146. #define SWCORE_IRQ 20
  147. #define WDT_IP1_IRQ 19
  148. #define WDT_IP2_IRQ 18
  149. #define SYSTEM_FREQ 200000000
  150. #define RTL838X_UART0_BASE ((volatile void *)(0xb8002000UL))
  151. #define RTL838X_UART0_BAUD 38400 /* ex. 19200 or 38400 or 57600 or 115200 */
  152. #define RTL838X_UART0_FREQ (SYSTEM_FREQ - RTL838X_UART0_BAUD * 24)
  153. #define RTL838X_UART0_MAPBASE 0x18002000UL
  154. #define RTL838X_UART0_MAPSIZE 0x100
  155. #define RTL838X_UART0_IRQ UART0_IRQ
  156. #define RTL838X_UART1_BASE ((volatile void *)(0xb8002100UL))
  157. #define RTL838X_UART1_BAUD 38400 /* ex. 19200 or 38400 or 57600 or 115200 */
  158. #define RTL838X_UART1_FREQ (SYSTEM_FREQ - RTL838X_UART1_BAUD * 24)
  159. #define RTL838X_UART1_MAPBASE 0x18002100UL
  160. #define RTL838X_UART1_MAPSIZE 0x100
  161. #define RTL838X_UART1_IRQ UART1_IRQ
  162. #define UART0_RBR (RTL838X_UART0_BASE + 0x000)
  163. #define UART0_THR (RTL838X_UART0_BASE + 0x000)
  164. #define UART0_DLL (RTL838X_UART0_BASE + 0x000)
  165. #define UART0_IER (RTL838X_UART0_BASE + 0x004)
  166. #define UART0_DLM (RTL838X_UART0_BASE + 0x004)
  167. #define UART0_IIR (RTL838X_UART0_BASE + 0x008)
  168. #define UART0_FCR (RTL838X_UART0_BASE + 0x008)
  169. #define UART0_LCR (RTL838X_UART0_BASE + 0x00C)
  170. #define UART0_MCR (RTL838X_UART0_BASE + 0x010)
  171. #define UART0_LSR (RTL838X_UART0_BASE + 0x014)
  172. #define UART1_RBR (RTL838X_UART1_BASE + 0x000)
  173. #define UART1_THR (RTL838X_UART1_BASE + 0x000)
  174. #define UART1_DLL (RTL838X_UART1_BASE + 0x000)
  175. #define UART1_IER (RTL838X_UART1_BASE + 0x004)
  176. #define UART1_DLM (RTL838X_UART1_BASE + 0x004)
  177. #define UART1_IIR (RTL838X_UART1_BASE + 0x008)
  178. #define UART1_FCR (RTL838X_UART1_BASE + 0x008)
  179. #define FCR_EN 0x01
  180. #define FCR_RXRST 0x02
  181. #define XRST 0x02
  182. #define FCR_TXRST 0x04
  183. #define TXRST 0x04
  184. #define FCR_DMA 0x08
  185. #define FCR_RTRG 0xC0
  186. #define CHAR_TRIGGER_01 0x00
  187. #define CHAR_TRIGGER_04 0x40
  188. #define CHAR_TRIGGER_08 0x80
  189. #define CHAR_TRIGGER_14 0xC0
  190. #define UART1_LCR (RTL838X_UART1_BASE + 0x00C)
  191. #define LCR_WLN 0x03
  192. #define CHAR_LEN_5 0x00
  193. #define CHAR_LEN_6 0x01
  194. #define CHAR_LEN_7 0x02
  195. #define CHAR_LEN_8 0x03
  196. #define LCR_STB 0x04
  197. #define ONE_STOP 0x00
  198. #define TWO_STOP 0x04
  199. #define LCR_PEN 0x08
  200. #define PARITY_ENABLE 0x01
  201. #define PARITY_DISABLE 0x00
  202. #define LCR_EPS 0x30
  203. #define PARITY_ODD 0x00
  204. #define PARITY_EVEN 0x10
  205. #define PARITY_MARK 0x20
  206. #define PARITY_SPACE 0x30
  207. #define LCR_BRK 0x40
  208. #define LCR_DLAB 0x80
  209. #define DLAB 0x80
  210. #define UART1_MCR (RTL838X_UART1_BASE + 0x010)
  211. #define UART1_LSR (RTL838X_UART1_BASE + 0x014)
  212. #define LSR_DR 0x01
  213. #define RxCHAR_AVAIL 0x01
  214. #define LSR_OE 0x02
  215. #define LSR_PE 0x04
  216. #define LSR_FE 0x08
  217. #define LSR_BI 0x10
  218. #define LSR_THRE 0x20
  219. #define TxCHAR_AVAIL 0x00
  220. #define TxCHAR_EMPTY 0x20
  221. #define LSR_TEMT 0x40
  222. #define LSR_RFE 0x80
  223. /*
  224. * Timer/counter for 8390/80/28 TC & MP chip
  225. */
  226. #define RTL838X_TIMER0_BASE ((volatile void *)(0xb8003100UL))
  227. #define RTL838X_TIMER0_IRQ RTL838X_TC0_EXT_IRQ
  228. #define RTL8390TC_TC1DATA (RTL838X_TIMER0_BASE + 0x04)
  229. #define RTL8390TC_TCD_OFFSET 8
  230. #define RTL8390TC_TC0CNT (RTL838X_TIMER0_BASE + 0x08)
  231. #define RTL8390TC_TC1CNT (RTL838X_TIMER0_BASE + 0x0C)
  232. #define RTL8390TC_TCCNR (RTL838X_TIMER0_BASE + 0x10)
  233. #define RTL8390TC_TC0EN (1 << 31)
  234. #define RTL8390TC_TC0MODE_TIMER (1 << 30)
  235. #define RTL8390TC_TC1EN (1 << 29)
  236. #define RTL8390TC_TC1MODE_TIMER (1 << 28)
  237. #define RTL8390TC_TCIR (RTL838X_TIMER0_BASE + 0x14)
  238. #define RTL8390TC_TC0IE (1 << 31)
  239. #define RTL8390TC_TC1IE (1 << 30)
  240. #define RTL8390TC_TC0IP (1 << 29)
  241. #define RTL8390TC_TC1IP (1 << 28)
  242. #define RTL8390TC_CDBR (RTL838X_TIMER0_BASE + 0x18)
  243. #define RTL8390TC_DIVF_OFFSET 16
  244. #define RTL8390TC_WDTCNR (RTL838X_TIMER0_BASE + 0x1C)
  245. #define RTL8390MP_TC1DATA (RTL838X_TIMER0_BASE + 0x10)
  246. #define RTL8390MP_TC0CNT (RTL838X_TIMER0_BASE + 0x04)
  247. #define RTL8390MP_TC1CNT (RTL838X_TIMER0_BASE + 0x14)
  248. #define RTL8390MP_TC0CTL (RTL838X_TIMER0_BASE + 0x08)
  249. #define RTL8390MP_TC1CTL (RTL838X_TIMER0_BASE + 0x18)
  250. #define RTL8390MP_TCEN (1 << 28)
  251. #define RTL8390MP_TCMODE_TIMER (1 << 24)
  252. #define RTL8390MP_TCDIV_FACTOR (0xFFFF << 0)
  253. #define RTL8390MP_TC0INT (RTL838X_TIMER0_BASE + 0xC)
  254. #define RTL8390MP_TC1INT (RTL838X_TIMER0_BASE + 0x1C)
  255. #define RTL8390MP_TCIE (1 << 20)
  256. #define RTL8390MP_TCIP (1 << 16)
  257. #define RTL8390MP_WDTCNR (RTL838X_TIMER0_BASE + 0x50)
  258. #define RTL8380MP_TC0DATA (RTL838X_TIMER0_BASE + 0x00)
  259. #define RTL8380MP_TC1DATA (RTL838X_TIMER0_BASE + 0x10)
  260. #define RTL8380MP_TC0CNT (RTL838X_TIMER0_BASE + 0x04)
  261. #define RTL8380MP_TC1CNT (RTL838X_TIMER0_BASE + 0x14)
  262. #define RTL8380MP_TC0CTL (RTL838X_TIMER0_BASE + 0x08)
  263. #define RTL8380MP_TC1CTL (RTL838X_TIMER0_BASE + 0x18)
  264. #define RTL8380MP_TCEN (1 << 28)
  265. #define RTL8380MP_TCMODE_TIMER (1 << 24)
  266. #define RTL8380MP_TCDIV_FACTOR (0xFFFF << 0)
  267. #define RTL8380MP_TC0INT (RTL838X_TIMER0_BASE + 0xC)
  268. #define RTL8380MP_TC1INT (RTL838X_TIMER0_BASE + 0x1C)
  269. #define RTL8380MP_TCIE (1 << 20)
  270. #define RTL8380MP_TCIP (1 << 16)
  271. #define RTL8380MP_WDTCNR (RTL838X_TIMER0_BASE + 0x50)
  272. #define DIVISOR_RTL8390 55
  273. #define DIVISOR_RTL8380 2500
  274. #define DIVISOR_MAX 16834
  275. /*
  276. * Memory Controller
  277. */
  278. #define MC_MCR 0xB8001000
  279. #define MC_MCR_VAL 0x00000000
  280. #define MC_DCR 0xB8001004
  281. #define MC_DCR0_VAL 0x54480000
  282. #define MC_DTCR 0xB8001008
  283. #define MC_DTCR_VAL 0xFFFF05C0
  284. /*
  285. * GPIO
  286. */
  287. #define GPIO_CTRL_REG_BASE ((volatile void *) 0xb8003500)
  288. #define RTL838X_GPIO_PABC_CNR (GPIO_CTRL_REG_BASE + 0x0)
  289. #define RTL838X_GPIO_PABC_TYPE (GPIO_CTRL_REG_BASE + 0x04)
  290. #define RTL838X_GPIO_PABC_DIR (GPIO_CTRL_REG_BASE + 0x8)
  291. #define RTL838X_GPIO_PABC_DATA (GPIO_CTRL_REG_BASE + 0xc)
  292. #define RTL838X_GPIO_PABC_ISR (GPIO_CTRL_REG_BASE + 0x10)
  293. #define RTL838X_GPIO_PAB_IMR (GPIO_CTRL_REG_BASE + 0x14)
  294. #define RTL838X_GPIO_PC_IMR (GPIO_CTRL_REG_BASE + 0x18)
  295. #define RTL838X_MODEL_NAME_INFO (0x00D4)
  296. #define RTL839X_MODEL_NAME_INFO (0x0FF0)
  297. #define RTL838X_LED_GLB_CTRL (0xA000)
  298. #define RTL839X_LED_GLB_CTRL (0x00E4)
  299. #define RTL838X_EXT_GPIO_DIR (0xA08C)
  300. #define RTL839X_EXT_GPIO_DIR (0x0214)
  301. #define RTL838X_EXT_GPIO_DATA (0xA094)
  302. #define RTL839X_EXT_GPIO_DATA (0x021c)
  303. #define RTL838X_EXT_GPIO_INDRT_ACCESS (0xA09C)
  304. #define RTL839X_EXT_GPIO_INDRT_ACCESS (0x0224)
  305. #define RTL838X_EXTRA_GPIO_CTRL (0xA0E0)
  306. #define RTL838X_DMY_REG5 (0x0144)
  307. #define RTL838X_EXTRA_GPIO_CTRL (0xA0E0)
  308. #define RTL838X_GMII_INTF_SEL (0x1000)
  309. #define RTL838X_IO_DRIVING_ABILITY_CTRL (0x1010)
  310. #define RTL838X_GPIO_A7 31
  311. #define RTL838X_GPIO_A6 30
  312. #define RTL838X_GPIO_A5 29
  313. #define RTL838X_GPIO_A4 28
  314. #define RTL838X_GPIO_A3 27
  315. #define RTL838X_GPIO_A2 26
  316. #define RTL838X_GPIO_A1 25
  317. #define RTL838X_GPIO_A0 24
  318. #define RTL838X_GPIO_B7 23
  319. #define RTL838X_GPIO_B6 22
  320. #define RTL838X_GPIO_B5 21
  321. #define RTL838X_GPIO_B4 20
  322. #define RTL838X_GPIO_B3 19
  323. #define RTL838X_GPIO_B2 18
  324. #define RTL838X_GPIO_B1 17
  325. #define RTL838X_GPIO_B0 16
  326. #define RTL838X_GPIO_C7 15
  327. #define RTL838X_GPIO_C6 14
  328. #define RTL838X_GPIO_C5 13
  329. #define RTL838X_GPIO_C4 12
  330. #define RTL838X_GPIO_C3 11
  331. #define RTL838X_GPIO_C2 10
  332. #define RTL838X_GPIO_C1 9
  333. #define RTL838X_GPIO_C0 8
  334. #define RTL838X_INT_RW_CTRL (0x0058)
  335. #define RTL838X_EXT_VERSION (0x00D0)
  336. #define RTL838X_PLL_CML_CTRL (0x0FF8)
  337. #define RTL838X_STRAP_DBG (0x100C)
  338. /*
  339. * Reset
  340. */
  341. #define RGCR (0x1E70)
  342. #define RTL839X_RST_GLB_CTRL (0x0014)
  343. #define RTL838X_RST_GLB_CTRL_1 (0x0040)
  344. /* LED control by switch */
  345. #define RTL838X_LED_MODE_SEL (0x1004)
  346. #define RTL838X_LED_MODE_CTRL (0xA004)
  347. #define RTL838X_LED_P_EN_CTRL (0xA008)
  348. /* LED control by software */
  349. #define RTL838X_LED_SW_CTRL (0x0128)
  350. #define RTL839X_LED_SW_CTRL (0xA00C)
  351. #define RTL838X_LED_SW_P_EN_CTRL (0xA010)
  352. #define RTL839X_LED_SW_P_EN_CTRL (0x012C)
  353. #define RTL838X_LED0_SW_P_EN_CTRL (0xA010)
  354. #define RTL839X_LED0_SW_P_EN_CTRL (0x012C)
  355. #define RTL838X_LED1_SW_P_EN_CTRL (0xA014)
  356. #define RTL839X_LED1_SW_P_EN_CTRL (0x0130)
  357. #define RTL838X_LED2_SW_P_EN_CTRL (0xA018)
  358. #define RTL839X_LED2_SW_P_EN_CTRL (0x0134)
  359. #define RTL838X_LED_SW_P_CTRL (0xA01C)
  360. #define RTL839X_LED_SW_P_CTRL (0x0144)
  361. #define RTL839X_MAC_EFUSE_CTRL (0x02ac)
  362. /*
  363. * MDIO via Realtek's SMI interface
  364. */
  365. #define RTL838X_SMI_GLB_CTRL (0xa100)
  366. #define RTL838X_SMI_ACCESS_PHY_CTRL_0 (0xa1b8)
  367. #define RTL838X_SMI_ACCESS_PHY_CTRL_1 (0xa1bc)
  368. #define RTL838X_SMI_ACCESS_PHY_CTRL_2 (0xa1c0)
  369. #define RTL838X_SMI_ACCESS_PHY_CTRL_3 (0xa1c4)
  370. #define RTL838X_SMI_PORT0_5_ADDR_CTRL (0xa1c8)
  371. #define RTL838X_SMI_POLL_CTRL (0xa17c)
  372. #define RTL839X_SMI_GLB_CTRL (0x03f8)
  373. #define RTL839X_SMI_PORT_POLLING_CTRL (0x03fc)
  374. #define RTL839X_PHYREG_ACCESS_CTRL (0x03DC)
  375. #define RTL839X_PHYREG_CTRL (0x03E0)
  376. #define RTL839X_PHYREG_PORT_CTRL(p) (0x03E4 + ((p >> 5) << 2))
  377. #define RTL839X_PHYREG_DATA_CTRL (0x03F0)
  378. /*
  379. * Switch interrupts
  380. */
  381. #define RTL838X_IMR_GLB (0x1100)
  382. #define RTL838X_IMR_PORT_LINK_STS_CHG (0x1104)
  383. #define RTL838X_ISR_GLB_SRC (0x1148)
  384. #define RTL838X_ISR_PORT_LINK_STS_CHG (0x114C)
  385. #define RTL839X_IMR_GLB (0x0064)
  386. #define RTL839X_IMR_PORT_LINK_STS_CHG (0x0068)
  387. #define RTL839X_ISR_GLB_SRC (0x009c)
  388. #define RTL839X_ISR_PORT_LINK_STS_CHG (0x00a0)
  389. /* Definition of family IDs */
  390. #define RTL8389_FAMILY_ID (0x8389)
  391. #define RTL8328_FAMILY_ID (0x8328)
  392. #define RTL8390_FAMILY_ID (0x8390)
  393. #define RTL8350_FAMILY_ID (0x8350)
  394. #define RTL8380_FAMILY_ID (0x8380)
  395. #define RTL8330_FAMILY_ID (0x8330)
  396. struct rtl83xx_soc_info {
  397. unsigned char *name;
  398. unsigned int id;
  399. unsigned int family;
  400. unsigned char *compatible;
  401. volatile void *sw_base;
  402. volatile void *icu_base;
  403. };
  404. /* rtl83xx-related functions used across subsystems */
  405. int rtl838x_smi_wait_op(int timeout);
  406. int rtl838x_read_phy(u32 port, u32 page, u32 reg, u32 *val);
  407. int rtl838x_write_phy(u32 port, u32 page, u32 reg, u32 val);
  408. int rtl839x_read_phy(u32 port, u32 page, u32 reg, u32 *val);
  409. int rtl839x_write_phy(u32 port, u32 page, u32 reg, u32 val);
  410. #endif /* _MACH_RTL838X_H_ */