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
|
|
|
|
|
2022-08-16 17:28:05 +00:00
|
|
|
#include <linux/iommu.h>
|
2015-10-01 19:13:58 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_IOMMU_DMA
|
|
|
|
|
2024-04-19 16:54:45 +00:00
|
|
|
void iommu_setup_dma_ops(struct device *dev);
|
|
|
|
|
2015-10-01 19:13:58 +00:00
|
|
|
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
|
|
|
|
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
|
|
|
|
2024-04-19 16:54:45 +00:00
|
|
|
static inline void iommu_setup_dma_ops(struct device *dev)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
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 */
|