1*cbab9cadSchs /* $NetBSD: ofisa_machdep.c,v 1.10 2012/10/27 17:18:11 chs Exp $ */
280675955Sthorpej
380675955Sthorpej /*
480675955Sthorpej * Copyright 1998
580675955Sthorpej * Digital Equipment Corporation. All rights reserved.
680675955Sthorpej *
780675955Sthorpej * This software is furnished under license and may be used and
880675955Sthorpej * copied only in accordance with the following terms and conditions.
980675955Sthorpej * Subject to these conditions, you may download, copy, install,
1080675955Sthorpej * use, modify and distribute this software in source and/or binary
1180675955Sthorpej * form. No title or ownership is transferred hereby.
1280675955Sthorpej *
1380675955Sthorpej * 1) Any source code used, modified or distributed must reproduce
1480675955Sthorpej * and retain this copyright notice and list of conditions as
1580675955Sthorpej * they appear in the source file.
1680675955Sthorpej *
1780675955Sthorpej * 2) No right is granted to use any trade name, trademark, or logo of
1880675955Sthorpej * Digital Equipment Corporation. Neither the "Digital Equipment
1980675955Sthorpej * Corporation" name nor any trademark or logo of Digital Equipment
2080675955Sthorpej * Corporation may be used to endorse or promote products derived
2180675955Sthorpej * from this software without the prior written permission of
2280675955Sthorpej * Digital Equipment Corporation.
2380675955Sthorpej *
2480675955Sthorpej * 3) This software is provided "AS-IS" and any express or implied
2580675955Sthorpej * warranties, including but not limited to, any implied warranties
2680675955Sthorpej * of merchantability, fitness for a particular purpose, or
2780675955Sthorpej * non-infringement are disclaimed. In no event shall DIGITAL be
2880675955Sthorpej * liable for any damages whatsoever, and in particular, DIGITAL
2980675955Sthorpej * shall not be liable for special, indirect, consequential, or
3080675955Sthorpej * incidental damages or damages for lost profits, loss of
3180675955Sthorpej * revenue or loss of use, whether such damages arise in contract,
3280675955Sthorpej * negligence, tort, under statute, in equity, at law or otherwise,
3380675955Sthorpej * even if advised of the possibility of such damage.
3480675955Sthorpej */
3580675955Sthorpej
36ed517291Slukem #include <sys/cdefs.h>
37*cbab9cadSchs __KERNEL_RCSID(0, "$NetBSD: ofisa_machdep.c,v 1.10 2012/10/27 17:18:11 chs Exp $");
38ed517291Slukem
39d505b189Smartin #include "opt_compat_old_ofw.h"
40d505b189Smartin
4180675955Sthorpej #include <sys/param.h>
4280675955Sthorpej #include <sys/device.h>
4380675955Sthorpej #include <sys/systm.h>
44703fe5baSdyoung #include <sys/bus.h>
4580675955Sthorpej #include <machine/intr.h>
4680675955Sthorpej
4780675955Sthorpej #include <dev/ofw/openfirm.h>
4880675955Sthorpej #include <dev/isa/isavar.h>
4980675955Sthorpej #include <dev/ofisa/ofisavar.h>
5080675955Sthorpej
51b77d9372Sjmmv #include "isadma.h"
52b77d9372Sjmmv
5380675955Sthorpej int
ofisa_get_isabus_data(int phandle,struct isabus_attach_args * iba)54454af1c0Sdsl ofisa_get_isabus_data(int phandle, struct isabus_attach_args *iba)
5580675955Sthorpej {
5680675955Sthorpej
5780675955Sthorpej iba->iba_iot = &isa_io_bs_tag;
5880675955Sthorpej iba->iba_memt = &isa_mem_bs_tag;
59b77d9372Sjmmv #if (NISADMA > 0)
6080675955Sthorpej iba->iba_dmat = &isa_bus_dma_tag;
61b77d9372Sjmmv #endif
6280675955Sthorpej iba->iba_ic = &isa_chipset_tag;
6380675955Sthorpej
6480675955Sthorpej return (0);
6580675955Sthorpej }
6680675955Sthorpej
6780675955Sthorpej int
ofisa_ignore_child(int pphandle,int cphandle)6882357f6dSdsl ofisa_ignore_child(int pphandle, int cphandle)
6980675955Sthorpej {
7080675955Sthorpej
7180675955Sthorpej return (0);
7280675955Sthorpej }
7380675955Sthorpej
7480675955Sthorpej #ifdef COMPAT_OLD_OFW
7580675955Sthorpej
7680675955Sthorpej int
ofisa_md_match(device_t parent,cfdata_t cf,void * aux)77*cbab9cadSchs ofisa_md_match(device_t parent, cfdata_t cf, void *aux)
7880675955Sthorpej {
7980675955Sthorpej struct ofbus_attach_args *oba = aux;
8080675955Sthorpej char type[8];
8180675955Sthorpej char name[8];
8280675955Sthorpej int rv;
8380675955Sthorpej
8480675955Sthorpej rv = 0;
8580675955Sthorpej if (1) { /* XXX old firmware compat enabled */
8680675955Sthorpej /* match type and name properties */
8780675955Sthorpej if (OF_getprop(oba->oba_phandle, "device_type", type,
8880675955Sthorpej sizeof(type)) > 0 &&
8980675955Sthorpej strcmp(type, "isa") == 0 &&
9080675955Sthorpej OF_getprop(oba->oba_phandle, "name", name,
9180675955Sthorpej sizeof(name)) > 0 &&
9280675955Sthorpej strcmp(name, "isa") == 0)
9380675955Sthorpej rv = 4;
9480675955Sthorpej }
9580675955Sthorpej return (rv);
9680675955Sthorpej }
9780675955Sthorpej
9880675955Sthorpej #endif /* COMPAT_OLD_OFW */
99