]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - arch/x86/events/amd/iommu.h
x86/events, drivers/iommu/amd: Introduce amd_iommu_get_num_iommus()
[mirror_ubuntu-hirsute-kernel.git] / arch / x86 / events / amd / iommu.h
CommitLineData
7be6296f
SS
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
12#ifndef _PERF_EVENT_AMD_IOMMU_H_
13#define _PERF_EVENT_AMD_IOMMU_H_
14
15/* iommu pc mmio region register indexes */
16#define IOMMU_PC_COUNTER_REG 0x00
17#define IOMMU_PC_COUNTER_SRC_REG 0x08
18#define IOMMU_PC_PASID_MATCH_REG 0x10
19#define IOMMU_PC_DOMID_MATCH_REG 0x18
20#define IOMMU_PC_DEVID_MATCH_REG 0x20
21#define IOMMU_PC_COUNTER_REPORT_REG 0x28
22
23/* maximun specified bank/counters */
24#define PC_MAX_SPEC_BNKS 64
25#define PC_MAX_SPEC_CNTRS 16
26
27/* iommu pc reg masks*/
28#define IOMMU_BASE_DEVID 0x0000
29
30/* amd_iommu_init.c external support functions */
6b9376e3
SS
31extern int amd_iommu_get_num_iommus(void);
32
7be6296f
SS
33extern bool amd_iommu_pc_supported(void);
34
35extern u8 amd_iommu_pc_get_max_banks(u16 devid);
36
37extern u8 amd_iommu_pc_get_max_counters(u16 devid);
38
39extern int amd_iommu_pc_get_set_reg_val(u16 devid, u8 bank, u8 cntr,
40 u8 fxn, u64 *value, bool is_write);
41
42#endif /*_PERF_EVENT_AMD_IOMMU_H_*/