From 2a2c16af5f9f1ccfc93a13e820d5381e5c881e92 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 18 Apr 2018 12:59:00 -0700 Subject: gpu: nvgpu: Move Linux files away from common Move all Linux source code files to drivers/gpu/nvgpu/os/linux from drivers/gpu/nvgpu/common/linux. This changes the meaning of common to be OS independent. JIRA NVGPU-598 JIRA NVGPU-601 Change-Id: Ib7f2a43d3688bb0d0b7dcc48469a6783fd988ce9 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1747714 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/nvlink.c | 106 -------------------------------- 1 file changed, 106 deletions(-) delete mode 100644 drivers/gpu/nvgpu/common/linux/nvlink.c (limited to 'drivers/gpu/nvgpu/common/linux/nvlink.c') diff --git a/drivers/gpu/nvgpu/common/linux/nvlink.c b/drivers/gpu/nvgpu/common/linux/nvlink.c deleted file mode 100644 index c93514c0..00000000 --- a/drivers/gpu/nvgpu/common/linux/nvlink.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include -#include -#include "module.h" - -#ifdef CONFIG_TEGRA_NVLINK -int nvgpu_nvlink_read_dt_props(struct gk20a *g) -{ - struct device_node *np; - struct nvlink_device *ndev = g->nvlink.priv; - u32 local_dev_id; - u32 local_link_id; - u32 remote_dev_id; - u32 remote_link_id; - bool is_master; - - /* Parse DT */ - np = nvgpu_get_node(g); - if (!np) - goto fail; - - np = of_get_child_by_name(np, "nvidia,nvlink"); - if (!np) - goto fail; - - np = of_get_child_by_name(np, "endpoint"); - if (!np) - goto fail; - - /* Parse DT structure to detect endpoint topology */ - of_property_read_u32(np, "local_dev_id", &local_dev_id); - of_property_read_u32(np, "local_link_id", &local_link_id); - of_property_read_u32(np, "remote_dev_id", &remote_dev_id); - of_property_read_u32(np, "remote_link_id", &remote_link_id); - is_master = of_property_read_bool(np, "is_master"); - - /* Check that we are in dGPU mode */ - if (local_dev_id != NVLINK_ENDPT_GV100) { - nvgpu_err(g, "Local nvlink device is not dGPU"); - return -EINVAL; - } - - ndev->is_master = is_master; - ndev->device_id = local_dev_id; - ndev->link.link_id = local_link_id; - ndev->link.remote_dev_info.device_id = remote_dev_id; - ndev->link.remote_dev_info.link_id = remote_link_id; - - return 0; - -fail: - nvgpu_info(g, "nvlink endpoint not found or invaling in DT"); - return -ENODEV; -} -#endif /* CONFIG_TEGRA_NVLINK */ - -void nvgpu_mss_nvlink_init_credits(struct gk20a *g) -{ - /* MSS_NVLINK_1_BASE */ - void __iomem *soc1 = ioremap(0x01f20010, 4096); - /* MSS_NVLINK_2_BASE */ - void __iomem *soc2 = ioremap(0x01f40010, 4096); - /* MSS_NVLINK_3_BASE */ - void __iomem *soc3 = ioremap(0x01f60010, 4096); - /* MSS_NVLINK_4_BASE */ - void __iomem *soc4 = ioremap(0x01f80010, 4096); - u32 val; - - nvgpu_log(g, gpu_dbg_info, "init nvlink soc credits"); - - val = readl_relaxed(soc1); - writel_relaxed(val, soc1); - val = readl_relaxed(soc1 + 4); - writel_relaxed(val, soc1 + 4); - - val = readl_relaxed(soc2); - writel_relaxed(val, soc2); - val = readl_relaxed(soc2 + 4); - writel_relaxed(val, soc2 + 4); - - val = readl_relaxed(soc3); - writel_relaxed(val, soc3); - val = readl_relaxed(soc3 + 4); - writel_relaxed(val, soc3 + 4); - - val = readl_relaxed(soc4); - writel_relaxed(val, soc4); - val = readl_relaxed(soc4 + 4); - writel_relaxed(val, soc4 + 4); -} -- cgit v1.2.2