xref: /netbsd-src/sys/arch/powerpc/marvell/marvell_intr.h (revision 16031f7d46f56c21335839c17974dddd9f9800b4)
1*16031f7dSrin /*	$NetBSD: marvell_intr.h,v 1.19 2020/07/06 09:34:17 rin Exp $	*/
2ff2281b4Smatt 
3ff2281b4Smatt /*-
4ff2281b4Smatt  * Copyright (c) 1998 The NetBSD Foundation, Inc.
5ff2281b4Smatt  * All rights reserved.
6ff2281b4Smatt  *
7ff2281b4Smatt  * This code is derived from software contributed to The NetBSD Foundation
8ff2281b4Smatt  * by Charles M. Hannum.
9ff2281b4Smatt  *
10ff2281b4Smatt  * Redistribution and use in source and binary forms, with or without
11ff2281b4Smatt  * modification, are permitted provided that the following conditions
12ff2281b4Smatt  * are met:
13ff2281b4Smatt  * 1. Redistributions of source code must retain the above copyright
14ff2281b4Smatt  *    notice, this list of conditions and the following disclaimer.
15ff2281b4Smatt  * 2. Redistributions in binary form must reproduce the above copyright
16ff2281b4Smatt  *    notice, this list of conditions and the following disclaimer in the
17ff2281b4Smatt  *    documentation and/or other materials provided with the distribution.
18ff2281b4Smatt  *
19ff2281b4Smatt  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20ff2281b4Smatt  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21ff2281b4Smatt  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22ff2281b4Smatt  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23ff2281b4Smatt  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24ff2281b4Smatt  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25ff2281b4Smatt  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26ff2281b4Smatt  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27ff2281b4Smatt  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28ff2281b4Smatt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29ff2281b4Smatt  * POSSIBILITY OF SUCH DAMAGE.
30ff2281b4Smatt  */
31ff2281b4Smatt 
32a748aedcSkiyohara #ifndef _POWERPC_MARVELL_INTR_H_
33a748aedcSkiyohara #define _POWERPC_MARVELL_INTR_H_
34ff2281b4Smatt 
35a748aedcSkiyohara #ifndef _LOCORE
36ff2281b4Smatt 
37870f6bfbSmatt #define	__IMASK_T	uint64_t
38ff2281b4Smatt 
39870f6bfbSmatt #if 0
40870f6bfbSmatt #define	PIC_VIRQ_MS_PENDING(p)	(((p) != (uint32_t)(p))			\
41870f6bfbSmatt 				    ? __builtin_clz((uint32_t((p) >> 32)) \
42870f6bfbSmatt 				    : 32 + __builtin_clz((uint32_t)(p)))
43870f6bfbSmatt #endif
44ff2281b4Smatt 
45ba380162Syamt 
46a748aedcSkiyohara #define ICU_LEN		(64 + 32)	/* Main Interrupt(64) + GPIO(32) */
47ff2281b4Smatt 
48a748aedcSkiyohara extern struct pic_ops *discovery_pic;
49a748aedcSkiyohara extern struct pic_ops *discovery_gpp_pic[4];
50a748aedcSkiyohara struct pic_ops *setup_discovery_pic(void);
51a748aedcSkiyohara struct pic_ops *setup_discovery_gpp_pic(void *, int);
52870f6bfbSmatt void genppc_cpu_configure(void);
53ff2281b4Smatt 
54ff2281b4Smatt #endif /* !_LOCORE */
55ff2281b4Smatt 
56870f6bfbSmatt #include <powerpc/intr.h>
57870f6bfbSmatt 
58a748aedcSkiyohara #endif /* _POWERPC_MARVELL_INTR_H_ */
59