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