Alistair Popple | 1d0761d | 2016-12-14 13:36:51 +1100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 IBM Corp. |
| 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 _ASM_POWERNV_H |
| 11 | #define _ASM_POWERNV_H |
| 12 | |
| 13 | #ifdef CONFIG_PPC_POWERNV |
Alistair Popple | 1ab66d1 | 2017-04-03 19:51:44 +1000 | [diff] [blame] | 14 | #define NPU2_WRITE 1 |
Alistair Popple | 1d0761d | 2016-12-14 13:36:51 +1100 | [diff] [blame] | 15 | extern void powernv_set_nmmu_ptcr(unsigned long ptcr); |
Alistair Popple | 1ab66d1 | 2017-04-03 19:51:44 +1000 | [diff] [blame] | 16 | extern struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev, |
| 17 | unsigned long flags, |
| 18 | struct npu_context *(*cb)(struct npu_context *, void *), |
| 19 | void *priv); |
| 20 | extern void pnv_npu2_destroy_context(struct npu_context *context, |
| 21 | struct pci_dev *gpdev); |
| 22 | extern int pnv_npu2_handle_fault(struct npu_context *context, uintptr_t *ea, |
| 23 | unsigned long *flags, unsigned long *status, |
| 24 | int count); |
Michael Ellerman | 5482053 | 2017-10-12 21:17:18 +1100 | [diff] [blame] | 25 | |
| 26 | void pnv_tm_init(void); |
Alistair Popple | 1d0761d | 2016-12-14 13:36:51 +1100 | [diff] [blame] | 27 | #else |
| 28 | static inline void powernv_set_nmmu_ptcr(unsigned long ptcr) { } |
Alistair Popple | 1ab66d1 | 2017-04-03 19:51:44 +1000 | [diff] [blame] | 29 | static inline struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev, |
| 30 | unsigned long flags, |
| 31 | struct npu_context *(*cb)(struct npu_context *, void *), |
| 32 | void *priv) { return ERR_PTR(-ENODEV); } |
| 33 | static inline void pnv_npu2_destroy_context(struct npu_context *context, |
| 34 | struct pci_dev *gpdev) { } |
| 35 | |
| 36 | static inline int pnv_npu2_handle_fault(struct npu_context *context, |
| 37 | uintptr_t *ea, unsigned long *flags, |
| 38 | unsigned long *status, int count) { |
| 39 | return -ENODEV; |
| 40 | } |
Michael Ellerman | 5482053 | 2017-10-12 21:17:18 +1100 | [diff] [blame] | 41 | |
| 42 | static inline void pnv_tm_init(void) { } |
Alistair Popple | 1d0761d | 2016-12-14 13:36:51 +1100 | [diff] [blame] | 43 | #endif |
| 44 | |
| 45 | #endif /* _ASM_POWERNV_H */ |