1244197Sgonzo/*- 2244197Sgonzo * Copyright (c) 2009, Oleksandr Tymoshenko <gonzo@FreeBSD.org> 3244197Sgonzo * All rights reserved. 4244197Sgonzo * 5244197Sgonzo * Redistribution and use in source and binary forms, with or without 6244197Sgonzo * modification, are permitted provided that the following conditions 7244197Sgonzo * are met: 8244197Sgonzo * 1. Redistributions of source code must retain the above copyright 9244197Sgonzo * notice unmodified, this list of conditions, and the following 10244197Sgonzo * disclaimer. 11244197Sgonzo * 2. Redistributions in binary form must reproduce the above copyright 12244197Sgonzo * notice, this list of conditions and the following disclaimer in the 13244197Sgonzo * documentation and/or other materials provided with the distribution. 14244197Sgonzo * 15244197Sgonzo * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16244197Sgonzo * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17244197Sgonzo * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18244197Sgonzo * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19244197Sgonzo * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20244197Sgonzo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21244197Sgonzo * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22244197Sgonzo * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23244197Sgonzo * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24244197Sgonzo * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25244197Sgonzo * SUCH DAMAGE. 26244197Sgonzo */ 27244197Sgonzo#include <sys/cdefs.h> 28244197Sgonzo__FBSDID("$FreeBSD$"); 29244197Sgonzo 30244197Sgonzo#include <sys/param.h> 31244197Sgonzo#include <sys/systm.h> 32244197Sgonzo#include <sys/bus.h> 33244197Sgonzo#include <sys/endian.h> 34244197Sgonzo 35244197Sgonzo#include <machine/bus.h> 36244197Sgonzo#include <arm/versatile/versatile_pci_bus_space.h> 37244197Sgonzo 38244197Sgonzo/* Prototypes for all the bus_space structure functions */ 39244197Sgonzobs_protos(generic); 40244197Sgonzobs_protos(generic_armv4); 41244197Sgonzo 42244197Sgonzo/* 43244197Sgonzo * Bus space that handles offsets in word for 1/2 bytes read/write access. 44244197Sgonzo * Byte order of values is handled by device drivers itself. 45244197Sgonzo */ 46244197Sgonzostatic struct bus_space bus_space_pcimem = { 47244197Sgonzo /* cookie */ 48244197Sgonzo (void *) 0, 49244197Sgonzo 50244197Sgonzo /* mapping/unmapping */ 51244197Sgonzo generic_bs_map, 52244197Sgonzo generic_bs_unmap, 53244197Sgonzo generic_bs_subregion, 54244197Sgonzo 55244197Sgonzo /* allocation/deallocation */ 56244197Sgonzo NULL, 57244197Sgonzo NULL, 58244197Sgonzo 59244197Sgonzo /* barrier */ 60244197Sgonzo generic_bs_barrier, 61244197Sgonzo 62244197Sgonzo /* read (single) */ 63244197Sgonzo generic_bs_r_1, 64244197Sgonzo generic_armv4_bs_r_2, 65244197Sgonzo generic_bs_r_4, 66244197Sgonzo NULL, 67244197Sgonzo 68244197Sgonzo /* read multiple */ 69244197Sgonzo generic_bs_rm_1, 70244197Sgonzo generic_armv4_bs_rm_2, 71244197Sgonzo generic_bs_rm_4, 72244197Sgonzo NULL, 73244197Sgonzo 74244197Sgonzo /* read region */ 75244197Sgonzo generic_bs_rr_1, 76244197Sgonzo generic_armv4_bs_rr_2, 77244197Sgonzo generic_bs_rr_4, 78244197Sgonzo NULL, 79244197Sgonzo 80244197Sgonzo /* write (single) */ 81244197Sgonzo generic_bs_w_1, 82244197Sgonzo generic_armv4_bs_w_2, 83244197Sgonzo generic_bs_w_4, 84244197Sgonzo NULL, 85244197Sgonzo 86244197Sgonzo /* write multiple */ 87244197Sgonzo generic_bs_wm_1, 88244197Sgonzo generic_armv4_bs_wm_2, 89244197Sgonzo generic_bs_wm_4, 90244197Sgonzo NULL, 91244197Sgonzo 92244197Sgonzo /* write region */ 93244197Sgonzo generic_bs_wr_1, 94244197Sgonzo generic_armv4_bs_wr_2, 95244197Sgonzo generic_bs_wr_4, 96244197Sgonzo NULL, 97244197Sgonzo 98244197Sgonzo /* set multiple */ 99244197Sgonzo NULL, 100244197Sgonzo NULL, 101244197Sgonzo NULL, 102244197Sgonzo NULL, 103244197Sgonzo 104244197Sgonzo /* set region */ 105244197Sgonzo NULL, 106244197Sgonzo NULL, 107244197Sgonzo generic_bs_sr_4, 108244197Sgonzo NULL, 109244197Sgonzo 110244197Sgonzo /* copy */ 111244197Sgonzo NULL, 112244197Sgonzo NULL, 113244197Sgonzo NULL, 114244197Sgonzo NULL, 115244197Sgonzo 116244197Sgonzo /* read (single) stream */ 117244197Sgonzo NULL, 118244197Sgonzo NULL, 119244197Sgonzo NULL, 120244197Sgonzo NULL, 121244197Sgonzo 122244197Sgonzo /* read multiple stream */ 123244197Sgonzo NULL, 124244197Sgonzo NULL, 125244197Sgonzo NULL, 126244197Sgonzo NULL, 127244197Sgonzo 128244197Sgonzo /* read region stream */ 129244197Sgonzo NULL, 130244197Sgonzo NULL, 131244197Sgonzo NULL, 132244197Sgonzo NULL, 133244197Sgonzo 134244197Sgonzo /* write (single) stream */ 135244197Sgonzo NULL, 136244197Sgonzo NULL, 137244197Sgonzo NULL, 138244197Sgonzo NULL, 139244197Sgonzo 140244197Sgonzo /* write multiple stream */ 141244197Sgonzo NULL, 142244197Sgonzo NULL, 143244197Sgonzo NULL, 144244197Sgonzo NULL, 145244197Sgonzo 146244197Sgonzo /* write region stream */ 147244197Sgonzo NULL, 148244197Sgonzo NULL, 149244197Sgonzo NULL, 150244197Sgonzo NULL, 151244197Sgonzo}; 152244197Sgonzo 153244197Sgonzobus_space_tag_t versatile_bus_space_pcimem = &bus_space_pcimem; 154