blob: 86ede827596118a566e8dbed7f24acd262bb725e [file] [log] [blame]
Cody P Schafera67f1442014-03-14 16:00:37 +11001#ifndef LINUX_POWERPC_PERF_HV_GPCI_H_
2#define LINUX_POWERPC_PERF_HV_GPCI_H_
3
4#include <linux/types.h>
5
6/* From the document "H_GetPerformanceCounterInfo Interface" v1.07 */
7
8/* H_GET_PERF_COUNTER_INFO argument */
9struct hv_get_perf_counter_info_params {
10 __be32 counter_request; /* I */
11 __be32 starting_index; /* IO */
12 __be16 secondary_index; /* IO */
13 __be16 returned_values; /* O */
14 __be32 detail_rc; /* O, only needed when called via *_norets() */
15
16 /*
17 * O, size each of counter_value element in bytes, only set for version
18 * >= 0x3
19 */
20 __be16 cv_element_size;
21
22 /* I, 0 (zero) for versions < 0x3 */
23 __u8 counter_info_version_in;
24
25 /* O, 0 (zero) if version < 0x3. Must be set to 0 when making hcall */
26 __u8 counter_info_version_out;
27 __u8 reserved[0xC];
28 __u8 counter_value[];
29} __packed;
30
31/*
32 * counter info version => fw version/reference (spec version)
33 *
34 * 8 => power8 (1.07)
35 * [7 is skipped by spec 1.07]
36 * 6 => TLBIE (1.07)
37 * 5 => v7r7m0.phyp (1.05)
38 * [4 skipped]
39 * 3 => v7r6m0.phyp (?)
40 * [1,2 skipped]
41 * 0 => v7r{2,3,4}m0.phyp (?)
42 */
43#define COUNTER_INFO_VERSION_CURRENT 0x8
44
Cody P Schafer9e9f6012015-01-30 13:46:01 -080045/* capability mask masks. */
46enum {
47 HV_GPCI_CM_GA = (1 << 7),
48 HV_GPCI_CM_EXPANDED = (1 << 6),
49 HV_GPCI_CM_LAB = (1 << 5)
Cody P Schafera67f1442014-03-14 16:00:37 +110050};
51
Cody P Schafer9e9f6012015-01-30 13:46:01 -080052#define REQUEST_FILE "../hv-gpci-requests.h"
53#define NAME_LOWER hv_gpci
54#define NAME_UPPER HV_GPCI
55#include "req-gen/perf.h"
56#undef REQUEST_FILE
57#undef NAME_LOWER
58#undef NAME_UPPER
Cody P Schafera67f1442014-03-14 16:00:37 +110059
60#endif