150825Smdodd/*-
250825Smdodd * Copyright (c) 1999 Matthew N. Dodd <winter@jurai.net>
350825Smdodd * All rights reserved.
450825Smdodd *
550825Smdodd * Redistribution and use in source and binary forms, with or without
650825Smdodd * modification, are permitted provided that the following conditions
750825Smdodd * are met:
850825Smdodd * 1. Redistributions of source code must retain the above copyright
950825Smdodd *    notice, this list of conditions and the following disclaimer.
1050825Smdodd * 2. Redistributions in binary form must reproduce the above copyright
1150825Smdodd *    notice, this list of conditions and the following disclaimer in the
1250825Smdodd *    documentation and/or other materials provided with the distribution.
1350825Smdodd *
1450825Smdodd * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1550825Smdodd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1650825Smdodd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1750825Smdodd * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1850825Smdodd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1950825Smdodd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2050825Smdodd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2150825Smdodd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2250825Smdodd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2350825Smdodd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2450825Smdodd * SUCH DAMAGE.
2550825Smdodd *
2650825Smdodd * $FreeBSD: releng/10.2/sys/dev/mca/mca_busreg.h 50825 1999-09-03 03:40:00Z mdodd $
2750825Smdodd */
2850825Smdodd
2950825Smdodd/*
3050825Smdodd * Standardized MCA configuration information
3150825Smdodd */
3250825Smdodd
3350825Smdodd#define MCA_MAX_SLOTS		8	/* max number of slots per bus */
3450825Smdodd#define MCA_MB_SCSI_SLOT	8
3550825Smdodd#define MCA_MB_VIDEO_SLOT	9
3650825Smdodd#define MCA_MAX_ADAPTERS	9
3750825Smdodd
3850825Smdodd/*
3950825Smdodd * When an ADF file talks about a POS register
4050825Smdodd * its not talking about the same index we are
4150825Smdodd * so provide this to convert ADF pos register
4250825Smdodd * offsets to our register offsets. (Since
4350825Smdodd * to us, POS0 and POS1 are just 2 more registers
4450825Smdodd */
4550825Smdodd
4650825Smdodd#define MCA_ADP_POS(pos)	(pos + 2)
4750825Smdodd
4850825Smdodd#define MCA_POS0		0	/* low byte of board ID		*/
4950825Smdodd#define MCA_POS1		1	/* high byte of board ID	*/
5050825Smdodd#define MCA_POS2		2
5150825Smdodd# define MCA_POS2_ENABLE	0x01    /* POS2, hi => adapter enabled */
5250825Smdodd#define MCA_POS3		3
5350825Smdodd#define MCA_POS4		4
5450825Smdodd#define MCA_POS5		5
5550825Smdodd# define MCA_POS5_CHCK_STAT	0x40	/* lo => CHCK status available */
5650825Smdodd# define MCA_POS5_CHCK		0x80	/* lo => adapter CHCK signal */
5750825Smdodd#define MCA_POS6		6	/* low byte of CHCK status */
5850825Smdodd#define MCA_POS7		7	/* high byte of CHCK status */
5950825Smdodd
6050825Smdodd/*
6150825Smdodd * MCA register addresses for IBM PS/2
6250825Smdodd */
6350825Smdodd
6450825Smdodd#define MCA_SYS_CTL_A_REG	0x92	/* PS/2 System Control Port A */
6550825Smdodd#define MCA_SYS_CTL_B_REG	0x60	/* PS/2 System Control Port B */
6650825Smdodd#define MCA_ARB_REG		0x90	/* MCA Arbitration port */
6750825Smdodd#define MCA_CSF_REG		0x91	/* MCA Card Select Feedback */
6850825Smdodd
6950825Smdodd/*
7050825Smdodd *	0x96, 0x97	POS Registers
7150825Smdodd *	0x100 - 0x107	POS Registers
7250825Smdodd */
7350825Smdodd
7450825Smdodd#define MCA_MB_SETUP_REG	0x94	/* Motherboard setup register */
7550825Smdodd# define MCA_MB_SETUP_DIS	0xff	/* Disable motherboard setup */
7650825Smdodd# define MCA_MB_SETUP_VIDEO	0xdf
7750825Smdodd# define MCA_MB_SETUP_SCSI	0xf7	/* Pri. SCSI setup reg */
7850825Smdodd# define MCA_MB_SETUP_SCSI_ALT	0xfd	/* Alt. SCSI setup reg */
7950825Smdodd
8050825Smdodd#define MCA_ADAP_SETUP_REG	0x96	/* Adapter setup register */
8150825Smdodd# define MCA_ADAP_SETUP_DIS	0x0	/* Disable adapter setup */
8250825Smdodd# define MCA_ADAP_SET		0x08	/* Adapter setup mode */
8350825Smdodd# define MCA_ADAP_CHR		0x80	/* Adapter channel reset */
8450825Smdodd#define MCA_POS_REG(n)		(0x100+(n))	/* POS registers 0-7 */
85