rmixlvar.h revision 1.1.2.4 1 /* $NetBSD: rmixlvar.h,v 1.1.2.4 2009/09/25 22:21:12 cliff Exp $ */
2
3 /*
4 * Copyright 2002 Wasabi Systems, Inc.
5 * All rights reserved.
6 *
7 * Written by Simon Burge for Wasabi Systems, Inc.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed for the NetBSD Project by
20 * Wasabi Systems, Inc.
21 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
22 * or promote products derived from this software without specific prior
23 * written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38 #include <dev/pci/pcivar.h>
39 #include <machine/bus.h>
40
41 typedef enum {
42 RMIXL_INTR_EDGE=0,
43 RMIXL_INTR_LEVEL,
44 } rmixl_intr_trigger_t;
45
46 typedef enum {
47 RMIXL_INTR_RISING=0,
48 RMIXL_INTR_HIGH,
49 RMIXL_INTR_FALLING,
50 RMIXL_INTR_LOW,
51 } rmixl_intr_polarity_t;
52
53 struct rmixl_config {
54 uint64_t rc_io_pbase;
55 struct mips_bus_space rc_el_memt; /* little endian bus */
56 struct mips_bus_space rc_eb_memt; /* big endian bus */
57 struct mips_bus_dma_tag rc_lt4G_dmat; /* space < 4GB */
58 struct mips_bus_dma_tag rc_ge4G_dmat; /* space < memsize */
59 struct mips_pci_chipset rc_pc;
60 struct extent *rc_io_ex;
61 struct extent *rc_mem_ex;
62 int rc_mallocsafe;
63 };
64
65 extern struct rmixl_config rmixl_configuration;
66
67 extern void rmixl_el_bus_mem_init(bus_space_tag_t, void *);
68 extern void rmixl_eb_bus_mem_init(bus_space_tag_t, void *);
69
70 extern void *rmixl_intr_establish(int, int,
71 rmixl_intr_trigger_t, rmixl_intr_polarity_t,
72 int (*)(void *), void *);
73 extern void rmixl_intr_disestablish(void *);
74