Home | History | Annotate | Line # | Download | only in virtex
      1  1.4    andvar /* 	$NetBSD: dcr.c,v 1.4 2025/02/27 08:39:54 andvar Exp $ */
      2  1.1     freza 
      3  1.1     freza /*
      4  1.1     freza  * Copyright (c) 2006 Jachym Holecek
      5  1.1     freza  * All rights reserved.
      6  1.1     freza  *
      7  1.1     freza  * Written for DFC Design, s.r.o.
      8  1.1     freza  *
      9  1.1     freza  * Redistribution and use in source and binary forms, with or without
     10  1.1     freza  * modification, are permitted provided that the following conditions
     11  1.1     freza  * are met:
     12  1.1     freza  *
     13  1.1     freza  * 1. Redistributions of source code must retain the above copyright
     14  1.1     freza  *    notice, this list of conditions and the following disclaimer.
     15  1.1     freza  *
     16  1.1     freza  * 2. Redistributions in binary form must reproduce the above copyright
     17  1.1     freza  *    notice, this list of conditions and the following disclaimer in the
     18  1.1     freza  *    documentation and/or other materials provided with the distribution.
     19  1.1     freza  *
     20  1.1     freza  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21  1.1     freza  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22  1.1     freza  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23  1.1     freza  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24  1.1     freza  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25  1.1     freza  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26  1.1     freza  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27  1.1     freza  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28  1.1     freza  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29  1.1     freza  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30  1.1     freza  */
     31  1.1     freza 
     32  1.1     freza /*
     33  1.1     freza  * DCR bus space size & base addresses are hardcoded and runtime-checked,
     34  1.4    andvar  * so there's no point in maintaining extents etc -- just provide placebo
     35  1.1     freza  * implementations so that we can use bus_space as usual (add more as
     36  1.1     freza  * needed).
     37  1.1     freza  */
     38  1.1     freza 
     39  1.1     freza #include <sys/cdefs.h>
     40  1.4    andvar __KERNEL_RCSID(0, "$NetBSD: dcr.c,v 1.4 2025/02/27 08:39:54 andvar Exp $");
     41  1.1     freza 
     42  1.1     freza #include <sys/types.h>
     43  1.2    dyoung #include <sys/bus.h>
     44  1.1     freza #include <evbppc/virtex/dcr.h>
     45  1.1     freza 
     46  1.1     freza int
     47  1.1     freza dcr_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size, int flags,
     48  1.1     freza     bus_space_handle_t *bsh)
     49  1.1     freza {
     50  1.1     freza 	*bsh = addr;
     51  1.1     freza 
     52  1.1     freza 	return (0);
     53  1.1     freza }
     54  1.1     freza 
     55  1.1     freza void
     56  1.1     freza dcr_unmap(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t size)
     57  1.1     freza {
     58  1.1     freza 	/* Nothing to do. */
     59  1.1     freza }
     60  1.1     freza 
     61  1.1     freza int
     62  1.1     freza dcr_subregion(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t offset,
     63  1.1     freza     bus_size_t size, bus_space_handle_t *bshp)
     64  1.1     freza {
     65  1.1     freza 	*bshp = bsh + offset;
     66  1.1     freza 
     67  1.1     freza 	return (0);
     68  1.1     freza }
     69  1.3  riastrad 
     70  1.3  riastrad void
     71  1.3  riastrad dcr_barrier(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t offset,
     72  1.3  riastrad     bus_size_t size, int flags)
     73  1.3  riastrad {
     74  1.3  riastrad 	/* XXX EIEIO? */
     75  1.3  riastrad }
     76