i80312var.h revision 1.3 1 1.3 thorpej /* $NetBSD: i80312var.h,v 1.3 2001/11/09 03:27:52 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.3 thorpej
63 1.3 thorpej /*
64 1.3 thorpej * Secondary IDSEL Select bits for providing a private
65 1.3 thorpej * PCI device space.
66 1.3 thorpej */
67 1.3 thorpej uint16_t sc_sisr;
68 1.3 thorpej
69 1.3 thorpej /*
70 1.3 thorpej * We expect the board-specific front-end to have already mapped
71 1.3 thorpej * the PCI I/O spaces .. they're only 64K each, and I/O mappings
72 1.3 thorpej * tend to be smaller than a page size, so it's generally more
73 1.3 thorpej * efficient to map them all into virtual space in one fell swoop.
74 1.3 thorpej */
75 1.3 thorpej vaddr_t sc_piow_vaddr; /* primary I/O window vaddr */
76 1.3 thorpej vaddr_t sc_siow_vaddr; /* secondary I/O window vaddr */
77 1.3 thorpej
78 1.3 thorpej /*
79 1.3 thorpej * Variables that define the Primary Inbound window. The base
80 1.3 thorpej * address is configured by a host via BAR #0. The xlate variable
81 1.3 thorpej * defines the start of the local address space that it maps to.
82 1.3 thorpej * The size variable defines the byte size.
83 1.3 thorpej *
84 1.3 thorpej * This window is used for incoming PCI memory read/write cycles
85 1.3 thorpej * from a host.
86 1.3 thorpej *
87 1.3 thorpej * ...unless we're a host, in which case we make the Primary
88 1.3 thorpej * Inbound window work like the Secondary Inbound window, so
89 1.3 thorpej * that PCI devices on that bus can talk to our local RAM.
90 1.3 thorpej */
91 1.3 thorpej uint32_t sc_pin_base;
92 1.3 thorpej uint32_t sc_pin_xlate;
93 1.3 thorpej uint32_t sc_pin_size;
94 1.3 thorpej
95 1.3 thorpej /*
96 1.3 thorpej * Variables that define the Secondary Inbound window. The
97 1.3 thorpej * base variable indicates the PCI base address of the window.
98 1.3 thorpej * The xlate variable defines the start of the local address
99 1.3 thorpej * space that it maps to. The size variable defines the byte
100 1.3 thorpej * size.
101 1.3 thorpej *
102 1.3 thorpej * This window is used for DMA with devices on the secondary bus.
103 1.3 thorpej */
104 1.3 thorpej uint32_t sc_sin_base;
105 1.3 thorpej uint32_t sc_sin_xlate;
106 1.3 thorpej uint32_t sc_sin_size;
107 1.3 thorpej
108 1.3 thorpej /*
109 1.3 thorpej * This is the PCI address that the Primary Outbound Memory
110 1.3 thorpej * window maps to.
111 1.3 thorpej */
112 1.3 thorpej uint32_t sc_pmemout_base;
113 1.3 thorpej uint32_t sc_pmemout_size;
114 1.3 thorpej
115 1.3 thorpej /*
116 1.3 thorpej * This is the PCI address that the Primary Outbound I/O
117 1.3 thorpej * window maps to.
118 1.3 thorpej */
119 1.3 thorpej uint32_t sc_pioout_base;
120 1.3 thorpej uint32_t sc_pioout_size;
121 1.3 thorpej
122 1.3 thorpej /*
123 1.3 thorpej * This is the PCI address that the Secondary Outbound Memory
124 1.3 thorpej * window maps to.
125 1.3 thorpej */
126 1.3 thorpej uint32_t sc_smemout_base;
127 1.3 thorpej uint32_t sc_smemout_size;
128 1.3 thorpej
129 1.3 thorpej /*
130 1.3 thorpej * This is the PCI address that the Secondary Outbound I/O
131 1.3 thorpej * window maps to.
132 1.3 thorpej */
133 1.3 thorpej uint32_t sc_sioout_base;
134 1.3 thorpej uint32_t sc_sioout_size;
135 1.3 thorpej
136 1.3 thorpej /*
137 1.3 thorpej * This defines the private I/O and Memory spaces on the
138 1.3 thorpej * Secondary bus.
139 1.3 thorpej */
140 1.3 thorpej uint32_t sc_privio_base;
141 1.3 thorpej uint32_t sc_privio_size;
142 1.3 thorpej uint32_t sc_privmem_base;
143 1.3 thorpej uint32_t sc_privmem_size;
144 1.3 thorpej
145 1.3 thorpej uint8_t sc_sder; /* secondary decode enable register */
146 1.3 thorpej
147 1.3 thorpej /* Bus space, DMA, and PCI tags for the PCI bus (private devices). */
148 1.3 thorpej struct bus_space sc_pci_iot;
149 1.3 thorpej struct bus_space sc_pci_memt;
150 1.3 thorpej struct arm32_bus_dma_tag sc_pci_dmat;
151 1.3 thorpej struct arm32_pci_chipset sc_pci_chipset;
152 1.3 thorpej };
153 1.3 thorpej
154 1.3 thorpej extern struct bus_space i80312_bs_tag;
155 1.3 thorpej
156 1.1 thorpej void i80312_sdram_bounds(bus_space_tag_t, bus_space_handle_t,
157 1.1 thorpej paddr_t *, psize_t *);
158 1.3 thorpej
159 1.3 thorpej void i80312_attach(struct i80312_softc *);
160 1.3 thorpej
161 1.3 thorpej void i80312_bs_init(bus_space_tag_t, void *);
162 1.3 thorpej void i80312_io_bs_init(bus_space_tag_t, void *);
163 1.3 thorpej void i80312_mem_bs_init(bus_space_tag_t, void *);
164 1.3 thorpej
165 1.3 thorpej void i80312_pci_dma_init(bus_dma_tag_t, void *);
166 1.3 thorpej
167 1.3 thorpej void i80312_pci_init(pci_chipset_tag_t, void *);
168 1.1 thorpej
169 1.1 thorpej #endif /* _ARM_XSCALE_I80312VAR_H_ */
170