Michael Ellerman | 577830b | 2007-02-08 18:33:51 +1100 | [diff] [blame] | 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 | |
| 10 | #ifndef _PSERIES_PSERIES_H |
| 11 | #define _PSERIES_PSERIES_H |
| 12 | |
Mark Nelson | 32c96f7 | 2010-05-18 22:51:00 +0000 | [diff] [blame] | 13 | #include <linux/interrupt.h> |
Nathan Fontenot | 999e2da | 2015-02-10 13:47:02 -0600 | [diff] [blame] | 14 | #include <asm/rtas.h> |
Mark Nelson | 32c96f7 | 2010-05-18 22:51:00 +0000 | [diff] [blame] | 15 | |
| 16 | struct device_node; |
| 17 | |
| 18 | extern void request_event_sources_irqs(struct device_node *np, |
| 19 | irq_handler_t handler, const char *name); |
| 20 | |
Nathan Fontenot | 2064897 | 2010-09-10 09:40:32 +0000 | [diff] [blame] | 21 | #include <linux/of.h> |
| 22 | |
Michael Ellerman | 577830b | 2007-02-08 18:33:51 +1100 | [diff] [blame] | 23 | struct pt_regs; |
| 24 | |
| 25 | extern int pSeries_system_reset_exception(struct pt_regs *regs); |
| 26 | extern int pSeries_machine_check_exception(struct pt_regs *regs); |
| 27 | |
Michael Ellerman | 8feaeca | 2007-02-08 18:33:55 +1100 | [diff] [blame] | 28 | #ifdef CONFIG_SMP |
Rashmica Gupta | 86425be | 2016-05-30 16:18:12 +1000 | [diff] [blame] | 29 | extern void smp_init_pseries(void); |
Michael Ellerman | 8feaeca | 2007-02-08 18:33:55 +1100 | [diff] [blame] | 30 | #else |
Rashmica Gupta | 86425be | 2016-05-30 16:18:12 +1000 | [diff] [blame] | 31 | static inline void smp_init_pseries(void) { }; |
Michael Ellerman | 8feaeca | 2007-02-08 18:33:55 +1100 | [diff] [blame] | 32 | #endif |
| 33 | |
Rashmica Gupta | d739d2c | 2016-05-30 16:18:13 +1000 | [diff] [blame] | 34 | extern void pseries_kexec_cpu_down(int crash_shutdown, int secondary); |
Michael Ellerman | dce623e | 2007-02-08 18:33:55 +1100 | [diff] [blame] | 35 | |
Benjamin Herrenschmidt | 3d5134e | 2007-06-04 15:15:36 +1000 | [diff] [blame] | 36 | extern void pSeries_final_fixup(void); |
| 37 | |
Manish Ahuja | 5d30bf3 | 2007-02-08 16:01:17 -0600 | [diff] [blame] | 38 | /* Poweron flag used for enabling auto ups restart */ |
| 39 | extern unsigned long rtas_poweron_auto; |
| 40 | |
Benjamin Herrenschmidt | 4d2bb3f | 2011-05-12 13:46:38 +1000 | [diff] [blame] | 41 | /* Provided by HVC VIO */ |
| 42 | extern void hvc_vio_init_early(void); |
Michael Ellerman | 21cf913 | 2008-04-16 13:51:48 +1000 | [diff] [blame] | 43 | |
Nathan Fontenot | 2064897 | 2010-09-10 09:40:32 +0000 | [diff] [blame] | 44 | /* Dynamic logical Partitioning/Mobility */ |
| 45 | extern void dlpar_free_cc_nodes(struct device_node *); |
| 46 | extern void dlpar_free_cc_property(struct property *); |
Bharata B Rao | d6f1e7a | 2014-09-16 15:15:45 -0500 | [diff] [blame] | 47 | extern struct device_node *dlpar_configure_connector(__be32, |
| 48 | struct device_node *); |
Rob Herring | 215ee76 | 2017-08-21 10:16:49 -0500 | [diff] [blame] | 49 | extern int dlpar_attach_node(struct device_node *, struct device_node *); |
Nathan Fontenot | 2064897 | 2010-09-10 09:40:32 +0000 | [diff] [blame] | 50 | extern int dlpar_detach_node(struct device_node *); |
Nathan Fontenot | 5e51d3c | 2015-02-10 13:45:01 -0600 | [diff] [blame] | 51 | extern int dlpar_acquire_drc(u32 drc_index); |
| 52 | extern int dlpar_release_drc(u32 drc_index); |
Nathan Fontenot | 2064897 | 2010-09-10 09:40:32 +0000 | [diff] [blame] | 53 | |
John Allen | b7d9eb3 | 2016-07-07 10:03:44 -0500 | [diff] [blame] | 54 | void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog, |
| 55 | struct completion *hotplug_done, int *rc); |
Nathan Fontenot | 999e2da | 2015-02-10 13:47:02 -0600 | [diff] [blame] | 56 | #ifdef CONFIG_MEMORY_HOTPLUG |
| 57 | int dlpar_memory(struct pseries_hp_errorlog *hp_elog); |
| 58 | #else |
| 59 | static inline int dlpar_memory(struct pseries_hp_errorlog *hp_elog) |
| 60 | { |
| 61 | return -EOPNOTSUPP; |
| 62 | } |
| 63 | #endif |
Michael Ellerman | 577830b | 2007-02-08 18:33:51 +1100 | [diff] [blame] | 64 | |
Nathan Fontenot | ac71380 | 2015-12-16 14:54:05 -0600 | [diff] [blame] | 65 | #ifdef CONFIG_HOTPLUG_CPU |
| 66 | int dlpar_cpu(struct pseries_hp_errorlog *hp_elog); |
| 67 | #else |
| 68 | static inline int dlpar_cpu(struct pseries_hp_errorlog *hp_elog) |
| 69 | { |
| 70 | return -EOPNOTSUPP; |
| 71 | } |
| 72 | #endif |
| 73 | |
Kleber Sacilotto de Souza | d82fb31 | 2013-05-03 12:43:12 +0000 | [diff] [blame] | 74 | /* PCI root bridge prepare function override for pseries */ |
| 75 | struct pci_host_bridge; |
| 76 | int pseries_root_bridge_prepare(struct pci_host_bridge *bridge); |
| 77 | |
Daniel Axtens | 38ae9ec | 2015-03-31 16:00:50 +1100 | [diff] [blame] | 78 | extern struct pci_controller_ops pseries_pci_controller_ops; |
| 79 | |
Anton Blanchard | a5d8625 | 2014-06-04 17:50:47 +1000 | [diff] [blame] | 80 | unsigned long pseries_memory_block_size(void); |
| 81 | |
Michael Ellerman | 8f272a5 | 2016-11-14 16:28:10 +1100 | [diff] [blame] | 82 | extern int CMO_PrPSP; |
| 83 | extern int CMO_SecPSP; |
| 84 | extern unsigned long CMO_PageSize; |
| 85 | |
| 86 | static inline int cmo_get_primary_psp(void) |
| 87 | { |
| 88 | return CMO_PrPSP; |
| 89 | } |
| 90 | |
| 91 | static inline int cmo_get_secondary_psp(void) |
| 92 | { |
| 93 | return CMO_SecPSP; |
| 94 | } |
| 95 | |
| 96 | static inline unsigned long cmo_get_page_size(void) |
| 97 | { |
| 98 | return CMO_PageSize; |
| 99 | } |
| 100 | |
Michael Ellerman | 577830b | 2007-02-08 18:33:51 +1100 | [diff] [blame] | 101 | #endif /* _PSERIES_PSERIES_H */ |