9f0fd0499d
Whenever an interrupt is received for opal the linux kernel gets a bitfield indicating certain events that have occurred and need handling by the various device drivers. Currently this is handled using a notifier interface where we call every device driver that has registered to receive opal events. This approach has several drawbacks. For example each driver has to do its own checking to see if the event is relevant as well as event masking. There is also no easy method of recording the number of times we receive particular events. This patch solves these issues by exposing opal events via the standard interrupt APIs by adding a new interrupt chip and domain. Drivers can then register for the appropriate events using standard kernel calls such as irq_of_parse_and_map(). Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
45 lines
1006 B
C
45 lines
1006 B
C
#ifndef _POWERNV_H
|
|
#define _POWERNV_H
|
|
|
|
#ifdef CONFIG_SMP
|
|
extern void pnv_smp_init(void);
|
|
#else
|
|
static inline void pnv_smp_init(void) { }
|
|
#endif
|
|
|
|
struct pci_dev;
|
|
|
|
#ifdef CONFIG_PCI
|
|
extern void pnv_pci_init(void);
|
|
extern void pnv_pci_shutdown(void);
|
|
extern int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask);
|
|
extern u64 pnv_pci_dma_get_required_mask(struct pci_dev *pdev);
|
|
#else
|
|
static inline void pnv_pci_init(void) { }
|
|
static inline void pnv_pci_shutdown(void) { }
|
|
|
|
static inline int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask)
|
|
{
|
|
return -ENODEV;
|
|
}
|
|
|
|
static inline u64 pnv_pci_dma_get_required_mask(struct pci_dev *pdev)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
extern struct pci_controller_ops pnv_pci_controller_ops;
|
|
|
|
extern u32 pnv_get_supported_cpuidle_states(void);
|
|
|
|
extern void pnv_lpc_init(void);
|
|
|
|
extern void opal_do_notifier(uint64_t events);
|
|
extern void opal_handle_events(uint64_t events);
|
|
extern void opal_event_shutdown(void);
|
|
|
|
bool cpu_core_split_required(void);
|
|
|
|
#endif /* _POWERNV_H */
|