1164426Ssam/* $NetBSD: ixp425_space.c,v 1.6 2006/04/10 03:36:03 simonb Exp $ */ 2164426Ssam 3164426Ssam/* 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); 62164426Ssambs_protos(generic_armv4); 63164426Ssam 64164426Ssamstruct bus_space ixp425_bs_tag = { 65164426Ssam /* cookie */ 66164426Ssam .bs_cookie = (void *) 0, 67164426Ssam 68164426Ssam /* mapping/unmapping */ 69177887Sraj .bs_map = generic_bs_map, 70177887Sraj .bs_unmap = generic_bs_unmap, 71177887Sraj .bs_subregion = generic_bs_subregion, 72164426Ssam 73164426Ssam /* allocation/deallocation */ 74177887Sraj .bs_alloc = generic_bs_alloc, 75177887Sraj .bs_free = generic_bs_free, 76164426Ssam 77164426Ssam /* barrier */ 78177887Sraj .bs_barrier = generic_bs_barrier, 79164426Ssam 80164426Ssam /* read (single) */ 81164426Ssam .bs_r_1 = generic_bs_r_1, 82164426Ssam .bs_r_2 = generic_armv4_bs_r_2, 83164426Ssam .bs_r_4 = generic_bs_r_4, 84164426Ssam .bs_r_8 = NULL, 85164426Ssam 86164426Ssam /* read multiple */ 87164426Ssam .bs_rm_1 = generic_bs_rm_1, 88164426Ssam .bs_rm_2 = generic_armv4_bs_rm_2, 89164426Ssam .bs_rm_4 = generic_bs_rm_4, 90164426Ssam .bs_rm_8 = NULL, 91164426Ssam 92164426Ssam /* read region */ 93164426Ssam .bs_rr_1 = generic_bs_rr_1, 94164426Ssam .bs_rr_2 = generic_armv4_bs_rr_2, 95164426Ssam .bs_rr_4 = generic_bs_rr_4, 96164426Ssam .bs_rr_8 = NULL, 97164426Ssam 98164426Ssam /* write (single) */ 99164426Ssam .bs_w_1 = generic_bs_w_1, 100164426Ssam .bs_w_2 = generic_armv4_bs_w_2, 101164426Ssam .bs_w_4 = generic_bs_w_4, 102164426Ssam .bs_w_8 = NULL, 103164426Ssam 104164426Ssam /* write multiple */ 105164426Ssam .bs_wm_1 = generic_bs_wm_1, 106164426Ssam .bs_wm_2 = generic_armv4_bs_wm_2, 107164426Ssam .bs_wm_4 = generic_bs_wm_4, 108164426Ssam .bs_wm_8 = NULL, 109164426Ssam 110164426Ssam /* write region */ 111164426Ssam .bs_wr_1 = generic_bs_wr_1, 112164426Ssam .bs_wr_2 = generic_armv4_bs_wr_2, 113164426Ssam .bs_wr_4 = generic_bs_wr_4, 114164426Ssam .bs_wr_8 = NULL, 115164426Ssam 116164426Ssam /* set multiple */ 117164426Ssam /* XXX not implemented */ 118164426Ssam 119164426Ssam /* set region */ 120164426Ssam .bs_sr_1 = NULL, 121164426Ssam .bs_sr_2 = generic_armv4_bs_sr_2, 122164426Ssam .bs_sr_4 = generic_bs_sr_4, 123164426Ssam .bs_sr_8 = NULL, 124164426Ssam 125164426Ssam /* copy */ 126164426Ssam .bs_c_1 = NULL, 127164426Ssam .bs_c_2 = generic_armv4_bs_c_2, 128164426Ssam .bs_c_4 = NULL, 129164426Ssam .bs_c_8 = NULL, 130164426Ssam}; 131