Remove aha(4) from the tree.

We tagged aha as gone in 12 a while ago. Proceed with its removal.
Data from nycbug's database shows the last sighting of this driver in
6, with the prior one in 4.x show its popularity had died prior to
4.x.

Relnotes: yes
This commit is contained in:
Warner Losh 2018-10-22 02:34:25 +00:00
parent c1cdf6a42f
commit 39c362e0b0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339565
15 changed files with 0 additions and 2730 deletions

View File

@ -29,7 +29,6 @@ MAN= aac.4 \
${_aesni.4} \
age.4 \
agp.4 \
aha.4 \
ahc.4 \
ahci.4 \
ahd.4 \

View File

@ -200,7 +200,6 @@ AdvanSys ABP980UA/3980UA
.El
.Sh SEE ALSO
.Xr adw 4 ,
.Xr aha 4 ,
.Xr ahc 4 ,
.Xr cd 4 ,
.Xr da 4 ,

View File

@ -1,122 +0,0 @@
.\"
.\" Copyright (c) 1994 Wilko Bulte
.\" 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.
.\" 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 ``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 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$
.\"
.Dd July 4, 2004
.Dt AHA 4
.Os
.Sh NAME
.Nm aha
.Nd Adaptec SCSI host adapter driver
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device scbus"
.Cd "device aha"
.Ed
.Pp
Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
aha_load="YES"
.Ed
.Pp
In
.Pa /boot/device.hints :
.Cd hint.aha.0.at="isa"
.Sh DESCRIPTION
This driver provides access to the
.Tn SCSI
bus connected to the Adaptec AHA-154x SCSI host adapters.
x is 0 for controllers without a floppy drive and 2 for controllers
that have them.
.Pp
One device hint entry for every card to be attached by the system is
required.
Specific values for the port address, IRQ, and DRQ may be specified.
If wildcard values are used, the driver will query the device for its
current settings and use those.
If the port address
is a wildcard, the driver consults an internal table of possible port address
locations and attaches to the first unattached card it finds.
The possible
port addresses for this card are 0x330, 0x334, 0x230, 0x234, 0x130, and
0x134.
.Sh HARDWARE
The
.Nm
driver supports the following SCSI host adapters:
.Pp
.Bl -bullet -compact
.It
Adaptec AHA-154xB
.It
Adaptec AHA-154xC
.It
Adaptec AHA-154xCF
.It
Adaptec AHA-154xCP
.It
DTC 3290 SCSI controller in 1542 emulation mode
.It
Tekram SCSI controllers in 154x emulation mode
.El
.Sh SEE ALSO
.Xr ahc 4 ,
.Xr aic 4 ,
.Xr cd 4 ,
.Xr da 4 ,
.Xr sa 4 ,
.Xr scsi 4
.\"
.\" .Sh DIAGNOSTICS
.\"
.Sh AUTHORS
.An -nosplit
The
.Nm
driver was ported by
.An M. Warner Losh
from the
.Nm bt
driver written by
.An Justin T. Gibbs .
.Sh BUGS
The AHA-154xA card does not support residuals on data transfers.
As a result, this card is no longer supported.
.Pp
There have been some reports that the AHA-154xB does not work well
under heavy load.
.Pp
The AHA-154xCP is a plug and play controller.
However, its resources are set using the on-board BIOS and cannot be
moved.
Failures to attached for this card are often caused when the resources
set in the BIOS conflict.

View File

@ -360,7 +360,6 @@ local SCB space serves as a cache for disconnected transactions, the
more SCB space available, the less host bus traffic consumed saving
and restoring SCB data.
.Sh SEE ALSO
.Xr aha 4 ,
.Xr ahd 4 ,
.Xr cd 4 ,
.Xr da 4 ,

View File

@ -64,7 +64,6 @@ Creative Labs SoundBlaster SCSI host adapter (ISA)
Adaptec AHA-1460, AHA-1460B, AHA-1460C, AHA-1460D (PC Card)
.El
.Sh SEE ALSO
.Xr aha 4 ,
.Xr ahc 4 ,
.Xr cd 4 ,
.Xr ch 4 ,

View File

@ -344,7 +344,6 @@ See
for details.
.Sh SEE ALSO
.Xr ada 4 ,
.Xr aha 4 ,
.Xr ahc 4 ,
.Xr ahci 4 ,
.Xr ahd 4 ,

View File

