blob: 05b5524185198698e55e01e817d89d7f3402727e [file] [log] [blame]
Alistair Popple1d0761d2016-12-14 13:36:51 +11001/*
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 Popple1ab66d12017-04-03 19:51:44 +100014#define NPU2_WRITE 1
Alistair Popple1d0761d2016-12-14 13:36:51 +110015extern void powernv_set_nmmu_ptcr(unsigned long ptcr);
Alistair Popple1ab66d12017-04-03 19:51:44 +100016extern struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
17 unsigned long flags,
Alistair Popplea1409ad2018-04-11 16:38:55 +100018 void (*cb)(struct npu_context *, void *),
Alistair Popple1ab66d12017-04-03 19:51:44 +100019 void *priv);
20extern void pnv_npu2_destroy_context(struct npu_context *context,
21 struct pci_dev *gpdev);
22extern int pnv_npu2_handle_fault(struct npu_context *context, uintptr_t *ea,
23 unsigned long *flags, unsigned long *status,
24 int count);
Michael Ellerman54820532017-10-12 21:17:18 +110025
Paul Mackerras19f8a5b2019-02-12 11:58:29 +110026void pnv_program_cpu_hotplug_lpcr(unsigned int cpu, u64 lpcr_val);
27
Michael Ellerman54820532017-10-12 21:17:18 +110028void pnv_tm_init(void);
Alistair Popple1d0761d2016-12-14 13:36:51 +110029#else
30static inline void powernv_set_nmmu_ptcr(unsigned long ptcr) { }
Alistair Popple1ab66d12017-04-03 19:51:44 +100031static inline struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
32 unsigned long flags,
33 struct npu_context *(*cb)(struct npu_context *, void *),
34 void *priv) { return ERR_PTR(-ENODEV); }
35static inline void pnv_npu2_destroy_context(struct npu_context *context,
36 struct pci_dev *gpdev) { }
37
38static inline int pnv_npu2_handle_fault(struct npu_context *context,
39 uintptr_t *ea, unsigned long *flags,
40 unsigned long *status, int count) {
41 return -ENODEV;
42}
Michael Ellerman54820532017-10-12 21:17:18 +110043
44static inline void pnv_tm_init(void) { }
Alistair Popple1d0761d2016-12-14 13:36:51 +110045#endif
46
47#endif /* _ASM_POWERNV_H */