4 * Copyright 2002 Wasabi Systems, Inc.
7 * Written by Simon Burge for Wasabi Systems, Inc.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
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
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.
38 #ifndef _MIPS_RMI_RMIXLVAR_H_
39 #define _MIPS_RMI_RMIXLVAR_H_
42 #include <dev/pci/pcivar.h>
43 #include <machine/bus.h>
46 cpu_rmixl(const struct pridtab
*ct
)
48 if (ct
->cpu_cid
== MIPS_PRID_CID_RMI
)
54 cpu_rmixlr(const struct pridtab
*ct
)
56 u_int type
= ct
->cpu_cidflags
& MIPS_CIDFL_RMI_TYPE
;
57 if (cpu_rmixl(ct
) && type
== CIDFL_RMI_TYPE_XLR
)
63 cpu_rmixls(const struct pridtab
*ct
)
65 u_int type
= ct
->cpu_cidflags
& MIPS_CIDFL_RMI_TYPE
;
66 if (cpu_rmixl(ct
) && type
== CIDFL_RMI_TYPE_XLS
)
72 cpu_rmixlp(const struct pridtab
*ct
)
74 u_int type
= ct
->cpu_cidflags
& MIPS_CIDFL_RMI_TYPE
;
75 if (cpu_rmixl(ct
) && type
== CIDFL_RMI_TYPE_XLP
)
84 } rmixl_intr_trigger_t
;
91 } rmixl_intr_polarity_t
;
95 bus_addr_t rc_pcie_cfg_pbase
;
96 bus_size_t rc_pcie_cfg_size
;
97 bus_addr_t rc_pcie_ecfg_pbase
;
98 bus_size_t rc_pcie_ecfg_size
;
99 bus_addr_t rc_pci_mem_pbase
;
100 bus_size_t rc_pci_mem_size
;
101 bus_addr_t rc_pci_io_pbase
;
102 bus_size_t rc_pci_io_size
;
103 struct mips_bus_space rc_obio_memt
; /* DEVIO */
104 struct mips_bus_space rc_pcie_cfg_memt
; /* PCI CFG */
105 struct mips_bus_space rc_pcie_ecfg_memt
; /* PCI ECFG */
106 struct mips_bus_space rc_pci_memt
; /* PCI MEM */
107 struct mips_bus_space rc_pci_iot
; /* PCI IO */
108 struct mips_bus_dma_tag rc_29bit_dmat
;
109 struct mips_bus_dma_tag rc_32bit_dmat
;
110 struct mips_bus_dma_tag rc_64bit_dmat
;
111 struct extent
*rc_phys_ex
; /* Note: MB units */
112 struct extent
*rc_obio_ex
;
113 struct extent
*rc_pcie_cfg_ex
;
114 struct extent
*rc_pcie_ecfg_ex
;
115 struct extent
*rc_pcie_mem_ex
;
116 struct extent
*rc_pcie_io_ex
;
120 extern struct rmixl_config rmixl_configuration
;
122 extern void rmixl_obio_bus_mem_init(bus_space_tag_t
, void *);
123 extern void rmixl_pcie_cfg_bus_mem_init(bus_space_tag_t
, void *);
124 extern void rmixl_pcie_ecfg_bus_mem_init(bus_space_tag_t
, void *);
125 extern void rmixl_pcie_bus_mem_init(bus_space_tag_t
, void *);
126 extern void rmixl_pcie_bus_io_init(bus_space_tag_t
, void *);
128 extern const char *rmixl_intr_string(int);
129 extern void *rmixl_intr_establish(int, int,
130 rmixl_intr_trigger_t
, rmixl_intr_polarity_t
,
131 int (*)(void *), void *);
132 extern void rmixl_intr_disestablish(void *);
134 extern void rmixl_addr_error_init(void);
135 extern int rmixl_addr_error_check(void);
137 extern uint64_t rmixl_mfcr(u_int
);
138 extern void rmixl_mtcr(uint64_t, u_int
);
140 #endif /* _MIPS_RMI_RMIXLVAR_H_ */