WIP FPC-III support
[linux/fpc-iii.git] / arch / powerpc / platforms / pseries / pseries.h
blob593840847cd3dc83324ee4c157c1afaeff3efe16
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Copyright 2006 IBM Corporation.
4 */
6 #ifndef _PSERIES_PSERIES_H
7 #define _PSERIES_PSERIES_H
9 #include <linux/interrupt.h>
10 #include <asm/rtas.h>
12 struct device_node;
14 extern void request_event_sources_irqs(struct device_node *np,
15 irq_handler_t handler, const char *name);
17 #include <linux/of.h>
19 struct pt_regs;
21 extern int pSeries_system_reset_exception(struct pt_regs *regs);
22 extern int pSeries_machine_check_exception(struct pt_regs *regs);
23 extern long pseries_machine_check_realmode(struct pt_regs *regs);
25 #ifdef CONFIG_SMP
26 extern void smp_init_pseries(void);
28 /* Get state of physical CPU from query_cpu_stopped */
29 int smp_query_cpu_stopped(unsigned int pcpu);
30 #define QCSS_STOPPED 0
31 #define QCSS_STOPPING 1
32 #define QCSS_NOT_STOPPED 2
33 #define QCSS_HARDWARE_ERROR -1
34 #define QCSS_HARDWARE_BUSY -2
35 #else
36 static inline void smp_init_pseries(void) { };
37 #endif
39 extern void pseries_kexec_cpu_down(int crash_shutdown, int secondary);
41 extern void pSeries_final_fixup(void);
43 /* Poweron flag used for enabling auto ups restart */
44 extern unsigned long rtas_poweron_auto;
46 /* Provided by HVC VIO */
47 extern void hvc_vio_init_early(void);
49 /* Dynamic logical Partitioning/Mobility */
50 extern void dlpar_free_cc_nodes(struct device_node *);
51 extern void dlpar_free_cc_property(struct property *);
52 extern struct device_node *dlpar_configure_connector(__be32,
53 struct device_node *);
54 extern int dlpar_attach_node(struct device_node *, struct device_node *);
55 extern int dlpar_detach_node(struct device_node *);
56 extern int dlpar_acquire_drc(u32 drc_index);
57 extern int dlpar_release_drc(u32 drc_index);
59 void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog);
60 int handle_dlpar_errorlog(struct pseries_hp_errorlog *hp_errlog);
62 #ifdef CONFIG_MEMORY_HOTPLUG
63 int dlpar_memory(struct pseries_hp_errorlog *hp_elog);
64 int dlpar_hp_pmem(struct pseries_hp_errorlog *hp_elog);
65 #else
66 static inline int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
68 return -EOPNOTSUPP;
70 static inline int dlpar_hp_pmem(struct pseries_hp_errorlog *hp_elog)
72 return -EOPNOTSUPP;
74 #endif
76 #ifdef CONFIG_HOTPLUG_CPU
77 int dlpar_cpu(struct pseries_hp_errorlog *hp_elog);
78 #else
79 static inline int dlpar_cpu(struct pseries_hp_errorlog *hp_elog)
81 return -EOPNOTSUPP;
83 #endif
85 /* PCI root bridge prepare function override for pseries */
86 struct pci_host_bridge;
87 int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
89 extern struct pci_controller_ops pseries_pci_controller_ops;
91 unsigned long pseries_memory_block_size(void);
93 extern int CMO_PrPSP;
94 extern int CMO_SecPSP;
95 extern unsigned long CMO_PageSize;
97 static inline int cmo_get_primary_psp(void)
99 return CMO_PrPSP;
102 static inline int cmo_get_secondary_psp(void)
104 return CMO_SecPSP;
107 static inline unsigned long cmo_get_page_size(void)
109 return CMO_PageSize;
112 int dlpar_workqueue_init(void);
114 void pseries_setup_security_mitigations(void);
115 void pseries_lpar_read_hblkrm_characteristics(void);
117 #endif /* _PSERIES_PSERIES_H */