License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2011-09-20 01:45:05 +08:00
|
|
|
#ifndef __POWERNV_PCI_H
|
|
|
|
#define __POWERNV_PCI_H
|
|
|
|
|
2017-03-30 18:19:25 +08:00
|
|
|
#include <linux/compiler.h> /* for __printf */
|
2016-07-14 05:17:00 +08:00
|
|
|
#include <linux/iommu.h>
|
|
|
|
#include <asm/iommu.h>
|
|
|
|
#include <asm/msi_bitmap.h>
|
|
|
|
|
2011-09-20 01:45:05 +08:00
|
|
|
struct pci_dn;
|
|
|
|
|
|
|
|
enum pnv_phb_type {
|
2018-01-23 19:31:36 +08:00
|
|
|
PNV_PHB_IODA1 = 0,
|
|
|
|
PNV_PHB_IODA2 = 1,
|
|
|
|
PNV_PHB_NPU_NVLINK = 2,
|
|
|
|
PNV_PHB_NPU_OCAPI = 3,
|
2011-09-20 01:45:05 +08:00
|
|
|
};
|
|
|
|
|
2011-11-30 02:22:53 +08:00
|
|
|
/* Precise PHB model for error management */
|
|
|
|
enum pnv_phb_model {
|
|
|
|
PNV_PHB_MODEL_UNKNOWN,
|
|
|
|
PNV_PHB_MODEL_P7IOC,
|
2013-04-26 03:20:57 +08:00
|
|
|
PNV_PHB_MODEL_PHB3,
|
2015-12-17 10:43:13 +08:00
|
|
|
PNV_PHB_MODEL_NPU,
|
2017-01-10 12:41:44 +08:00
|
|
|
PNV_PHB_MODEL_NPU2,
|
2011-11-30 02:22:53 +08:00
|
|
|
};
|
|
|
|
|
2013-09-06 09:00:03 +08:00
|
|
|
#define PNV_PCI_DIAG_BUF_SIZE 8192
|
2012-08-20 11:49:15 +08:00
|
|
|
#define PNV_IODA_PE_DEV (1 << 0) /* PE has single PCI device */
|
|
|
|
#define PNV_IODA_PE_BUS (1 << 1) /* PE has primary PCI bus */
|
|
|
|
#define PNV_IODA_PE_BUS_ALL (1 << 2) /* PE has subordinate buses */
|
2014-07-21 12:42:30 +08:00
|
|
|
#define PNV_IODA_PE_MASTER (1 << 3) /* Master PE in compound case */
|
|
|
|
#define PNV_IODA_PE_SLAVE (1 << 4) /* Slave PE in compound case */
|
2015-03-25 16:23:57 +08:00
|
|
|
#define PNV_IODA_PE_VF (1 << 5) /* PE for one VF */
|
2011-11-30 02:22:53 +08:00
|
|
|
|
2017-06-14 12:19:58 +08:00
|
|
|
/* Indicates operations are frozen for a PE: MMIO in PESTA & DMA in PESTB. */
|
|
|
|
#define PNV_IODA_STOPPED_STATE 0x8000000000000000
|
|
|
|
|
2011-11-16 01:29:08 +08:00
|
|
|
/* Data associated with a PE, including IOMMU tracking etc.. */
|
2013-04-26 03:21:00 +08:00
|
|
|
struct pnv_phb;
|
2011-11-16 01:29:08 +08:00
|
|
|
struct pnv_ioda_pe {
|
2012-08-20 11:49:15 +08:00
|
|
|
unsigned long flags;
|
2013-04-26 03:21:00 +08:00
|
|
|
struct pnv_phb *phb;
|
2016-05-20 14:41:35 +08:00
|
|
|
int device_count;
|
2012-08-20 11:49:15 +08:00
|
|
|
|
2011-11-16 01:29:08 +08:00
|
|
|
/* A PE can be associated with a single device or an
|
|
|
|
* entire bus (& children). In the former case, pdev
|
|
|
|
* is populated, in the later case, pbus is.
|
|
|
|
*/
|
2015-03-25 16:23:57 +08:00
|
|
|
#ifdef CONFIG_PCI_IOV
|
|
|
|
struct pci_dev *parent_dev;
|
|
|
|
#endif
|
2011-11-16 01:29:08 +08:00
|
|
|
struct pci_dev *pdev;
|
|
|
|
struct pci_bus *pbus;
|
|
|
|
|
|
|
|
/* Effective RID (device RID for a device PE and base bus
|
|
|
|
* RID with devfn 0 for a bus PE)
|
|
|
|
*/
|
|
|
|
unsigned int rid;
|
|
|
|
|
|
|
|
/* PE number */
|
|
|
|
unsigned int pe_number;
|
|
|
|
|
|
|
|
/* "Base" iommu table, ie, 4K TCEs, 32-bit DMA */
|
2015-06-05 14:35:08 +08:00
|
|
|
struct iommu_table_group table_group;
|
2018-12-19 16:52:26 +08:00
|
|
|
struct npu_comp *npucomp;
|
2011-11-16 01:29:08 +08:00
|
|
|
|
2014-02-11 08:32:38 +08:00
|
|
|
/* 64-bit TCE bypass region */
|
|
|
|
bool tce_bypass_enabled;
|
|
|
|
uint64_t tce_bypass_base;
|
2011-11-16 01:29:08 +08:00
|
|
|
|
|
|
|
/* MSIs. MVE index is identical for for 32 and 64 bit MSI
|
|
|
|
* and -1 if not supported. (It's actually identical to the
|
|
|
|
* PE number)
|
|
|
|
*/
|
|
|
|
int mve_number;
|
|
|
|
|
2014-07-21 12:42:30 +08:00
|
|
|
/* PEs in compound case */
|
|
|
|
struct pnv_ioda_pe *master;
|
|
|
|
struct list_head slaves;
|
|
|
|
|
powerpc/powernv: Enable PCI peer-to-peer
P9 has support for PCI peer-to-peer, enabling a device to write in the
MMIO space of another device directly, without interrupting the CPU.
This patch adds support for it on powernv, by adding a new API to be
called by drivers. The pnv_pci_set_p2p(...) call configures an
'initiator', i.e the device which will issue the MMIO operation, and a
'target', i.e. the device on the receiving side.
P9 really only supports MMIO stores for the time being but that's
expected to change in the future, so the API allows to define both
load and store operations.
/* PCI p2p descriptor */
#define OPAL_PCI_P2P_ENABLE 0x1
#define OPAL_PCI_P2P_LOAD 0x2
#define OPAL_PCI_P2P_STORE 0x4
int pnv_pci_set_p2p(struct pci_dev *initiator, struct pci_dev *target,
u64 desc)
It uses a new OPAL call, as the configuration magic is done on the
PHBs by skiboot.
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Russell Currey <ruscur@russell.cc>
[mpe: Drop unrelated OPAL calls, s/uint64_t/u64/, minor formatting]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-08-04 17:55:14 +08:00
|
|
|
/* PCI peer-to-peer*/
|
|
|
|
int p2p_initiator_count;
|
|
|
|
|
2011-11-16 01:29:08 +08:00
|
|
|
/* Link in list of PE#s */
|
2012-08-20 11:49:15 +08:00
|
|
|
struct list_head list;
|
2011-11-16 01:29:08 +08:00
|
|
|
};
|
|
|
|
|
2014-04-24 16:00:09 +08:00
|
|
|
#define PNV_PHB_FLAG_EEH (1 << 0)
|
|
|
|
|
2011-09-20 01:45:05 +08:00
|
|
|
struct pnv_phb {
|
|
|
|
struct pci_controller *hose;
|
|
|
|
enum pnv_phb_type type;
|
2011-11-30 02:22:53 +08:00
|
|
|
enum pnv_phb_model model;
|
2013-06-20 13:21:06 +08:00
|
|
|
u64 hub_id;
|
2011-09-20 01:45:05 +08:00
|
|
|
u64 opal_id;
|
2014-04-24 16:00:09 +08:00
|
|
|
int flags;
|
2011-09-20 01:45:05 +08:00
|
|
|
void __iomem *regs;
|
2016-07-08 14:37:14 +08:00
|
|
|
u64 regs_phys;
|
2012-08-20 11:49:18 +08:00
|
|
|
int initialized;
|
2011-09-20 01:45:05 +08:00
|
|
|
spinlock_t lock;
|
|
|
|
|
2013-06-20 18:13:25 +08:00
|
|
|
#ifdef CONFIG_DEBUG_FS
|
2014-04-24 16:00:18 +08:00
|
|
|
int has_dbgfs;
|
2013-06-20 18:13:25 +08:00
|
|
|
struct dentry *dbgfs;
|
|
|
|
#endif
|
|
|
|
|
2011-09-20 01:45:06 +08:00
|
|
|
unsigned int msi_base;
|
|
|
|
unsigned int msi32_support;
|
2013-03-06 05:12:37 +08:00
|
|
|
struct msi_bitmap msi_bmp;
|
2011-09-20 01:45:06 +08:00
|
|
|
int (*msi_setup)(struct pnv_phb *phb, struct pci_dev *dev,
|
2013-04-26 03:20:59 +08:00
|
|
|
unsigned int hwirq, unsigned int virq,
|
|
|
|
unsigned int is_64, struct msi_msg *msg);
|
2011-09-20 01:45:05 +08:00
|
|
|
void (*dma_dev_setup)(struct pnv_phb *phb, struct pci_dev *pdev);
|
2014-07-21 12:42:30 +08:00
|
|
|
int (*init_m64)(struct pnv_phb *phb);
|
2014-07-21 12:42:33 +08:00
|
|
|
int (*get_pe_state)(struct pnv_phb *phb, int pe_no);
|
|
|
|
void (*freeze_pe)(struct pnv_phb *phb, int pe_no);
|
|
|
|
int (*unfreeze_pe)(struct pnv_phb *phb, int pe_no, int opt);
|
2011-09-20 01:45:05 +08:00
|
|
|
|
2016-02-08 12:08:20 +08:00
|
|
|
struct {
|
|
|
|
/* Global bridge info */
|
2016-05-03 13:41:24 +08:00
|
|
|
unsigned int total_pe_num;
|
|
|
|
unsigned int reserved_pe_idx;
|
2016-05-20 14:41:32 +08:00
|
|
|
unsigned int root_pe_idx;
|
|
|
|
bool root_pe_populated;
|
2016-02-08 12:08:20 +08:00
|
|
|
|
|
|
|
/* 32-bit MMIO window */
|
|
|
|
unsigned int m32_size;
|
|
|
|
unsigned int m32_segsize;
|
|
|
|
unsigned int m32_pci_base;
|
|
|
|
|
|
|
|
/* 64-bit MMIO window */
|
|
|
|
unsigned int m64_bar_idx;
|
|
|
|
unsigned long m64_size;
|
|
|
|
unsigned long m64_segsize;
|
|
|
|
unsigned long m64_base;
|
|
|
|
unsigned long m64_bar_alloc;
|
|
|
|
|
|
|
|
/* IO ports */
|
|
|
|
unsigned int io_size;
|
|
|
|
unsigned int io_segsize;
|
|
|
|
unsigned int io_pci_base;
|
|
|
|
|
2016-05-03 13:41:23 +08:00
|
|
|
/* PE allocation */
|
2016-02-08 12:08:20 +08:00
|
|
|
struct mutex pe_alloc_mutex;
|
2016-05-03 13:41:23 +08:00
|
|
|
unsigned long *pe_alloc;
|
|
|
|
struct pnv_ioda_pe *pe_array;
|
2016-02-08 12:08:20 +08:00
|
|
|
|
|
|
|
/* M32 & IO segment maps */
|
2016-05-03 13:41:29 +08:00
|
|
|
unsigned int *m64_segmap;
|
2016-02-08 12:08:20 +08:00
|
|
|
unsigned int *m32_segmap;
|
|
|
|
unsigned int *io_segmap;
|
|
|
|
|
2016-05-05 10:04:16 +08:00
|
|
|
/* DMA32 segment maps - IODA1 only */
|
|
|
|
unsigned int dma32_count;
|
|
|
|
unsigned int *dma32_segmap;
|
|
|
|
|
2016-02-08 12:08:20 +08:00
|
|
|
/* IRQ chip */
|
|
|
|
int irq_chip_init;
|
|
|
|
struct irq_chip irq_chip;
|
|
|
|
|
|
|
|
/* Sorted list of used PE's based
|
|
|
|
* on the sequence of creation
|
|
|
|
*/
|
|
|
|
struct list_head pe_list;
|
|
|
|
struct mutex pe_list_mutex;
|
|
|
|
|
2016-05-20 14:41:29 +08:00
|
|
|
/* Reverse map of PEs, indexed by {bus, devfn} */
|
|
|
|
unsigned int pe_rmap[0x10000];
|
2016-02-08 12:08:20 +08:00
|
|
|
} ioda;
|
2011-11-30 02:22:53 +08:00
|
|
|
|
2017-06-14 12:19:59 +08:00
|
|
|
/* PHB and hub diagnostics */
|
|
|
|
unsigned int diag_data_size;
|
|
|
|
u8 *diag_data;
|
2013-12-21 03:06:01 +08:00
|
|
|
|
powerpc/powernv: Enable PCI peer-to-peer
P9 has support for PCI peer-to-peer, enabling a device to write in the
MMIO space of another device directly, without interrupting the CPU.
This patch adds support for it on powernv, by adding a new API to be
called by drivers. The pnv_pci_set_p2p(...) call configures an
'initiator', i.e the device which will issue the MMIO operation, and a
'target', i.e. the device on the receiving side.
P9 really only supports MMIO stores for the time being but that's
expected to change in the future, so the API allows to define both
load and store operations.
/* PCI p2p descriptor */
#define OPAL_PCI_P2P_ENABLE 0x1
#define OPAL_PCI_P2P_LOAD 0x2
#define OPAL_PCI_P2P_STORE 0x4
int pnv_pci_set_p2p(struct pci_dev *initiator, struct pci_dev *target,
u64 desc)
It uses a new OPAL call, as the configuration magic is done on the
PHBs by skiboot.
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Russell Currey <ruscur@russell.cc>
[mpe: Drop unrelated OPAL calls, s/uint64_t/u64/, minor formatting]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-08-04 17:55:14 +08:00
|
|
|
int p2p_target_count;
|
2011-09-20 01:45:05 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct pci_ops pnv_pci_ops;
|
|
|
|
|
2013-11-22 16:28:45 +08:00
|
|
|
void pnv_pci_dump_phb_diag_data(struct pci_controller *hose,
|
|
|
|
unsigned char *log_buff);
|
2015-03-17 13:15:03 +08:00
|
|
|
int pnv_pci_cfg_read(struct pci_dn *pdn,
|
2013-06-27 13:46:48 +08:00
|
|
|
int where, int size, u32 *val);
|
2015-03-17 13:15:03 +08:00
|
|
|
int pnv_pci_cfg_write(struct pci_dn *pdn,
|
2013-06-27 13:46:48 +08:00
|
|
|
int where, int size, u32 val);
|
2015-06-05 14:35:09 +08:00
|
|
|
extern struct iommu_table *pnv_pci_table_alloc(int nid);
|
|
|
|
|
2011-11-16 01:29:08 +08:00
|
|
|
extern void pnv_pci_init_ioda_hub(struct device_node *np);
|
2013-04-26 03:20:57 +08:00
|
|
|
extern void pnv_pci_init_ioda2_phb(struct device_node *np);
|
2015-12-17 10:43:13 +08:00
|
|
|
extern void pnv_pci_init_npu_phb(struct device_node *np);
|
2018-01-23 19:31:36 +08:00
|
|
|
extern void pnv_pci_init_npu2_opencapi_phb(struct device_node *np);
|
2018-12-19 16:52:17 +08:00
|
|
|
extern void pnv_npu2_map_lpar(struct pnv_ioda_pe *gpe, unsigned long msr);
|
2014-04-24 16:00:24 +08:00
|
|
|
extern void pnv_pci_reset_secondary_bus(struct pci_dev *dev);
|
2015-02-16 11:45:47 +08:00
|
|
|
extern int pnv_eeh_phb_reset(struct pci_controller *hose, int option);
|
2013-05-10 14:59:18 +08:00
|
|
|
|
2015-04-28 13:12:05 +08:00
|
|
|
extern void pnv_pci_dma_dev_setup(struct pci_dev *pdev);
|
2016-02-09 12:50:22 +08:00
|
|
|
extern void pnv_pci_dma_bus_setup(struct pci_bus *bus);
|
2015-04-28 13:12:05 +08:00
|
|
|
extern int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type);
|
|
|
|
extern void pnv_teardown_msi_irqs(struct pci_dev *pdev);
|
2016-07-14 05:17:00 +08:00
|
|
|
extern struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev);
|
|
|
|
extern void pnv_set_msi_irq_chip(struct pnv_phb *phb, unsigned int virq);
|
powerpc/powernv: Enable PCI peer-to-peer
P9 has support for PCI peer-to-peer, enabling a device to write in the
MMIO space of another device directly, without interrupting the CPU.
This patch adds support for it on powernv, by adding a new API to be
called by drivers. The pnv_pci_set_p2p(...) call configures an
'initiator', i.e the device which will issue the MMIO operation, and a
'target', i.e. the device on the receiving side.
P9 really only supports MMIO stores for the time being but that's
expected to change in the future, so the API allows to define both
load and store operations.
/* PCI p2p descriptor */
#define OPAL_PCI_P2P_ENABLE 0x1
#define OPAL_PCI_P2P_LOAD 0x2
#define OPAL_PCI_P2P_STORE 0x4
int pnv_pci_set_p2p(struct pci_dev *initiator, struct pci_dev *target,
u64 desc)
It uses a new OPAL call, as the configuration magic is done on the
PHBs by skiboot.
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Russell Currey <ruscur@russell.cc>
[mpe: Drop unrelated OPAL calls, s/uint64_t/u64/, minor formatting]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-08-04 17:55:14 +08:00
|
|
|
extern void pnv_pci_ioda2_set_bypass(struct pnv_ioda_pe *pe, bool enable);
|
2018-12-19 16:52:26 +08:00
|
|
|
extern unsigned long pnv_pci_ioda2_get_table_size(__u32 page_shift,
|
|
|
|
__u64 window_size, __u32 levels);
|
2017-09-07 14:35:44 +08:00
|
|
|
extern int pnv_eeh_post_init(void);
|
2015-04-28 13:12:05 +08:00
|
|
|
|
2017-03-30 18:19:25 +08:00
|
|
|
__printf(3, 4)
|
2016-04-29 16:55:21 +08:00
|
|
|
extern void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level,
|
|
|
|
const char *fmt, ...);
|
|
|
|
#define pe_err(pe, fmt, ...) \
|
|
|
|
pe_level_printk(pe, KERN_ERR, fmt, ##__VA_ARGS__)
|
|
|
|
#define pe_warn(pe, fmt, ...) \
|
|
|
|
pe_level_printk(pe, KERN_WARNING, fmt, ##__VA_ARGS__)
|
|
|
|
#define pe_info(pe, fmt, ...) \
|
|
|
|
pe_level_printk(pe, KERN_INFO, fmt, ##__VA_ARGS__)
|
|
|
|
|
2015-12-17 10:43:13 +08:00
|
|
|
/* Nvlink functions */
|
2016-04-29 16:55:20 +08:00
|
|
|
extern void pnv_npu_try_dma_set_bypass(struct pci_dev *gpdev, bool bypass);
|
2017-05-03 11:24:08 +08:00
|
|
|
extern void pnv_pci_ioda2_tce_invalidate_entire(struct pnv_phb *phb, bool rm);
|
2016-04-29 16:55:24 +08:00
|
|
|
extern struct pnv_ioda_pe *pnv_pci_npu_setup_iommu(struct pnv_ioda_pe *npe);
|
2018-12-19 16:52:26 +08:00
|
|
|
extern struct iommu_table_group *pnv_try_setup_npu_table_group(
|
|
|
|
struct pnv_ioda_pe *pe);
|
|
|
|
extern struct iommu_table_group *pnv_npu_compound_attach(
|
|
|
|
struct pnv_ioda_pe *pe);
|
2016-07-14 05:17:06 +08:00
|
|
|
|
2018-07-04 14:13:45 +08:00
|
|
|
/* pci-ioda-tce.c */
|
|
|
|
#define POWERNV_IOMMU_DEFAULT_LEVELS 1
|
|
|
|
#define POWERNV_IOMMU_MAX_LEVELS 5
|
|
|
|
|
|
|
|
extern int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
|
|
|
|
unsigned long uaddr, enum dma_data_direction direction,
|
|
|
|
unsigned long attrs);
|
|
|
|
extern void pnv_tce_free(struct iommu_table *tbl, long index, long npages);
|
|
|
|
extern int pnv_tce_xchg(struct iommu_table *tbl, long index,
|
2018-07-04 14:13:49 +08:00
|
|
|
unsigned long *hpa, enum dma_data_direction *direction,
|
|
|
|
bool alloc);
|
|
|
|
extern __be64 *pnv_tce_useraddrptr(struct iommu_table *tbl, long index,
|
|
|
|
bool alloc);
|
2018-07-04 14:13:45 +08:00
|
|
|
extern unsigned long pnv_tce_get(struct iommu_table *tbl, long index);
|
|
|
|
|
|
|
|
extern long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset,
|
|
|
|
__u32 page_shift, __u64 window_size, __u32 levels,
|
2018-07-04 14:13:47 +08:00
|
|
|
bool alloc_userspace_copy, struct iommu_table *tbl);
|
2018-07-04 14:13:45 +08:00
|
|
|
extern void pnv_pci_ioda2_table_free_pages(struct iommu_table *tbl);
|
|
|
|
|
|
|
|
extern long pnv_pci_link_table_and_group(int node, int num,
|
|
|
|
struct iommu_table *tbl,
|
|
|
|
struct iommu_table_group *table_group);
|
|
|
|
extern void pnv_pci_unlink_table_and_group(struct iommu_table *tbl,
|
|
|
|
struct iommu_table_group *table_group);
|
|
|
|
extern void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
|
|
|
|
void *tce_mem, u64 tce_size,
|
|
|
|
u64 dma_offset, unsigned int page_shift);
|
|
|
|
|
2011-09-20 01:45:05 +08:00
|
|
|
#endif /* __POWERNV_PCI_H */
|