2019-06-03 13:44:50 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-10-02 03:13:58 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014-2015 ARM Ltd.
|
|
|
|
*/
|
|
|
|
#ifndef __DMA_IOMMU_H
|
|
|
|
#define __DMA_IOMMU_H
|
|
|
|
|
2022-08-17 01:28:05 +08:00
|
|
|
#include <linux/iommu.h>
|
2015-10-02 03:13:58 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_IOMMU_DMA
|
|
|
|
|
|
|
|
int iommu_get_dma_cookie(struct iommu_domain *domain);
|
|
|
|
void iommu_put_dma_cookie(struct iommu_domain *domain);
|
|
|
|
|
2021-08-11 20:21:38 +08:00
|
|
|
int iommu_dma_init_fq(struct iommu_domain *domain);
|
2015-10-02 03:13:58 +08:00
|
|
|
|
2017-03-17 01:00:19 +08:00
|
|
|
void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list);
|
2016-09-13 00:13:59 +08:00
|
|
|
|
2021-03-06 00:32:34 +08:00
|
|
|
extern bool iommu_dma_forcedac;
|
|
|
|
|
2019-05-20 15:29:26 +08:00
|
|
|
#else /* CONFIG_IOMMU_DMA */
|
2015-10-02 03:13:58 +08:00
|
|
|
|
2021-08-11 20:21:38 +08:00
|
|
|
static inline int iommu_dma_init_fq(struct iommu_domain *domain)
|
|
|
|
{
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2015-10-02 03:13:58 +08: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-17 01:00:19 +08:00
|
|
|
static inline void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-10-02 03:13:58 +08:00
|
|
|
#endif /* CONFIG_IOMMU_DMA */
|
|
|
|
#endif /* __DMA_IOMMU_H */
|