Files
android_kernel_samsung_sm8750/drivers/iommu/iommu-logger.h
2025-08-12 22:16:57 +02:00

54 lines
1.4 KiB
C
Executable File

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef __LINUX_QTI_IOMMU_LOGGER_H
#define __LINUX_QTI_IOMMU_LOGGER_H
#include <linux/io-pgtable.h>
enum iommu_logger_pgtable_fmt {
IOMMU_LOGGER_ARM_32_LPAE_S1,
IOMMU_LOGGER_ARM_64_LPAE_S1,
IOMMU_LOGGER_MAX_PGTABLE_FMTS,
};
/*
* Each group may have more than one domain; but each domain may
* only have one group.
*/
struct iommu_debug_attachment {
struct iommu_domain *domain;
struct iommu_group *group;
char *client_name;
enum iommu_logger_pgtable_fmt fmt;
unsigned int levels;
/*
* Virtual addresses of the top-level page tables are stored here,
* as they are more useful for debug tools than physical addresses.
*/
void *ttbr0;
void *ttbr1;
struct list_head list;
struct device *dev;
};
#if IS_ENABLED(CONFIG_QTI_IOMMU_SUPPORT)
int iommu_logger_register(struct iommu_domain *domain, struct device *dev,
struct io_pgtable_ops *ops);
void iommu_logger_unregister(struct device *dev, struct iommu_domain *domain);
#else
static inline int iommu_logger_register(struct iommu_domain *domain,
struct device *dev,
struct io_pgtable_ops *ops)
{
return 0;
}
static inline void iommu_logger_unregister(struct device *dev, struct iommu_domain *domain) {}
#endif /* CONFIG_QTI_IOMMU_LOGGER */
#endif /* __LINUX_QTI_IOMMU_LOGGER_H */