mca_machdep.h revision 1.8
11.8Sjdolecek/*	$NetBSD: mca_machdep.h,v 1.8 2001/12/02 17:02:33 jdolecek Exp $	*/
21.1Sjdolecek
31.1Sjdolecek/*
41.8Sjdolecek * Copyright (c) 2000, 2001 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.7Sjdolecek#include <machine/bus.h>
341.7Sjdolecek
351.1Sjdolecek/*
361.1Sjdolecek * i386-specific definitions for MCA autoconfiguration.
371.1Sjdolecek */
381.1Sjdolecek
391.1Sjdolecekextern struct i386_bus_dma_tag mca_bus_dma_tag;
401.1Sjdolecek
411.1Sjdolecek/* set to 1 if MCA bus is detected */
421.1Sjdolecekextern int MCA_system;
431.1Sjdolecek
441.2Scgdint	mca_nmi(void);
451.1Sjdolecek
461.1Sjdolecek/*
471.1Sjdolecek * Types provided to machine-independent MCA code.
481.1Sjdolecek */
491.1Sjdolecekstruct i386_mca_chipset {
501.1Sjdolecek        void * /*struct mca_dma_state*/ ic_dmastate;
511.1Sjdolecek};
521.1Sjdolecek
531.7Sjdolecektypedef struct i386_mca_chipset *mca_chipset_tag_t;
541.1Sjdolecektypedef int mca_intr_handle_t;
551.1Sjdolecek
561.1Sjdolecek/*
571.1Sjdolecek * Functions provided to machine-independent MCA code.
581.1Sjdolecek */
591.1Sjdolecekstruct mcabus_attach_args;
601.1Sjdolecek
611.2Scgdvoid	mca_attach_hook(struct device *, struct device *,
621.2Scgd		struct mcabus_attach_args *);
631.7Sjdolecekint	mca_dmamap_create(bus_dma_tag_t, bus_size_t, int, bus_dmamap_t *, int);
641.8Sjdolecekvoid	mca_dma_set_ioport(int dma, u_int16_t port);
651.3Scgdconst struct evcnt *mca_intr_evcnt(mca_chipset_tag_t, mca_intr_handle_t);
661.2Scgdvoid	*mca_intr_establish(mca_chipset_tag_t, mca_intr_handle_t,
671.2Scgd		int, int (*)(void *), void *);
681.2Scgdvoid	mca_intr_disestablish(mca_chipset_tag_t, void *);
691.2Scgdint	mca_conf_read(mca_chipset_tag_t, int, int);
701.2Scgdvoid	mca_conf_write(mca_chipset_tag_t, int, int, int);
711.2Scgdvoid	mca_busprobe(void);
721.8Sjdolecek
731.8Sjdolecek/*
741.8Sjdolecek * Flags for DMA. Avoid BUS_DMA_BUS1, we share dmamap routines with ISA and
751.8Sjdolecek * that flag is used for different purpose within _isa_dmamap_*().
761.8Sjdolecek */
771.8Sjdolecek#define MCABUS_DMA_IOPORT		BUS_DMA_BUS2	/* io-port based DMA */
781.8Sjdolecek#define	MCABUS_DMA_16BIT		BUS_DMA_BUS3	/* 16bit DMA */
791.8Sjdolecek#define	_MCABUS_DMA_USEDMACTRL		BUS_DMA_BUS4	/* internal flag */
801.5Sjdolecek
811.5Sjdolecek/*
821.5Sjdolecek * These two are used to light disk busy LED on PS/2 during disk operations.
831.5Sjdolecek */
841.5Sjdolecekvoid	mca_disk_busy(void);
851.5Sjdolecekvoid	mca_disk_unbusy(void);
861.1Sjdolecek
871.1Sjdolecek/* MCA register addresses for IBM PS/2 */
881.1Sjdolecek
891.1Sjdolecek#define PS2_SYS_CTL_A		0x92	/* PS/2 System Control Port A */
901.1Sjdolecek#define MCA_MB_SETUP_REG	0x94	/* Motherboard setup register */
911.1Sjdolecek#define MCA_ADAP_SETUP_REG	0x96	/* Adapter setup register */
921.1Sjdolecek#define MCA_POS_REG_BASE	0x100	/* POS registers base address */
931.1Sjdolecek#define MCA_POS_REG_SIZE	8	/* POS registers window size */
941.1Sjdolecek
951.1Sjdolecek#define MCA_POS_REG(n)		(0x100+(n))	/* POS registers 0-7 */
961.1Sjdolecek
971.1Sjdolecek/* Adapter setup register bits */
981.1Sjdolecek
991.1Sjdolecek#define MCA_ADAP_SET		0x08	/* Adapter setup mode */
1001.1Sjdolecek#define MCA_ADAP_CHR		0x80	/* Adapter channel reset */
1011.1Sjdolecek
1021.1Sjdolecek#endif /* _I386_MCA_MACHDEP_H_ */
103