Home | History | Annotate | Line # | Download | only in vme
      1 /*	$NetBSD: vmevar.h,v 1.9 2023/01/06 10:28:28 tsutsui Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 1997 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  *
     16  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     17  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     18  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     19  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     26  * POSSIBILITY OF SUCH DAMAGE.
     27  */
     28 
     29 /*
     30  * Definitions for VME autoconfiguration.
     31  */
     32 
     33 #include <sys/bus.h>
     34 
     35 /*
     36  * Structures and definitions needed by the machine-dependent header.
     37  */
     38 struct vmebus_attach_args;
     39 
     40 #include <atari/vme/vme_machdep.h>
     41 
     42 /*
     43  * VME bus attach arguments
     44  */
     45 struct vmebus_attach_args {
     46 	const char *vba_busname;	/* XXX should be common */
     47 	bus_space_tag_t vba_iot;	/* vme i/o space tag */
     48 	bus_space_tag_t vba_memt;	/* vme mem space tag */
     49 	vme_chipset_tag_t vba_vc;
     50 };
     51 
     52 /*
     53  * VME driver attach arguments
     54  */
     55 struct vme_attach_args {
     56 	bus_space_tag_t va_iot;		/* vme i/o space tag */
     57 	bus_space_tag_t va_memt;	/* vme mem space tag */
     58 
     59 	vme_chipset_tag_t va_vc;
     60 
     61 	int	va_iobase;		/* base i/o address */
     62 	int	va_iosize;		/* span of ports used */
     63 	int	va_irq;			/* interrupt request */
     64 	int	va_maddr;		/* physical i/o mem addr */
     65 	u_int	va_msize;		/* size of i/o memory */
     66 	void	*va_aux;		/* driver specific */
     67 };
     68 
     69 #include "locators.h"
     70 
     71 #define	IOBASEUNK	VMECF_IOPORT_DEFAULT	/* i/o address is unknown */
     72 #define	IRQUNK		VMECF_IRQ_DEFAULT	/* interrupt request line is unknown */
     73 #define	MADDRUNK	VMECF_MEM_DEFAULT	/* shared memory address is unknown */
     74 
     75 #define		cf_iobase		cf_loc[VMECF_IOPORT]
     76 #define		cf_iosize		cf_loc[VMECF_IOSIZE]
     77 #define		cf_maddr		cf_loc[VMECF_MEM]
     78 #define		cf_msize		cf_loc[VMECF_MEMSIZ]
     79 #define		cf_irq			cf_loc[VMECF_IRQ]
     80 
     81 /*
     82  * VME master bus
     83  */
     84 struct vme_softc {
     85 	device_t sc_dev;		/* base device */
     86 	bus_space_tag_t sc_iot;		/* vme io space tag */
     87 	bus_space_tag_t sc_memt;	/* vme mem space tag */
     88 
     89 	vme_chipset_tag_t sc_vc;
     90 };
     91 
     92