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