diff --git a/sys/dev/si/si_pci.c b/sys/dev/si/si_pci.c index 7aa390fca3fa..81c74e1fa2e9 100644 --- a/sys/dev/si/si_pci.c +++ b/sys/dev/si/si_pci.c @@ -105,6 +105,29 @@ si_pci_attach(device_t dev) goto fail; } + if (pci_get_devid(dev) == 0x200011cb) { + int rid; + struct resource *plx_res; + uint32_t *addr; + uint32_t oldvalue; + + /* Perform a PLX control register fixup */ + rid = PCIR_BAR(0); + plx_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (plx_res == NULL) { + device_printf(dev, "couldn't map plx registers\n"); + } else { + addr = rman_get_virtual(plx_res); + oldvalue = addr[0x50 / 4]; + if (oldvalue != 0x18260000) { + device_printf(dev, "PLX register 0x50: 0x%08x changed to 0x%08x\n", oldvalue, 0x18260000); + addr[0x50 / 4] = 0x18260000; + } + bus_release_resource(dev, SYS_RES_MEMORY, rid, plx_res); + } + } + error = siattach(dev); if (error) goto fail;