summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJon Hunter <jonathanh@nvidia.com>2015-04-17 01:58:59 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-07-31 09:17:19 -0400
commitb241f27b5d324585fc52797c1283dde650aa520d (patch)
tree82491ca4dbdba61cb9c7f1ee93518881c8629348 /include/linux
parentaf99d6491702dc8fd53690680e269433a5019719 (diff)
soc/tegra: Update Tegra Processor Power Model (PPM)
Update the Tegra Processor Power Model for Linux v4.4. This is based upon the following work by Wei Ni <wni@nvidia.com>: Reviewed-on: https://chromium-review.googlesource.com/269914 Reviewed-on: https://chromium-review.googlesource.com/283720 Bug 1811732 Change-Id: I9a847cccee322853096093b1ad5110bc4650f3f2 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: http://git-master/r/1255679 GVS: Gerrit_Virtual_Submit Reviewed-by: Jon Mayo <jmayo@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1786276 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/tegra_ppm.h81
1 files changed, 0 insertions, 81 deletions
diff --git a/include/linux/tegra_ppm.h b/include/linux/tegra_ppm.h
deleted file mode 100644
index 8e421bcbc..000000000
--- a/include/linux/tegra_ppm.h
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * Copyright (c) 2014, NVIDIA CORPORATION. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __TEGRA_PPM_H
18#define __TEGRA_PPM_H
19
20#include <linux/clk.h>
21#include <linux/fs.h>
22
23struct fv_relation;
24struct fv_relation *fv_relation_create(
25 struct clk *, int, ssize_t, int (*)(struct clk *, long unsigned int));
26void fv_relation_destroy(struct fv_relation *);
27
28#define TEGRA_PPM_MAX_CORES 4
29struct tegra_ppm_params {
30 int n_cores;
31
32 /* activity factor in nA/MHz (aka fF, femtofarads) */
33 u32 dyn_consts_n[TEGRA_PPM_MAX_CORES];
34
35 /* leakage scaling factor based on number of cores. Expressed permill */
36 u32 leakage_consts_n[TEGRA_PPM_MAX_CORES];
37
38 /* Coefficients to a tricubic model of leakage. Model inputs are:
39 * Voltage in Volts
40 * IDDQ in Amps
41 * Temperature in *deciCelcius*
42 *
43 * This unusual choice of units helps with the accuracy of fixed point
44 * calculations by keeping all of the coefficients near the same order
45 * of magnitude.
46 *
47 * All of the coefficients are expressed as ijk_scaled times their true
48 * value so that they fit nicely in 32-bit integers with minimal
49 * quantization error.
50 */
51 s32 leakage_consts_ijk[4][4][4];
52 u32 ijk_scaled;
53
54 u32 leakage_min; /* minimum leakage current */
55};
56
57struct tegra_ppm;
58struct dt;
59
60struct tegra_ppm_params *of_read_tegra_ppm_params(struct device_node *np);
61
62struct tegra_ppm *tegra_ppm_create(const char *name,
63 struct fv_relation *fv,
64 struct tegra_ppm_params *params,
65 int iddq_ma,
66 struct dentry *debugfs_dir);
67void tegra_ppm_destroy(struct tegra_ppm *doomed,
68 struct fv_relation **fv,
69 struct tegra_ppm_params **params);
70
71#define TEGRA_PPM_UNITS_MILLIAMPS 0
72#define TEGRA_PPM_UNITS_MILLIWATTS 1
73
74
75unsigned tegra_ppm_get_maxf(struct tegra_ppm *ctx,
76 unsigned int limit, int units,
77 int temp_c, int cores);
78
79void tegra_ppm_drop_cache(struct tegra_ppm *ctx);
80
81#endif