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: releng/6.1/sys/arm/arm/nexus_io.c 139735 2005-01-05 21:58:49Z imp $");
41
42 #include <sys/param.h>
43 #include <sys/systm.h>
44 #include <sys/queue.h>
45 #include <sys/types.h>
46 #include <sys/bus.h>
47 #include <sys/lock.h>
48 #include <sys/mutex.h>
49 #include <vm/vm.h>
50 #include <vm/pmap.h>
51 #include <vm/vm_extern.h>
52
53
54 #include <machine/bus.h>
55 #include <machine/pmap.h>
56
57 /* Proto types for all the bus_space structure functions */
58 vm_offset_t lala;
59 bs_protos(nexus);
60 /* Declare the mainbus bus space tag */
61
62 struct bus_space mainbus_bs_tag = {
63 /* cookie */
64 NULL,
65
66 /* mapping/unmapping */
67 nexus_bs_map,
68 nexus_bs_unmap,
69 nexus_bs_subregion,
70
71 /* allocation/deallocation */
72 nexus_bs_alloc,
73 nexus_bs_free,
74
75 /* barrier */
76 nexus_bs_barrier,
77
78 /* read (single) */
79 nexus_bs_r_1,
80 nexus_bs_r_2,
81 nexus_bs_r_4,
82 NULL,
83
84 /* read multiple */
85 NULL,
86 nexus_bs_rm_2,
87 NULL,
88 NULL,
89
90 /* read region */
91 NULL,
92 NULL,
93 NULL,
94 NULL,
95
96 /* write (single) */
97 nexus_bs_w_1,
98 nexus_bs_w_2,
99 nexus_bs_w_4,
100 NULL,
101
102 /* write multiple */
103 nexus_bs_wm_1,
104 nexus_bs_wm_2,
105 NULL,
106 NULL,
107
108 /* write region */
109 NULL,
110 NULL,
111 NULL,
112 NULL,
113
114 NULL,
115 NULL,
116 NULL,
117 NULL,
118
119 /* set region */
120 NULL,
121 NULL,
122 NULL,
123 NULL,
124
125 /* copy */
126 NULL,
127 NULL,
128 NULL,
129 NULL,
130 };
131
132 /* bus space functions */
133
134 int
135 nexus_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int cacheable,
136 bus_space_handle_t *bshp)
137 {
138 return(0);
139 }
140
141 int
142 nexus_bs_alloc(t, rstart, rend, size, alignment, boundary, cacheable,
143 bpap, bshp)
144 void *t;
145 bus_addr_t rstart, rend;
146 bus_size_t size, alignment, boundary;
147 int cacheable;
148 bus_addr_t *bpap;
149 bus_space_handle_t *bshp;
150 {
151 panic("mainbus_bs_alloc(): Help!");
152 }
153
154
155 void
156 nexus_bs_unmap(void *t, bus_size_t size)
157 {
158 /*
159 * Temporary implementation
160 */
161 }
162
163 void
164 nexus_bs_free(t, bsh, size)
165 void *t;
166 bus_space_handle_t bsh;
167 bus_size_t size;
168 {
169
170 panic("mainbus_bs_free(): Help!");
171 /* mainbus_bs_unmap() does all that we need to do. */
172 /* mainbus_bs_unmap(t, bsh, size);*/
173 }
174
175 int
176 nexus_bs_subregion(t, bsh, offset, size, nbshp)
177 void *t;
178 bus_space_handle_t bsh;
179 bus_size_t offset, size;
180 bus_space_handle_t *nbshp;
181 {
182
183 *nbshp = bsh + offset;
184 return (0);
185 }
186
187 int
188 nexus_bs_mmap(struct cdev *dev, vm_offset_t off, vm_paddr_t *addr, int prot)
189 {
190 *addr = off;
191 return (0);
192 }
193
194 void
195 nexus_bs_barrier(t, bsh, offset, len, flags)
196 void *t;
197 bus_space_handle_t bsh;
198 bus_size_t offset, len;
199 int flags;
200 {
201 }
202
203 /* End of mainbus_io.c */
Cache object: 28256b902bea766c11fac653b3a4faa2
|