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