From ae64f22e8d5707ef715ad4bd01b6181653a3f9ca Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sat, 30 Nov 2019 09:42:20 +0100 Subject: [PATCH] drivers/usb/ehci_debug: Add x86_64 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use proper int to pointer conversions. Tested on Lenovo T410 with x86_64 enabled. Still works. Change-Id: I4ed62297fb47d7d83d4b28e80f3770de99ce70f7 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/37393 Reviewed-by: Kyösti Mälkki Tested-by: build bot (Jenkins) --- src/drivers/usb/ehci_debug.c | 4 ++-- src/drivers/usb/ehci_debug.h | 2 +- src/drivers/usb/pci_ehci.c | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/drivers/usb/ehci_debug.c b/src/drivers/usb/ehci_debug.c index d6b468c3a2..318dfe7f59 100644 --- a/src/drivers/usb/ehci_debug.c +++ b/src/drivers/usb/ehci_debug.c @@ -434,7 +434,7 @@ static int ehci_wait_for_port(struct ehci_regs *ehci_regs, int port) -static int usbdebug_init_(unsigned int ehci_bar, unsigned int offset, struct ehci_debug_info *info) +static int usbdebug_init_(uintptr_t ehci_bar, unsigned int offset, struct ehci_debug_info *info) { struct ehci_caps *ehci_caps; struct ehci_regs *ehci_regs; @@ -653,7 +653,7 @@ void dbgp_put(struct dbgp_pipe *pipe) } #if ENV_RAMSTAGE -void usbdebug_re_enable(unsigned int ehci_base) +void usbdebug_re_enable(uintptr_t ehci_base) { struct ehci_debug_info *dbg_info = dbgp_ehci_info(); u64 diff; diff --git a/src/drivers/usb/ehci_debug.h b/src/drivers/usb/ehci_debug.h index 0f20c2f5fb..a6a3e55826 100644 --- a/src/drivers/usb/ehci_debug.h +++ b/src/drivers/usb/ehci_debug.h @@ -16,7 +16,7 @@ #include -void usbdebug_re_enable(unsigned int ehci_base); +void usbdebug_re_enable(uintptr_t ehci_base); void usbdebug_disable(void); /* Returns 0 on success and sets MMIO base and dbg_offset if EHCI debug diff --git a/src/drivers/usb/pci_ehci.c b/src/drivers/usb/pci_ehci.c index a740d50dbf..dfc78cc666 100644 --- a/src/drivers/usb/pci_ehci.c +++ b/src/drivers/usb/pci_ehci.c @@ -116,6 +116,7 @@ void pci_ehci_read_resources(struct device *dev) u8 *pci_ehci_base_regs(pci_devfn_t sdev) { - u8 *base = (u8 *)(pci_s_read_config32(sdev, EHCI_BAR_INDEX) & ~0x0f); + u32 bar = pci_s_read_config32(sdev, EHCI_BAR_INDEX) & ~0x0f; + u8 *base = (u8 *)(uintptr_t)bar; return base + HC_LENGTH(read32(base)); }