1 1.1 gdamore /* $NetBSD: auspireg.h,v 1.1 2006/10/02 08:00:07 gdamore Exp $ */ 2 1.1 gdamore 3 1.1 gdamore /*- 4 1.1 gdamore * Copyright (c) 2006 Urbana-Champaign Independent Media Center. 5 1.1 gdamore * Copyright (c) 2006 Garrett D'Amore. 6 1.1 gdamore * All rights reserved. 7 1.1 gdamore * 8 1.1 gdamore * Portions of this code were written by Garrett D'Amore for the 9 1.1 gdamore * Champaign-Urbana Community Wireless Network Project. 10 1.1 gdamore * 11 1.1 gdamore * Redistribution and use in source and binary forms, with or 12 1.1 gdamore * without modification, are permitted provided that the following 13 1.1 gdamore * conditions are met: 14 1.1 gdamore * 1. Redistributions of source code must retain the above copyright 15 1.1 gdamore * notice, this list of conditions and the following disclaimer. 16 1.1 gdamore * 2. Redistributions in binary form must reproduce the above 17 1.1 gdamore * copyright notice, this list of conditions and the following 18 1.1 gdamore * disclaimer in the documentation and/or other materials provided 19 1.1 gdamore * with the distribution. 20 1.1 gdamore * 3. All advertising materials mentioning features or use of this 21 1.1 gdamore * software must display the following acknowledgements: 22 1.1 gdamore * This product includes software developed by the Urbana-Champaign 23 1.1 gdamore * Independent Media Center. 24 1.1 gdamore * This product includes software developed by Garrett D'Amore. 25 1.1 gdamore * 4. Urbana-Champaign Independent Media Center's name and Garrett 26 1.1 gdamore * D'Amore's name may not be used to endorse or promote products 27 1.1 gdamore * derived from this software without specific prior written permission. 28 1.1 gdamore * 29 1.1 gdamore * THIS SOFTWARE IS PROVIDED BY THE URBANA-CHAMPAIGN INDEPENDENT 30 1.1 gdamore * MEDIA CENTER AND GARRETT D'AMORE ``AS IS'' AND ANY EXPRESS OR 31 1.1 gdamore * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 32 1.1 gdamore * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 33 1.1 gdamore * ARE DISCLAIMED. IN NO EVENT SHALL THE URBANA-CHAMPAIGN INDEPENDENT 34 1.1 gdamore * MEDIA CENTER OR GARRETT D'AMORE BE LIABLE FOR ANY DIRECT, INDIRECT, 35 1.1 gdamore * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 36 1.1 gdamore * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 37 1.1 gdamore * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 38 1.1 gdamore * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 1.1 gdamore * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 40 1.1 gdamore * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 41 1.1 gdamore * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42 1.1 gdamore */ 43 1.1 gdamore 44 1.1 gdamore #ifndef _MIPS_ALCHEMY_AUSPIREG_H_ 45 1.1 gdamore #define _MIPS_ALCHEMY_AUSPIREG_H_ 46 1.1 gdamore 47 1.1 gdamore #define SPICFG_RT_8 (0x3 << 30) 48 1.1 gdamore #define SPICFG_RT_4 (0x2 << 30) 49 1.1 gdamore #define SPICFG_RT_2 (0x1 << 30) 50 1.1 gdamore #define SPICFG_RT_1 (0x0 << 30) 51 1.1 gdamore #define SPICFG_TT_8 (0x3 << 28) 52 1.1 gdamore #define SPICFG_TT_4 (0x2 << 28) 53 1.1 gdamore #define SPICFG_TT_2 (0x1 << 28) 54 1.1 gdamore #define SPICFG_TT_1 (0x0 << 28) 55 1.1 gdamore #define SPICFG_DD (1 << 27) /* disable DMA */ 56 1.1 gdamore #define SPICFG_DE (1 << 26) /* device enable */ 57 1.1 gdamore #define SPICFG_BRG_MASK (0x3f << 15) /* baud rate generator */ 58 1.1 gdamore #define SPICFG_BRG_SHIFT 15 59 1.1 gdamore #define SPICFG_DIV_MASK (0x3 << 13) /* psc clock divider */ 60 1.1 gdamore #define SPICFG_DIV_SHIFT 13 61 1.1 gdamore #define SPICFG_BI (1 << 12) /* bit clock invert */ 62 1.1 gdamore #define SPICFG_PSE (1 << 11) /* port swap enable */ 63 1.1 gdamore #define SPICFG_CGE (1 << 10) /* clock gate enable */ 64 1.1 gdamore #define SPICFG_CDE (1 << 9) /* clock phase delay enable */ 65 1.1 gdamore #define SPICFG_LEN_MASK (0x1f << 4) /* data length */ 66 1.1 gdamore #define SPICFG_LEN_SHIFT 4 67 1.1 gdamore #define SPICFG_LB (1 << 3) /* loopback mode */ 68 1.1 gdamore #define SPICFG_MLF (1 << 2) /* msb/lsb data first */ 69 1.1 gdamore #define SPICFG_MO (1 << 0) /* master only mode */ 70 1.1 gdamore 71 1.1 gdamore /* and also SPIEVNT */ 72 1.1 gdamore #define SPIMSK_MM (1 << 16) /* multiple master error */ 73 1.1 gdamore #define SPIMSK_RR (1 << 13) /* rx fifo request */ 74 1.1 gdamore #define SPIMSK_RO (1 << 12) /* rx fifo overflow */ 75 1.1 gdamore #define SPIMSK_RU (1 << 11) /* rx fifo underflow */ 76 1.1 gdamore #define SPIMSK_TR (1 << 10) /* tx fifo request */ 77 1.1 gdamore #define SPIMSK_TO (1 << 9) /* tx fifo overflow */ 78 1.1 gdamore #define SPIMSK_TU (1 << 8) /* tx fifo underflow */ 79 1.1 gdamore #define SPIMSK_SD (1 << 5) /* slave done */ 80 1.1 gdamore #define SPIMSK_MD (1 << 4) /* master done */ 81 1.1 gdamore #define SPIMSK_ALL (SPIMSK_MM | SPIMSK_RR | SPIMSK_RO | \ 82 1.1 gdamore SPIMSK_RU | SPIMSK_TR | SPIMSK_TO | \ 83 1.1 gdamore SPIMSK_TU | SPIMSK_SD | SPIMSK_MD) 84 1.1 gdamore #define SPIMSK_NORM (SPIMSK_RU | SPIMSK_TO | SPIMSK_TR | SPIMSK_SD) 85 1.1 gdamore 86 1.1 gdamore #define SPIPCR_RC (1 << 6) /* rx data clear */ 87 1.1 gdamore #define SPIPCR_SP (1 << 5) /* slave stop */ 88 1.1 gdamore #define SPIPCR_SS (1 << 4) /* slave start */ 89 1.1 gdamore #define SPIPCR_TC (1 << 2) /* tx data clear */ 90 1.1 gdamore #define SPIPCR_MS (1 << 0) /* master start*/ 91 1.1 gdamore 92 1.1 gdamore #define SPISTAT_RF (1 << 13) /* rx fifo full */ 93 1.1 gdamore #define SPISTAT_RE (1 << 12) /* rx fifo empty */ 94 1.1 gdamore #define SPISTAT_RR (1 << 11) /* rx request */ 95 1.1 gdamore #define SPISTAT_TF (1 << 10) /* tx fifo full */ 96 1.1 gdamore #define SPISTAT_TE (1 << 9) /* tx fifo empty */ 97 1.1 gdamore #define SPISTAT_TR (1 << 8) /* tx request */ 98 1.1 gdamore #define SPISTAT_SB (1 << 5) /* slave busy */ 99 1.1 gdamore #define SPISTAT_MB (1 << 4) /* master busy */ 100 1.1 gdamore #define SPISTAT_DI (1 << 2) /* device interrupt */ 101 1.1 gdamore #define SPISTAT_DR (1 << 1) /* device ready */ 102 1.1 gdamore #define SPISTAT_SR (1 << 0) /* psc ready */ 103 1.1 gdamore 104 1.1 gdamore #define SPITXRX_LC (1 << 29) /* last character */ 105 1.1 gdamore #define SPITXRX_ST (1 << 28) /* select togle */ 106 1.1 gdamore #define SPITXRX_DATA_MASK (0xffffff) 107 1.1 gdamore #define SPITXRX_DATA_SHIFT 0 108 1.1 gdamore 109 1.1 gdamore #endif /* _MIPS_ALCHEMY_AUSPIREG_H_ */ 110