footbridge_com_io.c revision 1.1 1 1.1 chris /* $NetBSD: footbridge_com_io.c,v 1.1 2001/06/09 10:29:12 chris Exp $ */
2 1.1 chris
3 1.1 chris /*
4 1.1 chris * Copyright (c) 1997 Mark Brinicombe.
5 1.1 chris * Copyright (c) 1997 Causality Limited.
6 1.1 chris * All rights reserved.
7 1.1 chris *
8 1.1 chris * Redistribution and use in source and binary forms, with or without
9 1.1 chris * modification, are permitted provided that the following conditions
10 1.1 chris * are met:
11 1.1 chris * 1. Redistributions of source code must retain the above copyright
12 1.1 chris * notice, this list of conditions and the following disclaimer.
13 1.1 chris * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 chris * notice, this list of conditions and the following disclaimer in the
15 1.1 chris * documentation and/or other materials provided with the distribution.
16 1.1 chris * 3. All advertising materials mentioning features or use of this software
17 1.1 chris * must display the following acknowledgement:
18 1.1 chris * This product includes software developed by Mark Brinicombe
19 1.1 chris * for the NetBSD Project.
20 1.1 chris * 4. The name of the company nor the name of the author may be used to
21 1.1 chris * endorse or promote products derived from this software without specific
22 1.1 chris * prior written permission.
23 1.1 chris *
24 1.1 chris * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
25 1.1 chris * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 1.1 chris * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 1.1 chris * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
28 1.1 chris * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 1.1 chris * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 1.1 chris * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 1.1 chris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 1.1 chris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 1.1 chris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 1.1 chris * SUCH DAMAGE.
35 1.1 chris */
36 1.1 chris
37 1.1 chris /*
38 1.1 chris * This file provides the bus space tag for the footbridge serial console
39 1.1 chris */
40 1.1 chris
41 1.1 chris /*
42 1.1 chris * bus_space I/O functions for mainbus
43 1.1 chris */
44 1.1 chris
45 1.1 chris #include <sys/param.h>
46 1.1 chris #include <sys/systm.h>
47 1.1 chris #include <machine/bus.h>
48 1.1 chris
49 1.1 chris /* Proto types for all the bus_space structure functions */
50 1.1 chris
51 1.1 chris bs_protos(fcomcons);
52 1.1 chris bs_protos(bs_notimpl);
53 1.1 chris
54 1.1 chris /* Declare the fcomcons bus space tag */
55 1.1 chris
56 1.1 chris struct bus_space fcomcons_bs_tag = {
57 1.1 chris /* cookie */
58 1.1 chris NULL,
59 1.1 chris
60 1.1 chris /* mapping/unmapping */
61 1.1 chris fcomcons_bs_map,
62 1.1 chris fcomcons_bs_unmap,
63 1.1 chris fcomcons_bs_subregion,
64 1.1 chris
65 1.1 chris /* allocation/deallocation */
66 1.1 chris fcomcons_bs_alloc,
67 1.1 chris fcomcons_bs_free,
68 1.1 chris
69 1.1 chris /* get kernel virtual address */
70 1.1 chris 0, /* never used */
71 1.1 chris
72 1.1 chris /* barrier */
73 1.1 chris fcomcons_bs_barrier,
74 1.1 chris
75 1.1 chris /* read (single) */
76 1.1 chris bs_notimpl_bs_r_1,
77 1.1 chris bs_notimpl_bs_r_2,
78 1.1 chris fcomcons_bs_r_4,
79 1.1 chris bs_notimpl_bs_r_8,
80 1.1 chris
81 1.1 chris /* read multiple */
82 1.1 chris bs_notimpl_bs_rm_1,
83 1.1 chris bs_notimpl_bs_rm_2,
84 1.1 chris bs_notimpl_bs_rm_4,
85 1.1 chris bs_notimpl_bs_rm_8,
86 1.1 chris
87 1.1 chris /* read region */
88 1.1 chris bs_notimpl_bs_rr_1,
89 1.1 chris bs_notimpl_bs_rr_2,
90 1.1 chris bs_notimpl_bs_rr_4,
91 1.1 chris bs_notimpl_bs_rr_8,
92 1.1 chris
93 1.1 chris /* write (single) */
94 1.1 chris bs_notimpl_bs_w_1,
95 1.1 chris bs_notimpl_bs_w_2,
96 1.1 chris fcomcons_bs_w_4,
97 1.1 chris bs_notimpl_bs_w_8,
98 1.1 chris
99 1.1 chris /* write multiple */
100 1.1 chris bs_notimpl_bs_wm_1,
101 1.1 chris bs_notimpl_bs_wm_2,
102 1.1 chris bs_notimpl_bs_wm_4,
103 1.1 chris bs_notimpl_bs_wm_8,
104 1.1 chris
105 1.1 chris /* write region */
106 1.1 chris bs_notimpl_bs_wr_1,
107 1.1 chris bs_notimpl_bs_wr_2,
108 1.1 chris bs_notimpl_bs_wr_4,
109 1.1 chris bs_notimpl_bs_wr_8,
110 1.1 chris
111 1.1 chris bs_notimpl_bs_sm_1,
112 1.1 chris bs_notimpl_bs_sm_2,
113 1.1 chris bs_notimpl_bs_sm_4,
114 1.1 chris bs_notimpl_bs_sm_8,
115 1.1 chris
116 1.1 chris /* set region */
117 1.1 chris bs_notimpl_bs_sr_1,
118 1.1 chris bs_notimpl_bs_sr_2,
119 1.1 chris bs_notimpl_bs_sr_4,
120 1.1 chris bs_notimpl_bs_sr_8,
121 1.1 chris
122 1.1 chris /* copy */
123 1.1 chris bs_notimpl_bs_c_1,
124 1.1 chris bs_notimpl_bs_c_2,
125 1.1 chris bs_notimpl_bs_c_4,
126 1.1 chris bs_notimpl_bs_c_8,
127 1.1 chris };
128 1.1 chris
129 1.1 chris /* bus space functions */
130 1.1 chris
131 1.1 chris int
132 1.1 chris fcomcons_bs_map(t, bpa, size, cacheable, bshp)
133 1.1 chris void *t;
134 1.1 chris bus_addr_t bpa;
135 1.1 chris bus_size_t size;
136 1.1 chris int cacheable;
137 1.1 chris bus_space_handle_t *bshp;
138 1.1 chris {
139 1.1 chris /*
140 1.1 chris * Temporary implementation as all I/O is already mapped etc.
141 1.1 chris *
142 1.1 chris * Eventually this function will do the mapping check for multiple maps
143 1.1 chris */
144 1.1 chris *bshp = bpa;
145 1.1 chris return(0);
146 1.1 chris }
147 1.1 chris
148 1.1 chris int
149 1.1 chris fcomcons_bs_alloc(t, rstart, rend, size, alignment, boundary, cacheable,
150 1.1 chris bpap, bshp)
151 1.1 chris void *t;
152 1.1 chris bus_addr_t rstart, rend;
153 1.1 chris bus_size_t size, alignment, boundary;
154 1.1 chris int cacheable;
155 1.1 chris bus_addr_t *bpap;
156 1.1 chris bus_space_handle_t *bshp;
157 1.1 chris {
158 1.1 chris panic("fcomcons_alloc(): Help!\n");
159 1.1 chris }
160 1.1 chris
161 1.1 chris
162 1.1 chris void
163 1.1 chris fcomcons_bs_unmap(t, bsh, size)
164 1.1 chris void *t;
165 1.1 chris bus_space_handle_t bsh;
166 1.1 chris bus_size_t size;
167 1.1 chris {
168 1.1 chris /*
169 1.1 chris * Temporary implementation
170 1.1 chris */
171 1.1 chris }
172 1.1 chris
173 1.1 chris void
174 1.1 chris fcomcons_bs_free(t, bsh, size)
175 1.1 chris void *t;
176 1.1 chris bus_space_handle_t bsh;
177 1.1 chris bus_size_t size;
178 1.1 chris {
179 1.1 chris
180 1.1 chris panic("fcomcons_free(): Help!\n");
181 1.1 chris /* fcomcons_unmap() does all that we need to do. */
182 1.1 chris /* fcomcons_unmap(t, bsh, size);*/
183 1.1 chris }
184 1.1 chris
185 1.1 chris int
186 1.1 chris fcomcons_bs_subregion(t, bsh, offset, size, nbshp)
187 1.1 chris void *t;
188 1.1 chris bus_space_handle_t bsh;
189 1.1 chris bus_size_t offset, size;
190 1.1 chris bus_space_handle_t *nbshp;
191 1.1 chris {
192 1.1 chris
193 1.1 chris *nbshp = bsh + offset;
194 1.1 chris return (0);
195 1.1 chris }
196 1.1 chris
197 1.1 chris void
198 1.1 chris fcomcons_bs_barrier(t, bsh, offset, len, flags)
199 1.1 chris void *t;
200 1.1 chris bus_space_handle_t bsh;
201 1.1 chris bus_size_t offset, len;
202 1.1 chris int flags;
203 1.1 chris {
204 1.1 chris }
205 1.1 chris
206 1.1 chris /* End of footbridge_com_io.c */
207