@ -1550,7 +1550,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)
#
# adv: All Narrow SCSI bus AdvanSys controllers.
# adw: Second Generation AdvanSys controllers including the ADV940UW.
# aha: Adaptec 154x/1535/1640
# ahc: Adaptec 274x/284x/2910/293x/294x/394x/3950x/3960x/398X/4944/
# 19160x/29160x, aic7770/aic78xx
# ahd: Adaptec 29320/39320 Controllers.
@ -1586,8 +1585,6 @@ hint.bt.0.port="0x330"
device adv
hint.adv.0.at="isa"
device adw
device aha
hint.aha.0.at="isa"
device aic
hint.aic.0.at="isa"
device ahc

View File

@ -767,8 +767,6 @@ dev/ae/if_ae.c optional ae pci
dev/age/if_age.c optional age pci
dev/agp/agp.c optional agp pci
dev/agp/agp_if.m optional agp pci
dev/aha/aha.c optional aha
dev/aha/aha_isa.c optional aha isa
dev/ahci/ahci.c optional ahci
dev/ahci/ahciem.c optional ahci
dev/ahci/ahci_pci.c optional ahci pci

File diff suppressed because it is too large Load Diff

View File

@ -1,365 +0,0 @@
/*
* Product specific probe and attach routines for:
* Adaptec 154x.
*/
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 1999-2003 M. Warner Losh
* 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,
* without modification, immediately at the beginning of the file.
* 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.
*
* Derived from bt isa from end, written by:
*
* Copyright (c) 1998 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, this list of conditions, and the following disclaimer,
* without modification, immediately at the beginning of the file.
* 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.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <machine/bus.h>
#include <machine/resource.h>
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/rman.h>
#include <isa/isavar.h>
#include <dev/aha/ahareg.h>
#include <cam/scsi/scsi_all.h>
static struct isa_pnp_id aha_ids[] = {
{ADP0100_PNP, "Adaptec 1540/1542 ISA SCSI"}, /* ADP0100 */
{AHA1540_PNP, "Adaptec 1540/aha-1640/aha-1535"},/* ADP1540 */
{AHA1542_PNP, "Adaptec 1542/aha-1535"}, /* ADP1542 */
{AHA1542_PNPCOMPAT, "Adaptec 1542 compatible"}, /* PNP00A0 */
{ICU0091_PNP, "Adaptec AHA-1540/1542 SCSI"}, /* ICU0091 */
{0}
};
/*
* I/O ports listed in the order enumerated by the card for certain op codes.
*/
static bus_addr_t aha_board_ports[] =
{
0x330,
0x334,
0x230,
0x234,
0x130,
0x134
};
/*
* Check if the device can be found at the port given
*/
static int
aha_isa_probe(device_t dev)
{
/*
* find unit and check we have that many defined
*/
struct aha_softc *aha = device_get_softc(dev);
int error;
u_long port_start;
int port_rid;
int drq;
int irq;
config_data_t config_data;
aha->dev = dev;
/* Check isapnp ids */
if (ISA_PNP_PROBE(device_get_parent(dev), dev, aha_ids) == ENXIO)
return (ENXIO);
port_rid = 0;
aha->port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &port_rid,
AHA_NREGS, RF_ACTIVE);
if (aha->port == NULL)
return (ENXIO);
port_start = rman_get_start(aha->port);
aha_alloc(aha);
/* See if there is really a card present */
if (aha_probe(aha) || aha_fetch_adapter_info(aha)) {
aha_free(aha);
bus_release_resource(dev, SYS_RES_IOPORT, port_rid, aha->port);
return (ENXIO);
}
/*
* Determine our IRQ, and DMA settings and
* export them to the configuration system.
*/
error = aha_cmd(aha, AOP_INQUIRE_CONFIG, NULL, /*parmlen*/0,
(uint8_t*)&config_data, sizeof(config_data), DEFAULT_CMD_TIMEOUT);
if (error != 0) {
device_printf(dev, "Could not determine IRQ or DMA "
"settings for adapter at %#jx. Failing probe\n",
(uintmax_t)port_start);
aha_free(aha);
bus_release_resource(dev, SYS_RES_IOPORT, port_rid,
aha->port);
return (ENXIO);
}
bus_release_resource(dev, SYS_RES_IOPORT, port_rid, aha->port);
aha->port = NULL;
switch (config_data.dma_chan) {
case DMA_CHAN_5:
drq = 5;
break;
case DMA_CHAN_6:
drq = 6;
break;
case DMA_CHAN_7:
drq = 7;
break;
default:
device_printf(dev, "Invalid DMA setting for adapter at %#jx.",
(uintmax_t)port_start);
return (ENXIO);
}
error = bus_set_resource(dev, SYS_RES_DRQ, 0, drq, 1);
if (error)
return error;
irq = ffs(config_data.irq) + 8;
error = bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1);
return (error);
}
/*
* Attach all the sub-devices we can find
*/
static int
aha_isa_attach(device_t dev)
{
struct aha_softc *aha = device_get_softc(dev);
int error = ENOMEM;
aha->dev = dev;
aha->portrid = 0;
aha->port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT,
&aha->portrid, AHA_NREGS, RF_ACTIVE);
if (!aha->port) {
device_printf(dev, "Unable to allocate I/O ports\n");
goto fail;
}
aha->irqrid = 0;
aha->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &aha->irqrid,
RF_ACTIVE);
if (!aha->irq) {
device_printf(dev, "Unable to allocate excluse use of irq\n");
goto fail;
}
aha->drqrid = 0;
aha->drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, &aha->drqrid,
RF_ACTIVE);
if (!aha->drq) {
device_printf(dev, "Unable to allocate drq\n");
goto fail;
}
#if 0 /* is the drq ever unset? */
if (dev->id_drq != -1)
isa_dmacascade(dev->id_drq);
#endif
isa_dmacascade(rman_get_start(aha->drq));
/* Allocate our parent dmatag */
if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev),
/* alignemnt */ 1,
/* boundary */ 0,
/* lowaddr */ BUS_SPACE_MAXADDR_24BIT,
/* highaddr */ BUS_SPACE_MAXADDR,
/* filter */ NULL,
/* filterarg */ NULL,
/* maxsize */ BUS_SPACE_MAXSIZE_24BIT,
/* nsegments */ ~0,
/* maxsegsz */ BUS_SPACE_MAXSIZE_24BIT,
/* flags */ 0,
/* lockfunc */ NULL,
/* lockarg */ NULL,
&aha->parent_dmat) != 0) {
device_printf(dev, "dma tag create failed.\n");
goto fail;
}
if (aha_init(aha)) {
device_printf(dev, "init failed\n");
goto fail;
}
/*
* The 1542A and B look the same. So we guess based on
* the firmware revision. It appears that only rev 0 is on
* the A cards.
*/
if (aha->boardid <= BOARD_1542 && aha->fw_major == 0) {
device_printf(dev, "154xA may not work\n");
aha->ccb_sg_opcode = INITIATOR_SG_CCB;
aha->ccb_ccb_opcode = INITIATOR_CCB;
}
error = aha_attach(aha);
if (error) {
device_printf(dev, "attach failed\n");
goto fail;
}
error = bus_setup_intr(dev, aha->irq, INTR_TYPE_CAM|INTR_ENTROPY|
INTR_MPSAFE, NULL, aha_intr, aha, &aha->ih);
if (error) {
device_printf(dev, "Unable to register interrupt handler\n");
aha_detach(aha);
goto fail;
}
return (0);
fail: ;
aha_free(aha);
bus_free_resource(dev, SYS_RES_IOPORT, aha->port);
bus_free_resource(dev, SYS_RES_IRQ, aha->irq);
bus_free_resource(dev, SYS_RES_DRQ, aha->drq);
return (error);
}
static int
aha_isa_detach(device_t dev)
{
struct aha_softc *aha = (struct aha_softc *)device_get_softc(dev);
int error;
error = bus_teardown_intr(dev, aha->irq, aha->ih);
if (error)
device_printf(dev, "failed to unregister interrupt handler\n");
error = aha_detach(aha);
if (error) {
device_printf(dev, "detach failed\n");
return (error);
}
aha_free(aha);
bus_free_resource(dev, SYS_RES_IOPORT, aha->port);
bus_free_resource(dev, SYS_RES_IRQ, aha->irq);
bus_free_resource(dev, SYS_RES_DRQ, aha->drq);
return (0);
}
static void
aha_isa_identify(driver_t *driver, device_t parent)
{
int i;
bus_addr_t ioport;
struct aha_softc aha;
int rid;
device_t child;
/* Attempt to find an adapter */
for (i = 0; i < nitems(aha_board_ports); i++) {
bzero(&aha, sizeof(aha));
ioport = aha_board_ports[i];
/*
* XXX Check to see if we have a hard-wired aha device at
* XXX this port, if so, skip. This should also cover the
* XXX case where we are run multiple times due to, eg,
* XXX kldload/kldunload.
*/
rid = 0;
aha.port = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid,
ioport, ioport, AHA_NREGS, RF_ACTIVE);
if (aha.port == NULL)
continue;
aha_alloc(&aha);
/* See if there is really a card present */
if (aha_probe(&aha) || aha_fetch_adapter_info(&aha))
goto not_this_one;
child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "aha", -1);
bus_set_resource(child, SYS_RES_IOPORT, 0, ioport, AHA_NREGS);
/*
* Could query the board and set IRQ/DRQ, but probe does
* that.
*/
not_this_one:
bus_release_resource(parent, SYS_RES_IOPORT, rid, aha.port);
aha_free(&aha);
}
}
static device_method_t aha_isa_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, aha_isa_probe),
DEVMETHOD(device_attach, aha_isa_attach),
DEVMETHOD(device_detach, aha_isa_detach),
DEVMETHOD(device_identify, aha_isa_identify),
{ 0, 0 }
};
static driver_t aha_isa_driver = {
"aha",
aha_isa_methods,
sizeof(struct aha_softc),
};
static devclass_t aha_devclass;
DRIVER_MODULE(aha, isa, aha_isa_driver, aha_devclass, 0, 0);
MODULE_DEPEND(aha, isa, 1, 1, 1);
ISA_PNP_INFO(aha_ids);

