1239278Sgonzo/*-
2239278Sgonzo * Copyright (c) 2011 Jakub Wojciech Klama <jceel@FreeBSD.org>
3239278Sgonzo * All rights reserved.
4239278Sgonzo *
5239278Sgonzo * Redistribution and use in source and binary forms, with or without
6239278Sgonzo * modification, are permitted provided that the following conditions
7239278Sgonzo * are met:
8239278Sgonzo * 1. Redistributions of source code must retain the above copyright
9239278Sgonzo *    notice, this list of conditions and the following disclaimer.
10239278Sgonzo * 2. Redistributions in binary form must reproduce the above copyright
11239278Sgonzo *    notice, this list of conditions and the following disclaimer in the
12239278Sgonzo *    documentation and/or other materials provided with the distribution.
13239278Sgonzo *
14239278Sgonzo * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15239278Sgonzo * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16239278Sgonzo * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17239278Sgonzo * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18239278Sgonzo * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19239278Sgonzo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20239278Sgonzo * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21239278Sgonzo * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22239278Sgonzo * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23239278Sgonzo * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24239278Sgonzo * SUCH DAMAGE.
25239278Sgonzo */
26239278Sgonzo
27239278Sgonzo#include <sys/cdefs.h>
28239278Sgonzo__FBSDID("$FreeBSD$");
29239278Sgonzo
30239278Sgonzo#include <sys/param.h>
31239278Sgonzo#include <sys/systm.h>
32239278Sgonzo#include <sys/bus.h>
33239278Sgonzo#include <sys/kernel.h>
34239278Sgonzo#include <sys/malloc.h>
35239278Sgonzo#include <machine/bus.h>
36239278Sgonzo
37239278Sgonzobs_protos(generic);
38239278Sgonzobs_protos(generic_armv4);
39239278Sgonzo
40239278Sgonzostatic struct bus_space _base_tag = {
41239278Sgonzo	/* cookie */
42239278Sgonzo	NULL,
43239278Sgonzo
44239278Sgonzo	/* mapping/unmapping */
45239278Sgonzo	generic_bs_map,
46239278Sgonzo	generic_bs_unmap,
47239278Sgonzo	generic_bs_subregion,
48239278Sgonzo
49239278Sgonzo	/* allocation/deallocation */
50239278Sgonzo	generic_bs_alloc,
51239278Sgonzo	generic_bs_free,
52239278Sgonzo
53239278Sgonzo	/* barrier */
54239278Sgonzo	generic_bs_barrier,
55239278Sgonzo
56239278Sgonzo	/* read (single) */
57239278Sgonzo	generic_bs_r_1,
58239278Sgonzo	generic_armv4_bs_r_2,
59239278Sgonzo	generic_bs_r_4,
60239278Sgonzo	NULL,
61239278Sgonzo
62239278Sgonzo	/* read (multiple) */
63239278Sgonzo	generic_bs_rm_1,
64239278Sgonzo	generic_armv4_bs_rm_2,
65239278Sgonzo	generic_bs_rm_4,
66239278Sgonzo	NULL,
67239278Sgonzo
68239278Sgonzo	/* read region */
69239278Sgonzo	generic_bs_rr_1,
70239278Sgonzo	generic_armv4_bs_rr_2,
71239278Sgonzo	generic_bs_rr_4,
72239278Sgonzo	NULL,
73239278Sgonzo
74239278Sgonzo	/* write (single) */
75239278Sgonzo	generic_bs_w_1,
76239278Sgonzo	generic_armv4_bs_w_2,
77239278Sgonzo	generic_bs_w_4,
78239278Sgonzo	NULL,
79239278Sgonzo
80239278Sgonzo	/* write multiple */
81239278Sgonzo	generic_bs_wm_1,
82239278Sgonzo	generic_armv4_bs_wm_2,
83239278Sgonzo	generic_bs_wm_4,
84239278Sgonzo	NULL,
85239278Sgonzo
86239278Sgonzo	/* write region */
87239278Sgonzo	NULL,
88239278Sgonzo	NULL,
89239278Sgonzo	NULL,
90239278Sgonzo	NULL,
91239278Sgonzo
92239278Sgonzo	/* set multiple */
93239278Sgonzo	NULL,
94239278Sgonzo	NULL,
95239278Sgonzo	NULL,
96239278Sgonzo	NULL,
97239278Sgonzo
98239278Sgonzo	/* set region */
99239278Sgonzo	NULL,
100239278Sgonzo	NULL,
101239278Sgonzo	NULL,
102239278Sgonzo	NULL,
103239278Sgonzo
104239278Sgonzo	/* copy */
105239278Sgonzo	NULL,
106239278Sgonzo	NULL,
107239278Sgonzo	NULL,
108239278Sgonzo	NULL,
109239278Sgonzo
110239278Sgonzo	/* read stream (single) */
111239278Sgonzo	NULL,
112239278Sgonzo	NULL,
113239278Sgonzo	NULL,
114239278Sgonzo	NULL,
115239278Sgonzo
116239278Sgonzo	/* read multiple stream */
117239278Sgonzo	NULL,
118239278Sgonzo	generic_armv4_bs_rm_2,
119239278Sgonzo	NULL,
120239278Sgonzo	NULL,
121239278Sgonzo
122239278Sgonzo	/* read region stream */
123239278Sgonzo	NULL,
124239278Sgonzo	NULL,
125239278Sgonzo	NULL,
126239278Sgonzo	NULL,
127239278Sgonzo
128239278Sgonzo	/* write stream (single) */
129239278Sgonzo	NULL,
130239278Sgonzo	NULL,
131239278Sgonzo	NULL,
132239278Sgonzo	NULL,
133239278Sgonzo
134239278Sgonzo	/* write multiple stream */
135239278Sgonzo	NULL,
136239278Sgonzo	generic_armv4_bs_wm_2,
137239278Sgonzo	NULL,
138239278Sgonzo	NULL,
139239278Sgonzo
140239278Sgonzo	/* write region stream */
141239278Sgonzo	NULL,
142239278Sgonzo	NULL,
143239278Sgonzo	NULL,
144239278Sgonzo	NULL,
145239278Sgonzo};
146239278Sgonzo
147239278Sgonzobus_space_tag_t fdtbus_bs_tag = &_base_tag;
148