pseries.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. #ifdef CONFIG_SMP
  21. extern void smp_init_pseries(void);
  22. /* Get state of physical CPU from query_cpu_stopped */
  23. int smp_query_cpu_stopped(unsigned int pcpu);
  24. #define QCSS_STOPPED 0
  25. #define QCSS_STOPPING 1
  26. #define QCSS_NOT_STOPPED 2
  27. #define QCSS_HARDWARE_ERROR -1
  28. #define QCSS_HARDWARE_BUSY -2
  29. #else
  30. static inline void smp_init_pseries(void) { };
  31. #endif
  32. extern void pseries_kexec_cpu_down(int crash_shutdown, int secondary);
  33. extern void pSeries_final_fixup(void);
  34. /* Poweron flag used for enabling auto ups restart */
  35. extern unsigned long rtas_poweron_auto;
  36. /* Provided by HVC VIO */
  37. extern void hvc_vio_init_early(void);
  38. /* Dynamic logical Partitioning/Mobility */
  39. extern void dlpar_free_cc_nodes(struct device_node *);
  40. extern void dlpar_free_cc_property(struct property *);
  41. extern struct device_node *dlpar_configure_connector(__be32,
  42. struct device_node *);
  43. extern int dlpar_attach_node(struct device_node *, struct device_node *);
  44. extern int dlpar_detach_node(struct device_node *);
  45. extern int dlpar_acquire_drc(u32 drc_index);
  46. extern int dlpar_release_drc(u32 drc_index);
  47. void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog,
  48. struct completion *hotplug_done, int *rc);
  49. #ifdef CONFIG_MEMORY_HOTPLUG
  50. int dlpar_memory(struct pseries_hp_errorlog *hp_elog);
  51. #else
  52. static inline int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
  53. {
  54. return -EOPNOTSUPP;
  55. }
  56. #endif
  57. #ifdef CONFIG_HOTPLUG_CPU
  58. int dlpar_cpu(struct pseries_hp_errorlog *hp_elog);
  59. #else
  60. static inline int dlpar_cpu(struct pseries_hp_errorlog *hp_elog)
  61. {
  62. return -EOPNOTSUPP;
  63. }
  64. #endif
  65. /* PCI root bridge prepare function override for pseries */
  66. struct pci_host_bridge;
  67. int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
  68. extern struct pci_controller_ops pseries_pci_controller_ops;
  69. unsigned long pseries_memory_block_size(void);
  70. extern int CMO_PrPSP;
  71. extern int CMO_SecPSP;
  72. extern unsigned long CMO_PageSize;
  73. static inline int cmo_get_primary_psp(void)
  74. {
  75. return CMO_PrPSP;
  76. }
  77. static inline int cmo_get_secondary_psp(void)
  78. {
  79. return CMO_SecPSP;
  80. }
  81. static inline unsigned long cmo_get_page_size(void)
  82. {
  83. return CMO_PageSize;
  84. }
  85. int dlpar_workqueue_init(void);
  86. void pseries_setup_rfi_flush(void);
  87. #endif /* _PSERIES_PSERIES_H */