Thomas Gleixner | 2874c5f | 2019-05-27 08:55:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Alistair Popple | 1d0761d | 2016-12-14 13:36:51 +1100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2017 IBM Corp. |
Alistair Popple | 1d0761d | 2016-12-14 13:36:51 +1100 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _ASM_POWERNV_H |
| 7 | #define _ASM_POWERNV_H |
| 8 | |
| 9 | #ifdef CONFIG_PPC_POWERNV |
Alistair Popple | 1ab66d1 | 2017-04-03 19:51:44 +1000 | [diff] [blame] | 10 | #define NPU2_WRITE 1 |
Alistair Popple | 1d0761d | 2016-12-14 13:36:51 +1100 | [diff] [blame] | 11 | extern void powernv_set_nmmu_ptcr(unsigned long ptcr); |
Alistair Popple | 1ab66d1 | 2017-04-03 19:51:44 +1000 | [diff] [blame] | 12 | extern struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev, |
| 13 | unsigned long flags, |
Alistair Popple | a1409ad | 2018-04-11 16:38:55 +1000 | [diff] [blame] | 14 | void (*cb)(struct npu_context *, void *), |
Alistair Popple | 1ab66d1 | 2017-04-03 19:51:44 +1000 | [diff] [blame] | 15 | void *priv); |
| 16 | extern void pnv_npu2_destroy_context(struct npu_context *context, |
| 17 | struct pci_dev *gpdev); |
| 18 | extern int pnv_npu2_handle_fault(struct npu_context *context, uintptr_t *ea, |
| 19 | unsigned long *flags, unsigned long *status, |
| 20 | int count); |
Michael Ellerman | 5482053 | 2017-10-12 21:17:18 +1100 | [diff] [blame] | 21 | |
Paul Mackerras | 19f8a5b | 2019-02-12 11:58:29 +1100 | [diff] [blame] | 22 | void pnv_program_cpu_hotplug_lpcr(unsigned int cpu, u64 lpcr_val); |
| 23 | |
Michael Ellerman | 5482053 | 2017-10-12 21:17:18 +1100 | [diff] [blame] | 24 | void pnv_tm_init(void); |
Alistair Popple | 1d0761d | 2016-12-14 13:36:51 +1100 | [diff] [blame] | 25 | #else |
| 26 | static inline void powernv_set_nmmu_ptcr(unsigned long ptcr) { } |
Alistair Popple | 1ab66d1 | 2017-04-03 19:51:44 +1000 | [diff] [blame] | 27 | static 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); } |
| 31 | static inline void pnv_npu2_destroy_context(struct npu_context *context, |
| 32 | struct pci_dev *gpdev) { } |
| 33 | |
| 34 | static 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 Ellerman | 5482053 | 2017-10-12 21:17:18 +1100 | [diff] [blame] | 39 | |
| 40 | static inline void pnv_tm_init(void) { } |
Alistair Popple | 1d0761d | 2016-12-14 13:36:51 +1100 | [diff] [blame] | 41 | #endif |
| 42 | |
| 43 | #endif /* _ASM_POWERNV_H */ |