View File

@ -1,404 +0,0 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Generic register and struct definitions for the Adaptech 1540, 1542,
* SCSI host adapters. Product specific probe and attach
* routines can be found in:
* aha_isa.c
*
* Derived from bt.c written by:
*
* Copyright (c) 1998 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, this list of conditions, and the following disclaimer,
* without modification, immediately at the beginning of the file.
* 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.
*
* $FreeBSD$
*/
#ifndef _AHAREG_H_
#define _AHAREG_H_
#include <sys/queue.h>
#include <cam/scsi/scsi_all.h>
#define AHA_MAXTRANSFER_SIZE 0xffffff /* limited by 24bit counter */
#define AHA_NSEG 17 /* The number of dma segments
* supported. */
#define ALL_TARGETS (~0)
/*
* Control Register pp. 1-8, 1-9 (Write Only)
*/
#define CONTROL_REG 0x00
#define HARD_RESET 0x80 /* Hard Reset - return to POST state */
#define SOFT_RESET 0x40 /* Soft Reset - Clears Adapter state */
#define RESET_INTR 0x20 /* Reset/Ack Interrupt */
#define RESET_SBUS 0x10 /* Drive SCSI bus reset signal */
/*
* Status Register pp. 1-9, 1-10 (Read Only)
*/
#define STATUS_REG 0x00
#define DIAG_ACTIVE 0x80 /* Performing Internal Diags */
#define DIAG_FAIL 0x40 /* Internal Diags failed */
#define INIT_REQUIRED 0x20 /* MBOXes need initialization */
#define HA_READY 0x10 /* HA ready for new commands */
#define CMD_REG_BUSY 0x08 /* HA busy with last cmd byte */
#define DATAIN_REG_READY 0x04 /* Data-in Byte available */
#define STATUS_REG_RSVD 0x02
#define CMD_INVALID 0x01 /* Invalid Command detected */
/*
* Command/Parameter Register pp. 1-10, 1-11 (Write Only)
*/
#define COMMAND_REG 0x01
/*
* Data in Register p. 1-11 (Read Only)
*/
#define DATAIN_REG 0x01
/*
* Interrupt Status Register pp. 1-12 -> 1-14 (Read Only)
*/
#define INTSTAT_REG 0x02
#define INTR_PENDING 0x80 /* There is a pending INTR */
#define INTSTAT_REG_RSVD 0x70
#define SCSI_BUS_RESET 0x08 /* Bus Reset detected */
#define CMD_COMPLETE 0x04
#define OMB_READY 0x02 /* Outgoin Mailbox Ready */
#define IMB_LOADED 0x01 /* Incoming Mailbox loaded */
/*
* Definitions for the "undocumented" geometry register, we just need
* its location.
*/
#define GEOMETRY_REG 0x03
#define AHA_NREGS (4)
/*
* Opcodes for Adapter commands.
*/
typedef enum {
AOP_NOP = 0x00,
AOP_INITIALIZE_MBOX = 0x01,
AOP_START_MBOX = 0x02,
AOP_EXECUTE_BIOS_CMD = 0x03,
AOP_INQUIRE_BOARD_ID = 0x04,
AOP_ENABLE_OMBR_INT = 0x05,
AOP_SET_SEL_TIMOUT = 0x06,
AOP_SET_TIME_ON_BUS = 0x07,
AOP_SET_TIME_OFF_BUS = 0x08,
AOP_SET_BUS_TRANS_RATE = 0x09,
AOP_INQUIRE_INST_LDEVS = 0x0A,
AOP_INQUIRE_CONFIG = 0x0B,
AOP_ENABLE_TARGET_MODE = 0x0C,
AOP_INQUIRE_SETUP_INFO = 0x0D,
AOP_WRITE_LRAM = 0x1A,
AOP_READ_LRAM = 0x1B,
AOP_WRITE_CHIP_FIFO = 0x1C,
AOP_READ_CHIP_FIFO = 0x1D,
AOP_ECHO_DATA_BYTE = 0x1F,
AOP_ADAPTER_DIAGNOSTICS = 0x20,
AOP_SET_ADAPTER_OPTIONS = 0x21,
AOP_SET_EEPROM = 0x22,
AOP_RETURN_EEPROM = 0x23,
AOP_ENABLE_SHADOW_RAM = 0x24,
AOP_INIT_BIOS_MBOX = 0x25,
AOP_SET_BIOS_BANK_1 = 0x26,
AOP_SET_BIOS_BANK_2 = 0x27,
AOP_RETURN_EXT_BIOS_INFO= 0x28,
AOP_MBOX_IF_ENABLE = 0x29,
AOP_SCSI_TERM_STATUS = 0x2C,
AOP_INQUIRE_SCAM_DEV = 0x2D,
AOP_SCSI_DEV_TABLE = 0x2E,
AOP_SCAM_OP = 0x2F,
AOP_START_BIOS_CMD = 0x82,
AOP_INQUIRE_ESETUP_INFO = 0x8D
} aha_op_t;
/************** Definitions of Multi-byte commands and responses ************/
struct aha_extbios
{
uint8_t flags; /* Bit 3 == 1 extended bios enabled */
uint8_t mailboxlock; /* mail box lock code to unlock it */
};
typedef struct {
uint8_t num_mboxes;
uint8_t base_addr[3];
} init_24b_mbox_params_t;
typedef struct {
uint8_t board_type;
/* These values are mostly from the aha-1540CP technical reference, but */
/* with other values from the old aha1542.c driver. The values from the */
/* aha-1540CP technical manual are used where conflicts arise */
#define BOARD_1540_16HEAD_BIOS 0x00
#define BOARD_1540_64HEAD_BIOS 0x30
#define BOARD_1542 0x41 /* aha-1540/1542 w/64-h bios */
#define BOARD_1542C 0x44 /* aha-1542C */
#define BOARD_1542CF 0x45 /* aha-1542CF */
#define BOARD_1542CP 0x46 /* aha-1542CP, plug and play */
uint8_t cust_features;
#define FEATURES_STANDARD 0x30
uint8_t firmware_rev_major;
uint8_t firmware_rev_minor;
} board_id_data_t;
typedef struct {
uint8_t dma_chan;
#define DMA_CHAN_5 0x20
#define DMA_CHAN_6 0x40
#define DMA_CHAN_7 0x80
uint8_t irq;
#define IRQ_9 0x01
#define IRQ_10 0x02
#define IRQ_11 0x04
#define IRQ_12 0x08
#define IRQ_14 0x20
#define IRQ_15 0x40
uint8_t scsi_id;
} config_data_t;
typedef struct {
uint8_t offset : 4,
period : 3,
sync : 1;
} targ_syncinfo_t;
typedef struct {
uint8_t initiate_sync : 1,
parity_enable : 1,
: 6;
uint8_t bus_transfer_rate;
uint8_t time_on_bus;
uint8_t time_off_bus;
uint8_t num_mboxes;
uint8_t mbox_base_addr[3];
targ_syncinfo_t syncinfo[8];
uint8_t discinfo;
uint8_t customer_sig[20];
uint8_t auto_retry;
uint8_t board_switches;
uint8_t firmware_cksum[2];
uint8_t bios_mbox_addr[3];
} setup_data_t;
#define AHA_NUM_ISAPORTS 6
typedef struct {
uint8_t len[3];
uint8_t addr[3];
} aha_sg_t;
/********************** Mail Box definitions *******************************/
typedef enum {
AMBO_FREE = 0x0, /* MBO intry is free */
AMBO_START = 0x1, /* MBO activate entry */
AMBO_ABORT = 0x2 /* MBO abort entry */
} aha_mbo_action_code_t;
typedef struct aha_mbox_out {
uint8_t action_code;
uint8_t ccb_addr[3];
} aha_mbox_out_t;
typedef enum {
AMBI_FREE = 0x0, /* MBI entry is free */
AMBI_OK = 0x1, /* completed without error */
AMBI_ABORT = 0x2, /* aborted ccb */
AMBI_NOT_FOUND = 0x3, /* Tried to abort invalid CCB */
AMBI_ERROR = 0x4 /* Completed with error */
} aha_mbi_comp_code_t;
typedef struct aha_mbox_in {
uint8_t comp_code;
uint8_t ccb_addr[3];
} aha_mbox_in_t;
/****************** Hardware CCB definition *********************************/
typedef enum {
INITIATOR_CCB = 0x00,
INITIATOR_SG_CCB = 0x02,
INITIATOR_CCB_WRESID = 0x03,
INITIATOR_SG_CCB_WRESID = 0x04,
INITIATOR_BUS_DEV_RESET = 0x81
} aha_ccb_opcode_t;
typedef enum {
AHASTAT_NOERROR = 0x00,
AHASTAT_SELTIMEOUT = 0x11,
AHASTAT_DATARUN_ERROR = 0x12,
AHASTAT_UNEXPECTED_BUSFREE = 0x13,
AHASTAT_INVALID_PHASE = 0x14,
AHASTAT_INVALID_ACTION_CODE = 0x15,
AHASTAT_INVALID_OPCODE = 0x16,
AHASTAT_LINKED_CCB_LUN_MISMATCH = 0x17,
AHASTAT_INVALID_CCB_OR_SG_PARAM = 0x1A,
AHASTAT_HA_SCSI_BUS_RESET = 0x22, /* stolen from bt */
AHASTAT_HA_BDR = 0x25 /* Stolen from bt */
} ahastat_t;
struct aha_hccb {
uint8_t opcode; /* 0 */
uint8_t lun : 3, /* 1 */
datain : 1,
dataout : 1,
target : 3;
uint8_t cmd_len; /* 2 */
uint8_t sense_len; /* 3 */
uint8_t data_len[3]; /* 4 */
uint8_t data_addr[3]; /* 7 */
uint8_t link_ptr[3]; /* 10 */
uint8_t link_id; /* 13 */
uint8_t ahastat; /* 14 */
uint8_t sdstat; /* 15 */
uint8_t reserved1; /* 16 */
uint8_t reserved2; /* 17 */
uint8_t scsi_cdb[16]; /* 18 */
uint8_t sense_data[SSD_FULL_SIZE];
};
typedef enum {
ACCB_FREE = 0x0,
ACCB_ACTIVE = 0x1,
ACCB_DEVICE_RESET = 0x2,
ACCB_RELEASE_SIMQ = 0x4
} accb_flags_t;
struct aha_ccb {
struct aha_hccb hccb; /* hccb assumed to be at 0 */
SLIST_ENTRY(aha_ccb) links;
uint32_t flags;
union ccb *ccb;
bus_dmamap_t dmamap;
struct callout timer;
aha_sg_t *sg_list;
uint32_t sg_list_phys;
};
struct sg_map_node {
bus_dmamap_t sg_dmamap;
bus_addr_t sg_physaddr;
aha_sg_t* sg_vaddr;
SLIST_ENTRY(sg_map_node) links;
};
struct aha_softc {
struct cam_sim *sim;
struct cam_path *path;
aha_mbox_out_t *cur_outbox;
aha_mbox_in_t *cur_inbox;
aha_mbox_out_t *last_outbox;
aha_mbox_in_t *last_inbox;
struct aha_ccb *aha_ccb_array;
SLIST_HEAD(,aha_ccb) free_aha_ccbs;
LIST_HEAD(,ccb_hdr) pending_ccbs;
u_int active_ccbs;
uint32_t aha_ccb_physbase;
aha_ccb_opcode_t ccb_sg_opcode;
aha_ccb_opcode_t ccb_ccb_opcode;
aha_mbox_in_t *in_boxes;
aha_mbox_out_t *out_boxes;
struct scsi_sense_data *sense_buffers;
uint32_t sense_buffers_physbase;
struct aha_ccb *recovery_accb;
u_int num_boxes;
bus_dma_tag_t parent_dmat; /*
* All dmat's derive from
* the dmat defined by our
* bus.
*/
bus_dma_tag_t buffer_dmat; /* dmat for buffer I/O */
bus_dma_tag_t mailbox_dmat; /* dmat for our mailboxes */
bus_dmamap_t mailbox_dmamap;
bus_dma_tag_t ccb_dmat; /* dmat for our ccb array */
bus_dmamap_t ccb_dmamap;
bus_dma_tag_t sg_dmat; /* dmat for our sg maps */
SLIST_HEAD(, sg_map_node) sg_maps;
bus_addr_t mailbox_physbase;
u_int num_ccbs; /* Number of CCBs malloc'd */
u_int max_ccbs; /* Maximum allocatable CCBs */
u_int max_sg;
u_int unit;
u_int scsi_id;
uint32_t extended_trans :1,
diff_bus :1,
extended_lun :1,
strict_rr :1,
tag_capable :1,
resource_shortage:1,
:26;
uint16_t disc_permitted;
uint16_t sync_permitted;
uint8_t init_level;
volatile uint8_t command_cmp;
volatile uint8_t latched_status;
uint32_t bios_addr;
uint8_t fw_major;
uint8_t fw_minor;
char model[32];
uint8_t boardid;
struct resource *irq;
struct resource *port;
struct resource *drq;
int irqrid;
int portrid;
int drqrid;
void *ih;
device_t dev;
struct mtx lock;
};
void aha_alloc(struct aha_softc *);
int aha_attach(struct aha_softc *);
int aha_cmd(struct aha_softc *, aha_op_t, uint8_t *, u_int, uint8_t *, u_int,
u_int);
int aha_detach(struct aha_softc *);
int aha_fetch_adapter_info(struct aha_softc *);
void aha_find_probe_range(int, int *, int *);
void aha_free(struct aha_softc *);
int aha_init(struct aha_softc *);
void aha_intr(void *);
int aha_probe(struct aha_softc *);
#define DEFAULT_CMD_TIMEOUT 10000 /* 1 sec */
#define aha_inb(aha, reg) \
bus_read_1((aha)->port, reg)
#define aha_outb(aha, reg, value) \
bus_write_1((aha)->port, reg, value)
#define ADP0100_PNP 0x00019004 /* ADP0100 */
#define AHA1540_PNP 0x40159004 /* ADP1540 */
#define AHA1542_PNP 0x42159004 /* ADP1542 */
#define AHA1542_PNPCOMPAT 0xA000D040 /* PNP00A0 */
#define ICU0091_PNP 0X91005AA4 /* ICU0091 */
#endif /* _AHAREG_H_ */

