Blame view

include/linux/acpi_iort.h 2.09 KB
3b20eb237   Thomas Gleixner   treewide: Replace...
1
  /* SPDX-License-Identifier: GPL-2.0-only */
88ef16d88   Tomasz Nowicki   ACPI: I/O Remappi...
2
3
4
  /*
   * Copyright (C) 2016, Semihalf
   *	Author: Tomasz Nowicki <tn@semihalf.com>
88ef16d88   Tomasz Nowicki   ACPI: I/O Remappi...
5
6
7
8
9
10
   */
  
  #ifndef __ACPI_IORT_H__
  #define __ACPI_IORT_H__
  
  #include <linux/acpi.h>
4bf2efd26   Tomasz Nowicki   ACPI: Add new IOR...
11
12
  #include <linux/fwnode.h>
  #include <linux/irqdomain.h>
88ef16d88   Tomasz Nowicki   ACPI: I/O Remappi...
13

d6fcd3b14   Lorenzo Pieralisi   iommu/arm-smmu: A...
14
15
  #define IORT_IRQ_MASK(irq)		(irq & 0xffffffffULL)
  #define IORT_IRQ_TRIGGER_MASK(irq)	((irq >> 32) & 0xffffffffULL)
24e516049   Neil Leeder   ACPI/IORT: Add su...
16
17
18
19
20
21
  /*
   * PMCG model identifiers for use in smmu pmu driver. Please note
   * that this is purely for the use of software and has nothing to
   * do with hardware or with IORT specification.
   */
  #define IORT_SMMU_V3_PMCG_GENERIC        0x00000000 /* Generic SMMUv3 PMCG */
24062fe85   Shameer Kolothum   perf/smmuv3: Enab...
22
  #define IORT_SMMU_V3_PMCG_HISI_HIP08     0x00000001 /* HiSilicon HIP08 PMCG */
24e516049   Neil Leeder   ACPI/IORT: Add su...
23

8b4282e6b   Shameer Kolothum   ACPI/IORT: Add ms...
24
25
  int iort_register_domain_token(int trans_id, phys_addr_t base,
  			       struct fwnode_handle *fw_node);
4bf2efd26   Tomasz Nowicki   ACPI: Add new IOR...
26
27
  void iort_deregister_domain_token(int trans_id);
  struct fwnode_handle *iort_find_domain_token(int trans_id);
88ef16d88   Tomasz Nowicki   ACPI: I/O Remappi...
28
29
  #ifdef CONFIG_ACPI_IORT
  void acpi_iort_init(void);
4bf2efd26   Tomasz Nowicki   ACPI: Add new IOR...
30
31
  u32 iort_msi_map_rid(struct device *dev, u32 req_id);
  struct irq_domain *iort_get_device_domain(struct device *dev, u32 req_id);
d4f54a186   Hanjun Guo   ACPI: platform: s...
32
  void acpi_configure_pmsi_domain(struct device *dev);
ae7c18380   Hanjun Guo   ACPI: platform-ms...
33
  int iort_pmsi_get_dev_id(struct device *dev, u32 *dev_id);
643b8e4d8   Lorenzo Pieralisi   ACPI/IORT: Introd...
34
  /* IOMMU interface */
7ad426398   Lorenzo Pieralisi   ACPI: Make acpi_d...
35
  void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *size);
643b8e4d8   Lorenzo Pieralisi   ACPI/IORT: Introd...
36
  const struct iommu_ops *iort_iommu_configure(struct device *dev);
8b4282e6b   Shameer Kolothum   ACPI/IORT: Add ms...
37
  int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head);
88ef16d88   Tomasz Nowicki   ACPI: I/O Remappi...
38
39
  #else
  static inline void acpi_iort_init(void) { }
4bf2efd26   Tomasz Nowicki   ACPI: Add new IOR...
40
41
42
43
44
  static inline u32 iort_msi_map_rid(struct device *dev, u32 req_id)
  { return req_id; }
  static inline struct irq_domain *iort_get_device_domain(struct device *dev,
  							u32 req_id)
  { return NULL; }
d4f54a186   Hanjun Guo   ACPI: platform: s...
45
  static inline void acpi_configure_pmsi_domain(struct device *dev) { }
643b8e4d8   Lorenzo Pieralisi   ACPI/IORT: Introd...
46
  /* IOMMU interface */
7ad426398   Lorenzo Pieralisi   ACPI: Make acpi_d...
47
48
  static inline void iort_dma_setup(struct device *dev, u64 *dma_addr,
  				  u64 *size) { }
e3d493926   Lorenzo Pieralisi   ACPI/IORT: Improv...
49
50
  static inline const struct iommu_ops *iort_iommu_configure(
  				      struct device *dev)
643b8e4d8   Lorenzo Pieralisi   ACPI/IORT: Introd...
51
  { return NULL; }
8b4282e6b   Shameer Kolothum   ACPI/IORT: Add ms...
52
53
54
  static inline
  int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head)
  { return 0; }
88ef16d88   Tomasz Nowicki   ACPI: I/O Remappi...
55
56
57
  #endif
  
  #endif /* __ACPI_IORT_H__ */