1 /* $NetBSD: pxa2x0_a4x_space.c,v 1.1 2002/10/19 19:31:39 bsh Exp $ */ 2 3 /* 4 * Copyright (c) 2002 Genetec Corporation. All rights reserved. 5 * Written by Hiroyuki Bessho for Genetec Corporation. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. All advertising materials mentioning features or use of this software 16 * must display the following acknowledgement: 17 * This product includes software developed for the NetBSD Project by 18 * Genetec Corporation. 19 * 4. The name of Genetec Corporation may not be used to endorse or 20 * promote products derived from this software without specific prior 21 * written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND 24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 25 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 26 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION 27 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 * POSSIBILITY OF SUCH DAMAGE. 34 */ 35 36 /* 37 * Bus space tag for 8/16-bit devices on 32-bit bus. 38 * all registers are located at the address of multiple of 4. 39 */ 40 41 #include <sys/param.h> 42 #include <sys/systm.h> 43 44 #include <uvm/uvm_extern.h> 45 46 #include <machine/bus.h> 47 48 /* Prototypes for all the bus_space structure functions */ 49 bs_protos(pxa2x0); 50 bs_protos(a4x); 51 bs_protos(generic); 52 bs_protos(generic_armv4); 53 bs_protos(bs_notimpl); 54 55 struct bus_space pxa2x0_a4x_bs_tag = { 56 /* cookie */ 57 (void *) 0, 58 59 /* mapping/unmapping */ 60 pxa2x0_bs_map, 61 pxa2x0_bs_unmap, 62 pxa2x0_bs_subregion, 63 64 /* allocation/deallocation */ 65 pxa2x0_bs_alloc, /* not implemented */ 66 pxa2x0_bs_free, /* not implemented */ 67 68 /* get kernel virtual address */ 69 pxa2x0_bs_vaddr, 70 71 /* mmap */ 72 bs_notimpl_bs_mmap, 73 74 /* barrier */ 75 pxa2x0_bs_barrier, 76 77 /* read (single) */ 78 a4x_bs_r_1, 79 a4x_bs_r_2, 80 a4x_bs_r_4, 81 bs_notimpl_bs_r_8, 82 83 /* read multiple */ 84 a4x_bs_rm_1, 85 a4x_bs_rm_2, 86 bs_notimpl_bs_rm_4, 87 bs_notimpl_bs_rm_8, 88 89 /* read region */ 90 bs_notimpl_bs_rr_1, 91 bs_notimpl_bs_rr_2, 92 bs_notimpl_bs_rr_4, 93 bs_notimpl_bs_rr_8, 94 95 /* write (single) */ 96 a4x_bs_w_1, 97 a4x_bs_w_2, 98 a4x_bs_w_4, 99 bs_notimpl_bs_w_8, 100 101 /* write multiple */ 102 a4x_bs_wm_1, 103 a4x_bs_wm_2, 104 bs_notimpl_bs_wm_4, 105 bs_notimpl_bs_wm_8, 106 107 /* write region */ 108 bs_notimpl_bs_wr_1, 109 bs_notimpl_bs_wr_2, 110 bs_notimpl_bs_wr_4, 111 bs_notimpl_bs_wr_8, 112 113 /* set multiple */ 114 bs_notimpl_bs_sm_1, 115 bs_notimpl_bs_sm_2, 116 bs_notimpl_bs_sm_4, 117 bs_notimpl_bs_sm_8, 118 119 /* set region */ 120 bs_notimpl_bs_sr_1, 121 bs_notimpl_bs_sr_2, 122 bs_notimpl_bs_sr_4, 123 bs_notimpl_bs_sr_8, 124 125 /* copy */ 126 bs_notimpl_bs_c_1, 127 bs_notimpl_bs_c_2, 128 bs_notimpl_bs_c_4, 129 bs_notimpl_bs_c_8, 130 }; 131 132 133 134