com_hpcio.c revision 1.2.4.3 1 1.2.4.3 nathanw /* $NetBSD: com_hpcio.c,v 1.2.4.3 2002/04/17 00:03:07 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.2 nathanw struct cfattach com_hpcio_ca = {
82 1.2.4.2 nathanw sizeof(struct com_hpcio_softc), com_hpcio_probe, com_hpcio_attach
83 1.2.4.2 nathanw };
84 1.2.4.2 nathanw
85 1.2.4.2 nathanw struct bus_space_ops com_hpcio_bs_ops = {
86 1.2.4.2 nathanw /* mapping/unmapping */
87 1.2.4.2 nathanw bs_through_bs_map,
88 1.2.4.2 nathanw bs_through_bs_unmap,
89 1.2.4.2 nathanw bs_through_bs_subregion,
90 1.2.4.2 nathanw
91 1.2.4.2 nathanw /* allocation/deallocation */
92 1.2.4.2 nathanw bs_through_bs_alloc,
93 1.2.4.2 nathanw bs_through_bs_free,
94 1.2.4.2 nathanw
95 1.2.4.2 nathanw /* get kernel virtual address */
96 1.2.4.2 nathanw bs_through_bs_vaddr, /* there is no linear mapping */
97 1.2.4.2 nathanw
98 1.2.4.2 nathanw /* Mmap bus space for user */
99 1.2.4.2 nathanw bs_through_bs_mmap,
100 1.2.4.2 nathanw
101 1.2.4.2 nathanw /* barrier */
102 1.2.4.2 nathanw bs_through_bs_barrier,
103 1.2.4.2 nathanw
104 1.2.4.3 nathanw /* probe */
105 1.2.4.3 nathanw bs_through_bs_peek,
106 1.2.4.3 nathanw bs_through_bs_poke,
107 1.2.4.3 nathanw
108 1.2.4.2 nathanw /* read (single) */
109 1.2.4.2 nathanw com_hpcio_bs_r_1,
110 1.2.4.2 nathanw bs_notimpl_bs_r_2,
111 1.2.4.2 nathanw bs_notimpl_bs_r_4,
112 1.2.4.2 nathanw bs_notimpl_bs_r_8,
113 1.2.4.2 nathanw
114 1.2.4.2 nathanw /* read multiple */
115 1.2.4.2 nathanw bs_notimpl_bs_rm_1,
116 1.2.4.2 nathanw bs_notimpl_bs_rm_2,
117 1.2.4.2 nathanw bs_notimpl_bs_rm_4,
118 1.2.4.2 nathanw bs_notimpl_bs_rm_8,
119 1.2.4.2 nathanw
120 1.2.4.2 nathanw /* read region */
121 1.2.4.2 nathanw bs_notimpl_bs_rr_1,
122 1.2.4.2 nathanw bs_notimpl_bs_rr_2,
123 1.2.4.2 nathanw bs_notimpl_bs_rr_4,
124 1.2.4.2 nathanw bs_notimpl_bs_rr_8,
125 1.2.4.2 nathanw
126 1.2.4.2 nathanw /* write (single) */
127 1.2.4.2 nathanw com_hpcio_bs_w_1,
128 1.2.4.2 nathanw bs_notimpl_bs_w_2,
129 1.2.4.2 nathanw bs_notimpl_bs_w_4,
130 1.2.4.2 nathanw bs_notimpl_bs_w_8,
131 1.2.4.2 nathanw
132 1.2.4.2 nathanw /* write multiple */
133 1.2.4.2 nathanw com_hpcio_bs_wm_1,
134 1.2.4.2 nathanw bs_notimpl_bs_wm_2,
135 1.2.4.2 nathanw bs_notimpl_bs_wm_4,
136 1.2.4.2 nathanw bs_notimpl_bs_wm_8,
137 1.2.4.2 nathanw
138 1.2.4.2 nathanw /* write region */
139 1.2.4.2 nathanw bs_notimpl_bs_wr_1,
140 1.2.4.2 nathanw bs_notimpl_bs_wr_2,
141 1.2.4.2 nathanw bs_notimpl_bs_wr_4,
142 1.2.4.2 nathanw bs_notimpl_bs_wr_8,
143 1.2.4.2 nathanw
144 1.2.4.2 nathanw #ifdef BUS_SPACE_HAS_REAL_STREAM_METHODS
145 1.2.4.2 nathanw /* read stream (single) */
146 1.2.4.2 nathanw bs_notimpl_bs_rs_1,
147 1.2.4.2 nathanw bs_notimpl_bs_rs_2,
148 1.2.4.2 nathanw bs_notimpl_bs_rs_4,
149 1.2.4.2 nathanw bs_notimpl_bs_rs_8,
150 1.2.4.2 nathanw
151 1.2.4.2 nathanw /* read multiple stream */
152 1.2.4.2 nathanw bs_notimpl_bs_rms_1,
153 1.2.4.2 nathanw bs_notimpl_bs_rms_2,
154 1.2.4.2 nathanw bs_notimpl_bs_rms_4,
155 1.2.4.2 nathanw bs_notimpl_bs_rms_8,
156 1.2.4.2 nathanw
157 1.2.4.2 nathanw /* read region stream */
158 1.2.4.2 nathanw bs_notimpl_bs_rrs_1,
159 1.2.4.2 nathanw bs_notimpl_bs_rrs_2,
160 1.2.4.2 nathanw bs_notimpl_bs_rrs_4,
161 1.2.4.2 nathanw bs_notimpl_bs_rrs_8,
162 1.2.4.2 nathanw
163 1.2.4.2 nathanw /* write stream (single) */
164 1.2.4.2 nathanw bs_notimpl_bs_ws_1,
165 1.2.4.2 nathanw bs_notimpl_bs_ws_2,
166 1.2.4.2 nathanw bs_notimpl_bs_ws_4,
167 1.2.4.2 nathanw bs_notimpl_bs_ws_8,
168 1.2.4.2 nathanw
169 1.2.4.2 nathanw /* write multiple stream */
170 1.2.4.2 nathanw bs_notimpl_bs_wms_1,
171 1.2.4.2 nathanw bs_notimpl_bs_wms_2,
172 1.2.4.2 nathanw bs_notimpl_bs_wms_4,
173 1.2.4.2 nathanw bs_notimpl_bs_wms_8,
174 1.2.4.2 nathanw
175 1.2.4.2 nathanw /* write region stream */
176 1.2.4.2 nathanw bs_notimpl_bs_wrs_1,
177 1.2.4.2 nathanw bs_notimpl_bs_wrs_2,
178 1.2.4.2 nathanw bs_notimpl_bs_wrs_4,
179 1.2.4.2 nathanw bs_notimpl_bs_wrs_8,
180 1.2.4.2 nathanw #endif /* BUS_SPACE_HAS_REAL_STREAM_METHODS */
181 1.2.4.2 nathanw
182 1.2.4.2 nathanw /* set multi */
183 1.2.4.2 nathanw bs_notimpl_bs_sm_1,
184 1.2.4.2 nathanw bs_notimpl_bs_sm_2,
185 1.2.4.2 nathanw bs_notimpl_bs_sm_4,
186 1.2.4.2 nathanw bs_notimpl_bs_sm_8,
187 1.2.4.2 nathanw
188 1.2.4.2 nathanw /* set region */
189 1.2.4.2 nathanw bs_notimpl_bs_sr_1,
190 1.2.4.2 nathanw bs_notimpl_bs_sr_2,
191 1.2.4.2 nathanw bs_notimpl_bs_sr_4,
192 1.2.4.2 nathanw bs_notimpl_bs_sr_8,
193 1.2.4.2 nathanw
194 1.2.4.2 nathanw /* copy */
195 1.2.4.2 nathanw bs_notimpl_bs_c_1,
196 1.2.4.2 nathanw bs_notimpl_bs_c_2,
197 1.2.4.2 nathanw bs_notimpl_bs_c_4,
198 1.2.4.2 nathanw bs_notimpl_bs_c_8,
199 1.2.4.2 nathanw };
200 1.2.4.2 nathanw
201 1.2.4.2 nathanw int
202 1.2.4.2 nathanw com_hpcio_cndb_attach(bus_space_tag_t iot, int iobase, int rate,
203 1.2.4.2 nathanw int frequency, tcflag_t cflag, int kgdb)
204 1.2.4.2 nathanw {
205 1.2.4.2 nathanw int alignment;
206 1.2.4.2 nathanw
207 1.2.4.2 nathanw DPRINTF("com_hpcio_cndb_attach()\n");
208 1.2.4.2 nathanw if (!com_hpcio_common_probe(iot, iobase, &alignment)) {
209 1.2.4.2 nathanw DPRINTF("com_hpcio_cndb_attach(): probe failed\n");
210 1.2.4.2 nathanw return (ENOTTY);
211 1.2.4.2 nathanw }
212 1.2.4.2 nathanw if (alignment == COM_HPCIO_HALFWORD_ALIGNMENT) {
213 1.2.4.2 nathanw DPRINTF("com_hpcio_cndb_attach(): half word aligned\n");
214 1.2.4.2 nathanw com_hpcio_iot_init(&com_hpcio_cniotx, iot);
215 1.2.4.2 nathanw com_hpcio_cniot = &com_hpcio_cniotx;
216 1.2.4.2 nathanw } else {
217 1.2.4.2 nathanw com_hpcio_cniot = iot;
218 1.2.4.2 nathanw }
219 1.2.4.2 nathanw com_hpcio_cniobase = iobase;
220 1.2.4.2 nathanw DPRINTF("com_hpcio_cndb_attach(): probe succeeded\n");
221 1.2.4.2 nathanw #ifdef KGDB
222 1.2.4.2 nathanw if (kgdb)
223 1.2.4.2 nathanw return (com_kgdb_attach(com_hpcio_cniot, iobase, rate,
224 1.2.4.2 nathanw frequency, cflag));
225 1.2.4.2 nathanw else
226 1.2.4.2 nathanw #endif
227 1.2.4.2 nathanw return (comcnattach(com_hpcio_cniot, iobase, rate,
228 1.2.4.2 nathanw frequency, cflag));
229 1.2.4.2 nathanw }
230 1.2.4.2 nathanw
231 1.2.4.2 nathanw static int
232 1.2.4.2 nathanw com_hpcio_common_probe(bus_space_tag_t iot, int iobase, int *alignment)
233 1.2.4.2 nathanw {
234 1.2.4.2 nathanw bus_space_handle_t ioh;
235 1.2.4.2 nathanw static struct bus_space_tag tmpiot;
236 1.2.4.2 nathanw int rv;
237 1.2.4.2 nathanw
238 1.2.4.2 nathanw /*
239 1.2.4.2 nathanw * try byte aligned register
240 1.2.4.2 nathanw */
241 1.2.4.2 nathanw *alignment = COM_HPCIO_BYTE_ALIGNMENT;
242 1.2.4.2 nathanw if (bus_space_map(iot, iobase, 1, 0, &ioh))
243 1.2.4.2 nathanw return 0;
244 1.2.4.2 nathanw rv = comprobe1(iot, ioh);
245 1.2.4.2 nathanw bus_space_unmap(iot, ioh, 1);
246 1.2.4.2 nathanw
247 1.2.4.2 nathanw if (rv != 0)
248 1.2.4.2 nathanw return (rv);
249 1.2.4.2 nathanw
250 1.2.4.2 nathanw /*
251 1.2.4.2 nathanw * try half word aligned register
252 1.2.4.2 nathanw */
253 1.2.4.2 nathanw *alignment = COM_HPCIO_HALFWORD_ALIGNMENT;
254 1.2.4.2 nathanw com_hpcio_iot_init(&tmpiot, iot);
255 1.2.4.2 nathanw if (bus_space_map(&tmpiot, iobase, 1, 0, &ioh))
256 1.2.4.2 nathanw return 0;
257 1.2.4.2 nathanw rv = comprobe1(&tmpiot, ioh);
258 1.2.4.2 nathanw bus_space_unmap(&tmpiot, ioh, 1);
259 1.2.4.2 nathanw
260 1.2.4.2 nathanw return (rv);
261 1.2.4.2 nathanw }
262 1.2.4.2 nathanw
263 1.2.4.2 nathanw static int
264 1.2.4.2 nathanw com_hpcio_probe(struct device *parent, struct cfdata *cf, void *aux)
265 1.2.4.2 nathanw {
266 1.2.4.2 nathanw struct hpcio_attach_args *haa = aux;
267 1.2.4.2 nathanw bus_space_tag_t iot = haa->haa_iot;
268 1.2.4.2 nathanw int addr, alignment;
269 1.2.4.2 nathanw
270 1.2.4.2 nathanw if (cf->cf_loc[HPCIOIFCF_PLATFORM] != HPCIOIFCF_PLATFORM_DEFAULT) {
271 1.2.4.2 nathanw platid_mask_t mask;
272 1.2.4.2 nathanw
273 1.2.4.2 nathanw mask = PLATID_DEREF(cf->cf_loc[HPCIOIFCF_PLATFORM]);
274 1.2.4.2 nathanw if (!platid_match(&platid, &mask))
275 1.2.4.2 nathanw return (0); /* platform id didn't match */
276 1.2.4.2 nathanw }
277 1.2.4.2 nathanw
278 1.2.4.2 nathanw if ((addr = cf->cf_loc[HPCIOIFCF_ADDR]) == HPCIOIFCF_ADDR_DEFAULT)
279 1.2.4.2 nathanw return (0); /* address wasn't specified */
280 1.2.4.2 nathanw
281 1.2.4.2 nathanw return com_hpcio_common_probe(iot, addr, &alignment);
282 1.2.4.2 nathanw }
283 1.2.4.2 nathanw
284 1.2.4.2 nathanw
285 1.2.4.2 nathanw static void
286 1.2.4.2 nathanw com_hpcio_attach(struct device *parent, struct device *self, void *aux)
287 1.2.4.2 nathanw {
288 1.2.4.2 nathanw struct com_hpcio_softc *hsc = (void *)self;
289 1.2.4.2 nathanw struct com_softc *sc = &hsc->hsc_com;
290 1.2.4.2 nathanw struct hpcio_attach_args *haa = aux;
291 1.2.4.2 nathanw bus_space_tag_t iot;
292 1.2.4.2 nathanw bus_space_handle_t ioh;
293 1.2.4.2 nathanw int addr, port, mode, alignment, *loc;
294 1.2.4.2 nathanw
295 1.2.4.2 nathanw loc = sc->sc_dev.dv_cfdata->cf_loc;
296 1.2.4.2 nathanw addr = loc[HPCIOIFCF_ADDR];
297 1.2.4.2 nathanw printf(" addr %x", addr);
298 1.2.4.2 nathanw if ((com_hpcio_cniot == haa->haa_iot ||
299 1.2.4.2 nathanw com_hpcio_cniot->bs_base == haa->haa_iot) &&
300 1.2.4.2 nathanw com_hpcio_cniobase == addr &&
301 1.2.4.2 nathanw com_is_console(com_hpcio_cniot, addr, 0)) {
302 1.2.4.2 nathanw iot = com_hpcio_cniot;
303 1.2.4.2 nathanw if (com_hpcio_cniot->bs_base == haa->haa_iot)
304 1.2.4.2 nathanw printf(", half word aligned");
305 1.2.4.2 nathanw } else {
306 1.2.4.2 nathanw com_hpcio_common_probe(haa->haa_iot, addr, &alignment);
307 1.2.4.2 nathanw if (alignment == COM_HPCIO_HALFWORD_ALIGNMENT) {
308 1.2.4.2 nathanw printf(", half word aligned");
309 1.2.4.2 nathanw iot = &hsc->hsc_iot;
310 1.2.4.2 nathanw com_hpcio_iot_init(iot, haa->haa_iot);
311 1.2.4.2 nathanw } else {
312 1.2.4.2 nathanw iot = haa->haa_iot;
313 1.2.4.2 nathanw }
314 1.2.4.2 nathanw }
315 1.2.4.2 nathanw if (bus_space_map(iot, addr, 1, 0, &ioh)) {
316 1.2.4.2 nathanw printf(": can't map bus space\n");
317 1.2.4.2 nathanw return;
318 1.2.4.2 nathanw }
319 1.2.4.2 nathanw sc->sc_iobase = addr;
320 1.2.4.2 nathanw sc->sc_iot = iot;
321 1.2.4.2 nathanw sc->sc_ioh = ioh;
322 1.2.4.2 nathanw
323 1.2.4.2 nathanw sc->enable = NULL;
324 1.2.4.2 nathanw sc->disable = NULL;
325 1.2.4.2 nathanw
326 1.2.4.2 nathanw sc->sc_frequency = COM_FREQ;
327 1.2.4.2 nathanw com_attach_subr(sc);
328 1.2.4.2 nathanw
329 1.2.4.2 nathanw hsc->hsc_hc = (*haa->haa_getchip)(haa->haa_sc, loc[HPCIOIFCF_IOCHIP]);
330 1.2.4.2 nathanw port = loc[HPCIOIFCF_PORT];
331 1.2.4.2 nathanw mode = HPCIO_INTR_LEVEL | HPCIO_INTR_HIGH;
332 1.2.4.2 nathanw hpcio_intr_establish(hsc->hsc_hc, port, mode, comintr, sc);
333 1.2.4.2 nathanw }
334 1.2.4.2 nathanw
335 1.2.4.2 nathanw /*
336 1.2.4.2 nathanw * bus stuff (registershalf word aligned)
337 1.2.4.2 nathanw */
338 1.2.4.2 nathanw void
339 1.2.4.2 nathanw com_hpcio_iot_init(bus_space_tag_t iot, bus_space_tag_t base)
340 1.2.4.2 nathanw {
341 1.2.4.2 nathanw
342 1.2.4.2 nathanw iot->bs_base = base;
343 1.2.4.2 nathanw iot->bs_ops = com_hpcio_bs_ops; /* structure assignment */
344 1.2.4.2 nathanw iot->bs_ops.bs_r_1 = com_hpcio_bs_r_1;
345 1.2.4.2 nathanw iot->bs_ops.bs_w_1 = com_hpcio_bs_w_1;
346 1.2.4.2 nathanw iot->bs_ops.bs_wm_1 = com_hpcio_bs_wm_1;
347 1.2.4.2 nathanw }
348 1.2.4.2 nathanw
349 1.2.4.2 nathanw u_int8_t
350 1.2.4.2 nathanw com_hpcio_bs_r_1(bus_space_tag_t t, bus_space_handle_t bsh,
351 1.2.4.2 nathanw bus_size_t offset)
352 1.2.4.2 nathanw {
353 1.2.4.2 nathanw return bus_space_read_1(t->bs_base, bsh, offset * 2);
354 1.2.4.2 nathanw }
355 1.2.4.2 nathanw
356 1.2.4.2 nathanw void
357 1.2.4.2 nathanw com_hpcio_bs_w_1(bus_space_tag_t t, bus_space_handle_t bsh,
358 1.2.4.2 nathanw bus_size_t offset, u_int8_t value)
359 1.2.4.2 nathanw {
360 1.2.4.2 nathanw bus_space_write_1(t->bs_base, bsh, offset * 2, value);
361 1.2.4.2 nathanw }
362 1.2.4.2 nathanw
363 1.2.4.2 nathanw void
364 1.2.4.2 nathanw com_hpcio_bs_wm_1(bus_space_tag_t t, bus_space_handle_t bsh,
365 1.2.4.2 nathanw bus_size_t offset, const u_int8_t *addr, bus_size_t count)
366 1.2.4.2 nathanw {
367 1.2.4.2 nathanw bus_space_write_multi_1(t->bs_base, bsh, offset * 2, addr, count);
368 1.2.4.2 nathanw }
369