xref: /original-bsd/sys/news3400/sio/scc.h (revision 13ec26c3)
1 /*
2  * Copyright (c) 1992 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
7  *
8  * %sccs.include.redist.c%
9  *
10  * from: $Hdr: scc.h,v 4.300 91/06/09 06:44:56 root Rel41 $ SONY
11  *
12  *	@(#)scc.h	7.1 (Berkeley) 06/04/92
13  */
14 
15 #ifdef news700
16 #define splscc		spl4
17 #endif
18 
19 #if defined(news1200) || defined(news1700)
20 #define splscc		spl5
21 #endif
22 
23 #ifdef news3400
24 #ifdef PMAXSPL
25 #define	splscc		Mach_spl1
26 #else
27 #define	splscc		spl4
28 #endif /* PMAXSPL */
29 #endif /* news3400 */
30 
31 #define	SCCWAIT		DELAY(2)
32 #define	SCCWAIT		_delay(5)
33 
34 #define SCC_REMOTE0	0
35 #define SCC_REMOTE1	1
36 #define SCC_REMOTE2	2
37 #define SCC_REMOTE3	3
38 #define SCC_REMOTE4	4
39 #define SCC_REMOTE5	5
40 #define SCC_REMOTE6	6
41 #define SCC_REMOTE7	7
42 #define SCC_REMOTE8	8
43 #define SCC_REMOTE9	9
44 
45 #define	SCCVEC0		64
46 #define	SCCVEC1		(SCCVEC0+16)
47 #define SCCVEC2		(SCCVEC0+32)
48 #define SCCVEC3		(SCCVEC0+48)
49 #define SCCVEC4		(SCCVEC0+64)
50 
51 /*
52  *	SCC channel control block
53  */
54 typedef struct scc_dma {
55 	char	*dma_addr;
56 	int	dma_count;
57 } Scc_dma;
58 
59 typedef struct scc_channel {
60 	int	scc_status;		/* channel status		*/
61 	int	scc_param;		/* channel parameter		*/
62 	struct	scc_reg	*scc_port;	/* port address			*/
63 	char	*scc_init;		/* initialize data		*/
64 	int	scc_vec;		/* interrupt vector		*/
65 	Scc_dma	x_dma;
66 	Scc_dma	r_dma;
67 } Scc_channel;
68 
69 /*
70  *	SCC channel status
71  */
72 #define	OACTIVE		0x00000001	/* transmit in progress	*/
73 #define	OSTOP		0x00000002	/* output stop request	*/
74 #define	OFLUSH		0x00000004	/* output flush request	*/
75 #define	OBUSY		0x00000008	/* output in use	*/
76 #define LINE_BREAK	0x00000010	/* line break interrupt	*/
77 #define	ENABLE		0x00000020	/* receiver enable	*/
78 #define	CHAN_ACTIVE	0x80000000	/* channel active	*/
79 
80 /*
81  *	SCC channel usage
82  */
83 #define	SCC_MOUSE	0
84 #define	SCC_KEYBOARD	1
85