1 /* $NetBSD: podulebus_machdep.h,v 1.1 2002/03/24 15:47:08 bjh21 Exp $ */
4 * Copyright (c) 1995 Mark Brinicombe.
5 * Copyright (c) 1995 Brini.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Brini.
19 * 4. The name of the company nor the name of the author may be used to
20 * endorse or promote products derived from this software without specific
21 * prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
24 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * RiscBSD kernel project
39 * Podule bus header file
44 #include <sys/param.h>
45 #include <machine/bus.h>
47 struct podulebus_chunk
{
54 typedef int podulebus_intr_handle_t
;
56 struct podulebus_attach_args
{
57 /* bus_space references for the (many) podule spaces */
58 bus_space_tag_t pa_easi_t
;
59 bus_space_handle_t pa_easi_h
;
60 bus_space_tag_t pa_mod_t
;
61 bus_space_handle_t pa_mod_h
;
62 bus_space_tag_t pa_fast_t
;
63 bus_space_handle_t pa_fast_h
;
64 bus_space_tag_t pa_medium_t
;
65 bus_space_handle_t pa_medium_h
;
66 bus_space_tag_t pa_slow_t
;
67 bus_space_handle_t pa_slow_h
;
68 bus_space_tag_t pa_sync_t
;
69 bus_space_handle_t pa_sync_h
;
71 /* Same things as raw addresses (arm32 compat) */
72 bus_addr_t pa_easi_base
;
73 bus_addr_t pa_mod_base
;
74 bus_addr_t pa_fast_base
;
75 bus_addr_t pa_medium_base
;
76 bus_addr_t pa_slow_base
;
77 bus_addr_t pa_sync_base
;
79 podulebus_intr_handle_t pa_ih
;
86 struct podulebus_chunk
*pa_chunks
;
91 #define PA_SLOT_EASI 0x01 /* EASI space available */
94 #define IS_PODULE(pa, man, prod) \
95 ((pa)->pa_manufacturer == (man) && (pa)->pa_product == (prod))
97 /* Set the address-bus shift for a bus_space tag. */
99 #define podulebus_shift_tag(tag, shift, tagp) bus_space_shift(tag, shift, tagp)
105 extern void *podulebus_irq_establish(podulebus_intr_handle_t
, int,
106 int (*)(void *), void *, struct evcnt
*);
110 /* arm32 compatibility */
112 #define WriteByte(a, v) bus_space_write_1(2, (a), 0, (v))
113 #define WriteShort(a, v) bus_space_write_2(2, (a), 0, (v))
114 #define ReadByte(a) bus_space_read_1(2, (a), 0)
115 #define ReadShort(a) bus_space_read_2(2, (a), 0)
117 /* XXX The arm32 version ignores "slot" too. */
118 #define matchpodule(pa, man, prod, slot) IS_PODULE(pa, man, prod)
120 /* end arm32 compatibility */
122 /* End of podulebus.h */