xref: /freebsd/sys/powerpc/include/intr_machdep.h (revision 49d9a5978306d6856325808653eec1ceac21263c)
160727d8bSWarner Losh /*-
271e3c308SPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
371e3c308SPedro F. Giffuni  *
4f6a7723dSBenno Rice  * Copyright (C) 2002 Benno Rice.
5f6a7723dSBenno Rice  * All rights reserved.
6f6a7723dSBenno Rice  *
7f6a7723dSBenno Rice  * Redistribution and use in source and binary forms, with or without
8f6a7723dSBenno Rice  * modification, are permitted provided that the following conditions
9f6a7723dSBenno Rice  * are met:
10f6a7723dSBenno Rice  * 1. Redistributions of source code must retain the above copyright
11f6a7723dSBenno Rice  *    notice, this list of conditions and the following disclaimer.
12f6a7723dSBenno Rice  * 2. Redistributions in binary form must reproduce the above copyright
13f6a7723dSBenno Rice  *    notice, this list of conditions and the following disclaimer in the
14f6a7723dSBenno Rice  *    documentation and/or other materials provided with the distribution.
15f6a7723dSBenno Rice  *
16f6a7723dSBenno Rice  * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR
17f6a7723dSBenno Rice  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18f6a7723dSBenno Rice  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19f6a7723dSBenno Rice  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20f6a7723dSBenno Rice  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21f6a7723dSBenno Rice  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22f6a7723dSBenno Rice  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23f6a7723dSBenno Rice  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24f6a7723dSBenno Rice  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25f6a7723dSBenno Rice  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26f6a7723dSBenno Rice  *
27f6a7723dSBenno Rice  * $FreeBSD$
28f6a7723dSBenno Rice  */
29f6a7723dSBenno Rice 
30f6a7723dSBenno Rice #ifndef	_MACHINE_INTR_MACHDEP_H_
31f6a7723dSBenno Rice #define	_MACHINE_INTR_MACHDEP_H_
32f6a7723dSBenno Rice 
3377d40ffdSMarcel Moolenaar #define	INTR_VECTORS	256
346d2d7b8cSMarcel Moolenaar 
3510b980e7SWojciech Macek #define	MAX_PICS		32
36607ebaafSMarcel Moolenaar #define	MAP_IRQ(node, pin)	powerpc_get_irq(node, pin)
37f6a7723dSBenno Rice 
38ca2c1931SNathan Whitehorn /*
39ca2c1931SNathan Whitehorn  * Default base address for MSI messages on PowerPC
40ca2c1931SNathan Whitehorn  */
41ca2c1931SNathan Whitehorn #define	MSI_INTEL_ADDR_BASE		0xfee00000
42ca2c1931SNathan Whitehorn 
43eaef5f0aSNathan Whitehorn extern device_t root_pic;
44f6a7723dSBenno Rice 
4577d40ffdSMarcel Moolenaar struct trapframe;
46f6a7723dSBenno Rice 
4705c62b81SMarcel Moolenaar driver_filter_t powerpc_ipi_handler;
4805c62b81SMarcel Moolenaar 
49707c2fb9SAlexander Motin void	intrcnt_add(const char *name, u_long **countp);
50707c2fb9SAlexander Motin 
51e5497948SNathan Whitehorn u_int	powerpc_register_pic(device_t, uint32_t, u_int, u_int, u_int);
526d2d7b8cSMarcel Moolenaar u_int	powerpc_get_irq(uint32_t, u_int);
534f5d8660SMarcel Moolenaar 
5477d40ffdSMarcel Moolenaar void	powerpc_dispatch_intr(u_int, struct trapframe *);
5577d40ffdSMarcel Moolenaar int	powerpc_enable_intr(void);
56eaef5f0aSNathan Whitehorn int	powerpc_setup_intr(const char *, u_int, driver_filter_t, driver_intr_t,
57*49d9a597SJustin Hibbits 	    void *, enum intr_type, void **, int);
5877d40ffdSMarcel Moolenaar int	powerpc_teardown_intr(void *);
5908393b3eSNathan Whitehorn int	powerpc_bind_intr(u_int irq, u_char cpu);
60d6f59297SMarcel Moolenaar int	powerpc_config_intr(int, enum intr_trigger, enum intr_polarity);
6154423402SNathan Whitehorn int	powerpc_fw_config_intr(int irq, int sense_code);
62f6a7723dSBenno Rice 
630aeed3e9SJustin Hibbits void	powerpc_intr_mask(u_int irq);
640aeed3e9SJustin Hibbits void	powerpc_intr_unmask(u_int irq);
650aeed3e9SJustin Hibbits 
66f6a7723dSBenno Rice #endif /* _MACHINE_INTR_MACHDEP_H_ */
67