From af90f33eee2920875fd8d4b92e1b820759705e8b Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 11 Jun 2005 09:03:49 +0000 Subject: [PATCH] Dispose of support for IBM's Micro Channel architecture (MCA). --- sys/bus/mca/i386/mca_machdep.c | 159 -------- sys/bus/mca/i386/mca_machdep.h | 32 -- sys/bus/mca/mca_bus.c | 590 --------------------------- sys/bus/mca/mca_busreg.h | 85 ---- sys/bus/mca/mca_busvar.h | 71 ---- sys/conf/files | 6 +- sys/conf/files.amd64 | 3 +- sys/conf/files.i386 | 3 +- sys/config/LINT | 18 +- sys/dev/disk/aha/aha_mca.c | 245 ----------- sys/dev/disk/buslogic/bt.c | 3 +- sys/dev/disk/buslogic/bt_mca.c | 329 --------------- sys/dev/disk/buslogic/btreg.h | 3 +- sys/dev/netif/ep/if_ep_mca.c | 166 -------- sys/dev/serial/stli/istallion.c | 131 +----- sys/i386/Makefile | 8 +- sys/i386/bios/mca_machdep.c | 159 -------- sys/i386/bios/mca_machdep.h | 32 -- sys/i386/conf/LINT | 18 +- sys/i386/i386/nexus.c | 12 +- sys/i386/isa/clock.c | 12 +- sys/i386/isa/intr_machdep.c | 28 +- sys/platform/pc32/Makefile | 8 +- sys/platform/pc32/bios/mca_machdep.c | 159 -------- sys/platform/pc32/bios/mca_machdep.h | 32 -- sys/platform/pc32/i386/nexus.c | 12 +- sys/platform/pc32/isa/clock.c | 12 +- sys/platform/pc32/isa/intr_machdep.c | 28 +- 28 files changed, 32 insertions(+), 2332 deletions(-) delete mode 100644 sys/bus/mca/i386/mca_machdep.c delete mode 100644 sys/bus/mca/i386/mca_machdep.h delete mode 100644 sys/bus/mca/mca_bus.c delete mode 100644 sys/bus/mca/mca_busreg.h delete mode 100644 sys/bus/mca/mca_busvar.h delete mode 100644 sys/dev/disk/aha/aha_mca.c delete mode 100644 sys/dev/disk/buslogic/bt_mca.c delete mode 100644 sys/dev/netif/ep/if_ep_mca.c delete mode 100644 sys/i386/bios/mca_machdep.c delete mode 100644 sys/i386/bios/mca_machdep.h delete mode 100644 sys/platform/pc32/bios/mca_machdep.c delete mode 100644 sys/platform/pc32/bios/mca_machdep.h diff --git a/sys/bus/mca/i386/mca_machdep.c b/sys/bus/mca/i386/mca_machdep.c deleted file mode 100644 index 2d6b933f40..0000000000 --- a/sys/bus/mca/i386/mca_machdep.c +++ /dev/null @@ -1,159 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/isa/mca_machdep.c,v 1.4 2000/01/29 16:17:34 peter Exp $ - * $DragonFly: src/sys/bus/mca/i386/Attic/mca_machdep.c,v 1.3 2003/08/07 21:16:46 dillon Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../mca_busreg.h" -#include "mca_machdep.h" - -/* Global MCA bus flag */ -int MCA_system = 0; - -/* System Configuration Block */ -struct sys_config { - u_int16_t count; - u_int8_t model; - u_int8_t submodel; - u_int8_t bios_rev; - u_int8_t feature; -#define FEATURE_RESV 0x01 /* Reserved */ -#define FEATURE_MCABUS 0x02 /* MicroChannel Architecture */ -#define FEATURE_EBDA 0x04 /* Extended BIOS data area allocated */ -#define FEATURE_WAITEV 0x08 /* Wait for external event is supported */ -#define FEATURE_KBDINT 0x10 /* Keyboard intercept called by Int 09h */ -#define FEATURE_RTC 0x20 /* Real-time clock present */ -#define FEATURE_IC2 0x40 /* Second interrupt chip present */ -#define FEATURE_DMA3 0x80 /* DMA channel 3 used by hard disk BIOS */ - u_int8_t pad[3]; -} __attribute__ ((packed)); - -/* Function Prototypes */ -static void bios_mcabus_present (void *); -SYSINIT(mca_present, SI_SUB_CPU, SI_ORDER_ANY, bios_mcabus_present, NULL); - -/* Functions */ -static void -bios_mcabus_present(void * dummy) -{ - struct vm86frame vmf; - struct sys_config * scp; - vm_offset_t paddr; - - bzero(&vmf, sizeof(struct vm86frame)); - - vmf.vmf_ah = 0xc0; - if (vm86_intcall(0x15, &vmf)) { - if (bootverbose) { - printf("BIOS SDT: INT call failed.\n"); - } - return; - } - - if ((vmf.vmf_ah != 0) && (vmf.vmf_flags & 0x01)) { - if (bootverbose) { - printf("BIOS SDT: Not supported. Not PS/2?\n"); - printf("BIOS SDT: AH 0x%02x, Flags 0x%04x\n", - vmf.vmf_ah, vmf.vmf_flags); - } - return; - } - - paddr = vmf.vmf_es; - paddr = (paddr << 4) + vmf.vmf_bx; - scp = (struct sys_config *)BIOS_PADDRTOVADDR(paddr); - - if (bootverbose) { - printf("BIOS SDT: model 0x%02x, submodel 0x%02x, bios_rev 0x%02x\n", - scp->model, scp->submodel, scp->bios_rev); - printf("BIOS SDT: features 0x%b\n", scp->feature, - "\20" - "\01RESV" - "\02MCABUS" - "\03EBDA" - "\04WAITEV" - "\05KBDINT" - "\06RTC" - "\07IC2" - "\08DMA3\n"); - } - - MCA_system = ((scp->feature & FEATURE_MCABUS) ? 1 : 0); - - if (MCA_system) - printf("MicroChannel Architecture System detected.\n"); - - return; -} - -int -mca_bus_nmi (void) -{ - int slot; - int retval = 0; - int pos5 = 0; - - /* Disable motherboard setup */ - outb(MCA_MB_SETUP_REG, MCA_MB_SETUP_DIS); - - /* For each slot */ - for (slot = 0; slot < MCA_MAX_SLOTS; slot++) { - - /* Select the slot */ - outb(MCA_ADAP_SETUP_REG, slot | MCA_ADAP_SET); - pos5 = inb(MCA_POS_REG(MCA_POS5)); - - /* If Adapter Check is low */ - if ((pos5 & MCA_POS5_CHCK) == 0) { - retval++; - - /* If Adapter Check Status is available */ - if ((pos5 & MCA_POS5_CHCK_STAT) == 0) { - printf("MCA NMI: slot %d, POS6=0x%02x, POS7=0x%02x\n", - slot+1, - inb( MCA_POS_REG(MCA_POS6) ), - inb( MCA_POS_REG(MCA_POS7) )); - } else { - printf("MCA NMI: slot %d\n", slot+1); - } - } - /* Disable adapter setup */ - outb(MCA_ADAP_SETUP_REG, MCA_ADAP_SETUP_DIS); - } - - return (retval); -} diff --git a/sys/bus/mca/i386/mca_machdep.h b/sys/bus/mca/i386/mca_machdep.h deleted file mode 100644 index ec35a526e1..0000000000 --- a/sys/bus/mca/i386/mca_machdep.h +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/isa/mca_machdep.h,v 1.1 1999/09/03 02:04:28 mdodd Exp $ - * $DragonFly: src/sys/bus/mca/i386/Attic/mca_machdep.h,v 1.2 2003/06/17 04:28:37 dillon Exp $ - */ - -extern int MCA_system; - -extern int mca_bus_nmi (void); diff --git a/sys/bus/mca/mca_bus.c b/sys/bus/mca/mca_bus.c deleted file mode 100644 index fe43c94763..0000000000 --- a/sys/bus/mca/mca_bus.c +++ /dev/null @@ -1,590 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/mca/mca_bus.c,v 1.7.2.1 2000/03/17 23:55:48 peter Exp $ - * $DragonFly: src/sys/bus/mca/Attic/mca_bus.c,v 1.5 2004/04/07 05:54:39 dillon Exp $ - */ - -/* - * References: - * The CMU Mach3 microkernel - * NetBSD MCA patches by Scott Telford - * Linux MCA code. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "mca_busreg.h" -#include "mca_busvar.h" - -#include - -#define MAX_COL 79 - -static void mca_reg_print (device_t, char *, char *, int *); - -struct mca_device { - struct resource_list rl; /* Resources */ - - mca_id_t id; - u_int8_t slot; - u_int8_t enabled; - u_int8_t pos[8]; /* Programable Option Select Regs. */ -}; - -/* Not supposed to use this function! */ -void -mca_pos_set (dev, reg, data) - device_t dev; - u_int8_t reg; - u_int8_t data; -{ - struct mca_device * m_dev = device_get_ivars(dev); - u_int8_t slot = mca_get_slot(dev); - - if ((slot > MCA_MAX_ADAPTERS) || (reg > MCA_POS7)) - return; - - /* Disable motherboard setup */ - outb(MCA_MB_SETUP_REG, MCA_MB_SETUP_DIS); - - /* Select adapter setup regs */ - outb(MCA_ADAP_SETUP_REG, ((slot & 0x0f) | MCA_ADAP_SET)); - - /* Write the register */ - outb(MCA_POS_REG(reg), data); - - /* Disable adapter setup */ - outb(MCA_ADAP_SETUP_REG, MCA_ADAP_SETUP_DIS); - - /* Update the IVAR copy */ - m_dev->pos[reg] = data; - - return; -} - -u_int8_t -mca_pos_get (dev, reg) - device_t dev; - u_int8_t reg; -{ - u_int8_t slot = mca_get_slot(dev); - u_int8_t data = 0; - - if ((slot > MCA_MAX_ADAPTERS) || (reg > MCA_POS7)) - return (0); - - /* Disable motherboard setup */ - outb(MCA_MB_SETUP_REG, MCA_MB_SETUP_DIS); - - switch (slot) { - case MCA_MB_SCSI_SLOT: - - /* Disable adapter setup */ - outb(MCA_ADAP_SETUP_REG, MCA_ADAP_SETUP_DIS); - - /* Select motherboard video setup regs */ - outb(MCA_MB_SETUP_REG, MCA_MB_SETUP_SCSI); - - /* read the register */ - data = inb(MCA_POS_REG(reg)); - - /* Disable motherboard setup */ - outb(MCA_MB_SETUP_REG, MCA_MB_SETUP_DIS); - - break; - case MCA_MB_VIDEO_SLOT: - /* Disable adapter setup */ - outb(MCA_ADAP_SETUP_REG, MCA_ADAP_SETUP_DIS); - - /* Select motherboard scsi setup regs */ - outb(MCA_MB_SETUP_REG, MCA_MB_SETUP_VIDEO); - - /* read the register */ - data = inb(MCA_POS_REG(reg)); - - /* Disable motherboard setup */ - outb(MCA_MB_SETUP_REG, MCA_MB_SETUP_DIS); - break; - default: - - /* Select adapter setup regs */ - outb(MCA_ADAP_SETUP_REG, - ((slot & 0x0f) | MCA_ADAP_SET)); - - /* read the register */ - data = inb(MCA_POS_REG(reg)); - - /* Disable adapter setup */ - outb(MCA_ADAP_SETUP_REG, MCA_ADAP_SETUP_DIS); - break; - } - - return (data); -} - -const char * -mca_match_id (id, mca_devs) - u_int16_t id; - struct mca_ident * mca_devs; -{ - struct mca_ident * m = mca_devs; - while(m->name != NULL) { - if (id == m->id) - return (m->name); - m++; - } - return (NULL); -} - -u_int8_t -mca_pos_read (dev, reg) - device_t dev; - u_int8_t reg; -{ - struct mca_device * m_dev = device_get_ivars(dev); - - if (reg > MCA_POS7) - return (0); - - return (m_dev->pos[reg]); -} - -void -mca_add_irq (dev, irq) - device_t dev; - int irq; -{ - struct mca_device * m_dev = device_get_ivars(dev); - int rid = 0; - - while (resource_list_find(&(m_dev->rl), SYS_RES_IRQ, rid)) rid++; - resource_list_add(&(m_dev->rl), SYS_RES_IRQ, rid, irq, irq, 1); - - return; -} - -void -mca_add_drq (dev, drq) - device_t dev; - int drq; -{ - struct mca_device * m_dev = device_get_ivars(dev); - int rid = 0; - - while (resource_list_find(&(m_dev->rl), SYS_RES_DRQ, rid)) rid++; - resource_list_add(&(m_dev->rl), SYS_RES_DRQ, rid, drq, drq, 1); - - return; -} - -void -mca_add_mspace (dev, mbase, msize) - device_t dev; - u_long mbase; - u_long msize; -{ - struct mca_device * m_dev = device_get_ivars(dev); - int rid = 0; - - while (resource_list_find(&(m_dev->rl), SYS_RES_MEMORY, rid)) rid++; - resource_list_add(&(m_dev->rl), SYS_RES_MEMORY, rid, - mbase, (mbase + msize), msize); - - return; -} - -void -mca_add_iospace (dev, iobase, iosize) - device_t dev; - u_long iobase; - u_long iosize; -{ - struct mca_device * m_dev = device_get_ivars(dev); - int rid = 0; - - while (resource_list_find(&(m_dev->rl), SYS_RES_IOPORT, rid)) rid++; - resource_list_add(&(m_dev->rl), SYS_RES_IOPORT, rid, - iobase, (iobase + iosize), iosize); - - return; -} - -static int -mca_probe (device_t dev) -{ - device_t child; - struct mca_device * m_dev = NULL; - int devices_found = 0; - u_int8_t slot; - u_int8_t reg; - - device_set_desc(dev, "MCA bus"); - - /* Disable adapter setup */ - outb(MCA_ADAP_SETUP_REG, MCA_ADAP_SETUP_DIS); - /* Disable motherboard setup */ - outb(MCA_MB_SETUP_REG, MCA_MB_SETUP_DIS); - - if (bootverbose) { - printf("POS REG 00 01 02 03 04 05 06 07\n"); - printf("-----------------------------------\n"); - } - - for (slot = 0; slot < MCA_MAX_SLOTS; slot++) { - - if (m_dev == NULL) - m_dev = malloc(sizeof(*m_dev), M_DEVBUF, M_WAITOK); - bzero(m_dev, sizeof(*m_dev)); - - /* Select adapter setup regs */ - outb(MCA_ADAP_SETUP_REG, ((slot & 0x0f) | MCA_ADAP_SET)); - - /* Read the POS registers */ - for (reg = MCA_POS0; reg <= MCA_POS7; reg++) { - m_dev->pos[reg] = inb(MCA_POS_REG(reg)); - } - - /* Disable adapter setup */ - outb(MCA_ADAP_SETUP_REG, MCA_ADAP_SETUP_DIS); - - if (bootverbose) { - printf("mca slot %d:", slot + 1); - for (reg = MCA_POS0; reg <= MCA_POS7; reg++) { - printf(" %02x", m_dev->pos[reg]); - } - printf("\n"); - } - - m_dev->id = (u_int16_t)m_dev->pos[MCA_POS0] | - ((u_int16_t)m_dev->pos[MCA_POS1] << 8); - - if (m_dev->id == 0xffff) { - continue; - } - - devices_found++; - - m_dev->enabled = (m_dev->pos[MCA_POS2] & MCA_POS2_ENABLE); - m_dev->slot = slot; - - resource_list_init(&(m_dev->rl)); - - child = device_add_child(dev, NULL, -1); - device_set_ivars(child, m_dev); - - m_dev = NULL; - } - - if (m_dev) { - free(m_dev, M_DEVBUF); - } - - return (devices_found ? 0 : ENXIO); -} - -static void -mca_reg_print (dev, string, separator, column) - device_t dev; - char * string; - char * separator; - int * column; -{ - int length = strlen(string); - - length += (separator ? 2 : 1); - - if (((*column) + length) >= MAX_COL) { - printf("\n"); - (*column) = 0; - } else if ((*column) != 0) { - if (separator) { - printf("%c", *separator); - (*column)++; - } - printf(" "); - (*column)++; - } - - if ((*column) == 0) { - (*column) += device_printf(dev, "%s", string); - } else { - (*column) += printf("%s", string); - } - - return; -} - -static int -mca_print_child (device_t dev, device_t child) -{ - char buf[MAX_COL+1]; - struct mca_device * m_dev = device_get_ivars(child); - int rid; - struct resource_list_entry * rle; - char separator = ','; - int column = 0; - int retval = 0; - - if (device_get_desc(child)) { - snprintf(buf, sizeof(buf), "<%s>", device_get_desc(child)); - mca_reg_print(child, buf, NULL, &column); - } - - rid = 0; - while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_IOPORT, rid++))) { - if (rle->count == 1) { - snprintf(buf, sizeof(buf), "%s%lx", - ((rid == 1) ? "io 0x" : "0x"), - rle->start); - } else { - snprintf(buf, sizeof(buf), "%s%lx-0x%lx", - ((rid == 1) ? "io 0x" : "0x"), - rle->start, - (rle->start + rle->count)); - } - mca_reg_print(child, buf, - ((rid == 2) ? &separator : NULL), &column); - } - - rid = 0; - while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_MEMORY, rid++))) { - if (rle->count == 1) { - snprintf(buf, sizeof(buf), "%s%lx", - ((rid == 1) ? "mem 0x" : "0x"), - rle->start); - } else { - snprintf(buf, sizeof(buf), "%s%lx-0x%lx", - ((rid == 1) ? "mem 0x" : "0x"), - rle->start, - (rle->start + rle->count)); - } - mca_reg_print(child, buf, - ((rid == 2) ? &separator : NULL), &column); - } - - rid = 0; - while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_IRQ, rid++))) { - snprintf(buf, sizeof(buf), "irq %ld", rle->start); - mca_reg_print(child, buf, - ((rid == 1) ? &separator : NULL), &column); - } - - rid = 0; - while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_DRQ, rid++))) { - snprintf(buf, sizeof(buf), "drq %lx", rle->start); - mca_reg_print(child, buf, - ((rid == 1) ? &separator : NULL), &column); - } - - snprintf(buf, sizeof(buf), "on %s id %04x slot %d\n", - device_get_nameunit(dev), - mca_get_id(child), mca_get_slot(child)+1); - mca_reg_print(child, buf, NULL, &column); - - return (retval); -} - -static void -mca_probe_nomatch (device_t dev, device_t child) -{ - mca_id_t mca_id = mca_get_id(child); - u_int8_t slot = mca_get_slot(child); - u_int8_t enabled = mca_get_enabled(child); - - device_printf(dev, "unknown card (id 0x%04x, %s) at slot %d\n", - mca_id, - (enabled ? "enabled" : "disabled"), - slot + 1); - - return; -} - -static int -mca_read_ivar (device_t dev, device_t child, int which, u_long * result) -{ - struct mca_device * m_dev = device_get_ivars(child); - - switch (which) { - case MCA_IVAR_SLOT: - *result = m_dev->slot; - break; - case MCA_IVAR_ID: - *result = m_dev->id; - break; - case MCA_IVAR_ENABLED: - *result = m_dev->enabled; - break; - default: - return (ENOENT); - break; - } - - return (0); -} - -static int -mca_write_ivar(device_t dev, device_t child, int which, uintptr_t value) -{ - return (EINVAL); -} - -static struct resource * -mca_alloc_resource (device_t dev, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) -{ - struct mca_device * m_dev = device_get_ivars(child); - struct resource_list_entry * rle; - int isdefault; - int passthrough; - - isdefault = (start == 0UL && end == ~0UL); - passthrough = (device_get_parent(child) != dev); - - if (!passthrough && !isdefault) { - rle = resource_list_find(&(m_dev->rl), type, *rid); - if (!rle) { - resource_list_add(&(m_dev->rl), type, *rid, - start, end, count); - } - } - - if (type == SYS_RES_IRQ) { - flags |= RF_SHAREABLE; - } - - return (resource_list_alloc(&(m_dev->rl), dev, child, type, rid, - start, end, count, flags)); -} - -static int -mca_release_resource (device_t dev, device_t child, int type, int rid, - struct resource * r) -{ - struct mca_device * m_dev = device_get_ivars(child); - - return (resource_list_release(&(m_dev->rl), dev, child, type, rid, r)); -} - -static int -mca_get_resource(device_t dev, device_t child, int type, int rid, - u_long *startp, u_long *countp) -{ - struct mca_device * m_dev = device_get_ivars(child); - struct resource_list * rl = &(m_dev->rl); - struct resource_list_entry * rle; - - rle = resource_list_find(rl, type, rid); - if (!rle) - return ENOENT; - - *startp = rle->start; - *countp = rle->count; - - return (0); -} - -static int -mca_set_resource(device_t dev, device_t child, int type, int rid, - u_long start, u_long count) -{ - struct mca_device * m_dev = device_get_ivars(child); - struct resource_list * rl = &(m_dev->rl); - - resource_list_add(rl, type, rid, start, start + count - 1, count); - return (0); -} - -static void -mca_delete_resource(device_t dev, device_t child, int type, int rid) -{ - struct mca_device * m_dev = device_get_ivars(child); - struct resource_list * rl = &(m_dev->rl); - - resource_list_delete(rl, type, rid); -} - -static struct resource_list * -mca_get_resource_list (device_t dev, device_t child) -{ - struct mca_device * m_dev = device_get_ivars(child); - struct resource_list * rl = &m_dev->rl; - - if (!rl) - return (NULL); - - return (rl); -} - - -static device_method_t mca_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, mca_probe), - DEVMETHOD(device_attach, bus_generic_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_print_child, mca_print_child), - DEVMETHOD(bus_probe_nomatch, mca_probe_nomatch), - DEVMETHOD(bus_read_ivar, mca_read_ivar), - DEVMETHOD(bus_write_ivar, mca_write_ivar), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - - DEVMETHOD(bus_get_resource_list,mca_get_resource_list), - DEVMETHOD(bus_alloc_resource, mca_alloc_resource), - DEVMETHOD(bus_release_resource, mca_release_resource), - DEVMETHOD(bus_set_resource, mca_set_resource), - DEVMETHOD(bus_get_resource, mca_get_resource), - DEVMETHOD(bus_delete_resource, mca_delete_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - - { 0, 0 } -}; - -static driver_t mca_driver = { - "mca", - mca_methods, - 1, /* no softc */ -}; - -static devclass_t mca_devclass; - -DRIVER_MODULE(mca, nexus, mca_driver, mca_devclass, 0, 0); diff --git a/sys/bus/mca/mca_busreg.h b/sys/bus/mca/mca_busreg.h deleted file mode 100644 index 45b8411490..0000000000 --- a/sys/bus/mca/mca_busreg.h +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/mca/mca_busreg.h,v 1.1 1999/09/03 03:40:00 mdodd Exp $ - * $DragonFly: src/sys/bus/mca/Attic/mca_busreg.h,v 1.2 2003/06/17 04:28:28 dillon Exp $ - */ - -/* - * Standardized MCA configuration information - */ - -#define MCA_MAX_SLOTS 8 /* max number of slots per bus */ -#define MCA_MB_SCSI_SLOT 8 -#define MCA_MB_VIDEO_SLOT 9 -#define MCA_MAX_ADAPTERS 9 - -/* - * When an ADF file talks about a POS register - * its not talking about the same index we are - * so provide this to convert ADF pos register - * offsets to our register offsets. (Since - * to us, POS0 and POS1 are just 2 more registers - */ - -#define MCA_ADP_POS(pos) (pos + 2) - -#define MCA_POS0 0 /* low byte of board ID */ -#define MCA_POS1 1 /* high byte of board ID */ -#define MCA_POS2 2 -# define MCA_POS2_ENABLE 0x01 /* POS2, hi => adapter enabled */ -#define MCA_POS3 3 -#define MCA_POS4 4 -#define MCA_POS5 5 -# define MCA_POS5_CHCK_STAT 0x40 /* lo => CHCK status available */ -# define MCA_POS5_CHCK 0x80 /* lo => adapter CHCK signal */ -#define MCA_POS6 6 /* low byte of CHCK status */ -#define MCA_POS7 7 /* high byte of CHCK status */ - -/* - * MCA register addresses for IBM PS/2 - */ - -#define MCA_SYS_CTL_A_REG 0x92 /* PS/2 System Control Port A */ -#define MCA_SYS_CTL_B_REG 0x60 /* PS/2 System Control Port B */ -#define MCA_ARB_REG 0x90 /* MCA Arbitration port */ -#define MCA_CSF_REG 0x91 /* MCA Card Select Feedback */ - -/* - * 0x96, 0x97 POS Registers - * 0x100 - 0x107 POS Registers - */ - -#define MCA_MB_SETUP_REG 0x94 /* Motherboard setup register */ -# define MCA_MB_SETUP_DIS 0xff /* Disable motherboard setup */ -# define MCA_MB_SETUP_VIDEO 0xdf -# define MCA_MB_SETUP_SCSI 0xf7 /* Pri. SCSI setup reg */ -# define MCA_MB_SETUP_SCSI_ALT 0xfd /* Alt. SCSI setup reg */ - -#define MCA_ADAP_SETUP_REG 0x96 /* Adapter setup register */ -# define MCA_ADAP_SETUP_DIS 0x0 /* Disable adapter setup */ -# define MCA_ADAP_SET 0x08 /* Adapter setup mode */ -# define MCA_ADAP_CHR 0x80 /* Adapter channel reset */ -#define MCA_POS_REG(n) (0x100+(n)) /* POS registers 0-7 */ diff --git a/sys/bus/mca/mca_busvar.h b/sys/bus/mca/mca_busvar.h deleted file mode 100644 index 451fbe9f53..0000000000 --- a/sys/bus/mca/mca_busvar.h +++ /dev/null @@ -1,71 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/mca/mca_busvar.h,v 1.2 1999/09/26 07:02:05 mdodd Exp $ - * $DragonFly: src/sys/bus/mca/Attic/mca_busvar.h,v 1.2 2003/06/17 04:28:28 dillon Exp $ - */ - -typedef u_int16_t mca_id_t; - -struct mca_ident { - mca_id_t id; - char *name; -}; - -const char * mca_match_id (u_int16_t, struct mca_ident *); - -/* - * Simplified accessors for isa devices - */ - -enum mca_device_ivars { - MCA_IVAR_SLOT, - MCA_IVAR_ID, - MCA_IVAR_ENABLED, -}; - -#define MCA_ACCESSOR(A, B, T) \ - \ -static __inline T mca_get_ ## A(device_t dev) \ -{ \ - uintptr_t v; \ - BUS_READ_IVAR(device_get_parent(dev), dev, MCA_IVAR_ ## B, &v); \ - return (T) v; \ -} - -MCA_ACCESSOR(slot, SLOT, int) -MCA_ACCESSOR(id, ID, mca_id_t) -MCA_ACCESSOR(enabled, ENABLED, int) - -/* don't use these! */ -void mca_pos_set (device_t, u_int8_t, u_int8_t); -u_int8_t mca_pos_get (device_t, u_int8_t); - -u_int8_t mca_pos_read (device_t, u_int8_t); - -void mca_add_irq (device_t, int); -void mca_add_drq (device_t, int); -void mca_add_iospace (device_t, u_long, u_long); -void mca_add_mspace (device_t, u_long, u_long); diff --git a/sys/conf/files b/sys/conf/files index 43f1539641..0e8cc694bd 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/conf/files,v 1.340.2.137 2003/06/04 17:10:30 sam Exp $ -# $DragonFly: src/sys/conf/files,v 1.92 2005/06/07 19:07:11 hsu Exp $ +# $DragonFly: src/sys/conf/files,v 1.93 2005/06/11 09:03:48 swildner Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -291,7 +291,6 @@ dev/raid/amr/amr_pci.c optional amr dev/raid/amr/amr.c optional amr dev/disk/aha/aha.c optional aha dev/disk/aha/aha_isa.c optional aha isa -dev/disk/aha/aha_mca.c optional aha mca dev/disk/ahb/ahb.c optional ahb eisa dev/disk/aic/aic.c optional aic dev/disk/aic/aic_pccard.c optional aic pccard @@ -311,7 +310,6 @@ dev/netif/bfe/if_bfe.c optional bfe dev/netif/bge/if_bge.c optional bge dev/disk/buslogic/bt.c optional bt dev/disk/buslogic/bt_isa.c optional bt isa -dev/disk/buslogic/bt_mca.c optional bt mca dev/disk/buslogic/bt_eisa.c optional bt eisa dev/disk/buslogic/bt_pci.c optional bt pci dev/disk/ccd/ccd.c optional ccd @@ -333,7 +331,6 @@ dev/netif/ed/if_ed_pci.c optional ed pci dev/netif/ep/if_ep.c optional ep dev/netif/ep/if_ep_isa.c optional ep isa dev/netif/ep/if_ep_eisa.c optional ep eisa -dev/netif/ep/if_ep_mca.c optional ep mca dev/netif/ep/if_ep_pccard.c optional ep pccard dev/atm/en/midway.c optional en dev/netif/ex/if_ex.c optional ex @@ -390,7 +387,6 @@ dev/raid/iir/iir.c optional iir dev/raid/iir/iir_ctrl.c optional iir dev/raid/iir/iir_pci.c optional iir pci dev/netif/lge/if_lge.c optional lge -bus/mca/mca_bus.c optional mca dev/disk/md/md.c optional md dev/netif/mii_layer/mii.c optional miibus dev/netif/mii_layer/mii_physubr.c optional miibus diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 5a3feb84e0..1c18fa129c 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -2,7 +2,7 @@ # files marked standard are always included. # # $FreeBSD: src/sys/conf/files.i386,v 1.307.2.38 2003/01/02 20:41:33 kan Exp $ -# $DragonFly: src/sys/conf/Attic/files.amd64,v 1.6 2005/05/07 17:38:33 swildner Exp $ +# $DragonFly: src/sys/conf/Attic/files.amd64,v 1.7 2005/06/11 09:03:48 swildner Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -193,7 +193,6 @@ bus/isa/i386/isa_compat.c optional isa bus/isa/i386/isa_dma.c optional isa dev/serial/stli/istallion.c optional stli dev/misc/labpc/labpc.c optional labpc -bus/mca/i386/mca_machdep.c optional mca dev/disk/mcd/mcd.c optional mcd dev/misc/mse/mse.c optional mse i386/isa/npx.c mandatory npx diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index c65280b268..7521698ff0 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -2,7 +2,7 @@ # files marked standard are always included. # # $FreeBSD: src/sys/conf/files.i386,v 1.307.2.38 2003/01/02 20:41:33 kan Exp $ -# $DragonFly: src/sys/conf/Attic/files.i386,v 1.30 2005/05/07 17:38:33 swildner Exp $ +# $DragonFly: src/sys/conf/Attic/files.i386,v 1.31 2005/06/11 09:03:48 swildner Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -243,7 +243,6 @@ bus/isa/i386/isa_compat.c optional isa compat_oldisa bus/isa/i386/isa_dma.c optional isa dev/serial/stli/istallion.c optional stli dev/misc/labpc/labpc.c optional labpc -bus/mca/i386/mca_machdep.c optional mca dev/disk/mcd/mcd.c optional mcd dev/misc/mse/mse.c optional mse i386/isa/npx.c mandatory npx diff --git a/sys/config/LINT b/sys/config/LINT index ea0a3c5e0e..39f8b256c0 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -3,7 +3,7 @@ # as much of the source tree as it can. # # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $ -# $DragonFly: src/sys/config/LINT,v 1.53 2005/06/06 22:45:39 corecode Exp $ +# $DragonFly: src/sys/config/LINT,v 1.54 2005/06/11 09:03:49 swildner Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -1024,7 +1024,6 @@ options MSGBUF_SIZE=40960 # ISA and EISA devices: # EISA support is available for some device, so they can be auto-probed. -# MicroChannel (MCA) support is available for some devices. # # Mandatory ISA devices: isa, npx @@ -1596,21 +1595,6 @@ device xrpu # nullmodem terminal driver device nmdm -# -# MCA devices: -# -# The MCA bus device is `mca'. It provides auto-detection and -# configuration support for all devices on the MCA bus. -# -# The 'aha' device provides support for the Adaptec 1640 -# -# The 'bt' device provides support for various Buslogic/Bustek -# and Storage Dimensions SCSI adapters. -# -# The 'ep' device provides support for the 3Com 3C529 ethernet card. -# -device mca - # # EISA devices: # diff --git a/sys/dev/disk/aha/aha_mca.c b/sys/dev/disk/aha/aha_mca.c deleted file mode 100644 index 3a7b51f706..0000000000 --- a/sys/dev/disk/aha/aha_mca.c +++ /dev/null @@ -1,245 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/aha/aha_mca.c,v 1.2 2000/01/24 07:08:40 imp Exp $ - * $DragonFly: src/sys/dev/disk/aha/Attic/aha_mca.c,v 1.4 2005/05/24 20:58:59 dillon Exp $ - * - * Based on aha_isa.c - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "ahareg.h" - -static struct mca_ident aha_mca_devs[] = { - { 0x0f1f, "Adaptec AHA-1640 SCSI Adapter" }, - { 0, NULL }, -}; - -#define AHA_MCA_IOPORT_POS MCA_ADP_POS(MCA_POS1) -# define AHA_MCA_IOPORT_MASK1 0x07 -# define AHA_MCA_IOPORT_MASK2 0xc0 -# define AHA_MCA_IOPORT_SIZE 0x03 -# define AHA_MCA_IOPORT(pos) (0x30 + \ - (((u_int32_t)pos & \ - AHA_MCA_IOPORT_MASK1) << 8) + \ - (((u_int32_t)pos & \ - AHA_MCA_IOPORT_MASK2) >> 4)) - -#define AHA_MCA_DRQ_POS MCA_ADP_POS(MCA_POS3) -# define AHA_MCA_DRQ_MASK 0x0f -# define AHA_MCA_DRQ(pos) (pos & AHA_MCA_DRQ_MASK) - -#define AHA_MCA_IRQ_POS MCA_ADP_POS(MCA_POS2) -# define AHA_MCA_IRQ_MASK 0x07 -# define AHA_MCA_IRQ(pos) ((pos & AHA_MCA_IRQ_MASK) + 8) - -/* - * Not needed as the board knows its config - * internally and the ID will be fetched - * via AOP_INQUIRE_SETUP_INFO command. - */ -#define AHA_MCA_SCSIID_POS MCA_ADP_POS(MCA_POS2) -#define AHA_MCA_SCSIID_MASK 0xe0 -#define AHA_MCA_SCSIID(pos) ((pos & AHA_MCA_SCSIID_MASK) >> 5) - -static int -aha_mca_probe (device_t dev) -{ - const char * desc; - mca_id_t id = mca_get_id(dev); - u_int32_t iobase = 0; - u_int32_t iosize = 0; - u_int8_t drq = 0; - u_int8_t irq = 0; - u_int8_t pos; - - desc = mca_match_id(id, aha_mca_devs); - if (!desc) - return (ENXIO); - device_set_desc(dev, desc); - - pos = mca_pos_read(dev, AHA_MCA_IOPORT_POS); - iobase = AHA_MCA_IOPORT(pos); - iosize = AHA_MCA_IOPORT_SIZE; - - pos = mca_pos_read(dev, AHA_MCA_DRQ_POS); - drq = AHA_MCA_DRQ(pos); - - pos = mca_pos_read(dev, AHA_MCA_IRQ_POS); - irq = AHA_MCA_IRQ(pos); - - mca_add_iospace(dev, iobase, iosize); - mca_add_drq(dev, drq); - mca_add_irq(dev, irq); - - aha_unit++; - - return (0); -} - -static int -aha_mca_attach (device_t dev) -{ - struct aha_softc * sc = NULL; - struct resource * io = NULL; - struct resource * irq = NULL; - struct resource * drq = NULL; - int error = 0; - int unit = device_get_unit(dev); - int rid; - void * ih; - - rid = 0; - io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); - if (!io) { - device_printf(dev, "No I/O space?!\n"); - error = ENOMEM; - goto bad; - } - - rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE); - if (irq == NULL) { - device_printf(dev, "No IRQ?!\n"); - error = ENOMEM; - goto bad; - } - - rid = 0; - drq = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, - 0, ~0, 1, RF_ACTIVE); - if (drq == NULL) { - device_printf(dev, "No DRQ?!\n"); - error = ENOMEM; - goto bad; - } - - sc = aha_alloc(unit, rman_get_bustag(io), rman_get_bushandle(io)); - if (sc == NULL) { - device_printf(dev, "aha_alloc() failed!\n"); - error = ENOMEM; - goto bad; - } - - error = aha_probe(sc); - if (error) { - device_printf(dev, "aha_probe() failed!\n"); - goto bad; - } - - error = aha_fetch_adapter_info(sc); - if (error) { - device_printf(dev, "aha_fetch_adapter_info() failed!\n"); - goto bad; - } - - isa_dmacascade(rman_get_start(drq)); - - error = bus_dma_tag_create(/* parent */ NULL, - /* alignemnt */ 1, - /* boundary */ 0, - BUS_SPACE_MAXADDR_24BIT, - /* highaddr */ BUS_SPACE_MAXADDR, - NULL, - NULL, - /* maxsize */ BUS_SPACE_MAXSIZE_24BIT, - /* nsegments */ BUS_SPACE_UNRESTRICTED, - /* maxsegsz */ BUS_SPACE_MAXSIZE_24BIT, - /* flags */ 0, - &sc->parent_dmat); - if (error) { - device_printf(dev, "bus_dma_tag_create() failed!\n"); - goto bad; - } - - error = aha_init(sc); - if (error) { - device_printf(dev, "aha_init() failed\n"); - goto bad; - } - - error = aha_attach(sc); - if (error) { - device_printf(dev, "aha_attach() failed\n"); - goto bad; - } - - error = bus_setup_intr(dev, irq, INTR_TYPE_CAM, aha_intr, sc, - &ih, NULL); - if (error) { - device_printf(dev, "Unable to register interrupt handler\n"); - goto bad; - } - - return (0); - -bad: - aha_free(sc); - - if (io) - bus_release_resource(dev, SYS_RES_IOPORT, 0, io); - if (irq) - bus_release_resource(dev, SYS_RES_IRQ, 0, irq); - if (drq) - bus_release_resource(dev, SYS_RES_DRQ, 0, drq); - - return (error); -} - -static device_method_t aha_mca_methods[] = { - DEVMETHOD(device_probe, aha_mca_probe), - DEVMETHOD(device_attach, aha_mca_attach), - - { 0, 0 } -}; - -static driver_t aha_mca_driver = { - "aha", - aha_mca_methods, - 1, -/* - sizeof(struct aha_softc *), - */ -}; - -static devclass_t aha_devclass; - -DRIVER_MODULE(aha, mca, aha_mca_driver, aha_devclass, 0, 0); diff --git a/sys/dev/disk/buslogic/bt.c b/sys/dev/disk/buslogic/bt.c index 1edf619744..42f86709b2 100644 --- a/sys/dev/disk/buslogic/bt.c +++ b/sys/dev/disk/buslogic/bt.c @@ -2,7 +2,6 @@ * Generic driver for the BusLogic MultiMaster SCSI host adapters * Product specific probe and attach routines can be found in: * sys/dev/buslogic/bt_isa.c BT-54X, BT-445 cards - * sys/dev/buslogic/bt_mca.c BT-64X, SDC3211B, SDC3211F * sys/dev/buslogic/bt_eisa.c BT-74X, BT-75x cards, SDC3222F * sys/dev/buslogic/bt_pci.c BT-946, BT-948, BT-956, BT-958 cards * @@ -31,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/buslogic/bt.c,v 1.25.2.1 2000/08/02 22:32:26 peter Exp $ - * $DragonFly: src/sys/dev/disk/buslogic/bt.c,v 1.9 2005/06/03 21:56:23 swildner Exp $ + * $DragonFly: src/sys/dev/disk/buslogic/bt.c,v 1.10 2005/06/11 09:03:48 swildner Exp $ */ /* diff --git a/sys/dev/disk/buslogic/bt_mca.c b/sys/dev/disk/buslogic/bt_mca.c deleted file mode 100644 index 105fdc7e56..0000000000 --- a/sys/dev/disk/buslogic/bt_mca.c +++ /dev/null @@ -1,329 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/buslogic/bt_mca.c,v 1.4 1999/10/09 04:02:02 mdodd Exp $ - * $DragonFly: src/sys/dev/disk/buslogic/Attic/bt_mca.c,v 1.3 2003/08/07 21:16:52 dillon Exp $ - */ - -/* - * Written using the bt_isa/bt_pci code as a reference. - * - * Thanks to Andy Farkas for - * testing and feedback. - */ - -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include - -#include - -#include "btreg.h" - -#include - -static struct mca_ident bt_mca_devs[] = { - { 0x0708, "BusLogic 32 Bit Bus Master MCA-to-SCSI Host Adapter" }, - { 0x0708, "BusTek BT-640A Micro Channel to SCSI Host Adapter" }, - { 0x0708, "Storage Dimensions SDC3211B 32-bit SCSI Host Adapter" }, - { 0x0709, "Storage Dimensions SDC3211F 32-bit FAST SCSI Host Adapter" }, - { 0, NULL }, -}; - -#define BT_MCA_IOPORT_POS1 MCA_ADP_POS(MCA_POS0) -#define BT_MCA_IOPORT_POS2 MCA_ADP_POS(MCA_POS1) -#define BT_MCA_IOPORT_MASK1 0x10 -#define BT_MCA_IOPORT_MASK2 0x03 -#define BT_MCA_IOPORT_SIZE 0x03 -#define BT_MCA_IOPORT(pos) (0x30 + \ - (((u_int32_t)pos &\ - BT_MCA_IOPORT_MASK2) << 8) + \ - (((u_int32_t)pos &\ - BT_MCA_IOPORT_MASK1) >> 2)) - -#define BT_MCA_IRQ_POS MCA_ADP_POS(MCA_POS0) -#define BT_MCA_IRQ_MASK 0x0e -#define BT_MCA_IRQ(pos) (((pos & BT_MCA_IRQ_MASK) >> 1) + 8) - -#define BT_MCA_DRQ_POS MCA_ADP_POS(MCA_POS3) -#define BT_MCA_DRQ_MASK 0x0f -#define BT_MCA_DRQ(pos) (pos & BT_MCA_DRQ_MASK) - -#define BT_MCA_SCSIID_POS MCA_ADP_POS(MCA_POS2) -#define BT_MCA_SCSIID_MASK 0xe0 -#define BT_MCA_SCSIID(pos) ((pos & BT_MCA_SCSIID_MASK) >> 5) - -static bus_dma_filter_t btvlbouncefilter; -static bus_dmamap_callback_t btmapsensebuffers; - -static void -bt_mca_release_resources (device_t dev) -{ - struct bt_softc * bt = device_get_softc(dev); - - if (bt->port) - bus_release_resource(dev, SYS_RES_IOPORT, 0, bt->port); - if (bt->irq) - bus_release_resource(dev, SYS_RES_IRQ, 0, bt->irq); - if (bt->drq) - bus_release_resource(dev, SYS_RES_DRQ, 0, bt->drq); - - bt_free_softc(dev); -} - -#define BT_MCA_PROBE 0 -#define BT_MCA_ATTACH 1 - -static int -bt_mca_alloc_resources(device_t dev, int mode) -{ - struct resource * io = NULL; - struct resource * irq = NULL; - struct resource * drq = NULL; - int rid; - - rid = 0; - io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, - 0, ~0, 1, RF_ACTIVE); - if (io == NULL) { - printf("bt_mca_alloc_resources() failed to allocate IOPORT\n"); - return (ENOMEM); - } - - if (mode == BT_MCA_ATTACH) { - - rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_ACTIVE); - if (irq == NULL) { - printf("bt_mca_alloc_resources() failed to allocate IRQ\n"); - goto bad; - } - - rid = 0; - drq = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, - 0, ~0, 1, RF_ACTIVE); - if (drq == NULL) { - printf("bt_mca_alloc_resources() failed to allocate DRQ\n"); - goto bad; - } - } - - bt_init_softc(dev, io, irq, drq); - - return (0); -bad: - bt_mca_release_resources(dev); - return (ENOMEM); -} - -static int -bt_mca_probe (device_t dev) -{ - const char * desc; - mca_id_t id = mca_get_id(dev); - struct bt_probe_info info; - u_int32_t iobase = 0; - u_int32_t iosize = 0; - u_int8_t drq = 0; - u_int8_t irq = 0; - u_int8_t pos; - int result; - - desc = mca_match_id(id, bt_mca_devs); - if (!desc) - return (ENXIO); - device_set_desc(dev, desc); - - pos = (mca_pos_read(dev, BT_MCA_IOPORT_POS1) & BT_MCA_IOPORT_MASK1) | - (mca_pos_read(dev, BT_MCA_IOPORT_POS2) & BT_MCA_IOPORT_MASK2); - iobase = BT_MCA_IOPORT(pos); - iosize = BT_MCA_IOPORT_SIZE; - - pos = mca_pos_read(dev, BT_MCA_DRQ_POS); - drq = BT_MCA_DRQ(pos); - - pos = mca_pos_read(dev, BT_MCA_IRQ_POS); - irq = BT_MCA_IRQ(pos); - - bt_mark_probed_iop(iobase); - - mca_add_iospace(dev, iobase, iosize); - - /* And allocate them */ - bt_mca_alloc_resources(dev, BT_MCA_PROBE); - - if (bt_port_probe(dev, &info) != 0) { - printf("bt_mca_probe: Probe failed for " - "card at slot %d\n", mca_get_slot(dev) + 1); - result = ENXIO; - } else { - mca_add_drq(dev, drq); - mca_add_irq(dev, irq); - result = 0; - } - bt_mca_release_resources(dev); - - return (result); -} - -static int -bt_mca_attach (device_t dev) -{ - struct bt_softc * bt = device_get_softc(dev); - int error = 0; - - /* Allocate resources */ - if ((error = bt_mca_alloc_resources(dev, BT_MCA_ATTACH))) { - device_printf(dev, "Unable to allocate resources in bt_mca_attach()\n"); - return (error); - } - - isa_dmacascade(rman_get_start(bt->drq)); - - /* Allocate a dmatag for our CCB DMA maps */ - if (bus_dma_tag_create(/*parent*/NULL, /*alignemnt*/1, /*boundary*/0, - /*lowaddr*/BUS_SPACE_MAXADDR_24BIT, - /*highaddr*/BUS_SPACE_MAXADDR, - /*filter*/btvlbouncefilter, - /*filterarg*/bt, - /*maxsize*/BUS_SPACE_MAXSIZE_32BIT, - /*nsegments*/BUS_SPACE_UNRESTRICTED, - /*maxsegsz*/BUS_SPACE_MAXSIZE_32BIT, - /*flags*/0, &bt->parent_dmat) != 0) { - bt_mca_release_resources(dev); - return (ENOMEM); - } - - if (bt_init(dev)) { - bt_mca_release_resources(dev); - return (ENOMEM); - } - - /* DMA tag for our sense buffers */ - if (bus_dma_tag_create(bt->parent_dmat, /*alignment*/1, - /*boundary*/0, - /*lowaddr*/BUS_SPACE_MAXADDR, - /*highaddr*/BUS_SPACE_MAXADDR, - /*filter*/NULL, /*filterarg*/NULL, - bt->max_ccbs * sizeof(struct scsi_sense_data), - /*nsegments*/1, - /*maxsegsz*/BUS_SPACE_MAXSIZE_32BIT, - /*flags*/0, &bt->sense_dmat) != 0) { - bt_mca_release_resources(dev); - return (ENOMEM); - } - - bt->init_level++; - - /* Allocation of sense buffers */ - if (bus_dmamem_alloc(bt->sense_dmat, - (void **)&bt->sense_buffers, - BUS_DMA_NOWAIT, &bt->sense_dmamap) != 0) { - bt_mca_release_resources(dev); - return (ENOMEM); - } - - bt->init_level++; - - /* And permanently map them */ - bus_dmamap_load(bt->sense_dmat, bt->sense_dmamap, - bt->sense_buffers, - bt->max_ccbs * sizeof(*bt->sense_buffers), - btmapsensebuffers, bt, /*flags*/0); - - bt->init_level++; - - if ((error = bt_attach(dev))) { - bt_mca_release_resources(dev); - return (error); - } - - return (0); -} - -/* - * This code should be shared with the ISA - * stubs as its exactly the same. - */ - -#define BIOS_MAP_SIZE (16 * 1024) - -static int -btvlbouncefilter(void *arg, bus_addr_t addr) -{ - struct bt_softc *bt; - - bt = (struct bt_softc *)arg; - - addr &= BUS_SPACE_MAXADDR_24BIT; - - if (addr == 0 - || (addr >= bt->bios_addr - && addr < (bt->bios_addr + BIOS_MAP_SIZE))) - return (1); - return (0); -} - -static void -btmapsensebuffers(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct bt_softc* bt; - - bt = (struct bt_softc*)arg; - bt->sense_buffers_physbase = segs->ds_addr; -} - -static device_method_t bt_mca_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, bt_mca_probe), - DEVMETHOD(device_attach, bt_mca_attach), - - { 0, 0 } -}; - -static driver_t bt_mca_driver = { - "bt", - bt_mca_methods, - sizeof(struct bt_softc), -}; - -static devclass_t bt_devclass; - -DRIVER_MODULE(bt, mca, bt_mca_driver, bt_devclass, 0, 0); diff --git a/sys/dev/disk/buslogic/btreg.h b/sys/dev/disk/buslogic/btreg.h index da7f238dfb..c2ce897741 100644 --- a/sys/dev/disk/buslogic/btreg.h +++ b/sys/dev/disk/buslogic/btreg.h @@ -3,7 +3,6 @@ * MultiMaster SCSI host adapters. Product specific probe and * attach routines can be found in: * sys/dev/buslogic/bt_isa.c BT-54X, BT-445 cards - * sys/dev/buslogic/bt_mca.c BT-64X, SDC3211B, SDC3211F * sys/dev/buslogic/bt_eisa.c BT-74X, BT-75x cards, SDC3222F * sys/dev/buslogic/bt_pci.c BT-946, BT-948, BT-956, BT-958 cards * @@ -32,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/buslogic/btreg.h,v 1.10.2.2 2001/09/03 02:45:22 peter Exp $ - * $DragonFly: src/sys/dev/disk/buslogic/btreg.h,v 1.2 2003/06/17 04:28:23 dillon Exp $ + * $DragonFly: src/sys/dev/disk/buslogic/btreg.h,v 1.3 2005/06/11 09:03:48 swildner Exp $ */ #ifndef _BTREG_H_ diff --git a/sys/dev/netif/ep/if_ep_mca.c b/sys/dev/netif/ep/if_ep_mca.c deleted file mode 100644 index fd55c3e222..0000000000 --- a/sys/dev/netif/ep/if_ep_mca.c +++ /dev/null @@ -1,166 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/ep/if_ep_mca.c,v 1.2 1999/10/27 06:25:15 mdodd Exp $ - * $DragonFly: src/sys/dev/netif/ep/Attic/if_ep_mca.c,v 1.5 2005/05/24 20:59:01 dillon Exp $ - */ - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include "if_epreg.h" -#include "if_epvar.h" - -#define EP_MCA_627C 0x627C -#define EP_MCA_627D 0x627D -#define EP_MCA_62DB 0x62db -#define EP_MCA_62F6 0x62f6 -#define EP_MCA_62F7 0x62f7 - -static struct mca_ident ep_mca_devs[] = { - { EP_MCA_627C, "3Com 3C529 Network Adapter" }, - { EP_MCA_627D, "3Com 3C529-TP Network Adapter" }, - - /* - * These are from the linux 3c509 driver. - * I have not seen the ADFs for them and have - * not tested or even seen the hardware. - * Someone with the ADFs should replace the names with - * whatever is in the AdapterName field of the ADF. - * (and fix the media setup for the cards as well.) - */ - { EP_MCA_62DB, "3Com 3c529 EtherLink III (test mode)" }, - { EP_MCA_62F6, "3Com 3c529 EtherLink III (TP or coax)" }, - { EP_MCA_62F7, "3Com 3c529 EtherLink III (TP)" }, - - { 0, NULL }, -}; - -#define EP_MCA_IOPORT_POS MCA_ADP_POS(MCA_POS2) -#define EP_MCA_IOPORT_MASK 0xfc -#define EP_MCA_IOPORT_SIZE EP_IOSIZE -#define EP_MCA_IOPORT(pos) ((((u_int32_t)pos & EP_MCA_IOPORT_MASK) \ - | 0x02) << 8) - -#define EP_MCA_IRQ_POS MCA_ADP_POS(MCA_POS3) -#define EP_MCA_IRQ_MASK 0x0f -#define EP_MCA_IRQ(pos) (pos & EP_MCA_IRQ_MASK) - -#define EP_MCA_MEDIA_POS MCA_ADP_POS(MCA_POS2) -#define EP_MCA_MEDIA_MASK 0x03 -#define EP_MCA_MEDIA(pos) (pos & EP_MCA_MEDIA_MASK) - -static int -ep_mca_probe (device_t dev) -{ - const char * desc; - u_int32_t iobase = 0; - u_int8_t irq = 0; - u_int8_t pos; - - desc = mca_match_id(mca_get_id(dev), ep_mca_devs); - if (!desc) - return (ENXIO); - device_set_desc(dev, desc); - - pos = mca_pos_read(dev, EP_MCA_IOPORT_POS); - iobase = EP_MCA_IOPORT(pos); - - pos = mca_pos_read(dev, EP_MCA_IRQ_POS); - irq = EP_MCA_IRQ(pos); - - mca_add_iospace(dev, iobase, EP_MCA_IOPORT_SIZE); - mca_add_irq(dev, irq); - - return (0); -} - -static int -ep_mca_attach (device_t dev) -{ - struct ep_softc * sc = device_get_softc(dev); - int error = 0; - - if ((error = ep_alloc(dev))) { - device_printf(dev, "ep_alloc() failed! (%d)\n", error); - goto bad; - } - sc->stat = F_ACCESS_32_BITS; - - ep_get_media(sc); - - GO_WINDOW(0); - SET_IRQ(BASE, rman_get_start(sc->irq)); - - if ((error = ep_attach(sc))) { - device_printf(dev, "ep_attach() failed! (%d)\n", error); - goto bad; - } - - if ((error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, ep_intr, - sc, &sc->ep_intrhand, NULL))) { - device_printf(dev, "bus_setup_intr() failed! (%d)\n", error); - goto bad; - } - - return (0); -bad: - ep_free(dev); - return (error); -} - -static device_method_t ep_mca_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, ep_mca_probe), - DEVMETHOD(device_attach, ep_mca_attach), - - { 0, 0 } -}; - -static driver_t ep_mca_driver = { - "ep", - ep_mca_methods, - sizeof(struct ep_softc), -}; - -static devclass_t ep_devclass; - -DRIVER_MODULE(if_ep, mca, ep_mca_driver, ep_devclass, 0, 0); diff --git a/sys/dev/serial/stli/istallion.c b/sys/dev/serial/stli/istallion.c index cc75464868..c2cb9e12b5 100644 --- a/sys/dev/serial/stli/istallion.c +++ b/sys/dev/serial/stli/istallion.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/istallion.c,v 1.36.2.2 2001/08/30 12:29:57 murray Exp $ - * $DragonFly: src/sys/dev/serial/stli/istallion.c,v 1.15 2005/06/08 08:25:50 okumoto Exp $ + * $DragonFly: src/sys/dev/serial/stli/istallion.c,v 1.16 2005/06/11 09:03:49 swildner Exp $ */ /*****************************************************************************/ @@ -102,7 +102,6 @@ #define BRD_ECHMC 22 #define BRD_ECP 23 #define BRD_ECPE 24 -#define BRD_ECPMC 25 #define BRD_ECHPCI 26 #define BRD_ECH64PCI 27 #define BRD_EASYIOPCI 28 @@ -157,7 +156,6 @@ static struct callout stli_poll_ch; */ #define BRD_ISA 0x1 #define BRD_EISA 0x2 -#define BRD_MCA 0x4 #define BRD_PCI 0x8 static unsigned char stli_stliprobed[STL_MAXBRDS]; @@ -335,13 +333,12 @@ static char *stli_brdnames[] = { /* * Hardware configuration info for ECP boards. These defines apply * to the directly accessable io ports of the ECP. There is a set of - * defines for each ECP board type, ISA, EISA and MCA. + * defines for each ECP board type, ISA and EISA. */ #define ECP_IOSIZE 4 #define ECP_MEMSIZE (128 * 1024) #define ECP_ATPAGESIZE (4 * 1024) #define ECP_EIPAGESIZE (64 * 1024) -#define ECP_MCPAGESIZE (4 * 1024) #define STL_EISAID 0x8c4e @@ -542,7 +539,6 @@ STATIC d_ioctl_t stliioctl; static stliport_t *stli_dev2port(dev_t dev); static int stli_isaprobe(struct isa_device *idp); static int stli_eisaprobe(struct isa_device *idp); -static int stli_mcaprobe(struct isa_device *idp); static int stli_brdinit(stlibrd_t *brdp); static int stli_brdattach(stlibrd_t *brdp); static int stli_initecp(stlibrd_t *brdp); @@ -596,12 +592,6 @@ static void stli_ecpeidisable(stlibrd_t *brdp); static void stli_ecpeireset(stlibrd_t *brdp); static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); -static void stli_ecpmcenable(stlibrd_t *brdp); -static void stli_ecpmcdisable(stlibrd_t *brdp); -static void stli_ecpmcreset(stlibrd_t *brdp); -static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, - int line); - static void stli_onbinit(stlibrd_t *brdp); static void stli_onbenable(stlibrd_t *brdp); static void stli_onbdisable(stlibrd_t *brdp); @@ -773,37 +763,6 @@ static int stli_eisaprobe(struct isa_device *idp) /*****************************************************************************/ -/* - * Probe for an MCA board type. Not really sure how to do this yet, - * so for now just use the supplied flag specifier as board type... - */ - -static int stli_mcaprobe(struct isa_device *idp) -{ - int btype; - -#if STLDEBUG - printf("stli_mcaprobe(idp=%x): unit=%d iobase=%x flags=%x\n", - (int) idp, idp->id_unit, idp->id_iobase, idp->id_flags); -#endif - - switch (idp->id_flags) { - case BRD_ONBOARD2: - case BRD_ONBOARD2_32: - case BRD_ONBOARDRS: - case BRD_ECHMC: - case BRD_ECPMC: - btype = idp->id_flags; - break; - default: - btype = 0; - break; - } - return(0); -} - -/*****************************************************************************/ - /* * Probe for a board. This is involved, since we need to enable the * shared memory region to see if the board is really there or not... @@ -824,26 +783,14 @@ static int stliprobe(struct isa_device *idp) /* * First up determine what bus type of board we might be dealing - * with. It is easy to separate out the ISA from the EISA and MCA - * boards, based on their IO addresses. We may not be able to tell - * the EISA and MCA apart on IO address alone... + * with. It is easy to separate out the ISA from the EISA + * boards, based on their IO addresses. */ bclass = 0; - if ((idp->id_iobase > 0) && (idp->id_iobase < 0x400)) { + if ((idp->id_iobase > 0) && (idp->id_iobase < 0x400)) bclass |= BRD_ISA; - } else { - /* ONboard2 range */ - if ((idp->id_iobase >= 0x700) && (idp->id_iobase < 0x900)) - bclass |= BRD_MCA; - /* EC-MCA ranges */ - if ((idp->id_iobase >= 0x7000) && (idp->id_iobase < 0x7400)) - bclass |= BRD_MCA; - if ((idp->id_iobase >= 0x8000) && (idp->id_iobase < 0xc000)) - bclass |= BRD_MCA; - /* EISA board range */ - if ((idp->id_iobase & ~0xf000) == 0) - bclass |= BRD_EISA; - } + else if ((idp->id_iobase & ~0xf000) == 0) + bclass |= BRD_EISA; if ((bclass == 0) || (idp->id_iobase == 0)) return(0); @@ -856,8 +803,6 @@ static int stliprobe(struct isa_device *idp) btype = stli_isaprobe(idp); if ((btype == 0) && (bclass & BRD_EISA)) btype = stli_eisaprobe(idp); - if ((btype == 0) && (bclass & BRD_MCA)) - btype = stli_mcaprobe(idp); if (btype == 0) return(0); @@ -2731,55 +2676,6 @@ static void stli_ecpeireset(stlibrd_t *brdp) /*****************************************************************************/ -/* - * The following set of functions act on ECP MCA boards. - */ - -static void stli_ecpmcenable(stlibrd_t *brdp) -{ - outb((brdp->iobase + ECP_MCCONFR), ECP_MCENABLE); -} - -/*****************************************************************************/ - -static void stli_ecpmcdisable(stlibrd_t *brdp) -{ - outb((brdp->iobase + ECP_MCCONFR), ECP_MCDISABLE); -} - -/*****************************************************************************/ - -static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) -{ - void *ptr; - unsigned char val; - - if (offset > brdp->memsize) { - printf("STALLION: shared memory pointer=%x out of range at " - "line=%d(%d), brd=%d\n", (int) offset, line, - __LINE__, brdp->brdnr); - ptr = 0; - val = 0; - } else { - ptr = (char *) brdp->vaddr + (offset % ECP_MCPAGESIZE); - val = ((unsigned char) (offset / ECP_MCPAGESIZE)) | ECP_MCENABLE; - } - outb((brdp->iobase + ECP_MCCONFR), val); - return(ptr); -} - -/*****************************************************************************/ - -static void stli_ecpmcreset(stlibrd_t *brdp) -{ - outb((brdp->iobase + ECP_MCCONFR), ECP_MCSTOP); - DELAY(10); - outb((brdp->iobase + ECP_MCCONFR), ECP_MCDISABLE); - DELAY(500); -} - -/*****************************************************************************/ - /* * The following routines act on ONboards. */ @@ -3139,18 +3035,6 @@ static int stli_initecp(stlibrd_t *brdp) brdp->reset = stli_ecpeireset; break; - case BRD_ECPMC: - brdp->memsize = ECP_MEMSIZE; - brdp->pagesize = ECP_MCPAGESIZE; - brdp->init = NULL; - brdp->enable = stli_ecpmcenable; - brdp->reenable = stli_ecpmcenable; - brdp->disable = stli_ecpmcdisable; - brdp->getmemptr = stli_ecpmcgetmemptr; - brdp->intr = stli_ecpintr; - brdp->reset = stli_ecpmcreset; - break; - default: return(EINVAL); } @@ -3476,7 +3360,6 @@ static int stli_brdinit(stlibrd_t *brdp) switch (brdp->brdtype) { case BRD_ECP: case BRD_ECPE: - case BRD_ECPMC: stli_initecp(brdp); break; case BRD_ONBOARD: diff --git a/sys/i386/Makefile b/sys/i386/Makefile index caa1d65155..72543865c4 100644 --- a/sys/i386/Makefile +++ b/sys/i386/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/i386/Makefile,v 1.8 2000/01/27 01:22:06 mckusick Exp $ -# $DragonFly: src/sys/i386/Attic/Makefile,v 1.4 2004/04/15 21:00:50 drhodus Exp $ +# $DragonFly: src/sys/i386/Attic/Makefile,v 1.5 2005/06/11 09:03:49 swildner Exp $ # @(#)Makefile 8.1 (Berkeley) 6/11/93 # Makefile for i386 links, tags file @@ -15,7 +15,7 @@ all: @echo "make links or tags only" # Directories in which to place i386 tags links -DI386= acpica apm bios conf i386 include isa +DI386= acpica apm conf i386 include isa links:: -for i in ${COMMDIR1}; do \ @@ -26,8 +26,8 @@ links:: (cd $$i && { rm -f tags; ln -s ../tags tags; }) done SI386= ${SYS}/i386/acpica/*.[ch] ${SYS}/i386/apm/*.[ch] \ - ${SYS}/i386/bios/*.[ch] ${SYS}/i386/i386/*.[ch] \ - ${SYS}/i386/include/*.[ch] ${SYS}/i386/isa/*.[ch] + ${SYS}/i386/i386/*.[ch] ${SYS}/i386/include/*.[ch] \ + ${SYS}/i386/isa/*.[ch] AI386= ${SYS}/i386/i386/*.s tags:: diff --git a/sys/i386/bios/mca_machdep.c b/sys/i386/bios/mca_machdep.c deleted file mode 100644 index 699e1eab38..0000000000 --- a/sys/i386/bios/mca_machdep.c +++ /dev/null @@ -1,159 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/bios/mca_machdep.c,v 1.4 2000/01/29 16:17:34 peter Exp $ - * $DragonFly: src/sys/i386/bios/Attic/mca_machdep.c,v 1.3 2003/08/07 21:17:20 dillon Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "mca_machdep.h" - -/* Global MCA bus flag */ -int MCA_system = 0; - -/* System Configuration Block */ -struct sys_config { - u_int16_t count; - u_int8_t model; - u_int8_t submodel; - u_int8_t bios_rev; - u_int8_t feature; -#define FEATURE_RESV 0x01 /* Reserved */ -#define FEATURE_MCABUS 0x02 /* MicroChannel Architecture */ -#define FEATURE_EBDA 0x04 /* Extended BIOS data area allocated */ -#define FEATURE_WAITEV 0x08 /* Wait for external event is supported */ -#define FEATURE_KBDINT 0x10 /* Keyboard intercept called by Int 09h */ -#define FEATURE_RTC 0x20 /* Real-time clock present */ -#define FEATURE_IC2 0x40 /* Second interrupt chip present */ -#define FEATURE_DMA3 0x80 /* DMA channel 3 used by hard disk BIOS */ - u_int8_t pad[3]; -} __attribute__ ((packed)); - -/* Function Prototypes */ -static void bios_mcabus_present (void *); -SYSINIT(mca_present, SI_SUB_CPU, SI_ORDER_ANY, bios_mcabus_present, NULL); - -/* Functions */ -static void -bios_mcabus_present(void * dummy) -{ - struct vm86frame vmf; - struct sys_config * scp; - vm_offset_t paddr; - - bzero(&vmf, sizeof(struct vm86frame)); - - vmf.vmf_ah = 0xc0; - if (vm86_intcall(0x15, &vmf)) { - if (bootverbose) { - printf("BIOS SDT: INT call failed.\n"); - } - return; - } - - if ((vmf.vmf_ah != 0) && (vmf.vmf_flags & 0x01)) { - if (bootverbose) { - printf("BIOS SDT: Not supported. Not PS/2?\n"); - printf("BIOS SDT: AH 0x%02x, Flags 0x%04x\n", - vmf.vmf_ah, vmf.vmf_flags); - } - return; - } - - paddr = vmf.vmf_es; - paddr = (paddr << 4) + vmf.vmf_bx; - scp = (struct sys_config *)BIOS_PADDRTOVADDR(paddr); - - if (bootverbose) { - printf("BIOS SDT: model 0x%02x, submodel 0x%02x, bios_rev 0x%02x\n", - scp->model, scp->submodel, scp->bios_rev); - printf("BIOS SDT: features 0x%b\n", scp->feature, - "\20" - "\01RESV" - "\02MCABUS" - "\03EBDA" - "\04WAITEV" - "\05KBDINT" - "\06RTC" - "\07IC2" - "\08DMA3\n"); - } - - MCA_system = ((scp->feature & FEATURE_MCABUS) ? 1 : 0); - - if (MCA_system) - printf("MicroChannel Architecture System detected.\n"); - - return; -} - -int -mca_bus_nmi (void) -{ - int slot; - int retval = 0; - int pos5 = 0; - - /* Disable motherboard setup */ - outb(MCA_MB_SETUP_REG, MCA_MB_SETUP_DIS); - - /* For each slot */ - for (slot = 0; slot < MCA_MAX_SLOTS; slot++) { - - /* Select the slot */ - outb(MCA_ADAP_SETUP_REG, slot | MCA_ADAP_SET); - pos5 = inb(MCA_POS_REG(MCA_POS5)); - - /* If Adapter Check is low */ - if ((pos5 & MCA_POS5_CHCK) == 0) { - retval++; - - /* If Adapter Check Status is available */ - if ((pos5 & MCA_POS5_CHCK_STAT) == 0) { - printf("MCA NMI: slot %d, POS6=0x%02x, POS7=0x%02x\n", - slot+1, - inb( MCA_POS_REG(MCA_POS6) ), - inb( MCA_POS_REG(MCA_POS7) )); - } else { - printf("MCA NMI: slot %d\n", slot+1); - } - } - /* Disable adapter setup */ - outb(MCA_ADAP_SETUP_REG, MCA_ADAP_SETUP_DIS); - } - - return (retval); -} diff --git a/sys/i386/bios/mca_machdep.h b/sys/i386/bios/mca_machdep.h deleted file mode 100644 index 271dd25887..0000000000 --- a/sys/i386/bios/mca_machdep.h +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/bios/mca_machdep.h,v 1.1 1999/09/03 02:04:28 mdodd Exp $ - * $DragonFly: src/sys/i386/bios/Attic/mca_machdep.h,v 1.2 2003/06/17 04:28:34 dillon Exp $ - */ - -extern int MCA_system; - -extern int mca_bus_nmi (void); diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index 95b9462aca..32e4c5effe 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -3,7 +3,7 @@ # as much of the source tree as it can. # # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $ -# $DragonFly: src/sys/i386/conf/Attic/LINT,v 1.53 2005/06/06 22:45:39 corecode Exp $ +# $DragonFly: src/sys/i386/conf/Attic/LINT,v 1.54 2005/06/11 09:03:49 swildner Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -1024,7 +1024,6 @@ options MSGBUF_SIZE=40960 # ISA and EISA devices: # EISA support is available for some device, so they can be auto-probed. -# MicroChannel (MCA) support is available for some devices. # # Mandatory ISA devices: isa, npx @@ -1596,21 +1595,6 @@ device xrpu # nullmodem terminal driver device nmdm -# -# MCA devices: -# -# The MCA bus device is `mca'. It provides auto-detection and -# configuration support for all devices on the MCA bus. -# -# The 'aha' device provides support for the Adaptec 1640 -# -# The 'bt' device provides support for various Buslogic/Bustek -# and Storage Dimensions SCSI adapters. -# -# The 'ep' device provides support for the 3Com 3C529 ethernet card. -# -device mca - # # EISA devices: # diff --git a/sys/i386/i386/nexus.c b/sys/i386/i386/nexus.c index 0fecbb7948..e676e5aa42 100644 --- a/sys/i386/i386/nexus.c +++ b/sys/i386/i386/nexus.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/nexus.c,v 1.26.2.10 2003/02/22 13:16:45 imp Exp $ - * $DragonFly: src/sys/i386/i386/Attic/nexus.c,v 1.15 2005/05/25 01:44:04 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/nexus.c,v 1.16 2005/06/11 09:03:49 swildner Exp $ */ /* @@ -41,8 +41,6 @@ * and I/O memory address space. */ -#include "use_mca.h" - #include #include #include @@ -259,14 +257,6 @@ nexus_attach(device_t dev) panic("nexus_attach eisa"); device_probe_and_attach(child); } -#if NMCA > 0 - if (!devclass_get_device(devclass_find("mca"), 0)) { - child = BUS_ADD_CHILD(dev, 0, "mca", 0); - if (child == NULL) - panic("nexus_probe mca"); - device_probe_and_attach(child); - } -#endif if (!devclass_get_device(devclass_find("isa"), 0)) { child = BUS_ADD_CHILD(dev, 0, "isa", 0); if (child == NULL) diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index f1c4776c9e..924016a71c 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -35,7 +35,7 @@ * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/clock.c,v 1.149.2.6 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/i386/isa/Attic/clock.c,v 1.29 2005/06/09 19:14:12 eirikn Exp $ + * $DragonFly: src/sys/i386/isa/Attic/clock.c,v 1.30 2005/06/11 09:03:49 swildner Exp $ */ /* @@ -50,7 +50,6 @@ */ #include "use_apm.h" -#include "use_mca.h" #include "opt_clock.h" #include @@ -92,10 +91,6 @@ #include -#if NMCA > 0 -#include -#endif - #ifdef APIC_IO #include /* The interrupt triggered by the 8254 (timer) chip */ @@ -197,11 +192,6 @@ clkintr(struct intrframe frame) systimer_intr(&timer1_count, &frame); } } -#if NMCA > 0 - /* Reset clock interrupt by asserting bit 7 of port 0x61 */ - if (MCA_system) - outb(0x61, inb(0x61) | 0x80); -#endif } diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c index a0aedf4e99..b2d2b10e00 100644 --- a/sys/i386/isa/intr_machdep.c +++ b/sys/i386/isa/intr_machdep.c @@ -35,7 +35,7 @@ * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 * $FreeBSD: src/sys/i386/isa/intr_machdep.c,v 1.29.2.5 2001/10/14 06:54:27 luigi Exp $ - * $DragonFly: src/sys/i386/isa/Attic/intr_machdep.c,v 1.29 2005/06/03 17:14:51 dillon Exp $ + * $DragonFly: src/sys/i386/isa/Attic/intr_machdep.c,v 1.30 2005/06/11 09:03:49 swildner Exp $ */ /* * This file contains an aggregated module marked: @@ -45,7 +45,6 @@ */ #include "use_isa.h" -#include "use_mca.h" #include "opt_auto_eoi.h" #include @@ -81,10 +80,6 @@ #endif #include -#if NMCA > 0 -#include -#endif - /* XXX should be in suitable include files */ #define ICU_IMR_OFFSET 1 /* IO_ICU{1,2} + 1 */ #define ICU_SLAVEID 2 @@ -189,10 +184,6 @@ isa_nmi(cd) int eisa_port = inb(0x461); log(LOG_CRIT, "NMI ISA %x, EISA %x\n", isa_port, eisa_port); -#if NMCA > 0 - if (MCA_system && mca_bus_nmi()) - return(0); -#endif if (isa_port & NMI_PARITY) { log(LOG_CRIT, "RAM parity error, likely hardware failure."); @@ -264,13 +255,7 @@ init_i8259(void) { /* initialize 8259's */ -#if NMCA > 0 - if (MCA_system) - outb(IO_ICU1, 0x19); /* reset; program device, four bytes */ - else -#endif - outb(IO_ICU1, 0x11); /* reset; program device, four bytes */ - + outb(IO_ICU1, 0x11); /* reset; program device, four bytes */ outb(IO_ICU1+ICU_IMR_OFFSET, NRSVIDT); /* starting at this vector index */ outb(IO_ICU1+ICU_IMR_OFFSET, IRQ_SLAVE); /* slave on line 7 */ #ifdef AUTO_EOI_1 @@ -281,14 +266,7 @@ init_i8259(void) outb(IO_ICU1+ICU_IMR_OFFSET, 0xff); /* leave interrupts masked */ outb(IO_ICU1, 0x0a); /* default to IRR on read */ outb(IO_ICU1, 0xc0 | (3 - 1)); /* pri order 3-7, 0-2 (com2 first) */ - -#if NMCA > 0 - if (MCA_system) - outb(IO_ICU2, 0x19); /* reset; program device, four bytes */ - else -#endif - outb(IO_ICU2, 0x11); /* reset; program device, four bytes */ - + outb(IO_ICU2, 0x11); /* reset; program device, four bytes */ outb(IO_ICU2+ICU_IMR_OFFSET, NRSVIDT+8); /* staring at this vector index */ outb(IO_ICU2+ICU_IMR_OFFSET, ICU_SLAVEID); /* my slave id is 7 */ #ifdef AUTO_EOI_2 diff --git a/sys/platform/pc32/Makefile b/sys/platform/pc32/Makefile index 85a5fac3f6..7545382857 100644 --- a/sys/platform/pc32/Makefile +++ b/sys/platform/pc32/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/i386/Makefile,v 1.8 2000/01/27 01:22:06 mckusick Exp $ -# $DragonFly: src/sys/platform/pc32/Makefile,v 1.4 2004/04/15 21:00:50 drhodus Exp $ +# $DragonFly: src/sys/platform/pc32/Makefile,v 1.5 2005/06/11 09:03:49 swildner Exp $ # @(#)Makefile 8.1 (Berkeley) 6/11/93 # Makefile for i386 links, tags file @@ -15,7 +15,7 @@ all: @echo "make links or tags only" # Directories in which to place i386 tags links -DI386= acpica apm bios conf i386 include isa +DI386= acpica apm conf i386 include isa links:: -for i in ${COMMDIR1}; do \ @@ -26,8 +26,8 @@ links:: (cd $$i && { rm -f tags; ln -s ../tags tags; }) done SI386= ${SYS}/i386/acpica/*.[ch] ${SYS}/i386/apm/*.[ch] \ - ${SYS}/i386/bios/*.[ch] ${SYS}/i386/i386/*.[ch] \ - ${SYS}/i386/include/*.[ch] ${SYS}/i386/isa/*.[ch] + ${SYS}/i386/i386/*.[ch] ${SYS}/i386/include/*.[ch] \ + ${SYS}/i386/isa/*.[ch] AI386= ${SYS}/i386/i386/*.s tags:: diff --git a/sys/platform/pc32/bios/mca_machdep.c b/sys/platform/pc32/bios/mca_machdep.c deleted file mode 100644 index 6cb187129d..0000000000 --- a/sys/platform/pc32/bios/mca_machdep.c +++ /dev/null @@ -1,159 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/bios/mca_machdep.c,v 1.4 2000/01/29 16:17:34 peter Exp $ - * $DragonFly: src/sys/platform/pc32/bios/Attic/mca_machdep.c,v 1.3 2003/08/07 21:17:20 dillon Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "mca_machdep.h" - -/* Global MCA bus flag */ -int MCA_system = 0; - -/* System Configuration Block */ -struct sys_config { - u_int16_t count; - u_int8_t model; - u_int8_t submodel; - u_int8_t bios_rev; - u_int8_t feature; -#define FEATURE_RESV 0x01 /* Reserved */ -#define FEATURE_MCABUS 0x02 /* MicroChannel Architecture */ -#define FEATURE_EBDA 0x04 /* Extended BIOS data area allocated */ -#define FEATURE_WAITEV 0x08 /* Wait for external event is supported */ -#define FEATURE_KBDINT 0x10 /* Keyboard intercept called by Int 09h */ -#define FEATURE_RTC 0x20 /* Real-time clock present */ -#define FEATURE_IC2 0x40 /* Second interrupt chip present */ -#define FEATURE_DMA3 0x80 /* DMA channel 3 used by hard disk BIOS */ - u_int8_t pad[3]; -} __attribute__ ((packed)); - -/* Function Prototypes */ -static void bios_mcabus_present (void *); -SYSINIT(mca_present, SI_SUB_CPU, SI_ORDER_ANY, bios_mcabus_present, NULL); - -/* Functions */ -static void -bios_mcabus_present(void * dummy) -{ - struct vm86frame vmf; - struct sys_config * scp; - vm_offset_t paddr; - - bzero(&vmf, sizeof(struct vm86frame)); - - vmf.vmf_ah = 0xc0; - if (vm86_intcall(0x15, &vmf)) { - if (bootverbose) { - printf("BIOS SDT: INT call failed.\n"); - } - return; - } - - if ((vmf.vmf_ah != 0) && (vmf.vmf_flags & 0x01)) { - if (bootverbose) { - printf("BIOS SDT: Not supported. Not PS/2?\n"); - printf("BIOS SDT: AH 0x%02x, Flags 0x%04x\n", - vmf.vmf_ah, vmf.vmf_flags); - } - return; - } - - paddr = vmf.vmf_es; - paddr = (paddr << 4) + vmf.vmf_bx; - scp = (struct sys_config *)BIOS_PADDRTOVADDR(paddr); - - if (bootverbose) { - printf("BIOS SDT: model 0x%02x, submodel 0x%02x, bios_rev 0x%02x\n", - scp->model, scp->submodel, scp->bios_rev); - printf("BIOS SDT: features 0x%b\n", scp->feature, - "\20" - "\01RESV" - "\02MCABUS" - "\03EBDA" - "\04WAITEV" - "\05KBDINT" - "\06RTC" - "\07IC2" - "\08DMA3\n"); - } - - MCA_system = ((scp->feature & FEATURE_MCABUS) ? 1 : 0); - - if (MCA_system) - printf("MicroChannel Architecture System detected.\n"); - - return; -} - -int -mca_bus_nmi (void) -{ - int slot; - int retval = 0; - int pos5 = 0; - - /* Disable motherboard setup */ - outb(MCA_MB_SETUP_REG, MCA_MB_SETUP_DIS); - - /* For each slot */ - for (slot = 0; slot < MCA_MAX_SLOTS; slot++) { - - /* Select the slot */ - outb(MCA_ADAP_SETUP_REG, slot | MCA_ADAP_SET); - pos5 = inb(MCA_POS_REG(MCA_POS5)); - - /* If Adapter Check is low */ - if ((pos5 & MCA_POS5_CHCK) == 0) { - retval++; - - /* If Adapter Check Status is available */ - if ((pos5 & MCA_POS5_CHCK_STAT) == 0) { - printf("MCA NMI: slot %d, POS6=0x%02x, POS7=0x%02x\n", - slot+1, - inb( MCA_POS_REG(MCA_POS6) ), - inb( MCA_POS_REG(MCA_POS7) )); - } else { - printf("MCA NMI: slot %d\n", slot+1); - } - } - /* Disable adapter setup */ - outb(MCA_ADAP_SETUP_REG, MCA_ADAP_SETUP_DIS); - } - - return (retval); -} diff --git a/sys/platform/pc32/bios/mca_machdep.h b/sys/platform/pc32/bios/mca_machdep.h deleted file mode 100644 index dc3d3f98a1..0000000000 --- a/sys/platform/pc32/bios/mca_machdep.h +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * Copyright (c) 1999 Matthew N. Dodd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/bios/mca_machdep.h,v 1.1 1999/09/03 02:04:28 mdodd Exp $ - * $DragonFly: src/sys/platform/pc32/bios/Attic/mca_machdep.h,v 1.2 2003/06/17 04:28:34 dillon Exp $ - */ - -extern int MCA_system; - -extern int mca_bus_nmi (void); diff --git a/sys/platform/pc32/i386/nexus.c b/sys/platform/pc32/i386/nexus.c index 71a14b82d4..7fa0bb2350 100644 --- a/sys/platform/pc32/i386/nexus.c +++ b/sys/platform/pc32/i386/nexus.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/nexus.c,v 1.26.2.10 2003/02/22 13:16:45 imp Exp $ - * $DragonFly: src/sys/platform/pc32/i386/nexus.c,v 1.15 2005/05/25 01:44:04 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/nexus.c,v 1.16 2005/06/11 09:03:49 swildner Exp $ */ /* @@ -41,8 +41,6 @@ * and I/O memory address space. */ -#include "use_mca.h" - #include #include #include @@ -259,14 +257,6 @@ nexus_attach(device_t dev) panic("nexus_attach eisa"); device_probe_and_attach(child); } -#if NMCA > 0 - if (!devclass_get_device(devclass_find("mca"), 0)) { - child = BUS_ADD_CHILD(dev, 0, "mca", 0); - if (child == NULL) - panic("nexus_probe mca"); - device_probe_and_attach(child); - } -#endif if (!devclass_get_device(devclass_find("isa"), 0)) { child = BUS_ADD_CHILD(dev, 0, "isa", 0); if (child == NULL) diff --git a/sys/platform/pc32/isa/clock.c b/sys/platform/pc32/isa/clock.c index 0ec5f6f62a..126df83b0f 100644 --- a/sys/platform/pc32/isa/clock.c +++ b/sys/platform/pc32/isa/clock.c @@ -35,7 +35,7 @@ * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/clock.c,v 1.149.2.6 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/platform/pc32/isa/clock.c,v 1.29 2005/06/09 19:14:12 eirikn Exp $ + * $DragonFly: src/sys/platform/pc32/isa/clock.c,v 1.30 2005/06/11 09:03:49 swildner Exp $ */ /* @@ -50,7 +50,6 @@ */ #include "use_apm.h" -#include "use_mca.h" #include "opt_clock.h" #include @@ -92,10 +91,6 @@ #include -#if NMCA > 0 -#include -#endif - #ifdef APIC_IO #include /* The interrupt triggered by the 8254 (timer) chip */ @@ -197,11 +192,6 @@ clkintr(struct intrframe frame) systimer_intr(&timer1_count, &frame); } } -#if NMCA > 0 - /* Reset clock interrupt by asserting bit 7 of port 0x61 */ - if (MCA_system) - outb(0x61, inb(0x61) | 0x80); -#endif } diff --git a/sys/platform/pc32/isa/intr_machdep.c b/sys/platform/pc32/isa/intr_machdep.c index dc1b6312a0..2ff5df4f3f 100644 --- a/sys/platform/pc32/isa/intr_machdep.c +++ b/sys/platform/pc32/isa/intr_machdep.c @@ -35,7 +35,7 @@ * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 * $FreeBSD: src/sys/i386/isa/intr_machdep.c,v 1.29.2.5 2001/10/14 06:54:27 luigi Exp $ - * $DragonFly: src/sys/platform/pc32/isa/intr_machdep.c,v 1.29 2005/06/03 17:14:51 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/intr_machdep.c,v 1.30 2005/06/11 09:03:49 swildner Exp $ */ /* * This file contains an aggregated module marked: @@ -45,7 +45,6 @@ */ #include "use_isa.h" -#include "use_mca.h" #include "opt_auto_eoi.h" #include @@ -81,10 +80,6 @@ #endif #include -#if NMCA > 0 -#include -#endif - /* XXX should be in suitable include files */ #define ICU_IMR_OFFSET 1 /* IO_ICU{1,2} + 1 */ #define ICU_SLAVEID 2 @@ -189,10 +184,6 @@ isa_nmi(cd) int eisa_port = inb(0x461); log(LOG_CRIT, "NMI ISA %x, EISA %x\n", isa_port, eisa_port); -#if NMCA > 0 - if (MCA_system && mca_bus_nmi()) - return(0); -#endif if (isa_port & NMI_PARITY) { log(LOG_CRIT, "RAM parity error, likely hardware failure."); @@ -264,13 +255,7 @@ init_i8259(void) { /* initialize 8259's */ -#if NMCA > 0 - if (MCA_system) - outb(IO_ICU1, 0x19); /* reset; program device, four bytes */ - else -#endif - outb(IO_ICU1, 0x11); /* reset; program device, four bytes */ - + outb(IO_ICU1, 0x11); /* reset; program device, four bytes */ outb(IO_ICU1+ICU_IMR_OFFSET, NRSVIDT); /* starting at this vector index */ outb(IO_ICU1+ICU_IMR_OFFSET, IRQ_SLAVE); /* slave on line 7 */ #ifdef AUTO_EOI_1 @@ -281,14 +266,7 @@ init_i8259(void) outb(IO_ICU1+ICU_IMR_OFFSET, 0xff); /* leave interrupts masked */ outb(IO_ICU1, 0x0a); /* default to IRR on read */ outb(IO_ICU1, 0xc0 | (3 - 1)); /* pri order 3-7, 0-2 (com2 first) */ - -#if NMCA > 0 - if (MCA_system) - outb(IO_ICU2, 0x19); /* reset; program device, four bytes */ - else -#endif - outb(IO_ICU2, 0x11); /* reset; program device, four bytes */ - + outb(IO_ICU2, 0x11); /* reset; program device, four bytes */ outb(IO_ICU2+ICU_IMR_OFFSET, NRSVIDT+8); /* staring at this vector index */ outb(IO_ICU2+ICU_IMR_OFFSET, ICU_SLAVEID); /* my slave id is 7 */ #ifdef AUTO_EOI_2 -- 2.41.0