1164426Ssam/*	$NetBSD: ixp425_space.c,v 1.6 2006/04/10 03:36:03 simonb Exp $ */
2164426Ssam
3331722Seadler/*
4164426Ssam * Copyright (c) 2003
5164426Ssam *	Ichiro FUKUHARA <ichiro@ichiro.org>.
6164426Ssam * All rights reserved.
7164426Ssam *
8164426Ssam * Redistribution and use in source and binary forms, with or without
9164426Ssam * modification, are permitted provided that the following conditions
10164426Ssam * are met:
11164426Ssam * 1. Redistributions of source code must retain the above copyright
12164426Ssam *    notice, this list of conditions and the following disclaimer.
13164426Ssam * 2. Redistributions in binary form must reproduce the above copyright
14164426Ssam *    notice, this list of conditions and the following disclaimer in the
15164426Ssam *    documentation and/or other materials provided with the distribution.
16164426Ssam * 3. All advertising materials mentioning features or use of this software
17164426Ssam *    must display the following acknowledgement:
18164426Ssam *	This product includes software developed by Ichiro FUKUHARA.
19164426Ssam * 4. The name of the company nor the name of the author may be used to
20164426Ssam *    endorse or promote products derived from this software without specific
21164426Ssam *    prior written permission.
22164426Ssam *
23164426Ssam * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
24164426Ssam * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25164426Ssam * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26164426Ssam * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
27164426Ssam * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28164426Ssam * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29164426Ssam * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30164426Ssam * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31164426Ssam * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32164426Ssam * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33164426Ssam * SUCH DAMAGE.
34164426Ssam */
35164426Ssam
36164426Ssam#include <sys/cdefs.h>
37164426Ssam__FBSDID("$FreeBSD$");
38164426Ssam
39164426Ssam/*
40164426Ssam * bus_space I/O functions for ixp425
41164426Ssam */
42164426Ssam
43164426Ssam#include <sys/param.h>
44164426Ssam#include <sys/systm.h>
45164426Ssam#include <sys/bus.h>
46164426Ssam
47164426Ssam#include <machine/pcb.h>
48164426Ssam
49164426Ssam#include <vm/vm.h>
50164426Ssam#include <vm/vm_kern.h>
51164426Ssam#include <vm/pmap.h>
52164426Ssam#include <vm/vm_page.h>
53164426Ssam#include <vm/vm_extern.h>
54164426Ssam
55164426Ssam#include <machine/bus.h>
56164426Ssam
57164426Ssam#include <arm/xscale/ixp425/ixp425reg.h>
58164426Ssam#include <arm/xscale/ixp425/ixp425var.h>
59164426Ssam
60164426Ssam/* Proto types for all the bus_space structure functions */
61164426Ssambs_protos(generic);
62164426Ssam
63164426Ssamstruct bus_space ixp425_bs_tag = {
64164426Ssam	/* cookie */
65277460Sian	.bs_privdata	= (void *) 0,
66164426Ssam
67164426Ssam	/* mapping/unmapping */
68177887Sraj	.bs_map		= generic_bs_map,
69177887Sraj	.bs_unmap	= generic_bs_unmap,
70177887Sraj	.bs_subregion	= generic_bs_subregion,
71164426Ssam
72164426Ssam	/* allocation/deallocation */
73177887Sraj	.bs_alloc	= generic_bs_alloc,
74177887Sraj	.bs_free	= generic_bs_free,
75164426Ssam
76164426Ssam	/* barrier */
77177887Sraj	.bs_barrier	= generic_bs_barrier,
78164426Ssam
79164426Ssam	/* read (single) */
80164426Ssam	.bs_r_1		= generic_bs_r_1,
81277467Sian	.bs_r_2		= generic_bs_r_2,
82164426Ssam	.bs_r_4		= generic_bs_r_4,
83164426Ssam	.bs_r_8		= NULL,
84164426Ssam
85164426Ssam	/* read multiple */
86164426Ssam	.bs_rm_1	= generic_bs_rm_1,
87277467Sian	.bs_rm_2	= generic_bs_rm_2,
88164426Ssam	.bs_rm_4	= generic_bs_rm_4,
89164426Ssam	.bs_rm_8	= NULL,
90164426Ssam
91164426Ssam	/* read region */
92164426Ssam	.bs_rr_1	= generic_bs_rr_1,
93277467Sian	.bs_rr_2	= generic_bs_rr_2,
94164426Ssam	.bs_rr_4	= generic_bs_rr_4,
95164426Ssam	.bs_rr_8	= NULL,
96164426Ssam
97164426Ssam	/* write (single) */
98164426Ssam	.bs_w_1		= generic_bs_w_1,
99277467Sian	.bs_w_2		= generic_bs_w_2,
100164426Ssam	.bs_w_4		= generic_bs_w_4,
101164426Ssam	.bs_w_8		= NULL,
102164426Ssam
103164426Ssam	/* write multiple */
104164426Ssam	.bs_wm_1	= generic_bs_wm_1,
105277467Sian	.bs_wm_2	= generic_bs_wm_2,
106164426Ssam	.bs_wm_4	= generic_bs_wm_4,
107164426Ssam	.bs_wm_8	= NULL,
108164426Ssam
109164426Ssam	/* write region */
110164426Ssam	.bs_wr_1	= generic_bs_wr_1,
111277467Sian	.bs_wr_2	= generic_bs_wr_2,
112164426Ssam	.bs_wr_4	= generic_bs_wr_4,
113164426Ssam	.bs_wr_8	= NULL,
114164426Ssam
115164426Ssam	/* set multiple */
116164426Ssam	/* XXX not implemented */
117164426Ssam
118164426Ssam	/* set region */
119164426Ssam	.bs_sr_1	= NULL,
120277467Sian	.bs_sr_2	= generic_bs_sr_2,
121164426Ssam	.bs_sr_4	= generic_bs_sr_4,
122164426Ssam	.bs_sr_8	= NULL,
123164426Ssam
124164426Ssam	/* copy */
125164426Ssam	.bs_c_1		= NULL,
126277467Sian	.bs_c_2		= generic_bs_c_2,
127164426Ssam	.bs_c_4		= NULL,
128164426Ssam	.bs_c_8		= NULL,
129164426Ssam};
130