diff options
author | Nico Huber <nico.huber@secunet.com> | 2014-07-07 16:33:59 +0200 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2014-07-10 20:55:41 +0200 |
commit | 6e23066d7ac31bd29b328824ec11e7d1252cf41c (patch) | |
tree | 0f30f1245394dcc4205bb58fdc0b8a1d4ef345b5 /payloads/libpayload/drivers/usb/xhci.c | |
parent | 322794243a98a47fe6e3b270277dd049e7d4f22e (diff) | |
download | coreboot-6e23066d7ac31bd29b328824ec11e7d1252cf41c.tar.xz |
libpayload: Use unsigned long for BARs in *hci_init()
Using void* for physical addresses leads to much casting and confuses
developers when to convert from physical to virtual addresses or
the other way around. When using plain integers for physical addresses
and pointers for virtual addresses things become much cleaner and we
won't ever end up dereferencing a physical address.
Change-Id: I24cd53b81c7863b6d14f0cbb4ce8937728b37c1c
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/6244
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'payloads/libpayload/drivers/usb/xhci.c')
-rw-r--r-- | payloads/libpayload/drivers/usb/xhci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c index d9ac0a490b..f540230ec2 100644 --- a/payloads/libpayload/drivers/usb/xhci.c +++ b/payloads/libpayload/drivers/usb/xhci.c @@ -143,7 +143,7 @@ xhci_wait_ready(xhci_t *const xhci) } hci_t * -xhci_init (const void *bar) +xhci_init (unsigned long physical_bar) { int i; @@ -192,7 +192,7 @@ xhci_init (const void *bar) goto _free_xhci; } - controller->reg_base = (u32)(unsigned long)bar; + controller->reg_base = (u32)physical_bar; xhci->capreg = phys_to_virt(controller->reg_base); xhci->opreg = ((void *)xhci->capreg) + xhci->capreg->caplength; @@ -310,7 +310,7 @@ xhci_pci_init (pcidev_t addr) fatal("We don't do 64bit addressing.\n"); } - controller = xhci_init((void *)(unsigned long)reg_addr); + controller = xhci_init((unsigned long)reg_addr); controller->pcidev = addr; xhci_switch_ppt_ports(addr); |