This source file includes following definitions.
- gm20b_volt_new
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #include "priv.h"
24 #include "gk20a.h"
25
26 #include <core/tegra.h>
27
28 static const struct cvb_coef gm20b_cvb_coef[] = {
29
30 { 1786666, -85625, 1632 },
31 { 1846729, -87525, 1632 },
32 { 1910480, -89425, 1632 },
33 { 1977920, -91325, 1632 },
34 { 2049049, -93215, 1632 },
35 { 2122872, -95095, 1632 },
36 { 2201331, -96985, 1632 },
37 { 2283479, -98885, 1632 },
38 { 2369315, -100785, 1632 },
39 { 2458841, -102685, 1632 },
40 { 2550821, -104555, 1632 },
41 { 2647676, -106455, 1632 },
42 };
43
44 static const struct cvb_coef gm20b_na_cvb_coef[] = {
45
46 { 814294, 8144, -940, 808, -21583, 226 },
47 { 856185, 8144, -940, 808, -21583, 226 },
48 { 898077, 8144, -940, 808, -21583, 226 },
49 { 939968, 8144, -940, 808, -21583, 226 },
50 { 981860, 8144, -940, 808, -21583, 226 },
51 { 1023751, 8144, -940, 808, -21583, 226 },
52 { 1065642, 8144, -940, 808, -21583, 226 },
53 { 1107534, 8144, -940, 808, -21583, 226 },
54 { 1149425, 8144, -940, 808, -21583, 226 },
55 { 1191317, 8144, -940, 808, -21583, 226 },
56 { 1233208, 8144, -940, 808, -21583, 226 },
57 { 1275100, 8144, -940, 808, -21583, 226 },
58 { 1316991, 8144, -940, 808, -21583, 226 },
59 };
60
61 static const u32 speedo_to_vmin[] = {
62
63 950000, 840000, 818750, 840000, 810000,
64 };
65
66 int
67 gm20b_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
68 {
69 struct nvkm_device_tegra *tdev = device->func->tegra(device);
70 struct gk20a_volt *volt;
71 u32 vmin;
72
73 if (tdev->gpu_speedo_id >= ARRAY_SIZE(speedo_to_vmin)) {
74 nvdev_error(device, "unsupported speedo %d\n",
75 tdev->gpu_speedo_id);
76 return -EINVAL;
77 }
78
79 volt = kzalloc(sizeof(*volt), GFP_KERNEL);
80 if (!volt)
81 return -ENOMEM;
82 *pvolt = &volt->base;
83
84 vmin = speedo_to_vmin[tdev->gpu_speedo_id];
85
86 if (tdev->gpu_speedo_id >= 1)
87 return gk20a_volt_ctor(device, index, gm20b_na_cvb_coef,
88 ARRAY_SIZE(gm20b_na_cvb_coef), vmin, volt);
89 else
90 return gk20a_volt_ctor(device, index, gm20b_cvb_coef,
91 ARRAY_SIZE(gm20b_cvb_coef), vmin, volt);
92 }