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