gemini_a4x_space.c revision 1.1.8.2 1 1.1.8.2 mjf /* $NetBSD: gemini_a4x_space.c,v 1.1.8.2 2009/01/17 13:27:52 mjf Exp $ */
2 1.1.8.2 mjf
3 1.1.8.2 mjf /* adapted from:
4 1.1.8.2 mjf * NetBSD: pxa2x0_a4x_space.c,v 1.4 2006/07/28 08:15:29 simonb Exp
5 1.1.8.2 mjf */
6 1.1.8.2 mjf
7 1.1.8.2 mjf /*
8 1.1.8.2 mjf * Copyright (c) 2002 Genetec Corporation. All rights reserved.
9 1.1.8.2 mjf * Written by Hiroyuki Bessho for Genetec Corporation.
10 1.1.8.2 mjf *
11 1.1.8.2 mjf * Redistribution and use in source and binary forms, with or without
12 1.1.8.2 mjf * modification, are permitted provided that the following conditions
13 1.1.8.2 mjf * are met:
14 1.1.8.2 mjf * 1. Redistributions of source code must retain the above copyright
15 1.1.8.2 mjf * notice, this list of conditions and the following disclaimer.
16 1.1.8.2 mjf * 2. Redistributions in binary form must reproduce the above copyright
17 1.1.8.2 mjf * notice, this list of conditions and the following disclaimer in the
18 1.1.8.2 mjf * documentation and/or other materials provided with the distribution.
19 1.1.8.2 mjf * 3. All advertising materials mentioning features or use of this software
20 1.1.8.2 mjf * must display the following acknowledgement:
21 1.1.8.2 mjf * This product includes software developed for the NetBSD Project by
22 1.1.8.2 mjf * Genetec Corporation.
23 1.1.8.2 mjf * 4. The name of Genetec Corporation may not be used to endorse or
24 1.1.8.2 mjf * promote products derived from this software without specific prior
25 1.1.8.2 mjf * written permission.
26 1.1.8.2 mjf *
27 1.1.8.2 mjf * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
28 1.1.8.2 mjf * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 1.1.8.2 mjf * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 1.1.8.2 mjf * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
31 1.1.8.2 mjf * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 1.1.8.2 mjf * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 1.1.8.2 mjf * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 1.1.8.2 mjf * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 1.1.8.2 mjf * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 1.1.8.2 mjf * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 1.1.8.2 mjf * POSSIBILITY OF SUCH DAMAGE.
38 1.1.8.2 mjf */
39 1.1.8.2 mjf
40 1.1.8.2 mjf /*
41 1.1.8.2 mjf * Bus space tag for 8/16-bit devices on 32-bit bus.
42 1.1.8.2 mjf * all registers are located at the address of multiple of 4.
43 1.1.8.2 mjf */
44 1.1.8.2 mjf
45 1.1.8.2 mjf #include <sys/cdefs.h>
46 1.1.8.2 mjf __KERNEL_RCSID(0, "$NetBSD: gemini_a4x_space.c,v 1.1.8.2 2009/01/17 13:27:52 mjf Exp $");
47 1.1.8.2 mjf
48 1.1.8.2 mjf #include <sys/param.h>
49 1.1.8.2 mjf #include <sys/systm.h>
50 1.1.8.2 mjf
51 1.1.8.2 mjf #include <uvm/uvm_extern.h>
52 1.1.8.2 mjf
53 1.1.8.2 mjf #include <machine/bus.h>
54 1.1.8.2 mjf
55 1.1.8.2 mjf /* Prototypes for all the bus_space structure functions */
56 1.1.8.2 mjf bs_protos(gemini);
57 1.1.8.2 mjf bs_protos(a4x);
58 1.1.8.2 mjf bs_protos(generic);
59 1.1.8.2 mjf bs_protos(generic_armv4);
60 1.1.8.2 mjf bs_protos(bs_notimpl);
61 1.1.8.2 mjf
62 1.1.8.2 mjf struct bus_space gemini_a4x_bs_tag = {
63 1.1.8.2 mjf /* cookie */
64 1.1.8.2 mjf (void *) 0,
65 1.1.8.2 mjf
66 1.1.8.2 mjf /* mapping/unmapping */
67 1.1.8.2 mjf gemini_bs_map,
68 1.1.8.2 mjf gemini_bs_unmap,
69 1.1.8.2 mjf gemini_bs_subregion,
70 1.1.8.2 mjf
71 1.1.8.2 mjf /* allocation/deallocation */
72 1.1.8.2 mjf gemini_bs_alloc, /* not implemented */
73 1.1.8.2 mjf gemini_bs_free, /* not implemented */
74 1.1.8.2 mjf
75 1.1.8.2 mjf /* get kernel virtual address */
76 1.1.8.2 mjf gemini_bs_vaddr,
77 1.1.8.2 mjf
78 1.1.8.2 mjf /* mmap */
79 1.1.8.2 mjf bs_notimpl_bs_mmap,
80 1.1.8.2 mjf
81 1.1.8.2 mjf /* barrier */
82 1.1.8.2 mjf gemini_bs_barrier,
83 1.1.8.2 mjf
84 1.1.8.2 mjf /* read (single) */
85 1.1.8.2 mjf a4x_bs_r_1,
86 1.1.8.2 mjf a4x_bs_r_2,
87 1.1.8.2 mjf a4x_bs_r_4,
88 1.1.8.2 mjf bs_notimpl_bs_r_8,
89 1.1.8.2 mjf
90 1.1.8.2 mjf /* read multiple */
91 1.1.8.2 mjf a4x_bs_rm_1,
92 1.1.8.2 mjf a4x_bs_rm_2,
93 1.1.8.2 mjf bs_notimpl_bs_rm_4,
94 1.1.8.2 mjf bs_notimpl_bs_rm_8,
95 1.1.8.2 mjf
96 1.1.8.2 mjf /* read region */
97 1.1.8.2 mjf bs_notimpl_bs_rr_1,
98 1.1.8.2 mjf bs_notimpl_bs_rr_2,
99 1.1.8.2 mjf bs_notimpl_bs_rr_4,
100 1.1.8.2 mjf bs_notimpl_bs_rr_8,
101 1.1.8.2 mjf
102 1.1.8.2 mjf /* write (single) */
103 1.1.8.2 mjf a4x_bs_w_1,
104 1.1.8.2 mjf a4x_bs_w_2,
105 1.1.8.2 mjf a4x_bs_w_4,
106 1.1.8.2 mjf bs_notimpl_bs_w_8,
107 1.1.8.2 mjf
108 1.1.8.2 mjf /* write multiple */
109 1.1.8.2 mjf a4x_bs_wm_1,
110 1.1.8.2 mjf a4x_bs_wm_2,
111 1.1.8.2 mjf bs_notimpl_bs_wm_4,
112 1.1.8.2 mjf bs_notimpl_bs_wm_8,
113 1.1.8.2 mjf
114 1.1.8.2 mjf /* write region */
115 1.1.8.2 mjf bs_notimpl_bs_wr_1,
116 1.1.8.2 mjf bs_notimpl_bs_wr_2,
117 1.1.8.2 mjf bs_notimpl_bs_wr_4,
118 1.1.8.2 mjf bs_notimpl_bs_wr_8,
119 1.1.8.2 mjf
120 1.1.8.2 mjf /* set multiple */
121 1.1.8.2 mjf bs_notimpl_bs_sm_1,
122 1.1.8.2 mjf bs_notimpl_bs_sm_2,
123 1.1.8.2 mjf bs_notimpl_bs_sm_4,
124 1.1.8.2 mjf bs_notimpl_bs_sm_8,
125 1.1.8.2 mjf
126 1.1.8.2 mjf /* set region */
127 1.1.8.2 mjf bs_notimpl_bs_sr_1,
128 1.1.8.2 mjf bs_notimpl_bs_sr_2,
129 1.1.8.2 mjf bs_notimpl_bs_sr_4,
130 1.1.8.2 mjf bs_notimpl_bs_sr_8,
131 1.1.8.2 mjf
132 1.1.8.2 mjf /* copy */
133 1.1.8.2 mjf bs_notimpl_bs_c_1,
134 1.1.8.2 mjf bs_notimpl_bs_c_2,
135 1.1.8.2 mjf bs_notimpl_bs_c_4,
136 1.1.8.2 mjf bs_notimpl_bs_c_8,
137 1.1.8.2 mjf };
138