summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/conf/files3
-rw-r--r--sys/dev/eisa/aic7770.c526
-rw-r--r--sys/dev/ic/93cx6.c179
-rw-r--r--sys/dev/ic/93cx6.h79
4 files changed, 1 insertions, 786 deletions
diff --git a/sys/conf/files b/sys/conf/files
index ecc83dbb15f..2c5ff9800f6 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $OpenBSD: files,v 1.34 1996/08/07 17:27:52 deraadt Exp $
+# $OpenBSD: files,v 1.35 1996/08/15 14:44:47 shawn Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -98,7 +98,6 @@ file ddb/db_usrreq.c ddb
file ddb/db_hangman.c ddb
file dev/audio.c audio needs-flag
file dev/ccd.c ccd needs-flag
-file dev/ic/93cx6.c aic7xxx
file dev/ic/ncr5380sbc.c ncr5380sbc
file dev/ic/pdq.c pdq
file dev/ic/pdq_ifsubr.c pdq
diff --git a/sys/dev/eisa/aic7770.c b/sys/dev/eisa/aic7770.c
deleted file mode 100644
index b7aea8278a9..00000000000
--- a/sys/dev/eisa/aic7770.c
+++ /dev/null
@@ -1,526 +0,0 @@
-/*
- * Product specific probe and attach routines for:
- * 27/284X and aic7770 motherboard SCSI controllers
- *
- * Copyright (c) 1994, 1995, 1996 Justin T. Gibbs.
- * 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 immediately at the beginning of the file, without modification,
- * 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * 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.
- *
- * $Id: aic7770.c,v 1.2 1996/06/27 21:15:45 shawn Exp $
- */
-
-#if defined(__FreeBSD__)
-#include <eisa.h>
-#endif
-#if NEISA > 0 || defined(__NetBSD__)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#if defined(__FreeBSD__)
-#include <sys/devconf.h>
-#endif
-#include <sys/kernel.h>
-
-#if defined(__NetBSD__)
-#include <sys/device.h>
-#include <machine/bus.h>
-#include <machine/intr.h>
-#endif /* defined(__NetBSD__) */
-
-#include <scsi/scsi_all.h>
-#include <scsi/scsiconf.h>
-
-#if defined(__FreeBSD__)
-
-#include <machine/clock.h>
-
-#include <i386/eisa/eisaconf.h>
-#include <i386/scsi/aic7xxx.h>
-#include <dev/aic7xxx/aic7xxx_reg.h>
-
-#define EISA_DEVICE_ID_ADAPTEC_AIC7770 0x04907770
-#define EISA_DEVICE_ID_ADAPTEC_274x 0x04907771
-#define EISA_DEVICE_ID_ADAPTEC_284xB 0x04907756 /* BIOS enabled */
-#define EISA_DEVICE_ID_ADAPTEC_284x 0x04907757 /* BIOS disabled*/
-
-#elif defined(__NetBSD__)
-
-#include <dev/eisa/eisareg.h>
-#include <dev/eisa/eisavar.h>
-#include <dev/eisa/eisadevs.h>
-
-#include <dev/ic/aic7xxxreg.h>
-#include <dev/ic/aic7xxxvar.h>
-
-#endif /* defined(__NetBSD__) */
-
-#define AHC_EISA_SLOT_OFFSET 0xc00
-#define AHC_EISA_IOSIZE 0x100
-#define INTDEF 0x5cul /* Interrupt Definition Register */
-
-#if defined(__FreeBSD__)
-
-static int aic7770probe __P((void));
-static int aic7770_attach __P((struct eisa_device *e_dev));
-
-static struct eisa_driver ahc_eisa_driver = {
- "ahc",
- aic7770probe,
- aic7770_attach,
- /*shutdown*/NULL,
- &ahc_unit
- };
-
-DATA_SET (eisadriver_set, ahc_eisa_driver);
-
-static struct kern_devconf kdc_aic7770 = {
- 0, 0, 0, /* filled in by dev_attach */
- "ahc", 0, { MDDT_EISA, 0, "bio" },
- eisa_generic_externalize, 0, 0, EISA_EXTERNALLEN,
- &kdc_eisa0, /* parent */
- 0, /* parentdata */
- DC_UNCONFIGURED, /* always start out here */
- NULL,
- DC_CLS_MISC /* host adapters aren't special */
-};
-
-
-static char *aic7770_match __P((eisa_id_t type));
-
-static char*
-aic7770_match(type)
- eisa_id_t type;
-{
- switch(type) {
- case EISA_DEVICE_ID_ADAPTEC_AIC7770:
- return ("Adaptec aic7770 SCSI host adapter");
- break;
- case EISA_DEVICE_ID_ADAPTEC_274x:
- return ("Adaptec 274X SCSI host adapter");
- break;
- case EISA_DEVICE_ID_ADAPTEC_284xB:
- case EISA_DEVICE_ID_ADAPTEC_284x:
- return ("Adaptec 284X SCSI host adapter");
- break;
- default:
- break;
- }
- return (NULL);
-}
-
-static int
-aic7770probe(void)
-{
- u_long iobase;
- char intdef;
- u_long irq;
- struct eisa_device *e_dev = NULL;
- int count;
-
- count = 0;
- while ((e_dev = eisa_match_dev(e_dev, aic7770_match))) {
- iobase = (e_dev->ioconf.slot * EISA_SLOT_SIZE)
- + AHC_EISA_SLOT_OFFSET;
- ahc_reset(iobase);
-
- eisa_add_iospace(e_dev, iobase, AHC_EISA_IOSIZE, RESVADDR_NONE);
- intdef = inb(INTDEF + iobase);
- switch (intdef & 0xf) {
- case 9:
- irq = 9;
- break;
- case 10:
- irq = 10;
- break;
- case 11:
- irq = 11;
- break;
- case 12:
- irq = 12;
- break;
- case 14:
- irq = 14;
- break;
- case 15:
- irq = 15;
- break;
- default:
- printf("aic7770 at slot %d: illegal "
- "irq setting %d\n", e_dev->ioconf.slot,
- intdef);
- continue;
- }
- eisa_add_intr(e_dev, irq);
- eisa_registerdev(e_dev, &ahc_eisa_driver, &kdc_aic7770);
- if(e_dev->id == EISA_DEVICE_ID_ADAPTEC_284xB
- || e_dev->id == EISA_DEVICE_ID_ADAPTEC_284x) {
- /* Our real parent is the isa bus. Say so. */
- e_dev->kdc->kdc_parent = &kdc_isa0;
- }
- count++;
- }
- return count;
-}
-
-#elif defined(__NetBSD__)
-
-#define bootverbose 1
-
-int ahc_eisa_match __P((struct device *, void *, void *));
-void ahc_eisa_attach __P((struct device *, struct device *, void *));
-
-
-struct cfattach ahc_eisa_ca = {
- sizeof(struct ahc_data), ahc_eisa_match, ahc_eisa_attach
-};
-
-/*
- * Return irq setting of the board, otherwise -1.
- */
-int
-ahc_eisa_irq(bc, ioh)
- bus_chipset_tag_t bc;
- bus_io_handle_t ioh;
-{
- int irq;
- u_char intdef;
-
- ahc_reset("ahc_eisa", bc, ioh);
- intdef = bus_io_read_1(bc, ioh, INTDEF);
- switch (irq = (intdef & 0xf)) {
- case 9:
- case 10:
- case 11:
- case 12:
- case 14:
- case 15:
- break;
- default:
- printf("ahc_eisa_irq: illegal irq setting %d\n", intdef);
- return -1;
- }
-
- /* Note that we are going and return (to probe) */
- return irq;
-}
-
-/*
- * Check the slots looking for a board we recognise
- * If we find one, note it's address (slot) and call
- * the actual probe routine to check it out.
- */
-int
-ahc_eisa_match(parent, match, aux)
- struct device *parent;
- void *match, *aux;
-{
- struct eisa_attach_args *ea = aux;
- bus_chipset_tag_t bc = ea->ea_bc;
- bus_io_handle_t ioh;
- int irq;
-
- /* must match one of our known ID strings */
- if (strcmp(ea->ea_idstring, "ADP7770") &&
- strcmp(ea->ea_idstring, "ADP7771") &&
- strcmp(ea->ea_idstring, "ADP7756") && /* XXX - not EISA, but VL */
- strcmp(ea->ea_idstring, "ADP7757")) /* XXX - not EISA, but VL */
- return (0);
-
- if (bus_io_map(bc, EISA_SLOT_ADDR(ea->ea_slot) + AHC_EISA_SLOT_OFFSET,
- AHC_EISA_IOSIZE, &ioh))
- return (0);
-
- irq = ahc_eisa_irq(bc, ioh);
-
- bus_io_unmap(bc, ioh, AHC_EISA_IOSIZE);
-
- return (irq >= 0);
-}
-
-#endif /* defined(__NetBSD__) */
-
-#if defined(__FreeBSD__)
-static int
-aic7770_attach(e_dev)
- struct eisa_device *e_dev;
-#elif defined(__NetBSD__)
-void
-ahc_eisa_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
-#endif
-{
- ahc_type type;
-
-#if defined(__FreeBSD__)
- struct ahc_data *ahc;
- resvaddr_t *iospace;
- int unit = e_dev->unit;
- int irq = ffs(e_dev->ioconf.irq) - 1;
-
- iospace = e_dev->ioconf.ioaddrs.lh_first;
-
- if(!iospace)
- return -1;
-
- switch(e_dev->id) {
- case EISA_DEVICE_ID_ADAPTEC_AIC7770:
- type = AHC_AIC7770;
- break;
- case EISA_DEVICE_ID_ADAPTEC_274x:
- type = AHC_274;
- break;
- case EISA_DEVICE_ID_ADAPTEC_284xB:
- case EISA_DEVICE_ID_ADAPTEC_284x:
- type = AHC_284;
- break;
- default:
- printf("aic7770_attach: Unknown device type!\n");
- return -1;
- break;
- }
-
- if(!(ahc = ahc_alloc(unit, iospace->addr, type, AHC_FNONE)))
- return -1;
-
- eisa_reg_start(e_dev);
- if(eisa_reg_iospace(e_dev, iospace)) {
- ahc_free(ahc);
- return -1;
- }
-
- /*
- * The IRQMS bit enables level sensitive interrupts. Only allow
- * IRQ sharing if it's set.
- */
- if(eisa_reg_intr(e_dev, irq, ahc_intr, (void *)ahc, &bio_imask,
- /*shared ==*/ahc->pause & IRQMS)) {
- ahc_free(ahc);
- return -1;
- }
- eisa_reg_end(e_dev);
-
-#elif defined(__NetBSD__)
-
- struct ahc_data *ahc = (void *)self;
- struct eisa_attach_args *ea = aux;
- bus_chipset_tag_t bc = ea->ea_bc;
- bus_io_handle_t ioh;
- int irq;
- eisa_chipset_tag_t ec = ea->ea_ec;
- eisa_intr_handle_t ih;
- const char *model, *intrstr;
-
- if (bus_io_map(bc, EISA_SLOT_ADDR(ea->ea_slot) + AHC_EISA_SLOT_OFFSET,
- AHC_EISA_IOSIZE, &ioh))
- panic("ahc_eisa_attach: could not map I/O addresses");
- if ((irq = ahc_eisa_irq(bc, ioh)) < 0)
- panic("ahc_eisa_attach: ahc_eisa_irq failed!");
-
- if (strcmp(ea->ea_idstring, "ADP7770") == 0) {
- model = EISA_PRODUCT_ADP7770;
- type = AHC_AIC7770;
- } else if (strcmp(ea->ea_idstring, "ADP7771") == 0) {
- model = EISA_PRODUCT_ADP7771;
- type = AHC_274;
- } else if (strcmp(ea->ea_idstring, "ADP7756") == 0) {
- model = EISA_PRODUCT_ADP7756;
- type = AHC_284;
- } else if (strcmp(ea->ea_idstring, "ADP7757") == 0) {
- model = EISA_PRODUCT_ADP7757;
- type = AHC_284;
- } else {
- panic("ahc_eisa_attach: Unknown device type %s\n",
- ea->ea_idstring);
- }
- printf(": %s\n", model);
-
- ahc_construct(ahc, bc, ioh, type, AHC_FNONE);
- if (eisa_intr_map(ec, irq, &ih)) {
- printf("%s: couldn't map interrupt (%d)\n",
- ahc->sc_dev.dv_xname, irq);
- return;
- }
-#endif /* defined(__NetBSD__) */
-
- /*
- * Tell the user what type of interrupts we're using.
- * usefull for debugging irq problems
- */
- if(bootverbose) {
- printf("%s: Using %s Interrupts\n",
- ahc_name(ahc),
- ahc->pause & IRQMS ?
- "Level Sensitive" : "Edge Triggered");
- }
-
- /*
- * Now that we know we own the resources we need, do the
- * card initialization.
- *
- * First, the aic7770 card specific setup.
- */
- switch( ahc->type ) {
- case AHC_AIC7770:
- case AHC_274:
- {
- u_char biosctrl = AHC_INB(ahc, HA_274_BIOSCTRL);
-
- /* Get the primary channel information */
- ahc->flags |= (biosctrl & CHANNEL_B_PRIMARY);
-
- if((biosctrl & BIOSMODE) == BIOSDISABLED)
- ahc->flags |= AHC_USEDEFAULTS;
- break;
- }
- case AHC_284:
- {
- /* XXX
- * All values are automagically intialized at
- * POST for these cards, so we can always rely
- * on the Scratch Ram values. However, we should
- * read the SEEPROM here (Dan has the code to do
- * it) so we can say what kind of translation the
- * BIOS is using. Printing out the geometry could
- * save a lot of users the grief of failed installs.
- */
- break;
- }
- default:
- break;
- }
-
- /*
- * See if we have a Rev E or higher aic7770. Anything below a
- * Rev E will have a R/O autoflush disable configuration bit.
- * It's still not clear exactly what is differenent about the Rev E.
- * We think it allows 8 bit entries in the QOUTFIFO to support
- * "paging" SCBs so you can have more than 4 commands active at
- * once.
- */
- {
- char *id_string;
- u_char sblkctl;
- u_char sblkctl_orig;
-
- sblkctl_orig = AHC_INB(ahc, SBLKCTL);
- sblkctl = sblkctl_orig ^ AUTOFLUSHDIS;
- AHC_OUTB(ahc, SBLKCTL, sblkctl);
- sblkctl = AHC_INB(ahc, SBLKCTL);
- if(sblkctl != sblkctl_orig)
- {
- id_string = "aic7770 >= Rev E, ";
- /*
- * Ensure autoflush is enabled
- */
- sblkctl &= ~AUTOFLUSHDIS;
- AHC_OUTB(ahc, SBLKCTL, sblkctl);
-
- /* Allow paging on this adapter */
- ahc->flags |= AHC_PAGESCBS;
- }
- else
- id_string = "aic7770 <= Rev C, ";
-
- printf("%s: %s", ahc_name(ahc), id_string);
- }
-
- /* Setup the FIFO threshold and the bus off time */
- {
- u_char hostconf = AHC_INB(ahc, HOSTCONF);
- AHC_OUTB(ahc, BUSSPD, hostconf & DFTHRSH);
- AHC_OUTB(ahc, BUSTIME, (hostconf << 2) & BOFF);
- }
-
- /*
- * Generic aic7xxx initialization.
- */
- if(ahc_init(ahc)){
-#if defined(__FreeBSD__)
- ahc_free(ahc);
- /*
- * The board's IRQ line is not yet enabled so it's safe
- * to release the irq.
- */
- eisa_release_intr(e_dev, irq, ahc_intr);
- return -1;
-#elif defined(__NetBSD__)
- ahc_free(ahc);
- return;
-#endif
- }
-
- /*
- * Enable the board's BUS drivers
- */
- AHC_OUTB(ahc, BCTL, ENABLE);
-
-#if defined(__FreeBSD__)
- /*
- * Enable our interrupt handler.
- */
- if(eisa_enable_intr(e_dev, irq)) {
- ahc_free(ahc);
- eisa_release_intr(e_dev, irq, ahc_intr);
- return -1;
- }
-
- e_dev->kdc->kdc_state = DC_BUSY; /* host adapters always busy */
-#elif defined(__NetBSD__)
- intrstr = eisa_intr_string(ec, ih);
- /*
- * The IRQMS bit enables level sensitive interrupts only allow
- * IRQ sharing if its set.
- */
- ahc->sc_ih = eisa_intr_establish(ec, ih,
- ahc->pause & IRQMS ? IST_LEVEL : IST_EDGE, IPL_BIO, ahc_intr, ahc
-#ifdef __OpenBSD__
- , ahc->sc_dev.dv_xname
-#endif
- );
- if (ahc->sc_ih == NULL) {
- printf("%s: couldn't establish interrupt",
- ahc->sc_dev.dv_xname);
- if (intrstr != NULL)
- printf(" at %s", intrstr);
- printf("\n");
- ahc_free(ahc);
- return;
- }
- if (intrstr != NULL)
- printf("%s: interrupting at %s\n", ahc->sc_dev.dv_xname,
- intrstr);
-#endif /* defined(__NetBSD__) */
-
- /* Attach sub-devices - always succeeds */
- ahc_attach(ahc);
-
-#if defined(__FreeBSD__)
- return 0;
-#endif
-}
-
-#endif /* NEISA > 0 */
diff --git a/sys/dev/ic/93cx6.c b/sys/dev/ic/93cx6.c
deleted file mode 100644
index 5327d39d746..00000000000
--- a/sys/dev/ic/93cx6.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Interface for the 93C46/26/06 serial eeprom parts.
- *
- * Copyright (c) 1995 Daniel M. Eischen
- * 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 immediately at the beginning of the file, without modification,
- * 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.
- * 3. Absolutely no warranty of function or purpose is made by the author
- * Daniel M. Eischen.
- * 4. Modifications may be freely made to this file if the above conditions
- * are met.
- *
- * $Id: 93cx6.c,v 1.2 1996/06/27 21:15:46 shawn Exp $
- */
-
-/*
- * The instruction set of the 93C46/26/06 chips are as follows:
- *
- * Start OP
- * Function Bit Code Address Data Description
- * -------------------------------------------------------------------
- * READ 1 10 A5 - A0 Reads data stored in memory,
- * starting at specified address
- * EWEN 1 00 11XXXX Write enable must preceed
- * all programming modes
- * ERASE 1 11 A5 - A0 Erase register A5A4A3A2A1A0
- * WRITE 1 01 A5 - A0 D15 - D0 Writes register
- * ERAL 1 00 10XXXX Erase all registers
- * WRAL 1 00 01XXXX D15 - D0 Writes to all registers
- * EWDS 1 00 00XXXX Disables all programming
- * instructions
- * *Note: A value of X for address is a don't care condition.
- *
- * The 93C46 has a four wire interface: clock, chip select, data in, and
- * data out. In order to perform one of the above functions, you need
- * to enable the chip select for a clock period (typically a minimum of
- * 1 usec, with the clock high and low a minimum of 750 and 250 nsec
- * respectively. While the chip select remains high, you can clock in
- * the instructions (above) starting with the start bit, followed by the
- * OP code, Address, and Data (if needed). For the READ instruction, the
- * requested 16-bit register contents is read from the data out line but
- * is preceded by an initial zero (leading 0, followed by 16-bits, MSB
- * first). The clock cycling from low to high initiates the next data
- * bit to be sent from the chip.
- *
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#if defined(__FreeBSD__)
-#include <machine/clock.h>
-#include <i386/scsi/93cx6.h>
-#elif defined(__NetBSD__)
-#include <machine/bus.h>
-#include <dev/ic/smc93cx6var.h>
-#endif
-
-/*
- * Right now, we only have to read the SEEPROM. But we make it easier to
- * add other 93Cx6 functions.
- */
-static struct seeprom_cmd {
- unsigned char len;
- unsigned char bits[3];
-} seeprom_read = {3, {1, 1, 0}};
-
-/*
- * Wait for the SEERDY to go high; about 800 ns.
- */
-#define CLOCK_PULSE(sd, rdy) \
- while ((SEEPROM_INB(sd) & rdy) == 0) { \
- ; /* Do nothing */ \
- }
-
-/*
- * Read the serial EEPROM and returns 1 if successful and 0 if
- * not successful.
- */
-int
-read_seeprom(sd, buf, start_addr, count)
- struct seeprom_descriptor *sd;
- u_int16_t *buf;
-#if defined(__FreeBSD__)
- u_int start_addr;
- int count;
-#elif defined(__NetBSD__)
- bus_io_size_t start_addr;
- bus_io_size_t count;
-#endif
-{
- int i = 0, k = 0;
- u_int16_t v;
- u_int8_t temp;
-
- /*
- * Read the requested registers of the seeprom. The loop
- * will range from 0 to count-1.
- */
- for (k = start_addr; k < count + start_addr; k++) {
- /* Send chip select for one clock cycle. */
- temp = sd->sd_MS ^ sd->sd_CS;
- SEEPROM_OUTB(sd, temp ^ sd->sd_CK);
- CLOCK_PULSE(sd, sd->sd_RDY);
-
- /*
- * Now we're ready to send the read command followed by the
- * address of the 16-bit register we want to read.
- */
- for (i = 0; i < seeprom_read.len; i++) {
- if (seeprom_read.bits[i] != 0)
- temp ^= sd->sd_DO;
- SEEPROM_OUTB(sd, temp);
- CLOCK_PULSE(sd, sd->sd_RDY);
- SEEPROM_OUTB(sd, temp ^ sd->sd_CK);
- CLOCK_PULSE(sd, sd->sd_RDY);
- if (seeprom_read.bits[i] != 0)
- temp ^= sd->sd_DO;
- }
- /* Send the 6 bit address (MSB first, LSB last). */
- for (i = 5; i >= 0; i--) {
- if ((k & (1 << i)) != 0)
- temp ^= sd->sd_DO;
- SEEPROM_OUTB(sd, temp);
- CLOCK_PULSE(sd, sd->sd_RDY);
- SEEPROM_OUTB(sd, temp ^ sd->sd_CK);
- CLOCK_PULSE(sd, sd->sd_RDY);
- if ((k & (1 << i)) != 0)
- temp ^= sd->sd_DO;
- }
-
- /*
- * Now read the 16 bit register. An initial 0 precedes the
- * register contents which begins with bit 15 (MSB) and ends
- * with bit 0 (LSB). The initial 0 will be shifted off the
- * top of our word as we let the loop run from 0 to 16.
- */
- v = 0;
- for (i = 16; i >= 0; i--) {
- SEEPROM_OUTB(sd, temp);
- CLOCK_PULSE(sd, sd->sd_RDY);
- v <<= 1;
- if (SEEPROM_INB(sd) & sd->sd_DI)
- v |= 1;
- SEEPROM_OUTB(sd, temp ^ sd->sd_CK);
- CLOCK_PULSE(sd, sd->sd_RDY);
- }
-
- buf[k - start_addr] = v;
-
- /* Reset the chip select for the next command cycle. */
- temp = sd->sd_MS;
- SEEPROM_OUTB(sd, temp);
- CLOCK_PULSE(sd, sd->sd_RDY);
- SEEPROM_OUTB(sd, temp ^ sd->sd_CK);
- CLOCK_PULSE(sd, sd->sd_RDY);
- SEEPROM_OUTB(sd, temp);
- CLOCK_PULSE(sd, sd->sd_RDY);
- }
-#if 0
- printf ("Serial EEPROM:");
- for (k = 0; k < count; k = k + 1) {
- if (((k % 8) == 0) && (k != 0))
- {
- printf ("\n ");
- }
- printf (" 0x%x", buf[k]);
- }
- printf ("\n");
-#endif
- return (1);
-}
diff --git a/sys/dev/ic/93cx6.h b/sys/dev/ic/93cx6.h
deleted file mode 100644
index 8a2015b114e..00000000000
--- a/sys/dev/ic/93cx6.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Interface to the 93C46 serial EEPROM that is used to store BIOS
- * settings for the aic7xxx based adaptec SCSI controllers. It can
- * also be used for 93C26 and 93C06 serial EEPROMS.
- *
- * Copyright (c) 1994, 1995 Justin T. Gibbs.
- * 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 immediately at the beginning of the file, without modification,
- * 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.
- * 3. Absolutely no warranty of function or purpose is made by the author
- * Justin T. Gibbs.
- * 4. Modifications may be freely made to this file if the above conditions
- * are met.
- *
- * $Id: 93cx6.h,v 1.2 1996/06/27 21:15:47 shawn Exp $
- */
-
-#include <sys/param.h>
-#if !defined(__NetBSD__)
-#include <sys/systm.h>
-#endif
-
-struct seeprom_descriptor {
-#if defined(__FreeBSD__)
- u_long sd_iobase;
-#elif defined(__NetBSD__)
- bus_chipset_tag_t sd_bc;
- bus_io_handle_t sd_ioh;
- bus_io_size_t sd_offset;
-#endif
- u_int16_t sd_MS;
- u_int16_t sd_RDY;
- u_int16_t sd_CS;
- u_int16_t sd_CK;
- u_int16_t sd_DO;
- u_int16_t sd_DI;
-};
-
-/*
- * This function will read count 16-bit words from the serial EEPROM and
- * return their value in buf. The port address of the aic7xxx serial EEPROM
- * control register is passed in as offset. The following parameters are
- * also passed in:
- *
- * CS - Chip select
- * CK - Clock
- * DO - Data out
- * DI - Data in
- * RDY - SEEPROM ready
- * MS - Memory port mode select
- *
- * A failed read attempt returns 0, and a successful read returns 1.
- */
-
-#if defined(__FreeBSD__)
-#define SEEPROM_INB(sd) inb(sd->sd_iobase)
-#define SEEPROM_OUTB(sd, value) outb(sd->sd_iobase, value)
-#elif defined(__NetBSD__)
-#define SEEPROM_INB(sd) \
- bus_io_read_1(sd->sd_bc, sd->sd_ioh, sd->sd_offset)
-#define SEEPROM_OUTB(sd, value) \
- bus_io_write_1(sd->sd_bc, sd->sd_ioh, sd->sd_offset, value)
-#endif
-
-#if defined(__FreeBSD__)
-int read_seeprom __P((struct seeprom_descriptor *sd,
- u_int16_t *buf, u_int start_addr, int count));
-#elif defined(__NetBSD__)
-int read_seeprom __P((struct seeprom_descriptor *sd,
- u_int16_t *buf, bus_io_size_t start_addr, bus_io_size_t count));
-#endif