1 /* $NetBSD: aster.c,v 1.20 2003/01/01 00:28:57 thorpej Exp $ */
4 * Copyright (c) 1998,2001 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Ignatios Souvatzis.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #include <sys/cdefs.h>
33 __KERNEL_RCSID(0, "$NetBSD: aster.c,v 1.20 2003/01/01 00:28:57 thorpej Exp $");
36 * zbus ISDN Blaster, ISDN Master driver.
39 #include <sys/types.h>
42 #include <sys/device.h>
43 #include <sys/systm.h>
44 #include <sys/param.h>
46 #include <machine/bus.h>
48 #include <amiga/include/cpu.h>
50 #include <amiga/amiga/device.h>
51 #include <amiga/amiga/drcustom.h>
53 #include <amiga/dev/supio.h>
54 #include <amiga/dev/zbusvar.h>
59 struct bus_space_tag sc_bst
;
62 int astermatch(struct device
*, struct cfdata
*, void *);
63 void asterattach(struct device
*, struct device
*, void *);
64 int asterprint(void *auxp
, const char *);
66 CFATTACH_DECL(aster
, sizeof(struct aster_softc
),
67 astermatch
, asterattach
, NULL
, NULL
);
70 astermatch(struct device
*parent
, struct cfdata
*cfp
, void *auxp
)
73 struct zbus_args
*zap
;
77 if (zap
->manid
== 5001 && zap
->prodid
== 1) /* VMC ISDN Blaster */
80 if (zap
->manid
== 2092 && (zap
->prodid
== 64 || /* BSC ISDN Master */
81 zap
->prodid
== 65)) /* BSC ISDN Master II */
84 if (zap
->manid
== 5000 && zap
->prodid
== 1) /* ITH ISDN Master II */
87 if (zap
->manid
== 4626 && zap
->prodid
== 5 && zap
->serno
== 0)
88 return (1); /* Schoenfeld ISDN Surfer */
90 if (zap
->manid
== 2189 && zap
->prodid
== 3)
91 return (1); /* Zeus Dev. ? ISDN board */
97 asterattach(struct device
*parent
, struct device
*self
, void *auxp
)
99 struct aster_softc
*astrsc
;
100 struct zbus_args
*zap
;
101 struct supio_attach_args supa
;
103 astrsc
= (struct aster_softc
*)self
;
106 astrsc
->sc_bst
.base
= (u_long
)zap
->va
+ 0;
107 astrsc
->sc_bst
.absm
= &amiga_bus_stride_2
;
108 supa
.supio_ipl
= 2; /* could be 6. isic_supio will decide. */
110 switch (zap
->manid
) {
112 supa
.supio_name
= "isic31VMC ISDN Blaster";
115 supa
.supio_name
= "isic31BSC ISDN Master/Master II";
118 supa
.supio_name
= "isic13ITH ISDN Master II";
121 supa
.supio_name
= "isic@BZeus ISDN Link";
124 if (zap
->serno
== 0) {
126 "isic1CIndividual Comp. ISDN Surfer";
127 ((volatile u_int8_t
*)zap
->va
)[0x00fe] = 0xff;
128 if (((volatile u_int8_t
*)zap
->va
)[0x00fe] & 0x80)
136 printf(" IPL %d: %s\n", supa
.supio_ipl
, supa
.supio_name
+6);
138 supa
.supio_iot
= &astrsc
->sc_bst
;
140 supa
.supio_iobase
= 0;
142 config_found(self
, &supa
, asterprint
); /* XXX */
144 hyper3i_attach_subr(self
, &supa
, asterprint
);
149 asterprint(void *auxp
, const char *pnp
)
151 struct supio_attach_args
*supa
;
157 aprint_normal("%s at %s port 0x%04x",
158 supa
->supio_name
, pnp
, supa
->supio_iobase
);