1*b5d71af9Stsutsui /* $NetBSD: autoconf.h,v 1.27 2012/10/13 06:37:16 tsutsui Exp $ */ 220af809cScgd 303325025Sgwr /*- 403325025Sgwr * Copyright (c) 1996 The NetBSD Foundation, Inc. 5a2133ea2Sglass * All rights reserved. 6a2133ea2Sglass * 703325025Sgwr * This code is derived from software contributed to The NetBSD Foundation 803325025Sgwr * by Adam Glass and Gordon W. Ross. 903325025Sgwr * 10a2133ea2Sglass * Redistribution and use in source and binary forms, with or without 11a2133ea2Sglass * modification, are permitted provided that the following conditions 12a2133ea2Sglass * are met: 13a2133ea2Sglass * 1. Redistributions of source code must retain the above copyright 14a2133ea2Sglass * notice, this list of conditions and the following disclaimer. 15a2133ea2Sglass * 2. Redistributions in binary form must reproduce the above copyright 16a2133ea2Sglass * notice, this list of conditions and the following disclaimer in the 17a2133ea2Sglass * documentation and/or other materials provided with the distribution. 18a2133ea2Sglass * 1903325025Sgwr * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 2003325025Sgwr * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2103325025Sgwr * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22340699a2Sgwr * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23340699a2Sgwr * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2403325025Sgwr * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2503325025Sgwr * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2603325025Sgwr * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2703325025Sgwr * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2803325025Sgwr * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2903325025Sgwr * POSSIBILITY OF SUCH DAMAGE. 30a2133ea2Sglass */ 318ff8fa80Sglass 32fe52f9aeSgwr /* 33fe52f9aeSgwr * Autoconfiguration information. 340c5e3e49Sgwr * (machdep parts of driver/kernel interface) 35fe52f9aeSgwr */ 368ff8fa80Sglass 37d23b794cStsutsui #include <machine/bus.h> 38d23b794cStsutsui 39eff2e270Sgwr /* 40eff2e270Sgwr * These are the "bus" types, in attach order. 41eff2e270Sgwr * Note tables in bus_subr.c and vme.c that 42eff2e270Sgwr * care about the order of these. 43eff2e270Sgwr */ 44eff2e270Sgwr #define BUS_OBIO 0 /* on-board I/O */ 45eff2e270Sgwr #define BUS_OBMEM 1 /* on-board memory */ 46eff2e270Sgwr #define BUS_VME16D16 2 /* VME A16/D16 */ 47eff2e270Sgwr #define BUS_VME16D32 3 /* VME A16/D32 */ 48eff2e270Sgwr #define BUS_VME24D16 4 /* VME A24/D16 */ 49eff2e270Sgwr #define BUS_VME24D32 5 /* VME A24/D32 */ 50eff2e270Sgwr #define BUS_VME32D16 6 /* VME A32/D16 */ 51eff2e270Sgwr #define BUS_VME32D32 7 /* VME A32/D32 */ 52eff2e270Sgwr #define BUS__NTYPES 8 /* not a valid bus type */ 53fe52f9aeSgwr 54fe52f9aeSgwr /* 55fe52f9aeSgwr * This is the "args" parameter to the bus match/attach functions. 56fe52f9aeSgwr */ 57fe52f9aeSgwr struct confargs { 58d23b794cStsutsui bus_space_tag_t ca_bustag; 59d23b794cStsutsui bus_dma_tag_t ca_dmatag; 60d23b794cStsutsui const char *ca_name; 61fe52f9aeSgwr int ca_bustype; /* BUS_OBIO, ... */ 62d23b794cStsutsui paddr_t ca_paddr; /* physical address */ 63fe52f9aeSgwr int ca_intpri; /* interrupt priority level */ 64fe52f9aeSgwr int ca_intvec; /* interrupt vector index */ 65fe52f9aeSgwr }; 66fe52f9aeSgwr 67d23b794cStsutsui extern struct sun68k_bus_dma_tag mainbus_dma_tag; 68d23b794cStsutsui extern struct sun68k_bus_space_tag mainbus_space_tag; 69d23b794cStsutsui 70fa59faccSgwr /* Locator aliases */ 71fa59faccSgwr #define cf_paddr cf_loc[0] 72fa59faccSgwr #define cf_intpri cf_loc[1] 73fa59faccSgwr #define cf_intvec cf_loc[2] 74fa59faccSgwr 75*b5d71af9Stsutsui int bus_scan(device_t, cfdata_t, const int *, void *); 7610b1a7beSchs int bus_print(void *, const char *); 7710b1a7beSchs int bus_peek(int, int, int); 7810b1a7beSchs void *bus_mapin(int, int, int); 7910b1a7beSchs void bus_mapout(void *, int); 8010b1a7beSchs void *bus_tmapin(int, int); 8110b1a7beSchs void bus_tmapout(void *); 82fa59faccSgwr 830c5e3e49Sgwr /* Bus-error tolerant access to mapped address. */ 8453524e44Schristos int peek_byte(void *); 8553524e44Schristos int peek_word(void *); 8653524e44Schristos int peek_long(void *); 87