i80312var.h revision 1.4 1 1.4 thorpej /* $NetBSD: i80312var.h,v 1.4 2001/11/09 23:15:53 thorpej Exp $ */
2 1.2 thorpej
3 1.1 thorpej /*
4 1.1 thorpej * Copyright (c) 2001 Wasabi Systems, Inc.
5 1.1 thorpej * All rights reserved.
6 1.1 thorpej *
7 1.1 thorpej * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 1.1 thorpej *
9 1.1 thorpej * Redistribution and use in source and binary forms, with or without
10 1.1 thorpej * modification, are permitted provided that the following conditions
11 1.1 thorpej * are met:
12 1.1 thorpej * 1. Redistributions of source code must retain the above copyright
13 1.1 thorpej * notice, this list of conditions and the following disclaimer.
14 1.1 thorpej * 2. Redistributions in binary form must reproduce the above copyright
15 1.1 thorpej * notice, this list of conditions and the following disclaimer in the
16 1.1 thorpej * documentation and/or other materials provided with the distribution.
17 1.1 thorpej * 3. All advertising materials mentioning features or use of this software
18 1.1 thorpej * must display the following acknowledgement:
19 1.1 thorpej * This product includes software developed for the NetBSD Project by
20 1.1 thorpej * Wasabi Systems, Inc.
21 1.1 thorpej * 4. The name of Wasabi Systems, Inc. may not be used to endorse
22 1.1 thorpej * or promote products derived from this software without specific prior
23 1.1 thorpej * written permission.
24 1.1 thorpej *
25 1.1 thorpej * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
26 1.1 thorpej * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 1.1 thorpej * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 1.1 thorpej * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 1.1 thorpej * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 1.1 thorpej * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 1.1 thorpej * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 1.1 thorpej * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 1.1 thorpej * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 1.1 thorpej * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 1.1 thorpej * POSSIBILITY OF SUCH DAMAGE.
36 1.1 thorpej */
37 1.1 thorpej
38 1.1 thorpej #ifndef _ARM_XSCALE_I80312VAR_H_
39 1.1 thorpej #define _ARM_XSCALE_I80312VAR_H_
40 1.1 thorpej
41 1.3 thorpej #include <machine/bus.h>
42 1.3 thorpej
43 1.3 thorpej #include <dev/pci/pcivar.h>
44 1.3 thorpej
45 1.3 thorpej struct i80312_softc {
46 1.3 thorpej struct device sc_dev; /* generic device glue */
47 1.3 thorpej
48 1.3 thorpej int sc_is_host; /* indicates if we're a host or
49 1.3 thorpej plugged into another host */
50 1.3 thorpej
51 1.3 thorpej /*
52 1.3 thorpej * This is the bus_space and handle used to access the
53 1.3 thorpej * i80312 itself. This is filled in by the board-specific
54 1.3 thorpej * front-end.
55 1.3 thorpej */
56 1.3 thorpej bus_space_tag_t sc_st;
57 1.3 thorpej bus_space_handle_t sc_sh;
58 1.3 thorpej
59 1.3 thorpej /* Handles for the various subregions. */
60 1.3 thorpej bus_space_handle_t sc_ppb_sh;
61 1.3 thorpej bus_space_handle_t sc_atu_sh;
62 1.4 thorpej bus_space_handle_t sc_mem_sh;
63 1.3 thorpej
64 1.3 thorpej /*
65 1.3 thorpej * Secondary IDSEL Select bits for providing a private
66 1.3 thorpej * PCI device space.
67 1.3 thorpej */
68 1.3 thorpej uint16_t sc_sisr;
69 1.3 thorpej
70 1.3 thorpej /*
71 1.3 thorpej * We expect the board-specific front-end to have already mapped
72 1.3 thorpej * the PCI I/O spaces .. they're only 64K each, and I/O mappings
73 1.3 thorpej * tend to be smaller than a page size, so it's generally more
74 1.3 thorpej * efficient to map them all into virtual space in one fell swoop.
75 1.3 thorpej */
76 1.3 thorpej vaddr_t sc_piow_vaddr; /* primary I/O window vaddr */
77 1.3 thorpej vaddr_t sc_siow_vaddr; /* secondary I/O window vaddr */
78 1.3 thorpej
79 1.3 thorpej /*
80 1.3 thorpej * Variables that define the Primary Inbound window. The base
81 1.3 thorpej * address is configured by a host via BAR #0. The xlate variable
82 1.3 thorpej * defines the start of the local address space that it maps to.
83 1.3 thorpej * The size variable defines the byte size.
84 1.3 thorpej *
85 1.3 thorpej * This window is used for incoming PCI memory read/write cycles
86 1.3 thorpej * from a host.
87 1.3 thorpej *
88 1.3 thorpej * ...unless we're a host, in which case we make the Primary
89 1.3 thorpej * Inbound window work like the Secondary Inbound window, so
90 1.3 thorpej * that PCI devices on that bus can talk to our local RAM.
91 1.3 thorpej */
92 1.3 thorpej uint32_t sc_pin_base;
93 1.3 thorpej uint32_t sc_pin_xlate;
94 1.3 thorpej uint32_t sc_pin_size;
95 1.3 thorpej
96 1.3 thorpej /*
97 1.3 thorpej * Variables that define the Secondary Inbound window. The
98 1.3 thorpej * base variable indicates the PCI base address of the window.
99 1.3 thorpej * The xlate variable defines the start of the local address
100 1.3 thorpej * space that it maps to. The size variable defines the byte
101 1.3 thorpej * size.
102 1.3 thorpej *
103 1.3 thorpej * This window is used for DMA with devices on the secondary bus.
104 1.3 thorpej */
105 1.3 thorpej uint32_t sc_sin_base;
106 1.3 thorpej uint32_t sc_sin_xlate;
107 1.3 thorpej uint32_t sc_sin_size;
108 1.3 thorpej
109 1.3 thorpej /*
110 1.3 thorpej * This is the PCI address that the Primary Outbound Memory
111 1.3 thorpej * window maps to.
112 1.3 thorpej */
113 1.3 thorpej uint32_t sc_pmemout_base;
114 1.3 thorpej uint32_t sc_pmemout_size;
115 1.3 thorpej
116 1.3 thorpej /*
117 1.3 thorpej * This is the PCI address that the Primary Outbound I/O
118 1.3 thorpej * window maps to.
119 1.3 thorpej */
120 1.3 thorpej uint32_t sc_pioout_base;
121 1.3 thorpej uint32_t sc_pioout_size;
122 1.3 thorpej
123 1.3 thorpej /*
124 1.3 thorpej * This is the PCI address that the Secondary Outbound Memory
125 1.3 thorpej * window maps to.
126 1.3 thorpej */
127 1.3 thorpej uint32_t sc_smemout_base;
128 1.3 thorpej uint32_t sc_smemout_size;
129 1.3 thorpej
130 1.3 thorpej /*
131 1.3 thorpej * This is the PCI address that the Secondary Outbound I/O
132 1.3 thorpej * window maps to.
133 1.3 thorpej */
134 1.3 thorpej uint32_t sc_sioout_base;
135 1.3 thorpej uint32_t sc_sioout_size;
136 1.3 thorpej
137 1.3 thorpej /*
138 1.3 thorpej * This defines the private I/O and Memory spaces on the
139 1.3 thorpej * Secondary bus.
140 1.3 thorpej */
141 1.3 thorpej uint32_t sc_privio_base;
142 1.3 thorpej uint32_t sc_privio_size;
143 1.3 thorpej uint32_t sc_privmem_base;
144 1.3 thorpej uint32_t sc_privmem_size;
145 1.3 thorpej
146 1.3 thorpej uint8_t sc_sder; /* secondary decode enable register */
147 1.3 thorpej
148 1.3 thorpej /* Bus space, DMA, and PCI tags for the PCI bus (private devices). */
149 1.3 thorpej struct bus_space sc_pci_iot;
150 1.3 thorpej struct bus_space sc_pci_memt;
151 1.3 thorpej struct arm32_bus_dma_tag sc_pci_dmat;
152 1.3 thorpej struct arm32_pci_chipset sc_pci_chipset;
153 1.3 thorpej };
154 1.3 thorpej
155 1.3 thorpej extern struct bus_space i80312_bs_tag;
156 1.3 thorpej
157 1.1 thorpej void i80312_sdram_bounds(bus_space_tag_t, bus_space_handle_t,
158 1.1 thorpej paddr_t *, psize_t *);
159 1.3 thorpej
160 1.3 thorpej void i80312_attach(struct i80312_softc *);
161 1.3 thorpej
162 1.3 thorpej void i80312_bs_init(bus_space_tag_t, void *);
163 1.3 thorpej void i80312_io_bs_init(bus_space_tag_t, void *);
164 1.3 thorpej void i80312_mem_bs_init(bus_space_tag_t, void *);
165 1.3 thorpej
166 1.3 thorpej void i80312_pci_dma_init(bus_dma_tag_t, void *);
167 1.3 thorpej
168 1.3 thorpej void i80312_pci_init(pci_chipset_tag_t, void *);
169 1.1 thorpej
170 1.1 thorpej #endif /* _ARM_XSCALE_I80312VAR_H_ */
171