diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-05-08 18:37:29 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-05-08 18:37:29 +0000 |
commit | 78eee38ce401a874ac54aca3ade4aacda8d506cd (patch) | |
tree | 056c9250577f926ebf908c54f10a1c38e7d372ef /sys/arch/sgi | |
parent | c7d78ad16c99623a658bd4a9d4a6008000842b99 (diff) |
Fix devio byteswap, this makes isp(4) happy on IP27 and IP35.
Diffstat (limited to 'sys/arch/sgi')
-rw-r--r-- | sys/arch/sgi/xbow/xbridge.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/sys/arch/sgi/xbow/xbridge.c b/sys/arch/sgi/xbow/xbridge.c index 3e95eab6b1d..bc655ee5511 100644 --- a/sys/arch/sgi/xbow/xbridge.c +++ b/sys/arch/sgi/xbow/xbridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbridge.c,v 1.15 2009/05/06 20:08:47 miod Exp $ */ +/* $OpenBSD: xbridge.c,v 1.16 2009/05/08 18:37:28 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -579,7 +579,7 @@ xbridge_intr_establish(void *cookie, pci_intr_handle_t ih, int level, * given source, yet. */ if (xbow_intr_establish(xbridge_intr_handler, xi, intrsrc, - level, sc->sc_dev.dv_xname)) { + level, NULL)) { printf("%s: unable to register interrupt handler, " "did xheart or xhub attach?\n", sc->sc_dev.dv_xname); @@ -682,7 +682,10 @@ xbridge_intr_handler(void *v) bus_space_write_4(sc->sc_iot, sc->sc_regh, BRIDGE_INT_FORCE_PIN(xi->xi_intrbit), 1); } else { - IP27_RHUB_PI_S(nasid, 0, HUB_IR_CHANGE, xi->xi_intrsrc); + if (bus_space_read_4(sc->sc_iot, sc->sc_regh, BRIDGE_ISR) & + (1 << xi->xi_intrbit)) + IP27_RHUB_PI_S(nasid, 0, HUB_IR_CHANGE, + HUB_IR_SET | xi->xi_intrsrc); } return rc; @@ -1031,11 +1034,6 @@ xbridge_resource_setup(struct xbridge_softc *sc) * On Octane, the firmware will setup the I/O registers * correctly for the on-board devices. Other PCI buses, * and other systems, need more attention. - * - * XXX Another reason not to enter the loop below on the Octane - * XXX main Bridge widget is that it uses a sligthly different - * XXX devio window allocation scheme, with only one large devio - * XXX (used by the first isp controller). */ if (sys_config.system_type == SGI_OCTANE && sc->sc_widget == WIDGET_MAX) return; @@ -1049,6 +1047,8 @@ xbridge_resource_setup(struct xbridge_softc *sc) /* * Devices which have been configured by the firmware * have their I/O window pointing to the bridge widget. + * XXX We only need to preserve IOC3 devio settings if + * XXX it is the console. */ devio = bus_space_read_4(sc->sc_iot, sc->sc_regh, BRIDGE_DEVICE(dev)); @@ -1074,16 +1074,13 @@ xbridge_resource_setup(struct xbridge_softc *sc) } /* - * Enable byte swapping for PIO and DMA, except on IOC3 and + * Enable byte swapping for DMA, except on IOC3 and * RAD1 devices. */ - if (id == PCI_ID_CODE(PCI_VENDOR_SGI, PCI_PRODUCT_SGI_IOC3) || - id == PCI_ID_CODE(PCI_VENDOR_SGI, PCI_PRODUCT_SGI_RAD1)) - devio &= ~(BRIDGE_DEVICE_SWAP_DIR | - BRIDGE_DEVICE_SWAP_PMU); - else - devio |= BRIDGE_DEVICE_SWAP_DIR | - BRIDGE_DEVICE_SWAP_PMU; + devio &= ~(BRIDGE_DEVICE_SWAP_DIR | BRIDGE_DEVICE_SWAP_PMU); + if (id != PCI_ID_CODE(PCI_VENDOR_SGI, PCI_PRODUCT_SGI_IOC3) && + id != PCI_ID_CODE(PCI_VENDOR_SGI, PCI_PRODUCT_SGI_RAD1)) + devio |= BRIDGE_DEVICE_SWAP_PMU; bus_space_write_4(sc->sc_iot, sc->sc_regh, BRIDGE_DEVICE(dev), devio); |