xref: /openbmc/linux/arch/powerpc/sysdev/mpic.h (revision 38958dd9)
1a7de7c74SMichael Ellerman #ifndef _POWERPC_SYSDEV_MPIC_H
2a7de7c74SMichael Ellerman #define _POWERPC_SYSDEV_MPIC_H
3a7de7c74SMichael Ellerman 
4a7de7c74SMichael Ellerman /*
5a7de7c74SMichael Ellerman  * Copyright 2006-2007, Michael Ellerman, IBM Corporation.
6a7de7c74SMichael Ellerman  *
7a7de7c74SMichael Ellerman  * This program is free software; you can redistribute it and/or
8a7de7c74SMichael Ellerman  * modify it under the terms of the GNU General Public License
9a7de7c74SMichael Ellerman  * as published by the Free Software Foundation; version 2 of the
10a7de7c74SMichael Ellerman  * License.
11a7de7c74SMichael Ellerman  *
12a7de7c74SMichael Ellerman  */
13a7de7c74SMichael Ellerman 
14a7de7c74SMichael Ellerman #ifdef CONFIG_PCI_MSI
15a7de7c74SMichael Ellerman extern void mpic_msi_reserve_hwirq(struct mpic *mpic, irq_hw_number_t hwirq);
16a7de7c74SMichael Ellerman extern int mpic_msi_init_allocator(struct mpic *mpic);
17a7de7c74SMichael Ellerman extern irq_hw_number_t mpic_msi_alloc_hwirqs(struct mpic *mpic, int num);
18a7de7c74SMichael Ellerman extern void mpic_msi_free_hwirqs(struct mpic *mpic, int offset, int num);
1905af7bd2SMichael Ellerman extern int mpic_u3msi_init(struct mpic *mpic);
2038958dd9SOlof Johansson extern int mpic_pasemi_msi_init(struct mpic *mpic);
21a7de7c74SMichael Ellerman #else
22a7de7c74SMichael Ellerman static inline void mpic_msi_reserve_hwirq(struct mpic *mpic,
23a7de7c74SMichael Ellerman 					  irq_hw_number_t hwirq)
24a7de7c74SMichael Ellerman {
25a7de7c74SMichael Ellerman 	return;
26a7de7c74SMichael Ellerman }
2705af7bd2SMichael Ellerman 
2805af7bd2SMichael Ellerman static inline int mpic_u3msi_init(struct mpic *mpic)
2905af7bd2SMichael Ellerman {
3005af7bd2SMichael Ellerman 	return -1;
3105af7bd2SMichael Ellerman }
3238958dd9SOlof Johansson 
3338958dd9SOlof Johansson static inline int mpic_pasemi_msi_init(struct mpic *mpic)
3438958dd9SOlof Johansson {
3538958dd9SOlof Johansson 	return -1;
3638958dd9SOlof Johansson }
37a7de7c74SMichael Ellerman #endif
38a7de7c74SMichael Ellerman 
3905af7bd2SMichael Ellerman extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type);
4038958dd9SOlof Johansson extern void mpic_set_vector(unsigned int virq, unsigned int vector);
4105af7bd2SMichael Ellerman extern void mpic_end_irq(unsigned int irq);
4205af7bd2SMichael Ellerman extern void mpic_mask_irq(unsigned int irq);
4305af7bd2SMichael Ellerman extern void mpic_unmask_irq(unsigned int irq);
4417b5ee04SOlof Johansson extern void mpic_set_affinity(unsigned int irq, cpumask_t cpumask);
4505af7bd2SMichael Ellerman 
46a7de7c74SMichael Ellerman #endif /* _POWERPC_SYSDEV_MPIC_H */
47