summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv100/clk_gv100.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gv100/clk_gv100.h')
-rw-r--r--drivers/gpu/nvgpu/gv100/clk_gv100.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv100/clk_gv100.h b/drivers/gpu/nvgpu/gv100/clk_gv100.h
new file mode 100644
index 00000000..d3356a7f
--- /dev/null
+++ b/drivers/gpu/nvgpu/gv100/clk_gv100.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22#ifndef CLK_GV100_H
23#define CLK_GV100_H
24
25#include <nvgpu/lock.h>
26#include "gk20a/gk20a.h"
27
28#define CLK_NAMEMAP_INDEX_GPCCLK 0x00
29#define CLK_NAMEMAP_INDEX_XBARCLK 0x02
30#define CLK_NAMEMAP_INDEX_SYSCLK 0x07 /* SYSPLL */
31#define CLK_NAMEMAP_INDEX_DRAMCLK 0x20 /* DRAMPLL */
32
33#define CLK_DEFAULT_CNTRL_SETTLE_RETRIES 10
34#define CLK_DEFAULT_CNTRL_SETTLE_USECS 5
35#define CLK_MAX_CNTRL_REGISTERS 2
36
37#define XTAL_CNTR_CLKS 27000 /* 1000usec at 27KHz XTAL */
38#define XTAL_CNTR_DELAY 10000 /* we need acuracy up to the 10ms */
39#define XTAL_SCALE_TO_KHZ 1
40#define NUM_NAMEMAPS (3U)
41#define XTAL4X_KHZ 108000
42
43u32 gv100_get_rate_cntr(struct gk20a *g, struct namemap_cfg *c);
44struct namemap_cfg {
45 u32 namemap;
46 u32 is_enable; /* Namemap enabled */
47 u32 is_counter; /* Using cntr */
48 struct gk20a *g;
49 struct {
50 u32 reg_ctrl_addr;
51 u32 reg_ctrl_idx;
52 u32 reg_cntr_addr[CLK_MAX_CNTRL_REGISTERS];
53 } cntr;
54 u32 scale;
55 char name[24];
56};
57
58int gv100_init_clk_support(struct gk20a *g);
59u32 gv100_crystal_clk_hz(struct gk20a *g);
60unsigned long gv100_clk_measure_freq(struct gk20a *g, u32 api_domain);
61int gv100_suspend_clk_support(struct gk20a *g);
62
63#endif /* CLK_GV100_H */