xref: /csrg-svn/sys/sparc/dev/zsreg.h (revision 63318)
155107Storek /*
2*63318Sbostic  * Copyright (c) 1992, 1993
3*63318Sbostic  *	The Regents of the University of California.  All rights reserved.
455107Storek  *
555107Storek  * This software was developed by the Computer Systems Engineering group
655107Storek  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
755107Storek  * contributed to Berkeley.
855107Storek  *
955499Sbostic  * All advertising materials mentioning features or use of this software
1055499Sbostic  * must display the following acknowledgement:
1155499Sbostic  *	This product includes software developed by the University of
1259192Storek  *	California, Lawrence Berkeley Laboratory.
1355499Sbostic  *
1455107Storek  * %sccs.include.redist.c%
1555107Storek  *
16*63318Sbostic  *	@(#)zsreg.h	8.1 (Berkeley) 06/11/93
1755107Storek  *
1859192Storek  * from: $Header: zsreg.h,v 1.7 92/11/26 01:27:18 torek Exp $ (LBL)
1955107Storek  */
2055107Storek 
2155107Storek /*
2255107Storek  * Zilog SCC registers, as implemented on the Sun-4c.
2355107Storek  *
2455107Storek  * Each Z8530 implements two channels (called `a' and `b').
2555107Storek  *
2655107Storek  * The damnable chip was designed to fit on Z80 I/O ports, and thus
2755107Storek  * has everything multiplexed out the wazoo.  We have to select
2855107Storek  * a register, then read or write the register, and so on.  Worse,
2955107Storek  * the parameter bits are scattered all over the register space.
3055107Storek  * This thing is full of `miscellaneous' control registers.
3155107Storek  *
3255107Storek  * Worse yet, the registers have incompatible functions on read
3355107Storek  * and write operations.  We describe the registers below according
3455107Storek  * to whether they are `read registers' (RR) or `write registers' (WR).
3555107Storek  * As if this were not enough, some of the channel B status bits show
3655107Storek  * up in channel A, and vice versa.  The blasted thing shares write
3755107Storek  * registers 2 and 9 across both channels, and reads registers 2 and 3
3855107Storek  * differently for the two channels.  We can, however, ignore this much
3955107Storek  * of the time.
4055107Storek  */
4155107Storek #ifndef LOCORE
4255107Storek struct zschan {
4355107Storek 	u_char	zc_csr;		/* control and status, and indirect access */
4455107Storek 	u_char	zc_xxx0;
4555107Storek 	u_char	zc_data;	/* data */
4655107Storek 	u_char	zc_xxx1;
4755107Storek };
4855107Storek 
4955107Storek /*
5055107Storek  * N.B.: the keyboard is channel 1, the mouse channel 0; ttyb is 1, ttya
5155107Storek  * is 0.  In other words, the things are BACKWARDS.
5255107Storek  */
5355107Storek struct zsdevice {
5455107Storek 	struct	zschan zs_chan[2];	/* channel A = 1, B = 0 */
5555107Storek };
5655107Storek 
5755107Storek #define	CHAN_A	1
5855107Storek #define	CHAN_B	0
5955107Storek #endif
6055107Storek 
6155107Storek /*
6255107Storek  * Some of the names in this files were chosen to make the hsis driver
6355107Storek  * work unchanged (which means that they will match some in SunOS).
6455107Storek  *
6555107Storek  * `S.C.' stands for Special Condition, which is any of these:
6655107Storek  *	receiver overrun	(aka silo overflow)
6755107Storek  *	framing error		(missing stop bit, etc)
6855107Storek  *	end of frame		(in synchronous modes)
6955107Storek  *	parity error		(when `parity error is S.C.' is set)
7055107Storek  */
7155107Storek 
7255107Storek /*
7355107Storek  * Registers with only a single `numeric value' get a name.
7455107Storek  * Other registers hold bits and are only numbered; the bit
7555107Storek  * definitions imply the register number (see below).
7655107Storek  *
7755107Storek  * We never use the receive and transmit data registers as
7855107Storek  * indirects (choosing instead the zc_data register), so they
7955107Storek  * are not defined here.
8055107Storek  */
8155107Storek #define	ZSRR_IVEC	2	/* interrupt vector (channel 0) */
8255107Storek #define	ZSRR_IPEND	3	/* interrupt pending (ch. 0 only) */
8355107Storek #define	ZSRR_BAUDLO	12	/* baud rate generator (low half) */
8455107Storek #define	ZSRR_BAUDHI	13	/* baud rate generator (high half) */
8555107Storek 
8655107Storek #define	ZSWR_IVEC	2	/* interrupt vector (shared) */
8755107Storek #define	ZSWR_TXSYNC	6	/* sync transmit char (monosync mode) */
8855107Storek #define	ZSWR_RXSYNC	7	/* sync receive char (monosync mode) */
8955107Storek #define	ZSWR_SYNCLO	6	/* sync low byte (bisync mode) */
9055107Storek #define	ZSWR_SYNCHI	7	/* sync high byte (bisync mode) */
9155107Storek #define	ZSWR_SDLC_ADDR	6	/* SDLC address (SDLC mode) */
9255107Storek #define	ZSWR_SDLC_FLAG	7	/* SDLC flag 0x7E (SDLC mode) */
9355107Storek #define	ZSWR_BAUDLO	12	/* baud rate generator (low half) */
9455107Storek #define	ZSWR_BAUDHI	13	/* baud rate generator (high half) */
9555107Storek 
9655107Storek /*
9755107Storek  * Registers 0 through 7 may be written with any one of the 8 command
9855107Storek  * modifiers, and/or any one of the 4 reset modifiers, defined below.
9955107Storek  * To write registers 8 through 15, however, the command modifier must
10055107Storek  * always be `point high'.  Rather than track this bizzareness all over
10155107Storek  * the driver, we try to avoid using any modifiers, ever (but they are
10255107Storek  * defined here if you want them).
10355107Storek  */
10455107Storek #define	ZSM_RESET_TXUEOM	0xc0	/* reset xmit underrun / eom latch */
10555107Storek #define	ZSM_RESET_TXCRC		0x80	/* reset xmit crc generator */
10655107Storek #define	ZSM_RESET_RXCRC		0x40	/* reset recv crc checker */
10755107Storek #define	ZSM_NULL		0x00	/* nothing special */
10855107Storek 
10955107Storek #define	ZSM_RESET_IUS		0x38	/* reset interrupt under service */
11055107Storek #define	ZSM_RESET_ERR		0x30	/* reset error cond */
11155107Storek #define	ZSM_RESET_TXINT		0x28	/* reset xmit interrupt pending */
11255107Storek #define	ZSM_EI_NEXTRXC		0x20	/* enable int. on next rcvd char */
11355107Storek #define	ZSM_SEND_ABORT		0x18	/* send abort (SDLC) */
11455107Storek #define	ZSM_RESET_STINT		0x10	/* reset external/status interrupt */
11555107Storek #define	ZSM_POINTHIGH		0x08	/* `point high' (use r8-r15) */
11655107Storek #define	ZSM_NULL		0x00	/* nothing special */
11755107Storek 
11855107Storek /*
11955107Storek  * Commands for Write Register 0 (`Command Register').
12055107Storek  * These are just the command modifiers or'ed with register number 0
12155107Storek  * (which of course equals the command modifier).
12255107Storek  */
12355107Storek #define	ZSWR0_RESET_EOM		ZSM_RESET_TXUEOM
12455107Storek #define	ZSWR0_RESET_TXCRC	ZSM_RESET_TXCRC
12555107Storek #define	ZSWR0_RESET_RXCRC	ZSM_RESET_RXCRC
12655107Storek #define	ZSWR0_CLR_INTR		ZSM_RESET_IUS
12755107Storek #define	ZSWR0_RESET_ERRORS	ZSM_RESET_ERR
12855107Storek #define	ZSWR0_EI_NEXTRXC	ZSM_EI_NEXTRXC
12955107Storek #define	ZSWR0_SEND_ABORT	ZSM_SEND_ABORT
13055107Storek #define	ZSWR0_RESET_STATUS	ZSM_RESET_STINT
13155107Storek #define	ZSWR0_RESET_TXINT	ZSM_RESET_TXINT
13255107Storek 
13355107Storek /*
13455107Storek  * Bits in Write Register 1 (`Transmit/Receive Interrupt and Data
13555107Storek  * Transfer Mode Definition').  Note that bits 3 and 4 are taken together
13655107Storek  * as a single unit, and bits 5 and 6 are useful only if bit 7 is set.
13755107Storek  */
13855107Storek #define	ZSWR1_REQ_WAIT		0x80	/* WAIT*-REQ* pin gives WAIT* */
13955107Storek #define	ZSWR1_REQ_REQ		0xc0	/* WAIT*-REQ* pin gives REQ* */
14055107Storek #define	ZSWR1_REQ_TX		0x00	/* WAIT*-REQ* pin follows xmit buf */
14155107Storek #define	ZSWR1_REQ_RX		0x20	/* WAIT*-REQ* pin follows recv buf */
14255107Storek 
14355107Storek #define	ZSWR1_RIE_NONE		0x00	/* disable rxint entirely */
14455107Storek #define	ZSWR1_RIE_FIRST		0x08	/* rxint on first char & on S.C. */
14555107Storek #define	ZSWR1_RIE		0x10	/* rxint per char & on S.C. */
14655107Storek #define	ZSWR1_RIE_SPECIAL_ONLY	0x18	/* rxint on S.C. only */
14755107Storek 
14855107Storek #define	ZSWR1_PE_SC		0x04	/* parity error is special condition */
14955107Storek #define	ZSWR1_TIE		0x02	/* transmit interrupt enable */
15055107Storek #define	ZSWR1_SIE		0x01	/* external/status interrupt enable */
15155107Storek 
15255107Storek /* HSIS compat */
15355107Storek #define	ZSWR1_REQ_ENABLE	(ZSWR1_REQ_WAIT | ZSWR1_REQ_TX)
15455107Storek 
15555107Storek /*
15655107Storek  * Bits in Write Register 3 (`Receive Parameters and Control').
15755107Storek  * Bits 7 and 6 are taken as a unit.  Note that the receive bits
15855107Storek  * per character ordering is insane.
15955107Storek  *
16055107Storek  * Here `hardware flow control' means CTS enables the transmitter
16155107Storek  * and DCD enables the receiver.  The latter is neither interesting
16255107Storek  * nor useful, and gets in our way, making it almost unusable.
16355107Storek  */
16455107Storek #define	ZSWR3_RX_5		0x00	/* receive 5 bits per char */
16555107Storek #define	ZSWR3_RX_7		0x40	/* receive 7 bits per char */
16655107Storek #define	ZSWR3_RX_6		0x80	/* receive 6 bits per char */
16755107Storek #define	ZSWR3_RX_8		0xc0	/* receive 8 bits per char */
16855107Storek 
16955107Storek #define	ZSWR3_HFC		0x20	/* hardware flow control */
17055107Storek #define	ZSWR3_HUNT		0x10	/* enter hunt mode */
17155107Storek #define	ZSWR3_RXCRC_ENABLE	0x08	/* enable recv crc calculation */
17255107Storek #define	ZSWR3_ADDR_SEARCH_MODE	0x04	/* address search mode (SDLC only) */
17355107Storek #define	ZSWR3_SYNC_LOAD_INH	0x02	/* sync character load inhibit */
17455107Storek #define	ZSWR3_RX_ENABLE		0x01	/* receiver enable */
17555107Storek 
17655107Storek /*
17755107Storek  * Bits in Write Register 4 (`Transmit/Receive Miscellaneous Parameters
17855107Storek  * and Modes').  Bits 7&6, 5&4, and 3&2 are taken as units.
17955107Storek  */
18055107Storek #define	ZSWR4_CLK_X1		0x00	/* clock divisor = 1 */
18155107Storek #define	ZSWR4_CLK_X16		0x40	/* clock divisor = 16 */
18255107Storek #define	ZSWR4_CLK_X32		0x80	/* clock divisor = 32 */
18355107Storek #define	ZSWR4_CLK_X64		0xc0	/* clock divisor = 64 */
18455107Storek 
18555107Storek #define	ZSWR4_MONOSYNC		0x00	/* 8 bit sync char (sync only) */
18655107Storek #define	ZSWR4_BISYNC		0x10	/* 16 bit sync char (sync only) */
18755107Storek #define	ZSWR4_SDLC		0x20	/* SDLC mode */
18855107Storek #define	ZSWR4_EXTSYNC		0x30	/* external sync mode */
18955107Storek 
19055107Storek #define	ZSWR4_SYNCMODE		0x00	/* one of the above sync modes */
19155107Storek #define	ZSWR4_ONESB		0x04	/* 1 stop bit */
19255107Storek #define	ZSWR4_1P5SB		0x08	/* 1.5 stop bits (clk cannot be 1x) */
19355107Storek #define	ZSWR4_TWOSB		0x0c	/* 2 stop bits */
19455107Storek 
19555107Storek #define	ZSWR4_EVENP		0x02	/* check for even parity */
19655107Storek #define	ZSWR4_PARENB		0x01	/* enable parity checking */
19755107Storek 
19855107Storek /*
19955107Storek  * Bits in Write Register 5 (`Transmit Parameter and Controls').
20055107Storek  * Bits 6 and 5 are taken as a unit; the ordering is, as with RX
20155107Storek  * bits per char, not sensible.
20255107Storek  */
20355107Storek #define	ZSWR5_DTR		0x80	/* assert (set to -12V) DTR */
20455107Storek 
20555107Storek #define	ZSWR5_TX_5		0x00	/* transmit 5 or fewer bits */
20655107Storek #define	ZSWR5_TX_7		0x20	/* transmit 7 bits */
20755107Storek #define	ZSWR5_TX_6		0x40	/* transmit 6 bits */
20855107Storek #define	ZSWR5_TX_8		0x60	/* transmit 8 bits */
20955107Storek 
21055107Storek #define	ZSWR5_BREAK		0x10	/* send break (continuous 0s) */
21155107Storek #define	ZSWR5_TX_ENABLE		0x08	/* enable transmitter */
21255107Storek #define	ZSWR5_CRC16		0x04	/* use CRC16 (off => use SDLC) */
21355107Storek #define	ZSWR5_RTS		0x02	/* assert RTS */
21455107Storek #define	ZSWR5_TXCRC_ENABLE	0x01	/* enable xmit crc calculation */
21555107Storek 
21655107Storek #ifdef not_done_here
21755107Storek /*
21855107Storek  * Bits in Write Register 7 when the chip is in SDLC mode.
21955107Storek  */
22055107Storek #define	ZSWR7_SDLCFLAG		0x7e	/* this value makes SDLC mode work */
22155107Storek #endif
22255107Storek 
22355107Storek /*
22455107Storek  * Bits in Write Register 9 (`Master Interrupt Control').  Bits 7 & 6
22555107Storek  * are taken as a unit and indicate the type of reset; 00 means no reset
22655107Storek  * (and is not defined here).
22755107Storek  */
22855107Storek #define	ZSWR9_HARD_RESET	0xc0	/* force hardware reset */
22955107Storek #define	ZSWR9_A_RESET		0x80	/* reset channel A (0) */
23055107Storek #define	ZSWR9_B_RESET		0x40	/* reset channel B (1) */
23155107Storek 			/*	0x20	   unused */
23255107Storek 
23355107Storek #define	ZSWR9_STATUS_HIGH	0x10	/* status in high bits of intr vec */
23455107Storek #define	ZSWR9_MASTER_IE		0x08	/* master interrupt enable */
23555107Storek #define	ZSWR9_DLC		0x04	/* disable lower chain */
23655107Storek #define	ZSWR9_NO_VECTOR		0x02	/* no vector */
23755107Storek #define	ZSWR9_VECTOR_INCL_STAT	0x01	/* vector includes status */
23855107Storek 
23955107Storek /*
24055107Storek  * Bits in Write Register 10 (`Miscellaneous Transmitter/Receiver Control
24155107Storek  * Bits').  Bits 6 & 5 are taken as a unit, and some of the bits are
24255107Storek  * meaningful only in certain modes.  Bleah.
24355107Storek  */
24455107Storek #define	ZSWR10_PRESET_ONES	0x80	/* preset CRC to all 1 (else all 0) */
24555107Storek 
24655107Storek #define	ZSWR10_NRZ		0x00	/* NRZ encoding */
24755107Storek #define	ZSWR10_NRZI		0x20	/* NRZI encoding */
24855107Storek #define	ZSWR10_FM1		0x40	/* FM1 encoding */
24955107Storek #define	ZSWR10_FM0		0x60	/* FM0 encoding */
25055107Storek 
25155107Storek #define	ZSWR10_GA_ON_POLL	0x10	/* go active on poll (loop mode) */
25255107Storek #define	ZSWR10_MARK_IDLE	0x08	/* all 1s (vs flag) when idle (SDLC) */
25355107Storek #define	ZSWR10_ABORT_ON_UNDERRUN 0x4	/* abort on xmit underrun (SDLC) */
25455107Storek #define	ZSWR10_LOOP_MODE	0x02	/* loop mode (SDLC) */
25555107Storek #define	ZSWR10_6_BIT_SYNC	0x01	/* 6 bits per sync char (sync modes) */
25655107Storek 
25755107Storek /*
25855107Storek  * Bits in Write Register 11 (`Clock Mode Control').  Bits 6&5, 4&3, and
25955107Storek  * 1&0 are taken as units.  Various bits depend on other bits in complex
26055107Storek  * ways; see the Zilog manual.
26155107Storek  */
26255107Storek #define	ZSWR11_XTAL		0x80	/* have xtal between RTxC* and SYNC* */
26355107Storek 					/* (else have TTL oscil. on RTxC*) */
26455107Storek #define	ZSWR11_RXCLK_RTXC	0x00	/* recv clock taken from TRxC* pin */
26555107Storek #define	ZSWR11_RXCLK_TRXC	0x20	/* recv clock taken from TRxC* pin */
26655107Storek #define	ZSWR11_RXCLK_BAUD	0x40	/* recv clock taken from BRG */
26755107Storek #define	ZSWR11_RXCLK_DPLL	0x60	/* recv clock taken from DPLL */
26855107Storek 
26955107Storek #define	ZSWR11_TXCLK_RTXC	0x00	/* xmit clock taken from TRxC* pin */
27055107Storek #define	ZSWR11_TXCLK_TRXC	0x08	/* xmit clock taken from RTxC* pin */
27155107Storek #define	ZSWR11_TXCLK_BAUD	0x10	/* xmit clock taken from BRG */
27255107Storek #define	ZSWR11_TXCLK_DPLL	0x18	/* xmit clock taken from DPLL */
27355107Storek 
27455107Storek #define	ZSWR11_TRXC_OUT_ENA	0x04	/* TRxC* pin will be an output */
27555107Storek 					/* (unless it is being used above) */
27655107Storek #define	ZSWR11_TRXC_XTAL	0x00	/* TRxC output from xtal oscillator */
27755107Storek #define	ZSWR11_TRXC_XMIT	0x01	/* TRxC output from xmit clock */
27855107Storek #define	ZSWR11_TRXC_BAUD	0x02	/* TRxC output from BRG */
27955107Storek #define	ZSWR11_TRXC_DPLL	0x03	/* TRxC output from DPLL */
28055107Storek 
28155107Storek /*
28255107Storek  * Formula for Write Registers 12 and 13 (`Lower Byte of Baud Rate
28355107Storek  * Generator Time Constant' and `Upper Byte of ...').  Inputs:
28455107Storek  *
28555107Storek  *	f	BRG input clock frequency (in Hz) AFTER division
28655107Storek  *		by 1, 16, 32, or 64 (per clock divisor in WR4)
28755107Storek  *	bps	desired rate in bits per second (9600, etc)
28855107Storek  *
28955107Storek  * We want
29055107Storek  *
29155107Storek  *	  f
29255107Storek  *	----- + 0.5 - 2
29355107Storek  *	2 bps
29455107Storek  *
29555107Storek  * rounded down to an integer.  This can be computed entirely
29655107Storek  * in integer arithemtic as:
29755107Storek  *
29855107Storek  *	f + bps
29955107Storek  *	------- - 2
30055107Storek  *	 2 bps
30155107Storek  */
30255107Storek #define	BPS_TO_TCONST(f, bps)	((((f) + (bps)) / (2 * (bps))) - 2)
30355107Storek 
30455107Storek /* inverse of above: given a BRG Time Constant, return Bits Per Second */
30555107Storek #define	TCONST_TO_BPS(f, tc)	((f) / 2 / ((tc) + 2))
30655107Storek 
30755107Storek /*
30855107Storek  * Bits in Write Register 14 (`Miscellaneous Control Bits').
30955107Storek  * Bits 7 through 5 are taken as a unit and make up a `DPLL command'.
31055107Storek  */
31155107Storek #define	ZSWR14_DPLL_NOOP	0x00	/* leave DPLL alone */
31255107Storek #define	ZSWR14_DPLL_SEARCH	0x20	/* enter search mode */
31355107Storek #define	ZSWR14_DPLL_RESET_CM	0x40	/* reset `clock missing' in RR10 */
31455107Storek #define	ZSWR14_DPLL_DISABLE	0x60	/* disable DPLL (continuous search) */
31555107Storek #define	ZSWR14_DPLL_SRC_BAUD	0x80	/* set DPLL src = BRG */
31655107Storek #define	ZSWR14_DPLL_SRC_RTXC	0xa0	/* set DPLL src = RTxC* or xtal osc */
31755107Storek #define	ZSWR14_DPLL_FM		0xc0	/* operate in FM mode */
31855107Storek #define	ZSWR14_DPLL_NRZI	0xe0	/* operate in NRZI mode */
31955107Storek 
32055107Storek #define	ZSWR14_LOCAL_LOOPBACK	0x10	/* set local loopback mode */
32155107Storek #define	ZSWR14_AUTO_ECHO	0x08	/* set auto echo mode */
32255107Storek #define	ZSWR14_DTR_REQ		0x04	/* DTR*/REQ* pin gives REQ* */
32355107Storek #define	ZSWR14_BAUD_FROM_PCLK	0x02	/* BRG clock taken from PCLK */
32455107Storek 					/* (else from RTxC* pin or xtal osc) */
32555107Storek #define	ZSWR14_BAUD_ENA		0x01	/* enable BRG countdown */
32655107Storek 
32755107Storek /*
32855107Storek  * Bits in Write Register 15 (`External/Status Interrupt Control').
32955107Storek  * Most of these cause status interrupts whenever the corresponding
33055107Storek  * bit or pin changes state (i.e., any rising or falling edge).
33155107Storek  */
33255107Storek #define	ZSWR15_BREAK_IE		0x80	/* enable break/abort status int */
33355107Storek #define	ZSWR15_TXUEOM_IE	0x40	/* enable TX underrun/EOM status int */
33455107Storek #define	ZSWR15_CTS_IE		0x20	/* enable CTS* pin status int */
33555107Storek #define	ZSWR15_SYNCHUNT_IE	0x10	/* enable SYNC* pin/hunt status int */
33655107Storek #define	ZSWR15_DCD_IE		0x08	/* enable DCD* pin status int */
33755107Storek 			/*	0x04	   unused, must be zero */
33855107Storek #define	ZSWR15_ZERO_COUNT_IE	0x02	/* enable BRG-counter = 0 status int */
33955107Storek 			/*	0x01	   unused, must be zero */
34055107Storek 
34155107Storek /*
34255107Storek  * Bits in Read Register 0 (`Transmit/Receive Buffer Status and External
34355107Storek  * Status').
34455107Storek  */
34555107Storek #define	ZSRR0_BREAK		0x80	/* break/abort detected */
34655107Storek #define	ZSRR0_TXUNDER		0x40	/* transmit underrun/EOM (sync) */
34755107Storek #define	ZSRR0_CTS		0x20	/* clear to send */
34855107Storek #define	ZSRR0_SYNC_HUNT		0x10	/* sync/hunt (sync mode) */
34955107Storek #define	ZSRR0_DCD		0x08	/* data carrier detect */
35055107Storek #define	ZSRR0_TX_READY		0x04	/* transmit buffer empty */
35155107Storek #define	ZSRR0_ZERO_COUNT	0x02	/* zero count in baud clock */
35255107Storek #define	ZSRR0_RX_READY		0x01	/* received character ready */
35355107Storek 
35455107Storek /*
35555107Storek  * Bits in Read Register 1 (the Zilog book does not name this one).
35655107Storek  */
35755107Storek #define	ZSRR1_EOF		0x80	/* end of frame (SDLC mode) */
35855107Storek #define	ZSRR1_FE		0x40	/* CRC/framing error */
35955107Storek #define	ZSRR1_DO		0x20	/* data (receiver) overrun */
36055107Storek #define	ZSRR1_PE		0x10	/* parity error */
36155107Storek #define	ZSRR1_RC0		0x08	/* residue code 0 (SDLC mode) */
36255107Storek #define	ZSRR1_RC1		0x04	/* residue code 1 (SDLC mode) */
36355107Storek #define	ZSRR1_RC2		0x02	/* residue code 2 (SDLC mode) */
36455107Storek #define	ZSRR1_ALL_SENT		0x01	/* all chars out of xmitter (async) */
36555107Storek 
36655107Storek /*
36755107Storek  * Read Register 2 in B channel contains status bits if VECTOR_INCL_STAT
36855107Storek  * is set.
36955107Storek  */
37055107Storek 
37155107Storek /*
37255107Storek  * Bits in Read Register 3 (`Interrupt Pending').  Only channel A
37355107Storek  * has an RR3.
37455107Storek  */
37555107Storek 			/*	0x80	   unused, returned as 0 */
37655107Storek 			/*	0x40	   unused, returned as 0 */
37755107Storek #define	ZSRR3_IP_A_RX		0x20	/* channel A recv int pending */
37855107Storek #define	ZSRR3_IP_A_TX		0x10	/* channel A xmit int pending */
37955107Storek #define	ZSRR3_IP_A_STAT		0x08	/* channel A status int pending */
38055107Storek #define	ZSRR3_IP_B_RX		0x04	/* channel B recv int pending */
38155107Storek #define	ZSRR3_IP_B_TX		0x02	/* channel B xmit int pending */
38255107Storek #define	ZSRR3_IP_B_STAT		0x01	/* channel B status int pending */
38355107Storek 
38455107Storek /*
38555107Storek  * Bits in Read Register 10 (`contains some miscellaneous status bits').
38655107Storek  */
38755107Storek #define	ZSRR10_1_CLOCK_MISSING	0x80	/* 1 clock edge missing (FM mode) */
38855107Storek #define	ZSRR10_2_CLOCKS_MISSING	0x40	/* 2 clock edges missing (FM mode) */
38955107Storek 			/*	0x20	   unused */
39055107Storek #define	ZSRR10_LOOP_SENDING	0x10	/* xmitter controls loop (SDLC loop) */
39155107Storek 			/*	0x08	   unused */
39255107Storek 			/*	0x04	   unused */
39355107Storek #define	ZSRR10_ON_LOOP		0x02	/* SCC is on loop (SDLC/X.21 modes) */
39455107Storek 
39555107Storek /*
39655107Storek  * Bits in Read Register 15.  This register is one of the few that
39755107Storek  * simply reads back the corresponding Write Register.
39855107Storek  */
39955107Storek #define	ZSRR15_BREAK_IE		0x80	/* break/abort status int enable */
40055107Storek #define	ZSRR15_TXUEOM_IE	0x40	/* TX underrun/EOM status int enable */
40155107Storek #define	ZSRR15_CTS_IE		0x20	/* CTS* pin status int enable */
40255107Storek #define	ZSRR15_SYNCHUNT_IE	0x10	/* SYNC* pin/hunt status int enable */
40355107Storek #define	ZSRR15_DCD_IE		0x08	/* DCD* pin status int enable */
40455107Storek 			/*	0x04	   unused, returned as zero */
40555107Storek #define	ZSRR15_ZERO_COUNT_IE	0x02	/* BRG-counter = 0 status int enable */
40655107Storek 			/*	0x01	   unused, returned as zero */
407