1 1.6 andvar /* $NetBSD: if_ntwoc_pcireg.h,v 1.6 2024/07/06 10:09:15 andvar Exp $ */ 2 1.1 explorer 3 1.1 explorer /* 4 1.1 explorer * Copyright (c) 1998 Vixie Enterprises 5 1.1 explorer * All rights reserved. 6 1.1 explorer * 7 1.1 explorer * Redistribution and use in source and binary forms, with or without 8 1.1 explorer * modification, are permitted provided that the following conditions 9 1.1 explorer * are met: 10 1.1 explorer * 11 1.1 explorer * 1. Redistributions of source code must retain the above copyright 12 1.1 explorer * notice, this list of conditions and the following disclaimer. 13 1.1 explorer * 2. Redistributions in binary form must reproduce the above copyright 14 1.1 explorer * notice, this list of conditions and the following disclaimer in the 15 1.1 explorer * documentation and/or other materials provided with the distribution. 16 1.1 explorer * 3. Neither the name of Vixie Enterprises nor the names 17 1.1 explorer * of its contributors may be used to endorse or promote products derived 18 1.1 explorer * from this software without specific prior written permission. 19 1.1 explorer * 20 1.1 explorer * THIS SOFTWARE IS PROVIDED BY VIXIE ENTERPRISES AND 21 1.1 explorer * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 22 1.1 explorer * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 1.1 explorer * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 1.1 explorer * DISCLAIMED. IN NO EVENT SHALL VIXIE ENTERPRISES OR 25 1.1 explorer * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 1.1 explorer * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 1.1 explorer * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 28 1.1 explorer * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 29 1.1 explorer * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 1.1 explorer * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 31 1.1 explorer * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 1.1 explorer * SUCH DAMAGE. 33 1.1 explorer * 34 1.1 explorer * This software has been written for Vixie Enterprises by Michael Graff 35 1.1 explorer * <explorer (at) flame.org>. To learn more about Vixie Enterprises, see 36 1.1 explorer * ``http://www.vix.com''. 37 1.1 explorer */ 38 1.1 explorer 39 1.1 explorer #ifndef _IF_NTWOC_PCIREG_H_ 40 1.1 explorer #define _IF_NTWOC_PCIREG_H_ 41 1.3 chopps 42 1.3 chopps /* config flags are as follows */ 43 1.3 chopps /* 44 1.3 chopps * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 45 1.3 chopps * +-------------+ +-----+ +-----+ + +---+ +-+ + +---+ +-+ + 46 1.3 chopps * tmc tdiv rdiv e1 rxs1 ts1 e0 rxs0 txs0 nports - 1 47 1.3 chopps */ 48 1.3 chopps #define NTWOC_FLAGS_CLK0_MASK 0x000000fc /* port 0 clock info mask */ 49 1.3 chopps #define NTWOC_FLAGS_CLK1_MASK 0x0000fc00 /* port 1 clock info mask */ 50 1.3 chopps #define NTWOC_FLAGS_RXDIV_MASK 0x000F0000 /* rx div mask */ 51 1.3 chopps #define NTWOC_FLAGS_TXDIV_MASK 0x00F00000 /* tx div mask */ 52 1.3 chopps #define NTWOC_FLAGS_TMC_MASK 0xFF000000 /* tmc port 0 mask */ 53 1.3 chopps 54 1.3 chopps #define NTWOC_FLAGS_CLK1_SHIFT 8 55 1.3 chopps 56 1.3 chopps /* these are used after you shift down to the clock byte for the resp. port */ 57 1.3 chopps #define NTWOC_FLAGS_TXS_SHIFT 2 58 1.3 chopps #define NTWOC_FLAGS_TXS_MASK 0x0000000c /* port 0 tx clk source mask */ 59 1.3 chopps #define NTWOC_FLAGS_TXS_LINE 0 /* use the line clock */ 60 1.3 chopps #define NTWOC_FLAGS_TXS_INTERNAL 1 /* use the internal clock */ 61 1.3 chopps #define NTWOC_FLAGS_TXS_RXCLOCK 2 /* use the receive clock */ 62 1.3 chopps 63 1.3 chopps #define NTWOC_FLAGS_RXS_SHIFT 4 64 1.3 chopps #define NTWOC_FLAGS_RXS_MASK 0x00000070 /* port 0 rx clk source mask */ 65 1.3 chopps #define NTWOC_FLAGS_RXS_LINE 0 /* use the line clock */ 66 1.3 chopps #define NTWOC_FLAGS_RXS_LINE_SN 1 /* use line with noise supp. */ 67 1.3 chopps #define NTWOC_FLAGS_RXS_INTERNAL 2 /* use internal clock */ 68 1.3 chopps #define NTWOC_FLAGS_RXS_ADPLL_OUT 3 /* use brg out for adpll clk */ 69 1.3 chopps #define NTWOC_FLAGS_RXS_ADPLL_IN 4 /* use line in for adpll clk */ 70 1.3 chopps 71 1.3 chopps #define NTWOC_FLAGS_ECLOCK_SHIFT 7 /* generate external clock */ 72 1.3 chopps #define NTWOC_FLAGS_ECLOCK_MASK 0x00000080 /* port 0 ext clk gen mask */ 73 1.3 chopps 74 1.3 chopps /* these are used on the flags directly */ 75 1.3 chopps #define NTWOC_FLAGS_RXDIV_SHIFT 16 76 1.3 chopps #define NTWOC_FLAGS_TXDIV_SHIFT 20 77 1.3 chopps #define NTWOC_FLAGS_TMC_SHIFT 24 78 1.1 explorer 79 1.1 explorer /* 80 1.1 explorer * ASIC register offsets 81 1.1 explorer */ 82 1.1 explorer 83 1.1 explorer /* 84 1.1 explorer * This register is in the SCA namespace, but is NOT really an SCA register. 85 1.1 explorer * It contains information about the daughter cards, and provides a method 86 1.1 explorer * to configure them. 87 1.1 explorer */ 88 1.1 explorer #define NTWOC_FECR 0x200 89 1.1 explorer 90 1.1 explorer /* 91 1.1 explorer * definition of the NTWO_FECR register 92 1.1 explorer */ 93 1.1 explorer #define NTWOC_FECR_ID0 0x0e00 /* mask of daughter card on port 0 */ 94 1.1 explorer #define NTWOC_FECR_ID0_SHIFT 9 95 1.1 explorer #define NTWOC_FECR_ID1 0xe000 /* mask of daughter card on port 1 */ 96 1.1 explorer #define NTWOC_FECR_ID1_SHIFT 13 97 1.1 explorer 98 1.1 explorer #define NTWOC_FECR_DTR1 0x0080 /* DTR output for port 1 */ 99 1.1 explorer #define NTWOC_FECR_DTR0 0x0040 /* DTR output for port 0 */ 100 1.1 explorer #define NTWOC_FECR_DSR1 0x1000 /* DSR input for port 1 */ 101 1.1 explorer #define NTWOC_FECR_DSR0 0x0100 /* DSR input for port 0 */ 102 1.1 explorer #define NTWOC_FECR_TE1 0x0008 /* tristate enable port 1 */ 103 1.1 explorer #define NTWOC_FECR_TE0 0x0004 /* tristate enable port 0 */ 104 1.1 explorer #define NTWOC_FECR_ETC1 0x0002 /* output clock port 1 */ 105 1.1 explorer #define NTWOC_FECR_ETC0 0x0001 /* output clock port 0 */ 106 1.1 explorer 107 1.4 perry /* 108 1.1 explorer * Daughter card for port. 109 1.1 explorer */ 110 1.1 explorer #define NTWOC_FE_ID_V35 0x00 111 1.1 explorer #define NTWOC_FE_ID_X01 0x01 /* unused? */ 112 1.1 explorer #define NTWOC_FE_ID_TEST 0x02 113 1.1 explorer #define NTWOC_FE_ID_X03 0x03 /* unused? */ 114 1.1 explorer #define NTWOC_FE_ID_RS232 0x04 115 1.1 explorer #define NTWOC_FE_ID_X05 0x05 /* was hssi, now unused? */ 116 1.1 explorer #define NTWOC_FE_ID_RS422 0x06 117 1.1 explorer #define NTWOC_FE_ID_NONE 0x07 /* empty, no card present */ 118 1.1 explorer 119 1.1 explorer /* 120 1.6 andvar * ASIC Control definitions 121 1.1 explorer */ 122 1.1 explorer 123 1.1 explorer /* Front End (Modem,etc) Control Register */ 124 1.1 explorer 125 1.1 explorer #define ASIC_MODEM 0x200 /* ASIC modem control register Offset */ 126 1.1 explorer 127 1.1 explorer /* ASIC front end control register bits */ 128 1.1 explorer #define ASIC_DSR1 0x1000 /* DSR signal input port 1 */ 129 1.1 explorer #define ASIC_DSR0 0x100 /* DSR signal input port 0 */ 130 1.1 explorer #define ASIC_DTR1 0x80 /* DTR signal output port 1 */ 131 1.1 explorer #define ASIC_DTR0 0x40 /* DTR signal output port 0 */ 132 1.1 explorer #define ASIC_TE1 0x8 /* RS422 TX,enable port 1 */ 133 1.1 explorer #define ASIC_TE0 0x4 /* RS422 TX,enable port 0 */ 134 1.1 explorer #define ASIC_ETC1 0x2 /* ETC Clock out port 1 */ 135 1.1 explorer #define ASIC_ETC0 0x1 /* ETC Clock out port 0 */ 136 1.1 explorer 137 1.1 explorer #endif /* _IF_NTWOC_PCIREG_H_ */ 138