diff options
author | Peter Hessler <phessler@cvs.openbsd.org> | 2018-05-02 19:11:02 +0000 |
---|---|---|
committer | Peter Hessler <phessler@cvs.openbsd.org> | 2018-05-02 19:11:02 +0000 |
commit | 48048ed9d89377f88d29d9288b10e723bba4648f (patch) | |
tree | f2cca4752145b8b66e661e1366fd6db690c27de4 /sys/dev | |
parent | ee4868aa157551cc43239a2eb62633bed4c8720d (diff) |
Continue kettenis@'s revert:
Revert previous commit; the XR17V35X probe that was added accesses registers
that aren't guaranteed to be there and may even belong to a different device.
This triggers a fault on hppa machines like the C3000 for example.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/puc.c | 45 | ||||
-rw-r--r-- | sys/dev/pci/pucdata.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/pucvar.h | 7 |
3 files changed, 11 insertions, 51 deletions
diff --git a/sys/dev/pci/puc.c b/sys/dev/pci/puc.c index bbd05098395..38d4d238319 100644 --- a/sys/dev/pci/puc.c +++ b/sys/dev/pci/puc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: puc.c,v 1.25 2018/04/15 15:07:25 jcs Exp $ */ +/* $OpenBSD: puc.c,v 1.26 2018/05/02 19:11:01 phessler Exp $ */ /* $NetBSD: puc.c,v 1.3 1999/02/06 06:29:54 cgd Exp $ */ /* @@ -61,7 +61,6 @@ #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> #include <dev/pci/pucvar.h> -#include <dev/pci/pcidevs.h> #include <dev/ic/comreg.h> #include <dev/ic/comvar.h> @@ -79,7 +78,6 @@ int puc_pci_detach(struct device *, int); const char *puc_pci_intr_string(struct puc_attach_args *); void *puc_pci_intr_establish(struct puc_attach_args *, int, int (*)(void *), void *, char *); -int puc_pci_xr17v35x_intr(void *arg); struct cfattach puc_pci_ca = { sizeof(struct puc_pci_softc), puc_pci_match, @@ -127,20 +125,9 @@ puc_pci_intr_establish(struct puc_attach_args *paa, int type, { struct puc_pci_softc *sc = paa->puc; struct puc_softc *psc = &sc->sc_psc; - - if (psc->sc_xr17v35x) { - psc->sc_ports[paa->port].real_intrhand = func; - psc->sc_ports[paa->port].real_intrhand_arg = arg; - if (paa->port == 0) - psc->sc_ports[paa->port].intrhand = - pci_intr_establish(sc->pc, sc->ih, type, - puc_pci_xr17v35x_intr, sc, name); - return (psc->sc_ports[paa->port].real_intrhand); - } else { - psc->sc_ports[paa->port].intrhand = - pci_intr_establish(sc->pc, sc->ih, type, func, arg, name); - return (psc->sc_ports[paa->port].intrhand); - } + + psc->sc_ports[paa->port].intrhand = + pci_intr_establish(sc->pc, sc->ih, type, func, arg, name); return (psc->sc_ports[paa->port].intrhand); } @@ -159,10 +146,6 @@ puc_pci_attach(struct device *parent, struct device *self, void *aux) sc->sc_desc = puc_find_description(PCI_VENDOR(pa->pa_id), PCI_PRODUCT(pa->pa_id), PCI_VENDOR(subsys), PCI_PRODUCT(subsys)); - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_EXAR && - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_EXAR_XR17V354) - sc->sc_xr17v35x = 1; - puc_print_ports(sc->sc_desc); for (i = 0; i < PUC_NBARS; i++) { @@ -336,6 +319,7 @@ puc_find_description(u_int16_t vend, u_int16_t prod, const char * puc_port_type_name(int type) { + if (PUC_IS_COM(type)) return "com"; if (PUC_IS_LPT(type)) @@ -364,22 +348,3 @@ puc_print_ports(const struct puc_device_description *desc) } printf("\n"); } - -int -puc_pci_xr17v35x_intr(void *arg) -{ - struct puc_pci_softc *sc = arg; - struct puc_softc *psc = &sc->sc_psc; - int ports, i; - - ports = bus_space_read_1(psc->sc_bar_mappings[0].t, - psc->sc_bar_mappings[0].h, UART_EXAR_INT0); - - for (i = 0; i < 8; i++) { - if ((ports & (1 << i)) && psc->sc_ports[i].real_intrhand) - (*(psc->sc_ports[i].real_intrhand))( - psc->sc_ports[i].real_intrhand_arg); - } - - return (1); -} diff --git a/sys/dev/pci/pucdata.c b/sys/dev/pci/pucdata.c index 840b8e156b9..8054e8c5e60 100644 --- a/sys/dev/pci/pucdata.c +++ b/sys/dev/pci/pucdata.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pucdata.c,v 1.108 2018/04/15 15:07:25 jcs Exp $ */ +/* $OpenBSD: pucdata.c,v 1.109 2018/05/02 19:11:01 phessler Exp $ */ /* $NetBSD: pucdata.c,v 1.6 1999/07/03 05:55:23 cgd Exp $ */ /* @@ -2062,10 +2062,10 @@ const struct puc_device_description puc_devs[] = { { PCI_VENDOR_EXAR, PCI_PRODUCT_EXAR_XR17V354, 0, 0 }, { 0xffff, 0xffff, 0, 0 }, { - { PUC_PORT_COM_125MHZ, 0x10, 0x0000 }, - { PUC_PORT_COM_125MHZ, 0x10, 0x0400 }, - { PUC_PORT_COM_125MHZ, 0x10, 0x0800 }, - { PUC_PORT_COM_125MHZ, 0x10, 0x0C00 }, + { PUC_PORT_COM_MUL8, 0x10, 0x0000 }, + { PUC_PORT_COM_MUL8, 0x10, 0x0400 }, + { PUC_PORT_COM_MUL8, 0x10, 0x0800 }, + { PUC_PORT_COM_MUL8, 0x10, 0x0C00 }, }, }, diff --git a/sys/dev/pci/pucvar.h b/sys/dev/pci/pucvar.h index c4c655e6fea..da3d0784d9b 100644 --- a/sys/dev/pci/pucvar.h +++ b/sys/dev/pci/pucvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pucvar.h,v 1.15 2018/04/15 15:07:25 jcs Exp $ */ +/* $OpenBSD: pucvar.h,v 1.16 2018/05/02 19:11:01 phessler Exp $ */ /* $NetBSD: pucvar.h,v 1.2 1999/02/06 06:29:54 cgd Exp $ */ /* @@ -72,7 +72,6 @@ static const struct puc_port_type puc_port_types[] = { { PUC_PORT_COM_MUL8, COM_FREQ * 8 }, { PUC_PORT_COM_MUL10, COM_FREQ * 10 }, { PUC_PORT_COM_MUL128, COM_FREQ * 128 }, - { PUC_PORT_COM_125MHZ, 125000000 }, }; #define PUC_IS_LPT(type) ((type) == PUC_PORT_LPT) @@ -118,11 +117,7 @@ struct puc_softc { struct device *dev; /* filled in by port attachments */ void *intrhand; - int (*real_intrhand)(void *); - void *real_intrhand_arg; } sc_ports[PUC_MAX_PORTS]; - - int sc_xr17v35x; }; const struct puc_device_description * |