1 /* $NetBSD: plcomvar.h,v 1.5 2007/10/17 19:54:11 garbled Exp $ */
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Christopher G. Demetriou
17 * for the NetBSD Project.
18 * 4. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include "opt_multiprocessor.h"
35 #include "opt_lockdebug.h"
36 #include "opt_plcom.h"
39 #if NRND > 0 && defined(RND_COM)
43 #include <sys/callout.h>
44 #include <sys/timepps.h>
45 #include <sys/simplelock.h>
47 int plcomcnattach (bus_space_tag_t
, bus_addr_t
, int, int, tcflag_t
, int);
48 void plcomcndetach (void);
51 int plcom_kgdb_attach (bus_space_tag_t
, bus_addr_t
, int, int, tcflag_t
);
54 int plcom_is_console (bus_space_tag_t
, int, bus_space_handle_t
*);
56 /* Hardware flag masks */
57 #define PLCOM_HW_NOIEN 0x01
58 #define PLCOM_HW_FIFO 0x02
59 #define PLCOM_HW_HAYESP 0x04
60 #define PLCOM_HW_FLOW 0x08
61 #define PLCOM_HW_DEV_OK 0x20
62 #define PLCOM_HW_CONSOLE 0x40
63 #define PLCOM_HW_KGDB 0x80
64 #define PLCOM_HW_TXFIFO_DISABLE 0x100
66 /* Buffer size for character buffer */
67 #define PLCOM_RING_SIZE 2048
74 struct callout sc_diag_callout
;
79 bus_space_tag_t sc_iot
;
80 bus_space_handle_t sc_ioh
;
92 u_char
*volatile sc_rbget
,
94 volatile u_int sc_rbavail
;
102 volatile u_char sc_rx_flags
,
103 #define RX_TTY_BLOCKED 0x01
104 #define RX_TTY_OVERFLOWED 0x02
105 #define RX_IBUF_BLOCKED 0x04
106 #define RX_IBUF_OVERFLOWED 0x08
107 #define RX_ANY_BLOCK 0x0f
114 volatile u_char sc_heldchange
;
115 volatile u_char sc_msr
, sc_msr_delta
, sc_msr_mask
, sc_mcr
,
116 sc_mcr_active
, sc_lcr
, sc_cr
, sc_dlbl
, sc_dlbh
;
117 u_char sc_mcr_dtr
, sc_mcr_rts
, sc_msr_cts
, sc_msr_dcd
;
120 /* Support routine to program mcr lines, if present. */
121 void (*sc_set_mcr
)(void *, int, u_int
);
122 void *sc_set_mcr_arg
;
124 /* power management hooks */
125 int (*enable
) (struct plcom_softc
*);
126 void (*disable
) (struct plcom_softc
*);
129 /* PPS signal on DCD, with or without inkernel clock disciplining */
130 u_char sc_ppsmask
; /* pps signal mask */
131 u_char sc_ppsassert
; /* pps leading edge */
132 u_char sc_ppsclear
; /* pps trailing edge */
134 pps_params_t ppsparam
;
136 #if NRND > 0 && defined(RND_COM)
137 rndsource_element_t rnd_source
;
139 struct simplelock sc_lock
;
142 int plcomprobe1 (bus_space_tag_t
, bus_space_handle_t
);
143 int plcomintr (void *);
144 void plcom_attach_subr (struct plcom_softc
*);
145 int plcom_detach (struct device
*, int);
146 int plcom_activate (struct device
*, enum devact
);