mca_machdep.h revision 1.5
11.5Sjdolecek/*	$NetBSD: mca_machdep.h,v 1.5 2001/04/22 11:52:18 jdolecek Exp $	*/
21.1Sjdolecek
31.1Sjdolecek/*
41.1Sjdolecek * Copyright (c) 2000 The NetBSD Foundation, Inc.
51.1Sjdolecek * Copyright (c) 1999 Scott D. Telford.  All rights reserved.
61.1Sjdolecek *
71.1Sjdolecek * Redistribution and use in source and binary forms, with or without
81.1Sjdolecek * modification, are permitted provided that the following conditions
91.1Sjdolecek * are met:
101.1Sjdolecek * 1. Redistributions of source code must retain the above copyright
111.1Sjdolecek *    notice, this list of conditions and the following disclaimer.
121.1Sjdolecek * 2. Redistributions in binary form must reproduce the above copyright
131.1Sjdolecek *    notice, this list of conditions and the following disclaimer in the
141.1Sjdolecek *    documentation and/or other materials provided with the distribution.
151.1Sjdolecek * 3. The name of the author may not be used to endorse or promote products
161.1Sjdolecek *    derived from this software without specific prior written permission.
171.1Sjdolecek *
181.1Sjdolecek * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
191.1Sjdolecek * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
201.1Sjdolecek * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
211.1Sjdolecek * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
221.1Sjdolecek * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
231.1Sjdolecek * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
241.1Sjdolecek * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
251.1Sjdolecek * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
261.1Sjdolecek * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
271.1Sjdolecek * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
281.1Sjdolecek */
291.1Sjdolecek
301.1Sjdolecek#ifndef _I386_MCA_MACHDEP_H_
311.1Sjdolecek#define _I386_MCA_MACHDEP_H_
321.1Sjdolecek
331.1Sjdolecek/*
341.1Sjdolecek * i386-specific definitions for MCA autoconfiguration.
351.1Sjdolecek */
361.1Sjdolecek
371.1Sjdolecekextern struct i386_bus_dma_tag mca_bus_dma_tag;
381.1Sjdolecek
391.1Sjdolecek/* set to 1 if MCA bus is detected */
401.1Sjdolecekextern int MCA_system;
411.1Sjdolecek
421.2Scgdint	mca_nmi(void);
431.1Sjdolecek
441.1Sjdolecek/*
451.1Sjdolecek * Types provided to machine-independent MCA code.
461.1Sjdolecek */
471.1Sjdolecekstruct i386_mca_chipset {
481.1Sjdolecek        void * /*struct mca_dma_state*/ ic_dmastate;
491.1Sjdolecek};
501.1Sjdolecek
511.1Sjdolecektypedef struct i386_mca_chipse *mca_chipset_tag_t;
521.1Sjdolecektypedef int mca_intr_handle_t;
531.4Sjdolecek
541.4Sjdolecek/* System Configuration Block - this info is returned by the BIOS call */
551.4Sjdolecekstruct ps2_sys_config {
561.4Sjdolecek	u_int16_t	count;
571.4Sjdolecek	u_int8_t	model;
581.4Sjdolecek	u_int8_t	submodel;
591.4Sjdolecek	u_int8_t	bios_rev;
601.4Sjdolecek	u_int8_t	feature;
611.4Sjdolecek#define FEATURE_RESV	0x01	/* Reserved				*/
621.4Sjdolecek#define FEATURE_MCABUS	0x02	/* MicroChannel Architecture		*/
631.4Sjdolecek#define FEATURE_EBDA	0x04	/* Extended BIOS data area allocated	*/
641.4Sjdolecek#define FEATURE_WAITEV	0x08	/* Wait for external event is supported	*/
651.4Sjdolecek#define FEATURE_KBDINT	0x10	/* Keyboard intercept called by Int 09h	*/
661.4Sjdolecek#define FEATURE_RTC	0x20	/* Real-time clock present		*/
671.4Sjdolecek#define FEATURE_IC2	0x40	/* Second interrupt chip present	*/
681.4Sjdolecek#define FEATURE_DMA3	0x80	/* DMA channel 3 used by hard disk BIOS	*/
691.4Sjdolecek	u_int8_t	pad[10];
701.4Sjdolecek} __attribute__ ((packed));
711.1Sjdolecek
721.1Sjdolecek/*
731.1Sjdolecek * Functions provided to machine-independent MCA code.
741.1Sjdolecek */
751.1Sjdolecekstruct mcabus_attach_args;
761.1Sjdolecek
771.2Scgdvoid	mca_attach_hook(struct device *, struct device *,
781.2Scgd		struct mcabus_attach_args *);
791.3Scgdconst struct evcnt *mca_intr_evcnt(mca_chipset_tag_t, mca_intr_handle_t);
801.2Scgdvoid	*mca_intr_establish(mca_chipset_tag_t, mca_intr_handle_t,
811.2Scgd		int, int (*)(void *), void *);
821.2Scgdvoid	mca_intr_disestablish(mca_chipset_tag_t, void *);
831.2Scgdint	mca_conf_read(mca_chipset_tag_t, int, int);
841.2Scgdvoid	mca_conf_write(mca_chipset_tag_t, int, int, int);
851.2Scgdvoid	mca_busprobe(void);
861.5Sjdolecek
871.5Sjdolecek/*
881.5Sjdolecek * These two are used to light disk busy LED on PS/2 during disk operations.
891.5Sjdolecek */
901.5Sjdolecekvoid	mca_disk_busy(void);
911.5Sjdolecekvoid	mca_disk_unbusy(void);
921.1Sjdolecek
931.1Sjdolecek/* MCA register addresses for IBM PS/2 */
941.1Sjdolecek
951.1Sjdolecek#define PS2_SYS_CTL_A		0x92	/* PS/2 System Control Port A */
961.1Sjdolecek#define MCA_MB_SETUP_REG	0x94	/* Motherboard setup register */
971.1Sjdolecek#define MCA_ADAP_SETUP_REG	0x96	/* Adapter setup register */
981.1Sjdolecek#define MCA_POS_REG_BASE	0x100	/* POS registers base address */
991.1Sjdolecek#define MCA_POS_REG_SIZE	8	/* POS registers window size */
1001.1Sjdolecek
1011.1Sjdolecek#define MCA_POS_REG(n)		(0x100+(n))	/* POS registers 0-7 */
1021.1Sjdolecek
1031.1Sjdolecek/* Adapter setup register bits */
1041.1Sjdolecek
1051.1Sjdolecek#define MCA_ADAP_SET		0x08	/* Adapter setup mode */
1061.1Sjdolecek#define MCA_ADAP_CHR		0x80	/* Adapter channel reset */
1071.1Sjdolecek
1081.1Sjdolecek#endif /* _I386_MCA_MACHDEP_H_ */
109