1 /* $NetBSD: giovar.h,v 1.9 2007/02/19 20:14:30 rumble Exp $ */ 2 3 /* 4 * Copyright (c) 2000 Soren S. Jorvang 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 * 3. All advertising materials mentioning features or use of this software 16 * must display the following acknowledgement: 17 * This product includes software developed for the 18 * NetBSD Project. See http://www.NetBSD.org/ for 19 * information about NetBSD. 20 * 4. The name of the author may not be used to endorse or promote products 21 * derived from this software without specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 */ 34 35 /* 36 * GIO 32/32-bis/64 bus 37 */ 38 39 #include <machine/bus.h> 40 41 struct giobus_attach_args { 42 bus_space_tag_t gba_iot; 43 bus_space_handle_t gba_ioh; 44 45 #define GIOBUS_GIO32 0 46 #define GIOBUS_GIO32BIS 1 47 #define GIOBUS_GIO64 2 48 int gba_type; 49 }; 50 51 struct gio_attach_args { 52 bus_space_tag_t ga_iot; 53 bus_space_handle_t ga_ioh; 54 bus_dma_tag_t ga_dmat; 55 56 int ga_slot; /* not valid if graphics */ 57 u_int32_t ga_addr; 58 59 u_int32_t ga_product; /* not valid if graphics */ 60 }; 61 62 63 #define GIO_SLOT_GFX 0 64 #define GIO_SLOT_EXP0 1 65 #define GIO_SLOT_EXP1 2 66 67 #define GIO_ARB_RT 0x001 /* real-time device */ 68 #define GIO_ARB_LB 0x002 /* long-burst device */ 69 70 #define GIO_ARB_MST 0x004 /* bus master enable */ 71 #define GIO_ARB_SLV 0x008 /* slave */ 72 73 #define GIO_ARB_PIPE 0x010 /* pipelining enable */ 74 #define GIO_ARB_NOPIPE 0x020 /* pipelining disable */ 75 76 #define GIO_ARB_32BIT 0x040 /* 32-bit transfers */ 77 #define GIO_ARB_64BIT 0x080 /* 64-bit transfers */ 78 79 #define GIO_ARB_HPC2_32BIT 0x100 /* 32-bit secondary HPC (ignores slot)*/ 80 #define GIO_ARB_HPC2_64BIT 0x200 /* 64-bit secondary HPC (ignores slot)*/ 81 82 int gio_cnattach(void); 83 int gio_arb_config(int, uint32_t); 84 void *gio_intr_establish(int, int, int (*)(void *), void *); 85 const char *gio_product_string(int); 86 87