From 27dd53e35296463629aa2ae372983263a5a3cf2d Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 29 Dec 2007 13:40:28 +0000 Subject: [PATCH] Remove the xrpu driver as FreeBSD did ~1 month ago. --- etc/Makefile | 3 +- sys/conf/files | 3 +- sys/config/LINT | 4 +- sys/dev/misc/xrpu/xrpu.c | 273 ----------------------------- sys/platform/pc32/i386/elan-mmcr.c | 4 +- sys/sys/xrpuio.h | 43 ----- 6 files changed, 6 insertions(+), 324 deletions(-) delete mode 100644 sys/dev/misc/xrpu/xrpu.c delete mode 100644 sys/sys/xrpuio.h diff --git a/etc/Makefile b/etc/Makefile index 37fcd2a45c..41fce8a1a5 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,6 +1,6 @@ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 # $FreeBSD: src/etc/Makefile,v 1.219.2.38 2003/03/04 09:49:00 ru Exp $ -# $DragonFly: src/etc/Makefile,v 1.199 2007/12/16 19:33:08 thomas Exp $ +# $DragonFly: src/etc/Makefile,v 1.200 2007/12/29 13:40:27 swildner Exp $ .if !defined(NO_SENDMAIL) SUBDIR= sendmail @@ -547,6 +547,7 @@ upgrade_etc: preupgrade rm -f ${DESTDIR}/usr/share/games/fortune/freebsd-tips.dat csh -c "rm -f ${DESTDIR}/usr/share/man/{man,cat}8/rc.{atm,early,network,serial}.8.gz" csh -c "rm -f ${DESTDIR}/usr/share/man/{man,cat}8/i386/rc.i386.8.gz" + rm -f ${DESTDIR}/usr/include/sys/xrpuio.h ldconfig -R .if !defined(BINARY_UPGRADE) # binary upgrade just copies these nodes .if !defined(NOMAN) diff --git a/sys/conf/files b/sys/conf/files index 14ae322dd3..9370d5108a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/conf/files,v 1.340.2.137 2003/06/04 17:10:30 sam Exp $ -# $DragonFly: src/sys/conf/files,v 1.196 2007/12/26 14:02:36 sephe Exp $ +# $DragonFly: src/sys/conf/files,v 1.197 2007/12/29 13:40:28 swildner Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1104,7 +1104,6 @@ bus/pci/pcisupport.c optional pci bus/pci/pci_if.m optional pci bus/pci/pcib_if.m optional pci dev/powermng/i386/alpm/alpm.c optional alpm -dev/misc/xrpu/xrpu.c optional xrpu kern/kern_posix4_mib.c standard kern/kern_p1003_1b.c standard kern/kern_sched.c optional _kposix_priority_scheduling diff --git a/sys/config/LINT b/sys/config/LINT index 0428ad5dec..724fadeb20 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -3,7 +3,7 @@ # as much of the source tree as it can. # # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $ -# $DragonFly: src/sys/config/LINT,v 1.144 2007/12/26 14:02:36 sephe Exp $ +# $DragonFly: src/sys/config/LINT,v 1.145 2007/12/29 13:40:28 swildner Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -1635,8 +1635,6 @@ device asc0 at isa? port IO_ASC1 drq 3 irq 10 device spic0 at isa? irq 0 port 0x10a0 device stl0 at isa? port 0x2a0 irq 10 device stli0 at isa? port 0x2a0 iomem 0xcc000 flags 23 iosiz 0x1000 -# HOT1 Xilinx 6200 card (http://www.vcc.com/) -device xrpu # nullmodem terminal driver device nmdm diff --git a/sys/dev/misc/xrpu/xrpu.c b/sys/dev/misc/xrpu/xrpu.c deleted file mode 100644 index a3fc4f8d22..0000000000 --- a/sys/dev/misc/xrpu/xrpu.c +++ /dev/null @@ -1,273 +0,0 @@ -/* - * ---------------------------------------------------------------------------- - * "THE BEER-WARE LICENSE" (Revision 42): - * wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - * ---------------------------------------------------------------------------- - * - * $FreeBSD: src/sys/pci/xrpu.c,v 1.19.2.1 2000/08/02 22:19:57 peter Exp $ - * $DragonFly: src/sys/dev/misc/xrpu/Attic/xrpu.c,v 1.13 2006/12/22 23:26:18 swildner Exp $ - * - * A very simple device driver for PCI cards based on Xilinx 6200 series - * FPGA/RPU devices. Current Functionality is to allow you to open and - * mmap the entire thing into your program. - * - * Hardware currently supported: - * www.vcc.com HotWorks 1 6216 based card. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "pci_if.h" - -/* - * Device driver initialization stuff - */ - -static d_open_t xrpu_open; -static d_close_t xrpu_close; -static d_ioctl_t xrpu_ioctl; -static d_mmap_t xrpu_mmap; - -#define CDEV_MAJOR 100 -static struct dev_ops xrpu_ops = { - { "xrpu", CDEV_MAJOR, 0 }, - .d_open = xrpu_open, - .d_close = xrpu_close, - .d_ioctl = xrpu_ioctl, - .d_mmap = xrpu_mmap, -}; - -static MALLOC_DEFINE(M_XRPU, "xrpu", "XRPU related"); - -static devclass_t xrpu_devclass; - -#define dev2unit(devt) (minor(devt) & 0xff) -#define dev2pps(devt) ((minor(devt) >> 16)-1) - -struct softc { - enum { NORMAL, TIMECOUNTER } mode; - vm_offset_t virbase, physbase; - u_int *virbase62; -#if 0 - struct timecounter tc; -#endif - u_int *trigger, *latch, dummy; - struct pps_state pps[XRPU_MAX_PPS]; - u_int *assert[XRPU_MAX_PPS], *clear[XRPU_MAX_PPS]; -}; - -#if 0 - -static unsigned -xrpu_get_timecount(struct timecounter *tc) -{ - struct softc *sc = tc->tc_priv; - - sc->dummy += *sc->trigger; - return (*sc->latch & tc->tc_counter_mask); -} - -static void -xrpu_poll_pps(struct timecounter *tc) -{ - struct softc *sc = tc->tc_priv; - int i, j; - unsigned count1, ppscount; - - for (i = 0; i < XRPU_MAX_PPS; i++) { - if (sc->assert[i]) { - ppscount = *(sc->assert[i]) & tc->tc_counter_mask; - j = 0; - do { - count1 = ppscount; - ppscount = *(sc->assert[i]) & tc->tc_counter_mask; - } while (ppscount != count1 && ++j < 5); - pps_event(&sc->pps[i], tc, ppscount, PPS_CAPTUREASSERT); - } - if (sc->clear[i]) { - j = 0; - ppscount = *(sc->clear[i]) & tc->tc_counter_mask; - do { - count1 = ppscount; - ppscount = *(sc->clear[i]) & tc->tc_counter_mask; - } while (ppscount != count1 && ++j < 5); - pps_event(&sc->pps[i], tc, ppscount, PPS_CAPTURECLEAR); - } - } -} - -#endif - -static int -xrpu_open(struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct softc *sc = devclass_get_softc(xrpu_devclass, dev2unit(dev)); - - if (!sc) - return (ENXIO); - dev->si_drv1 = sc; - return (0); -} - -static int -xrpu_close(struct dev_close_args *ap) -{ - return (0); -} - -static int -xrpu_mmap(struct dev_mmap_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct softc *sc = dev->si_drv1; - - if (ap->a_offset >= 0x1000000) - return (-1); - return (i386_btop(sc->physbase + ap->a_offset)); -} - -static int -xrpu_ioctl(struct dev_ioctl_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct softc *sc = dev->si_drv1; - int i, error; - - if (sc->mode == TIMECOUNTER) { - i = dev2pps(dev); - if (i < 0 || i >= XRPU_MAX_PPS) - return ENODEV; - error = pps_ioctl(ap->a_cmd, ap->a_data, &sc->pps[i]); - return (error); - } - -#if 0 - if (ap->a_cmd == XRPU_IOC_TIMECOUNTING) { - struct xrpu_timecounting *xt = (struct xrpu_timecounting *)ap->a_data; - - /* Name SHALL be zero terminated */ - xt->xt_name[sizeof xt->xt_name - 1] = '\0'; - i = strlen(xt->xt_name); - sc->tc.tc_name = (char *)kmalloc(i + 1, M_XRPU, M_WAITOK); - strcpy(sc->tc.tc_name, xt->xt_name); - sc->tc.tc_frequency = xt->xt_frequency; - sc->tc.tc_get_timecount = xrpu_get_timecount; - sc->tc.tc_poll_pps = xrpu_poll_pps; - sc->tc.tc_priv = sc; - sc->tc.tc_counter_mask = xt->xt_mask; - sc->trigger = sc->virbase62 + xt->xt_addr_trigger; - sc->latch = sc->virbase62 + xt->xt_addr_latch; - - for (i = 0; i < XRPU_MAX_PPS; i++) { - if (xt->xt_pps[i].xt_addr_assert == 0 - && xt->xt_pps[i].xt_addr_clear == 0) - continue; - make_dev(&xrpu_ops, (i+1)<<16, - UID_ROOT, GID_WHEEL, 0600, "xpps%d", i); - sc->pps[i].ppscap = 0; - if (xt->xt_pps[i].xt_addr_assert) { - sc->assert[i] = sc->virbase62 + xt->xt_pps[i].xt_addr_assert; - sc->pps[i].ppscap |= PPS_CAPTUREASSERT; - } - if (xt->xt_pps[i].xt_addr_clear) { - sc->clear[i] = sc->virbase62 + xt->xt_pps[i].xt_addr_clear; - sc->pps[i].ppscap |= PPS_CAPTURECLEAR; - } - pps_init(&sc->pps[i]); - } - sc->mode = TIMECOUNTER; - init_timecounter(&sc->tc); - return (0); - } -#endif - error = ENOTTY; - return (error); -} - -/* - * PCI initialization stuff - */ - -static int -xrpu_probe(device_t self) -{ - char *desc; - - desc = NULL; - switch (pci_get_devid(self)) { - case 0x6216133e: - desc = "VCC Hotworks-I xc6216"; - break; - } - if (desc == NULL) - return ENXIO; - - device_set_desc(self, desc); - return 0; -} - -static int -xrpu_attach(device_t self) -{ - struct softc *sc; - struct resource *res; - int rid, unit; - - unit = device_get_unit(self); - sc = device_get_softc(self); - sc->mode = NORMAL; - rid = PCIR_MAPS; - res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); - if (res == NULL) { - device_printf(self, "Could not map memory\n"); - return ENXIO; - } - sc->virbase = (vm_offset_t)rman_get_virtual(res); - sc->physbase = rman_get_start(res); - sc->virbase62 = (u_int *)(sc->virbase + 0x800000); - - if (bootverbose) - kprintf("Mapped physbase %#lx to virbase %#lx\n", - (u_long)sc->physbase, (u_long)sc->virbase); - - dev_ops_add(&xrpu_ops, -1, unit); - make_dev(&xrpu_ops, unit, UID_ROOT, GID_WHEEL, 0600, "xrpu%d", unit); - return 0; -} - -static device_method_t xrpu_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, xrpu_probe), - DEVMETHOD(device_attach, xrpu_attach), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - - {0, 0} -}; - -static driver_t xrpu_driver = { - "xrpu", - xrpu_methods, - sizeof(struct softc) -}; - - -DRIVER_MODULE(xrpu, pci, xrpu_driver, xrpu_devclass, 0, 0); diff --git a/sys/platform/pc32/i386/elan-mmcr.c b/sys/platform/pc32/i386/elan-mmcr.c index f84d2d3e4b..7cad960d91 100644 --- a/sys/platform/pc32/i386/elan-mmcr.c +++ b/sys/platform/pc32/i386/elan-mmcr.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/i386/i386/elan-mmcr.c,v 1.6.2.1 2002/09/17 22:39:53 sam Exp $ - * $DragonFly: src/sys/platform/pc32/i386/elan-mmcr.c,v 1.9 2006/12/23 00:27:03 swildner Exp $ + * $DragonFly: src/sys/platform/pc32/i386/elan-mmcr.c,v 1.10 2007/12/29 13:40:28 swildner Exp $ * The AMD Elan sc520 is a system-on-chip gadget which is used in embedded * kind of things, see www.soekris.com for instance, and it has a few quirks * we need to deal with. @@ -95,7 +95,7 @@ static d_close_t elan_close; static d_ioctl_t elan_ioctl; static d_mmap_t elan_mmap; -#define CDEV_MAJOR 100 /* Share with xrpu */ +#define CDEV_MAJOR 100 static struct dev_ops elan_ops = { { "elan", CDEV_MAJOR, 0 }, .d_open = elan_open, diff --git a/sys/sys/xrpuio.h b/sys/sys/xrpuio.h deleted file mode 100644 index 1e8e97de0c..0000000000 --- a/sys/sys/xrpuio.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * ---------------------------------------------------------------------------- - * "THE BEER-WARE LICENSE" (Revision 42): - * wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - * ---------------------------------------------------------------------------- - * - * $FreeBSD: src/sys/sys/xrpuio.h,v 1.2 1999/08/28 00:52:12 peter Exp $ - * $DragonFly: src/sys/sys/Attic/xrpuio.h,v 1.3 2006/05/20 02:42:13 dillon Exp $ - * - */ - -#ifndef _SYS_XRPUIO_H_ -#define _SYS_XRPUIO_H_ - -#ifndef _SYS_TYPES_H_ -#include -#endif -#ifndef _SYS_IOCCOM_H_ -#include -#endif - -#define XRPU_MAX_PPS 16 -struct xrpu_timecounting { - - /* The timecounter itself */ - u_int xt_addr_trigger; - u_int xt_addr_latch; - unsigned xt_mask; - u_int32_t xt_frequency; - char xt_name[16]; - - /* The PPS latches */ - struct { - u_int xt_addr_assert; - u_int xt_addr_clear; - } xt_pps[XRPU_MAX_PPS]; -}; - -#define XRPU_IOC_TIMECOUNTING _IOW('6', 1, struct xrpu_timecounting) - -#endif /* _SYS_XRPUIO_H_ */ -- 2.41.0