From a032664fc9c37f7b29a9713d084d2e3510510531 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 1 Dec 2007 20:39:47 +0000 Subject: [PATCH] Based in info gleaned from the web and other drivers (including the Linux sx driver), change a magic value in the PLX bridge chip. Apparently later builds of the PCI cards had corrected values in the configuration eeprom. This change supposedly fixes some pci bus problems. --- sys/dev/si/si_pci.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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;