summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/usb/ehci.c
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2014-07-07 16:33:59 +0200
committerPatrick Georgi <patrick@georgi-clan.de>2014-07-10 20:55:41 +0200
commit6e23066d7ac31bd29b328824ec11e7d1252cf41c (patch)
tree0f30f1245394dcc4205bb58fdc0b8a1d4ef345b5 /payloads/libpayload/drivers/usb/ehci.c
parent322794243a98a47fe6e3b270277dd049e7d4f22e (diff)
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/ehci.c')
-rw-r--r--payloads/libpayload/drivers/usb/ehci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c
index e58bd38bbb..03d0aef8d6 100644
--- a/payloads/libpayload/drivers/usb/ehci.c
+++ b/payloads/libpayload/drivers/usb/ehci.c
@@ -724,7 +724,7 @@ static u8 *ehci_poll_intr_queue(void *const queue)
}
hci_t *
-ehci_init (void *bar)
+ehci_init (unsigned long physical_bar)
{
int i;
hci_t *controller = new_controller ();
@@ -751,7 +751,7 @@ ehci_init (void *bar)
controller->create_intr_queue = ehci_create_intr_queue;
controller->destroy_intr_queue = ehci_destroy_intr_queue;
controller->poll_intr_queue = ehci_poll_intr_queue;
- controller->reg_base = (u32)(unsigned long)bar;
+ controller->reg_base = (u32)physical_bar;
for (i = 0; i < 128; i++) {
controller->devices[i] = 0;
}
@@ -822,7 +822,7 @@ ehci_pci_init (pcidev_t addr)
/* default value for frame length adjust */
pci_write_config8(addr, FLADJ, FLADJ_framelength(60000));
- controller = ehci_init((void *)(unsigned long)reg_base);
+ controller = ehci_init((unsigned long)reg_base);
return controller;
}