summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2018-04-16 19:52:08 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-09 16:25:18 -0400
commit703d00d730d230f9ac9970e7d2d22a7d8f0cd2d1 (patch)
tree2dec0fb4b51b79d0d6f4f1b19e9f3cbd71ba1d85 /drivers/gpu/nvgpu/include
parentf9e55fbaf66c024125a19e1a773a1a4f0e9648f4 (diff)
gpu: nvgpu: nvlink endpoint ops to common code
Move nvlink endpoint operations to common code. These operations are invoked when handling nvlink core driver requests. Jira VQRM-3523 Change-Id: I93024bf88a8caa3765b33c1264dde452c1a85ee3 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1698686 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/nvlink.h31
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/nvlink.h11
2 files changed, 40 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/nvlink.h b/drivers/gpu/nvgpu/include/nvgpu/linux/nvlink.h
new file mode 100644
index 00000000..550a897a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/nvlink.h
@@ -0,0 +1,31 @@
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_LINUX_NVLINK_H__
24#define __NVGPU_LINUX_NVLINK_H__
25
26#ifdef CONFIG_TEGRA_NVLINK
27#include <linux/mutex.h>
28#include <linux/platform/tegra/tegra-nvlink.h>
29#endif
30
31#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvlink.h b/drivers/gpu/nvgpu/include/nvgpu/nvlink.h
index dfa3be3f..00f0eda9 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/nvlink.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/nvlink.h
@@ -25,6 +25,12 @@
25 25
26#include <nvgpu/types.h> 26#include <nvgpu/types.h>
27 27
28#ifdef __KERNEL__
29#include <nvgpu/linux/nvlink.h>
30#else
31#include <nvgpu_rmos/include/nvlink.h>
32#endif
33
28struct gk20a; 34struct gk20a;
29 35
30struct nvgpu_nvlink_ioctrl_list { 36struct nvgpu_nvlink_ioctrl_list {
@@ -207,11 +213,12 @@ struct nvgpu_nvlink_dev {
207 void *priv; 213 void *priv;
208}; 214};
209 215
210
211int nvgpu_nvlink_enumerate(struct gk20a *g); 216int nvgpu_nvlink_enumerate(struct gk20a *g);
212int nvgpu_nvlink_train(struct gk20a *g, u32 link_id, bool from_off); 217int nvgpu_nvlink_train(struct gk20a *g, u32 link_id, bool from_off);
218int nvgpu_nvlink_read_dt_props(struct gk20a *g);
219
213int nvgpu_nvlink_probe(struct gk20a *g); 220int nvgpu_nvlink_probe(struct gk20a *g);
214 221
215void nvgpu_mss_nvlink_init_credits(struct gk20a *g); 222void nvgpu_mss_nvlink_init_credits(struct gk20a *g);
216 223
217#endif 224#endif /* __NVGPU_NVLINK_H__ */