Home | History | Annotate | Line # | Download | only in ic
nec7210reg.h revision 1.1
      1 /*	$NetBSD: nec7210reg.h,v 1.1 2003/06/02 03:54:31 gmcgarry Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 2003 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Gregory McGarry.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *        This product includes software developed by the NetBSD
     21  *        Foundation, Inc. and its contributors.
     22  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  *    contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  * POSSIBILITY OF SUCH DAMAGE.
     37  */
     38 
     39 #define NEC7210_IOSIZE		8
     40 
     41 /*
     42  * Direct-access Registers (write only)
     43  */
     44 
     45 #define NEC7210_CDOR		0	/* (W) command/data out */
     46 #define NEC7210_IMR1		1	/* (W) interrupt mask 1 */
     47 #define		IMR1_DI		0x01
     48 #define		IMR1_DO		0x02
     49 #define		IMR1_ERR	0x04
     50 #define		IMR1_DEC	0x08
     51 #define		IMR1_END	0x10
     52 #define		IMR1_DET	0x20
     53 #define		IMR1_APT	0x20
     54 #define		IMR1_CPT	0x80
     55 #define NEC7210_IMR2		2	/* (W) interrupt mask 2 */
     56 #define 	IMR2_ADSC 	0x01
     57 #define 	IMR2_REMC	0x02
     58 #define 	IMR2_LOKC	0x04
     59 #define 	IMR2_CO		0x08
     60 #define 	IMR2_DMAI	0x10
     61 #define 	IMR2_DMAO	0x20
     62 #define 	IMR2_SRQ	0x40
     63 #define NEC7210_SPMR		3	/* (W) serial poll mode */
     64 #define 	SPMR_RSV	0x80
     65 #define NEC7210_ADMR		4	/* (W) address mode */
     66 #define 	ADMR_ADM0	0x01
     67 #define 	ADMR_ADM1	0x02
     68 #define 	ADMR_TRM0	0x10
     69 #define 	ADMR_TRM1	0x20
     70 #define 	ADMR_LON	0x40
     71 #define 	ADMR_TON	0x80
     72 #define NEC7210_AUXMR		5	/* (W) auxilliary mode */
     73 #define		AUXMR_CMD	0x00	/* see below */
     74 #define 	AUXMR_ICR	0x20
     75 #define		AUXMR_REGD	0x40
     76 #define 	AUXMR_PPOLL	0x60
     77 #define 	AUXMR_REGA	0x80
     78 #define 	AUXMR_REGB	0xa0
     79 #define 	AUXMR_REGE	0xc0
     80 #define 	AUXMR_EXTERN	0xe0
     81 #define NEC7210_ADDR		6	/* (W) address */
     82 #define		ADDR_MASK	0x1f
     83 #define 	ADDR_DL 	0x20
     84 #define 	ADDR_DT 	0x40
     85 #define		ADDR_ARS	0x80
     86 #define NEC7210_EOSR		7	/* (W) end-of-string */
     87 
     88 /*
     89  * Direct-access Registers (read only)
     90  */
     91 
     92 #define NEC7210_DIR		0	/* (R) data in */
     93 #define NEC7210_ISR1		1	/* (R) interrupt status 1 */
     94 #define 	ISR1_DI		0x01
     95 #define 	ISR1_DO		0x02
     96 #define 	ISR1_ERR	0x04
     97 #define  	ISR1_DEC	0x08
     98 #define  	ISR1_END	0x10
     99 #define  	ISR1_DET	0x20
    100 #define  	ISR1_APT	0x40
    101 #define  	ISR1_CPT	0x80
    102 #define NEC7210_ISR2		2	/* (R) interrupt status 2 */
    103 #define 	ISR2_ADSC	0x01
    104 #define  	ISR2_REMC	0x02
    105 #define  	ISR2_LOKC	0x04
    106 #define  	ISR2_CO		0x08
    107 #define  	ISR2_REM	0x10
    108 #define  	ISR2_LOK	0x20
    109 #define  	ISR2_SRQI	0x40
    110 #define  	ISR2_INT	0x80
    111 #define NEC7210_SPSR		3	/* (R) serial poll status */
    112 #define 	SPSR_PEND	0x80
    113 #define NEC7210_ADSR		4	/* (R) address status */
    114 #define 	ADSR_MJMN 	0x01
    115 #define  	ADSR_TA		0x02
    116 #define  	ADSR_LA		0x04
    117 #define 	ADSR_TPAS	0x08
    118 #define 	ADSR_LPAS	0x10
    119 #define  	ADSR_SPMS	0x20
    120 #define 	ADSR_NATN	0x40
    121 #define  	ADSR_CIC	0x80
    122 #define NEC7210_CPTR		5	/* (R) command pass-though */
    123 #define NEC7210_ADDR0		6	/* (R) address 1 */
    124 #define		ADDR1_EOI	0x80
    125 #define NEC7210_ADDR1		7	/* (R) address 2 */
    126 
    127 /*
    128  * Auxiliary Register A (indirect-access)
    129  */
    130 
    131 #define AUX_A_HSNORM		0x00
    132 #define AUX_A_HLDA   		0x01
    133 #define AUX_A_HLDE  		0x02
    134 #define AUX_A_REOS		0x04
    135 #define AUX_A_XEOS		0x08
    136 #define AUX_A_BIN		0x10
    137 #define AUX_A_CONT   		(AUX_A_HLDA | AUX_A_HLDE)
    138 
    139 /*
    140  * Auxiliary Register B (indirect-access)
    141  */
    142 
    143 #define AUX_B_CPTE		0x01
    144 #define AUX_B_SPEOI        	0x02
    145 #define AUX_B_TRI		0x04
    146 #define AUX_B_INV		0x08
    147 #define AUX_B_ISS		0x10
    148 
    149 /*
    150  * Parallel Poll Register (indirect-access)
    151  */
    152 
    153 #define	PPOLL_PPS		0x08
    154 #define	PPOLL_PPU		0x10	/* Parallel poll unconfigure */
    155 
    156 /*
    157  * nec7210 Auxiliary Commands (NEC7210_AUXMR)
    158  */
    159 
    160 #define AUXCMD_IEPON		0x0	/* Immediate Execute pon */
    161 #define AUXCMD_CPPF		0x1	/* Clear Parallel Poll Flag */
    162 #define AUXCMD_CRST		0x2	/* Chip Reset */
    163 #define AUXCMD_RHDF		0x3	/* Release RFD holdoff */
    164 #define AUXCMD_TRIG		0x4	/* Trigger */
    165 #define AUXCMD_RTL		0x5	/* Return to local */
    166 #define AUXCMD_SEOI		0x6	/* Send EOI */
    167 #define AUXCMD_NVLD		0x7	/* Non-Valid Secondary Cmd or Addr */
    168 #define AUXCMD_SPPF		0x9	/* Set Parallel Poll Flag */
    169 #define AUXCMD_VLD		0xf	/* Valid Secondary Cmd or Addr */
    170 #define AUXCMD_GTS		0x10	/* Go To Standby */
    171 #define AUXCMD_TCA		0x11	/* Take Control Asynchronously */
    172 #define AUXCMD_TCS		0x12	/* Take Control Synchronously */
    173 #define AUXCMD_LTN		0x13	/* Listen */
    174 #define AUXCMD_DSC		0x14	/* Disable System Control */
    175 #define AUXCMD_CIFC		0x16	/* Clear IFC */
    176 #define AUXCMD_CREN		0x17	/* Clear REN */
    177 #define AUXCMD_TCSE		0x1a	/* Take Control Synchronously on End */
    178 #define AUXCMD_LTNC		0x1b	/* Listen in Continuous Mode */
    179 #define AUXCMD_LUN		0x1c	/* Local Unlisten */
    180 #define AUXCMD_EPP		0x1d	/* Execute Parallel Poll */
    181 #define AUXCMD_SIFC		0x1e	/* Set IFC */
    182 #define AUXCMD_SREN		0x1f	/* Set REN */
    183