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