Remove EISA support from ahc driver. The AIC-7770 chip can be on ISA,

VesaLocalBus or EISA. Internally, EISA and ISA are handled the same,
with VL being handled slightly differently. To avoid too much code
churn, retain the EISA name, despite it being used only for ISA
bus. When it is on the ISA bus, weird gymnastics are required with
EISA-space address accesses as well. Remove known models from the ahc
man page. Remove ahc_eisa module.
This commit is contained in:
Warner Losh 2017-02-16 21:57:19 +00:00
parent bcb3c3b5eb
commit a4e4cebf17
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313836
8 changed files with 15 additions and 243 deletions

View file

@ -26,12 +26,12 @@
.\"
.\" $FreeBSD$
.\"
.Dd July 13, 2008
.Dd February 15, 2017
.Dt AHC 4
.Os
.Sh NAME
.Nm ahc
.Nd Adaptec VL/EISA/PCI SCSI host adapter driver
.Nd Adaptec VL/ISA/PCI SCSI host adapter driver
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following lines in your
@ -40,9 +40,6 @@ kernel configuration file:
.Cd "device scbus"
.Cd "device ahc"
.Pp
For one or more VL/EISA cards:
.Cd "device eisa"
.Pp
For one or more PCI cards:
.Cd "device pci"
.Pp
@ -58,7 +55,6 @@ module at boot time, place the following lines in
.Xr loader.conf 5 :
.Bd -literal -offset indent
ahc_load="YES"
ahc_eisa_load="YES"
ahc_isa_load="YES"
ahc_pci_load="YES"
.Ed
@ -98,45 +94,19 @@ A value of 0x8a enables it for units 1, 3, and 7.
Per target configuration performed in the
.Tn SCSI-Select
menu, accessible at boot
in
.No non- Ns Tn EISA
models,
or through an
.Tn EISA
configuration utility for
.Tn EISA
models,
is honored by this driver.
This includes synchronous/asynchronous transfers,
maximum synchronous negotiation rate,
wide transfers,
disconnection,
the host adapter's SCSI ID,
and,
in the case of
.Tn EISA
Twin Channel controllers,
the primary channel selection.
the host adapter's SCSI ID.
For systems that store non-volatile settings in a system specific manner
rather than a serial eeprom directly connected to the aic7xxx controller,
the
.Tn BIOS
must be enabled for the driver to access this information.
This restriction applies to all
.Tn EISA
and many motherboard configurations.
.Pp
Note that I/O addresses are determined automatically by the probe routines,
but care should be taken when using a 284x
.Pq Tn VESA No local bus controller
in an
.Tn EISA
system.
The jumpers setting the I/O area for the 284x should match the
.Tn EISA
slot into which the card is inserted to prevent conflicts with other
.Tn EISA
cards.
This restriction applies to
many chip-down motherboard configurations.
.Pp
Performance and feature sets vary throughout the aic7xxx product line.
The following table provides a comparison of the different chips supported
@ -147,9 +117,9 @@ Note that wide and twin channel features, although always supported
by a particular chip, may be disabled in a particular motherboard or card
design.
.Bd -ragged -offset indent
.Bl -column "aic7895CX" "MIPSX" "EISA/VLX" "MaxSyncX" "MaxWidthX" "SCBsX" "2 3 4 5 6 7 8X"
.Bl -column "aic7895CX" "MIPSX" "PCI/64X" "MaxSyncX" "MaxWidthX" "SCBsX" "2 3 4 5 6 7 8X"
.It Em "Chip" Ta "MIPS" Ta "Bus" Ta "MaxSync" Ta "MaxWidth" Ta "SCBs" Ta "Features"
.It "aic7770" Ta "10" Ta "EISA/VL" Ta "10MHz" Ta "16Bit" Ta "4" Ta "1"
.It "aic7770" Ta "10" Ta "VL" Ta "10MHz" Ta "16Bit" Ta "4" Ta "1"
.It "aic7850" Ta "10" Ta "PCI/32" Ta "10MHz" Ta "8Bit" Ta "3" Ta ""
.It "aic7860" Ta "10" Ta "PCI/32" Ta "20MHz" Ta "8Bit" Ta "3" Ta ""
.It "aic7870" Ta "10" Ta "PCI/32" Ta "10MHz" Ta "16Bit" Ta "16" Ta ""
@ -254,9 +224,6 @@ Adaptec
.Tn 274X(T)
.It
Adaptec
.Tn 284X
.It
Adaptec
.Tn 2910
.It
Adaptec

