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