1*cf10107dSdyoung /* $NetBSD: giovar.h,v 1.10 2011/07/01 18:53:46 dyoung Exp $ */ 2f12e2b4dSsoren 3f12e2b4dSsoren /* 4f12e2b4dSsoren * Copyright (c) 2000 Soren S. Jorvang 5f12e2b4dSsoren * All rights reserved. 6f12e2b4dSsoren * 7f12e2b4dSsoren * Redistribution and use in source and binary forms, with or without 8f12e2b4dSsoren * modification, are permitted provided that the following conditions 9f12e2b4dSsoren * are met: 10f12e2b4dSsoren * 1. Redistributions of source code must retain the above copyright 11f12e2b4dSsoren * notice, this list of conditions and the following disclaimer. 12f12e2b4dSsoren * 2. Redistributions in binary form must reproduce the above copyright 13f12e2b4dSsoren * notice, this list of conditions and the following disclaimer in the 14f12e2b4dSsoren * documentation and/or other materials provided with the distribution. 15f12e2b4dSsoren * 3. All advertising materials mentioning features or use of this software 16f12e2b4dSsoren * must display the following acknowledgement: 17f12e2b4dSsoren * This product includes software developed for the 1807147999Skeihan * NetBSD Project. See http://www.NetBSD.org/ for 19f12e2b4dSsoren * information about NetBSD. 20f12e2b4dSsoren * 4. The name of the author may not be used to endorse or promote products 21f12e2b4dSsoren * derived from this software without specific prior written permission. 22f12e2b4dSsoren * 23f12e2b4dSsoren * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 24f12e2b4dSsoren * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 25f12e2b4dSsoren * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26f12e2b4dSsoren * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 27f12e2b4dSsoren * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28f12e2b4dSsoren * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29f12e2b4dSsoren * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30f12e2b4dSsoren * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31f12e2b4dSsoren * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32f12e2b4dSsoren * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33f12e2b4dSsoren */ 34f12e2b4dSsoren 35f12e2b4dSsoren /* 36f12e2b4dSsoren * GIO 32/32-bis/64 bus 37f12e2b4dSsoren */ 38f12e2b4dSsoren 39*cf10107dSdyoung #include <sys/bus.h> 40f12e2b4dSsoren 41f12e2b4dSsoren struct giobus_attach_args { 42f12e2b4dSsoren bus_space_tag_t gba_iot; 43f12e2b4dSsoren bus_space_handle_t gba_ioh; 44f12e2b4dSsoren 45f12e2b4dSsoren #define GIOBUS_GIO32 0 46f12e2b4dSsoren #define GIOBUS_GIO32BIS 1 47f12e2b4dSsoren #define GIOBUS_GIO64 2 48f12e2b4dSsoren int gba_type; 49f12e2b4dSsoren }; 50f12e2b4dSsoren 51f12e2b4dSsoren struct gio_attach_args { 52f12e2b4dSsoren bus_space_tag_t ga_iot; 53f12e2b4dSsoren bus_space_handle_t ga_ioh; 542d1cbf72Srumble bus_dma_tag_t ga_dmat; 55f12e2b4dSsoren 56163b9bb1Srumble int ga_slot; /* not valid if graphics */ 57163b9bb1Srumble u_int32_t ga_addr; 58f12e2b4dSsoren 59163b9bb1Srumble u_int32_t ga_product; /* not valid if graphics */ 60f12e2b4dSsoren }; 6161349135Slonewolf 622d1cbf72Srumble 632d1cbf72Srumble #define GIO_SLOT_GFX 0 642d1cbf72Srumble #define GIO_SLOT_EXP0 1 652d1cbf72Srumble #define GIO_SLOT_EXP1 2 662d1cbf72Srumble 672c7e4582Srumble #define GIO_ARB_RT 0x001 /* real-time device */ 682c7e4582Srumble #define GIO_ARB_LB 0x002 /* long-burst device */ 692d1cbf72Srumble 702c7e4582Srumble #define GIO_ARB_MST 0x004 /* bus master enable */ 712c7e4582Srumble #define GIO_ARB_SLV 0x008 /* slave */ 722d1cbf72Srumble 732c7e4582Srumble #define GIO_ARB_PIPE 0x010 /* pipelining enable */ 742c7e4582Srumble #define GIO_ARB_NOPIPE 0x020 /* pipelining disable */ 752c7e4582Srumble 762c7e4582Srumble #define GIO_ARB_32BIT 0x040 /* 32-bit transfers */ 772c7e4582Srumble #define GIO_ARB_64BIT 0x080 /* 64-bit transfers */ 782c7e4582Srumble 792c7e4582Srumble #define GIO_ARB_HPC2_32BIT 0x100 /* 32-bit secondary HPC (ignores slot)*/ 802c7e4582Srumble #define GIO_ARB_HPC2_64BIT 0x200 /* 64-bit secondary HPC (ignores slot)*/ 812d1cbf72Srumble 8261349135Slonewolf int gio_cnattach(void); 832d1cbf72Srumble int gio_arb_config(int, uint32_t); 842d1cbf72Srumble void *gio_intr_establish(int, int, int (*)(void *), void *); 852d1cbf72Srumble const char *gio_product_string(int); 862d1cbf72Srumble 87