Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  *
0003  * BRIEF MODULE DESCRIPTION
0004  *  Include file for Alchemy Semiconductor's Au1k CPU.
0005  *
0006  * Copyright 2004 Embedded Edge, LLC
0007  *  dan@embeddededge.com
0008  *
0009  *  This program is free software; you can redistribute  it and/or modify it
0010  *  under  the terms of  the GNU General  Public License as published by the
0011  *  Free Software Foundation;  either version 2 of the  License, or (at your
0012  *  option) any later version.
0013  *
0014  *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
0015  *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
0016  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
0017  *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
0018  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
0019  *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
0020  *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
0021  *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
0022  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
0023  *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0024  *
0025  *  You should have received a copy of the  GNU General Public License along
0026  *  with this program; if not, write  to the Free Software Foundation, Inc.,
0027  *  675 Mass Ave, Cambridge, MA 02139, USA.
0028  */
0029 
0030 /* Specifics for the Au1xxx Programmable Serial Controllers, first
0031  * seen in the AU1550 part.
0032  */
0033 #ifndef _AU1000_PSC_H_
0034 #define _AU1000_PSC_H_
0035 
0036 /*
0037  * The PSC select and control registers are common to all protocols.
0038  */
0039 #define PSC_SEL_OFFSET      0x00000000
0040 #define PSC_CTRL_OFFSET     0x00000004
0041 
0042 #define PSC_SEL_CLK_MASK    (3 << 4)
0043 #define PSC_SEL_CLK_INTCLK  (0 << 4)
0044 #define PSC_SEL_CLK_EXTCLK  (1 << 4)
0045 #define PSC_SEL_CLK_SERCLK  (2 << 4)
0046 
0047 #define PSC_SEL_PS_MASK     0x00000007
0048 #define PSC_SEL_PS_DISABLED 0
0049 #define PSC_SEL_PS_SPIMODE  2
0050 #define PSC_SEL_PS_I2SMODE  3
0051 #define PSC_SEL_PS_AC97MODE 4
0052 #define PSC_SEL_PS_SMBUSMODE    5
0053 
0054 #define PSC_CTRL_DISABLE    0
0055 #define PSC_CTRL_SUSPEND    2
0056 #define PSC_CTRL_ENABLE     3
0057 
0058 /* AC97 Registers. */
0059 #define PSC_AC97CFG_OFFSET  0x00000008
0060 #define PSC_AC97MSK_OFFSET  0x0000000c
0061 #define PSC_AC97PCR_OFFSET  0x00000010
0062 #define PSC_AC97STAT_OFFSET 0x00000014
0063 #define PSC_AC97EVNT_OFFSET 0x00000018
0064 #define PSC_AC97TXRX_OFFSET 0x0000001c
0065 #define PSC_AC97CDC_OFFSET  0x00000020
0066 #define PSC_AC97RST_OFFSET  0x00000024
0067 #define PSC_AC97GPO_OFFSET  0x00000028
0068 #define PSC_AC97GPI_OFFSET  0x0000002c
0069 
0070 /* AC97 Config Register. */
0071 #define PSC_AC97CFG_RT_MASK (3 << 30)
0072 #define PSC_AC97CFG_RT_FIFO1    (0 << 30)
0073 #define PSC_AC97CFG_RT_FIFO2    (1 << 30)
0074 #define PSC_AC97CFG_RT_FIFO4    (2 << 30)
0075 #define PSC_AC97CFG_RT_FIFO8    (3 << 30)
0076 
0077 #define PSC_AC97CFG_TT_MASK (3 << 28)
0078 #define PSC_AC97CFG_TT_FIFO1    (0 << 28)
0079 #define PSC_AC97CFG_TT_FIFO2    (1 << 28)
0080 #define PSC_AC97CFG_TT_FIFO4    (2 << 28)
0081 #define PSC_AC97CFG_TT_FIFO8    (3 << 28)
0082 
0083 #define PSC_AC97CFG_DD_DISABLE  (1 << 27)
0084 #define PSC_AC97CFG_DE_ENABLE   (1 << 26)
0085 #define PSC_AC97CFG_SE_ENABLE   (1 << 25)
0086 
0087 #define PSC_AC97CFG_LEN_MASK    (0xf << 21)
0088 #define PSC_AC97CFG_TXSLOT_MASK (0x3ff << 11)
0089 #define PSC_AC97CFG_RXSLOT_MASK (0x3ff << 1)
0090 #define PSC_AC97CFG_GE_ENABLE   (1)
0091 
0092 /* Enable slots 3-12. */
0093 #define PSC_AC97CFG_TXSLOT_ENA(x)   (1 << (((x) - 3) + 11))
0094 #define PSC_AC97CFG_RXSLOT_ENA(x)   (1 << (((x) - 3) + 1))
0095 
0096 /*
0097  * The word length equation is ((x) * 2) + 2, so choose 'x' appropriately.
0098  * The only sensible numbers are 7, 9, or possibly 11.  Nah, just do the
0099  * arithmetic in the macro.
0100  */
0101 #define PSC_AC97CFG_SET_LEN(x)  (((((x) - 2) / 2) & 0xf) << 21)
0102 #define PSC_AC97CFG_GET_LEN(x)  (((((x) >> 21) & 0xf) * 2) + 2)
0103 
0104 /* AC97 Mask Register. */
0105 #define PSC_AC97MSK_GR      (1 << 25)
0106 #define PSC_AC97MSK_CD      (1 << 24)
0107 #define PSC_AC97MSK_RR      (1 << 13)
0108 #define PSC_AC97MSK_RO      (1 << 12)
0109 #define PSC_AC97MSK_RU      (1 << 11)
0110 #define PSC_AC97MSK_TR      (1 << 10)
0111 #define PSC_AC97MSK_TO      (1 << 9)
0112 #define PSC_AC97MSK_TU      (1 << 8)
0113 #define PSC_AC97MSK_RD      (1 << 5)
0114 #define PSC_AC97MSK_TD      (1 << 4)
0115 #define PSC_AC97MSK_ALLMASK (PSC_AC97MSK_GR | PSC_AC97MSK_CD | \
0116                  PSC_AC97MSK_RR | PSC_AC97MSK_RO | \
0117                  PSC_AC97MSK_RU | PSC_AC97MSK_TR | \
0118                  PSC_AC97MSK_TO | PSC_AC97MSK_TU | \
0119                  PSC_AC97MSK_RD | PSC_AC97MSK_TD)
0120 
0121 /* AC97 Protocol Control Register. */
0122 #define PSC_AC97PCR_RC      (1 << 6)
0123 #define PSC_AC97PCR_RP      (1 << 5)
0124 #define PSC_AC97PCR_RS      (1 << 4)
0125 #define PSC_AC97PCR_TC      (1 << 2)
0126 #define PSC_AC97PCR_TP      (1 << 1)
0127 #define PSC_AC97PCR_TS      (1 << 0)
0128 
0129 /* AC97 Status register (read only). */
0130 #define PSC_AC97STAT_CB     (1 << 26)
0131 #define PSC_AC97STAT_CP     (1 << 25)
0132 #define PSC_AC97STAT_CR     (1 << 24)
0133 #define PSC_AC97STAT_RF     (1 << 13)
0134 #define PSC_AC97STAT_RE     (1 << 12)
0135 #define PSC_AC97STAT_RR     (1 << 11)
0136 #define PSC_AC97STAT_TF     (1 << 10)
0137 #define PSC_AC97STAT_TE     (1 << 9)
0138 #define PSC_AC97STAT_TR     (1 << 8)
0139 #define PSC_AC97STAT_RB     (1 << 5)
0140 #define PSC_AC97STAT_TB     (1 << 4)
0141 #define PSC_AC97STAT_DI     (1 << 2)
0142 #define PSC_AC97STAT_DR     (1 << 1)
0143 #define PSC_AC97STAT_SR     (1 << 0)
0144 
0145 /* AC97 Event Register. */
0146 #define PSC_AC97EVNT_GR     (1 << 25)
0147 #define PSC_AC97EVNT_CD     (1 << 24)
0148 #define PSC_AC97EVNT_RR     (1 << 13)
0149 #define PSC_AC97EVNT_RO     (1 << 12)
0150 #define PSC_AC97EVNT_RU     (1 << 11)
0151 #define PSC_AC97EVNT_TR     (1 << 10)
0152 #define PSC_AC97EVNT_TO     (1 << 9)
0153 #define PSC_AC97EVNT_TU     (1 << 8)
0154 #define PSC_AC97EVNT_RD     (1 << 5)
0155 #define PSC_AC97EVNT_TD     (1 << 4)
0156 
0157 /* CODEC Command Register. */
0158 #define PSC_AC97CDC_RD      (1 << 25)
0159 #define PSC_AC97CDC_ID_MASK (3 << 23)
0160 #define PSC_AC97CDC_INDX_MASK   (0x7f << 16)
0161 #define PSC_AC97CDC_ID(x)   (((x) & 0x03) << 23)
0162 #define PSC_AC97CDC_INDX(x) (((x) & 0x7f) << 16)
0163 
0164 /* AC97 Reset Control Register. */
0165 #define PSC_AC97RST_RST     (1 << 1)
0166 #define PSC_AC97RST_SNC     (1 << 0)
0167 
0168 /* PSC in I2S Mode. */
0169 typedef struct  psc_i2s {
0170     u32 psc_sel;
0171     u32 psc_ctrl;
0172     u32 psc_i2scfg;
0173     u32 psc_i2smsk;
0174     u32 psc_i2spcr;
0175     u32 psc_i2sstat;
0176     u32 psc_i2sevent;
0177     u32 psc_i2stxrx;
0178     u32 psc_i2sudf;
0179 } psc_i2s_t;
0180 
0181 #define PSC_I2SCFG_OFFSET   0x08
0182 #define PSC_I2SMASK_OFFSET  0x0C
0183 #define PSC_I2SPCR_OFFSET   0x10
0184 #define PSC_I2SSTAT_OFFSET  0x14
0185 #define PSC_I2SEVENT_OFFSET 0x18
0186 #define PSC_I2SRXTX_OFFSET  0x1C
0187 #define PSC_I2SUDF_OFFSET   0x20
0188 
0189 /* I2S Config Register. */
0190 #define PSC_I2SCFG_RT_MASK  (3 << 30)
0191 #define PSC_I2SCFG_RT_FIFO1 (0 << 30)
0192 #define PSC_I2SCFG_RT_FIFO2 (1 << 30)
0193 #define PSC_I2SCFG_RT_FIFO4 (2 << 30)
0194 #define PSC_I2SCFG_RT_FIFO8 (3 << 30)
0195 
0196 #define PSC_I2SCFG_TT_MASK  (3 << 28)
0197 #define PSC_I2SCFG_TT_FIFO1 (0 << 28)
0198 #define PSC_I2SCFG_TT_FIFO2 (1 << 28)
0199 #define PSC_I2SCFG_TT_FIFO4 (2 << 28)
0200 #define PSC_I2SCFG_TT_FIFO8 (3 << 28)
0201 
0202 #define PSC_I2SCFG_DD_DISABLE   (1 << 27)
0203 #define PSC_I2SCFG_DE_ENABLE    (1 << 26)
0204 #define PSC_I2SCFG_SET_WS(x)    (((((x) / 2) - 1) & 0x7f) << 16)
0205 #define PSC_I2SCFG_WS(n)    ((n & 0xFF) << 16)
0206 #define PSC_I2SCFG_WS_MASK  (PSC_I2SCFG_WS(0x3F))
0207 #define PSC_I2SCFG_WI       (1 << 15)
0208 
0209 #define PSC_I2SCFG_DIV_MASK (3 << 13)
0210 #define PSC_I2SCFG_DIV2     (0 << 13)
0211 #define PSC_I2SCFG_DIV4     (1 << 13)
0212 #define PSC_I2SCFG_DIV8     (2 << 13)
0213 #define PSC_I2SCFG_DIV16    (3 << 13)
0214 
0215 #define PSC_I2SCFG_BI       (1 << 12)
0216 #define PSC_I2SCFG_BUF      (1 << 11)
0217 #define PSC_I2SCFG_MLJ      (1 << 10)
0218 #define PSC_I2SCFG_XM       (1 << 9)
0219 
0220 /* The word length equation is simply LEN+1. */
0221 #define PSC_I2SCFG_SET_LEN(x)   ((((x) - 1) & 0x1f) << 4)
0222 #define PSC_I2SCFG_GET_LEN(x)   ((((x) >> 4) & 0x1f) + 1)
0223 
0224 #define PSC_I2SCFG_LB       (1 << 2)
0225 #define PSC_I2SCFG_MLF      (1 << 1)
0226 #define PSC_I2SCFG_MS       (1 << 0)
0227 
0228 /* I2S Mask Register. */
0229 #define PSC_I2SMSK_RR       (1 << 13)
0230 #define PSC_I2SMSK_RO       (1 << 12)
0231 #define PSC_I2SMSK_RU       (1 << 11)
0232 #define PSC_I2SMSK_TR       (1 << 10)
0233 #define PSC_I2SMSK_TO       (1 << 9)
0234 #define PSC_I2SMSK_TU       (1 << 8)
0235 #define PSC_I2SMSK_RD       (1 << 5)
0236 #define PSC_I2SMSK_TD       (1 << 4)
0237 #define PSC_I2SMSK_ALLMASK  (PSC_I2SMSK_RR | PSC_I2SMSK_RO | \
0238                  PSC_I2SMSK_RU | PSC_I2SMSK_TR | \
0239                  PSC_I2SMSK_TO | PSC_I2SMSK_TU | \
0240                  PSC_I2SMSK_RD | PSC_I2SMSK_TD)
0241 
0242 /* I2S Protocol Control Register. */
0243 #define PSC_I2SPCR_RC       (1 << 6)
0244 #define PSC_I2SPCR_RP       (1 << 5)
0245 #define PSC_I2SPCR_RS       (1 << 4)
0246 #define PSC_I2SPCR_TC       (1 << 2)
0247 #define PSC_I2SPCR_TP       (1 << 1)
0248 #define PSC_I2SPCR_TS       (1 << 0)
0249 
0250 /* I2S Status register (read only). */
0251 #define PSC_I2SSTAT_RF      (1 << 13)
0252 #define PSC_I2SSTAT_RE      (1 << 12)
0253 #define PSC_I2SSTAT_RR      (1 << 11)
0254 #define PSC_I2SSTAT_TF      (1 << 10)
0255 #define PSC_I2SSTAT_TE      (1 << 9)
0256 #define PSC_I2SSTAT_TR      (1 << 8)
0257 #define PSC_I2SSTAT_RB      (1 << 5)
0258 #define PSC_I2SSTAT_TB      (1 << 4)
0259 #define PSC_I2SSTAT_DI      (1 << 2)
0260 #define PSC_I2SSTAT_DR      (1 << 1)
0261 #define PSC_I2SSTAT_SR      (1 << 0)
0262 
0263 /* I2S Event Register. */
0264 #define PSC_I2SEVNT_RR      (1 << 13)
0265 #define PSC_I2SEVNT_RO      (1 << 12)
0266 #define PSC_I2SEVNT_RU      (1 << 11)
0267 #define PSC_I2SEVNT_TR      (1 << 10)
0268 #define PSC_I2SEVNT_TO      (1 << 9)
0269 #define PSC_I2SEVNT_TU      (1 << 8)
0270 #define PSC_I2SEVNT_RD      (1 << 5)
0271 #define PSC_I2SEVNT_TD      (1 << 4)
0272 
0273 /* PSC in SPI Mode. */
0274 typedef struct  psc_spi {
0275     u32 psc_sel;
0276     u32 psc_ctrl;
0277     u32 psc_spicfg;
0278     u32 psc_spimsk;
0279     u32 psc_spipcr;
0280     u32 psc_spistat;
0281     u32 psc_spievent;
0282     u32 psc_spitxrx;
0283 } psc_spi_t;
0284 
0285 /* SPI Config Register. */
0286 #define PSC_SPICFG_RT_MASK  (3 << 30)
0287 #define PSC_SPICFG_RT_FIFO1 (0 << 30)
0288 #define PSC_SPICFG_RT_FIFO2 (1 << 30)
0289 #define PSC_SPICFG_RT_FIFO4 (2 << 30)
0290 #define PSC_SPICFG_RT_FIFO8 (3 << 30)
0291 
0292 #define PSC_SPICFG_TT_MASK  (3 << 28)
0293 #define PSC_SPICFG_TT_FIFO1 (0 << 28)
0294 #define PSC_SPICFG_TT_FIFO2 (1 << 28)
0295 #define PSC_SPICFG_TT_FIFO4 (2 << 28)
0296 #define PSC_SPICFG_TT_FIFO8 (3 << 28)
0297 
0298 #define PSC_SPICFG_DD_DISABLE   (1 << 27)
0299 #define PSC_SPICFG_DE_ENABLE    (1 << 26)
0300 #define PSC_SPICFG_CLR_BAUD(x)  ((x) & ~((0x3f) << 15))
0301 #define PSC_SPICFG_SET_BAUD(x)  (((x) & 0x3f) << 15)
0302 
0303 #define PSC_SPICFG_SET_DIV(x)   (((x) & 0x03) << 13)
0304 #define PSC_SPICFG_DIV2     0
0305 #define PSC_SPICFG_DIV4     1
0306 #define PSC_SPICFG_DIV8     2
0307 #define PSC_SPICFG_DIV16    3
0308 
0309 #define PSC_SPICFG_BI       (1 << 12)
0310 #define PSC_SPICFG_PSE      (1 << 11)
0311 #define PSC_SPICFG_CGE      (1 << 10)
0312 #define PSC_SPICFG_CDE      (1 << 9)
0313 
0314 #define PSC_SPICFG_CLR_LEN(x)   ((x) & ~((0x1f) << 4))
0315 #define PSC_SPICFG_SET_LEN(x)   (((x-1) & 0x1f) << 4)
0316 
0317 #define PSC_SPICFG_LB       (1 << 3)
0318 #define PSC_SPICFG_MLF      (1 << 1)
0319 #define PSC_SPICFG_MO       (1 << 0)
0320 
0321 /* SPI Mask Register. */
0322 #define PSC_SPIMSK_MM       (1 << 16)
0323 #define PSC_SPIMSK_RR       (1 << 13)
0324 #define PSC_SPIMSK_RO       (1 << 12)
0325 #define PSC_SPIMSK_RU       (1 << 11)
0326 #define PSC_SPIMSK_TR       (1 << 10)
0327 #define PSC_SPIMSK_TO       (1 << 9)
0328 #define PSC_SPIMSK_TU       (1 << 8)
0329 #define PSC_SPIMSK_SD       (1 << 5)
0330 #define PSC_SPIMSK_MD       (1 << 4)
0331 #define PSC_SPIMSK_ALLMASK  (PSC_SPIMSK_MM | PSC_SPIMSK_RR | \
0332                  PSC_SPIMSK_RO | PSC_SPIMSK_TO | \
0333                  PSC_SPIMSK_TU | PSC_SPIMSK_SD | \
0334                  PSC_SPIMSK_MD)
0335 
0336 /* SPI Protocol Control Register. */
0337 #define PSC_SPIPCR_RC       (1 << 6)
0338 #define PSC_SPIPCR_SP       (1 << 5)
0339 #define PSC_SPIPCR_SS       (1 << 4)
0340 #define PSC_SPIPCR_TC       (1 << 2)
0341 #define PSC_SPIPCR_MS       (1 << 0)
0342 
0343 /* SPI Status register (read only). */
0344 #define PSC_SPISTAT_RF      (1 << 13)
0345 #define PSC_SPISTAT_RE      (1 << 12)
0346 #define PSC_SPISTAT_RR      (1 << 11)
0347 #define PSC_SPISTAT_TF      (1 << 10)
0348 #define PSC_SPISTAT_TE      (1 << 9)
0349 #define PSC_SPISTAT_TR      (1 << 8)
0350 #define PSC_SPISTAT_SB      (1 << 5)
0351 #define PSC_SPISTAT_MB      (1 << 4)
0352 #define PSC_SPISTAT_DI      (1 << 2)
0353 #define PSC_SPISTAT_DR      (1 << 1)
0354 #define PSC_SPISTAT_SR      (1 << 0)
0355 
0356 /* SPI Event Register. */
0357 #define PSC_SPIEVNT_MM      (1 << 16)
0358 #define PSC_SPIEVNT_RR      (1 << 13)
0359 #define PSC_SPIEVNT_RO      (1 << 12)
0360 #define PSC_SPIEVNT_RU      (1 << 11)
0361 #define PSC_SPIEVNT_TR      (1 << 10)
0362 #define PSC_SPIEVNT_TO      (1 << 9)
0363 #define PSC_SPIEVNT_TU      (1 << 8)
0364 #define PSC_SPIEVNT_SD      (1 << 5)
0365 #define PSC_SPIEVNT_MD      (1 << 4)
0366 
0367 /* Transmit register control. */
0368 #define PSC_SPITXRX_LC      (1 << 29)
0369 #define PSC_SPITXRX_SR      (1 << 28)
0370 
0371 /* SMBus Config Register. */
0372 #define PSC_SMBCFG_RT_MASK  (3 << 30)
0373 #define PSC_SMBCFG_RT_FIFO1 (0 << 30)
0374 #define PSC_SMBCFG_RT_FIFO2 (1 << 30)
0375 #define PSC_SMBCFG_RT_FIFO4 (2 << 30)
0376 #define PSC_SMBCFG_RT_FIFO8 (3 << 30)
0377 
0378 #define PSC_SMBCFG_TT_MASK  (3 << 28)
0379 #define PSC_SMBCFG_TT_FIFO1 (0 << 28)
0380 #define PSC_SMBCFG_TT_FIFO2 (1 << 28)
0381 #define PSC_SMBCFG_TT_FIFO4 (2 << 28)
0382 #define PSC_SMBCFG_TT_FIFO8 (3 << 28)
0383 
0384 #define PSC_SMBCFG_DD_DISABLE   (1 << 27)
0385 #define PSC_SMBCFG_DE_ENABLE    (1 << 26)
0386 
0387 #define PSC_SMBCFG_SET_DIV(x)   (((x) & 0x03) << 13)
0388 #define PSC_SMBCFG_DIV2     0
0389 #define PSC_SMBCFG_DIV4     1
0390 #define PSC_SMBCFG_DIV8     2
0391 #define PSC_SMBCFG_DIV16    3
0392 
0393 #define PSC_SMBCFG_GCE      (1 << 9)
0394 #define PSC_SMBCFG_SFM      (1 << 8)
0395 
0396 #define PSC_SMBCFG_SET_SLV(x)   (((x) & 0x7f) << 1)
0397 
0398 /* SMBus Mask Register. */
0399 #define PSC_SMBMSK_DN       (1 << 30)
0400 #define PSC_SMBMSK_AN       (1 << 29)
0401 #define PSC_SMBMSK_AL       (1 << 28)
0402 #define PSC_SMBMSK_RR       (1 << 13)
0403 #define PSC_SMBMSK_RO       (1 << 12)
0404 #define PSC_SMBMSK_RU       (1 << 11)
0405 #define PSC_SMBMSK_TR       (1 << 10)
0406 #define PSC_SMBMSK_TO       (1 << 9)
0407 #define PSC_SMBMSK_TU       (1 << 8)
0408 #define PSC_SMBMSK_SD       (1 << 5)
0409 #define PSC_SMBMSK_MD       (1 << 4)
0410 #define PSC_SMBMSK_ALLMASK  (PSC_SMBMSK_DN | PSC_SMBMSK_AN | \
0411                  PSC_SMBMSK_AL | PSC_SMBMSK_RR | \
0412                  PSC_SMBMSK_RO | PSC_SMBMSK_TO | \
0413                  PSC_SMBMSK_TU | PSC_SMBMSK_SD | \
0414                  PSC_SMBMSK_MD)
0415 
0416 /* SMBus Protocol Control Register. */
0417 #define PSC_SMBPCR_DC       (1 << 2)
0418 #define PSC_SMBPCR_MS       (1 << 0)
0419 
0420 /* SMBus Status register (read only). */
0421 #define PSC_SMBSTAT_BB      (1 << 28)
0422 #define PSC_SMBSTAT_RF      (1 << 13)
0423 #define PSC_SMBSTAT_RE      (1 << 12)
0424 #define PSC_SMBSTAT_RR      (1 << 11)
0425 #define PSC_SMBSTAT_TF      (1 << 10)
0426 #define PSC_SMBSTAT_TE      (1 << 9)
0427 #define PSC_SMBSTAT_TR      (1 << 8)
0428 #define PSC_SMBSTAT_SB      (1 << 5)
0429 #define PSC_SMBSTAT_MB      (1 << 4)
0430 #define PSC_SMBSTAT_DI      (1 << 2)
0431 #define PSC_SMBSTAT_DR      (1 << 1)
0432 #define PSC_SMBSTAT_SR      (1 << 0)
0433 
0434 /* SMBus Event Register. */
0435 #define PSC_SMBEVNT_DN      (1 << 30)
0436 #define PSC_SMBEVNT_AN      (1 << 29)
0437 #define PSC_SMBEVNT_AL      (1 << 28)
0438 #define PSC_SMBEVNT_RR      (1 << 13)
0439 #define PSC_SMBEVNT_RO      (1 << 12)
0440 #define PSC_SMBEVNT_RU      (1 << 11)
0441 #define PSC_SMBEVNT_TR      (1 << 10)
0442 #define PSC_SMBEVNT_TO      (1 << 9)
0443 #define PSC_SMBEVNT_TU      (1 << 8)
0444 #define PSC_SMBEVNT_SD      (1 << 5)
0445 #define PSC_SMBEVNT_MD      (1 << 4)
0446 #define PSC_SMBEVNT_ALLCLR  (PSC_SMBEVNT_DN | PSC_SMBEVNT_AN | \
0447                  PSC_SMBEVNT_AL | PSC_SMBEVNT_RR | \
0448                  PSC_SMBEVNT_RO | PSC_SMBEVNT_TO | \
0449                  PSC_SMBEVNT_TU | PSC_SMBEVNT_SD | \
0450                  PSC_SMBEVNT_MD)
0451 
0452 /* Transmit register control. */
0453 #define PSC_SMBTXRX_RSR     (1 << 28)
0454 #define PSC_SMBTXRX_STP     (1 << 29)
0455 #define PSC_SMBTXRX_DATAMASK    0xff
0456 
0457 /* SMBus protocol timers register. */
0458 #define PSC_SMBTMR_SET_TH(x)    (((x) & 0x03) << 30)
0459 #define PSC_SMBTMR_SET_PS(x)    (((x) & 0x1f) << 25)
0460 #define PSC_SMBTMR_SET_PU(x)    (((x) & 0x1f) << 20)
0461 #define PSC_SMBTMR_SET_SH(x)    (((x) & 0x1f) << 15)
0462 #define PSC_SMBTMR_SET_SU(x)    (((x) & 0x1f) << 10)
0463 #define PSC_SMBTMR_SET_CL(x)    (((x) & 0x1f) << 5)
0464 #define PSC_SMBTMR_SET_CH(x)    (((x) & 0x1f) << 0)
0465 
0466 #endif /* _AU1000_PSC_H_ */