View file

@ -698,7 +698,6 @@ dev/ahci/ahciem.c optional ahci
dev/ahci/ahci_pci.c optional ahci pci
dev/aic/aic.c optional aic
dev/aic/aic_pccard.c optional aic pccard
dev/aic7xxx/ahc_eisa.c optional ahc eisa
dev/aic7xxx/ahc_isa.c optional ahc isa
dev/aic7xxx/ahc_pci.c optional ahc pci \
compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}"

View file

@ -1,178 +0,0 @@
/*-
* FreeBSD, EISA product support functions
*
*
* Copyright (c) 1994-1998, 2000, 2001 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. 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: //depot/aic7xxx/freebsd/dev/aic7xxx/ahc_eisa.c#13 $
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <dev/aic7xxx/aic7xxx_osm.h>
#include <dev/eisa/eisaconf.h>
static int
aic7770_probe(device_t dev)
{
struct aic7770_identity *entry;
struct resource *regs;
uint32_t iobase;
bus_space_handle_t bsh;
bus_space_tag_t tag;
u_int irq;
u_int intdef;
u_int hcntrl;
int shared;
int rid;
int error;
entry = aic7770_find_device(eisa_get_id(dev));
if (entry == NULL)
return (ENXIO);
device_set_desc(dev, entry->name);
iobase = (eisa_get_slot(dev) * EISA_SLOT_SIZE) + AHC_EISA_SLOT_OFFSET;
eisa_add_iospace(dev, iobase, AHC_EISA_IOSIZE, RESVADDR_NONE);
rid = 0;
regs = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
if (regs == NULL) {
device_printf(dev, "Unable to map I/O space?!\n");
return ENOMEM;
}
tag = rman_get_bustag(regs);
bsh = rman_get_bushandle(regs);
error = 0;
/* Pause the card preseving the IRQ type */
hcntrl = bus_space_read_1(tag, bsh, HCNTRL) & IRQMS;
bus_space_write_1(tag, bsh, HCNTRL, hcntrl | PAUSE);
while ((bus_space_read_1(tag, bsh, HCNTRL) & PAUSE) == 0)
;
/* Make sure we have a valid interrupt vector */
intdef = bus_space_read_1(tag, bsh, INTDEF);
shared = (intdef & EDGE_TRIG) ? EISA_TRIGGER_EDGE : EISA_TRIGGER_LEVEL;
irq = intdef & VECTOR;
switch (irq) {
case 9:
case 10:
case 11:
case 12:
case 14:
case 15:
break;
default:
printf("aic7770 at slot %d: illegal irq setting %d\n",
eisa_get_slot(dev), intdef);
error = ENXIO;
}
if (error == 0)
eisa_add_intr(dev, irq, shared);
bus_release_resource(dev, SYS_RES_IOPORT, rid, regs);
return (error);
}
static int
aic7770_attach(device_t dev)
{
struct aic7770_identity *entry;
struct ahc_softc *ahc;
char *name;
int error;
entry = aic7770_find_device(eisa_get_id(dev));
if (entry == NULL)
return (ENXIO);
/*
* Allocate a softc for this card and
* set it up for attachment by our
* common detect routine.
*/
name = malloc(strlen(device_get_nameunit(dev)) + 1, M_DEVBUF, M_NOWAIT);
if (name == NULL)
return (ENOMEM);
strcpy(name, device_get_nameunit(dev));
ahc = ahc_alloc(dev, name);
if (ahc == NULL)
return (ENOMEM);
ahc_set_unit(ahc, device_get_unit(dev));
/* Allocate a dmatag for our SCB DMA maps */
error = aic_dma_tag_create(ahc, /*parent*/bus_get_dma_tag(dev),
/*alignment*/1, /*boundary*/0,
/*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
/*highaddr*/BUS_SPACE_MAXADDR,
/*filter*/NULL, /*filterarg*/NULL,
/*maxsize*/BUS_SPACE_MAXSIZE_32BIT,
/*nsegments*/AHC_NSEG,
/*maxsegsz*/AHC_MAXTRANSFER_SIZE,
/*flags*/0,
&ahc->parent_dmat);
if (error != 0) {
printf("ahc_eisa_attach: Could not allocate DMA tag "
"- error %d\n", error);
ahc_free(ahc);
return (ENOMEM);
}
ahc->dev_softc = dev;
error = aic7770_config(ahc, entry, /*unused ioport arg*/0);
if (error != 0) {
ahc_free(ahc);
return (error);
}
ahc_attach(ahc);
return (0);
}
static device_method_t ahc_eisa_device_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, aic7770_probe),
DEVMETHOD(device_attach, aic7770_attach),
DEVMETHOD(device_detach, ahc_detach),
{ 0, 0 }
};
static driver_t ahc_eisa_driver = {
"ahc",
ahc_eisa_device_methods,
sizeof(struct ahc_softc)
};
DRIVER_MODULE(ahc_eisa, eisa, ahc_eisa_driver, ahc_devclass, 0, 0);
MODULE_DEPEND(ahc_eisa, ahc, 1, 1, 1);
MODULE_VERSION(ahc_eisa, 1);

