blob: 4470a3194311e06e040c624b8b1491eb0e071298 [file] [log] [blame]
Michael Ellerman577830b2007-02-08 18:33:51 +11001/*
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 Nelson32c96f72010-05-18 22:51:00 +000013#include <linux/interrupt.h>
Nathan Fontenot999e2da2015-02-10 13:47:02 -060014#include <asm/rtas.h>
Mark Nelson32c96f72010-05-18 22:51:00 +000015
16struct device_node;
17
18extern void request_event_sources_irqs(struct device_node *np,
19 irq_handler_t handler, const char *name);
20
Nathan Fontenot20648972010-09-10 09:40:32 +000021#include <linux/of.h>
22
Michael Ellerman577830b2007-02-08 18:33:51 +110023struct pt_regs;
24
25extern int pSeries_system_reset_exception(struct pt_regs *regs);
26extern int pSeries_machine_check_exception(struct pt_regs *regs);
27
Michael Ellerman8feaeca2007-02-08 18:33:55 +110028#ifdef CONFIG_SMP
Rashmica Gupta86425be2016-05-30 16:18:12 +100029extern void smp_init_pseries(void);
Michael Ellerman8feaeca2007-02-08 18:33:55 +110030#else
Rashmica Gupta86425be2016-05-30 16:18:12 +100031static inline void smp_init_pseries(void) { };
Michael Ellerman8feaeca2007-02-08 18:33:55 +110032#endif
33
Rashmica Guptad739d2c2016-05-30 16:18:13 +100034extern void pseries_kexec_cpu_down(int crash_shutdown, int secondary);
Michael Ellermandce623e2007-02-08 18:33:55 +110035
Benjamin Herrenschmidt3d5134e2007-06-04 15:15:36 +100036extern void pSeries_final_fixup(void);
37
Manish Ahuja5d30bf32007-02-08 16:01:17 -060038/* Poweron flag used for enabling auto ups restart */
39extern unsigned long rtas_poweron_auto;
40
Benjamin Herrenschmidt4d2bb3f2011-05-12 13:46:38 +100041/* Provided by HVC VIO */
42extern void hvc_vio_init_early(void);
Michael Ellerman21cf9132008-04-16 13:51:48 +100043
Nathan Fontenot20648972010-09-10 09:40:32 +000044/* Dynamic logical Partitioning/Mobility */
45extern void dlpar_free_cc_nodes(struct device_node *);
46extern void dlpar_free_cc_property(struct property *);
Bharata B Raod6f1e7a2014-09-16 15:15:45 -050047extern struct device_node *dlpar_configure_connector(__be32,
48 struct device_node *);
Rob Herring215ee762017-08-21 10:16:49 -050049extern int dlpar_attach_node(struct device_node *, struct device_node *);
Nathan Fontenot20648972010-09-10 09:40:32 +000050extern int dlpar_detach_node(struct device_node *);
Nathan Fontenot5e51d3c2015-02-10 13:45:01 -060051extern int dlpar_acquire_drc(u32 drc_index);
52extern int dlpar_release_drc(u32 drc_index);
Nathan Fontenot20648972010-09-10 09:40:32 +000053
John Allenb7d9eb32016-07-07 10:03:44 -050054void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog,
55 struct completion *hotplug_done, int *rc);
Nathan Fontenot999e2da2015-02-10 13:47:02 -060056#ifdef CONFIG_MEMORY_HOTPLUG
57int dlpar_memory(struct pseries_hp_errorlog *hp_elog);
58#else
59static inline int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
60{
61 return -EOPNOTSUPP;
62}
63#endif
Michael Ellerman577830b2007-02-08 18:33:51 +110064
Nathan Fontenotac713802015-12-16 14:54:05 -060065#ifdef CONFIG_HOTPLUG_CPU
66int dlpar_cpu(struct pseries_hp_errorlog *hp_elog);
67#else
68static inline int dlpar_cpu(struct pseries_hp_errorlog *hp_elog)
69{
70 return -EOPNOTSUPP;
71}
72#endif
73
Kleber Sacilotto de Souzad82fb312013-05-03 12:43:12 +000074/* PCI root bridge prepare function override for pseries */
75struct pci_host_bridge;
76int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
77
Daniel Axtens38ae9ec2015-03-31 16:00:50 +110078extern struct pci_controller_ops pseries_pci_controller_ops;
79
Anton Blancharda5d86252014-06-04 17:50:47 +100080unsigned long pseries_memory_block_size(void);
81
Michael Ellerman8f272a52016-11-14 16:28:10 +110082extern int CMO_PrPSP;
83extern int CMO_SecPSP;
84extern unsigned long CMO_PageSize;
85
86static inline int cmo_get_primary_psp(void)
87{
88 return CMO_PrPSP;
89}
90
91static inline int cmo_get_secondary_psp(void)
92{
93 return CMO_SecPSP;
94}
95
96static inline unsigned long cmo_get_page_size(void)
97{
98 return CMO_PageSize;
99}
100
Michael Ellerman577830b2007-02-08 18:33:51 +1100101#endif /* _PSERIES_PSERIES_H */