Home | History | Annotate | Line # | Download | only in dev
      1  1.3  gdamore /* $NetBSD: aupscreg.h,v 1.3 2006/10/02 07:32:16 gdamore Exp $ */
      2  1.1    shige 
      3  1.1    shige /*-
      4  1.1    shige  * Copyright (c) 2006 Shigeyuki Fukushima.
      5  1.1    shige  * All rights reserved.
      6  1.1    shige  *
      7  1.1    shige  * Written by Shigeyuki Fukushima.
      8  1.1    shige  *
      9  1.1    shige  * Redistribution and use in source and binary forms, with or without
     10  1.1    shige  * modification, are permitted provided that the following conditions
     11  1.1    shige  * are met:
     12  1.1    shige  * 1. Redistributions of source code must retain the above copyright
     13  1.1    shige  *    notice, this list of conditions and the following disclaimer.
     14  1.1    shige  * 2. Redistributions in binary form must reproduce the above
     15  1.1    shige  *    copyright notice, this list of conditions and the following
     16  1.1    shige  *    disclaimer in the documentation and/or other materials provided
     17  1.1    shige  *    with the distribution.
     18  1.1    shige  * 3. The name of the author may not be used to endorse or promote
     19  1.1    shige  *    products derived from this software without specific prior
     20  1.1    shige  *    written permission.
     21  1.1    shige  *
     22  1.1    shige  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
     23  1.1    shige  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     24  1.1    shige  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25  1.1    shige  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
     26  1.1    shige  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     27  1.1    shige  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
     28  1.1    shige  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     29  1.1    shige  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     30  1.1    shige  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     31  1.1    shige  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     32  1.1    shige  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     33  1.1    shige  */
     34  1.1    shige 
     35  1.1    shige #ifndef _MIPS_ALCHEMY_DEV_AUPSCREG_H_
     36  1.1    shige #define	_MIPS_ALCHEMY_DEV_AUPSCREG_H_
     37  1.1    shige 
     38  1.1    shige /*
     39  1.1    shige  * PSC registers (offset from PSCn_BASE).
     40  1.1    shige  */
     41  1.1    shige 
     42  1.1    shige /* psc_sel: PSC clock and protocol select
     43  1.1    shige  *   CLK [5:4]
     44  1.1    shige  *     00 = pscn_intclk (for SPI, SMBus, I2S Master[PSC3 Only])
     45  1.1    shige  *     01 = PSCn_EXTCLK (for SPI, SMBus, I2S Master)
     46  1.1    shige  *     10 = PSCn_CLK    (for AC97, I2S Slave)
     47  1.1    shige  *     11 = Reserved
     48  1.1    shige  *   PS [2:0]
     49  1.1    shige  *     000 = Protocol disable
     50  1.1    shige  *     001 = Reserved
     51  1.1    shige  *     010 = SPI mode
     52  1.1    shige  *     011 = I2S mode
     53  1.1    shige  *     100 = AC97 mode
     54  1.1    shige  *     101 = SMBus mode
     55  1.1    shige  *     11x = Reserved
     56  1.1    shige  */
     57  1.1    shige #define	AUPSC_SEL			0x00	/* R/W */
     58  1.1    shige #  define	AUPSC_SEL_CLK(x)	((x & 0x03) << 4) /* CLK */
     59  1.1    shige #  define	AUPSC_SEL_PS(x)		(x & 0x07)
     60  1.1    shige #  define	AUPSC_SEL_DISABLE	0
     61  1.1    shige #  define	AUPSC_SEL_SPI		2
     62  1.1    shige #  define	AUPSC_SEL_I2S		3
     63  1.1    shige #  define	AUPSC_SEL_AC97		4
     64  1.1    shige #  define	AUPSC_SEL_SMBUS		5
     65  1.1    shige 
     66  1.1    shige /* psc_ctrl: PSC control
     67  1.1    shige  *  ENA [1:0]
     68  1.1    shige  *    00 = Disable/Reset
     69  1.1    shige  *    01 = Reserved
     70  1.1    shige  *    10 = Suspend
     71  1.2    shige  *    11 = Enable
     72  1.1    shige  */
     73  1.1    shige #define	AUPSC_CTRL			0x04	/* R/W */
     74  1.1    shige #  define	AUPSC_CTRL_ENA(x)	(x & 0x03)
     75  1.2    shige #  define	AUPSC_CTRL_DISABLE	0
     76  1.2    shige #  define	AUPSC_CTRL_SUSPEND	2
     77  1.2    shige #  define	AUPSC_CTRL_ENABLE	3
     78  1.1    shige 
     79  1.1    shige /* 0x0008 - 0x002F: Protocol-specific registers */
     80  1.1    shige 
     81  1.3  gdamore /* psc_stat: PSC status
     82  1.3  gdamore  *  DI [1]
     83  1.3  gdamore  *    1 = Device interrupt
     84  1.3  gdamore  *  DR [1]
     85  1.3  gdamore  *    1 = Device ready
     86  1.3  gdamore  *  SR [0]
     87  1.3  gdamore  *    1 = PSC ready
     88  1.3  gdamore  *  all other bits a are protocol specific
     89  1.3  gdamore  */
     90  1.3  gdamore #define AUPSC_STAT			0x14
     91  1.3  gdamore #  define	AUPSC_STAT_SR		1
     92  1.3  gdamore #  define	AUPSC_STAT_DR		2
     93  1.3  gdamore #  define	AUPSC_STAT_DI		4
     94  1.1    shige /* PSC registers size */
     95  1.1    shige #define	AUPSC_SIZE			0x2f
     96  1.1    shige 
     97  1.1    shige 
     98  1.1    shige /*
     99  1.1    shige  * SPI Protocol registers
    100  1.1    shige  */
    101  1.1    shige #define	AUPSC_SPICFG			0x08	/* R/W */
    102  1.1    shige #define	AUPSC_SPIMSK			0x0c	/* R/W */
    103  1.1    shige #define	AUPSC_SPIPCR			0x10	/* R/W */
    104  1.1    shige #define	AUPSC_SPISTAT			0x14	/* Read only */
    105  1.1    shige #define	AUPSC_SPIEVNT			0x18	/* R/W */
    106  1.1    shige #define	AUPSC_SPITXRX			0x1c	/* R/W */
    107  1.1    shige 
    108  1.1    shige /*
    109  1.1    shige  * I2S Protocol registers
    110  1.1    shige  */
    111  1.1    shige #define	AUPSC_I2SCFG			0x08	/* R/W */
    112  1.1    shige #define	AUPSC_I2SMSK			0x0c	/* R/W */
    113  1.1    shige #define	AUPSC_I2SPCR			0x10	/* R/W */
    114  1.1    shige #define	AUPSC_I2SSTAT			0x14	/* Read only */
    115  1.1    shige #define	AUPSC_I2SEVNT			0x18	/* R/W */
    116  1.1    shige #define	AUPSC_I2STXRX			0x1c	/* R/W */
    117  1.1    shige #define	AUPSC_I2SUDF			0x20	/* R/W */
    118  1.1    shige 
    119  1.1    shige /*
    120  1.1    shige  * AC97 Protocol registers
    121  1.1    shige  */
    122  1.1    shige #define	AUPSC_AC97CFG			0x08	/* R/W */
    123  1.1    shige #define	AUPSC_AC97MSK			0x0c	/* R/W */
    124  1.1    shige #define	AUPSC_AC97PCR			0x10	/* R/W */
    125  1.1    shige #define	AUPSC_AC97STAT			0x14	/* Read only */
    126  1.1    shige #define	AUPSC_AC97EVNT			0x18	/* R/W */
    127  1.1    shige #define	AUPSC_AC97TXRX			0x1c	/* R/W */
    128  1.1    shige #define	AUPSC_AC97CDC			0x20	/* R/W */
    129  1.1    shige #define	AUPSC_AC97RST			0x24	/* R/W */
    130  1.1    shige #define	AUPSC_AC97GPO			0x28	/* R/W */
    131  1.1    shige #define	AUPSC_AC97GPI			0x2c	/* Read only */
    132  1.1    shige 
    133  1.1    shige /*
    134  1.1    shige  * SMBus Protocol registers
    135  1.1    shige  */
    136  1.1    shige #define	AUPSC_SMBCFG			0x08	/* R/W */
    137  1.1    shige #define	AUPSC_SMBMSK			0x0c	/* R/W */
    138  1.1    shige #define	AUPSC_SMBPCR			0x10	/* R/W */
    139  1.1    shige #define	AUPSC_SMBSTAT			0x14	/* Read only */
    140  1.1    shige #define	AUPSC_SMBEVNT			0x18	/* R/W */
    141  1.1    shige #define	AUPSC_SMBTXRX			0x1c	/* R/W */
    142  1.1    shige #define	AUPSC_SMBTMR			0x20	/* R/W */
    143  1.1    shige 
    144  1.1    shige #endif	/* _MIPS_ALCHEMY_DEV_AUPSCREG_H_ */
    145