1129198Scognet/*	$NetBSD: sa11x0_io.c,v 1.12 2003/07/15 00:24:51 lukem Exp $	*/
2129198Scognet
3139735Simp/*-
4129198Scognet * Copyright (c) 1997 Mark Brinicombe.
5129198Scognet * Copyright (c) 1997 Causality Limited.
6129198Scognet * All rights reserved.
7129198Scognet *
8129198Scognet * This code is derived from software contributed to The NetBSD Foundation
9129198Scognet * by Ichiro FUKUHARA.
10129198Scognet *
11129198Scognet * Redistribution and use in source and binary forms, with or without
12129198Scognet * modification, are permitted provided that the following conditions
13129198Scognet * are met:
14129198Scognet * 1. Redistributions of source code must retain the above copyright
15129198Scognet *    notice, this list of conditions and the following disclaimer.
16129198Scognet * 2. Redistributions in binary form must reproduce the above copyright
17129198Scognet *    notice, this list of conditions and the following disclaimer in the
18129198Scognet *    documentation and/or other materials provided with the distribution.
19129198Scognet * 3. All advertising materials mentioning features or use of this software
20129198Scognet *    must display the following acknowledgement:
21129198Scognet *	This product includes software developed by Mark Brinicombe.
22129198Scognet * 4. The name of the company nor the name of the author may be used to
23129198Scognet *    endorse or promote products derived from this software without specific
24129198Scognet *    prior written permission.
25129198Scognet *
26129198Scognet * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
27129198Scognet * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28129198Scognet * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29129198Scognet * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
30129198Scognet * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31129198Scognet * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32129198Scognet * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33129198Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34129198Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35129198Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36129198Scognet * SUCH DAMAGE.
37129198Scognet */
38129198Scognet
39129198Scognet/*
40129198Scognet * bus_space I/O functions for sa11x0
41129198Scognet */
42129198Scognet
43129198Scognet#include <sys/cdefs.h>
44129198Scognet__FBSDID("$FreeBSD$");
45129198Scognet#include <sys/param.h>
46129198Scognet#include <sys/systm.h>
47129198Scognet#include <sys/queue.h>
48129198Scognet#include <sys/lock.h>
49129198Scognet#include <sys/mutex.h>
50129198Scognet
51129198Scognet#include <vm/vm.h>
52129198Scognet#include <vm/pmap.h>
53129198Scognet#include <vm/vm_extern.h>
54129198Scognet#include <vm/vm_kern.h>
55129198Scognet
56129198Scognet#include <machine/bus.h>
57129198Scognet#include <machine/pmap.h>
58129198Scognet
59129198Scognet/* Proto types for all the bus_space structure functions */
60129198Scognet
61177887Srajbs_protos(generic);
62129198Scognetbs_protos(sa11x0);
63129198Scognet
64129198Scognet/* Declare the sa11x0 bus space tag */
65129198Scognet
66129198Scognetstruct bus_space sa11x0_bs_tag = {
67129198Scognet	/* cookie */
68129198Scognet	NULL,
69129198Scognet
70129198Scognet	/* mapping/unmapping */
71177887Sraj	generic_bs_map,
72177887Sraj	generic_bs_unmap,
73177887Sraj	generic_bs_subregion,
74129198Scognet
75129198Scognet	/* allocation/deallocation */
76177887Sraj	generic_bs_alloc,
77177887Sraj	generic_bs_free,
78129198Scognet
79129198Scognet	/* barrier */
80177887Sraj	generic_bs_barrier,
81129198Scognet
82129198Scognet	/* read (single) */
83129198Scognet	sa11x0_bs_r_1,
84129198Scognet	sa11x0_bs_r_2,
85129198Scognet	sa11x0_bs_r_4,
86129198Scognet	NULL,
87129198Scognet
88129198Scognet	/* read multiple */
89129198Scognet	sa11x0_bs_rm_1,
90129198Scognet	sa11x0_bs_rm_2,
91129198Scognet	sa11x0_bs_rm_4,
92129198Scognet	NULL,
93129198Scognet
94129198Scognet	/* read region */
95129198Scognet	NULL,
96129198Scognet	sa11x0_bs_rr_2,
97129198Scognet	NULL,
98129198Scognet	NULL,
99129198Scognet	/* write (single) */
100129198Scognet	sa11x0_bs_w_1,
101129198Scognet	sa11x0_bs_w_2,
102129198Scognet	sa11x0_bs_w_4,
103129198Scognet	NULL,
104129198Scognet
105129198Scognet	/* write multiple */
106129198Scognet	sa11x0_bs_wm_1,
107129198Scognet	sa11x0_bs_wm_2,
108129198Scognet	sa11x0_bs_wm_4,
109129198Scognet	NULL,
110129198Scognet
111129198Scognet	/* write region */
112129198Scognet	NULL,
113129198Scognet	sa11x0_bs_wr_2,
114129198Scognet	NULL,
115129198Scognet	NULL,
116129198Scognet
117129198Scognet	/* set multiple */
118129198Scognet	NULL,
119129198Scognet	NULL,
120129198Scognet	NULL,
121129198Scognet	NULL,
122129198Scognet
123129198Scognet	/* set region */
124129198Scognet	NULL,
125129198Scognet	sa11x0_bs_sr_2,
126129198Scognet	NULL,
127129198Scognet	NULL,
128129198Scognet
129129198Scognet	/* copy */
130129198Scognet	NULL,
131129198Scognet	sa11x0_bs_c_2,
132129198Scognet	NULL,
133129198Scognet	NULL,
134129198Scognet};
135129198Scognet
136129198Scognet/* End of sa11x0_io.c */
137