diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gv100/nvlink_gv100.h')
-rw-r--r-- | drivers/gpu/nvgpu/gv100/nvlink_gv100.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv100/nvlink_gv100.h b/drivers/gpu/nvgpu/gv100/nvlink_gv100.h new file mode 100644 index 00000000..4ac8b907 --- /dev/null +++ b/drivers/gpu/nvgpu/gv100/nvlink_gv100.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Copyright (c) 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 | |||
23 | #ifndef NVGPU_NVLINK_GV100_H | ||
24 | #define NVGPU_NVLINK_GV100_H | ||
25 | |||
26 | struct gk20a; | ||
27 | |||
28 | #define MINION_REG_RD32(g, off) gk20a_readl(g, g->nvlink.minion_base + (off)) | ||
29 | #define MINION_REG_WR32(g, off, v) gk20a_writel(g, g->nvlink.minion_base + (off), (v)) | ||
30 | #define IOCTRL_REG_RD32(g, off) gk20a_readl(g, g->nvlink.ioctrl_base + (off)) | ||
31 | #define IOCTRL_REG_WR32(g, off, v) gk20a_writel(g, g->nvlink.ioctrl_base + (off), (v)); | ||
32 | #define MIF_REG_RD32(g, id, off) gk20a_readl(g, g->nvlink.links[(id)].mif_base + (off)) | ||
33 | #define MIF_REG_WR32(g, id, off, v) gk20a_writel(g, g->nvlink.links[(id)].mif_base + (off), (v)) | ||
34 | #define IPT_REG_RD32(g, off) gk20a_readl(g, g->nvlink.ipt_base + (off)) | ||
35 | #define IPT_REG_WR32(g, off, v) gk20a_writel(g, g->nvlink.ipt_base + (off), (v)) | ||
36 | #define TLC_REG_RD32(g, id, off) gk20a_readl(g, g->nvlink.links[(id)].tl_base + (off)) | ||
37 | #define TLC_REG_WR32(g, id, off, v) gk20a_writel(g, g->nvlink.links[(id)].tl_base + (off), (v)) | ||
38 | #define DLPL_REG_RD32(g, id, off) gk20a_readl(g, g->nvlink.links[(id)].dlpl_base + (off)) | ||
39 | #define DLPL_REG_WR32(g, id, off, v) gk20a_writel(g, g->nvlink.links[(id)].dlpl_base + (off), (v)) | ||
40 | |||
41 | int gv100_nvlink_discover_ioctrl(struct gk20a *g); | ||
42 | int gv100_nvlink_discover_link(struct gk20a *g); | ||
43 | int gv100_nvlink_init(struct gk20a *g); | ||
44 | int gv100_nvlink_isr(struct gk20a *g); | ||
45 | /* API */ | ||
46 | int gv100_nvlink_link_early_init(struct gk20a *g, unsigned long mask); | ||
47 | u32 gv100_nvlink_link_get_mode(struct gk20a *g, u32 link_id); | ||
48 | u32 gv100_nvlink_link_get_state(struct gk20a *g, u32 link_id); | ||
49 | int gv100_nvlink_link_set_mode(struct gk20a *g, u32 link_id, u32 mode); | ||
50 | u32 gv100_nvlink_link_get_sublink_mode(struct gk20a *g, u32 link_id, | ||
51 | bool is_rx_sublink); | ||
52 | u32 gv100_nvlink_link_get_tx_sublink_state(struct gk20a *g, u32 link_id); | ||
53 | u32 gv100_nvlink_link_get_rx_sublink_state(struct gk20a *g, u32 link_id); | ||
54 | int gv100_nvlink_link_set_sublink_mode(struct gk20a *g, u32 link_id, | ||
55 | bool is_rx_sublink, u32 mode); | ||
56 | int gv100_nvlink_interface_init(struct gk20a *g); | ||
57 | int gv100_nvlink_reg_init(struct gk20a *g); | ||
58 | int gv100_nvlink_shutdown(struct gk20a *g); | ||
59 | int gv100_nvlink_early_init(struct gk20a *g); | ||
60 | #endif | ||