Home | History | Annotate | Line # | Download | only in lubbock
sm_obio_space.c revision 1.1
      1  1.1  bsh /*	$NetBSD: sm_obio_space.c,v 1.1 2003/06/18 10:51:15 bsh 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.1  bsh 
     36  1.1  bsh #include <sys/param.h>
     37  1.1  bsh #include <sys/systm.h>
     38  1.1  bsh #include <sys/queue.h>
     39  1.1  bsh 
     40  1.1  bsh #include <uvm/uvm.h>
     41  1.1  bsh 
     42  1.1  bsh #include <machine/bus.h>
     43  1.1  bsh #include <machine/pmap.h>
     44  1.1  bsh 
     45  1.1  bsh /* Proto types for all the bus_space structure functions */
     46  1.1  bsh 
     47  1.1  bsh bs_protos(pxa2x0);
     48  1.1  bsh bs_protos(a4x);
     49  1.1  bsh bs_protos(smobio8);
     50  1.1  bsh bs_protos(bs_notimpl);
     51  1.1  bsh 
     52  1.1  bsh /*
     53  1.1  bsh  * Special bus space functions for on-board SMC91c96 in 8-bit mode
     54  1.1  bsh  */
     55  1.1  bsh struct bus_space smobio8_bs_tag = {
     56  1.1  bsh 	/* cookie */
     57  1.1  bsh 	NULL,
     58  1.1  bsh 
     59  1.1  bsh 	/* mapping/unmapping */
     60  1.1  bsh 	pxa2x0_bs_map,
     61  1.1  bsh 	pxa2x0_bs_unmap,
     62  1.1  bsh 	pxa2x0_bs_subregion,
     63  1.1  bsh 
     64  1.1  bsh 	/* allocation/deallocation */
     65  1.1  bsh 	pxa2x0_bs_alloc,
     66  1.1  bsh 	pxa2x0_bs_free,
     67  1.1  bsh 
     68  1.1  bsh 	/* get kernel virtual address */
     69  1.1  bsh 	pxa2x0_bs_vaddr,
     70  1.1  bsh 
     71  1.1  bsh 	/* mmap bus space for userland */
     72  1.1  bsh 	bs_notimpl_bs_mmap,
     73  1.1  bsh 
     74  1.1  bsh 	/* barrier */
     75  1.1  bsh 	pxa2x0_bs_barrier,
     76  1.1  bsh 
     77  1.1  bsh 	/* read (single) */
     78  1.1  bsh 	a4x_bs_r_1,
     79  1.1  bsh 	smobio8_bs_r_2,
     80  1.1  bsh 	bs_notimpl_bs_r_4,
     81  1.1  bsh 	bs_notimpl_bs_r_8,
     82  1.1  bsh 
     83  1.1  bsh 	/* read multiple */
     84  1.1  bsh 	a4x_bs_rm_1,
     85  1.1  bsh 	smobio8_bs_rm_2,
     86  1.1  bsh 	bs_notimpl_bs_rm_4,
     87  1.1  bsh 	bs_notimpl_bs_rm_8,
     88  1.1  bsh 
     89  1.1  bsh 	/* read region */
     90  1.1  bsh 	bs_notimpl_bs_rr_1,
     91  1.1  bsh 	bs_notimpl_bs_rr_2,
     92  1.1  bsh 	bs_notimpl_bs_rr_4,
     93  1.1  bsh 	bs_notimpl_bs_rr_8,
     94  1.1  bsh 
     95  1.1  bsh 	/* write (single) */
     96  1.1  bsh 	a4x_bs_w_1,
     97  1.1  bsh 	smobio8_bs_w_2,
     98  1.1  bsh 	bs_notimpl_bs_w_4,
     99  1.1  bsh 	bs_notimpl_bs_w_8,
    100  1.1  bsh 
    101  1.1  bsh 	/* write multiple */
    102  1.1  bsh 	a4x_bs_wm_1,
    103  1.1  bsh 	smobio8_bs_wm_2,
    104  1.1  bsh 	bs_notimpl_bs_wm_4,
    105  1.1  bsh 	bs_notimpl_bs_wm_8,
    106  1.1  bsh 
    107  1.1  bsh 	/* write region */
    108  1.1  bsh 	bs_notimpl_bs_wr_1,
    109  1.1  bsh 	bs_notimpl_bs_wr_2,
    110  1.1  bsh 	bs_notimpl_bs_wr_4,
    111  1.1  bsh 	bs_notimpl_bs_wr_8,
    112  1.1  bsh 
    113  1.1  bsh 	/* set multiple */
    114  1.1  bsh 	bs_notimpl_bs_sm_1,
    115  1.1  bsh 	bs_notimpl_bs_sm_2,
    116  1.1  bsh 	bs_notimpl_bs_sm_4,
    117  1.1  bsh 	bs_notimpl_bs_sm_8,
    118  1.1  bsh 
    119  1.1  bsh 	/* set region */
    120  1.1  bsh 	bs_notimpl_bs_sr_1,
    121  1.1  bsh 	bs_notimpl_bs_sr_2,
    122  1.1  bsh 	bs_notimpl_bs_sr_4,
    123  1.1  bsh 	bs_notimpl_bs_sr_8,
    124  1.1  bsh 
    125  1.1  bsh 	/* copy */
    126  1.1  bsh 	bs_notimpl_bs_c_1,
    127  1.1  bsh 	bs_notimpl_bs_c_2,
    128  1.1  bsh 	bs_notimpl_bs_c_4,
    129  1.1  bsh 	bs_notimpl_bs_c_8,
    130  1.1  bsh };
    131  1.1  bsh 
    132  1.1  bsh /* bus space functions */
    133  1.1  bsh 
    134