com_hpcio.c revision 1.2.4.4 1 1.2.4.4 nathanw /* $NetBSD: com_hpcio.c,v 1.2.4.4 2002/10/18 02:37:05 nathanw Exp $ */
2 1.2.4.2 nathanw
3 1.2.4.2 nathanw /*-
4 1.2.4.2 nathanw * Copyright (c) 2002 TAKEMRUA Shin. All rights reserved.
5 1.2.4.2 nathanw *
6 1.2.4.2 nathanw * Redistribution and use in source and binary forms, with or without
7 1.2.4.2 nathanw * modification, are permitted provided that the following conditions
8 1.2.4.2 nathanw * are met:
9 1.2.4.2 nathanw * 1. Redistributions of source code must retain the above copyright
10 1.2.4.2 nathanw * notice, this list of conditions and the following disclaimer.
11 1.2.4.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
12 1.2.4.2 nathanw * notice, this list of conditions and the following disclaimer in the
13 1.2.4.2 nathanw * documentation and/or other materials provided with the distribution.
14 1.2.4.2 nathanw * 3. Neither the name of the project nor the names of its contributors
15 1.2.4.2 nathanw * may be used to endorse or promote products derived from this software
16 1.2.4.2 nathanw * without specific prior written permission.
17 1.2.4.2 nathanw *
18 1.2.4.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 1.2.4.2 nathanw * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 1.2.4.2 nathanw * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 1.2.4.2 nathanw * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 1.2.4.2 nathanw * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 1.2.4.2 nathanw * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 1.2.4.2 nathanw * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 1.2.4.2 nathanw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 1.2.4.2 nathanw * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 1.2.4.2 nathanw * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 1.2.4.2 nathanw * SUCH DAMAGE.
29 1.2.4.2 nathanw *
30 1.2.4.2 nathanw */
31 1.2.4.2 nathanw
32 1.2.4.2 nathanw #include "opt_kgdb.h"
33 1.2.4.2 nathanw
34 1.2.4.2 nathanw #include <sys/param.h>
35 1.2.4.2 nathanw #include <sys/systm.h>
36 1.2.4.2 nathanw #include <sys/device.h>
37 1.2.4.2 nathanw #include <sys/reboot.h>
38 1.2.4.2 nathanw #include <sys/termios.h>
39 1.2.4.2 nathanw
40 1.2.4.2 nathanw #include <machine/intr.h>
41 1.2.4.2 nathanw #include <machine/bus.h>
42 1.2.4.2 nathanw #include <machine/platid.h>
43 1.2.4.2 nathanw #include <machine/platid_mask.h>
44 1.2.4.2 nathanw
45 1.2.4.2 nathanw #include <hpcmips/dev/com_hpciovar.h>
46 1.2.4.2 nathanw
47 1.2.4.2 nathanw #include <dev/hpc/hpciovar.h>
48 1.2.4.2 nathanw #include <dev/ic/comvar.h>
49 1.2.4.2 nathanw #include <dev/ic/comreg.h>
50 1.2.4.2 nathanw
51 1.2.4.2 nathanw #include "locators.h"
52 1.2.4.2 nathanw
53 1.2.4.2 nathanw #define COM_HPCIODEBUG
54 1.2.4.2 nathanw #ifdef COM_HPCIODEBUG
55 1.2.4.2 nathanw int com_hpcio_debug = 0;
56 1.2.4.2 nathanw #define DPRINTF(arg...) do { if (com_hpcio_debug) printf(arg); } while (0)
57 1.2.4.2 nathanw #else
58 1.2.4.2 nathanw #define DPRINTF(arg...) do {} while (0)
59 1.2.4.2 nathanw #endif
60 1.2.4.2 nathanw
61 1.2.4.2 nathanw #define COM_HPCIO_BYTE_ALIGNMENT 0
62 1.2.4.2 nathanw #define COM_HPCIO_HALFWORD_ALIGNMENT 1
63 1.2.4.2 nathanw
64 1.2.4.2 nathanw struct com_hpcio_softc {
65 1.2.4.2 nathanw struct com_softc hsc_com;
66 1.2.4.2 nathanw struct bus_space_tag hsc_iot;
67 1.2.4.2 nathanw struct hpcio_chip *hsc_hc;
68 1.2.4.2 nathanw };
69 1.2.4.2 nathanw static struct bus_space_tag com_hpcio_cniotx;
70 1.2.4.2 nathanw static bus_space_tag_t com_hpcio_cniot = &com_hpcio_cniotx;
71 1.2.4.2 nathanw static int com_hpcio_cniobase;
72 1.2.4.2 nathanw
73 1.2.4.2 nathanw static int com_hpcio_probe(struct device *, struct cfdata *, void *);
74 1.2.4.2 nathanw static void com_hpcio_attach(struct device *, struct device *, void *);
75 1.2.4.2 nathanw static int com_hpcio_common_probe(bus_space_tag_t, int, int *);
76 1.2.4.2 nathanw void com_hpcio_iot_init(bus_space_tag_t iot, bus_space_tag_t base);
77 1.2.4.2 nathanw bus_space_protos(bs_notimpl);
78 1.2.4.2 nathanw bus_space_protos(bs_through);
79 1.2.4.2 nathanw bus_space_protos(com_hpcio);
80 1.2.4.2 nathanw
81 1.2.4.4 nathanw CFATTACH_DECL(com_hpcio, sizeof(struct com_hpcio_softc),
82 1.2.4.4 nathanw com_hpcio_probe, com_hpcio_attach, NULL, NULL);
83 1.2.4.2 nathanw
84 1.2.4.2 nathanw struct bus_space_ops com_hpcio_bs_ops = {
85 1.2.4.2 nathanw /* mapping/unmapping */
86 1.2.4.2 nathanw bs_through_bs_map,
87 1.2.4.2 nathanw bs_through_bs_unmap,
88 1.2.4.2 nathanw bs_through_bs_subregion,
89 1.2.4.2 nathanw
90 1.2.4.2 nathanw /* allocation/deallocation */
91 1.2.4.2 nathanw bs_through_bs_alloc,
92 1.2.4.2 nathanw bs_through_bs_free,
93 1.2.4.2 nathanw
94 1.2.4.2 nathanw /* get kernel virtual address */
95 1.2.4.2 nathanw bs_through_bs_vaddr, /* there is no linear mapping */
96 1.2.4.2 nathanw
97 1.2.4.2 nathanw /* Mmap bus space for user */
98 1.2.4.2 nathanw bs_through_bs_mmap,
99 1.2.4.2 nathanw
100 1.2.4.2 nathanw /* barrier */
101 1.2.4.2 nathanw bs_through_bs_barrier,
102 1.2.4.2 nathanw
103 1.2.4.3 nathanw /* probe */
104 1.2.4.3 nathanw bs_through_bs_peek,
105 1.2.4.3 nathanw bs_through_bs_poke,
106 1.2.4.3 nathanw
107 1.2.4.2 nathanw /* read (single) */
108 1.2.4.2 nathanw com_hpcio_bs_r_1,
109 1.2.4.2 nathanw bs_notimpl_bs_r_2,
110 1.2.4.2 nathanw bs_notimpl_bs_r_4,
111 1.2.4.2 nathanw bs_notimpl_bs_r_8,
112 1.2.4.2 nathanw
113 1.2.4.2 nathanw /* read multiple */
114 1.2.4.2 nathanw bs_notimpl_bs_rm_1,
115 1.2.4.2 nathanw bs_notimpl_bs_rm_2,
116 1.2.4.2 nathanw bs_notimpl_bs_rm_4,
117 1.2.4.2 nathanw bs_notimpl_bs_rm_8,
118 1.2.4.2 nathanw
119 1.2.4.2 nathanw /* read region */
120 1.2.4.2 nathanw bs_notimpl_bs_rr_1,
121 1.2.4.2 nathanw bs_notimpl_bs_rr_2,
122 1.2.4.2 nathanw bs_notimpl_bs_rr_4,
123 1.2.4.2 nathanw bs_notimpl_bs_rr_8,
124 1.2.4.2 nathanw
125 1.2.4.2 nathanw /* write (single) */
126 1.2.4.2 nathanw com_hpcio_bs_w_1,
127 1.2.4.2 nathanw bs_notimpl_bs_w_2,
128 1.2.4.2 nathanw bs_notimpl_bs_w_4,
129 1.2.4.2 nathanw bs_notimpl_bs_w_8,
130 1.2.4.2 nathanw
131 1.2.4.2 nathanw /* write multiple */
132 1.2.4.2 nathanw com_hpcio_bs_wm_1,
133 1.2.4.2 nathanw bs_notimpl_bs_wm_2,
134 1.2.4.2 nathanw bs_notimpl_bs_wm_4,
135 1.2.4.2 nathanw bs_notimpl_bs_wm_8,
136 1.2.4.2 nathanw
137 1.2.4.2 nathanw /* write region */
138 1.2.4.2 nathanw bs_notimpl_bs_wr_1,
139 1.2.4.2 nathanw bs_notimpl_bs_wr_2,
140 1.2.4.2 nathanw bs_notimpl_bs_wr_4,
141 1.2.4.2 nathanw bs_notimpl_bs_wr_8,
142 1.2.4.2 nathanw
143 1.2.4.2 nathanw #ifdef BUS_SPACE_HAS_REAL_STREAM_METHODS
144 1.2.4.2 nathanw /* read stream (single) */
145 1.2.4.2 nathanw bs_notimpl_bs_rs_1,
146 1.2.4.2 nathanw bs_notimpl_bs_rs_2,
147 1.2.4.2 nathanw bs_notimpl_bs_rs_4,
148 1.2.4.2 nathanw bs_notimpl_bs_rs_8,
149 1.2.4.2 nathanw
150 1.2.4.2 nathanw /* read multiple stream */
151 1.2.4.2 nathanw bs_notimpl_bs_rms_1,
152 1.2.4.2 nathanw bs_notimpl_bs_rms_2,
153 1.2.4.2 nathanw bs_notimpl_bs_rms_4,
154 1.2.4.2 nathanw bs_notimpl_bs_rms_8,
155 1.2.4.2 nathanw
156 1.2.4.2 nathanw /* read region stream */
157 1.2.4.2 nathanw bs_notimpl_bs_rrs_1,
158 1.2.4.2 nathanw bs_notimpl_bs_rrs_2,
159 1.2.4.2 nathanw bs_notimpl_bs_rrs_4,
160 1.2.4.2 nathanw bs_notimpl_bs_rrs_8,
161 1.2.4.2 nathanw
162 1.2.4.2 nathanw /* write stream (single) */
163 1.2.4.2 nathanw bs_notimpl_bs_ws_1,
164 1.2.4.2 nathanw bs_notimpl_bs_ws_2,
165 1.2.4.2 nathanw bs_notimpl_bs_ws_4,
166 1.2.4.2 nathanw bs_notimpl_bs_ws_8,
167 1.2.4.2 nathanw
168 1.2.4.2 nathanw /* write multiple stream */
169 1.2.4.2 nathanw bs_notimpl_bs_wms_1,
170 1.2.4.2 nathanw bs_notimpl_bs_wms_2,
171 1.2.4.2 nathanw bs_notimpl_bs_wms_4,
172 1.2.4.2 nathanw bs_notimpl_bs_wms_8,
173 1.2.4.2 nathanw
174 1.2.4.2 nathanw /* write region stream */
175 1.2.4.2 nathanw bs_notimpl_bs_wrs_1,
176 1.2.4.2 nathanw bs_notimpl_bs_wrs_2,
177 1.2.4.2 nathanw bs_notimpl_bs_wrs_4,
178 1.2.4.2 nathanw bs_notimpl_bs_wrs_8,
179 1.2.4.2 nathanw #endif /* BUS_SPACE_HAS_REAL_STREAM_METHODS */
180 1.2.4.2 nathanw
181 1.2.4.2 nathanw /* set multi */
182 1.2.4.2 nathanw bs_notimpl_bs_sm_1,
183 1.2.4.2 nathanw bs_notimpl_bs_sm_2,
184 1.2.4.2 nathanw bs_notimpl_bs_sm_4,
185 1.2.4.2 nathanw bs_notimpl_bs_sm_8,
186 1.2.4.2 nathanw
187 1.2.4.2 nathanw /* set region */
188 1.2.4.2 nathanw bs_notimpl_bs_sr_1,
189 1.2.4.2 nathanw bs_notimpl_bs_sr_2,
190 1.2.4.2 nathanw bs_notimpl_bs_sr_4,
191 1.2.4.2 nathanw bs_notimpl_bs_sr_8,
192 1.2.4.2 nathanw
193 1.2.4.2 nathanw /* copy */
194 1.2.4.2 nathanw bs_notimpl_bs_c_1,
195 1.2.4.2 nathanw bs_notimpl_bs_c_2,
196 1.2.4.2 nathanw bs_notimpl_bs_c_4,
197 1.2.4.2 nathanw bs_notimpl_bs_c_8,
198 1.2.4.2 nathanw };
199 1.2.4.2 nathanw
200 1.2.4.2 nathanw int
201 1.2.4.2 nathanw com_hpcio_cndb_attach(bus_space_tag_t iot, int iobase, int rate,
202 1.2.4.2 nathanw int frequency, tcflag_t cflag, int kgdb)
203 1.2.4.2 nathanw {
204 1.2.4.2 nathanw int alignment;
205 1.2.4.2 nathanw
206 1.2.4.2 nathanw DPRINTF("com_hpcio_cndb_attach()\n");
207 1.2.4.2 nathanw if (!com_hpcio_common_probe(iot, iobase, &alignment)) {
208 1.2.4.2 nathanw DPRINTF("com_hpcio_cndb_attach(): probe failed\n");
209 1.2.4.2 nathanw return (ENOTTY);
210 1.2.4.2 nathanw }
211 1.2.4.2 nathanw if (alignment == COM_HPCIO_HALFWORD_ALIGNMENT) {
212 1.2.4.2 nathanw DPRINTF("com_hpcio_cndb_attach(): half word aligned\n");
213 1.2.4.2 nathanw com_hpcio_iot_init(&com_hpcio_cniotx, iot);
214 1.2.4.2 nathanw com_hpcio_cniot = &com_hpcio_cniotx;
215 1.2.4.2 nathanw } else {
216 1.2.4.2 nathanw com_hpcio_cniot = iot;
217 1.2.4.2 nathanw }
218 1.2.4.2 nathanw com_hpcio_cniobase = iobase;
219 1.2.4.2 nathanw DPRINTF("com_hpcio_cndb_attach(): probe succeeded\n");
220 1.2.4.2 nathanw #ifdef KGDB
221 1.2.4.2 nathanw if (kgdb)
222 1.2.4.2 nathanw return (com_kgdb_attach(com_hpcio_cniot, iobase, rate,
223 1.2.4.2 nathanw frequency, cflag));
224 1.2.4.2 nathanw else
225 1.2.4.2 nathanw #endif
226 1.2.4.2 nathanw return (comcnattach(com_hpcio_cniot, iobase, rate,
227 1.2.4.2 nathanw frequency, cflag));
228 1.2.4.2 nathanw }
229 1.2.4.2 nathanw
230 1.2.4.2 nathanw static int
231 1.2.4.2 nathanw com_hpcio_common_probe(bus_space_tag_t iot, int iobase, int *alignment)
232 1.2.4.2 nathanw {
233 1.2.4.2 nathanw bus_space_handle_t ioh;
234 1.2.4.2 nathanw static struct bus_space_tag tmpiot;
235 1.2.4.2 nathanw int rv;
236 1.2.4.2 nathanw
237 1.2.4.2 nathanw /*
238 1.2.4.2 nathanw * try byte aligned register
239 1.2.4.2 nathanw */
240 1.2.4.2 nathanw *alignment = COM_HPCIO_BYTE_ALIGNMENT;
241 1.2.4.2 nathanw if (bus_space_map(iot, iobase, 1, 0, &ioh))
242 1.2.4.2 nathanw return 0;
243 1.2.4.2 nathanw rv = comprobe1(iot, ioh);
244 1.2.4.2 nathanw bus_space_unmap(iot, ioh, 1);
245 1.2.4.2 nathanw
246 1.2.4.2 nathanw if (rv != 0)
247 1.2.4.2 nathanw return (rv);
248 1.2.4.2 nathanw
249 1.2.4.2 nathanw /*
250 1.2.4.2 nathanw * try half word aligned register
251 1.2.4.2 nathanw */
252 1.2.4.2 nathanw *alignment = COM_HPCIO_HALFWORD_ALIGNMENT;
253 1.2.4.2 nathanw com_hpcio_iot_init(&tmpiot, iot);
254 1.2.4.2 nathanw if (bus_space_map(&tmpiot, iobase, 1, 0, &ioh))
255 1.2.4.2 nathanw return 0;
256 1.2.4.2 nathanw rv = comprobe1(&tmpiot, ioh);
257 1.2.4.2 nathanw bus_space_unmap(&tmpiot, ioh, 1);
258 1.2.4.2 nathanw
259 1.2.4.2 nathanw return (rv);
260 1.2.4.2 nathanw }
261 1.2.4.2 nathanw
262 1.2.4.2 nathanw static int
263 1.2.4.2 nathanw com_hpcio_probe(struct device *parent, struct cfdata *cf, void *aux)
264 1.2.4.2 nathanw {
265 1.2.4.2 nathanw struct hpcio_attach_args *haa = aux;
266 1.2.4.2 nathanw bus_space_tag_t iot = haa->haa_iot;
267 1.2.4.2 nathanw int addr, alignment;
268 1.2.4.2 nathanw
269 1.2.4.2 nathanw if (cf->cf_loc[HPCIOIFCF_PLATFORM] != HPCIOIFCF_PLATFORM_DEFAULT) {
270 1.2.4.2 nathanw platid_mask_t mask;
271 1.2.4.2 nathanw
272 1.2.4.2 nathanw mask = PLATID_DEREF(cf->cf_loc[HPCIOIFCF_PLATFORM]);
273 1.2.4.2 nathanw if (!platid_match(&platid, &mask))
274 1.2.4.2 nathanw return (0); /* platform id didn't match */
275 1.2.4.2 nathanw }
276 1.2.4.2 nathanw
277 1.2.4.2 nathanw if ((addr = cf->cf_loc[HPCIOIFCF_ADDR]) == HPCIOIFCF_ADDR_DEFAULT)
278 1.2.4.2 nathanw return (0); /* address wasn't specified */
279 1.2.4.2 nathanw
280 1.2.4.2 nathanw return com_hpcio_common_probe(iot, addr, &alignment);
281 1.2.4.2 nathanw }
282 1.2.4.2 nathanw
283 1.2.4.2 nathanw
284 1.2.4.2 nathanw static void
285 1.2.4.2 nathanw com_hpcio_attach(struct device *parent, struct device *self, void *aux)
286 1.2.4.2 nathanw {
287 1.2.4.2 nathanw struct com_hpcio_softc *hsc = (void *)self;
288 1.2.4.2 nathanw struct com_softc *sc = &hsc->hsc_com;
289 1.2.4.2 nathanw struct hpcio_attach_args *haa = aux;
290 1.2.4.2 nathanw bus_space_tag_t iot;
291 1.2.4.2 nathanw bus_space_handle_t ioh;
292 1.2.4.2 nathanw int addr, port, mode, alignment, *loc;
293 1.2.4.2 nathanw
294 1.2.4.2 nathanw loc = sc->sc_dev.dv_cfdata->cf_loc;
295 1.2.4.2 nathanw addr = loc[HPCIOIFCF_ADDR];
296 1.2.4.2 nathanw printf(" addr %x", addr);
297 1.2.4.2 nathanw if ((com_hpcio_cniot == haa->haa_iot ||
298 1.2.4.2 nathanw com_hpcio_cniot->bs_base == haa->haa_iot) &&
299 1.2.4.2 nathanw com_hpcio_cniobase == addr &&
300 1.2.4.2 nathanw com_is_console(com_hpcio_cniot, addr, 0)) {
301 1.2.4.2 nathanw iot = com_hpcio_cniot;
302 1.2.4.2 nathanw if (com_hpcio_cniot->bs_base == haa->haa_iot)
303 1.2.4.2 nathanw printf(", half word aligned");
304 1.2.4.2 nathanw } else {
305 1.2.4.2 nathanw com_hpcio_common_probe(haa->haa_iot, addr, &alignment);
306 1.2.4.2 nathanw if (alignment == COM_HPCIO_HALFWORD_ALIGNMENT) {
307 1.2.4.2 nathanw printf(", half word aligned");
308 1.2.4.2 nathanw iot = &hsc->hsc_iot;
309 1.2.4.2 nathanw com_hpcio_iot_init(iot, haa->haa_iot);
310 1.2.4.2 nathanw } else {
311 1.2.4.2 nathanw iot = haa->haa_iot;
312 1.2.4.2 nathanw }
313 1.2.4.2 nathanw }
314 1.2.4.2 nathanw if (bus_space_map(iot, addr, 1, 0, &ioh)) {
315 1.2.4.2 nathanw printf(": can't map bus space\n");
316 1.2.4.2 nathanw return;
317 1.2.4.2 nathanw }
318 1.2.4.2 nathanw sc->sc_iobase = addr;
319 1.2.4.2 nathanw sc->sc_iot = iot;
320 1.2.4.2 nathanw sc->sc_ioh = ioh;
321 1.2.4.2 nathanw
322 1.2.4.2 nathanw sc->enable = NULL;
323 1.2.4.2 nathanw sc->disable = NULL;
324 1.2.4.2 nathanw
325 1.2.4.2 nathanw sc->sc_frequency = COM_FREQ;
326 1.2.4.2 nathanw com_attach_subr(sc);
327 1.2.4.2 nathanw
328 1.2.4.2 nathanw hsc->hsc_hc = (*haa->haa_getchip)(haa->haa_sc, loc[HPCIOIFCF_IOCHIP]);
329 1.2.4.2 nathanw port = loc[HPCIOIFCF_PORT];
330 1.2.4.2 nathanw mode = HPCIO_INTR_LEVEL | HPCIO_INTR_HIGH;
331 1.2.4.2 nathanw hpcio_intr_establish(hsc->hsc_hc, port, mode, comintr, sc);
332 1.2.4.2 nathanw }
333 1.2.4.2 nathanw
334 1.2.4.2 nathanw /*
335 1.2.4.2 nathanw * bus stuff (registershalf word aligned)
336 1.2.4.2 nathanw */
337 1.2.4.2 nathanw void
338 1.2.4.2 nathanw com_hpcio_iot_init(bus_space_tag_t iot, bus_space_tag_t base)
339 1.2.4.2 nathanw {
340 1.2.4.2 nathanw
341 1.2.4.2 nathanw iot->bs_base = base;
342 1.2.4.2 nathanw iot->bs_ops = com_hpcio_bs_ops; /* structure assignment */
343 1.2.4.2 nathanw iot->bs_ops.bs_r_1 = com_hpcio_bs_r_1;
344 1.2.4.2 nathanw iot->bs_ops.bs_w_1 = com_hpcio_bs_w_1;
345 1.2.4.2 nathanw iot->bs_ops.bs_wm_1 = com_hpcio_bs_wm_1;
346 1.2.4.2 nathanw }
347 1.2.4.2 nathanw
348 1.2.4.2 nathanw u_int8_t
349 1.2.4.2 nathanw com_hpcio_bs_r_1(bus_space_tag_t t, bus_space_handle_t bsh,
350 1.2.4.2 nathanw bus_size_t offset)
351 1.2.4.2 nathanw {
352 1.2.4.2 nathanw return bus_space_read_1(t->bs_base, bsh, offset * 2);
353 1.2.4.2 nathanw }
354 1.2.4.2 nathanw
355 1.2.4.2 nathanw void
356 1.2.4.2 nathanw com_hpcio_bs_w_1(bus_space_tag_t t, bus_space_handle_t bsh,
357 1.2.4.2 nathanw bus_size_t offset, u_int8_t value)
358 1.2.4.2 nathanw {
359 1.2.4.2 nathanw bus_space_write_1(t->bs_base, bsh, offset * 2, value);
360 1.2.4.2 nathanw }
361 1.2.4.2 nathanw
362 1.2.4.2 nathanw void
363 1.2.4.2 nathanw com_hpcio_bs_wm_1(bus_space_tag_t t, bus_space_handle_t bsh,
364 1.2.4.2 nathanw bus_size_t offset, const u_int8_t *addr, bus_size_t count)
365 1.2.4.2 nathanw {
366 1.2.4.2 nathanw bus_space_write_multi_1(t->bs_base, bsh, offset * 2, addr, count);
367 1.2.4.2 nathanw }
368