|
|
1.1 root 1: /*
2: * Copyright (c) 1988 University of Utah.
3: * Copyright (c) 1990 The Regents of the University of California.
4: * All rights reserved.
5: *
6: * This code is derived from software contributed to Berkeley by
7: * the Systems Programming Group of the University of Utah Computer
8: * Science Department.
9: *
10: * Redistribution is only permitted until one year after the first shipment
11: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and
12: * binary forms are permitted provided that: (1) source distributions retain
13: * this entire copyright notice and comment, and (2) distributions including
14: * binaries display the following acknowledgement: This product includes
15: * software developed by the University of California, Berkeley and its
16: * contributors'' in the documentation or other materials provided with the
17: * distribution and in all advertising materials mentioning features or use
18: * of this software. Neither the name of the University nor the names of
19: * its contributors may be used to endorse or promote products derived from
20: * this software without specific prior written permission.
21: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
22: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
23: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
24: *
25: * from: Utah $Hdr: autoconf.c 1.9 89/10/07$
26: *
27: * @(#)autoconf.c 7.2 (Berkeley) 5/25/90
28: */
29:
30: #include "samachdep.h"
31: #include "param.h"
32:
33: #include "../hpdev/device.h"
34: #include "../hpdev/grfvar.h"
35:
36: struct hp_hw sc_table[MAX_CTLR];
37:
38: extern int internalhpib;
39:
40: #if 0
41: #include "rominfo.h"
42: printrominfo()
43: {
44: struct rominfo *rp = (struct rominfo *)ROMADDR;
45: printf("boottype %x, name %s, lowram %x, sysflag %x\n",
46: rp->boottype, rp->name, rp->lowram, rp->sysflag&0xff);
47: printf("rambase %x, ndrives %x, sysflag2 %x, msus %x\n",
48: rp->rambase, rp->ndrives, rp->sysflag2&0xff, rp->msus);
49: }
50: #endif
51:
52: configure()
53: {
54: find_devs();
55: cninit();
56: #if 0
57: printrominfo();
58: #endif
59: hpibinit();
60: scsiinit();
61: }
62:
63: sctoaddr(sc)
64: int sc;
65: {
66: if (sc == -2)
67: return(0x1000000);
68: if (sc == -1)
69: return(GRFIADDR);
70: if (sc == 7 && internalhpib)
71: return(internalhpib);
72: if (sc < 32)
73: return(0x600000+(0x10000*sc));
74: return(sc);
75: }
76:
77: /*
78: * Probe all select codes (0 - 32) and internal display address.
79: * Note that we only care about displays, SCSIs and HP-IBs.
80: */
81: find_devs()
82: {
83: u_char *id_reg;
84: register short sc;
85: register int addr;
86: register struct hp_hw *hw;
87:
88: hw = sc_table;
89: for (sc = -2; sc < 32; sc++) {
90: addr = sctoaddr(sc);
91: if (badaddr(addr))
92: continue;
93:
94: id_reg = (u_char *) addr;
95: hw->hw_addr = (char *) addr;
96: hw->hw_id = id_reg[1] & 0xff;
97: hw->hw_sc = sc;
98:
99: /*
100: * Not all internal HP-IBs respond rationally to id requests
101: * so we just go by the "internal HPIB" indicator in SYSFLAG.
102: */
103: if (sc == 7 && internalhpib) {
104: hw->hw_type = HPIB;
105: hw++;
106: continue;
107: }
108:
109: switch (hw->hw_id) {
110: case 5: /* 98642A */
111: case 128+5: /* 98642A remote */
112: hw->hw_type = COMMDCM;
113: break;
114: case 8: /* 98625B */
115: case 128: /* 98624A */
116: hw->hw_type = HPIB;
117: break;
118: case 57: /* Displays */
119: hw->hw_type = BITMAP;
120: hw->hw_id2 = id_reg[0x15];
121: switch (hw->hw_id2) {
122: case 4: /* renaissance */
123: case 8: /* davinci */
124: sc++; /* occupy 2 select codes */
125: break;
126: }
127: break;
128: case 9:
129: hw->hw_type = KEYBOARD;
130: break;
131: case 7:
132: case 39:
133: case 71:
134: case 103:
135: hw->hw_type = SCSI;
136: break;
137: default: /* who cares */
138: hw->hw_type = MISC;
139: break;
140: }
141: hw++;
142: }
143: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.