Home | History | Annotate | Line # | Download | only in uba
uba_sbi.c revision 1.31
      1  1.31    rillig /*	$NetBSD: uba_sbi.c,v 1.31 2025/10/09 23:50:15 rillig Exp $	   */
      2  1.21       agc /*
      3  1.21       agc  * Copyright (c) 1982, 1986 The Regents of the University of California.
      4  1.21       agc  * All rights reserved.
      5  1.21       agc  *
      6  1.21       agc  * Redistribution and use in source and binary forms, with or without
      7  1.21       agc  * modification, are permitted provided that the following conditions
      8  1.21       agc  * are met:
      9  1.21       agc  * 1. Redistributions of source code must retain the above copyright
     10  1.21       agc  *    notice, this list of conditions and the following disclaimer.
     11  1.21       agc  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.21       agc  *    notice, this list of conditions and the following disclaimer in the
     13  1.21       agc  *    documentation and/or other materials provided with the distribution.
     14  1.21       agc  * 3. Neither the name of the University nor the names of its contributors
     15  1.21       agc  *    may be used to endorse or promote products derived from this software
     16  1.21       agc  *    without specific prior written permission.
     17  1.21       agc  *
     18  1.21       agc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     19  1.21       agc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     20  1.21       agc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     21  1.21       agc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     22  1.21       agc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     23  1.21       agc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     24  1.21       agc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     25  1.21       agc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     26  1.21       agc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     27  1.21       agc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     28  1.21       agc  * SUCH DAMAGE.
     29  1.21       agc  *
     30  1.21       agc  *	@(#)uba.c	7.10 (Berkeley) 12/16/90
     31  1.21       agc  *	@(#)autoconf.c	7.20 (Berkeley) 5/9/91
     32  1.21       agc  */
     33  1.21       agc 
     34   1.1     ragge /*
     35   1.1     ragge  * Copyright (c) 1996 Jonathan Stone.
     36   1.1     ragge  * Copyright (c) 1994, 1996 Ludd, University of Lule}, Sweden.
     37   1.1     ragge  *
     38   1.1     ragge  * Redistribution and use in source and binary forms, with or without
     39   1.1     ragge  * modification, are permitted provided that the following conditions
     40   1.1     ragge  * are met:
     41   1.1     ragge  * 1. Redistributions of source code must retain the above copyright
     42   1.1     ragge  *    notice, this list of conditions and the following disclaimer.
     43   1.1     ragge  * 2. Redistributions in binary form must reproduce the above copyright
     44   1.1     ragge  *    notice, this list of conditions and the following disclaimer in the
     45   1.1     ragge  *    documentation and/or other materials provided with the distribution.
     46   1.1     ragge  *
     47   1.1     ragge  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     48   1.1     ragge  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     49   1.1     ragge  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     50   1.1     ragge  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     51   1.1     ragge  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     52   1.1     ragge  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     53   1.1     ragge  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     54   1.1     ragge  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     55   1.1     ragge  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     56   1.1     ragge  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     57   1.1     ragge  * SUCH DAMAGE.
     58   1.1     ragge  *
     59   1.1     ragge  *	@(#)uba.c	7.10 (Berkeley) 12/16/90
     60   1.1     ragge  *	@(#)autoconf.c	7.20 (Berkeley) 5/9/91
     61   1.1     ragge  */
     62  1.20     lukem 
     63  1.28     ragge /*
     64  1.28     ragge  * Abus support added by Johnny Billquist 2010
     65  1.28     ragge  * Changed UBA code to need to know less of the innards of the
     66  1.28     ragge  * actual machine at the same time. Information passed down from
     67  1.28     ragge  * the SBI bus instead.
     68  1.28     ragge  */
     69  1.28     ragge 
     70  1.20     lukem #include <sys/cdefs.h>
     71  1.31    rillig __KERNEL_RCSID(0, "$NetBSD: uba_sbi.c,v 1.31 2025/10/09 23:50:15 rillig Exp $");
     72  1.29      matt 
     73  1.29      matt #define _VAX_BUS_DMA_PRIVATE
     74   1.1     ragge 
     75   1.1     ragge #include <sys/param.h>
     76  1.29      matt #include <sys/systm.h>
     77  1.29      matt #include <sys/bus.h>
     78  1.29      matt #include <sys/cpu.h>
     79   1.1     ragge #include <sys/device.h>
     80   1.1     ragge #include <sys/kernel.h>
     81   1.1     ragge 
     82   1.1     ragge #include <machine/nexus.h>
     83   1.1     ragge #include <machine/sgmap.h>
     84   1.1     ragge #include <machine/scb.h>
     85   1.1     ragge 
     86   1.1     ragge #include <dev/qbus/ubavar.h>
     87   1.1     ragge 
     88   1.5      matt #include <vax/uba/uba_common.h>
     89   1.1     ragge 
     90   1.6     ragge #include "locators.h"
     91   1.1     ragge #include "ioconf.h"
     92   1.1     ragge 
     93   1.1     ragge /* Some SBI-specific defines */
     94   1.1     ragge #define UBASIZE		(UBAPAGES * VAX_NBPG)
     95  1.28     ragge #define UMEM(sa,i) ((sa->sa_base)+0x100000+(i)*0x40000)
     96   1.1     ragge 
     97   1.1     ragge /*
     98   1.1     ragge  * Some status registers.
     99   1.1     ragge  */
    100   1.1     ragge #define UBACNFGR_UBIC  0x00010000      /* unibus init complete */
    101   1.1     ragge #define UBACNFGR_BITS \
    102  1.31    rillig "\20\40PARFLT\37WSQFLT\36URDFLT\35ISQFLT\34MXTFLT\33XMTFLT\30ADPDN\27ADPUP\23UBINIT\22UBPDN\21UBIC"
    103   1.1     ragge 
    104   1.1     ragge #define UBACR_IFS      0x00000040      /* interrupt field switch */
    105   1.1     ragge #define UBACR_BRIE     0x00000020      /* BR interrupt enable */
    106   1.1     ragge #define UBACR_USEFIE   0x00000010      /* UNIBUS to SBI error field IE */
    107   1.1     ragge #define UBACR_SUEFIE   0x00000008      /* SBI to UNIBUS error field IE */
    108   1.1     ragge #define UBACR_ADINIT   0x00000001      /* adapter init */
    109   1.1     ragge 
    110   1.1     ragge #define UBADPR_BNE     0x80000000      /* buffer not empty - purge */
    111   1.1     ragge 
    112   1.1     ragge #define UBABRRVR_DIV    0x0000ffff      /* device interrupt vector field */
    113   1.1     ragge 
    114   1.1     ragge #define UBASR_BITS \
    115   1.1     ragge "\20\13RDTO\12RDS\11CRD\10CXTER\7CXTMO\6DPPE\5IVMR\4MRPF\3LEB\2UBSTO\1UBSSYNTO"
    116   1.1     ragge 
    117  1.24      matt const char ubasr_bits[] = UBASR_BITS;
    118   1.1     ragge 
    119   1.1     ragge /*
    120   1.1     ragge  * The DW780 are directly connected to the SBI on 11/780 and 8600.
    121   1.1     ragge  */
    122  1.24      matt static	int	dw780_match(device_t, cfdata_t, void *);
    123  1.24      matt static	void	dw780_attach(device_t, device_t, void *);
    124   1.6     ragge static	void	dw780_init(struct uba_softc*);
    125   1.6     ragge static	void    dw780_beforescan(struct uba_softc *);
    126   1.6     ragge static	void    dw780_afterscan(struct uba_softc *);
    127   1.6     ragge static	int     dw780_errchk(struct uba_softc *);
    128  1.25      hans static	inline	void uba_dw780int_common(void *, int);
    129  1.25      hans static	void    uba_dw780int_0x14(void *);
    130  1.25      hans static	void    uba_dw780int_0x15(void *);
    131  1.25      hans static	void    uba_dw780int_0x16(void *);
    132  1.25      hans static	void    uba_dw780int_0x17(void *);
    133   1.6     ragge static  void	ubaerror(struct uba_softc *, int *, int *);
    134   1.1     ragge #ifdef notyet
    135   1.6     ragge static	void	dw780_purge(struct uba_softc *, int);
    136   1.1     ragge #endif
    137   1.1     ragge 
    138  1.24      matt CFATTACH_DECL_NEW(uba_sbi, sizeof(struct uba_vsoftc),
    139  1.19   thorpej     dw780_match, dw780_attach, NULL, NULL);
    140   1.1     ragge 
    141  1.15     ragge static struct evcnt strayint = EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "uba","stray intr");
    142  1.15     ragge static int strayinit = 0;
    143  1.15     ragge 
    144   1.1     ragge extern	struct vax_bus_space vax_mem_bus_space;
    145   1.1     ragge 
    146   1.1     ragge int
    147  1.24      matt dw780_match(device_t parent, cfdata_t cf, void *aux)
    148   1.1     ragge {
    149  1.24      matt 	struct sbi_attach_args * const sa = aux;
    150   1.1     ragge 
    151   1.6     ragge 	if (cf->cf_loc[SBICF_TR] != sa->sa_nexnum &&
    152   1.6     ragge 	    cf->cf_loc[SBICF_TR] != SBICF_TR_DEFAULT)
    153   1.1     ragge 		return 0;
    154   1.1     ragge 	/*
    155   1.1     ragge 	 * The uba type is actually only telling where the uba
    156   1.1     ragge 	 * space is in nexus space.
    157   1.1     ragge 	 */
    158   1.6     ragge 	if ((sa->sa_type & ~3) != NEX_UBA0)
    159   1.1     ragge 		return 0;
    160   1.1     ragge 
    161   1.1     ragge 	return 1;
    162   1.1     ragge }
    163   1.1     ragge 
    164   1.1     ragge void
    165  1.24      matt dw780_attach(device_t parent, device_t self, void *aux)
    166   1.1     ragge {
    167  1.24      matt 	struct uba_vsoftc * const sc = device_private(self);
    168  1.24      matt 	struct sbi_attach_args * const sa = aux;
    169   1.6     ragge 	int ubaddr = sa->sa_type & 3;
    170   1.1     ragge 
    171  1.28     ragge 	aprint_naive(": DW780\n");
    172  1.24      matt 	aprint_normal(": DW780\n");
    173  1.24      matt 
    174   1.1     ragge 	/*
    175   1.1     ragge 	 * Fill in bus specific data.
    176   1.1     ragge 	 */
    177  1.24      matt 	sc->uv_sc.uh_dev = self;
    178   1.1     ragge 	sc->uv_sc.uh_ubainit = dw780_init;
    179   1.1     ragge #ifdef notyet
    180   1.1     ragge 	sc->uv_sc.uh_ubapurge = dw780_purge;
    181   1.1     ragge #endif
    182   1.1     ragge 	sc->uv_sc.uh_beforescan = dw780_beforescan;
    183   1.1     ragge 	sc->uv_sc.uh_afterscan = dw780_afterscan;
    184   1.1     ragge 	sc->uv_sc.uh_errchk = dw780_errchk;
    185  1.24      matt 	sc->uv_sc.uh_iot = sa->sa_iot;
    186   1.1     ragge 	sc->uv_sc.uh_dmat = &sc->uv_dmat;
    187  1.16     ragge 	sc->uv_sc.uh_nr = ubaddr;
    188   1.6     ragge 	sc->uv_uba = (void *)sa->sa_ioh;
    189   1.1     ragge 	sc->uh_ibase = VAX_NBPG + ubaddr * VAX_NBPG;
    190  1.12     ragge 	sc->uv_sc.uh_type = UBA_UBA;
    191   1.1     ragge 
    192  1.15     ragge 	if (strayinit++ == 0) evcnt_attach_static(&strayint); /* Setup stray
    193  1.15     ragge 							         interrupt
    194  1.15     ragge 							         counter. */
    195  1.15     ragge 
    196   1.1     ragge 	/*
    197   1.1     ragge 	 * Set up dispatch vectors for DW780.
    198   1.1     ragge 	 */
    199  1.25      hans #define SCB_VECALLOC_DW780(br)						\
    200  1.25      hans 	scb_vecalloc(vecnum(0, br, sa->sa_nexnum), uba_dw780int_ ## br,	\
    201  1.25      hans 		     sc, SCB_ISTACK, &sc->uv_sc.uh_intrcnt)		\
    202  1.25      hans 
    203  1.25      hans 	SCB_VECALLOC_DW780(0x14);
    204  1.25      hans 	SCB_VECALLOC_DW780(0x15);
    205  1.25      hans 	SCB_VECALLOC_DW780(0x16);
    206  1.25      hans 	SCB_VECALLOC_DW780(0x17);
    207  1.25      hans 
    208   1.7      matt 	evcnt_attach_dynamic(&sc->uv_sc.uh_intrcnt, EVCNT_TYPE_INTR, NULL,
    209  1.24      matt 		device_xname(sc->uv_sc.uh_dev), "intr");
    210   1.5      matt 
    211   1.1     ragge 	/*
    212   1.1     ragge 	 * Fill in variables used by the sgmap system.
    213   1.1     ragge 	 */
    214   1.4     ragge 	sc->uv_size = UBASIZE;		/* Size in bytes of Unibus space */
    215   1.1     ragge 
    216   1.1     ragge 	uba_dma_init(sc);
    217  1.28     ragge 	uba_attach(&sc->uv_sc, UMEM(sa,ubaddr) + (UBAPAGES * VAX_NBPG));
    218   1.1     ragge }
    219   1.1     ragge 
    220   1.1     ragge void
    221  1.13     ragge dw780_beforescan(struct uba_softc *sc)
    222   1.1     ragge {
    223  1.24      matt 	struct uba_vsoftc * const vc = (void *)sc;
    224   1.1     ragge 	volatile int *hej = &vc->uv_uba->uba_sr;
    225   1.1     ragge 
    226   1.1     ragge 	*hej = *hej;
    227   1.1     ragge 	vc->uv_uba->uba_cr = UBACR_IFS|UBACR_BRIE;
    228   1.1     ragge }
    229   1.1     ragge 
    230   1.1     ragge void
    231  1.13     ragge dw780_afterscan(struct uba_softc *sc)
    232   1.1     ragge {
    233  1.24      matt 	struct uba_vsoftc * const vc = (void *)sc;
    234   1.1     ragge 
    235   1.1     ragge 	vc->uv_uba->uba_cr = UBACR_IFS | UBACR_BRIE |
    236   1.1     ragge 	    UBACR_USEFIE | UBACR_SUEFIE |
    237   1.1     ragge 	    (vc->uv_uba->uba_cr & 0x7c000000);
    238   1.1     ragge }
    239   1.1     ragge 
    240   1.1     ragge 
    241   1.1     ragge int
    242  1.13     ragge dw780_errchk(struct uba_softc *sc)
    243   1.1     ragge {
    244  1.24      matt 	struct uba_vsoftc * const vc = (void *)sc;
    245   1.1     ragge 	volatile int *hej = &vc->uv_uba->uba_sr;
    246   1.1     ragge 
    247   1.1     ragge 	if (*hej) {
    248   1.1     ragge 		*hej = *hej;
    249   1.1     ragge 		return 1;
    250   1.1     ragge 	}
    251   1.1     ragge 	return 0;
    252   1.1     ragge }
    253   1.1     ragge 
    254  1.25      hans static inline void
    255  1.25      hans uba_dw780int_common(void *arg, int br)
    256   1.1     ragge {
    257  1.13     ragge 	extern	void scb_stray(void *);
    258   1.2      matt 	struct	uba_vsoftc *vc = arg;
    259   1.1     ragge 	struct	uba_regs *ur = vc->uv_uba;
    260  1.13     ragge 	struct	ivec_dsp *ivec;
    261  1.15     ragge 	struct  evcnt *uvec;
    262  1.25      hans 	int	vec;
    263   1.1     ragge 
    264  1.15     ragge 	uvec = &vc->uv_sc.uh_intrcnt;
    265   1.1     ragge 	vec = ur->uba_brrvr[br - 0x14];
    266  1.14     ragge 	if (vec <= 0) {
    267  1.14     ragge 		ubaerror(&vc->uv_sc, &br, &vec);
    268  1.14     ragge 		if (vec == 0)
    269  1.14     ragge 			return;
    270  1.14     ragge 	}
    271  1.13     ragge 
    272  1.15     ragge 	uvec->ev_count--;	/* This interrupt should not be counted against
    273  1.15     ragge 				   the uba. */
    274  1.15     ragge 	ivec = &scb_vec[(vc->uh_ibase + vec)/4];
    275  1.15     ragge 	if (cold && *ivec->hoppaddr == scb_stray) {
    276   1.1     ragge 		scb_fake(vec + vc->uh_ibase, br);
    277  1.13     ragge 	} else {
    278  1.15     ragge 		if (*ivec->hoppaddr == scb_stray)
    279  1.15     ragge 			strayint.ev_count++; /* Count against stray int */
    280  1.15     ragge 		else
    281  1.15     ragge 			ivec->ev->ev_count++; /* Count against device */
    282  1.13     ragge 		(*ivec->hoppaddr)(ivec->pushlarg);
    283   1.1     ragge 	}
    284   1.1     ragge }
    285   1.1     ragge 
    286  1.25      hans #define UBA_DW780INT(br)		\
    287  1.25      hans void					\
    288  1.25      hans uba_dw780int_ ## br(void *arg)		\
    289  1.25      hans {					\
    290  1.25      hans 	uba_dw780int_common(arg, br);	\
    291  1.25      hans }					\
    292  1.25      hans 
    293  1.25      hans UBA_DW780INT(0x14);
    294  1.25      hans UBA_DW780INT(0x15);
    295  1.25      hans UBA_DW780INT(0x16);
    296  1.25      hans UBA_DW780INT(0x17);
    297  1.25      hans 
    298   1.1     ragge void
    299  1.13     ragge dw780_init(struct uba_softc *sc)
    300   1.1     ragge {
    301   1.1     ragge 	struct uba_vsoftc *vc = (void *)sc;
    302   1.1     ragge 
    303   1.1     ragge 	vc->uv_uba->uba_cr = UBACR_ADINIT;
    304   1.1     ragge 	vc->uv_uba->uba_cr = UBACR_IFS|UBACR_BRIE|UBACR_USEFIE|UBACR_SUEFIE;
    305   1.1     ragge 	while ((vc->uv_uba->uba_cnfgr & UBACNFGR_UBIC) == 0)
    306   1.1     ragge 		;
    307   1.1     ragge }
    308   1.1     ragge 
    309   1.1     ragge #ifdef notyet
    310   1.1     ragge void
    311  1.27       dsl dw780_purge(struct uba_softc *sc, int bdp)
    312   1.1     ragge {
    313   1.1     ragge 	struct uba_vsoftc *vc = (void *)sc;
    314   1.1     ragge 
    315   1.1     ragge 	vc->uv_uba->uba_dpr[bdp] |= UBADPR_BNE;
    316   1.1     ragge }
    317   1.1     ragge #endif
    318   1.1     ragge 
    319   1.1     ragge int	ubawedgecnt = 10;
    320   1.1     ragge int	ubacrazy = 500;
    321   1.1     ragge int	zvcnt_max = 5000;	/* in 8 sec */
    322   1.1     ragge int	ubaerrcnt;
    323   1.1     ragge /*
    324   1.1     ragge  * This routine is called by the locore code to process a UBA
    325   1.1     ragge  * error on an 11/780 or 8600.	The arguments are passed
    326   1.1     ragge  * on the stack, and value-result (through some trickery).
    327   1.1     ragge  * In particular, the uvec argument is used for further
    328   1.1     ragge  * uba processing so the result aspect of it is very important.
    329   1.1     ragge  */
    330   1.1     ragge /*ARGSUSED*/
    331   1.1     ragge void
    332  1.13     ragge ubaerror(struct uba_softc *uh, int *ipl, int *uvec)
    333   1.1     ragge {
    334   1.1     ragge 	struct uba_vsoftc *vc = (void *)uh;
    335   1.1     ragge 	struct	uba_regs *uba = vc->uv_uba;
    336  1.14     ragge 	int sr, s;
    337  1.10     ragge 	char sbuf[256], sbuf2[256];
    338   1.1     ragge 
    339   1.1     ragge 	if (*uvec == 0) {
    340   1.1     ragge 		/*
    341   1.1     ragge 		 * Declare dt as unsigned so that negative values
    342   1.1     ragge 		 * are handled as >8 below, in case time was set back.
    343   1.1     ragge 		 */
    344  1.23     joerg 		u_long	dt = time_second - vc->uh_zvtime;
    345   1.1     ragge 
    346   1.1     ragge 		vc->uh_zvtotal++;
    347   1.1     ragge 		if (dt > 8) {
    348  1.23     joerg 			vc->uh_zvtime = time_second;
    349   1.1     ragge 			vc->uh_zvcnt = 0;
    350   1.1     ragge 		}
    351   1.1     ragge 		if (++vc->uh_zvcnt > zvcnt_max) {
    352  1.24      matt 			aprint_error_dev(vc->uv_sc.uh_dev,
    353  1.24      matt 			    "too many zero vectors (%d in <%d sec)\n",
    354  1.24      matt 			    vc->uh_zvcnt, (int)dt + 1);
    355   1.9        tv 
    356  1.26  christos 			snprintb(sbuf, sizeof(sbuf), UBACNFGR_BITS,
    357  1.26  christos 			    uba->uba_cnfgr & ~0xff);
    358  1.24      matt 			aprint_error(
    359  1.24      matt 			    "\tIPL 0x%x\n"
    360  1.24      matt 			    "\tcnfgr: %s\tAdapter Code: 0x%x\n",
    361  1.24      matt 			    *ipl, sbuf, uba->uba_cnfgr&0xff);
    362  1.24      matt 
    363  1.26  christos 			snprintb(sbuf, sizeof(sbuf), ubasr_bits, uba->uba_sr);
    364  1.24      matt 			aprint_error(
    365  1.24      matt 			    "\tsr: %s\n"
    366  1.24      matt 			    "\tdcr: %x (MIC %sOK)\n",
    367  1.24      matt 			    sbuf, uba->uba_dcr,
    368  1.24      matt 			    (uba->uba_dcr&0x8000000)?"":"NOT ");
    369   1.9        tv 
    370   1.3     ragge 			ubareset(&vc->uv_sc);
    371   1.1     ragge 		}
    372   1.1     ragge 		return;
    373   1.1     ragge 	}
    374   1.1     ragge 	if (uba->uba_cnfgr & NEX_CFGFLT) {
    375  1.26  christos 		snprintb(sbuf, sizeof(sbuf), ubasr_bits, uba->uba_sr);
    376  1.26  christos 		snprintb(sbuf2, sizeof(sbuf2), NEXFLT_BITS, uba->uba_cnfgr);
    377  1.24      matt 		aprint_error_dev(vc->uv_sc.uh_dev,
    378  1.24      matt 		    "sbi fault sr=%s cnfgr=%s\n", sbuf, sbuf2);
    379   1.3     ragge 		ubareset(&vc->uv_sc);
    380   1.1     ragge 		*uvec = 0;
    381   1.1     ragge 		return;
    382   1.1     ragge 	}
    383   1.1     ragge 	sr = uba->uba_sr;
    384  1.11   thorpej 	s = spluba();
    385  1.26  christos 	snprintb(sbuf, sizeof(sbuf), ubasr_bits, uba->uba_sr);
    386  1.24      matt 	aprint_error_dev(vc->uv_sc.uh_dev,
    387  1.24      matt 	    "uba error sr=%s fmer=%x fubar=%o\n",
    388   1.9        tv 	    sbuf, uba->uba_fmer, 4*uba->uba_fubar);
    389   1.1     ragge 	splx(s);
    390   1.1     ragge 	uba->uba_sr = sr;
    391   1.1     ragge 	*uvec &= UBABRRVR_DIV;
    392   1.1     ragge 	if (++ubaerrcnt % ubawedgecnt == 0) {
    393   1.1     ragge 		if (ubaerrcnt > ubacrazy)
    394   1.1     ragge 			panic("uba crazy");
    395   1.1     ragge 		printf("ERROR LIMIT ");
    396   1.3     ragge 		ubareset(&vc->uv_sc);
    397   1.1     ragge 		*uvec = 0;
    398   1.1     ragge 	}
    399   1.1     ragge }
    400