diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-02-02 22:28:06 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-02-02 23:16:41 -0500 |
commit | 706eb8999ddf065f721aba7fee924fb2d4bfaba1 (patch) | |
tree | 24c28f18492da9beb4a2d05a58529911b6236ddb | |
parent | 46561b0844dbdc2c7d4abc70e5fe0df6ef6cb29d (diff) | |
download | seabios-hppa-706eb8999ddf065f721aba7fee924fb2d4bfaba1.zip seabios-hppa-706eb8999ddf065f721aba7fee924fb2d4bfaba1.tar.gz seabios-hppa-706eb8999ddf065f721aba7fee924fb2d4bfaba1.tar.bz2 |
ehci: Convert to new PCI BAR helper functions
Use the pci_enable_x() functions.
The ehci controller code will now explicitly set PCI_COMMAND_MEMORY
instead of assuming it has already been enabled.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | src/hw/usb-ehci.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/hw/usb-ehci.c b/src/hw/usb-ehci.c index a519455..57ce5a8 100644 --- a/src/hw/usb-ehci.c +++ b/src/hw/usb-ehci.c @@ -295,9 +295,9 @@ fail: static void ehci_controller_setup(struct pci_device *pci) { - u16 bdf = pci->bdf; - u32 baseaddr = pci_config_readl(bdf, PCI_BASE_ADDRESS_0); - struct ehci_caps *caps = (void*)(baseaddr & PCI_BASE_ADDRESS_MEM_MASK); + struct ehci_caps *caps = pci_enable_membar(pci, PCI_BASE_ADDRESS_0); + if (!caps) + return; u32 hcc_params = readl(&caps->hccparams); struct usb_ehci_s *cntl = malloc_tmphigh(sizeof(*cntl)); @@ -316,10 +316,10 @@ ehci_controller_setup(struct pci_device *pci) PendingEHCI++; dprintf(1, "EHCI init on dev %02x:%02x.%x (regs=%p)\n" - , pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf) - , pci_bdf_to_fn(bdf), cntl->regs); + , pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf) + , pci_bdf_to_fn(pci->bdf), cntl->regs); - pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER); + pci_enable_busmaster(pci); // XXX - check for and disable SMM control? |