au1000.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:36k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *
  3.  * BRIEF MODULE DESCRIPTION
  4.  * Include file for Alchemy Semiconductor's Au1k CPU.
  5.  *
  6.  * Copyright 2000,2001 MontaVista Software Inc.
  7.  * Author: MontaVista Software, Inc.
  8.  *          ppopov@mvista.com or source@mvista.com
  9.  *
  10.  *  This program is free software; you can redistribute  it and/or modify it
  11.  *  under  the terms of  the GNU General  Public License as published by the
  12.  *  Free Software Foundation;  either version 2 of the  License, or (at your
  13.  *  option) any later version.
  14.  *
  15.  *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
  16.  *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
  17.  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
  18.  *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
  19.  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  20.  *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
  21.  *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  22.  *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
  23.  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  24.  *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25.  *
  26.  *  You should have received a copy of the  GNU General Public License along
  27.  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  28.  *  675 Mass Ave, Cambridge, MA 02139, USA.
  29.  */
  30. #ifndef _AU1000_H_
  31. #define _AU1000_H_
  32. #include <linux/config.h>
  33. #include <linux/delay.h>
  34. #include <asm/io.h>
  35. /* cpu pipeline flush */
  36. void static inline au_sync(void)
  37. {
  38. __asm__ volatile ("sync");
  39. }
  40. void static inline au_sync_udelay(int us)
  41. {
  42. __asm__ volatile ("sync");
  43. udelay(us);
  44. }
  45. void static inline au_sync_delay(int ms)
  46. {
  47. __asm__ volatile ("sync");
  48. mdelay(ms);
  49. }
  50. void static inline au_writeb(u8 val, int reg)
  51. {
  52. *(volatile u8 *)(reg) = val;
  53. }
  54. void static inline au_writew(u16 val, int reg)
  55. {
  56. *(volatile u16 *)(reg) = val;
  57. }
  58. void static inline au_writel(u32 val, int reg)
  59. {
  60. *(volatile u32 *)(reg) = val;
  61. }
  62. static inline u8 au_readb(unsigned long port)
  63. {
  64. return (*(volatile u8 *)port);
  65. }
  66. static inline u16 au_readw(unsigned long port)
  67. {
  68. return (*(volatile u16 *)port);
  69. }
  70. static inline u32 au_readl(unsigned long port)
  71. {
  72. return (*(volatile u32 *)port);
  73. }
  74. /* arch/mips/au1000/common/clocks.c */
  75. extern void set_au1000_speed(unsigned int new_freq);
  76. extern unsigned int get_au1000_speed(void);
  77. extern void set_au1000_uart_baud_base(unsigned long new_baud_base);
  78. extern unsigned long get_au1000_uart_baud_base(void);
  79. extern void set_au1000_lcd_clock(void);
  80. extern unsigned int get_au1000_lcd_clock(void);
  81. #ifdef CONFIG_PM
  82. /* no CP0 timer irq */
  83. #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4)
  84. #else
  85. #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
  86. #endif
  87. /* SDRAM Controller */
  88. #define MEM_SDMODE0                0xB4000000
  89. #define MEM_SDMODE1                0xB4000004
  90. #define MEM_SDMODE2                0xB4000008
  91. #define MEM_SDADDR0                0xB400000C
  92. #define MEM_SDADDR1                0xB4000010
  93. #define MEM_SDADDR2                0xB4000014
  94. #define MEM_SDREFCFG               0xB4000018
  95. #define MEM_SDPRECMD               0xB400001C
  96. #define MEM_SDAUTOREF              0xB4000020
  97. #define MEM_SDWRMD0                0xB4000024
  98. #define MEM_SDWRMD1                0xB4000028
  99. #define MEM_SDWRMD2                0xB400002C
  100. #define MEM_SDSLEEP                0xB4000030
  101. #define MEM_SDSMCKE                0xB4000034
  102. /* Static Bus Controller */
  103. #define MEM_STCFG0                 0xB4001000
  104. #define MEM_STTIME0                0xB4001004
  105. #define MEM_STADDR0                0xB4001008
  106. #define MEM_STCFG1                 0xB4001010
  107. #define MEM_STTIME1                0xB4001014
  108. #define MEM_STADDR1                0xB4001018
  109. #define MEM_STCFG2                 0xB4001020
  110. #define MEM_STTIME2                0xB4001024
  111. #define MEM_STADDR2                0xB4001028
  112. #define MEM_STCFG3                 0xB4001030
  113. #define MEM_STTIME3                0xB4001034
  114. #define MEM_STADDR3                0xB4001038
  115. /* Interrupt Controller 0 */
  116. #define IC0_CFG0RD                 0xB0400040
  117. #define IC0_CFG0SET                0xB0400040
  118. #define IC0_CFG0CLR                0xB0400044
  119. #define IC0_CFG1RD                 0xB0400048
  120. #define IC0_CFG1SET                0xB0400048
  121. #define IC0_CFG1CLR                0xB040004C
  122. #define IC0_CFG2RD                 0xB0400050
  123. #define IC0_CFG2SET                0xB0400050
  124. #define IC0_CFG2CLR                0xB0400054
  125. #define IC0_REQ0INT                0xB0400054
  126. #define IC0_SRCRD                  0xB0400058
  127. #define IC0_SRCSET                 0xB0400058
  128. #define IC0_SRCCLR                 0xB040005C
  129. #define IC0_REQ1INT                0xB040005C
  130. #define IC0_ASSIGNRD               0xB0400060
  131. #define IC0_ASSIGNSET              0xB0400060
  132. #define IC0_ASSIGNCLR              0xB0400064
  133. #define IC0_WAKERD                 0xB0400068
  134. #define IC0_WAKESET                0xB0400068
  135. #define IC0_WAKECLR                0xB040006C
  136. #define IC0_MASKRD                 0xB0400070
  137. #define IC0_MASKSET                0xB0400070
  138. #define IC0_MASKCLR                0xB0400074
  139. #define IC0_RISINGRD               0xB0400078
  140. #define IC0_RISINGCLR              0xB0400078
  141. #define IC0_FALLINGRD              0xB040007C
  142. #define IC0_FALLINGCLR             0xB040007C
  143. #define IC0_TESTBIT                0xB0400080
  144. /* Interrupt Controller 1 */
  145. #define IC1_CFG0RD                 0xB1800040
  146. #define IC1_CFG0SET                0xB1800040
  147. #define IC1_CFG0CLR                0xB1800044
  148. #define IC1_CFG1RD                 0xB1800048
  149. #define IC1_CFG1SET                0xB1800048
  150. #define IC1_CFG1CLR                0xB180004C
  151. #define IC1_CFG2RD                 0xB1800050
  152. #define IC1_CFG2SET                0xB1800050
  153. #define IC1_CFG2CLR                0xB1800054
  154. #define IC1_REQ0INT                0xB1800054
  155. #define IC1_SRCRD                  0xB1800058
  156. #define IC1_SRCSET                 0xB1800058
  157. #define IC1_SRCCLR                 0xB180005C
  158. #define IC1_REQ1INT                0xB180005C
  159. #define IC1_ASSIGNRD               0xB1800060
  160. #define IC1_ASSIGNSET              0xB1800060
  161. #define IC1_ASSIGNCLR              0xB1800064
  162. #define IC1_WAKERD                 0xB1800068
  163. #define IC1_WAKESET                0xB1800068
  164. #define IC1_WAKECLR                0xB180006C
  165. #define IC1_MASKRD                 0xB1800070
  166. #define IC1_MASKSET                0xB1800070
  167. #define IC1_MASKCLR                0xB1800074
  168. #define IC1_RISINGRD               0xB1800078
  169. #define IC1_RISINGCLR              0xB1800078
  170. #define IC1_FALLINGRD              0xB180007C
  171. #define IC1_FALLINGCLR             0xB180007C
  172. #define IC1_TESTBIT                0xB1800080
  173. /* Interrupt Configuration Modes */
  174. #define INTC_INT_DISABLED                0
  175. #define INTC_INT_RISE_EDGE             0x1
  176. #define INTC_INT_FALL_EDGE             0x2
  177. #define INTC_INT_RISE_AND_FALL_EDGE    0x3
  178. #define INTC_INT_HIGH_LEVEL            0x5
  179. #define INTC_INT_LOW_LEVEL             0x6
  180. #define INTC_INT_HIGH_AND_LOW_LEVEL    0x7
  181. /* Interrupt Numbers */
  182. #define AU1000_UART0_INT          0
  183. #define AU1000_UART1_INT          1 /* au1000 */
  184. #define AU1000_UART2_INT          2 /* au1000 */
  185. #define AU1000_PCI_INTA           1 /* au1500 */
  186. #define AU1000_PCI_INTB           2 /* au1500 */
  187. #define AU1000_UART3_INT          3
  188. #define AU1000_SSI0_INT           4 /* au1000 */
  189. #define AU1000_SSI1_INT           5 /* au1000 */
  190. #define AU1000_PCI_INTC           4 /* au1500 */
  191. #define AU1000_PCI_INTD           5 /* au1500 */
  192. #define AU1000_DMA_INT_BASE       6
  193. #define AU1000_TOY_INT            14
  194. #define AU1000_TOY_MATCH0_INT     15
  195. #define AU1000_TOY_MATCH1_INT     16
  196. #define AU1000_TOY_MATCH2_INT     17
  197. #define AU1000_RTC_INT            18
  198. #define AU1000_RTC_MATCH0_INT     19
  199. #define AU1000_RTC_MATCH1_INT     20
  200. #define AU1000_RTC_MATCH2_INT     21
  201. #define AU1000_IRDA_TX_INT        22 /* au1000 */
  202. #define AU1000_IRDA_RX_INT        23 /* au1000 */
  203. #define AU1000_USB_DEV_REQ_INT    24
  204. #define AU1000_USB_DEV_SUS_INT    25
  205. #define AU1000_USB_HOST_INT       26
  206. #define AU1000_ACSYNC_INT         27
  207. #define AU1000_MAC0_DMA_INT       28
  208. #define AU1000_MAC1_DMA_INT       29
  209. #define AU1000_ETH0_IRQ           AU1000_MAC0_DMA_INT
  210. #define AU1000_ETH1_IRQ           AU1000_MAC1_DMA_INT
  211. #define AU1000_I2S_UO_INT         30 /* au1000 */
  212. #define AU1000_AC97C_INT          31
  213. #define AU1000_LAST_INTC0_INT     AU1000_AC97C_INT
  214. #define AU1000_GPIO_0             32
  215. #define AU1000_GPIO_1             33
  216. #define AU1000_GPIO_2             34
  217. #define AU1000_GPIO_3             35
  218. #define AU1000_GPIO_4             36
  219. #define AU1000_GPIO_5             37
  220. #define AU1000_GPIO_6             38
  221. #define AU1000_GPIO_7             39
  222. #define AU1000_GPIO_8             40
  223. #define AU1000_GPIO_9             41
  224. #define AU1000_GPIO_10            42
  225. #define AU1000_GPIO_11            43
  226. #define AU1000_GPIO_12            44
  227. #define AU1000_GPIO_13            45
  228. #define AU1000_GPIO_14            46
  229. #define AU1000_GPIO_15            47
  230. /* Au1000 only */
  231. #define AU1000_GPIO_16            48
  232. #define AU1000_GPIO_17            49
  233. #define AU1000_GPIO_18            50
  234. #define AU1000_GPIO_19            51
  235. #define AU1000_GPIO_20            52
  236. #define AU1000_GPIO_21            53
  237. #define AU1000_GPIO_22            54
  238. #define AU1000_GPIO_23            55
  239. #define AU1000_GPIO_24            56
  240. #define AU1000_GPIO_25            57
  241. #define AU1000_GPIO_26            58
  242. #define AU1000_GPIO_27            59
  243. #define AU1000_GPIO_28            60
  244. #define AU1000_GPIO_29            61
  245. #define AU1000_GPIO_30            62
  246. #define AU1000_GPIO_31            63
  247. /* Au1500 only */
  248. #define AU1500_GPIO_200           48
  249. #define AU1500_GPIO_201           49
  250. #define AU1500_GPIO_202           50
  251. #define AU1500_GPIO_203           51
  252. #define AU1500_GPIO_20            52
  253. #define AU1500_GPIO_204           53
  254. #define AU1500_GPIO_205           54
  255. #define AU1500_GPIO_23            55
  256. #define AU1500_GPIO_24            56
  257. #define AU1500_GPIO_25            57
  258. #define AU1500_GPIO_26            58
  259. #define AU1500_GPIO_27            59
  260. #define AU1500_GPIO_28            60
  261. #define AU1500_GPIO_206           61
  262. #define AU1500_GPIO_207           62
  263. #define AU1500_GPIO_208_215       63
  264. #define AU1000_MAX_INTR           63
  265. #define AU1100_SD 2
  266. #define AU1100_GPIO_208_215 29
  267. // REDEFINE SECONDARY GPIO BLOCK INTO IC1 CONTROLLER HERE
  268. /* Programmable Counters 0 and 1 */
  269. #define SYS_BASE                   0xB1900000
  270. #define SYS_COUNTER_CNTRL          (SYS_BASE + 0x14)
  271.   #define SYS_CNTRL_E1S            (1<<23)
  272.   #define SYS_CNTRL_T1S            (1<<20)
  273.   #define SYS_CNTRL_M21            (1<<19)
  274.   #define SYS_CNTRL_M11            (1<<18)
  275.   #define SYS_CNTRL_M01            (1<<17)
  276.   #define SYS_CNTRL_C1S            (1<<16)
  277.   #define SYS_CNTRL_BP             (1<<14)
  278.   #define SYS_CNTRL_EN1            (1<<13)
  279.   #define SYS_CNTRL_BT1            (1<<12)
  280.   #define SYS_CNTRL_EN0            (1<<11)
  281.   #define SYS_CNTRL_BT0            (1<<10)
  282.   #define SYS_CNTRL_E0             (1<<8)
  283.   #define SYS_CNTRL_E0S            (1<<7)
  284.   #define SYS_CNTRL_32S            (1<<5)
  285.   #define SYS_CNTRL_T0S            (1<<4)
  286.   #define SYS_CNTRL_M20            (1<<3)
  287.   #define SYS_CNTRL_M10            (1<<2)
  288.   #define SYS_CNTRL_M00            (1<<1)
  289.   #define SYS_CNTRL_C0S            (1<<0)
  290. /* Programmable Counter 0 Registers */
  291. #define SYS_TOYTRIM                 (SYS_BASE + 0)
  292. #define SYS_TOYWRITE                (SYS_BASE + 4)
  293. #define SYS_TOYMATCH0               (SYS_BASE + 8)
  294. #define SYS_TOYMATCH1               (SYS_BASE + 0xC)
  295. #define SYS_TOYMATCH2               (SYS_BASE + 0x10)
  296. #define SYS_TOYREAD                 (SYS_BASE + 0x40)
  297. /* Programmable Counter 1 Registers */
  298. #define SYS_RTCTRIM                 (SYS_BASE + 0x44)
  299. #define SYS_RTCWRITE                (SYS_BASE + 0x48)
  300. #define SYS_RTCMATCH0               (SYS_BASE + 0x4C)
  301. #define SYS_RTCMATCH1               (SYS_BASE + 0x50)
  302. #define SYS_RTCMATCH2               (SYS_BASE + 0x54)
  303. #define SYS_RTCREAD                 (SYS_BASE + 0x58)
  304. /* I2S Controller */
  305. #define I2S_DATA                    0xB1000000
  306.   #define I2S_DATA_MASK        (0xffffff)
  307. #define I2S_CONFIG                0xB1000004
  308.   #define I2S_CONFIG_XU        (1<<25)
  309.   #define I2S_CONFIG_XO        (1<<24)
  310.   #define I2S_CONFIG_RU        (1<<23)
  311.   #define I2S_CONFIG_RO        (1<<22)
  312.   #define I2S_CONFIG_TR        (1<<21)
  313.   #define I2S_CONFIG_TE        (1<<20)
  314.   #define I2S_CONFIG_TF        (1<<19)
  315.   #define I2S_CONFIG_RR        (1<<18)
  316.   #define I2S_CONFIG_RE        (1<<17)
  317.   #define I2S_CONFIG_RF        (1<<16)
  318.   #define I2S_CONFIG_PD        (1<<11)
  319.   #define I2S_CONFIG_LB        (1<<10)
  320.   #define I2S_CONFIG_IC        (1<<9)
  321.   #define I2S_CONFIG_FM_BIT    7
  322.   #define I2S_CONFIG_FM_MASK     (0x3 << I2S_CONFIG_FM_BIT)
  323.     #define I2S_CONFIG_FM_I2S    (0x0 << I2S_CONFIG_FM_BIT)
  324.     #define I2S_CONFIG_FM_LJ     (0x1 << I2S_CONFIG_FM_BIT)
  325.     #define I2S_CONFIG_FM_RJ     (0x2 << I2S_CONFIG_FM_BIT)
  326.   #define I2S_CONFIG_TN        (1<<6)
  327.   #define I2S_CONFIG_RN        (1<<5)
  328.   #define I2S_CONFIG_SZ_BIT    0
  329.   #define I2S_CONFIG_SZ_MASK     (0x1F << I2S_CONFIG_SZ_BIT)
  330. #define I2S_CONTROL                0xB1000008
  331.   #define I2S_CONTROL_D         (1<<1)
  332.   #define I2S_CONTROL_CE        (1<<0)
  333. /* USB Host Controller */
  334. // We pass USB_OHCI_BASE to ioremap, so it needs to be a physical address
  335. #define USB_OHCI_BASE             0x10100000
  336. #define USB_OHCI_LEN              0x00100000
  337. #define USB_HOST_CONFIG           0xB017fffc
  338. /* USB Device Controller */
  339. #define USBD_EP0RD                0xB0200000
  340. #define USBD_EP0WR                0xB0200004
  341. #define USBD_EP2WR                0xB0200008
  342. #define USBD_EP3WR                0xB020000C
  343. #define USBD_EP4RD                0xB0200010
  344. #define USBD_EP5RD                0xB0200014
  345. #define USBD_INTEN                0xB0200018
  346. #define USBD_INTSTAT              0xB020001C
  347.   #define USBDEV_INT_SOF       (1<<12)
  348.   #define USBDEV_INT_HF_BIT    6
  349.   #define USBDEV_INT_HF_MASK   (0x3f << USBDEV_INT_HF_BIT)
  350.   #define USBDEV_INT_CMPLT_BIT  0
  351.   #define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT)
  352. #define USBD_CONFIG               0xB0200020
  353. #define USBD_EP0CS                0xB0200024
  354. #define USBD_EP2CS                0xB0200028
  355. #define USBD_EP3CS                0xB020002C
  356. #define USBD_EP4CS                0xB0200030
  357. #define USBD_EP5CS                0xB0200034
  358.   #define USBDEV_CS_SU         (1<<14)
  359.   #define USBDEV_CS_NAK        (1<<13)
  360.   #define USBDEV_CS_ACK        (1<<12)
  361.   #define USBDEV_CS_BUSY       (1<<11)
  362.   #define USBDEV_CS_TSIZE_BIT  1
  363.   #define USBDEV_CS_TSIZE_MASK (0x3ff << USBDEV_CS_TSIZE_BIT)
  364.   #define USBDEV_CS_STALL      (1<<0)
  365. #define USBD_EP0RDSTAT            0xB0200040
  366. #define USBD_EP0WRSTAT            0xB0200044
  367. #define USBD_EP2WRSTAT            0xB0200048
  368. #define USBD_EP3WRSTAT            0xB020004C
  369. #define USBD_EP4RDSTAT            0xB0200050
  370. #define USBD_EP5RDSTAT            0xB0200054
  371.   #define USBDEV_FSTAT_FLUSH     (1<<6)
  372.   #define USBDEV_FSTAT_UF        (1<<5)
  373.   #define USBDEV_FSTAT_OF        (1<<4)
  374.   #define USBDEV_FSTAT_FCNT_BIT  0
  375.   #define USBDEV_FSTAT_FCNT_MASK (0x0f << USBDEV_FSTAT_FCNT_BIT)
  376. #define USBD_ENABLE               0xB0200058
  377.   #define USBDEV_ENABLE (1<<1)
  378.   #define USBDEV_CE     (1<<0)
  379. /* Ethernet Controllers  */
  380. #define AU1000_ETH0_BASE          0xB0500000
  381. #define AU1000_ETH1_BASE          0xB0510000
  382. #define AU1500_ETH0_BASE   0xB1500000
  383. #define AU1500_ETH1_BASE   0xB1510000
  384. #define AU1100_ETH0_BASE   0xB0500000
  385. /* 4 byte offsets from AU1000_ETH_BASE */
  386. #define MAC_CONTROL                     0x0
  387.   #define MAC_RX_ENABLE               (1<<2)
  388.   #define MAC_TX_ENABLE               (1<<3)
  389.   #define MAC_DEF_CHECK               (1<<5)
  390.   #define MAC_SET_BL(X)       (((X)&0x3)<<6)
  391.   #define MAC_AUTO_PAD                (1<<8)
  392.   #define MAC_DISABLE_RETRY          (1<<10)
  393.   #define MAC_DISABLE_BCAST          (1<<11)
  394.   #define MAC_LATE_COL               (1<<12)
  395.   #define MAC_HASH_MODE              (1<<13)
  396.   #define MAC_HASH_ONLY              (1<<15)
  397.   #define MAC_PASS_ALL               (1<<16)
  398.   #define MAC_INVERSE_FILTER         (1<<17)
  399.   #define MAC_PROMISCUOUS            (1<<18)
  400.   #define MAC_PASS_ALL_MULTI         (1<<19)
  401.   #define MAC_FULL_DUPLEX            (1<<20)
  402.   #define MAC_NORMAL_MODE                 0
  403.   #define MAC_INT_LOOPBACK           (1<<21)
  404.   #define MAC_EXT_LOOPBACK           (1<<22)
  405.   #define MAC_DISABLE_RX_OWN         (1<<23)
  406.   #define MAC_BIG_ENDIAN             (1<<30)
  407.   #define MAC_RX_ALL                 (1<<31)
  408. #define MAC_ADDRESS_HIGH                0x4
  409. #define MAC_ADDRESS_LOW                 0x8
  410. #define MAC_MCAST_HIGH                  0xC
  411. #define MAC_MCAST_LOW                  0x10
  412. #define MAC_MII_CNTRL                  0x14
  413.   #define MAC_MII_BUSY                (1<<0)
  414.   #define MAC_MII_READ                     0
  415.   #define MAC_MII_WRITE               (1<<1)
  416.   #define MAC_SET_MII_SELECT_REG(X)   (((X)&0x1f)<<6)
  417.   #define MAC_SET_MII_SELECT_PHY(X)   (((X)&0x1f)<<11)
  418. #define MAC_MII_DATA                   0x18
  419. #define MAC_FLOW_CNTRL                 0x1C
  420.   #define MAC_FLOW_CNTRL_BUSY         (1<<0)
  421.   #define MAC_FLOW_CNTRL_ENABLE       (1<<1)
  422.   #define MAC_PASS_CONTROL            (1<<2)
  423.   #define MAC_SET_PAUSE(X)        (((X)&0xffff)<<16)
  424. #define MAC_VLAN1_TAG                  0x20
  425. #define MAC_VLAN2_TAG                  0x24
  426. /* Ethernet Controller Enable */
  427. #define AU1000_MAC0_ENABLE       0xB0520000
  428. #define AU1000_MAC1_ENABLE       0xB0520004
  429. #define AU1500_MAC0_ENABLE       0xB1520000
  430. #define AU1500_MAC1_ENABLE       0xB1520004
  431. #define AU1100_MAC0_ENABLE       0xB0520000
  432.   #define MAC_EN_CLOCK_ENABLE         (1<<0)
  433.   #define MAC_EN_RESET0               (1<<1)
  434.   #define MAC_EN_TOSS                 (0<<2)
  435.   #define MAC_EN_CACHEABLE            (1<<3)
  436.   #define MAC_EN_RESET1               (1<<4)
  437.   #define MAC_EN_RESET2               (1<<5)
  438.   #define MAC_DMA_RESET               (1<<6)
  439. /* Ethernet Controller DMA Channels */
  440. #define MAC0_TX_DMA_ADDR         0xB4004000
  441. #define MAC1_TX_DMA_ADDR         0xB4004200
  442. /* offsets from MAC_TX_RING_ADDR address */
  443. #define MAC_TX_BUFF0_STATUS             0x0
  444.   #define TX_FRAME_ABORTED            (1<<0)
  445.   #define TX_JAB_TIMEOUT              (1<<1)
  446.   #define TX_NO_CARRIER               (1<<2)
  447.   #define TX_LOSS_CARRIER             (1<<3)
  448.   #define TX_EXC_DEF                  (1<<4)
  449.   #define TX_LATE_COLL_ABORT          (1<<5)
  450.   #define TX_EXC_COLL                 (1<<6)
  451.   #define TX_UNDERRUN                 (1<<7)
  452.   #define TX_DEFERRED                 (1<<8)
  453.   #define TX_LATE_COLL                (1<<9)
  454.   #define TX_COLL_CNT_MASK         (0xF<<10)
  455.   #define TX_PKT_RETRY               (1<<31)
  456. #define MAC_TX_BUFF0_ADDR                0x4
  457.   #define TX_DMA_ENABLE               (1<<0)
  458.   #define TX_T_DONE                   (1<<1)
  459.   #define TX_GET_DMA_BUFFER(X)    (((X)>>2)&0x3)
  460. #define MAC_TX_BUFF0_LEN                 0x8
  461. #define MAC_TX_BUFF1_STATUS             0x10
  462. #define MAC_TX_BUFF1_ADDR               0x14
  463. #define MAC_TX_BUFF1_LEN                0x18
  464. #define MAC_TX_BUFF2_STATUS             0x20
  465. #define MAC_TX_BUFF2_ADDR               0x24
  466. #define MAC_TX_BUFF2_LEN                0x28
  467. #define MAC_TX_BUFF3_STATUS             0x30
  468. #define MAC_TX_BUFF3_ADDR               0x34
  469. #define MAC_TX_BUFF3_LEN                0x38
  470. #define MAC0_RX_DMA_ADDR         0xB4004100
  471. #define MAC1_RX_DMA_ADDR         0xB4004300
  472. /* offsets from MAC_RX_RING_ADDR */
  473. #define MAC_RX_BUFF0_STATUS              0x0
  474.   #define RX_FRAME_LEN_MASK           0x3fff
  475.   #define RX_WDOG_TIMER              (1<<14)
  476.   #define RX_RUNT                    (1<<15)
  477.   #define RX_OVERLEN                 (1<<16)
  478.   #define RX_COLL                    (1<<17)
  479.   #define RX_ETHER                   (1<<18)
  480.   #define RX_MII_ERROR               (1<<19)
  481.   #define RX_DRIBBLING               (1<<20)
  482.   #define RX_CRC_ERROR               (1<<21)
  483.   #define RX_VLAN1                   (1<<22)
  484.   #define RX_VLAN2                   (1<<23)
  485.   #define RX_LEN_ERROR               (1<<24)
  486.   #define RX_CNTRL_FRAME             (1<<25)
  487.   #define RX_U_CNTRL_FRAME           (1<<26)
  488.   #define RX_MCAST_FRAME             (1<<27)
  489.   #define RX_BCAST_FRAME             (1<<28)
  490.   #define RX_FILTER_FAIL             (1<<29)
  491.   #define RX_PACKET_FILTER           (1<<30)
  492.   #define RX_MISSED_FRAME            (1<<31)
  493.   #define RX_ERROR (RX_WDOG_TIMER | RX_RUNT | RX_OVERLEN |  
  494.                     RX_COLL | RX_MII_ERROR | RX_CRC_ERROR | 
  495.                     RX_LEN_ERROR | RX_U_CNTRL_FRAME | RX_MISSED_FRAME)
  496. #define MAC_RX_BUFF0_ADDR                0x4
  497.   #define RX_DMA_ENABLE               (1<<0)
  498.   #define RX_T_DONE                   (1<<1)
  499.   #define RX_GET_DMA_BUFFER(X)    (((X)>>2)&0x3)
  500.   #define RX_SET_BUFF_ADDR(X)     ((X)&0xffffffc0)
  501. #define MAC_RX_BUFF1_STATUS              0x10
  502. #define MAC_RX_BUFF1_ADDR                0x14
  503. #define MAC_RX_BUFF2_STATUS              0x20
  504. #define MAC_RX_BUFF2_ADDR                0x24
  505. #define MAC_RX_BUFF3_STATUS              0x30
  506. #define MAC_RX_BUFF3_ADDR                0x34
  507. /* UARTS 0-3 */
  508. #define UART_BASE                 0xB1100000
  509. #define UART0_ADDR                0xB1100000
  510. #define UART1_ADDR                0xB1200000
  511. #define UART2_ADDR                0xB1300000
  512. #define UART3_ADDR                0xB1400000
  513. #define UART_RX 0 /* Receive buffer */
  514. #define UART_TX 4 /* Transmit buffer */
  515. #define UART_IER 8 /* Interrupt Enable Register */
  516. #define UART_IIR 0xC /* Interrupt ID Register */
  517. #define UART_FCR 0x10 /* FIFO Control Register */
  518. #define UART_LCR 0x14 /* Line Control Register */
  519. #define UART_MCR 0x18 /* Modem Control Register */
  520. #define UART_LSR 0x1C /* Line Status Register */
  521. #define UART_MSR 0x20 /* Modem Status Register */
  522. #define UART_CLK 0x28 /* Baud Rate Clock Divider */
  523. #define UART_MOD_CNTRL 0x100 /* Module Control */
  524. #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
  525. #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
  526. #define UART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
  527. #define UART_FCR_DMA_SELECT 0x08 /* For DMA applications */
  528. #define UART_FCR_TRIGGER_MASK 0xF0 /* Mask for the FIFO trigger range */
  529. #define UART_FCR_R_TRIGGER_1 0x00 /* Mask for receive trigger set at 1 */
  530. #define UART_FCR_R_TRIGGER_4 0x40 /* Mask for receive trigger set at 4 */
  531. #define UART_FCR_R_TRIGGER_8 0x80 /* Mask for receive trigger set at 8 */
  532. #define UART_FCR_R_TRIGGER_14   0xA0 /* Mask for receive trigger set at 14 */
  533. #define UART_FCR_T_TRIGGER_0 0x00 /* Mask for transmit trigger set at 0 */
  534. #define UART_FCR_T_TRIGGER_4 0x10 /* Mask for transmit trigger set at 4 */
  535. #define UART_FCR_T_TRIGGER_8    0x20 /* Mask for transmit trigger set at 8 */
  536. #define UART_FCR_T_TRIGGER_12 0x30 /* Mask for transmit trigger set at 12 */
  537. /*
  538.  * These are the definitions for the Line Control Register
  539.  */
  540. #define UART_LCR_SBC 0x40 /* Set break control */
  541. #define UART_LCR_SPAR 0x20 /* Stick parity (?) */
  542. #define UART_LCR_EPAR 0x10 /* Even parity select */
  543. #define UART_LCR_PARITY 0x08 /* Parity Enable */
  544. #define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
  545. #define UART_LCR_WLEN5  0x00 /* Wordlength: 5 bits */
  546. #define UART_LCR_WLEN6  0x01 /* Wordlength: 6 bits */
  547. #define UART_LCR_WLEN7  0x02 /* Wordlength: 7 bits */
  548. #define UART_LCR_WLEN8  0x03 /* Wordlength: 8 bits */
  549. /*
  550.  * These are the definitions for the Line Status Register
  551.  */
  552. #define UART_LSR_TEMT 0x40 /* Transmitter empty */
  553. #define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
  554. #define UART_LSR_BI 0x10 /* Break interrupt indicator */
  555. #define UART_LSR_FE 0x08 /* Frame error indicator */
  556. #define UART_LSR_PE 0x04 /* Parity error indicator */
  557. #define UART_LSR_OE 0x02 /* Overrun error indicator */
  558. #define UART_LSR_DR 0x01 /* Receiver data ready */
  559. /*
  560.  * These are the definitions for the Interrupt Identification Register
  561.  */
  562. #define UART_IIR_NO_INT 0x01 /* No interrupts pending */
  563. #define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
  564. #define UART_IIR_MSI 0x00 /* Modem status interrupt */
  565. #define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
  566. #define UART_IIR_RDI 0x04 /* Receiver data interrupt */
  567. #define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
  568. /*
  569.  * These are the definitions for the Interrupt Enable Register
  570.  */
  571. #define UART_IER_MSI 0x08 /* Enable Modem status interrupt */
  572. #define UART_IER_RLSI 0x04 /* Enable receiver line status interrupt */
  573. #define UART_IER_THRI 0x02 /* Enable Transmitter holding register int. */
  574. #define UART_IER_RDI 0x01 /* Enable receiver data interrupt */
  575. /*
  576.  * These are the definitions for the Modem Control Register
  577.  */
  578. #define UART_MCR_LOOP 0x10 /* Enable loopback test mode */
  579. #define UART_MCR_OUT2 0x08 /* Out2 complement */
  580. #define UART_MCR_OUT1 0x04 /* Out1 complement */
  581. #define UART_MCR_RTS 0x02 /* RTS complement */
  582. #define UART_MCR_DTR 0x01 /* DTR complement */
  583. /*
  584.  * These are the definitions for the Modem Status Register
  585.  */
  586. #define UART_MSR_DCD 0x80 /* Data Carrier Detect */
  587. #define UART_MSR_RI 0x40 /* Ring Indicator */
  588. #define UART_MSR_DSR 0x20 /* Data Set Ready */
  589. #define UART_MSR_CTS 0x10 /* Clear to Send */
  590. #define UART_MSR_DDCD 0x08 /* Delta DCD */
  591. #define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
  592. #define UART_MSR_DDSR 0x02 /* Delta DSR */
  593. #define UART_MSR_DCTS 0x01 /* Delta CTS */
  594. #define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
  595. /* SSIO */
  596. #define SSI0_STATUS                0xB1600000
  597.   #define SSI_STATUS_BF              (1<<4)
  598.   #define SSI_STATUS_OF              (1<<3)
  599.   #define SSI_STATUS_UF              (1<<2)
  600.   #define SSI_STATUS_D               (1<<1)
  601.   #define SSI_STATUS_B               (1<<0)
  602. #define SSI0_INT                   0xB1600004
  603.   #define SSI_INT_OI                 (1<<3)
  604.   #define SSI_INT_UI                 (1<<2)
  605.   #define SSI_INT_DI                 (1<<1)
  606. #define SSI0_INT_ENABLE            0xB1600008
  607.   #define SSI_INTE_OIE               (1<<3)
  608.   #define SSI_INTE_UIE               (1<<2)
  609.   #define SSI_INTE_DIE               (1<<1)
  610. #define SSI0_CONFIG                0xB1600020
  611.   #define SSI_CONFIG_AO              (1<<24)
  612.   #define SSI_CONFIG_DO              (1<<23)
  613.   #define SSI_CONFIG_ALEN_BIT        20
  614.     #define SSI_CONFIG_ALEN_MASK       (0x7<<20)
  615.   #define SSI_CONFIG_DLEN_BIT        16
  616.     #define SSI_CONFIG_DLEN_MASK       (0x7<<16)
  617.   #define SSI_CONFIG_DD              (1<<11)
  618.   #define SSI_CONFIG_AD              (1<<10)
  619.   #define SSI_CONFIG_BM_BIT          8
  620.     #define SSI_CONFIG_BM_MASK         (0x3<<8)
  621.   #define SSI_CONFIG_CE              (1<<7)
  622.   #define SSI_CONFIG_DP              (1<<6)
  623.   #define SSI_CONFIG_DL              (1<<5)
  624.   #define SSI_CONFIG_EP              (1<<4)
  625. #define SSI0_ADATA                 0xB1600024
  626.   #define SSI_AD_D                   (1<<24)
  627.   #define SSI_AD_ADDR_BIT            16
  628.     #define SSI_AD_ADDR_MASK           (0xff<<16)
  629.   #define SSI_AD_DATA_BIT            0
  630.     #define SSI_AD_DATA_MASK           (0xfff<<0)
  631. #define SSI0_CLKDIV                0xB1600028
  632. #define SSI0_CONTROL               0xB1600100
  633.   #define SSI_CONTROL_CD             (1<<1)
  634.   #define SSI_CONTROL_E              (1<<0)
  635. /* SSI1 */
  636. #define SSI1_STATUS                0xB1680000
  637. #define SSI1_INT                   0xB1680004
  638. #define SSI1_INT_ENABLE            0xB1680008
  639. #define SSI1_CONFIG                0xB1680020
  640. #define SSI1_ADATA                 0xB1680024
  641. #define SSI1_CLKDIV                0xB1680028
  642. #define SSI1_CONTROL               0xB1680100
  643. /* IrDA Controller */
  644. #define IRDA_BASE                 0xB0300000
  645. #define IR_RING_PTR_STATUS        (IRDA_BASE+0x00)
  646. #define IR_RING_BASE_ADDR_H       (IRDA_BASE+0x04)
  647. #define IR_RING_BASE_ADDR_L       (IRDA_BASE+0x08)
  648. #define IR_RING_SIZE              (IRDA_BASE+0x0C)
  649. #define IR_RING_PROMPT            (IRDA_BASE+0x10)
  650. #define IR_RING_ADDR_CMPR         (IRDA_BASE+0x14)
  651. #define IR_INT_CLEAR              (IRDA_BASE+0x18)
  652. #define IR_CONFIG_1               (IRDA_BASE+0x20)
  653.   #define IR_RX_INVERT_LED        (1<<0)
  654.   #define IR_TX_INVERT_LED        (1<<1)
  655.   #define IR_ST                   (1<<2)
  656.   #define IR_SF                   (1<<3)
  657.   #define IR_SIR                  (1<<4)
  658.   #define IR_MIR                  (1<<5)
  659.   #define IR_FIR                  (1<<6)
  660.   #define IR_16CRC                (1<<7)
  661.   #define IR_TD                   (1<<8)
  662.   #define IR_RX_ALL               (1<<9)
  663.   #define IR_DMA_ENABLE           (1<<10)
  664.   #define IR_RX_ENABLE            (1<<11)
  665.   #define IR_TX_ENABLE            (1<<12)
  666.   #define IR_LOOPBACK             (1<<14)
  667.   #define IR_SIR_MODE           (IR_SIR | IR_DMA_ENABLE | 
  668.                    IR_RX_ALL | IR_RX_ENABLE | IR_SF | IR_16CRC)
  669. #define IR_SIR_FLAGS              (IRDA_BASE+0x24)
  670. #define IR_ENABLE                 (IRDA_BASE+0x28)
  671.   #define IR_RX_STATUS            (1<<9)
  672.   #define IR_TX_STATUS            (1<<10)
  673. #define IR_READ_PHY_CONFIG        (IRDA_BASE+0x2C)
  674. #define IR_WRITE_PHY_CONFIG       (IRDA_BASE+0x30)
  675. #define IR_MAX_PKT_LEN            (IRDA_BASE+0x34)
  676. #define IR_RX_BYTE_CNT            (IRDA_BASE+0x38)
  677. #define IR_CONFIG_2               (IRDA_BASE+0x3C)
  678.   #define IR_MODE_INV             (1<<0)
  679.   #define IR_ONE_PIN              (1<<1)
  680. #define IR_INTERFACE_CONFIG       (IRDA_BASE+0x40)
  681. /* GPIO */
  682. #define SYS_PINFUNC               0xB190002C
  683.   #define SYS_PF_USB (1<<15) /* 2nd USB device/host */
  684.   #define SYS_PF_U3 (1<<14) /* GPIO23/U3TXD */
  685.   #define SYS_PF_U2 (1<<13) /* GPIO22/U2TXD */
  686.   #define SYS_PF_U1 (1<<12) /* GPIO21/U1TXD */
  687.   #define SYS_PF_SRC (1<<11) /* GPIO6/SROMCKE */
  688.   #define SYS_PF_CK5 (1<<10) /* GPIO3/CLK5 */
  689.   #define SYS_PF_CK4 (1<<9) /* GPIO2/CLK4 */
  690.   #define SYS_PF_IRF (1<<8) /* GPIO15/IRFIRSEL */
  691.   #define SYS_PF_UR3 (1<<7) /* GPIO[14:9]/UART3 */
  692.   #define SYS_PF_I2D (1<<6) /* GPIO8/I2SDI */
  693.   #define SYS_PF_I2S (1<<5) /* I2S/GPIO[29:31] */
  694.   #define SYS_PF_NI2 (1<<4) /* NI2/GPIO[24:28] */
  695.   #define SYS_PF_U0 (1<<3) /* U0TXD/GPIO20 */
  696.   #define SYS_PF_RD (1<<2) /* IRTXD/GPIO19 */
  697.   #define SYS_PF_A97 (1<<1) /* AC97/SSL1 */
  698.   #define SYS_PF_S0 (1<<0) /* SSI_0/GPIO[16:18] */
  699. #define SYS_TRIOUTRD              0xB1900100
  700. #define SYS_TRIOUTCLR             0xB1900100
  701. #define SYS_OUTPUTRD              0xB1900108
  702. #define SYS_OUTPUTSET             0xB1900108
  703. #define SYS_OUTPUTCLR             0xB190010C
  704. #define SYS_PINSTATERD            0xB1900110
  705. #define SYS_PININPUTEN            0xB1900110
  706. /* GPIO2, Au1500 only */
  707. #define GPIO2_BASE                0xB1700000
  708. #define GPIO2_DIR                 (GPIO2_BASE + 0)
  709. #define GPIO2_DATA_EN             (GPIO2_BASE + 8)
  710. #define GPIO2_PIN_STATE           (GPIO2_BASE + 0xC)
  711. #define GPIO2_INT_MASK            (GPIO2_BASE + 0x10)
  712. #define GPIO2_CONTROL             (GPIO2_BASE + 0x14)
  713. /* Power Management */
  714. #define SYS_SCRATCH0              0xB1900018
  715. #define SYS_SCRATCH1              0xB190001C
  716. #define SYS_WAKEMSK               0xB1900034
  717. #define SYS_ENDIAN                0xB1900038
  718. #define SYS_POWERCTRL             0xB190003C
  719. #define SYS_WAKESRC               0xB190005C
  720. #define SYS_SLPPWR                0xB1900078
  721. #define SYS_SLEEP                 0xB190007C
  722. /* Clock Controller */
  723. #define SYS_FREQCTRL0             0xB1900020
  724.   #define SYS_FC_FRDIV2_BIT         22
  725.   #define SYS_FC_FRDIV2_MASK        (0xff << FQC2_FRDIV2_BIT)
  726.   #define SYS_FC_FE2                (1<<21)
  727.   #define SYS_FC_FS2                (1<<20)
  728.   #define SYS_FC_FRDIV1_BIT         12
  729.   #define SYS_FC_FRDIV1_MASK        (0xff << FQC2_FRDIV1_BIT)
  730.   #define SYS_FC_FE1                (1<<11)
  731.   #define SYS_FC_FS1                (1<<10)
  732.   #define SYS_FC_FRDIV0_BIT         2
  733.   #define SYS_FC_FRDIV0_MASK        (0xff << FQC2_FRDIV0_BIT)
  734.   #define SYS_FC_FE0                (1<<1)
  735.   #define SYS_FC_FS0                (1<<0)
  736. #define SYS_FREQCTRL1             0xB1900024
  737.   #define SYS_FC_FRDIV5_BIT         22
  738.   #define SYS_FC_FRDIV5_MASK        (0xff << FQC2_FRDIV5_BIT)
  739.   #define SYS_FC_FE5                (1<<21)
  740.   #define SYS_FC_FS5                (1<<20)
  741.   #define SYS_FC_FRDIV4_BIT         12
  742.   #define SYS_FC_FRDIV4_MASK        (0xff << FQC2_FRDIV4_BIT)
  743.   #define SYS_FC_FE4                (1<<11)
  744.   #define SYS_FC_FS4                (1<<10)
  745.   #define SYS_FC_FRDIV3_BIT         2
  746.   #define SYS_FC_FRDIV3_MASK        (0xff << FQC2_FRDIV3_BIT)
  747.   #define SYS_FC_FE3                (1<<1)
  748.   #define SYS_FC_FS3                (1<<0)
  749. #define SYS_CLKSRC                0xB1900028
  750.   #define SYS_CS_ME1_BIT            27
  751.   #define SYS_CS_ME1_MASK           (0x7<<CSC_ME1_BIT)
  752.   #define SYS_CS_DE1                (1<<26)
  753.   #define SYS_CS_CE1                (1<<25)
  754.   #define SYS_CS_ME0_BIT            22
  755.   #define SYS_CS_ME0_MASK           (0x7<<CSC_ME0_BIT)
  756.   #define SYS_CS_DE0                (1<<21)
  757.   #define SYS_CS_CE0                (1<<20)
  758.   #define SYS_CS_MI2_BIT            17
  759.   #define SYS_CS_MI2_MASK           (0x7<<CSC_MI2_BIT)
  760.   #define SYS_CS_DI2                (1<<16)
  761.   #define SYS_CS_CI2                (1<<15)
  762.   #define SYS_CS_MUH_BIT            12
  763.   #define SYS_CS_MUH_MASK           (0x7<<CSC_MUH_BIT)
  764.   #define SYS_CS_DUH                (1<<11)
  765.   #define SYS_CS_CUH                (1<<10)
  766.   #define SYS_CS_MUD_BIT            7
  767.   #define SYS_CS_MUD_MASK           (0x7<<CSC_MUD_BIT)
  768.   #define SYS_CS_DUD                (1<<6)
  769.   #define SYS_CS_CUD                (1<<5)
  770.   #define SYS_CS_MIR_BIT            2
  771.   #define SYS_CS_MIR_MASK           (0x7<<CSC_MIR_BIT)
  772.   #define SYS_CS_DIR                (1<<1)
  773.   #define SYS_CS_CIR                (1<<0)
  774.   #define SYS_CS_MUX_AUX            0x1
  775.   #define SYS_CS_MUX_FQ0            0x2
  776.   #define SYS_CS_MUX_FQ1            0x3
  777.   #define SYS_CS_MUX_FQ2            0x4
  778.   #define SYS_CS_MUX_FQ3            0x5
  779.   #define SYS_CS_MUX_FQ4            0x6
  780.   #define SYS_CS_MUX_FQ5            0x7
  781. #define SYS_CPUPLL                0xB1900060
  782. #define SYS_AUXPLL                0xB1900064
  783. /* AC97 Controller */
  784. #define AC97C_CONFIG              0xB0000000
  785.   #define AC97C_RECV_SLOTS_BIT  13
  786.   #define AC97C_RECV_SLOTS_MASK (0x3ff << AC97C_RECV_SLOTS_BIT)
  787.   #define AC97C_XMIT_SLOTS_BIT  3
  788.   #define AC97C_XMIT_SLOTS_MASK (0x3ff << AC97C_XMIT_SLOTS_BIT)
  789.   #define AC97C_SG              (1<<2)
  790.   #define AC97C_SYNC            (1<<1)
  791.   #define AC97C_RESET           (1<<0)
  792. #define AC97C_STATUS              0xB0000004
  793.   #define AC97C_XU              (1<<11)
  794.   #define AC97C_XO              (1<<10)
  795.   #define AC97C_RU              (1<<9)
  796.   #define AC97C_RO              (1<<8)
  797.   #define AC97C_READY           (1<<7)
  798.   #define AC97C_CP              (1<<6)
  799.   #define AC97C_TR              (1<<5)
  800.   #define AC97C_TE              (1<<4)
  801.   #define AC97C_TF              (1<<3)
  802.   #define AC97C_RR              (1<<2)
  803.   #define AC97C_RE              (1<<1)
  804.   #define AC97C_RF              (1<<0)
  805. #define AC97C_DATA                0xB0000008
  806. #define AC97C_CMD                 0xB000000C
  807.   #define AC97C_WD_BIT          16
  808.   #define AC97C_READ            (1<<7)
  809.   #define AC97C_INDEX_MASK      0x7f
  810. #define AC97C_CNTRL               0xB0000010
  811.   #define AC97C_RS              (1<<1)
  812.   #define AC97C_CE              (1<<0)
  813. /* Au1500 PCI Controller */
  814. #define Au1500_CFG_BASE           0xB4005000 // virtual, kseg0 addr
  815. #define Au1500_PCI_CMEM           (Au1500_CFG_BASE + 0)
  816. #define Au1500_PCI_CFG            (Au1500_CFG_BASE + 4)
  817.   #define PCI_ERROR ((1<<22) | (1<<23) | (1<<24) | (1<<25) | (1<<26) | (1<<27))
  818. #define Au1500_PCI_B2BMASK_CCH    (Au1500_CFG_BASE + 8)
  819. #define Au1500_PCI_B2B0_VID       (Au1500_CFG_BASE + 0xC)
  820. #define Au1500_PCI_B2B1_ID        (Au1500_CFG_BASE + 0x10)
  821. #define Au1500_PCI_MWMASK_DEV     (Au1500_CFG_BASE + 0x14)
  822. #define Au1500_PCI_MWBASE_REV_CCL (Au1500_CFG_BASE + 0x18)
  823. #define Au1500_PCI_ERR_ADDR       (Au1500_CFG_BASE + 0x1C)
  824. #define Au1500_PCI_SPEC_INTACK    (Au1500_CFG_BASE + 0x20)
  825. #define Au1500_PCI_ID             (Au1500_CFG_BASE + 0x100)
  826. #define Au1500_PCI_STATCMD        (Au1500_CFG_BASE + 0x104)
  827. #define Au1500_PCI_CLASSREV       (Au1500_CFG_BASE + 0x108)
  828. #define Au1500_PCI_HDRTYPE        (Au1500_CFG_BASE + 0x10C)
  829. #define Au1500_PCI_MBAR           (Au1500_CFG_BASE + 0x110)
  830. #define Au1500_PCI_HDR            0xB4005100 // virtual, kseg0 addr
  831. /* All of our structures, like pci resource, have 32 bit members.
  832.  * Drivers are expected to do an ioremap on the PCI MEM resource, but it's
  833.  * hard to store 0x4 0000 0000 in a 32 bit type.  We require a small patch
  834.  * to __ioremap to check for addresses between (u32)Au1500_PCI_MEM_START and
  835.  * (u32)Au1500_PCI_MEM_END and change those to the full 36 bit PCI MEM
  836.  * addresses.  For PCI IO, it's simpler because we get to do the ioremap
  837.  * ourselves and then adjust the device's resources.
  838.  */
  839. #define Au1500_EXT_CFG            0x600000000
  840. #define Au1500_EXT_CFG_TYPE1      0x680000000
  841. #define Au1500_PCI_IO_START       0x500000000
  842. #define Au1500_PCI_IO_END         0x5000FFFFF
  843. #define Au1500_PCI_MEM_START      0x440000000
  844. #define Au1500_PCI_MEM_END        0x443FFFFFF
  845. #endif