xref: /netbsd-src/sys/arch/mips/alchemy/include/auvar.h (revision 97627a755de6688e3779397891de0a51dd226e2f)
1 /* $NetBSD: auvar.h,v 1.12 2015/06/09 22:50:50 matt Exp $ */
2 
3 /*-
4  * Copyright (c) 2006 Itronix Inc.
5  * All rights reserved.
6  *
7  * Written by Garrett D'Amore for Itronix Inc.
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  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. The name of Itronix Inc. may not be used to endorse
18  *    or promote products derived from this software without specific
19  *    prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
25  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28  * ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 /*
35  * Copyright 2002 Wasabi Systems, Inc.
36  * All rights reserved.
37  *
38  * Written by Simon Burge for Wasabi Systems, Inc.
39  *
40  * Redistribution and use in source and binary forms, with or without
41  * modification, are permitted provided that the following conditions
42  * are met:
43  * 1. Redistributions of source code must retain the above copyright
44  *    notice, this list of conditions and the following disclaimer.
45  * 2. Redistributions in binary form must reproduce the above copyright
46  *    notice, this list of conditions and the following disclaimer in the
47  *    documentation and/or other materials provided with the distribution.
48  * 3. All advertising materials mentioning features or use of this software
49  *    must display the following acknowledgement:
50  *      This product includes software developed for the NetBSD Project by
51  *      Wasabi Systems, Inc.
52  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
53  *    or promote products derived from this software without specific prior
54  *    written permission.
55  *
56  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
57  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
58  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
59  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
60  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
61  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
62  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
63  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
64  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
66  * POSSIBILITY OF SUCH DAMAGE.
67  */
68 
69 #ifndef _MIPS_ALCHEMY_AUVAR_H_
70 #define	_MIPS_ALCHEMY_AUVAR_H_
71 
72 #include <mips/cpuregs.h>
73 
74 #include "opt_alchemy.h"
75 
76 struct au_dev {
77 	const char *name;
78 	bus_addr_t addr[3];
79 	int irq[2];
80 };
81 
82 struct au_chipdep {
83 	const char	*name;
84 	bus_addr_t	icus[2];	/* in case it ever changes */
85 	struct au_dev	*devices;
86 	const char	* const *irqnames;
87 };
88 
89 struct au_chipdep	*au_chipdep(void);
90 
91 #ifdef	ALCHEMY_AU1000
92 bool		au1000_match(struct au_chipdep **);
93 #endif
94 #ifdef	ALCHEMY_AU1100
95 bool		au1100_match(struct au_chipdep **);
96 #endif
97 #ifdef	ALCHEMY_AU1500
98 bool		au1500_match(struct au_chipdep **);
99 #endif
100 #ifdef	ALCHEMY_AU1550
101 bool		au1550_match(struct au_chipdep **);
102 #endif
103 
104 void	au_intr_init(void);
105 void	*au_intr_establish(int, int, int, int, int (*)(void *), void *);
106 void	au_intr_disestablish(void *);
107 void	au_intr_enable(int);
108 void	au_intr_disable(int);
109 void	au_iointr(int, vaddr_t, uint32_t);
110 
111 void	au_cpureg_bus_mem_init(bus_space_tag_t, void *);
112 
113 void	au_cal_timers(bus_space_tag_t, bus_space_handle_t);
114 #endif /* _MIPS_ALCHEMY_AUVAR_H_ */
115