From 703d00d730d230f9ac9970e7d2d22a7d8f0cd2d1 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Mon, 16 Apr 2018 16:52:08 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1698686 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/linux/nvlink.h | 31 ++++++++++++++++++++++++++ drivers/gpu/nvgpu/include/nvgpu/nvlink.h | 11 +++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/nvgpu/include/nvgpu/linux/nvlink.h (limited to 'drivers/gpu/nvgpu/include') 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 @@ +/* + * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef __NVGPU_LINUX_NVLINK_H__ +#define __NVGPU_LINUX_NVLINK_H__ + +#ifdef CONFIG_TEGRA_NVLINK +#include +#include +#endif + +#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 @@ #include +#ifdef __KERNEL__ +#include +#else +#include +#endif + struct gk20a; struct nvgpu_nvlink_ioctrl_list { @@ -207,11 +213,12 @@ struct nvgpu_nvlink_dev { void *priv; }; - int nvgpu_nvlink_enumerate(struct gk20a *g); int nvgpu_nvlink_train(struct gk20a *g, u32 link_id, bool from_off); +int nvgpu_nvlink_read_dt_props(struct gk20a *g); + int nvgpu_nvlink_probe(struct gk20a *g); void nvgpu_mss_nvlink_init_credits(struct gk20a *g); -#endif +#endif /* __NVGPU_NVLINK_H__ */ -- cgit v1.2.2