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>
This commit is contained in:
committed by
Patrick Georgi
parent
322794243a
commit
6e23066d7a
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user