summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-04-19 17:09:05 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-27 06:57:13 -0400
commit8b3d94ffd3e5b6d7a622c6ad54692d79bf39d1ce (patch)
treefb8648cd40e99892e18e28de8e8851915a0ac0b9 /drivers/gpu/nvgpu/gp10b
parent52445fba1feac3ee20bf1c3db149adc42715af9e (diff)
gpu: nvgpu: Move sysfs dependencies from HAL to Linux
Move sysfs dependencies from gk20a/ and gp10b/ to common/linux. At the same time the gk20a and gp10b variants are merged into one. JIRA NVGPU-48 Change-Id: I212be8f1beb8d20a57de04a57513e8fa0e2e83b4 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master/r/1466055 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r--drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c68
-rw-r--r--drivers/gpu/nvgpu/gp10b/gp10b_sysfs.h22
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c3
-rw-r--r--drivers/gpu/nvgpu/gp10b/pmu_gp10b.c1
4 files changed, 2 insertions, 92 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c b/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c
deleted file mode 100644
index 1c90d2f9..00000000
--- a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * GP10B specific sysfs files
3 *
4 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#include <linux/platform_device.h>
17
18#include "gk20a/gk20a.h"
19#include "gk20a/platform_gk20a.h"
20#include "gp10b_sysfs.h"
21
22#include <nvgpu/hw/gp10b/hw_gr_gp10b.h>
23
24#define ROOTRW (S_IRWXU|S_IRGRP|S_IROTH)
25
26static ssize_t czf_bypass_store(struct device *dev,
27 struct device_attribute *attr, const char *buf, size_t count)
28{
29 struct gk20a *g = get_gk20a(dev);
30 unsigned long val;
31
32 if (kstrtoul(buf, 10, &val) < 0)
33 return -EINVAL;
34
35 if (val >= 4)
36 return -EINVAL;
37
38 g->gr.czf_bypass = val;
39
40 return count;
41}
42
43static ssize_t czf_bypass_read(struct device *dev,
44 struct device_attribute *attr, char *buf)
45{
46 struct gk20a *g = get_gk20a(dev);
47
48 return sprintf(buf, "%d\n", g->gr.czf_bypass);
49}
50
51static DEVICE_ATTR(czf_bypass, ROOTRW, czf_bypass_read, czf_bypass_store);
52
53void gp10b_create_sysfs(struct device *dev)
54{
55 struct gk20a *g = get_gk20a(dev);
56 int error = 0;
57
58 g->gr.czf_bypass = gr_gpc0_prop_debug1_czf_bypass_init_v();
59
60 error |= device_create_file(dev, &dev_attr_czf_bypass);
61 if (error)
62 nvgpu_err(g, "Failed to create sysfs attributes!");
63}
64
65void gp10b_remove_sysfs(struct device *dev)
66{
67 device_remove_file(dev, &dev_attr_czf_bypass);
68}
diff --git a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.h b/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.h
deleted file mode 100644
index f56ccfc7..00000000
--- a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * GP10B specific sysfs files
3 *
4 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef _GP10B_SYSFS_H_
17#define _GP10B_SYSFS_H_
18
19void gp10b_create_sysfs(struct device *dev);
20void gp10b_remove_sysfs(struct device *dev);
21
22#endif /*_GP10B_SYSFS_H_*/
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index 3bddef4c..f27e2605 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -31,7 +31,6 @@
31 31
32#include "gm20b/gr_gm20b.h" 32#include "gm20b/gr_gm20b.h"
33#include "gp10b/gr_gp10b.h" 33#include "gp10b/gr_gp10b.h"
34#include "gp10b_sysfs.h"
35 34
36#include <nvgpu/hw/gp10b/hw_gr_gp10b.h> 35#include <nvgpu/hw/gp10b/hw_gr_gp10b.h>
37#include <nvgpu/hw/gp10b/hw_fifo_gp10b.h> 36#include <nvgpu/hw/gp10b/hw_fifo_gp10b.h>
@@ -2292,6 +2291,8 @@ static int gr_gp10b_init_preemption_state(struct gk20a *g)
2292 gr_debug_2_gfxp_wfi_always_injects_wfi_enabled_f()); 2291 gr_debug_2_gfxp_wfi_always_injects_wfi_enabled_f());
2293 gk20a_writel(g, gr_debug_2_r(), debug_2); 2292 gk20a_writel(g, gr_debug_2_r(), debug_2);
2294 2293
2294 g->gr.czf_bypass = gr_gpc0_prop_debug1_czf_bypass_init_v();
2295
2295 return 0; 2296 return 0;
2296} 2297}
2297 2298
diff --git a/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c b/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c
index 58844e8f..a113d22e 100644
--- a/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/pmu_gp10b.c
@@ -23,7 +23,6 @@
23#include "gm20b/pmu_gm20b.h" 23#include "gm20b/pmu_gm20b.h"
24 24
25#include "pmu_gp10b.h" 25#include "pmu_gp10b.h"
26#include "gp10b_sysfs.h"
27 26
28#include <nvgpu/hw/gp10b/hw_pwr_gp10b.h> 27#include <nvgpu/hw/gp10b/hw_pwr_gp10b.h>
29#include <nvgpu/hw/gp10b/hw_fuse_gp10b.h> 28#include <nvgpu/hw/gp10b/hw_fuse_gp10b.h>