1*ed517291Slukem /* $NetBSD: wdc_ofisa_machdep.c,v 1.3 2003/07/15 03:36:02 lukem 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 36*ed517291Slukem #include <sys/cdefs.h> 37*ed517291Slukem __KERNEL_RCSID(0, "$NetBSD: wdc_ofisa_machdep.c,v 1.3 2003/07/15 03:36:02 lukem Exp $"); 38*ed517291Slukem 39d505b189Smartin #include "opt_compat_old_ofw.h" 40d505b189Smartin 4180675955Sthorpej #include <sys/param.h> 4280675955Sthorpej #include <sys/device.h> 4380675955Sthorpej #include <sys/systm.h> 4480675955Sthorpej #include <machine/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 5180675955Sthorpej #ifdef COMPAT_OLD_OFW 5280675955Sthorpej 5380675955Sthorpej int 5480675955Sthorpej wdc_ofisa_md_match(parent, cf, aux) 5580675955Sthorpej struct device *parent; 5680675955Sthorpej struct cfdata *cf; 5780675955Sthorpej void *aux; 5880675955Sthorpej { 5980675955Sthorpej struct ofisa_attach_args *aa = aux; 6080675955Sthorpej char type[8]; 6180675955Sthorpej char name[8]; 6280675955Sthorpej int rv; 6380675955Sthorpej 6480675955Sthorpej rv = 0; 6580675955Sthorpej if (1) { /* XXX old firmware compat enabled */ 6680675955Sthorpej /* match type and name properties */ 6780675955Sthorpej if (OF_getprop(aa->oba.oba_phandle, "device_type", 6880675955Sthorpej type, sizeof(type)) > 0 && 6980675955Sthorpej strcmp(type, "ide") == 0 && 7080675955Sthorpej OF_getprop(aa->oba.oba_phandle, "name", name, 7180675955Sthorpej sizeof(name)) > 0 && 7280675955Sthorpej strcmp(name, "ide") == 0) 7380675955Sthorpej rv = 4; 7480675955Sthorpej } 7580675955Sthorpej return (rv); 7680675955Sthorpej } 7780675955Sthorpej 7880675955Sthorpej int 7980675955Sthorpej wdc_ofisa_md_intr_fixup(parent, self, aux, descp, ndescs, ndescsfilled) 8080675955Sthorpej struct device *parent, *self; 8180675955Sthorpej void *aux; 8280675955Sthorpej struct ofisa_intr_desc *descp; 8380675955Sthorpej int ndescs, ndescsfilled; 8480675955Sthorpej { 8580675955Sthorpej 8680675955Sthorpej if (1) /* XXX old firmware compat enabled */ 8780675955Sthorpej if (ndescs > 0 && ndescsfilled > 0) 8880675955Sthorpej descp[0].share = IST_LEVEL; 8980675955Sthorpej return (ndescsfilled); 9080675955Sthorpej } 9180675955Sthorpej 9280675955Sthorpej #endif /* COMPAT_OLD_OFW */ 93