From 2aba54c7783f14b83ae34292c42d55c57c2309c2 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Thu, 6 Jan 2022 20:37:05 -0300 Subject: [PATCH] usblgoff: Fix ICH RCBA validity detection --- usblgoff/usblgoff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usblgoff/usblgoff.c b/usblgoff/usblgoff.c index ab5df37..c3973db 100644 --- a/usblgoff/usblgoff.c +++ b/usblgoff/usblgoff.c @@ -46,10 +46,10 @@ pci_scan_callback(uint8_t bus, uint8_t dev, uint8_t func, /* Get RCBA. */ printf("> RCBA is "); - mmio_base = pci_readl(bus, dev, func, 0xf0) & ~0x00003fff; + mmio_base = pci_readl(bus, dev, func, 0xf0); if ((mmio_base & 0x00000001) && (mmio_base != 0xffffffff)) { printf("assigned to %08X\n", mmio_base); - mmio = (uint32_t *) mmio_base; + mmio = (uint32_t *) (mmio_base & ~0x00003fff); /* Disable all relevant I/O traps. */ for (i = 0; i < 4; i++) {