summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/pci.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-11-14 13:55:05 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-17 16:19:52 -0500
commit23c647f7a0fd4573a21bdb671100bbb2951467ef (patch)
treedd8daa58dc9328ef321a8a5fc78e9bb35a94e691 /drivers/gpu/nvgpu/pci.c
parent60a5bc79be8314bc8c35d5a925bb02e94dd47944 (diff)
gpu: nvgpu: Expose boot freq as max freq for dGPU
On dGPU so far we boot only at maximum GPC2CLK frequency. Expose that as maximum clock rate to user space. Bug 200251486 Change-Id: Ie3463782a0e36028074325ce652c7ef554f6ea2c Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1252907 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pci.c')
-rw-r--r--drivers/gpu/nvgpu/pci.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/pci.c b/drivers/gpu/nvgpu/pci.c
index 3c46f073..c3617789 100644
--- a/drivers/gpu/nvgpu/pci.c
+++ b/drivers/gpu/nvgpu/pci.c
@@ -21,6 +21,7 @@
21#include "nvgpu_common.h" 21#include "nvgpu_common.h"
22#include "gk20a/gk20a.h" 22#include "gk20a/gk20a.h"
23#include "gk20a/platform_gk20a.h" 23#include "gk20a/platform_gk20a.h"
24#include "clk/clk.h"
24 25
25#define PCI_INTERFACE_NAME "card-%s%%s" 26#define PCI_INTERFACE_NAME "card-%s%%s"
26 27
@@ -39,6 +40,16 @@ static bool nvgpu_pci_tegra_is_railgated(struct device *pdev)
39 return false; 40 return false;
40} 41}
41 42
43static long nvgpu_pci_clk_round_rate(struct device *dev, unsigned long rate)
44{
45 long ret = (long)rate;
46
47 if (rate == UINT_MAX)
48 ret = BOOT_GPC2CLK_MHZ * 1000000UL;
49
50 return ret;
51}
52
42static struct gk20a_platform nvgpu_pci_device[] = { 53static struct gk20a_platform nvgpu_pci_device[] = {
43 { /* DEVICE=0x1c35 */ 54 { /* DEVICE=0x1c35 */
44 /* ptimer src frequency in hz */ 55 /* ptimer src frequency in hz */
@@ -57,6 +68,7 @@ static struct gk20a_platform nvgpu_pci_device[] = {
57 68
58 /* power management callbacks */ 69 /* power management callbacks */
59 .is_railgated = nvgpu_pci_tegra_is_railgated, 70 .is_railgated = nvgpu_pci_tegra_is_railgated,
71 .clk_round_rate = nvgpu_pci_clk_round_rate,
60 72
61 .default_big_page_size = SZ_64K, 73 .default_big_page_size = SZ_64K,
62 74
@@ -84,6 +96,7 @@ static struct gk20a_platform nvgpu_pci_device[] = {
84 96
85 /* power management callbacks */ 97 /* power management callbacks */
86 .is_railgated = nvgpu_pci_tegra_is_railgated, 98 .is_railgated = nvgpu_pci_tegra_is_railgated,
99 .clk_round_rate = nvgpu_pci_clk_round_rate,
87 100
88 .default_big_page_size = SZ_64K, 101 .default_big_page_size = SZ_64K,
89 102
@@ -111,6 +124,7 @@ static struct gk20a_platform nvgpu_pci_device[] = {
111 124
112 /* power management callbacks */ 125 /* power management callbacks */
113 .is_railgated = nvgpu_pci_tegra_is_railgated, 126 .is_railgated = nvgpu_pci_tegra_is_railgated,
127 .clk_round_rate = nvgpu_pci_clk_round_rate,
114 128
115 .default_big_page_size = SZ_64K, 129 .default_big_page_size = SZ_64K,
116 130