1 /* $NetBSD: footbridge_com_io.c,v 1.5 2003/03/23 14:12:25 chris Exp $ */
4 * Copyright (c) 1997 Mark Brinicombe.
5 * Copyright (c) 1997 Causality Limited.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Mark Brinicombe
19 * for the NetBSD Project.
20 * 4. The name of the company nor the name of the author may be used to
21 * endorse or promote products derived from this software without specific
22 * prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
25 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
28 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * This file provides the bus space tag for the footbridge serial console
42 * bus_space I/O functions for mainbus
45 #include <sys/cdefs.h>
46 __KERNEL_RCSID(0, "$NetBSD: footbridge_com_io.c,v 1.5 2003/03/23 14:12:25 chris Exp $");
48 #include <sys/param.h>
49 #include <sys/systm.h>
50 #include <machine/bus.h>
52 /* Proto types for all the bus_space structure functions */
56 bs_protos(bs_notimpl
);
58 /* Declare the fcomcons bus space tag */
60 struct bus_space fcomcons_bs_tag
= {
64 /* mapping/unmapping */
67 fcomcons_bs_subregion
,
69 /* allocation/deallocation */
73 /* get kernel virtual address */
76 /* Mmap bus space for user */
136 /* bus space functions */
139 fcomcons_bs_map(void *t
, bus_addr_t bpa
, bus_size_t size
, int cacheable
, bus_space_handle_t
*bshp
)
142 * Temporary implementation as all I/O is already mapped etc.
144 * Eventually this function will do the mapping check for multiple maps
151 fcomcons_bs_alloc(t
, rstart
, rend
, size
, alignment
, boundary
, cacheable
,
154 bus_addr_t rstart
, rend
;
155 bus_size_t size
, alignment
, boundary
;
158 bus_space_handle_t
*bshp
;
160 panic("fcomcons_alloc(): Help!");
165 fcomcons_bs_unmap(void *t
, bus_space_handle_t bsh
, bus_size_t size
)
168 * Temporary implementation
173 fcomcons_bs_free(void *t
, bus_space_handle_t bsh
, bus_size_t size
)
176 panic("fcomcons_free(): Help!");
177 /* fcomcons_unmap() does all that we need to do. */
178 /* fcomcons_unmap(t, bsh, size);*/
182 fcomcons_bs_subregion(void *t
, bus_space_handle_t bsh
, bus_size_t offset
, bus_size_t size
, bus_space_handle_t
*nbshp
)
185 *nbshp
= bsh
+ offset
;
190 fcomcons_bs_barrier(void *t
, bus_space_handle_t bsh
, bus_size_t offset
, bus_size_t len
, int flags
)
194 /* End of footbridge_com_io.c */