diff --git a/share/man/man4/ida.4 b/share/man/man4/ida.4 index 52f4bf21bde4..9257496aef44 100644 --- a/share/man/man4/ida.4 +++ b/share/man/man4/ida.4 @@ -2,7 +2,7 @@ .\" Written by Tom Rhodes .\" This file is public domain .\" -.Dd August 8, 2004 +.Dd February 15, 2017 .Dt IDA 4 .Os .Sh NAME @@ -57,10 +57,6 @@ Compaq SMART-2/DH Controller Compaq SMART-2/SL Controller .It Compaq SMART-2/P Controller -.It -Compaq SMART-2/E Controller -.It -Compaq SMART Controller .El .Sh IMPLEMENTATION NOTES Extreme caution should be exercised when using the pass-through interface. diff --git a/sys/conf/files b/sys/conf/files index 2942a71c31e6..ab6a1594c2cc 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1727,7 +1727,6 @@ dev/ichsmb/ichsmb.c optional ichsmb dev/ichsmb/ichsmb_pci.c optional ichsmb pci dev/ida/ida.c optional ida dev/ida/ida_disk.c optional ida -dev/ida/ida_eisa.c optional ida eisa dev/ida/ida_pci.c optional ida pci dev/iicbus/ad7418.c optional ad7418 dev/iicbus/ds1307.c optional ds1307 diff --git a/sys/dev/ida/ida_eisa.c b/sys/dev/ida/ida_eisa.c deleted file mode 100644 index aa5086353454..000000000000 --- a/sys/dev/ida/ida_eisa.c +++ /dev/null @@ -1,345 +0,0 @@ -/*- - * Copyright (c) 2000 Jonathan Lemon - * Copyright (c) 1999 by 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, - * 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 -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include - -#include -#include - -#include - -#define IDA_EISA_IOPORT_START 0x0c88 -#define IDA_EISA_IOPORT_LEN 0x0017 - -#define IDA_EISA_IRQ_REG 0x0cc0 -#define IDA_EISA_IRQ_MASK 0xf0 -#define IDA_EISA_IRQ_15 0x80 -#define IDA_EISA_IRQ_14 0x40 -#define IDA_EISA_IRQ_11 0x10 -#define IDA_EISA_IRQ_10 0x20 - -static int -ida_v1_fifo_full(struct ida_softc *ida) -{ - u_int8_t status; - - status = ida_inb(ida, R_EISA_SYSTEM_DOORBELL); - return ((status & EISA_CHANNEL_CLEAR) == 0); -} - -static void -ida_v1_submit(struct ida_softc *ida, struct ida_qcb *qcb) -{ - u_int16_t size; - - /* - * On these cards, this location is actually for control flags. - * Set them to zero and pass in structure size via an I/O port. - */ - size = qcb->hwqcb->hdr.size << 2; - qcb->hwqcb->hdr.size = 0; - - ida_outb(ida, R_EISA_SYSTEM_DOORBELL, EISA_CHANNEL_CLEAR); - ida_outl(ida, R_EISA_LIST_ADDR, qcb->hwqcb_busaddr); - ida_outw(ida, R_EISA_LIST_LEN, size); - ida_outb(ida, R_EISA_LOCAL_DOORBELL, EISA_CHANNEL_BUSY); -} - -static bus_addr_t -ida_v1_done(struct ida_softc *ida) -{ - struct ida_hardware_qcb *hwqcb; - bus_addr_t completed; - u_int8_t status; - - if ((ida_inb(ida, R_EISA_SYSTEM_DOORBELL) & EISA_CHANNEL_BUSY) == 0) - return (0); - - ida_outb(ida, R_EISA_SYSTEM_DOORBELL, EISA_CHANNEL_BUSY); - completed = ida_inl(ida, R_EISA_COMPLETE_ADDR); - status = ida_inb(ida, R_EISA_LIST_STATUS); - ida_outb(ida, R_EISA_LOCAL_DOORBELL, EISA_CHANNEL_CLEAR); - - if (completed != 0) { - hwqcb = (struct ida_hardware_qcb *) - ((bus_addr_t)ida->hwqcbs + - ((completed & ~3) - ida->hwqcb_busaddr)); - hwqcb->req.error = status; - } - - return (completed); -} - -static int -ida_v1_int_pending(struct ida_softc *ida) -{ - return (ida_inb(ida, R_EISA_SYSTEM_DOORBELL) & EISA_CHANNEL_BUSY); -} - -static void -ida_v1_int_enable(struct ida_softc *ida, int enable) -{ - if (enable) { - ida_outb(ida, R_EISA_SYSTEM_DOORBELL, ~EISA_CHANNEL_CLEAR); - ida_outb(ida, R_EISA_LOCAL_DOORBELL, EISA_CHANNEL_BUSY); - ida_outb(ida, R_EISA_INT_MASK, INT_ENABLE); - ida_outb(ida, R_EISA_SYSTEM_MASK, INT_ENABLE); - ida->flags |= IDA_INTERRUPTS; - } else { - ida_outb(ida, R_EISA_SYSTEM_MASK, INT_DISABLE); - ida->flags &= ~IDA_INTERRUPTS; - } -} - -static int -ida_v2_fifo_full(struct ida_softc *ida) -{ - return (ida_inl(ida, R_CMD_FIFO) == 0); -} - -static void -ida_v2_submit(struct ida_softc *ida, struct ida_qcb *qcb) -{ - ida_outl(ida, R_CMD_FIFO, qcb->hwqcb_busaddr); -} - -static bus_addr_t -ida_v2_done(struct ida_softc *ida) -{ - return (ida_inl(ida, R_DONE_FIFO)); -} - -static int -ida_v2_int_pending(struct ida_softc *ida) -{ - return (ida_inl(ida, R_INT_PENDING)); -} - -static void -ida_v2_int_enable(struct ida_softc *ida, int enable) -{ - if (enable) - ida->flags |= IDA_INTERRUPTS; - else - ida->flags &= ~IDA_INTERRUPTS; - ida_outl(ida, R_INT_MASK, enable ? INT_ENABLE : INT_DISABLE); -} - -static struct ida_access ida_v1_access = { - ida_v1_fifo_full, - ida_v1_submit, - ida_v1_done, - ida_v1_int_pending, - ida_v1_int_enable, -}; - -static struct ida_access ida_v2_access = { - ida_v2_fifo_full, - ida_v2_submit, - ida_v2_done, - ida_v2_int_pending, - ida_v2_int_enable, -}; - -static struct ida_board board_id[] = { - { 0x0e114001, "Compaq IDA controller", - &ida_v1_access, 0 }, - { 0x0e114002, "Compaq IDA-2 controller", - &ida_v1_access, 0 }, - { 0x0e114010, "Compaq IAES controller", - &ida_v1_access, 0 }, - { 0x0e114020, "Compaq SMART array controller", - &ida_v1_access, 0 }, - { 0x0e114030, "Compaq SMART-2/E array controller", - &ida_v2_access, 0 }, - - { 0, "", 0, 0 } -}; - -static struct ida_board *ida_eisa_match(eisa_id_t); -static int ida_eisa_probe(device_t); -static int ida_eisa_attach(device_t); - -static device_method_t ida_eisa_methods[] = { - DEVMETHOD(device_probe, ida_eisa_probe), - DEVMETHOD(device_attach, ida_eisa_attach), - DEVMETHOD(device_detach, ida_detach), - - { 0, 0 } -}; - -static driver_t ida_eisa_driver = { - "ida", - ida_eisa_methods, - sizeof(struct ida_softc) -}; - -static devclass_t ida_devclass; - -static struct ida_board * -ida_eisa_match(eisa_id_t id) -{ - int i; - - for (i = 0; board_id[i].board; i++) - if (board_id[i].board == id) - return (&board_id[i]); - return (NULL); -} - -static int -ida_eisa_probe(device_t dev) -{ - struct ida_board *board; - u_int32_t io_base; - u_int irq = 0; - - board = ida_eisa_match(eisa_get_id(dev)); - if (board == NULL) - return (ENXIO); - device_set_desc(dev, board->desc); - - io_base = (eisa_get_slot(dev) * EISA_SLOT_SIZE); - - switch (IDA_EISA_IRQ_MASK & (inb(IDA_EISA_IRQ_REG + io_base))) { - case IDA_EISA_IRQ_15: - irq = 15; - break; - case IDA_EISA_IRQ_14: - irq = 14; - break; - case IDA_EISA_IRQ_11: - irq = 11; - break; - case IDA_EISA_IRQ_10: - irq = 10; - break; - default: - device_printf(dev, "slot %d, illegal irq setting.\n", - eisa_get_slot(dev)); - return (ENXIO); - } - - eisa_add_iospace(dev, (io_base + IDA_EISA_IOPORT_START), - IDA_EISA_IOPORT_LEN, RESVADDR_NONE); - - eisa_add_intr(dev, irq, EISA_TRIGGER_LEVEL); /* XXX ??? */ - - return (0); -} - -static int -ida_eisa_attach(device_t dev) -{ - struct ida_softc *ida; - struct ida_board *board; - int error; - int rid; - - ida = device_get_softc(dev); - ida->dev = dev; - - board = ida_eisa_match(eisa_get_id(dev)); - ida->cmd = *board->accessor; - ida->flags = board->flags; - mtx_init(&ida->lock, "ida", NULL, MTX_DEF); - callout_init_mtx(&ida->ch, &ida->lock, 0); - - ida->regs_res_type = SYS_RES_IOPORT; - ida->regs_res_id = 0; - ida->regs = bus_alloc_resource_any(dev, ida->regs_res_type, - &ida->regs_res_id, RF_ACTIVE); - if (ida->regs == NULL) { - device_printf(dev, "can't allocate register resources\n"); - return (ENOMEM); - } - - error = bus_dma_tag_create( - /* 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 */ BUS_SPACE_UNRESTRICTED, - /* maxsegsize */ BUS_SPACE_MAXSIZE_32BIT, - /* flags */ BUS_DMA_ALLOCNOW, - /* lockfunc */ NULL, - /* lockarg */ NULL, - &ida->parent_dmat); - - if (error != 0) { - device_printf(dev, "can't allocate DMA tag\n"); - ida_free(ida); - return (ENOMEM); - } - - rid = 0; - ida->irq_res_type = SYS_RES_IRQ; - ida->irq = bus_alloc_resource_any(dev, ida->irq_res_type, &rid, - RF_ACTIVE | RF_SHAREABLE); - if (ida->irq == NULL) { - ida_free(ida); - return (ENOMEM); - } - - error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE, - NULL, ida_intr, ida, &ida->ih); - if (error) { - device_printf(dev, "can't setup interrupt\n"); - ida_free(ida); - return (ENOMEM); - } - - error = ida_setup(ida); - if (error) { - ida_free(ida); - return (error); - } - - return (0); -} - -DRIVER_MODULE(ida, eisa, ida_eisa_driver, ida_devclass, 0, 0); diff --git a/sys/dev/ida/idareg.h b/sys/dev/ida/idareg.h index 7fb48d45063b..3b74f0bfcacd 100644 --- a/sys/dev/ida/idareg.h +++ b/sys/dev/ida/idareg.h @@ -30,23 +30,6 @@ * #defines and software structures for the Compaq RAID card */ -/* - * defines for older EISA controllers (IDA, IDA-2, IAES, SMART) - */ -#define R_EISA_INT_MASK 0x01 -#define R_EISA_LOCAL_MASK 0x04 -#define R_EISA_LOCAL_DOORBELL 0x05 -#define R_EISA_SYSTEM_MASK 0x06 -#define R_EISA_SYSTEM_DOORBELL 0x07 -#define R_EISA_LIST_ADDR 0x08 -#define R_EISA_LIST_LEN 0x0c -#define R_EISA_TAG 0x0f -#define R_EISA_COMPLETE_ADDR 0x10 -#define R_EISA_LIST_STATUS 0x16 - -#define EISA_CHANNEL_BUSY 0x01 -#define EISA_CHANNEL_CLEAR 0x02 - /* * board register offsets for SMART-2 controllers */