From e4c2ac866ad6fee9140fe07d5f4ca91d836cb07d Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Mon, 5 Aug 2013 13:48:18 +0200 Subject: [PATCH] rp(4): Remove ISA attachment and some dead code, too. --- share/man/man4/isa.4 | 2 - share/man/man4/rp.4 | 1 - sys/conf/files | 1 - sys/config/LINT | 28 +-- sys/config/LINT64 | 28 +-- sys/dev/serial/rp/rp.c | 27 -- sys/dev/serial/rp/rp_isa.c | 490 ------------------------------------- sys/dev/serial/rp/rp_pci.c | 45 ---- sys/dev/serial/rp/rpreg.h | 6 - sys/dev/serial/rp/rpvar.h | 5 - 10 files changed, 2 insertions(+), 631 deletions(-) delete mode 100644 sys/dev/serial/rp/rp_isa.c diff --git a/share/man/man4/isa.4 b/share/man/man4/isa.4 index df85586bac..dcc594309e 100644 --- a/share/man/man4/isa.4 +++ b/share/man/man4/isa.4 @@ -76,8 +76,6 @@ Generic ATA/ATAPI disk controller driver DigiBoard intelligent serial cards driver .It Xr lpt 4 Generic printer device driver -.It Xr rp 4 -Comtrol RocketPort serial card driver .It Xr si 4 Specialix International SI/XIO or SX serial card driver .It Xr sio 4 diff --git a/share/man/man4/rp.4 b/share/man/man4/rp.4 index dc9323bccd..30fcc4d4b3 100644 --- a/share/man/man4/rp.4 +++ b/share/man/man4/rp.4 @@ -10,7 +10,6 @@ .Nd "driver for Comtrol RocketPort Intelligent Serial Port Cards" .Sh SYNOPSIS .Cd "device rp" -.Cd "device rp0 at isa? port 0x180" .Sh DESCRIPTION This driver provides a kernel device driver for the .Tn RocketPort diff --git a/sys/conf/files b/sys/conf/files index 73bf611423..fd561b2fdd 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -695,7 +695,6 @@ dev/disk/vpo/vpo.c optional vpo dev/disk/vpo/vpoio.c optional vpo dev/crypto/rndtest/rndtest.c optional rndtest dev/serial/rp/rp.c optional nrp -dev/serial/rp/rp_isa.c optional nrp isa dev/serial/rp/rp_pci.c optional nrp pci dev/crypto/safe/safe.c optional safe dev/netif/sbsh/if_sbsh.c optional sbsh diff --git a/sys/config/LINT b/sys/config/LINT index afa61126b2..6d2882ffb9 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -1424,7 +1424,7 @@ device "snd_uaudio" # cy: Cyclades serial driver # ecc: ECC memory controller # joy: joystick -# nrp: Comtrol Rocketport(ISA) - single card +# nrp: Comtrol Rocketport # si: Specialix SI/XIO 4-32 port terminal multiplexor # spic: Sony Programmable I/O controller (VAIO notebooks) # stl: Stallion EasyIO and EasyConnection 8/32 (PCI), EasyConnection 8/64 PCI @@ -1437,32 +1437,6 @@ device "snd_uaudio" # If apm is omitted, some systems require sysctl -w kern.timecounter.method=1 # for correct timekeeping. -# Notes on the Comtrol Rocketport driver: -# -# The exact values used for nrp0 depend on how many boards you have -# in the system. The manufacturer's sample configs are listed as: -# -# Comtrol Rocketport ISA single card -# device nrp0 at isa? port 0x280 -# -# If instead you have two ISA cards, one installed at 0x100 and the -# second installed at 0x180, then you should add the following to -# your kernel configuration file: -# -# device nrp0 at isa? port 0x100 -# device nrp1 at isa? port 0x180 -# -# For 4 ISA cards, it might be something like this: -# -# device nrp0 at isa? port 0x180 -# device nrp1 at isa? port 0x100 -# device nrp2 at isa? port 0x340 -# device nrp3 at isa? port 0x240 -# -# And for PCI cards, you only need say: -# -# device nrp - # Notes on the Specialix SI/XIO driver: # **This is NOT a Specialix supported Driver!** # The host card is memory, not IO mapped. diff --git a/sys/config/LINT64 b/sys/config/LINT64 index 77c661394c..7e9bb54c2d 100644 --- a/sys/config/LINT64 +++ b/sys/config/LINT64 @@ -1287,37 +1287,11 @@ device "snd_uaudio" # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board # ecc: ECC memory controller # joy: joystick -# nrp: Comtrol Rocketport(ISA) - single card +# nrp: Comtrol Rocketport # si: Specialix SI/XIO 4-32 port terminal multiplexor # nmdm: nullmodem terminal driver (see nmdm(4)) # tpm: Trusted Platform Module -# Notes on the Comtrol Rocketport driver: -# -# The exact values used for nrp0 depend on how many boards you have -# in the system. The manufacturer's sample configs are listed as: -# -# Comtrol Rocketport ISA single card -# device nrp0 at isa? port 0x280 -# -# If instead you have two ISA cards, one installed at 0x100 and the -# second installed at 0x180, then you should add the following to -# your kernel configuration file: -# -# device nrp0 at isa? port 0x100 -# device nrp1 at isa? port 0x180 -# -# For 4 ISA cards, it might be something like this: -# -# device nrp0 at isa? port 0x180 -# device nrp1 at isa? port 0x100 -# device nrp2 at isa? port 0x340 -# device nrp3 at isa? port 0x240 -# -# And for PCI cards, you only need say: -# -# device nrp - # Notes on the Specialix SI/XIO driver: # **This is NOT a Specialix supported Driver!** # The host card is memory, not IO mapped. diff --git a/sys/dev/serial/rp/rp.c b/sys/dev/serial/rp/rp.c index eb474c1a21..b3a23ef94f 100644 --- a/sys/dev/serial/rp/rp.c +++ b/sys/dev/serial/rp/rp.c @@ -52,7 +52,6 @@ #include #include -#define ROCKET_C #include "rpreg.h" #include "rpvar.h" @@ -97,14 +96,6 @@ static Byte_t RRegData[RREGDATASIZE]= 0x22, 0x09, 0x0a, 0x0a /* 30: Rx FIFO Enable */ }; -#if 0 -/* IRQ number to MUDBAC register 2 mapping */ -Byte_t sIRQMap[16] = -{ - 0,0,0,0x10,0x20,0x30,0,0,0,0x40,0x50,0x60,0x70,0,0,0x80 -}; -#endif - Byte_t rp_sBitMapClrTbl[8] = { 0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f @@ -115,21 +106,6 @@ Byte_t rp_sBitMapSetTbl[8] = 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 }; -/* Actually not used */ -#if 0 /* notdef */ -struct termios deftermios = { - TTYDEF_IFLAG, - TTYDEF_OFLAG, - TTYDEF_CFLAG, - TTYDEF_LFLAG, - { CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, - _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT, - CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE }, - TTYDEF_SPEED, - TTYDEF_SPEED -}; -#endif - /*************************************************************************** Function: sReadAiopID Purpose: Read the AIOP idenfication number directly from an AIOP. @@ -906,9 +882,6 @@ rp_attachcommon(CONTROLLER_T *ctlp, int num_aiops, int num_ports) rp->rp_intmask = RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR; -#if 0 /* notdef */ - ChanStatus = sGetChanStatus(&rp->rp_channel); -#endif /* notdef */ if(sInitChan(ctlp, &rp->rp_channel, aiop, chan) == 0) { device_printf(ctlp->dev, "RocketPort sInitChan(%d, %d, %d) failed.\n", unit, aiop, chan); diff --git a/sys/dev/serial/rp/rp_isa.c b/sys/dev/serial/rp/rp_isa.c deleted file mode 100644 index 2160263098..0000000000 --- a/sys/dev/serial/rp/rp_isa.c +++ /dev/null @@ -1,490 +0,0 @@ -/* - * Copyright (c) Comtrol Corporation - * All rights reserved. - * - * ISA-specific part separated from: - * sys/i386/isa/rp.c,v 1.33 1999/09/28 11:45:27 phk Exp - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted prodived that the follwoing conditions - * are met. - * 1. Redistributions of source code must retain the above copyright - * notive, this list of conditions and the following disclainer. - * 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 prodided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Comtrol Corporation. - * 4. The name of Comtrol Corporation may not be used to endorse or - * promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY COMTROL CORPORATION ``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 COMTROL CORPORATION 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, LIFE 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/rp/rp_isa.c,v 1.3.2.1 2002/06/18 03:11:46 obrien Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define ROCKET_C -#include "rpreg.h" -#include "rpvar.h" - -#include - -/* ISA-specific part of CONTROLLER_t */ -struct ISACONTROLLER_T { - int MBaseIO; /* rid of the Mudbac controller for this controller */ - int MReg0IO; /* offset0 of the Mudbac controller for this controller */ - int MReg1IO; /* offset1 of the Mudbac controller for this controller */ - int MReg2IO; /* offset2 of the Mudbac controller for this controller */ - int MReg3IO; /* offset3 of the Mudbac controller for this controller */ - Byte_t MReg2; - Byte_t MReg3; -}; -typedef struct ISACONTROLLER_T ISACONTROLLER_t; - -#define ISACTL(ctlp) ((ISACONTROLLER_t *)((ctlp)->bus_ctlp)) - -/*************************************************************************** -Function: sControllerEOI -Purpose: Strobe the MUDBAC's End Of Interrupt bit. -Call: sControllerEOI(MudbacCtlP,CtlP) - CONTROLLER_T *MudbacCtlP; Ptr to Mudbac controller structure - CONTROLLER_T *CtlP; Ptr to controller structure -*/ -#define sControllerEOI(MudbacCtlP,CtlP) \ - rp_writeio1(MudbacCtlP,ISACTL(CtlP)->MBaseIO,ISACTL(CtlP)->MReg2IO,ISACTL(CtlP)->MReg2 | INT_STROB) - -/*************************************************************************** -Function: sDisAiop -Purpose: Disable I/O access to an AIOP -Call: sDisAiop(MudbacCtlP,CtlP) - CONTROLLER_T *MudbacCtlP; Ptr to Mudbac controller structure - CONTROLLER_T *CtlP; Ptr to controller structure - int AiopNum; Number of AIOP on controller -*/ -#define sDisAiop(MudbacCtlP,CtlP,AIOPNUM) \ -{ \ - ISACTL(CtlP)->MReg3 &= rp_sBitMapClrTbl[AIOPNUM]; \ - rp_writeio1(MudbacCtlP,ISACTL(CtlP)->MBaseIO,ISACTL(CtlP)->MReg3IO,ISACTL(CtlP)->MReg3); \ -} - -/*************************************************************************** -Function: sEnAiop -Purpose: Enable I/O access to an AIOP -Call: sEnAiop(MudbacCtlP,CtlP) - CONTROLLER_T *MudbacCtlP; Ptr to Mudbac controller structure - CONTROLLER_T *CtlP; Ptr to controller structure - int AiopNum; Number of AIOP on controller -*/ -#define sEnAiop(MudbacCtlP,CtlP,AIOPNUM) \ -{ \ - ISACTL(CtlP)->MReg3 |= rp_sBitMapSetTbl[AIOPNUM]; \ - rp_writeio1(MudbacCtlP,ISACTL(CtlP)->MBaseIO,ISACTL(CtlP)->MReg3IO,ISACTL(CtlP)->MReg3); \ -} - -/*************************************************************************** -Function: sGetControllerIntStatus -Purpose: Get the controller interrupt status -Call: sGetControllerIntStatus(MudbacCtlP,CtlP) - CONTROLLER_T *MudbacCtlP; Ptr to Mudbac controller structure - CONTROLLER_T *CtlP; Ptr to controller structure -Return: Byte_t: The controller interrupt status in the lower 4 - bits. Bits 0 through 3 represent AIOP's 0 - through 3 respectively. If a bit is set that - AIOP is interrupting. Bits 4 through 7 will - always be cleared. -*/ -#define sGetControllerIntStatus(MudbacCtlP,CtlP) \ - (rp_readio1(MudbacCtlP,ISACTL(CtlP)->MBaseIO,ISACTL(CtlP)->MReg1IO) & 0x0f) - -static devclass_t rp_devclass; -static CONTROLLER_t *rp_controller; -static int rp_nisadevs; - -static int rp_probe(device_t dev); -static int rp_attach(device_t dev); -static void rp_isareleaseresource(CONTROLLER_t *ctlp); -static int sInitController(CONTROLLER_T *CtlP, - CONTROLLER_T *MudbacCtlP, - int AiopNum, - int IRQNum, - Byte_t Frequency, - int PeriodicOnly); -static rp_aiop2rid_t rp_isa_aiop2rid; -static rp_aiop2off_t rp_isa_aiop2off; -static rp_ctlmask_t rp_isa_ctlmask; - -static int -rp_probe(device_t dev) -{ - int unit; - CONTROLLER_t *controller; - int num_aiops; - CONTROLLER_t *ctlp; - int retval; - - /* - * We have no PnP RocketPort cards. - * (At least according to LINT) - */ - if (isa_get_logicalid(dev) != 0) - return (ENXIO); - - /* We need IO port resource to configure an ISA device. */ - if (bus_get_resource_count(dev, SYS_RES_IOPORT, 0) == 0) - return (ENXIO); - - unit = device_get_unit(dev); - if (unit >= 4) { - device_printf(dev, "rpprobe: unit number %d invalid.\n", unit); - return (ENXIO); - } - device_printf(dev, "probing for RocketPort(ISA) unit %d.\n", unit); - - ctlp = device_get_softc(dev); - bzero(ctlp, sizeof(*ctlp)); - ctlp->dev = dev; - ctlp->aiop2rid = rp_isa_aiop2rid; - ctlp->aiop2off = rp_isa_aiop2off; - ctlp->ctlmask = rp_isa_ctlmask; - - /* The IO ports of AIOPs for an ISA controller are discrete. */ - ctlp->io_num = 1; - ctlp->io_rid = kmalloc(sizeof(*(ctlp->io_rid)) * MAX_AIOPS_PER_BOARD, - M_DEVBUF, M_WAITOK | M_ZERO); - ctlp->io = kmalloc(sizeof(*(ctlp->io)) * MAX_AIOPS_PER_BOARD, - M_DEVBUF, M_WAITOK | M_ZERO); - - ctlp->bus_ctlp = kmalloc(sizeof(ISACONTROLLER_t) * 1, - M_DEVBUF, M_WAITOK | M_ZERO); - - ctlp->io_rid[0] = 0; - if (rp_controller != NULL) { - controller = rp_controller; - ctlp->io[0] = bus_alloc_resource(dev, SYS_RES_IOPORT, &ctlp->io_rid[0], 0, ~0, 0x40, RF_ACTIVE); - } else { - controller = rp_controller = ctlp; - ctlp->io[0] = bus_alloc_resource(dev, SYS_RES_IOPORT, &ctlp->io_rid[0], 0, ~0, 0x44, RF_ACTIVE); - } - if (ctlp->io[0] == NULL) { - device_printf(dev, "rp_attach: Resource not available.\n"); - retval = ENXIO; - goto nogo; - } - - num_aiops = sInitController(ctlp, - controller, - MAX_AIOPS_PER_BOARD, 0, - FREQ_DIS, 0); - if (num_aiops <= 0) { - device_printf(dev, "board%d init failed.\n", unit); - retval = ENXIO; - goto nogo; - } - - if (rp_controller == NULL) - rp_controller = controller; - rp_nisadevs++; - - device_set_desc(dev, "RocketPort ISA"); - - return (0); - -nogo: - rp_isareleaseresource(ctlp); - - return (retval); -} - -static int -rp_attach(device_t dev) -{ - int num_ports, num_aiops; - int aiop; - CONTROLLER_t *ctlp; - int retval; - - ctlp = device_get_softc(dev); - -#if 0 /* notdef */ - num_aiops = sInitController(ctlp, - rp_controller, - MAX_AIOPS_PER_BOARD, 0, - FREQ_DIS, 0); -#else - num_aiops = ctlp->NumAiop; -#endif /* notdef */ - - num_ports = 0; - for(aiop=0; aiop < num_aiops; aiop++) { - sResetAiopByNum(ctlp, aiop); - sEnAiop(rp_controller, ctlp, aiop); - num_ports += sGetAiopNumChan(ctlp, aiop); - } - - retval = rp_attachcommon(ctlp, num_aiops, num_ports); - if (retval != 0) - goto nogo; - - return (0); - -nogo: - rp_isareleaseresource(ctlp); - - return (retval); -} - -static void -rp_isareleaseresource(CONTROLLER_t *ctlp) -{ - int i; - - rp_releaseresource(ctlp); - - if (ctlp == rp_controller) - rp_controller = NULL; - if (ctlp->io != NULL) { - for (i = 0 ; i < MAX_AIOPS_PER_BOARD ; i++) - if (ctlp->io[i] != NULL) - bus_release_resource(ctlp->dev, SYS_RES_IOPORT, ctlp->io_rid[i], ctlp->io[i]); - kfree(ctlp->io, M_DEVBUF); - } - if (ctlp->io_rid != NULL) - kfree(ctlp->io_rid, M_DEVBUF); - if (rp_controller != NULL && rp_controller->io[ISACTL(ctlp)->MBaseIO] != NULL) { - bus_release_resource(rp_controller->dev, SYS_RES_IOPORT, rp_controller->io_rid[ISACTL(ctlp)->MBaseIO], rp_controller->io[ISACTL(ctlp)->MBaseIO]); - rp_controller->io[ISACTL(ctlp)->MBaseIO] = NULL; - rp_controller->io_rid[ISACTL(ctlp)->MBaseIO] = 0; - } - if (ctlp->bus_ctlp != NULL) - kfree(ctlp->bus_ctlp, M_DEVBUF); -} - -/*************************************************************************** -Function: sInitController -Purpose: Initialization of controller global registers and controller - structure. -Call: sInitController(CtlP,MudbacCtlP,AiopNum, - IRQNum,Frequency,PeriodicOnly) - CONTROLLER_T *CtlP; Ptr to controller structure - CONTROLLER_T *MudbacCtlP; Ptr to Mudbac controller structure - int AiopNum; Number of Aiops - int IRQNum; Interrupt Request number. Can be any of the following: - 0: Disable global interrupts - 3: IRQ 3 - 4: IRQ 4 - 5: IRQ 5 - 9: IRQ 9 - 10: IRQ 10 - 11: IRQ 11 - 12: IRQ 12 - 15: IRQ 15 - Byte_t Frequency: A flag identifying the frequency - of the periodic interrupt, can be any one of the following: - FREQ_DIS - periodic interrupt disabled - FREQ_137HZ - 137 Hertz - FREQ_69HZ - 69 Hertz - FREQ_34HZ - 34 Hertz - FREQ_17HZ - 17 Hertz - FREQ_9HZ - 9 Hertz - FREQ_4HZ - 4 Hertz - If IRQNum is set to 0 the Frequency parameter is - overidden, it is forced to a value of FREQ_DIS. - int PeriodicOnly: TRUE if all interrupts except the periodic - interrupt are to be blocked. - FALSE is both the periodic interrupt and - other channel interrupts are allowed. - If IRQNum is set to 0 the PeriodicOnly parameter is - overidden, it is forced to a value of FALSE. -Return: int: Number of AIOPs on the controller, or CTLID_NULL if controller - initialization failed. - -Comments: - If periodic interrupts are to be disabled but AIOP interrupts - are allowed, set Frequency to FREQ_DIS and PeriodicOnly to FALSE. - - If interrupts are to be completely disabled set IRQNum to 0. - - Setting Frequency to FREQ_DIS and PeriodicOnly to TRUE is an - invalid combination. - - This function performs initialization of global interrupt modes, - but it does not actually enable global interrupts. To enable - and disable global interrupts use functions sEnGlobalInt() and - sDisGlobalInt(). Enabling of global interrupts is normally not - done until all other initializations are complete. - - Even if interrupts are globally enabled, they must also be - individually enabled for each channel that is to generate - interrupts. - -Warnings: No range checking on any of the parameters is done. - - No context switches are allowed while executing this function. - - After this function all AIOPs on the controller are disabled, - they can be enabled with sEnAiop(). -*/ -static int -sInitController( CONTROLLER_T *CtlP, - CONTROLLER_T *MudbacCtlP, - int AiopNum, - int IRQNum, - Byte_t Frequency, - int PeriodicOnly) -{ - int i; - int ctl_base, aiop_base, aiop_size; - - CtlP->CtlID = CTLID_0001; /* controller release 1 */ - - ISACTL(CtlP)->MBaseIO = rp_nisadevs; - if (MudbacCtlP->io[ISACTL(CtlP)->MBaseIO] != NULL) { - ISACTL(CtlP)->MReg0IO = 0x40 + 0; - ISACTL(CtlP)->MReg1IO = 0x40 + 1; - ISACTL(CtlP)->MReg2IO = 0x40 + 2; - ISACTL(CtlP)->MReg3IO = 0x40 + 3; - } else { - MudbacCtlP->io_rid[ISACTL(CtlP)->MBaseIO] = ISACTL(CtlP)->MBaseIO; - ctl_base = rman_get_start(MudbacCtlP->io[0]) + 0x40 + 0x400 * rp_nisadevs; - MudbacCtlP->io[ISACTL(CtlP)->MBaseIO] = bus_alloc_resource(MudbacCtlP->dev, SYS_RES_IOPORT, &CtlP->io_rid[ISACTL(CtlP)->MBaseIO], ctl_base, ctl_base + 3, 4, RF_ACTIVE); - ISACTL(CtlP)->MReg0IO = 0; - ISACTL(CtlP)->MReg1IO = 1; - ISACTL(CtlP)->MReg2IO = 2; - ISACTL(CtlP)->MReg3IO = 3; - } -#if 1 - ISACTL(CtlP)->MReg2 = 0; /* interrupt disable */ - ISACTL(CtlP)->MReg3 = 0; /* no periodic interrupts */ -#else - if(sIRQMap[IRQNum] == 0) /* interrupts globally disabled */ - { - ISACTL(CtlP)->MReg2 = 0; /* interrupt disable */ - ISACTL(CtlP)->MReg3 = 0; /* no periodic interrupts */ - } - else - { - ISACTL(CtlP)->MReg2 = sIRQMap[IRQNum]; /* set IRQ number */ - ISACTL(CtlP)->MReg3 = Frequency; /* set frequency */ - if(PeriodicOnly) /* periodic interrupt only */ - { - ISACTL(CtlP)->MReg3 |= PERIODIC_ONLY; - } - } -#endif - rp_writeio1(MudbacCtlP,ISACTL(CtlP)->MBaseIO,ISACTL(CtlP)->MReg2IO,ISACTL(CtlP)->MReg2); - rp_writeio1(MudbacCtlP,ISACTL(CtlP)->MBaseIO,ISACTL(CtlP)->MReg3IO,ISACTL(CtlP)->MReg3); - sControllerEOI(MudbacCtlP,CtlP); /* clear EOI if warm init */ - - /* Init AIOPs */ - CtlP->NumAiop = 0; - for(i=0; i < AiopNum; i++) - { - if (CtlP->io[i] == NULL) { - CtlP->io_rid[i] = i; - aiop_base = rman_get_start(CtlP->io[0]) + 0x400 * i; - if (rp_nisadevs == 0) - aiop_size = 0x44; - else - aiop_size = 0x40; - CtlP->io[i] = bus_alloc_resource(CtlP->dev, SYS_RES_IOPORT, &CtlP->io_rid[i], aiop_base, aiop_base + aiop_size - 1, aiop_size, RF_ACTIVE); - } else - aiop_base = rman_get_start(CtlP->io[i]); - rp_writeio1(MudbacCtlP,ISACTL(CtlP)->MBaseIO, - ISACTL(CtlP)->MReg2IO, - ISACTL(CtlP)->MReg2 | (i & 0x03)); /* AIOP index */ - rp_writeio1(MudbacCtlP,ISACTL(CtlP)->MBaseIO, - ISACTL(CtlP)->MReg0IO, - (Byte_t)(aiop_base >> 6)); /* set up AIOP I/O in MUDBAC */ - sEnAiop(MudbacCtlP,CtlP,i); /* enable the AIOP */ - - CtlP->AiopID[i] = sReadAiopID(CtlP, i); /* read AIOP ID */ - if(CtlP->AiopID[i] == AIOPID_NULL) /* if AIOP does not exist */ - { - sDisAiop(MudbacCtlP,CtlP,i); /* disable AIOP */ - bus_release_resource(CtlP->dev, SYS_RES_IOPORT, CtlP->io_rid[i], CtlP->io[i]); - CtlP->io[i] = NULL; - break; /* done looking for AIOPs */ - } - - CtlP->AiopNumChan[i] = sReadAiopNumChan(CtlP, i); /* num channels in AIOP */ - rp_writeaiop2(CtlP,i,_INDX_ADDR,_CLK_PRE); /* clock prescaler */ - rp_writeaiop1(CtlP,i,_INDX_DATA,CLOCK_PRESC); - CtlP->NumAiop++; /* bump count of AIOPs */ - sDisAiop(MudbacCtlP,CtlP,i); /* disable AIOP */ - } - - if(CtlP->NumAiop == 0) - return(-1); - else - return(CtlP->NumAiop); -} - -/* - * ARGSUSED - * Maps (aiop, offset) to rid. - */ -static int -rp_isa_aiop2rid(int aiop, int offset) -{ - /* rid equals to aiop for an ISA controller. */ - return aiop; -} - -/* - * ARGSUSED - * Maps (aiop, offset) to the offset of resource. - */ -static int -rp_isa_aiop2off(int aiop, int offset) -{ - /* Each aiop has its own resource. */ - return offset; -} - -/* Read the int status for an ISA controller. */ -unsigned char -rp_isa_ctlmask(CONTROLLER_t *ctlp) -{ - return sGetControllerIntStatus(rp_controller,ctlp); -} - -static device_method_t rp_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, rp_probe), - DEVMETHOD(device_attach, rp_attach), - - DEVMETHOD_END -}; - -static driver_t rp_driver = { - "rp", - rp_methods, - sizeof(CONTROLLER_t), -}; - -/* - * rp can be attached to an isa bus. - */ -DRIVER_MODULE(rp, isa, rp_driver, rp_devclass, NULL, NULL); diff --git a/sys/dev/serial/rp/rp_pci.c b/sys/dev/serial/rp/rp_pci.c index 34591c0405..8fc64f2492 100644 --- a/sys/dev/serial/rp/rp_pci.c +++ b/sys/dev/serial/rp/rp_pci.c @@ -45,7 +45,6 @@ #include #include -#define ROCKET_C #include "rpreg.h" #include "rpvar.h" @@ -88,10 +87,6 @@ static devclass_t rp_devclass; static int rp_pciprobe(device_t dev); static int rp_pciattach(device_t dev); -#if 0 /* notdef */ -static int rp_pcidetach(device_t dev); -static int rp_pcishutdown(device_t dev); -#endif /* notdef */ static void rp_pcireleaseresource(CONTROLLER_t *ctlp); static int sPCIInitController( CONTROLLER_t *CtlP, int AiopNum, @@ -187,38 +182,6 @@ nogo: return (retval); } -#if 0 /* notdef */ -static int -rp_pcidetach(device_t dev) -{ - CONTROLLER_t *ctlp; - - if (device_get_state(dev) == DS_BUSY) - return (EBUSY); - - ctlp = device_get_softc(dev); - - rp_pcireleaseresource(ctlp); - - return (0); -} - -static int -rp_pcishutdown(device_t dev) -{ - CONTROLLER_t *ctlp; - - if (device_get_state(dev) == DS_BUSY) - return (EBUSY); - - ctlp = device_get_softc(dev); - - rp_pcireleaseresource(ctlp); - - return (0); -} -#endif /* notdef */ - static void rp_pcireleaseresource(CONTROLLER_t *ctlp) { @@ -276,11 +239,7 @@ sPCIInitController( CONTROLLER_t *CtlP, CtlP->AiopNumChan[i] = 8; break; default: -#if 0 /* notdef */ - CtlP->AiopNumChan[i] = 8; -#else CtlP->AiopNumChan[i] = sReadAiopNumChan(CtlP, i); -#endif /* notdef */ break; } /*device_printf(CtlP->dev, "%d channels.\n", CtlP->AiopNumChan[i]);*/ @@ -330,10 +289,6 @@ static device_method_t rp_pcimethods[] = { /* Device interface */ DEVMETHOD(device_probe, rp_pciprobe), DEVMETHOD(device_attach, rp_pciattach), -#if 0 /* notdef */ - DEVMETHOD(device_detach, rp_pcidetach), - DEVMETHOD(device_shutdown, rp_pcishutdown), -#endif /* notdef */ DEVMETHOD_END }; diff --git a/sys/dev/serial/rp/rpreg.h b/sys/dev/serial/rp/rpreg.h index 1c8dc50b8e..a2c9f42550 100644 --- a/sys/dev/serial/rp/rpreg.h +++ b/sys/dev/serial/rp/rpreg.h @@ -30,7 +30,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/rp/rpreg.h,v 1.4.2.1 2002/06/18 03:11:46 obrien Exp $ - * $DragonFly: src/sys/dev/serial/rp/rpreg.h,v 1.3 2004/05/19 22:52:49 dillon Exp $ */ /* @@ -1003,10 +1002,5 @@ void sDisInterrupts(CHANNEL_T *ChP,Word_t Flags); int rp_attachcommon(CONTROLLER_T *ctlp, int num_aiops, int num_ports); void rp_releaseresource(CONTROLLER_t *ctlp); -#ifndef ROCKET_C -extern Byte_t R[RDATASIZE]; -extern CONTROLLER_T sController[CTL_SIZE]; -extern Byte_t sIRQMap[16]; -#endif extern Byte_t rp_sBitMapClrTbl[8]; extern Byte_t rp_sBitMapSetTbl[8]; diff --git a/sys/dev/serial/rp/rpvar.h b/sys/dev/serial/rp/rpvar.h index b678e19ea5..b0497cdcd5 100644 --- a/sys/dev/serial/rp/rpvar.h +++ b/sys/dev/serial/rp/rpvar.h @@ -81,8 +81,3 @@ struct rp_port { unsigned short TxBuf[TXFIFO_SIZE/2 + 1]; unsigned short RxBuf[RXFIFO_SIZE/2 + 1]; }; - -/* Actually not used */ -#if 0 /* notdef */ -extern struct termios deftermios; -#endif /* notdef */ -- 2.41.0