FreeBSD/Linux Kernel Cross Reference
sys/arm/arm/nexus_io.c
1 /* $NetBSD: mainbus_io.c,v 1.13 2003/07/15 00:24:47 lukem Exp $ */
2
3 /*-
4 * Copyright (c) 1997 Mark Brinicombe.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Mark Brinicombe.
18 * 4. The name of the company nor the name of the author may be used to
19 * endorse or promote products derived from this software without specific
20 * prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35 /*
36 * bus_space I/O functions for mainbus
37 */
38
39 #include <sys/cdefs.h>
40 __FBSDID("$FreeBSD$");
41
42 #include <sys/param.h>
43 #include <sys/systm.h>
44 #include <sys/queue.h>
45 #include <sys/bus.h>
46 #include <sys/lock.h>
47 #include <sys/mutex.h>
48 #include <vm/vm.h>
49 #include <vm/pmap.h>
50 #include <vm/vm_extern.h>
51
52
53 #include <machine/bus.h>
54 #include <machine/pmap.h>
55
56 /* Proto types for all the bus_space structure functions */
57 vm_offset_t lala;
58 bs_protos(nexus);
59 /* Declare the mainbus bus space tag */
60
61 struct bus_space mainbus_bs_tag = {
62 /* cookie */
63 NULL,
64
65 /* mapping/unmapping */
66 nexus_bs_map,
67 nexus_bs_unmap,
68 nexus_bs_subregion,
69
70 /* allocation/deallocation */
71 nexus_bs_alloc,
72 nexus_bs_free,
73
74 /* barrier */
75 nexus_bs_barrier,
76
77 /* read (single) */
78 nexus_bs_r_1,
79 nexus_bs_r_2,
80 nexus_bs_r_4,
81 NULL,
82
83 /* read multiple */
84 NULL,
85 nexus_bs_rm_2,
86 NULL,
87 NULL,
88
89 /* read region */
90 NULL,
91 NULL,
92 NULL,
93 NULL,
94
95 /* write (single) */
96 nexus_bs_w_1,
97 nexus_bs_w_2,
98 nexus_bs_w_4,
99 NULL,
100
101 /* write multiple */
102 nexus_bs_wm_1,
103 nexus_bs_wm_2,
104 NULL,
105 NULL,
106
107 /* write region */
108 NULL,
109 NULL,
110 NULL,
111 NULL,
112
113 NULL,
114 NULL,
115 NULL,
116 NULL,
117
118 /* set region */
119 NULL,
120 NULL,
121 NULL,
122 NULL,
123
124 /* copy */
125 NULL,
126 NULL,
127 NULL,
128 NULL,
129 };
130
131 /* bus space functions */
132
133 int
134 nexus_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int cacheable,
135 bus_space_handle_t *bshp)
136 {
137 return(0);
138 }
139
140 int
141 nexus_bs_alloc(t, rstart, rend, size, alignment, boundary, cacheable,
142 bpap, bshp)
143 void *t;
144 bus_addr_t rstart, rend;
145 bus_size_t size, alignment, boundary;
146 int cacheable;
147 bus_addr_t *bpap;
148 bus_space_handle_t *bshp;
149 {
150 panic("mainbus_bs_alloc(): Help!");
151 }
152
153
154 void
155 nexus_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size)
156 {
157 /*
158 * Temporary implementation
159 */
160 }
161
162 void
163 nexus_bs_free(t, bsh, size)
164 void *t;
165 bus_space_handle_t bsh;
166 bus_size_t size;
167 {
168
169 panic("mainbus_bs_free(): Help!");
170 /* mainbus_bs_unmap() does all that we need to do. */
171 /* mainbus_bs_unmap(t, bsh, size);*/
172 }
173
174 int
175 nexus_bs_subregion(t, bsh, offset, size, nbshp)
176 void *t;
177 bus_space_handle_t bsh;
178 bus_size_t offset, size;
179 bus_space_handle_t *nbshp;
180 {
181
182 *nbshp = bsh + offset;
183 return (0);
184 }
185
186 int
187 nexus_bs_mmap(struct cdev *dev, vm_offset_t off, vm_paddr_t *addr, int prot)
188 {
189 *addr = off;
190 return (0);
191 }
192
193 void
194 nexus_bs_barrier(t, bsh, offset, len, flags)
195 void *t;
196 bus_space_handle_t bsh;
197 bus_size_t offset, len;
198 int flags;
199 {
200 }
201
202 /* End of mainbus_io.c */
Cache object: 3cfc8c4ae2b5e52adbb0e7f7f27a32a7
|