summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/usbehcipc.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-06-06 16:05:40 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-06-06 16:05:40 +0200
commita3626a6efacc99bdfbe733758d508ed38ed8148c (patch)
tree4ce24df456ce91051f1204dddfac928497adf10d /sys/src/9/pc/usbehcipc.c
parent8243b6600f4c8d60e520aa1b20368ae9575aabf9 (diff)
usbehcipc: use 64-bit physical addresses and check pci membar type
Diffstat (limited to 'sys/src/9/pc/usbehcipc.c')
-rw-r--r--sys/src/9/pc/usbehcipc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/src/9/pc/usbehcipc.c b/sys/src/9/pc/usbehcipc.c
index 0618de1bb..7f6e47923 100644
--- a/sys/src/9/pc/usbehcipc.c
+++ b/sys/src/9/pc/usbehcipc.c
@@ -153,7 +153,7 @@ scanpci(void)
{
static int already = 0;
int i;
- uintptr io;
+ uvlong io;
Ctlr *ctlr;
Pcidev *p;
Ecapio *capio;
@@ -170,6 +170,8 @@ scanpci(void)
continue;
switch(p->ccrp){
case 0x20:
+ if(p->mem[0].bar & 1)
+ continue;
io = p->mem[0].bar & ~0x0f;
break;
default:
@@ -178,7 +180,7 @@ scanpci(void)
if(io == 0)
continue;
- print("usbehci: %#x %#x: port %#p size %#x irq %d\n",
+ print("usbehci: %#x %#x: port %llux size %d irq %d\n",
p->vid, p->did, io, p->mem[0].size, p->intl);
ctlr = malloc(sizeof(Ctlr));
@@ -187,7 +189,8 @@ scanpci(void)
continue;
}
- if((capio = vmap(io, p->mem[0].size)) == nil){
+ capio = vmap(io, p->mem[0].size);
+ if(capio == nil){
print("usbehci: cannot map mmio\n");
free(ctlr);
continue;
@@ -210,7 +213,7 @@ scanpci(void)
*/
if (i >= maxehci) {
iprint("usbehci: ignoring controllers after first %d, "
- "at %#p\n", maxehci, io);
+ "at %.8llux\n", maxehci, io);
ctlrs[i] = nil;
}
}