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