1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
/* $OpenBSD: dz_ioasic.c,v 1.1 2000/08/19 18:36:19 maja Exp $ */
/* $NetBSD: dc_ioasic.c,v 1.4 1996/10/14 17:15:42 jonathan Exp $ */
/*
* Copyright 1996 The Board of Trustees of The Leland Stanford
* Junior University. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies. Stanford University
* makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without
* express or implied warranty.
*
* this driver contributed by Jonathan Stone
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/types.h>
#include <sys/device.h>
#include <sys/tty.h>
#include <machine/autoconf.h>
#include <dev/tc/tcvar.h>
#include <dev/tc/ioasicvar.h>
#include <machine/dc7085cons.h>
#include <pmax/dev/dzvar.h>
#include <pmax/dev/dz_ioasic_cons.h>
#include <pmax/pmax/kn02.h>
/*
* Autoconfig definition of driver front-end
*/
int dz_ioasic_match __P((struct device * parent, void *cfdata, void *aux));
void dz_ioasic_attach __P((struct device *parent, struct device *self, void *aux));
struct cfattach dz_ioasic_ca = {
sizeof(struct dz_softc), dz_ioasic_match, dz_ioasic_attach
};
/*
* Initialize a line for (polled) console I/O
*/
int
dz_ioasic_consinit(dev)
dev_t dev;
{
#if defined(DEBUG) && 0
printf("dz_ioasic(%d,%d): serial console at 0x%x\n",
minor(dev) >> 2, minor(dev) & 03,
MIPS_PHYS_TO_KSEG1(KN02_SYS_DZ));
DELAY(100000);
#endif
dz_consinit(dev, (void *)MIPS_PHYS_TO_KSEG1(KN02_SYS_DZ));
return(1);
}
/*
* Match driver on 5000/200
* (not a real ioasic, but we configure it as one)
*/
int
dz_ioasic_match(parent, match, aux)
struct device *parent;
void *match;
void *aux;
{
struct ioasicdev_attach_args *d = aux;
if (strcmp(d->iada_modname, "dc") != 0 &&
strcmp(d->iada_modname, "dc7085") != 0)
return (0);
if (badaddr((caddr_t)(d->iada_addr), 2))
return (0);
return (1);
}
void
dz_ioasic_attach(parent, self, aux)
struct device *parent;
struct device *self;
void *aux;
{
struct dz_softc *sc = (void*) self;
struct ioasicdev_attach_args *d = aux;
caddr_t dcaddr;
dcaddr = (caddr_t)d->iada_addr;
printf(" address %p", dcaddr);
(void) dzattach(sc, (void*)MIPS_PHYS_TO_KSEG1(dcaddr),
/* dtr/dsr mask */ (1<< DCPRINTER_PORT) + (1 << DCCOMM_PORT),
#ifdef HW_FLOW_CONTROL
/* rts/cts mask */ (1<< DCPRINTER_PORT) + (1 << DCCOMM_PORT),
#else
0,
#endif
1, 3);
/* tie pseudo-slot to device */
ioasic_intr_establish(parent, d->iada_cookie, TC_IPL_TTY,
dzintr, self);
printf("\n");
}
|