Annotation of sys/arch/sparc/sparc/auxioreg.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: auxioreg.h,v 1.5 2005/07/08 12:36:38 miod Exp $ */
2: /* $NetBSD: auxreg.h,v 1.7 1997/05/17 17:52:52 pk Exp $ */
3:
4: /*
5: * Copyright (c) 1992, 1993
6: * The Regents of the University of California. All rights reserved.
7: *
8: * This software was developed by the Computer Systems Engineering group
9: * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
10: * contributed to Berkeley.
11: *
12: * All advertising materials mentioning features or use of this software
13: * must display the following acknowledgement:
14: * This product includes software developed by the University of
15: * California, Lawrence Berkeley Laboratory.
16: *
17: * Redistribution and use in source and binary forms, with or without
18: * modification, are permitted provided that the following conditions
19: * are met:
20: * 1. Redistributions of source code must retain the above copyright
21: * notice, this list of conditions and the following disclaimer.
22: * 2. Redistributions in binary form must reproduce the above copyright
23: * notice, this list of conditions and the following disclaimer in the
24: * documentation and/or other materials provided with the distribution.
25: * 3. Neither the name of the University nor the names of its contributors
26: * may be used to endorse or promote products derived from this software
27: * without specific prior written permission.
28: *
29: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39: * SUCH DAMAGE.
40: *
41: * @(#)auxreg.h 8.1 (Berkeley) 6/11/93
42: */
43:
44: /*
45: * Sun-4c Auxiliary I/O register. This register talks to the floppy
46: * (if it exists) and the front-panel LED.
47: */
48:
49: #define AUXIO4C_MB1 0xf0 /* must be set on write */
50: #define AUXIO4C_FHD 0x20 /* floppy: high density (unreliable?)*/
51: #define AUXIO4C_FDC 0x10 /* floppy: diskette was changed */
52: #define AUXIO4C_FDS 0x08 /* floppy: drive select */
53: #define AUXIO4C_FTC 0x04 /* floppy: drives Terminal Count pin */
54: #define AUXIO4C_FEJ 0x02 /* floppy: eject disk */
55: #define AUXIO4C_LED 0x01 /* front panel LED */
56:
57: #define AUXIO4M_MB1 0xc0 /* must be set on write? */
58: #define AUXIO4M_FHD 0x20 /* floppy: high density (unreliable?)*/
59: #define AUXIO4M_LTE 0x08 /* link-test enable */
60: #define AUXIO4M_MMX 0x04 /* Monitor/Mouse MUX; what is it? */
61: #define AUXIO4M_FTC 0x02 /* floppy: drives Terminal Count pin */
62: #define AUXIO4M_LED 0x01 /* front panel LED */
63:
64: /*
65: * Tadpole Auxiliary I/O registers. Those control various power management
66: * features.
67: */
68:
69: #define AUXIO_MODEM 0x01 /* enable modem power */
70: #define AUXIO_ISDN 0x04 /* enable ISDN power */
71: #define AUXIO_MODEM_RESET 0x08 /* reset modem line (active low) */
72: #define AUXIO_TFT 0x80 /* S3000 XT tft power */
73:
74: #define AUXIO2_SERIAL 0x01 /* enable serial ports power */
75:
76: /*
77: * We use a fixed virtual address for the register because we use it for
78: * timing short sections of code (via external hardware attached to the LED).
79: */
80: #define AUXIO4C_REG ((volatile u_char *)(AUXREG_VA + 3))
81: #define AUXIO4M_REG ((volatile u_char *)(AUXREG_VA))
82:
83: #define LED_ON do { \
84: if (CPU_ISSUN4M) { \
85: auxio_regval |= AUXIO4M_LED; \
86: *AUXIO4M_REG = auxio_regval; \
87: } else { \
88: auxio_regval |= AUXIO4C_LED; \
89: *AUXIO4C_REG = auxio_regval; \
90: } \
91: } while(0)
92:
93: #define LED_OFF do { \
94: if (CPU_ISSUN4M) { \
95: auxio_regval &= ~AUXIO4M_LED; \
96: *AUXIO4M_REG = auxio_regval; \
97: } else { \
98: auxio_regval &= ~AUXIO4C_LED; \
99: *AUXIO4C_REG = auxio_regval; \
100: } \
101: } while(0)
102:
103: #define LED_FLIP do { \
104: if (CPU_ISSUN4M) { \
105: auxio_regval ^= AUXIO4M_LED; \
106: *AUXIO4M_REG = auxio_regval; \
107: } else { \
108: auxio_regval ^= AUXIO4C_LED; \
109: *AUXIO4C_REG = auxio_regval; \
110: } \
111: } while(0)
112:
113: #define FTC_FLIP do { \
114: if (CPU_ISSUN4M) { \
115: auxio_regval |= AUXIO4M_FTC; \
116: *AUXIO4M_REG = auxio_regval; \
117: *AUXIO4M_REG = *AUXIO4M_REG | AUXIO4M_MB1 | AUXIO4M_FTC;\
118: } else { \
119: auxio_regval |= AUXIO4C_FTC; \
120: *AUXIO4C_REG = auxio_regval; \
121: DELAY(10); \
122: auxio_regval &= ~AUXIO4C_FTC; \
123: *AUXIO4C_REG = auxio_regval; \
124: } \
125: } while(0)
126:
127: #define AUXIO_BITS ( \
128: CPU_ISSUN4M \
129: ? "\20\6FHD\4LTE\3MMX\2FTC\1LED" \
130: : "\20\6FHD\5FDC\4FDS\3FTC\2FEJ\1LED" \
131: )
132:
133: #ifndef _LOCORE
134: extern u_char auxio_regval;
135: unsigned int auxregbisc(int, int);
136: unsigned int sb_auxregbisc(int, int, int);
137: #endif
138:
CVSweb