1164426Ssam/* $NetBSD: ixp425_a4x_space.c,v 1.2 2005/12/11 12:16:51 christos Exp $ */ 2164426Ssam 3331722Seadler/* 4164426Ssam * Copyright 2003 Wasabi Systems, Inc. 5164426Ssam * All rights reserved. 6164426Ssam * 7164426Ssam * Written by Steve C. Woodford for Wasabi Systems, Inc. 8164426Ssam * 9164426Ssam * Redistribution and use in source and binary forms, with or without 10164426Ssam * modification, are permitted provided that the following conditions 11164426Ssam * are met: 12164426Ssam * 1. Redistributions of source code must retain the above copyright 13164426Ssam * notice, this list of conditions and the following disclaimer. 14164426Ssam * 2. Redistributions in binary form must reproduce the above copyright 15164426Ssam * notice, this list of conditions and the following disclaimer in the 16164426Ssam * documentation and/or other materials provided with the distribution. 17164426Ssam * 3. All advertising materials mentioning features or use of this software 18164426Ssam * must display the following acknowledgement: 19164426Ssam * This product includes software developed for the NetBSD Project by 20164426Ssam * Wasabi Systems, Inc. 21164426Ssam * 4. The name of Wasabi Systems, Inc. may not be used to endorse 22164426Ssam * or promote products derived from this software without specific prior 23164426Ssam * written permission. 24164426Ssam * 25164426Ssam * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND 26164426Ssam * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27164426Ssam * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28164426Ssam * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 29164426Ssam * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30164426Ssam * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31164426Ssam * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32164426Ssam * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33164426Ssam * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34164426Ssam * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35164426Ssam * POSSIBILITY OF SUCH DAMAGE. 36164426Ssam */ 37164426Ssam 38164426Ssam/* 39164426Ssam * Bus space tag for 8/16-bit devices on 32-bit bus. 40164426Ssam * all registers are located at the address of multiple of 4. 41164426Ssam * 42164426Ssam * Based on pxa2x0_a4x_space.c 43164426Ssam */ 44164426Ssam 45164426Ssam#include <sys/cdefs.h> 46164426Ssam__FBSDID("$FreeBSD$"); 47164426Ssam 48164426Ssam#include <sys/param.h> 49164426Ssam#include <sys/systm.h> 50164426Ssam#include <sys/bus.h> 51164426Ssam 52164426Ssam#include <machine/pcb.h> 53164426Ssam 54164426Ssam#include <vm/vm.h> 55164426Ssam#include <vm/vm_kern.h> 56164426Ssam#include <vm/pmap.h> 57164426Ssam#include <vm/vm_page.h> 58164426Ssam#include <vm/vm_extern.h> 59164426Ssam 60164426Ssam#include <machine/bus.h> 61164426Ssam 62164426Ssam/* Prototypes for all the bus_space structure functions */ 63164426Ssambs_protos(a4x); 64164426Ssambs_protos(generic); 65164426Ssam 66164426Ssamstruct bus_space ixp425_a4x_bs_tag = { 67164426Ssam /* cookie */ 68277460Sian .bs_privdata = (void *) 0, 69164426Ssam 70164426Ssam /* mapping/unmapping */ 71177887Sraj .bs_map = generic_bs_map, 72177887Sraj .bs_unmap = generic_bs_unmap, 73177887Sraj .bs_subregion = generic_bs_subregion, 74164426Ssam 75164426Ssam /* allocation/deallocation */ 76177887Sraj .bs_alloc = generic_bs_alloc, /* XXX not implemented */ 77177887Sraj .bs_free = generic_bs_free, /* XXX not implemented */ 78164426Ssam 79164426Ssam /* barrier */ 80177887Sraj .bs_barrier = generic_bs_barrier, 81164426Ssam 82164426Ssam /* read (single) */ 83164426Ssam .bs_r_1 = a4x_bs_r_1, 84164426Ssam .bs_r_2 = a4x_bs_r_2, 85164426Ssam .bs_r_4 = a4x_bs_r_4, 86164426Ssam 87164426Ssam /* read multiple */ 88164426Ssam .bs_rm_1 = a4x_bs_rm_1, 89164426Ssam .bs_rm_2 = a4x_bs_rm_2, 90164426Ssam 91164426Ssam /* read region */ 92164426Ssam /* XXX not implemented */ 93164426Ssam 94164426Ssam /* write (single) */ 95164426Ssam .bs_w_1 = a4x_bs_w_1, 96164426Ssam .bs_w_2 = a4x_bs_w_2, 97164426Ssam .bs_w_4 = a4x_bs_w_4, 98164426Ssam 99164426Ssam /* write multiple */ 100164426Ssam .bs_wm_1 = a4x_bs_wm_1, 101164426Ssam .bs_wm_2 = a4x_bs_wm_2, 102164426Ssam 103164426Ssam /* write region */ 104164426Ssam /* XXX not implemented */ 105164426Ssam 106164426Ssam /* set multiple */ 107164426Ssam /* XXX not implemented */ 108164426Ssam 109164426Ssam /* set region */ 110164426Ssam /* XXX not implemented */ 111164426Ssam 112164426Ssam /* copy */ 113164426Ssam /* XXX not implemented */ 114164426Ssam}; 115