#include "dat.h"
#include "fns.h"
#include "io.h"
+#include "../port/pci.h"
#include "../port/error.h"
#include "../port/usb.h"
}
OUTS(Status, sts & Sall);
cmd = INS(Cmd);
- if((cmd & Crun) == 0){
- iprint("uhci %#ux: not running: uhci bug?\n", ctlr->port);
- /* BUG: should abort everything in this case */
- }
if(debug > 1){
frptr = INL(Flbaseadd);
frno = INL(Frnum);
continue;
switch(p->ccrp){
case 0:
- io = p->mem[4].bar & ~0x0F;
+ if((p->mem[4].bar & 1) == 0)
+ continue;
+ io = p->mem[4].bar & ~3;
break;
default:
continue;
continue;
}
- dprint("uhci: %#x %#x: port %#ux size %#x irq %d\n",
+ print("uhci: %#x %#x: port %#ux size %#x irq %d\n",
p->vid, p->did, io, p->mem[4].size, p->intl);
ctlr = malloc(sizeof(Ctlr));
return -1;
p = ctlr->pcidev;
+ pcienable(p);
+
hp->aux = ctlr;
hp->port = ctlr->port;
hp->irq = p->intl;
uhcireset(ctlr);
uhcimeminit(ctlr);
+ pcisetbme(p);
+
/*
* Linkage to the generic HCI driver.
*/
hp->shutdown = shutdown;
hp->debug = setdebug;
hp->type = "uhci";
-
- /*
- * IRQ2 doesn't really exist, it's used to gang the interrupt
- * controllers together. A device set to IRQ2 will appear on
- * the second interrupt controller as IRQ9.
- */
- if(hp->irq == 2)
- hp->irq = 9;
intrenable(hp->irq, hp->interrupt, hp, hp->tbdf, hp->type);
return 0;