vme_machdep.c revision 1.2
11.2Sjtc/* $NetBSD: vme_machdep.c,v 1.2 1997/10/09 07:41:05 jtc Exp $ */ 21.1Sleo 31.1Sleo/*- 41.1Sleo * Copyright (c) 1997 The NetBSD Foundation, Inc. 51.1Sleo * All rights reserved. 61.1Sleo * 71.1Sleo * Redistribution and use in source and binary forms, with or without 81.1Sleo * modification, are permitted provided that the following conditions 91.1Sleo * are met: 101.1Sleo * 1. Redistributions of source code must retain the above copyright 111.1Sleo * notice, this list of conditions and the following disclaimer. 121.1Sleo * 2. Redistributions in binary form must reproduce the above copyright 131.1Sleo * notice, this list of conditions and the following disclaimer in the 141.1Sleo * documentation and/or other materials provided with the distribution. 151.1Sleo * 3. All advertising materials mentioning features or use of this software 161.1Sleo * must display the following acknowledgement: 171.1Sleo * This product includes software developed by the NetBSD 181.1Sleo * Foundation, Inc. and its contributors. 191.1Sleo * 4. Neither the name of The NetBSD Foundation nor the names of its 201.1Sleo * contributors may be used to endorse or promote products derived 211.1Sleo * from this software without specific prior written permission. 221.1Sleo * 231.1Sleo * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 241.1Sleo * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 251.1Sleo * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 261.2Sjtc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 271.2Sjtc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 281.1Sleo * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 291.1Sleo * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 301.1Sleo * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 311.1Sleo * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 321.1Sleo * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 331.1Sleo * POSSIBILITY OF SUCH DAMAGE. 341.1Sleo */ 351.1Sleo 361.1Sleo#include <sys/types.h> 371.1Sleo#include <sys/param.h> 381.1Sleo#include <sys/time.h> 391.1Sleo#include <sys/systm.h> 401.1Sleo#include <sys/errno.h> 411.1Sleo#include <sys/device.h> 421.1Sleo 431.1Sleo#include <vm/vm.h> 441.1Sleo#include <vm/vm_kern.h> 451.1Sleo 461.1Sleo#include <machine/bus.h> 471.1Sleo#include <machine/cpu.h> 481.1Sleo#include <machine/iomap.h> 491.1Sleo#include <machine/mfp.h> 501.1Sleo 511.1Sleo#include <atari/atari/device.h> 521.1Sleo#include <atari/vme/vmevar.h> 531.1Sleo 541.1Sleostatic int vmebusprint __P((void *auxp, const char *)); 551.1Sleostatic int vmebusmatch __P((struct device *, struct cfdata *, void *)); 561.1Sleostatic void vmebusattach __P((struct device *, struct device *, void *)); 571.1Sleo 581.1Sleostruct cfattach vmebus_ca = { 591.1Sleo sizeof(struct device), vmebusmatch, vmebusattach 601.1Sleo}; 611.1Sleo 621.1Sleostruct cfdriver vmebus_cd = { 631.1Sleo NULL, "vmebus", DV_DULL 641.1Sleo}; 651.1Sleo 661.1Sleoint 671.1Sleovmebusmatch(pdp, cfp, auxp) 681.1Sleostruct device *pdp; 691.1Sleostruct cfdata *cfp; 701.1Sleovoid *auxp; 711.1Sleo{ 721.1Sleo if(atari_realconfig == 0) 731.1Sleo return (0); 741.1Sleo if (strcmp((char *)auxp, "vmebus") || cfp->cf_unit != 0) 751.1Sleo return(0); 761.1Sleo return(machineid & ATARI_FALCON ? 0 : 1); 771.1Sleo} 781.1Sleo 791.1Sleovoid 801.1Sleovmebusattach(pdp, dp, auxp) 811.1Sleostruct device *pdp, *dp; 821.1Sleovoid *auxp; 831.1Sleo{ 841.1Sleo struct vmebus_attach_args vba; 851.1Sleo 861.1Sleo vba.vba_busname = "vme"; 871.1Sleo vba.vba_iot = 0; 881.1Sleo vba.vba_memt = 0; 891.1Sleo 901.1Sleo printf("\n"); 911.1Sleo config_found(dp, &vba, vmebusprint); 921.1Sleo} 931.1Sleo 941.1Sleoint 951.1Sleovmebusprint(auxp, name) 961.1Sleovoid *auxp; 971.1Sleoconst char *name; 981.1Sleo{ 991.1Sleo if(name == NULL) 1001.1Sleo return(UNCONF); 1011.1Sleo return(QUIET); 1021.1Sleo} 103