0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #include "priv.h"
0024 #include "gk20a.h"
0025
0026 #include <core/tegra.h>
0027
0028 static const struct cvb_coef gm20b_cvb_coef[] = {
0029
0030 { 1786666, -85625, 1632 },
0031 { 1846729, -87525, 1632 },
0032 { 1910480, -89425, 1632 },
0033 { 1977920, -91325, 1632 },
0034 { 2049049, -93215, 1632 },
0035 { 2122872, -95095, 1632 },
0036 { 2201331, -96985, 1632 },
0037 { 2283479, -98885, 1632 },
0038 { 2369315, -100785, 1632 },
0039 { 2458841, -102685, 1632 },
0040 { 2550821, -104555, 1632 },
0041 { 2647676, -106455, 1632 },
0042 };
0043
0044 static const struct cvb_coef gm20b_na_cvb_coef[] = {
0045
0046 { 814294, 8144, -940, 808, -21583, 226 },
0047 { 856185, 8144, -940, 808, -21583, 226 },
0048 { 898077, 8144, -940, 808, -21583, 226 },
0049 { 939968, 8144, -940, 808, -21583, 226 },
0050 { 981860, 8144, -940, 808, -21583, 226 },
0051 { 1023751, 8144, -940, 808, -21583, 226 },
0052 { 1065642, 8144, -940, 808, -21583, 226 },
0053 { 1107534, 8144, -940, 808, -21583, 226 },
0054 { 1149425, 8144, -940, 808, -21583, 226 },
0055 { 1191317, 8144, -940, 808, -21583, 226 },
0056 { 1233208, 8144, -940, 808, -21583, 226 },
0057 { 1275100, 8144, -940, 808, -21583, 226 },
0058 { 1316991, 8144, -940, 808, -21583, 226 },
0059 };
0060
0061 static const u32 speedo_to_vmin[] = {
0062
0063 950000, 840000, 818750, 840000, 810000,
0064 };
0065
0066 int
0067 gm20b_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
0068 struct nvkm_volt **pvolt)
0069 {
0070 struct nvkm_device_tegra *tdev = device->func->tegra(device);
0071 struct gk20a_volt *volt;
0072 u32 vmin;
0073
0074 if (tdev->gpu_speedo_id >= ARRAY_SIZE(speedo_to_vmin)) {
0075 nvdev_error(device, "unsupported speedo %d\n",
0076 tdev->gpu_speedo_id);
0077 return -EINVAL;
0078 }
0079
0080 volt = kzalloc(sizeof(*volt), GFP_KERNEL);
0081 if (!volt)
0082 return -ENOMEM;
0083 *pvolt = &volt->base;
0084
0085 vmin = speedo_to_vmin[tdev->gpu_speedo_id];
0086
0087 if (tdev->gpu_speedo_id >= 1)
0088 return gk20a_volt_ctor(device, type, inst, gm20b_na_cvb_coef,
0089 ARRAY_SIZE(gm20b_na_cvb_coef), vmin, volt);
0090 else
0091 return gk20a_volt_ctor(device, type, inst, gm20b_cvb_coef,
0092 ARRAY_SIZE(gm20b_cvb_coef), vmin, volt);
0093 }