Home | History | Annotate | Line # | Download | only in include
aureg.h revision 1.13
      1 /* $NetBSD: aureg.h,v 1.13 2006/02/20 17:08:08 gdamore Exp $ */
      2 
      3 /*
      4  * Copyright 2002 Wasabi Systems, Inc.
      5  * All rights reserved.
      6  *
      7  * Written by Simon Burge for Wasabi Systems, Inc.
      8  *
      9  * Redistribution and use in source and binary forms, with or without
     10  * modification, are permitted provided that the following conditions
     11  * are met:
     12  * 1. Redistributions of source code must retain the above copyright
     13  *    notice, this list of conditions and the following disclaimer.
     14  * 2. Redistributions in binary form must reproduce the above copyright
     15  *    notice, this list of conditions and the following disclaimer in the
     16  *    documentation and/or other materials provided with the distribution.
     17  * 3. All advertising materials mentioning features or use of this software
     18  *    must display the following acknowledgement:
     19  *      This product includes software developed for the NetBSD Project by
     20  *      Wasabi Systems, Inc.
     21  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
     22  *    or promote products derived from this software without specific prior
     23  *    written permission.
     24  *
     25  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
     26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     27  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     28  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
     29  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     30  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     31  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     32  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     33  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     34  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     35  * POSSIBILITY OF SUCH DAMAGE.
     36  */
     37 
     38 #ifndef	_MIPS_ALCHEMY_AUREG_H
     39 #define	_MIPS_ALCHEMY_AUREG_H
     40 
     41 /************************************************************************/
     42 /********************   AC97 Controller registers   *********************/
     43 /************************************************************************/
     44 #define	AC97_BASE		0x10000000
     45 
     46 /************************************************************************/
     47 /***********************   USB Host registers   *************************/
     48 /************************************************************************/
     49 #define	USBH_BASE		0x10100000
     50 #define	AU1550_USBH_BASE	0x14020000
     51 
     52 #define	USBH_ENABLE		0x7fffc
     53 #define	USBH_SIZE		0x100000
     54 
     55 #define	AU1550_USBH_ENABLE	0x7ffc
     56 #define AU1550_USBH_SIZE	0x60000
     57 
     58 /************************************************************************/
     59 /**********************   USB Device registers   ************************/
     60 /************************************************************************/
     61 #define	USBD_BASE		0x10200000
     62 
     63 /************************************************************************/
     64 /*************************   IRDA registers   ***************************/
     65 /************************************************************************/
     66 #define	IRDA_BASE		0x10300000
     67 
     68 /************************************************************************/
     69 /******************   Interrupt Controller registers   ******************/
     70 /************************************************************************/
     71 
     72 #define	IC0_BASE		0x10400000
     73 #define	IC1_BASE		0x11800000
     74 
     75 /*
     76  * The *_READ registers read the current value of the register
     77  * The *_SET registers set to 1 all bits that are written 1
     78  * The *_CLEAR registers clear to zero all bits that are written as 1
     79  */
     80 #define	IC_CONFIG0_READ			0x40	/* See table below */
     81 #define	IC_CONFIG0_SET			0x40
     82 #define	IC_CONFIG0_CLEAR		0x44
     83 
     84 #define	IC_CONFIG1_READ			0x48	/* See table below */
     85 #define	IC_CONFIG1_SET			0x48
     86 #define	IC_CONFIG1_CLEAR		0x4c
     87 
     88 #define	IC_CONFIG2_READ			0x50	/* See table below */
     89 #define	IC_CONFIG2_SET			0x50
     90 #define	IC_CONFIG2_CLEAR		0x54
     91 
     92 #define	IC_REQUEST0_INT			0x54	/* Show active interrupts on request 0 */
     93 
     94 #define	IC_SOURCE_READ			0x58	/* Interrupt source */
     95 #define	IC_SOURCE_SET			0x58	/*  0 - test bit used as source */
     96 #define	IC_SOURCE_CLEAR			0x5c	/*  1 - peripheral/GPIO used as source */
     97 
     98 #define	IC_REQUEST1_INT			0x5c	/* Show active interrupts on request 1 */
     99 
    100 #define	IC_ASSIGN_REQUEST_READ		0x60	/* Assigns the interrupt to one of the */
    101 #define	IC_ASSIGN_REQUEST_SET		0x60	/* CPU requests (0 - assign to request 1, */
    102 #define	IC_ASSIGN_REQUEST_CLEAR		0x64	/* 1 - assign to request 0) */
    103 
    104 #define	IC_WAKEUP_READ			0x68	/* Controls whether the interrupt can */
    105 #define	IC_WAKEUP_SET			0x68	/* cause a wakeup from IDLE */
    106 #define	IC_WAKEUP_CLEAR			0x6c
    107 
    108 #define	IC_MASK_READ			0x70	/* Enables/Disables the interrupt */
    109 #define	IC_MASK_SET			0x70
    110 #define	IC_MASK_CLEAR			0x74
    111 
    112 #define	IC_RISING_EDGE_DETECT		0x78	/* Check/clear rising edge interrupts */
    113 #define	IC_RISING_EDGE_DETECT_CLEAR	0x78
    114 
    115 #define	IC_FAILLING_EDGE_DETECT		0x7c	/* Check/clear falling edge interrupts */
    116 #define	IC_FAILLING_EDGE_DETECT_CLEAR	0x7c
    117 
    118 #define	IC_TEST_BIT			0x80	/* single bit source select testing register */
    119 
    120 /*
    121  *	Interrupt Configuration Register Functions
    122  *
    123  *	Cfg2[n]	Cfg1[n]	Cfg0[n]		Function
    124  *	   0	   0	   0		Interrupts Disabled
    125  *	   0	   0	   1		Rising Edge Enabled
    126  *	   0	   1	   0		Falling Edge Enabled
    127  *	   0	   1	   1		Rising and Falling Edge Enabled
    128  *	   1	   0	   0		Interrupts Disabled
    129  *	   1	   0	   1		High Level Enabled
    130  *	   1	   1	   0		Low Level Enabled
    131  *	   1	   1	   1		Both Levels and Both Edges Enabled
    132  */
    133 
    134 /************************************************************************/
    135 /**********************   Ethernet MAC registers   **********************/
    136 /************************************************************************/
    137 
    138 #define	MAC0_BASE		0x10500000
    139 #define	MAC1_BASE		0x10510000
    140 #define	MACx_SIZE		0x28
    141 
    142 #define	AU1500_MAC0_BASE	0x11500000	/* Grr, difference on Au1500 */
    143 #define	AU1500_MAC1_BASE	0x11510000	/* Grr, difference on Au1500 */
    144 
    145 #define	MAC0_ENABLE		0x10520000
    146 #define	MAC1_ENABLE		0x10520004
    147 #define	MACENx_SIZE		0x04
    148 
    149 #define	AU1500_MAC0_ENABLE	0x11520000	/* Grr, difference on Au1500 */
    150 #define	AU1500_MAC1_ENABLE	0x11520004	/* Grr, difference on Au1500 */
    151 
    152 #define	MAC0_DMA_BASE		0x14004000
    153 #define	MAC1_DMA_BASE		0x14004200
    154 #define	MACx_DMA_SIZE		0x140
    155 
    156 /************************************************************************/
    157 /**********************   Static Bus registers   ************************/
    158 /************************************************************************/
    159 #define	STATIC_BUS_BASE		0x14001000
    160 
    161 /************************************************************************/
    162 /********************   Secure Digital registers   **********************/
    163 /************************************************************************/
    164 #define	SD0_BASE		0x10600000
    165 #define	SD1_BASE		0x10680000
    166 
    167 /************************************************************************/
    168 /*************************   I^2S registers   ***************************/
    169 /************************************************************************/
    170 #define	I2S_BASE		0x11000000
    171 
    172 /************************************************************************/
    173 /**************************   UART registers   **************************/
    174 /************************************************************************/
    175 
    176 #define	UART0_BASE		0x11100000
    177 #define	UART1_BASE		0x11200000
    178 #define	UART2_BASE		0x11300000
    179 #define	UART3_BASE		0x11400000
    180 
    181 /************************************************************************/
    182 /*************************   SSI registers   ****************************/
    183 /************************************************************************/
    184 #define	SSI0_BASE		0x11600000
    185 #define	SSI1_BASE		0x11680000
    186 
    187 /************************************************************************/
    188 /************************   GPIO2 registers   ***************************/
    189 /************************************************************************/
    190 #define	GPIO_BASE		0x11900100
    191 
    192 /************************************************************************/
    193 /************************   GPIO2 registers   ***************************/
    194 /************************************************************************/
    195 #define	GPIO2_BASE		0x11700000
    196 
    197 /************************************************************************/
    198 /*************************   PCI registers   ****************************/
    199 /************************************************************************/
    200 #define	PCI_BASE		0x14005000
    201 #define	PCI_HEADER		0x14005100
    202 #define	PCI_MEM_BASE		0x400000000ULL
    203 #define	PCI_IO_BASE		0x500000000ULL
    204 #define	PCI_CONFIG_BASE		0x600000000ULL
    205 
    206 /************************************************************************/
    207 /***********************   PCMCIA registers   ***************************/
    208 /************************************************************************/
    209 #define	PCMCIA_BASE		0xF00000000ULL
    210 
    211 /************************************************************************/
    212 /******************   Programmable Counter registers   ******************/
    213 /************************************************************************/
    214 
    215 #define	SYS_BASE		0x11900000
    216 
    217 #define	PC_BASE			SYS_BASE
    218 
    219 #define	PC_TRIM0		0x00		/* PC0 Divide (16 bits) */
    220 #define	PC_COUNTER_WRITE0	0x04		/* set PC0 */
    221 #define	PC_MATCH0_0		0x08		/* match counter & interrupt */
    222 #define	PC_MATCH1_0		0x0c		/* match counter & interrupt */
    223 #define	PC_MATCH2_0		0x10		/* match counter & interrupt */
    224 #define	PC_COUNTER_CONTROL	0x14		/* Programmable Counter Control */
    225 #define	  CC_E1S		  0x00800000	/* Enable PC1 write status */
    226 #define	  CC_T1S		  0x00100000	/* Trim PC1 write status */
    227 #define	  CC_M21		  0x00080000	/* Match 2 of PC1 write status */
    228 #define	  CC_M11		  0x00040000	/* Match 1 of PC1 write status */
    229 #define	  CC_M01		  0x00020000	/* Match 0 of PC1 write status */
    230 #define	  CC_C1S		  0x00010000	/* PC1 write status */
    231 #define	  CC_BP			  0x00004000	/* Bypass OSC (use GPIO1) */
    232 #define	  CC_EN1		  0x00002000	/* Enable PC1 */
    233 #define	  CC_BT1		  0x00001000	/* Bypass Trim on PC1 */
    234 #define	  CC_EN0		  0x00000800	/* Enable PC0 */
    235 #define	  CC_BT0		  0x00000400	/* Bypass Trim on PC0 */
    236 #define	  CC_EO			  0x00000100	/* Enable Oscillator */
    237 #define	  CC_E0S		  0x00000080	/* Enable PC0 write status */
    238 #define	  CC_32S		  0x00000020	/* 32.768kHz OSC status */
    239 #define	  CC_T0S		  0x00000010	/* Trim PC0 write status */
    240 #define	  CC_M20		  0x00000008	/* Match 2 of PC0 write status */
    241 #define	  CC_M10		  0x00000004	/* Match 1 of PC0 write status */
    242 #define	  CC_M00		  0x00000002	/* Match 0 of PC0 write status */
    243 #define	  CC_C0S		  0x00000001	/* PC0 write status */
    244 #define	PC_COUNTER_READ_0	0x40		/* get PC0 */
    245 #define	PC_TRIM1		0x44		/* PC1 Divide (16 bits) */
    246 #define	PC_COUNTER_WRITE1	0x48		/* set PC1 */
    247 #define	PC_MATCH0_1		0x4c		/* match counter & interrupt */
    248 #define	PC_MATCH1_1		0x50		/* match counter & interrupt */
    249 #define	PC_MATCH2_1		0x54		/* match counter & interrupt */
    250 #define	PC_COUNTER_READ_1	0x58		/* get PC1 */
    251 
    252 #define	PC_SIZE			0x5c		/* size of register set */
    253 #define	PC_RATE			32768		/* counter rate is 32.768kHz */
    254 
    255 /************************************************************************/
    256 /*******************   Frequency Generator Registers   ******************/
    257 /************************************************************************/
    258 
    259 #define SYS_FREQCTRL0		(SYS_BASE + 0x20)
    260 #define SFC_FRDIV2(f)		(f<<22)		/* 29:22. Freq Divider 2 */
    261 #define SFC_FE2			(1<<21)		/* Freq generator output enable 2 */
    262 #define SFC_FS2			(1<<20)		/* Freq generator source 2 */
    263 #define SFC_FRDIV1(f)		(f<<12)		/* 19:12. Freq Divider 1 */
    264 #define SFC_FE1			(1<<11)		/* Freq generator output enable 1 */
    265 #define SFC_FS1			(1<<10)		/* Freq generator source 1 */
    266 #define SFC_FRDIV0(f)		(f<<2)		/* 9:2. Freq Divider 0 */
    267 #define SFC_FE0			2		/* Freq generator output enable 0 */
    268 #define SFC_FS0			1		/* Freq generator source 0 */
    269 
    270 #define SYS_FREQCTRL1		(SYS_BASE + 0x24)
    271 #define SFC_FRDIV5(f)		(f<<22)		/* 29:22. Freq Divider 5 */
    272 #define SFC_FE5			(1<<21)		/* Freq generator output enable 5 */
    273 #define SFC_FS5			(1<<20)		/* Freq generator source 5 */
    274 #define SFC_FRDIV4(f)		(f<<12)		/* 19:12. Freq Divider 4 */
    275 #define SFC_FE4			(1<<11)		/* Freq generator output enable 4 */
    276 #define SFC_FS4			(1<<10)		/* Freq generator source 4 */
    277 #define SFC_FRDIV3(f)		(f<<2)		/* 9:2. Freq Divider 3 */
    278 #define SFC_FE3			2		/* Freq generator output enable 3 */
    279 #define SFC_FS3			1		/* Freq generator source 3 */
    280 
    281 /************************************************************************/
    282 /******************   Clock Source Control Registers   ******************/
    283 /************************************************************************/
    284 
    285 #define SYS_CLKSRC		(SYS_BASE + 0x28)
    286 #define  SCS_ME1(n)		(n<<27)		/* EXTCLK1 Clock Mux input select */
    287 #define  SCS_ME0(n)		(n<<22)		/* EXTCLK0 Clock Mux input select */
    288 #define  SCS_MPC(n)		(n<<17)		/* PCI clock mux input select */
    289 #define  SCS_MUH(n)		(n<<12)		/* USB Host clock mux input select */
    290 #define  SCS_MUD(n)		(n<<7)		/* USB Device clock mux input select */
    291 #define   SCS_MEx_AUX		0x1		/* Aux clock */
    292 #define   SCS_MEx_FREQ0		0x2		/* FREQ0 */
    293 #define   SCS_MEx_FREQ1		0x3		/* FREQ1 */
    294 #define   SCS_MEx_FREQ2		0x4		/* FREQ2 */
    295 #define   SCS_MEx_FREQ3		0x5		/* FREQ3 */
    296 #define   SCS_MEx_FREQ4		0x6		/* FREQ4 */
    297 #define   SCS_MEx_FREQ5		0x7		/* FREQ5 */
    298 #define  SCS_DE1		(1<<26)		/* EXTCLK1 clock divider select */
    299 #define  SCS_CE1		(1<<25)		/* EXTCLK1 clock select */
    300 #define  SCS_DE0		(1<<21)		/* EXTCLK0 clock divider select */
    301 #define  SCS_CE0		(1<<20)		/* EXTCLK0 clock select */
    302 #define  SCS_DPC		(1<<16)		/* PCI clock divider select */
    303 #define  SCS_CPC		(1<<15)		/* PCI clock select */
    304 #define  SCS_DUH		(1<<11)		/* USB Host clock divider select */
    305 #define  SCS_CUH		(1<<10)		/* USB Host clock select */
    306 #define  SCS_DUD		(1<<6)		/* USB Device clock divider select */
    307 #define  SCS_CUD		(1<<5)		/* USB Device clock select */
    308 
    309 /************************************************************************/
    310 /***************************   PLL Control  *****************************/
    311 /************************************************************************/
    312 
    313 #define SYS_CPUPLL		(SYS_BASE + 0x60)
    314 #define SYS_AUXPLL              (SYS_BASE + 0x64)
    315 
    316 #endif	/* _MIPS_ALCHEMY_AUREG_H */
    317