1/*-
2 * Copyright (C) 2012 FreeBSD Foundation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of MARVELL nor the names of contributors
14 *    may be used to endorse or promote products derived from this software
15 *    without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD$");
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/bus.h>
36#include <sys/kernel.h>
37#include <sys/malloc.h>
38
39#include <machine/bus.h>
40
41/* Prototypes for all the bus_space structure functions */
42bs_protos(generic);
43bs_protos(generic_armv4);
44
45struct bus_space _base_tag = {
46	/* cookie */
47	.bs_cookie	= (void *) 0,
48
49	/* mapping/unmapping */
50	.bs_map		= generic_bs_map,
51	.bs_unmap	= generic_bs_unmap,
52	.bs_subregion	= generic_bs_subregion,
53
54	/* allocation/deallocation */
55	.bs_alloc	= generic_bs_alloc,
56	.bs_free	= generic_bs_free,
57
58	/* barrier */
59	.bs_barrier	= generic_bs_barrier,
60
61	/* read (single) */
62	.bs_r_1		= generic_bs_r_1,
63	.bs_r_2		= generic_armv4_bs_r_2,
64	.bs_r_4		= generic_bs_r_4,
65	.bs_r_8		= NULL,
66
67	/* read multiple */
68	.bs_rm_1	= generic_bs_rm_1,
69	.bs_rm_2	= generic_armv4_bs_rm_2,
70	.bs_rm_4	= generic_bs_rm_4,
71	.bs_rm_8	= NULL,
72
73	/* read region */
74	.bs_rr_1	= generic_bs_rr_1,
75	.bs_rr_2	= generic_armv4_bs_rr_2,
76	.bs_rr_4	= generic_bs_rr_4,
77	.bs_rr_8	= NULL,
78
79	/* write (single) */
80	.bs_w_1		= generic_bs_w_1,
81	.bs_w_2		= generic_armv4_bs_w_2,
82	.bs_w_4		= generic_bs_w_4,
83	.bs_w_8		= NULL,
84
85	/* write multiple */
86	.bs_wm_1	= generic_bs_wm_1,
87	.bs_wm_2	= generic_armv4_bs_wm_2,
88	.bs_wm_4	= generic_bs_wm_4,
89	.bs_wm_8	= NULL,
90
91	/* write region */
92	.bs_wr_1	= generic_bs_wr_1,
93	.bs_wr_2	= generic_armv4_bs_wr_2,
94	.bs_wr_4	= generic_bs_wr_4,
95	.bs_wr_8	= NULL,
96
97	/* set multiple */
98	/* XXX not implemented */
99
100	/* set region */
101	.bs_sr_1	= NULL,
102	.bs_sr_2	= generic_armv4_bs_sr_2,
103	.bs_sr_4	= generic_bs_sr_4,
104	.bs_sr_8	= NULL,
105
106	/* copy */
107	.bs_c_1		= NULL,
108	.bs_c_2		= generic_armv4_bs_c_2,
109	.bs_c_4		= NULL,
110	.bs_c_8		= NULL,
111};
112
113bus_space_tag_t fdtbus_bs_tag = &_base_tag;
114