View File

@ -12,7 +12,6 @@ SYS?= ${.CURDIR}/..
COMM= ${SYS}/dev/advansys/*.[ch] \
${SYS}/sys/vnode.h \
${SYS}/dev/aha/*.[ch] \
${SYS}/dev/alc/*.[ch] \
${SYS}/dev/buslogic/*.[ch] \
${SYS}/dev/dpt/*.[ch] \
@ -69,7 +68,6 @@ COMMDIR1= ${SYS}/conf \
${SYS}/sys
COMMDIR2= ${SYS}/dev/advansys \
${SYS}/dev/aha \
${SYS}/dev/alc \
${SYS}/dev/buslogic \
${SYS}/dev/dpt \

View File

@ -26,7 +26,6 @@ SUBDIR= \
${_aesni} \
age \
${_agp} \
aha \
ahci \
${_aic} \
aic7xxx \

View File

@ -1,9 +0,0 @@
# $FreeBSD$
.PATH: ${SRCTOP}/sys/dev/aha
KMOD= aha
SRCS= aha.c aha_isa.c ahareg.h opt_cam.h device_if.h bus_if.h \
isa_if.h
.include <bsd.kmod.mk>

View File

@ -119,7 +119,6 @@ nodevice snd_via8233
nodevice snd_via82c686
nodevice snd_vibes
nodevice snd_uaudio
nodevice aha
nodevice bt
nodevice ep
nodevice ex