View file

@ -64,7 +64,7 @@ static int aic7770_suspend(struct ahc_softc *ahc);
static int aic7770_resume(struct ahc_softc *ahc);
static int aha2840_load_seeprom(struct ahc_softc *ahc);
static ahc_device_setup_t ahc_aic7770_VL_setup;
static ahc_device_setup_t ahc_aic7770_EISA_setup;
static ahc_device_setup_t ahc_aic7770_EISA_setup; /* Really just ISA */
static ahc_device_setup_t ahc_aic7770_setup;
struct aic7770_identity aic7770_ident_table[] =

View file

@ -207,7 +207,7 @@ typedef enum {
AHC_AIC7892 = 0x000c,
AHC_AIC7899 = 0x000d,
AHC_VL = 0x0100, /* Bus type VL */
AHC_EISA = 0x0200, /* Bus type EISA */
AHC_EISA = 0x0200, /* Bus type EISA/ISA */
AHC_PCI = 0x0400, /* Bus type PCI */
AHC_BUS_MASK = 0x0F00
} ahc_chip;
@ -1170,7 +1170,7 @@ struct ahc_pci_identity {
extern struct ahc_pci_identity ahc_pci_ident_table[];
extern const u_int ahc_num_pci_devs;
/***************************** VL/EISA Declarations ***************************/
/*************************** VL/EISA/ISA Declarations *************************/
struct aic7770_identity {
uint32_t full_id;
uint32_t id_mask;
@ -1197,7 +1197,7 @@ int ahc_pci_config(struct ahc_softc *,
struct ahc_pci_identity *);
int ahc_pci_test_register_access(struct ahc_softc *);
/*************************** EISA/VL Front End ********************************/
/*************************** ISA/EISA/VL Front End ****************************/
struct aic7770_identity *aic7770_find_device(uint32_t);
int aic7770_config(struct ahc_softc *ahc,
struct aic7770_identity *,

View file

@ -224,7 +224,7 @@ int ahc_pci_map_registers(struct ahc_softc *ahc);
#define ahc_pci_map_int ahc_map_int
#endif /*AIC_PCI_CONFIG*/
/******************************** VL/EISA *************************************/
/******************************** VL/EISA/ISA *********************************/
int aic7770_map_registers(struct ahc_softc *ahc, u_int port);
static __inline int aic7770_map_int(struct ahc_softc *, int);
@ -233,9 +233,9 @@ aic7770_map_int(struct ahc_softc *ahc, int irq)
{
/*
* The IRQ is unused in the FreeBSD
* implementation since the EISA and
* ISA attachments register the IRQ
* with newbus before the core is called.
* implementation since the ISA attachment
* registers the IRQ with newbus before
* the core is called.
*/
return ahc_map_int(ahc);
}

View file

@ -6,9 +6,6 @@ SYSDIR?=${.CURDIR}/../../..
.PATH: ${SYSDIR}/dev/aic7xxx
KMOD= ahc
.if ${MK_EISA} != "no"
SUBDIR+= ahc_eisa
.endif
SUBDIR+= ahc_isa ahc_pci
GENSRCS= aic7xxx_seq.h aic7xxx_reg.h

View file

@ -1,13 +0,0 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../../../dev/aic7xxx
KMOD= ahc_eisa
SRCS= ahc_eisa.c
SRCS+= device_if.h bus_if.h eisa_if.h pci_if.h
SRCS+= opt_scsi.h opt_cam.h opt_aic7xxx.h
CFLAGS+= -I${.CURDIR}/../../../../dev/aic7xxx -I..
.include <bsd.kmod.mk>