Home | History | Annotate | Line # | Download | only in xscale
      1  1.4     ryo /*	$NetBSD: ixp425_a4x_space.c,v 1.4 2018/03/16 17:56:32 ryo Exp $	*/
      2  1.1     scw 
      3  1.1     scw /*
      4  1.1     scw  * Copyright 2003 Wasabi Systems, Inc.
      5  1.1     scw  * All rights reserved.
      6  1.1     scw  *
      7  1.1     scw  * Written by Steve C. Woodford for Wasabi Systems, Inc.
      8  1.1     scw  *
      9  1.1     scw  * Redistribution and use in source and binary forms, with or without
     10  1.1     scw  * modification, are permitted provided that the following conditions
     11  1.1     scw  * are met:
     12  1.1     scw  * 1. Redistributions of source code must retain the above copyright
     13  1.1     scw  *    notice, this list of conditions and the following disclaimer.
     14  1.1     scw  * 2. Redistributions in binary form must reproduce the above copyright
     15  1.1     scw  *    notice, this list of conditions and the following disclaimer in the
     16  1.1     scw  *    documentation and/or other materials provided with the distribution.
     17  1.1     scw  * 3. All advertising materials mentioning features or use of this software
     18  1.1     scw  *    must display the following acknowledgement:
     19  1.1     scw  *      This product includes software developed for the NetBSD Project by
     20  1.1     scw  *      Wasabi Systems, Inc.
     21  1.1     scw  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
     22  1.1     scw  *    or promote products derived from this software without specific prior
     23  1.1     scw  *    written permission.
     24  1.1     scw  *
     25  1.1     scw  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
     26  1.1     scw  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     27  1.1     scw  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     28  1.1     scw  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
     29  1.1     scw  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     30  1.1     scw  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     31  1.1     scw  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     32  1.1     scw  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     33  1.1     scw  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     34  1.1     scw  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     35  1.1     scw  * POSSIBILITY OF SUCH DAMAGE.
     36  1.1     scw  */
     37  1.1     scw 
     38  1.1     scw /*
     39  1.1     scw  * Bus space tag for 8/16-bit devices on 32-bit bus.
     40  1.1     scw  * all registers are located at the address of multiple of 4.
     41  1.1     scw  *
     42  1.1     scw  * Based on pxa2x0_a4x_space.c
     43  1.1     scw  */
     44  1.1     scw 
     45  1.1     scw #include <sys/cdefs.h>
     46  1.4     ryo __KERNEL_RCSID(0, "$NetBSD: ixp425_a4x_space.c,v 1.4 2018/03/16 17:56:32 ryo Exp $");
     47  1.1     scw 
     48  1.1     scw #include <sys/param.h>
     49  1.1     scw #include <sys/systm.h>
     50  1.1     scw 
     51  1.1     scw #include <uvm/uvm_extern.h>
     52  1.1     scw 
     53  1.3  dyoung #include <sys/bus.h>
     54  1.1     scw 
     55  1.1     scw /* Prototypes for all the bus_space structure functions */
     56  1.1     scw bs_protos(ixp425);
     57  1.1     scw bs_protos(a4x);
     58  1.1     scw bs_protos(generic);
     59  1.1     scw bs_protos(generic_armv4);
     60  1.1     scw bs_protos(bs_notimpl);
     61  1.1     scw 
     62  1.1     scw struct bus_space ixp425_a4x_bs_tag = {
     63  1.1     scw 	/* cookie */
     64  1.4     ryo 	.bs_cookie = (void *) 0,
     65  1.1     scw 
     66  1.1     scw 	/* mapping/unmapping */
     67  1.4     ryo 	.bs_map = ixp425_bs_map,
     68  1.4     ryo 	.bs_unmap = ixp425_bs_unmap,
     69  1.4     ryo 	.bs_subregion = ixp425_bs_subregion,
     70  1.1     scw 
     71  1.1     scw 	/* allocation/deallocation */
     72  1.4     ryo 	.bs_alloc = ixp425_bs_alloc,	/* not implemented */
     73  1.4     ryo 	.bs_free = ixp425_bs_free,	/* not implemented */
     74  1.1     scw 
     75  1.1     scw 	/* get kernel virtual address */
     76  1.4     ryo 	.bs_vaddr = ixp425_bs_vaddr,
     77  1.1     scw 
     78  1.1     scw 	/* mmap */
     79  1.4     ryo 	.bs_mmap = bs_notimpl_bs_mmap,
     80  1.1     scw 
     81  1.1     scw 	/* barrier */
     82  1.4     ryo 	.bs_barrier = ixp425_bs_barrier,
     83  1.1     scw 
     84  1.1     scw 	/* read (single) */
     85  1.4     ryo 	.bs_r_1 = a4x_bs_r_1,
     86  1.4     ryo 	.bs_r_2 = a4x_bs_r_2,
     87  1.4     ryo 	.bs_r_4 = a4x_bs_r_4,
     88  1.4     ryo 	.bs_r_8 = bs_notimpl_bs_r_8,
     89  1.1     scw 
     90  1.1     scw 	/* read multiple */
     91  1.4     ryo 	.bs_rm_1 = a4x_bs_rm_1,
     92  1.4     ryo 	.bs_rm_2 = a4x_bs_rm_2,
     93  1.4     ryo 	.bs_rm_4 = bs_notimpl_bs_rm_4,
     94  1.4     ryo 	.bs_rm_8 = bs_notimpl_bs_rm_8,
     95  1.1     scw 
     96  1.1     scw 	/* read region */
     97  1.4     ryo 	.bs_rr_1 = bs_notimpl_bs_rr_1,
     98  1.4     ryo 	.bs_rr_2 = bs_notimpl_bs_rr_2,
     99  1.4     ryo 	.bs_rr_4 = bs_notimpl_bs_rr_4,
    100  1.4     ryo 	.bs_rr_8 = bs_notimpl_bs_rr_8,
    101  1.1     scw 
    102  1.1     scw 	/* write (single) */
    103  1.4     ryo 	.bs_w_1 = a4x_bs_w_1,
    104  1.4     ryo 	.bs_w_2 = a4x_bs_w_2,
    105  1.4     ryo 	.bs_w_4 = a4x_bs_w_4,
    106  1.4     ryo 	.bs_w_8 = bs_notimpl_bs_w_8,
    107  1.1     scw 
    108  1.1     scw 	/* write multiple */
    109  1.4     ryo 	.bs_wm_1 = a4x_bs_wm_1,
    110  1.4     ryo 	.bs_wm_2 = a4x_bs_wm_2,
    111  1.4     ryo 	.bs_wm_4 = bs_notimpl_bs_wm_4,
    112  1.4     ryo 	.bs_wm_8 = bs_notimpl_bs_wm_8,
    113  1.1     scw 
    114  1.1     scw 	/* write region */
    115  1.4     ryo 	.bs_wr_1 = bs_notimpl_bs_wr_1,
    116  1.4     ryo 	.bs_wr_2 = bs_notimpl_bs_wr_2,
    117  1.4     ryo 	.bs_wr_4 = bs_notimpl_bs_wr_4,
    118  1.4     ryo 	.bs_wr_8 = bs_notimpl_bs_wr_8,
    119  1.1     scw 
    120  1.1     scw 	/* set multiple */
    121  1.4     ryo 	.bs_sm_1 = bs_notimpl_bs_sm_1,
    122  1.4     ryo 	.bs_sm_2 = bs_notimpl_bs_sm_2,
    123  1.4     ryo 	.bs_sm_4 = bs_notimpl_bs_sm_4,
    124  1.4     ryo 	.bs_sm_8 = bs_notimpl_bs_sm_8,
    125  1.1     scw 
    126  1.1     scw 	/* set region */
    127  1.4     ryo 	.bs_sr_1 = bs_notimpl_bs_sr_1,
    128  1.4     ryo 	.bs_sr_2 = bs_notimpl_bs_sr_2,
    129  1.4     ryo 	.bs_sr_4 = bs_notimpl_bs_sr_4,
    130  1.4     ryo 	.bs_sr_8 = bs_notimpl_bs_sr_8,
    131  1.1     scw 
    132  1.1     scw 	/* copy */
    133  1.4     ryo 	.bs_c_1 = bs_notimpl_bs_c_1,
    134  1.4     ryo 	.bs_c_2 = bs_notimpl_bs_c_2,
    135  1.4     ryo 	.bs_c_4 = bs_notimpl_bs_c_4,
    136  1.4     ryo 	.bs_c_8 = bs_notimpl_bs_c_8,
    137  1.1     scw };
    138