drivers/uhci: remove not-implemented UHCI driver
authorReto Achermann <reto.achermann@inf.ethz.ch>
Mon, 19 Aug 2019 16:07:25 +0000 (18:07 +0200)
committerReto Achermann <reto.achermann@inf.ethz.ch>
Tue, 20 Aug 2019 17:43:07 +0000 (19:43 +0200)
Signed-off-by: Reto Achermann <reto.achermann@inf.ethz.ch>

usr/drivers/uhci/Hakefile [deleted file]
usr/drivers/uhci/notes.txt [deleted file]
usr/drivers/uhci/uhci.c [deleted file]
usr/drivers/uhci/uhci.h [deleted file]
usr/drivers/uhci/uhci_debug.h [deleted file]

diff --git a/usr/drivers/uhci/Hakefile b/usr/drivers/uhci/Hakefile
deleted file mode 100644 (file)
index 1ffbb6b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---------------------------------------------------------------------------
--- Copyright (c) 2012, ETH Zurich.
--- All rights reserved.
---
--- This file is distributed under the terms in the attached LICENSE file.
--- If you do not find this file, copies can be found by writing to:
--- ETH Zurich D-INFK, Universitaetsstr. 6, CH-8092 Zurich. Attn: Systems Group.
---
--- Hakefile for /usr/drivers/uhci
--- 
---------------------------------------------------------------------------
-
-[ build application { target = "uhci",
-                      cFiles = [ "uhci.c" ],
---                      flounderBindings = [ "uhci_mgmt" ],
-                      mackerelDevices = [ "uhci" ],
-                      addLibraries = [ "pci", "skb" ]
-                    }
-]
-
diff --git a/usr/drivers/uhci/notes.txt b/usr/drivers/uhci/notes.txt
deleted file mode 100644 (file)
index 9a70265..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-
-Each device driver is a process. 
-
-Main:
-
-The main function connects to PCI, and calls "pci_register_driver_irq"
-to look for a device to drive.   Arguments to this function include
-the IRQ handler, and the initialization function to call.
-
-Initialization function:
-
-Called with: 
- - struct device_mem *bar_info
- - int nr_allocated_bars
-
-struct device_mem is defined in <pci/mem.h>, and contains a large
-number of fields:
-
-struct device_mem {
-    uint8_t type; // 0 = memory BAR, 1 = IO BAR
-    void *vaddr;  // assigned by the device driver when calling map_device()
-    genpaddr_t paddr; // physical base address of device
-    struct capref *phys_cap; // array of phys caps (only if type == 0 and in PCI server)
-    struct capref *frame_cap; // array of frame caps
-    struct capref io_cap; // IO cap (only valid if type == 1)
-    uint8_t bits;    // size of a single cap in bits
-    size_t bytes;    // size of entire region in bytes
-    uint32_t nr_caps;// number of caps used to map region, length of cap arrays
-    /* NB: it should be the case that bytes = (1 << bits) * nr_caps */
-    struct memobj *memobj;   // valid after map_device()
-    struct vregion *vregion; // valid after map_device()
-};
-
-Take local copies of these, as they will be deleted when the init
-function returns. 
-
-For each bar in main memory, call "map_device".
-
-
diff --git a/usr/drivers/uhci/uhci.c b/usr/drivers/uhci/uhci.c
deleted file mode 100644 (file)
index 0f95dee..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2012 ETH Zurich.
- * All rights reserved.
- *
- * This file is distributed under the terms in the attached LICENSE file.
- * If you do not find this file, copies can be found by writing to:
- * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
- */
-
-#define UHCI_SERVICE_DEBUG 1
-#define NO_PCI_IO_HANDLING 1
-
-#include <barrelfish/barrelfish.h>
-#include <barrelfish/waitset.h>
-#include <pci/pci.h>
-#include <dev/uhci_dev.h>
-#include <uhci_debug.h>
-#include <string.h>
-
-
-
-// #define PCI_DEVICE_82731_UHCI 0x7112
-#define PCI_DEVICE_82731_UHCI 0x7020
-
-#define UHCI_PORTBASE 0xc020
-#define UHCI_PORTEND 0xc03f
-#define UHCI_IRQ 9
-
-static const uint16_t device_ids[] = {
-    0x7020,
-    0x7112,
-    0x0000 // Sentinel
-};
-
-static struct device_mem bar;
-static struct uhci_t   dev;
-
-static void uhci_legacy_init(void)
-{
-    uint16_t portbase = UHCI_PORTBASE; // Why isn't this from a BAR
-
-    UHCI_DEBUG("accessing conf regs starting at %" PRIx16 "\n", portbase);
-    uhci_initialize(&dev, portbase);
-
-    {
-       char buf[4096];
-       uhci_pr(buf, 4095, &dev);
-       printf("%s", buf);
-    }
-
-    // Now initialize the controller.
-    
-
-}
-
-
-
-static void uhci_init(void *arg, struct device_mem *bar_info,
-                      int nr_allocated_bars)
-{
-    int i;
-    uint16_t portbase;
-
-    UHCI_DEBUG("nr_allocated_bars = %d\n", nr_allocated_bars);
-    for(i=0; i < nr_allocated_bars; i++) {
-       struct device_mem *b = &bar_info[i];
-       UHCI_DEBUG("Bar %d: type %d\n", i, b->type);
-       UHCI_DEBUG(" vaddr=%p, paddr=%"PRIx64"\n", b->vaddr, b->paddr);
-    }
-
-    if (nr_allocated_bars != 1) {
-       UHCI_DEBUG("Warning: more than 1 bar (ignoring others)\n");
-    }
-    memcpy(&bar, &bar_info[0], sizeof(&bar));
-
-    portbase = UHCI_PORTBASE; // Why isn't this from a BAR
-
-    UHCI_DEBUG("accessing conf regs starting at %" PRIx16 "\n", portbase);
-    uhci_initialize(&dev, portbase);
-
-    {
-       char buf[4096];
-       uhci_pr(buf, 4095, &dev);
-       printf("%s", buf);
-    }
-
-    // Now initialize the controller.
-    
-
-}
-
-static void uhci_interrupt_handler(void *arg)
-{
-    UHCI_DEBUG("interrupt!\n");
-}
-
-int main(int argc, char **argv)
-{
-    int r;
-
-    UHCI_DEBUG("starting\n");
-
-    // UHCI_DEBUG("connecting to the SKB...\n");
-    // skb_client_connect();
-    // UHCI_DEBUG("connected to SKB\n");
-
-    UHCI_DEBUG("connecting to PCI...\n");
-    r = pci_client_connect();
-    assert(err_is_ok(r));
-    UHCI_DEBUG("connected to PCI\n");
-
-    r = pci_register_legacy_driver_irq(uhci_legacy_init,
-                                      UHCI_PORTBASE,
-                                      UHCI_PORTEND,
-                                      UHCI_IRQ,
-                                      uhci_interrupt_handler,
-                                      NULL );
-    if (err_is_ok(r)) {
-       UHCI_DEBUG("uhci[legacy]: found controller.");
-       goto finish;
-    }
-
-    int i;
-    for( i=0; device_ids[i] != 0; i++) {
-       r = pci_register_driver_irq(uhci_init,  // Init. fn
-                    NULL, // User state
-                                   PCI_CLASS_SERIAL,   // Class
-                                   PCI_SUB_USB,        // Subclass
-                                   PCI_IF_USB_UHCI,    // Prog. if
-                                   PCI_VENDOR_INTEL,   // Vendor ID
-                                   device_ids[i],      // Device ID
-                                   PCI_DONT_CARE,      // Bus
-                                   PCI_DONT_CARE,      // Dev
-                                   PCI_DONT_CARE,      // Fun
-                                   uhci_interrupt_handler,     // IRQ handler
-                                   NULL                // IRQ argument
-                                   );
-       if (err_is_ok(r)) {
-           UHCI_DEBUG("uhci: found controller %" PRIx16 ":%" PRIx16 ".\n",
-                      PCI_VENDOR_INTEL, device_ids[i]);
-           goto finish;
-       }
-       printf("uhci: no device ID %" PRIx16 " found.\n", device_ids[i]);
-    }
-
-    printf("uhci: no devices recognized; giving up.");
-    return 1;
-
-finish:
-    UHCI_DEBUG("registered driver: retval=%d; now polling...\n", r);
-
-    errval_t err;
-    struct waitset *ws = get_default_waitset();
-    while (1) {
-        err = event_dispatch(ws);
-        if (err_is_fail(err)) {
-            DEBUG_ERR(err, "in event_dispatch");
-            break;
-        }
-    }
-}
diff --git a/usr/drivers/uhci/uhci.h b/usr/drivers/uhci/uhci.h
deleted file mode 100644 (file)
index 54adce5..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (c) 2012 ETH Zurich.
- * All rights reserved.
- *
- * This file is distributed under the terms in the attached LICENSE file.
- * If you do not find this file, copies can be found by writing to:
- * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
- */
-
-#ifndef UHCI_H_
-#define UHCI_H_
-
-#include <barrelfish/barrelfish.h>
-#include <dev/uhci_dev.h>
-
-#endif //UHCI_H_
diff --git a/usr/drivers/uhci/uhci_debug.h b/usr/drivers/uhci/uhci_debug.h
deleted file mode 100644 (file)
index a2dce1d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2012 ETH Zurich.
- * All rights reserved.
- *
- * This file is distributed under the terms in the attached LICENSE file.
- * If you do not find this file, copies can be found by writing to:
- * ETH Zurich D-INFK, Universitaetstrasse. 6, CH-8092 Zurich. Attn: Systems Group.
- */
-
-#ifndef UHCI_DEBUG_H_
-#define UHCI_DEBUG_H_
-
-
-/*****************************************************************
- * Debug printer:
- *****************************************************************/
-
-#if defined(UHCI_SERVICE_DEBUG) || defined(GLOBAL_DEBUG)
-#define UHCI_DEBUG(x...) printf("uhci: " x)
-#else
-#define UHCI_DEBUG(x...) ((void)0)
-#endif
-
-#endif // UHCI_DEBUG_H_