summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-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