1 1.2 msaitoh /* $NetBSD: qvavar.h,v 1.2 2019/12/27 06:52:43 msaitoh Exp $ */ 2 1.1 matt 3 1.1 matt /*- 4 1.1 matt * Copyright (c) 2015 The NetBSD Foundation, Inc. 5 1.1 matt * All rights reserved. 6 1.1 matt * 7 1.1 matt * This code is derived from software contributed to The NetBSD Foundation 8 1.1 matt * by Charles H. Dickman 9 1.1 matt * 10 1.1 matt * Redistribution and use in source and binary forms, with or without 11 1.1 matt * modification, are permitted provided that the following conditions 12 1.1 matt * are met: 13 1.1 matt * 1. Redistributions of source code must retain the above copyright 14 1.1 matt * notice, this list of conditions and the following disclaimer. 15 1.1 matt * 2. Redistributions in binary form must reproduce the above copyright 16 1.1 matt * notice, this list of conditions and the following disclaimer in the 17 1.1 matt * documentation and/or other materials provided with the distribution. 18 1.1 matt * 19 1.1 matt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 1.1 matt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 1.1 matt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 1.1 matt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 1.1 matt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 1.1 matt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 1.1 matt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 1.1 matt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 1.1 matt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 1.1 matt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 1.1 matt * POSSIBILITY OF SUCH DAMAGE. 30 1.1 matt */ 31 1.1 matt 32 1.1 matt /* 33 1.1 matt * Copyright (c) 1996, 1997 Philip L. Budne. 34 1.1 matt * Copyright (c) 1993 Philip A. Nelson. 35 1.1 matt * All rights reserved. 36 1.1 matt * 37 1.1 matt * Redistribution and use in source and binary forms, with or without 38 1.1 matt * modification, are permitted provided that the following conditions 39 1.1 matt * are met: 40 1.1 matt * 1. Redistributions of source code must retain the above copyright 41 1.1 matt * notice, this list of conditions and the following disclaimer. 42 1.1 matt * 2. Redistributions in binary form must reproduce the above copyright 43 1.1 matt * notice, this list of conditions and the following disclaimer in the 44 1.1 matt * documentation and/or other materials provided with the distribution. 45 1.1 matt * 3. All advertising materials mentioning features or use of this software 46 1.1 matt * must display the following acknowledgement: 47 1.1 matt * This product includes software developed by Philip A. Nelson. 48 1.1 matt * 4. The name of Philip A. Nelson may not be used to endorse or promote 49 1.1 matt * products derived from this software without specific prior written 50 1.1 matt * permission. 51 1.1 matt * 52 1.1 matt * THIS SOFTWARE IS PROVIDED BY PHILIP NELSON ``AS IS'' AND ANY EXPRESS OR 53 1.1 matt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 54 1.1 matt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 55 1.1 matt * IN NO EVENT SHALL PHILIP NELSON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 56 1.1 matt * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 57 1.1 matt * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 58 1.1 matt * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 59 1.1 matt * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 60 1.1 matt * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 61 1.1 matt * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 62 1.1 matt * 63 1.1 matt * qvavar.h: definitions for qvss scn2681 DUART 64 1.1 matt */ 65 1.1 matt 66 1.1 matt #ifndef _VAX_UBA_QVVAR_H_ 67 1.1 matt #define _VAX_UBA_QVVAR_H_ 68 1.1 matt 69 1.1 matt /* Constants. */ 70 1.1 matt #ifdef COMDEF_SPEED 71 1.1 matt #undef TTYDEF_SPEED 72 1.1 matt #define TTYDEF_SPEED COMDEF_SPEED /* default baud rate */ 73 1.1 matt #endif 74 1.1 matt 75 1.1 matt #define SCN_SIZE 0x10 /* address space for port */ 76 1.1 matt #define SCN_CONSOLE 0 /* minor number of console */ 77 1.1 matt #define SCN_CONSDUART 0 78 1.1 matt #define SCN_CONSCHAN 0 79 1.1 matt 80 1.1 matt #define CH_SZ 16 81 1.1 matt #define DUART_SZ 32 82 1.1 matt #define SCN_REG(n) ((n) << 1) /* DUART bytes are word aligned */ 83 1.1 matt #define QVA_FIRSTREG SCN_REG(0) 84 1.1 matt #define QVA_WINSIZE (SCN_REG(16) - SCN_REG(0)) 85 1.1 matt 86 1.1 matt /* A QVAUX is SCN2681 DUART */ 87 1.1 matt 88 1.1 matt #define NQVAUXLINE 2 89 1.1 matt 90 1.1 matt #define QVA_C2I(c) (0) /* convert controller # to index */ 91 1.1 matt #define QVA_I2C(c) (0) /* convert minor to controller # */ 92 1.1 matt #define QVA_PORT(u) ((u)&01) /* extract the port # */ 93 1.1 matt #define QVA_QVCSR (-32) /* offset to VCB01 CSR */ 94 1.1 matt #define QVA_QVIC (QVA_QVCSR + 12) /* offset to VCB01 IC */ 95 1.1 matt 96 1.1 matt struct qvaux_softc { 97 1.1 matt device_t sc_dev; /* Autoconf blaha */ 98 1.2 msaitoh struct evcnt sc_rintrcnt; /* receive interrupt counts */ 99 1.1 matt struct evcnt sc_tintrcnt; /* transmit interrupt counts */ 100 1.1 matt struct qvaux_regs sc_qr; /* reg pointers */ 101 1.1 matt bus_space_tag_t sc_iot; 102 1.1 matt bus_space_handle_t sc_ioh; 103 1.1 matt int sc_consline; /* console line, or -1 XXX */ 104 1.1 matt int sc_rxint; /* Receive interrupt count XXX */ 105 1.1 matt u_char sc_brk; /* Break asserted on some lines */ 106 1.1 matt u_char sc_dsr; /* DSR set bits if no mdm ctrl */ 107 1.1 matt int sc_imr; /* interrupts that are enabled */ 108 1.1 matt struct qvaux_linestate { 109 1.1 matt struct qvaux_softc *qvaux_sc; /* backpointer to softc */ 110 1.1 matt int qvaux_line; /* channel number */ 111 1.1 matt void *qvaux_private; /* sub-driver data pointer */ 112 1.1 matt int (*qvaux_catch)(void *, int); /* Fast catch recv */ 113 1.1 matt struct tty *qvaux_tty; /* what we work on */ 114 1.1 matt #ifdef notyet 115 1.1 matt void * qvaux_mem; /* pointers to clist output */ 116 1.1 matt void * qvaux_end; /* allowing pdma action */ 117 1.1 matt #endif 118 1.1 matt } sc_qvaux[NQVAUXLINE]; 119 1.1 matt }; 120 1.1 matt 121 1.1 matt void qvauxattach(struct qvaux_softc *, struct evcnt *, int); 122 1.1 matt void qvauxint(void *); 123 1.1 matt void qvauxrint(void *); 124 1.1 matt void qvauxxint(void *); 125 1.1 matt void qvauxreset(device_t); 126 1.1 matt 127 1.1 matt #endif /* _VAX_UBA_QVVAR_H_ */ 128 1.1 matt 129