Annotation of 43BSDReno/sys/vaxbi/bi.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1988 Regents of the University of California.
        !             3:  * All rights reserved.
        !             4:  *
        !             5:  * This code is derived from software contributed to Berkeley by
        !             6:  * Chris Torek.
        !             7:  *
        !             8:  * Redistribution is only permitted until one year after the first shipment
        !             9:  * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
        !            10:  * binary forms are permitted provided that: (1) source distributions retain
        !            11:  * this entire copyright notice and comment, and (2) distributions including
        !            12:  * binaries display the following acknowledgement:  This product includes
        !            13:  * software developed by the University of California, Berkeley and its
        !            14:  * contributors'' in the documentation or other materials provided with the
        !            15:  * distribution and in all advertising materials mentioning features or use
        !            16:  * of this software.  Neither the name of the University nor the names of
        !            17:  * its contributors may be used to endorse or promote products derived from
        !            18:  * this software without specific prior written permission.
        !            19:  * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
        !            20:  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
        !            21:  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
        !            22:  *
        !            23:  *     @(#)bi.c        7.3 (Berkeley) 6/28/90
        !            24:  */
        !            25: 
        !            26: /*
        !            27:  * VAXBI specific routines.
        !            28:  */
        !            29: 
        !            30: #include "param.h"
        !            31: 
        !            32: #include "../vax/cpu.h"
        !            33: #include "../vax/mtpr.h"
        !            34: #include "../vax/nexus.h"
        !            35: 
        !            36: #include "bireg.h"
        !            37: 
        !            38: bi_reset(bi)
        !            39:        register struct biiregs *bi;
        !            40: {
        !            41: 
        !            42:        bi->bi_csr |= BICSR_NRST;
        !            43:        DELAY(10000);           /* ??? */
        !            44: }
        !            45: 
        !            46: /*
        !            47:  * Reset with self test.  Return true iff reset fails.
        !            48:  * BEWARE, THIS RESETS THE BI ARBITRATION LEVEL TO ARB_NONE
        !            49:  * does self test ever cause a bi bus error?
        !            50:  */
        !            51: bi_selftest(bi)
        !            52:        register struct biiregs *bi;
        !            53: {
        !            54:        register int timo;
        !            55: 
        !            56:        bi->bi_csr |= BICSR_ARB_NONE;   /* why? */
        !            57:        bi->bi_csr |= BICSR_STS | BICSR_INIT;/* must this be separate? */
        !            58:        DELAY(50);                      /* why? */
        !            59:        timo = todr() + 1000;
        !            60:        while (bi->bi_csr & BICSR_BROKE) {
        !            61:                if (todr() > timo)      /* reset failed */
        !            62:                        return (-1);
        !            63:        }
        !            64:        return (0);                     /* reset OK */
        !            65: }
        !            66: 
        !            67: /*
        !            68:  * THIS SHOULD PROBABLY WORK MORE LIKE ubaerror()
        !            69:  * (but then we would need to be able to reset BI nodes)
        !            70:  * (we need a per-BI-device driver structure!)
        !            71:  */
        !            72: bi_buserr(binum)
        !            73:        int binum;
        !            74: {
        !            75:        register struct bi_node *bi;
        !            76:        register int node;
        !            77:        extern int bi_nodes;
        !            78:        extern int cold;
        !            79: 
        !            80:        printf("vaxbi%d: bus error\n", binum);
        !            81:        bi = (struct bi_node *) &nexus[binum * NNODEBI];/* XXX */
        !            82:        for (node = 0; node < 16; node++, bi++) {
        !            83:                if ((bi_nodes & (1 << node)) == 0)      /* XXX crude */
        !            84:                        continue;
        !            85:                printf("node %x: ber=%b\n", node, bi->biic.bi_ber, BIBER_BITS);
        !            86:        }
        !            87:        panic("bi_buserr");
        !            88: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.