Blame view
include/linux/acpi_iort.h
2.09 KB
3b20eb237
|
1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
88ef16d88
|
2 3 4 |
/* * Copyright (C) 2016, Semihalf * Author: Tomasz Nowicki <tn@semihalf.com> |
88ef16d88
|
5 6 7 8 9 10 |
*/ #ifndef __ACPI_IORT_H__ #define __ACPI_IORT_H__ #include <linux/acpi.h> |
4bf2efd26
|
11 12 |
#include <linux/fwnode.h> #include <linux/irqdomain.h> |
88ef16d88
|
13 |
|
d6fcd3b14
|
14 15 |
#define IORT_IRQ_MASK(irq) (irq & 0xffffffffULL) #define IORT_IRQ_TRIGGER_MASK(irq) ((irq >> 32) & 0xffffffffULL) |
24e516049
|
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
|
22 |
#define IORT_SMMU_V3_PMCG_HISI_HIP08 0x00000001 /* HiSilicon HIP08 PMCG */ |
24e516049
|
23 |
|
8b4282e6b
|
24 25 |
int iort_register_domain_token(int trans_id, phys_addr_t base, struct fwnode_handle *fw_node); |
4bf2efd26
|
26 27 |
void iort_deregister_domain_token(int trans_id); struct fwnode_handle *iort_find_domain_token(int trans_id); |
88ef16d88
|
28 29 |
#ifdef CONFIG_ACPI_IORT void acpi_iort_init(void); |
4bf2efd26
|
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
|
32 |
void acpi_configure_pmsi_domain(struct device *dev); |
ae7c18380
|
33 |
int iort_pmsi_get_dev_id(struct device *dev, u32 *dev_id); |
643b8e4d8
|
34 |
/* IOMMU interface */ |
7ad426398
|
35 |
void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *size); |
643b8e4d8
|
36 |
const struct iommu_ops *iort_iommu_configure(struct device *dev); |
8b4282e6b
|
37 |
int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head); |
88ef16d88
|
38 39 |
#else static inline void acpi_iort_init(void) { } |
4bf2efd26
|
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
|
45 |
static inline void acpi_configure_pmsi_domain(struct device *dev) { } |
643b8e4d8
|
46 |
/* IOMMU interface */ |
7ad426398
|
47 48 |
static inline void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *size) { } |
e3d493926
|
49 50 |
static inline const struct iommu_ops *iort_iommu_configure( struct device *dev) |
643b8e4d8
|
51 |
{ return NULL; } |
8b4282e6b
|
52 53 54 |
static inline int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head) { return 0; } |
88ef16d88
|
55 56 57 |
#endif #endif /* __ACPI_IORT_H__ */ |