mca_machdep.h revision 1.5
1/* $NetBSD: mca_machdep.h,v 1.5 2001/04/22 11:52:18 jdolecek Exp $ */ 2 3/* 4 * Copyright (c) 2000 The NetBSD Foundation, Inc. 5 * Copyright (c) 1999 Scott D. Telford. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. The name of the author may not be used to endorse or promote products 16 * derived from this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#ifndef _I386_MCA_MACHDEP_H_ 31#define _I386_MCA_MACHDEP_H_ 32 33/* 34 * i386-specific definitions for MCA autoconfiguration. 35 */ 36 37extern struct i386_bus_dma_tag mca_bus_dma_tag; 38 39/* set to 1 if MCA bus is detected */ 40extern int MCA_system; 41 42int mca_nmi(void); 43 44/* 45 * Types provided to machine-independent MCA code. 46 */ 47struct i386_mca_chipset { 48 void * /*struct mca_dma_state*/ ic_dmastate; 49}; 50 51typedef struct i386_mca_chipse *mca_chipset_tag_t; 52typedef int mca_intr_handle_t; 53 54/* System Configuration Block - this info is returned by the BIOS call */ 55struct ps2_sys_config { 56 u_int16_t count; 57 u_int8_t model; 58 u_int8_t submodel; 59 u_int8_t bios_rev; 60 u_int8_t feature; 61#define FEATURE_RESV 0x01 /* Reserved */ 62#define FEATURE_MCABUS 0x02 /* MicroChannel Architecture */ 63#define FEATURE_EBDA 0x04 /* Extended BIOS data area allocated */ 64#define FEATURE_WAITEV 0x08 /* Wait for external event is supported */ 65#define FEATURE_KBDINT 0x10 /* Keyboard intercept called by Int 09h */ 66#define FEATURE_RTC 0x20 /* Real-time clock present */ 67#define FEATURE_IC2 0x40 /* Second interrupt chip present */ 68#define FEATURE_DMA3 0x80 /* DMA channel 3 used by hard disk BIOS */ 69 u_int8_t pad[10]; 70} __attribute__ ((packed)); 71 72/* 73 * Functions provided to machine-independent MCA code. 74 */ 75struct mcabus_attach_args; 76 77void mca_attach_hook(struct device *, struct device *, 78 struct mcabus_attach_args *); 79const struct evcnt *mca_intr_evcnt(mca_chipset_tag_t, mca_intr_handle_t); 80void *mca_intr_establish(mca_chipset_tag_t, mca_intr_handle_t, 81 int, int (*)(void *), void *); 82void mca_intr_disestablish(mca_chipset_tag_t, void *); 83int mca_conf_read(mca_chipset_tag_t, int, int); 84void mca_conf_write(mca_chipset_tag_t, int, int, int); 85void mca_busprobe(void); 86 87/* 88 * These two are used to light disk busy LED on PS/2 during disk operations. 89 */ 90void mca_disk_busy(void); 91void mca_disk_unbusy(void); 92 93/* MCA register addresses for IBM PS/2 */ 94 95#define PS2_SYS_CTL_A 0x92 /* PS/2 System Control Port A */ 96#define MCA_MB_SETUP_REG 0x94 /* Motherboard setup register */ 97#define MCA_ADAP_SETUP_REG 0x96 /* Adapter setup register */ 98#define MCA_POS_REG_BASE 0x100 /* POS registers base address */ 99#define MCA_POS_REG_SIZE 8 /* POS registers window size */ 100 101#define MCA_POS_REG(n) (0x100+(n)) /* POS registers 0-7 */ 102 103/* Adapter setup register bits */ 104 105#define MCA_ADAP_SET 0x08 /* Adapter setup mode */ 106#define MCA_ADAP_CHR 0x80 /* Adapter channel reset */ 107 108#endif /* _I386_MCA_MACHDEP_H_ */ 109