Merge from vendor branch NTPD:
[dragonfly.git] / sys / bus / mca / mca_busreg.h
... / ...
CommitLineData
1/*-
2 * Copyright (c) 1999 Matthew N. Dodd <winter@jurai.net>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: src/sys/dev/mca/mca_busreg.h,v 1.1 1999/09/03 03:40:00 mdodd Exp $
27 * $DragonFly: src/sys/bus/mca/Attic/mca_busreg.h,v 1.2 2003/06/17 04:28:28 dillon Exp $
28 */
29
30/*
31 * Standardized MCA configuration information
32 */
33
34#define MCA_MAX_SLOTS 8 /* max number of slots per bus */
35#define MCA_MB_SCSI_SLOT 8
36#define MCA_MB_VIDEO_SLOT 9
37#define MCA_MAX_ADAPTERS 9
38
39/*
40 * When an ADF file talks about a POS register
41 * its not talking about the same index we are
42 * so provide this to convert ADF pos register
43 * offsets to our register offsets. (Since
44 * to us, POS0 and POS1 are just 2 more registers
45 */
46
47#define MCA_ADP_POS(pos) (pos + 2)
48
49#define MCA_POS0 0 /* low byte of board ID */
50#define MCA_POS1 1 /* high byte of board ID */
51#define MCA_POS2 2
52# define MCA_POS2_ENABLE 0x01 /* POS2, hi => adapter enabled */
53#define MCA_POS3 3
54#define MCA_POS4 4
55#define MCA_POS5 5
56# define MCA_POS5_CHCK_STAT 0x40 /* lo => CHCK status available */
57# define MCA_POS5_CHCK 0x80 /* lo => adapter CHCK signal */
58#define MCA_POS6 6 /* low byte of CHCK status */
59#define MCA_POS7 7 /* high byte of CHCK status */
60
61/*
62 * MCA register addresses for IBM PS/2
63 */
64
65#define MCA_SYS_CTL_A_REG 0x92 /* PS/2 System Control Port A */
66#define MCA_SYS_CTL_B_REG 0x60 /* PS/2 System Control Port B */
67#define MCA_ARB_REG 0x90 /* MCA Arbitration port */
68#define MCA_CSF_REG 0x91 /* MCA Card Select Feedback */
69
70/*
71 * 0x96, 0x97 POS Registers
72 * 0x100 - 0x107 POS Registers
73 */
74
75#define MCA_MB_SETUP_REG 0x94 /* Motherboard setup register */
76# define MCA_MB_SETUP_DIS 0xff /* Disable motherboard setup */
77# define MCA_MB_SETUP_VIDEO 0xdf
78# define MCA_MB_SETUP_SCSI 0xf7 /* Pri. SCSI setup reg */
79# define MCA_MB_SETUP_SCSI_ALT 0xfd /* Alt. SCSI setup reg */
80
81#define MCA_ADAP_SETUP_REG 0x96 /* Adapter setup register */
82# define MCA_ADAP_SETUP_DIS 0x0 /* Disable adapter setup */
83# define MCA_ADAP_SET 0x08 /* Adapter setup mode */
84# define MCA_ADAP_CHR 0x80 /* Adapter channel reset */
85#define MCA_POS_REG(n) (0x100+(n)) /* POS registers 0-7 */