pseries.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Copyright 2006 IBM Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. */
  9. #ifndef _PSERIES_PSERIES_H
  10. #define _PSERIES_PSERIES_H
  11. #include <linux/interrupt.h>
  12. #include <asm/rtas.h>
  13. struct device_node;
  14. extern void request_event_sources_irqs(struct device_node *np,
  15. irq_handler_t handler, const char *name);
  16. #include <linux/of.h>
  17. struct pt_regs;
  18. extern int pSeries_system_reset_exception(struct pt_regs *regs);
  19. extern int pSeries_machine_check_exception(struct pt_regs *regs);
  20. extern long pseries_machine_check_realmode(struct pt_regs *regs);
  21. #ifdef CONFIG_SMP
  22. extern void smp_init_pseries(void);
  23. /* Get state of physical CPU from query_cpu_stopped */
  24. int smp_query_cpu_stopped(unsigned int pcpu);
  25. #define QCSS_STOPPED 0
  26. #define QCSS_STOPPING 1
  27. #define QCSS_NOT_STOPPED 2
  28. #define QCSS_HARDWARE_ERROR -1
  29. #define QCSS_HARDWARE_BUSY -2
  30. #else
  31. static inline void smp_init_pseries(void) { };
  32. #endif
  33. extern void pseries_kexec_cpu_down(int crash_shutdown, int secondary);
  34. extern void pSeries_final_fixup(void);
  35. /* Poweron flag used for enabling auto ups restart */
  36. extern unsigned long rtas_poweron_auto;
  37. /* Provided by HVC VIO */
  38. extern void hvc_vio_init_early(void);
  39. /* Dynamic logical Partitioning/Mobility */
  40. extern void dlpar_free_cc_nodes(struct device_node *);
  41. extern void dlpar_free_cc_property(struct property *);
  42. extern struct device_node *dlpar_configure_connector(__be32,
  43. struct device_node *);
  44. extern int dlpar_attach_node(struct device_node *, struct device_node *);
  45. extern int dlpar_detach_node(struct device_node *);
  46. extern int dlpar_acquire_drc(u32 drc_index);
  47. extern int dlpar_release_drc(u32 drc_index);
  48. void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog);
  49. int handle_dlpar_errorlog(struct pseries_hp_errorlog *hp_errlog);
  50. #ifdef CONFIG_MEMORY_HOTPLUG
  51. int dlpar_memory(struct pseries_hp_errorlog *hp_elog);
  52. int dlpar_hp_pmem(struct pseries_hp_errorlog *hp_elog);
  53. #else
  54. static inline int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
  55. {
  56. return -EOPNOTSUPP;
  57. }
  58. static inline int dlpar_hp_pmem(struct pseries_hp_errorlog *hp_elog)
  59. {
  60. return -EOPNOTSUPP;
  61. }
  62. #endif
  63. #ifdef CONFIG_HOTPLUG_CPU
  64. int dlpar_cpu(struct pseries_hp_errorlog *hp_elog);
  65. #else
  66. static inline int dlpar_cpu(struct pseries_hp_errorlog *hp_elog)
  67. {
  68. return -EOPNOTSUPP;
  69. }
  70. #endif
  71. /* PCI root bridge prepare function override for pseries */
  72. struct pci_host_bridge;
  73. int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
  74. extern struct pci_controller_ops pseries_pci_controller_ops;
  75. unsigned long pseries_memory_block_size(void);
  76. extern int CMO_PrPSP;
  77. extern int CMO_SecPSP;
  78. extern unsigned long CMO_PageSize;
  79. static inline int cmo_get_primary_psp(void)
  80. {
  81. return CMO_PrPSP;
  82. }
  83. static inline int cmo_get_secondary_psp(void)
  84. {
  85. return CMO_SecPSP;
  86. }
  87. static inline unsigned long cmo_get_page_size(void)
  88. {
  89. return CMO_PageSize;
  90. }
  91. int dlpar_workqueue_init(void);
  92. void pseries_setup_rfi_flush(void);
  93. #endif /* _PSERIES_PSERIES_H */