xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/i915/oa/i915_oa_tgl.c (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: i915_oa_tgl.c,v 1.2 2021/12/18 23:45:31 riastradh Exp $	*/
2 
3 // SPDX-License-Identifier: MIT
4 /*
5  * Copyright © 2018 Intel Corporation
6  *
7  * Autogenerated file by GPU Top : https://github.com/rib/gputop
8  * DO NOT EDIT manually!
9  */
10 
11 #include <sys/cdefs.h>
12 __KERNEL_RCSID(0, "$NetBSD: i915_oa_tgl.c,v 1.2 2021/12/18 23:45:31 riastradh Exp $");
13 
14 #include <linux/sysfs.h>
15 
16 #include "i915_drv.h"
17 #include "i915_oa_tgl.h"
18 
19 static const struct i915_oa_reg b_counter_config_test_oa[] = {
20 	{ _MMIO(0xD920), 0x00000000 },
21 	{ _MMIO(0xD900), 0x00000000 },
22 	{ _MMIO(0xD904), 0xF0800000 },
23 	{ _MMIO(0xD910), 0x00000000 },
24 	{ _MMIO(0xD914), 0xF0800000 },
25 	{ _MMIO(0xDC40), 0x00FF0000 },
26 	{ _MMIO(0xD940), 0x00000004 },
27 	{ _MMIO(0xD944), 0x0000FFFF },
28 	{ _MMIO(0xDC00), 0x00000004 },
29 	{ _MMIO(0xDC04), 0x0000FFFF },
30 	{ _MMIO(0xD948), 0x00000003 },
31 	{ _MMIO(0xD94C), 0x0000FFFF },
32 	{ _MMIO(0xDC08), 0x00000003 },
33 	{ _MMIO(0xDC0C), 0x0000FFFF },
34 	{ _MMIO(0xD950), 0x00000007 },
35 	{ _MMIO(0xD954), 0x0000FFFF },
36 	{ _MMIO(0xDC10), 0x00000007 },
37 	{ _MMIO(0xDC14), 0x0000FFFF },
38 	{ _MMIO(0xD958), 0x00100002 },
39 	{ _MMIO(0xD95C), 0x0000FFF7 },
40 	{ _MMIO(0xDC18), 0x00100002 },
41 	{ _MMIO(0xDC1C), 0x0000FFF7 },
42 	{ _MMIO(0xD960), 0x00100002 },
43 	{ _MMIO(0xD964), 0x0000FFCF },
44 	{ _MMIO(0xDC20), 0x00100002 },
45 	{ _MMIO(0xDC24), 0x0000FFCF },
46 	{ _MMIO(0xD968), 0x00100082 },
47 	{ _MMIO(0xD96C), 0x0000FFEF },
48 	{ _MMIO(0xDC28), 0x00100082 },
49 	{ _MMIO(0xDC2C), 0x0000FFEF },
50 	{ _MMIO(0xD970), 0x001000C2 },
51 	{ _MMIO(0xD974), 0x0000FFE7 },
52 	{ _MMIO(0xDC30), 0x001000C2 },
53 	{ _MMIO(0xDC34), 0x0000FFE7 },
54 	{ _MMIO(0xD978), 0x00100001 },
55 	{ _MMIO(0xD97C), 0x0000FFE7 },
56 	{ _MMIO(0xDC38), 0x00100001 },
57 	{ _MMIO(0xDC3C), 0x0000FFE7 },
58 };
59 
60 static const struct i915_oa_reg flex_eu_config_test_oa[] = {
61 };
62 
63 static const struct i915_oa_reg mux_config_test_oa[] = {
64 	{ _MMIO(0x0D04), 0x00000200 },
65 	{ _MMIO(0x9840), 0x00000000 },
66 	{ _MMIO(0x9884), 0x00000000 },
67 	{ _MMIO(0x9888), 0x280E0000 },
68 	{ _MMIO(0x9888), 0x1E0E0147 },
69 	{ _MMIO(0x9888), 0x180E0000 },
70 	{ _MMIO(0x9888), 0x160E0000 },
71 	{ _MMIO(0x9888), 0x1E0F1000 },
72 	{ _MMIO(0x9888), 0x1E104000 },
73 	{ _MMIO(0x9888), 0x2E020100 },
74 	{ _MMIO(0x9888), 0x2C030004 },
75 	{ _MMIO(0x9888), 0x38003000 },
76 	{ _MMIO(0x9888), 0x1E0A8000 },
77 	{ _MMIO(0x9884), 0x00000003 },
78 	{ _MMIO(0x9888), 0x49110000 },
79 	{ _MMIO(0x9888), 0x5D101400 },
80 	{ _MMIO(0x9888), 0x1D140020 },
81 	{ _MMIO(0x9888), 0x1D1103A3 },
82 	{ _MMIO(0x9888), 0x01110000 },
83 	{ _MMIO(0x9888), 0x61111000 },
84 	{ _MMIO(0x9888), 0x1F128000 },
85 	{ _MMIO(0x9888), 0x17100000 },
86 	{ _MMIO(0x9888), 0x55100630 },
87 	{ _MMIO(0x9888), 0x57100000 },
88 	{ _MMIO(0x9888), 0x31100000 },
89 	{ _MMIO(0x9884), 0x00000003 },
90 	{ _MMIO(0x9888), 0x65100002 },
91 	{ _MMIO(0x9884), 0x00000000 },
92 	{ _MMIO(0x9888), 0x42000001 },
93 };
94 
95 static ssize_t
show_test_oa_id(struct device * kdev,struct device_attribute * attr,char * buf)96 show_test_oa_id(struct device *kdev, struct device_attribute *attr, char *buf)
97 {
98 	return sprintf(buf, "1\n");
99 }
100 
101 void
i915_perf_load_test_config_tgl(struct drm_i915_private * dev_priv)102 i915_perf_load_test_config_tgl(struct drm_i915_private *dev_priv)
103 {
104 	strlcpy(dev_priv->perf.test_config.uuid,
105 		"80a833f0-2504-4321-8894-e9277844ce7b",
106 		sizeof(dev_priv->perf.test_config.uuid));
107 	dev_priv->perf.test_config.id = 1;
108 
109 	dev_priv->perf.test_config.mux_regs = mux_config_test_oa;
110 	dev_priv->perf.test_config.mux_regs_len = ARRAY_SIZE(mux_config_test_oa);
111 
112 	dev_priv->perf.test_config.b_counter_regs = b_counter_config_test_oa;
113 	dev_priv->perf.test_config.b_counter_regs_len = ARRAY_SIZE(b_counter_config_test_oa);
114 
115 	dev_priv->perf.test_config.flex_regs = flex_eu_config_test_oa;
116 	dev_priv->perf.test_config.flex_regs_len = ARRAY_SIZE(flex_eu_config_test_oa);
117 
118 	dev_priv->perf.test_config.sysfs_metric.name = "80a833f0-2504-4321-8894-e9277844ce7b";
119 	dev_priv->perf.test_config.sysfs_metric.attrs = dev_priv->perf.test_config.attrs;
120 
121 	dev_priv->perf.test_config.attrs[0] = &dev_priv->perf.test_config.sysfs_metric_id.attr;
122 
123 	dev_priv->perf.test_config.sysfs_metric_id.attr.name = "id";
124 	dev_priv->perf.test_config.sysfs_metric_id.attr.mode = 0444;
125 	dev_priv->perf.test_config.sysfs_metric_id.show = show_test_oa_id;
126 }
127