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