pseries.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright 2006 IBM Corporation.
  4. */
  5. #ifndef _PSERIES_PSERIES_H
  6. #define _PSERIES_PSERIES_H
  7. #include <linux/interrupt.h>
  8. #include <asm/rtas.h>
  9. struct device_node;
  10. void __init request_event_sources_irqs(struct device_node *np,
  11. irq_handler_t handler, const char *name);
  12. #include <linux/of.h>
  13. struct pt_regs;
  14. extern int pSeries_system_reset_exception(struct pt_regs *regs);
  15. extern int pSeries_machine_check_exception(struct pt_regs *regs);
  16. extern long pseries_machine_check_realmode(struct pt_regs *regs);
  17. void pSeries_machine_check_log_err(void);
  18. #ifdef CONFIG_SMP
  19. extern void smp_init_pseries(void);
  20. /* Get state of physical CPU from query_cpu_stopped */
  21. int smp_query_cpu_stopped(unsigned int pcpu);
  22. #define QCSS_STOPPED 0
  23. #define QCSS_STOPPING 1
  24. #define QCSS_NOT_STOPPED 2
  25. #define QCSS_HARDWARE_ERROR -1
  26. #define QCSS_HARDWARE_BUSY -2
  27. #else
  28. static inline void smp_init_pseries(void) { }
  29. #endif
  30. extern void pseries_kexec_cpu_down(int crash_shutdown, int secondary);
  31. void pseries_machine_kexec(struct kimage *image);
  32. extern void pSeries_final_fixup(void);
  33. /* Poweron flag used for enabling auto ups restart */
  34. extern unsigned long rtas_poweron_auto;
  35. /* Dynamic logical Partitioning/Mobility */
  36. extern void dlpar_free_cc_nodes(struct device_node *);
  37. extern void dlpar_free_cc_property(struct property *);
  38. extern struct device_node *dlpar_configure_connector(__be32,
  39. struct device_node *);
  40. extern int dlpar_attach_node(struct device_node *, struct device_node *);
  41. extern int dlpar_detach_node(struct device_node *);
  42. extern int dlpar_acquire_drc(u32 drc_index);
  43. extern int dlpar_release_drc(u32 drc_index);
  44. extern int dlpar_unisolate_drc(u32 drc_index);
  45. void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog);
  46. int handle_dlpar_errorlog(struct pseries_hp_errorlog *hp_errlog);
  47. #ifdef CONFIG_MEMORY_HOTPLUG
  48. int dlpar_memory(struct pseries_hp_errorlog *hp_elog);
  49. int dlpar_hp_pmem(struct pseries_hp_errorlog *hp_elog);
  50. #else
  51. static inline int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
  52. {
  53. return -EOPNOTSUPP;
  54. }
  55. static inline int dlpar_hp_pmem(struct pseries_hp_errorlog *hp_elog)
  56. {
  57. return -EOPNOTSUPP;
  58. }
  59. #endif
  60. #ifdef CONFIG_HOTPLUG_CPU
  61. int dlpar_cpu(struct pseries_hp_errorlog *hp_elog);
  62. #else
  63. static inline int dlpar_cpu(struct pseries_hp_errorlog *hp_elog)
  64. {
  65. return -EOPNOTSUPP;
  66. }
  67. #endif
  68. /* PCI root bridge prepare function override for pseries */
  69. struct pci_host_bridge;
  70. int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
  71. extern struct pci_controller_ops pseries_pci_controller_ops;
  72. int pseries_msi_allocate_domains(struct pci_controller *phb);
  73. void pseries_msi_free_domains(struct pci_controller *phb);
  74. unsigned long pseries_memory_block_size(void);
  75. extern int CMO_PrPSP;
  76. extern int CMO_SecPSP;
  77. extern unsigned long CMO_PageSize;
  78. static inline int cmo_get_primary_psp(void)
  79. {
  80. return CMO_PrPSP;
  81. }
  82. static inline int cmo_get_secondary_psp(void)
  83. {
  84. return CMO_SecPSP;
  85. }
  86. static inline unsigned long cmo_get_page_size(void)
  87. {
  88. return CMO_PageSize;
  89. }
  90. int dlpar_workqueue_init(void);
  91. extern u32 pseries_security_flavor;
  92. void pseries_setup_security_mitigations(void);
  93. #ifdef CONFIG_PPC_64S_HASH_MMU
  94. void pseries_lpar_read_hblkrm_characteristics(void);
  95. #else
  96. static inline void pseries_lpar_read_hblkrm_characteristics(void) { }
  97. #endif
  98. void pseries_rng_init(void);
  99. #endif /* _PSERIES_PSERIES_H */