ofisa_machdep.c revision 1.5.2.2 1 1.5.2.2 jmmv /* $NetBSD: ofisa_machdep.c,v 1.5.2.2 2007/08/03 16:02:18 jmmv Exp $ */
2 1.5.2.2 jmmv
3 1.5.2.2 jmmv /*
4 1.5.2.2 jmmv * Copyright 1998
5 1.5.2.2 jmmv * Digital Equipment Corporation. All rights reserved.
6 1.5.2.2 jmmv *
7 1.5.2.2 jmmv * This software is furnished under license and may be used and
8 1.5.2.2 jmmv * copied only in accordance with the following terms and conditions.
9 1.5.2.2 jmmv * Subject to these conditions, you may download, copy, install,
10 1.5.2.2 jmmv * use, modify and distribute this software in source and/or binary
11 1.5.2.2 jmmv * form. No title or ownership is transferred hereby.
12 1.5.2.2 jmmv *
13 1.5.2.2 jmmv * 1) Any source code used, modified or distributed must reproduce
14 1.5.2.2 jmmv * and retain this copyright notice and list of conditions as
15 1.5.2.2 jmmv * they appear in the source file.
16 1.5.2.2 jmmv *
17 1.5.2.2 jmmv * 2) No right is granted to use any trade name, trademark, or logo of
18 1.5.2.2 jmmv * Digital Equipment Corporation. Neither the "Digital Equipment
19 1.5.2.2 jmmv * Corporation" name nor any trademark or logo of Digital Equipment
20 1.5.2.2 jmmv * Corporation may be used to endorse or promote products derived
21 1.5.2.2 jmmv * from this software without the prior written permission of
22 1.5.2.2 jmmv * Digital Equipment Corporation.
23 1.5.2.2 jmmv *
24 1.5.2.2 jmmv * 3) This software is provided "AS-IS" and any express or implied
25 1.5.2.2 jmmv * warranties, including but not limited to, any implied warranties
26 1.5.2.2 jmmv * of merchantability, fitness for a particular purpose, or
27 1.5.2.2 jmmv * non-infringement are disclaimed. In no event shall DIGITAL be
28 1.5.2.2 jmmv * liable for any damages whatsoever, and in particular, DIGITAL
29 1.5.2.2 jmmv * shall not be liable for special, indirect, consequential, or
30 1.5.2.2 jmmv * incidental damages or damages for lost profits, loss of
31 1.5.2.2 jmmv * revenue or loss of use, whether such damages arise in contract,
32 1.5.2.2 jmmv * negligence, tort, under statute, in equity, at law or otherwise,
33 1.5.2.2 jmmv * even if advised of the possibility of such damage.
34 1.5.2.2 jmmv */
35 1.5.2.2 jmmv
36 1.5.2.2 jmmv #include <sys/cdefs.h>
37 1.5.2.2 jmmv __KERNEL_RCSID(0, "$NetBSD: ofisa_machdep.c,v 1.5.2.2 2007/08/03 16:02:18 jmmv Exp $");
38 1.5.2.2 jmmv
39 1.5.2.2 jmmv #include "opt_compat_old_ofw.h"
40 1.5.2.2 jmmv
41 1.5.2.2 jmmv #include <sys/param.h>
42 1.5.2.2 jmmv #include <sys/device.h>
43 1.5.2.2 jmmv #include <sys/systm.h>
44 1.5.2.2 jmmv #include <machine/bus.h>
45 1.5.2.2 jmmv #include <machine/intr.h>
46 1.5.2.2 jmmv
47 1.5.2.2 jmmv #include <dev/ofw/openfirm.h>
48 1.5.2.2 jmmv #include <dev/isa/isavar.h>
49 1.5.2.2 jmmv #include <dev/ofisa/ofisavar.h>
50 1.5.2.2 jmmv
51 1.5.2.2 jmmv #include "isadma.h"
52 1.5.2.2 jmmv
53 1.5.2.2 jmmv int
54 1.5.2.2 jmmv ofisa_get_isabus_data(phandle, iba)
55 1.5.2.2 jmmv int phandle;
56 1.5.2.2 jmmv struct isabus_attach_args *iba;
57 1.5.2.2 jmmv {
58 1.5.2.2 jmmv
59 1.5.2.2 jmmv iba->iba_iot = &isa_io_bs_tag;
60 1.5.2.2 jmmv iba->iba_memt = &isa_mem_bs_tag;
61 1.5.2.2 jmmv #if (NISADMA > 0)
62 1.5.2.2 jmmv iba->iba_dmat = &isa_bus_dma_tag;
63 1.5.2.2 jmmv #endif
64 1.5.2.2 jmmv iba->iba_ic = &isa_chipset_tag;
65 1.5.2.2 jmmv
66 1.5.2.2 jmmv return (0);
67 1.5.2.2 jmmv }
68 1.5.2.2 jmmv
69 1.5.2.2 jmmv int
70 1.5.2.2 jmmv ofisa_ignore_child(pphandle, cphandle)
71 1.5.2.2 jmmv int pphandle, cphandle;
72 1.5.2.2 jmmv {
73 1.5.2.2 jmmv
74 1.5.2.2 jmmv return (0);
75 1.5.2.2 jmmv }
76 1.5.2.2 jmmv
77 1.5.2.2 jmmv #ifdef COMPAT_OLD_OFW
78 1.5.2.2 jmmv
79 1.5.2.2 jmmv int
80 1.5.2.2 jmmv ofisa_md_match(parent, cf, aux)
81 1.5.2.2 jmmv struct device *parent;
82 1.5.2.2 jmmv struct cfdata *cf;
83 1.5.2.2 jmmv void *aux;
84 1.5.2.2 jmmv {
85 1.5.2.2 jmmv struct ofbus_attach_args *oba = aux;
86 1.5.2.2 jmmv char type[8];
87 1.5.2.2 jmmv char name[8];
88 1.5.2.2 jmmv int rv;
89 1.5.2.2 jmmv
90 1.5.2.2 jmmv rv = 0;
91 1.5.2.2 jmmv if (1) { /* XXX old firmware compat enabled */
92 1.5.2.2 jmmv /* match type and name properties */
93 1.5.2.2 jmmv if (OF_getprop(oba->oba_phandle, "device_type", type,
94 1.5.2.2 jmmv sizeof(type)) > 0 &&
95 1.5.2.2 jmmv strcmp(type, "isa") == 0 &&
96 1.5.2.2 jmmv OF_getprop(oba->oba_phandle, "name", name,
97 1.5.2.2 jmmv sizeof(name)) > 0 &&
98 1.5.2.2 jmmv strcmp(name, "isa") == 0)
99 1.5.2.2 jmmv rv = 4;
100 1.5.2.2 jmmv }
101 1.5.2.2 jmmv return (rv);
102 1.5.2.2 jmmv }
103 1.5.2.2 jmmv
104 1.5.2.2 jmmv #endif /* COMPAT_OLD_OFW */
105