diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/clk.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/platform_gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c | 8 |
3 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/clk.c b/drivers/gpu/nvgpu/common/linux/clk.c index a0e56455..414b17c4 100644 --- a/drivers/gpu/nvgpu/common/linux/clk.c +++ b/drivers/gpu/nvgpu/common/linux/clk.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | 20 | ||
21 | #include <soc/tegra/tegra-dvfs.h> | 21 | #include <soc/tegra/tegra-dvfs.h> |
22 | #include <soc/tegra/tegra-bpmp-dvfs.h> | ||
22 | 23 | ||
23 | #include "clk.h" | 24 | #include "clk.h" |
24 | #include "os_linux.h" | 25 | #include "os_linux.h" |
@@ -86,6 +87,8 @@ static int nvgpu_linux_clk_set_rate(struct gk20a *g, | |||
86 | 87 | ||
87 | static unsigned long nvgpu_linux_get_fmax_at_vmin_safe(struct gk20a *g) | 88 | static unsigned long nvgpu_linux_get_fmax_at_vmin_safe(struct gk20a *g) |
88 | { | 89 | { |
90 | struct gk20a_platform *platform = gk20a_get_platform(dev_from_gk20a(g)); | ||
91 | |||
89 | /* | 92 | /* |
90 | * On Tegra platforms with GPCPLL bus (gbus) GPU tegra_clk clock exposed | 93 | * On Tegra platforms with GPCPLL bus (gbus) GPU tegra_clk clock exposed |
91 | * to frequency governor is a shared user on the gbus. The latter can be | 94 | * to frequency governor is a shared user on the gbus. The latter can be |
@@ -95,6 +98,10 @@ static unsigned long nvgpu_linux_get_fmax_at_vmin_safe(struct gk20a *g) | |||
95 | return tegra_dvfs_get_fmax_at_vmin_safe_t( | 98 | return tegra_dvfs_get_fmax_at_vmin_safe_t( |
96 | clk_get_parent(g->clk.tegra_clk)); | 99 | clk_get_parent(g->clk.tegra_clk)); |
97 | 100 | ||
101 | if (platform->maxmin_clk_id) | ||
102 | return tegra_bpmp_dvfs_get_fmax_at_vmin( | ||
103 | platform->maxmin_clk_id); | ||
104 | |||
98 | return 0; | 105 | return 0; |
99 | } | 106 | } |
100 | 107 | ||
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a.h b/drivers/gpu/nvgpu/common/linux/platform_gk20a.h index dec79b87..cdb221eb 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gk20a.h +++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a.h | |||
@@ -65,6 +65,7 @@ struct gk20a_platform { | |||
65 | * for filling this data. */ | 65 | * for filling this data. */ |
66 | struct clk *clk[GK20A_CLKS_MAX]; | 66 | struct clk *clk[GK20A_CLKS_MAX]; |
67 | int num_clks; | 67 | int num_clks; |
68 | int maxmin_clk_id; | ||
68 | 69 | ||
69 | #ifdef CONFIG_RESET_CONTROLLER | 70 | #ifdef CONFIG_RESET_CONTROLLER |
70 | /* Reset control for device */ | 71 | /* Reset control for device */ |
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c index 08c5df0f..df10e36c 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include <soc/tegra/tegra_bpmp.h> | 25 | #include <soc/tegra/tegra_bpmp.h> |
26 | #include <soc/tegra/tegra_powergate.h> | 26 | #include <soc/tegra/tegra_powergate.h> |
27 | #include <soc/tegra/tegra-bpmp-dvfs.h> | ||
27 | 28 | ||
28 | #include <dt-bindings/memory/tegra-swgroup.h> | 29 | #include <dt-bindings/memory/tegra-swgroup.h> |
29 | 30 | ||
@@ -98,6 +99,13 @@ int gp10b_tegra_get_clocks(struct device *dev) | |||
98 | } | 99 | } |
99 | platform->num_clks = i; | 100 | platform->num_clks = i; |
100 | 101 | ||
102 | if (platform->clk[0]) { | ||
103 | i = tegra_bpmp_dvfs_get_clk_id(dev->of_node, | ||
104 | tegra_gp10b_clocks[0].name); | ||
105 | if (i > 0) | ||
106 | platform->maxmin_clk_id = i; | ||
107 | } | ||
108 | |||
101 | return 0; | 109 | return 0; |
102 | } | 110 | } |
103 | 111 | ||