2019-06-03 05:44:50 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-10-01 19:13:58 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014-2015 ARM Ltd.
|
|
|
|
*/
|
|
|
|
#ifndef __DMA_IOMMU_H
|
|
|
|
#define __DMA_IOMMU_H
|
|
|
|
|
2019-05-20 07:29:26 +00:00
|
|
|
#include <linux/errno.h>
|
2018-05-08 12:14:33 +00:00
|
|
|
#include <linux/types.h>
|
2015-10-01 19:13:58 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_IOMMU_DMA
|
2017-04-26 13:46:20 +00:00
|
|
|
#include <linux/dma-mapping.h>
|
2015-10-01 19:13:58 +00:00
|
|
|
#include <linux/iommu.h>
|
2016-09-12 16:13:59 +00:00
|
|
|
#include <linux/msi.h>
|
2015-10-01 19:13:58 +00:00
|
|
|
|
|
|
|
/* Domain management interface for IOMMU drivers */
|
|
|
|
int iommu_get_dma_cookie(struct iommu_domain *domain);
|
|
|
|
void iommu_put_dma_cookie(struct iommu_domain *domain);
|
|
|
|
|
2021-08-11 12:21:38 +00:00
|
|
|
int iommu_dma_init_fq(struct iommu_domain *domain);
|
2015-10-01 19:13:58 +00:00
|
|
|
|
2017-03-16 17:00:19 +00:00
|
|
|
void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list);
|
2016-09-12 16:13:59 +00:00
|
|
|
|
2020-11-24 08:20:52 +00:00
|
|
|
void iommu_dma_free_cpu_cached_iovas(unsigned int cpu,
|
|
|
|
struct iommu_domain *domain);
|
|
|
|
|
2021-03-05 16:32:34 +00:00
|
|
|
extern bool iommu_dma_forcedac;
|
|
|
|
|
2019-05-20 07:29:26 +00:00
|
|
|
#else /* CONFIG_IOMMU_DMA */
|
2015-10-01 19:13:58 +00:00
|
|
|
|
|
|
|
struct iommu_domain;
|
2017-05-18 13:13:57 +00:00
|
|
|
struct device;
|
2015-10-01 19:13:58 +00:00
|
|
|
|
2021-08-11 12:21:38 +00:00
|
|
|
static inline int iommu_dma_init_fq(struct iommu_domain *domain)
|
|
|
|
{
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2015-10-01 19:13:58 +00:00
|
|
|
static inline int iommu_get_dma_cookie(struct iommu_domain *domain)
|
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void iommu_put_dma_cookie(struct iommu_domain *domain)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-03-16 17:00:19 +00:00
|
|
|
static inline void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-10-01 19:13:58 +00:00
|
|
|
#endif /* CONFIG_IOMMU_DMA */
|
|
|
|
#endif /* __DMA_IOMMU_H */
|