iommu.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2013 Advanced Micro Devices, Inc.
  3. *
  4. * Author: Steven Kinney <Steven.Kinney@amd.com>
  5. * Author: Suravee Suthikulpanit <Suraveee.Suthikulpanit@amd.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef _PERF_EVENT_AMD_IOMMU_H_
  12. #define _PERF_EVENT_AMD_IOMMU_H_
  13. /* iommu pc mmio region register indexes */
  14. #define IOMMU_PC_COUNTER_REG 0x00
  15. #define IOMMU_PC_COUNTER_SRC_REG 0x08
  16. #define IOMMU_PC_PASID_MATCH_REG 0x10
  17. #define IOMMU_PC_DOMID_MATCH_REG 0x18
  18. #define IOMMU_PC_DEVID_MATCH_REG 0x20
  19. #define IOMMU_PC_COUNTER_REPORT_REG 0x28
  20. /* maximun specified bank/counters */
  21. #define PC_MAX_SPEC_BNKS 64
  22. #define PC_MAX_SPEC_CNTRS 16
  23. struct amd_iommu;
  24. /* amd_iommu_init.c external support functions */
  25. extern int amd_iommu_get_num_iommus(void);
  26. extern bool amd_iommu_pc_supported(void);
  27. extern u8 amd_iommu_pc_get_max_banks(unsigned int idx);
  28. extern u8 amd_iommu_pc_get_max_counters(unsigned int idx);
  29. extern int amd_iommu_pc_set_reg(struct amd_iommu *iommu, u8 bank, u8 cntr,
  30. u8 fxn, u64 *value);
  31. extern int amd_iommu_pc_get_reg(struct amd_iommu *iommu, u8 bank, u8 cntr,
  32. u8 fxn, u64 *value);
  33. extern struct amd_iommu *get_amd_iommu(int idx);
  34. #endif /*_PERF_EVENT_AMD_IOMMU_H_*/