blob: bc69ed2d952c902a8c42296bf1e8dac9fbe6b448 [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Alistair Popple1d0761d2016-12-14 13:36:51 +11002/*
3 * Copyright 2017 IBM Corp.
Alistair Popple1d0761d2016-12-14 13:36:51 +11004 */
5
6#ifndef _ASM_POWERNV_H
7#define _ASM_POWERNV_H
8
9#ifdef CONFIG_PPC_POWERNV
Alistair Popple1ab66d12017-04-03 19:51:44 +100010#define NPU2_WRITE 1
Alistair Popple1d0761d2016-12-14 13:36:51 +110011extern void powernv_set_nmmu_ptcr(unsigned long ptcr);
Alistair Popple1ab66d12017-04-03 19:51:44 +100012extern struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
13 unsigned long flags,
Alistair Popplea1409ad2018-04-11 16:38:55 +100014 void (*cb)(struct npu_context *, void *),
Alistair Popple1ab66d12017-04-03 19:51:44 +100015 void *priv);
16extern void pnv_npu2_destroy_context(struct npu_context *context,
17 struct pci_dev *gpdev);
18extern int pnv_npu2_handle_fault(struct npu_context *context, uintptr_t *ea,
19 unsigned long *flags, unsigned long *status,
20 int count);
Michael Ellerman54820532017-10-12 21:17:18 +110021
Paul Mackerras19f8a5b2019-02-12 11:58:29 +110022void pnv_program_cpu_hotplug_lpcr(unsigned int cpu, u64 lpcr_val);
23
Michael Ellerman54820532017-10-12 21:17:18 +110024void pnv_tm_init(void);
Alistair Popple1d0761d2016-12-14 13:36:51 +110025#else
26static inline void powernv_set_nmmu_ptcr(unsigned long ptcr) { }
Alistair Popple1ab66d12017-04-03 19:51:44 +100027static inline struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
28 unsigned long flags,
29 struct npu_context *(*cb)(struct npu_context *, void *),
30 void *priv) { return ERR_PTR(-ENODEV); }
31static inline void pnv_npu2_destroy_context(struct npu_context *context,
32 struct pci_dev *gpdev) { }
33
34static inline int pnv_npu2_handle_fault(struct npu_context *context,
35 uintptr_t *ea, unsigned long *flags,
36 unsigned long *status, int count) {
37 return -ENODEV;
38}
Michael Ellerman54820532017-10-12 21:17:18 +110039
40static inline void pnv_tm_init(void) { }
Alistair Popple1d0761d2016-12-14 13:36:51 +110041#endif
42
43#endif /* _ASM_POWERNV_H */