summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Adams <kadams@nvidia.com>2014-10-01 11:27:17 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:52:02 -0500
commit16c511220ecda4a0220976f649fddabcfbee86e0 (patch)
tree4b5bcafa5823df54ee08587b72f9a126e853e6c0
parent07b7a534fa8d5e93420521fcb5e745acad386f00 (diff)
gpu: nvgpu: t18x, gp10b framework
This change adds gp10b to the nvgpu build as well as enabling CMA for buffer allocation. Change-Id: Id3d45ad6ffdab14120395952e68b285dd7364c76 Signed-off-by: Ken Adams <kadams@nvidia.com> Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/553324 GVS: Gerrit_Virtual_Submit
-rw-r--r--drivers/gpu/nvgpu/Makefile10
-rw-r--r--drivers/gpu/nvgpu/gp10b/Makefile13
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c54
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.h31
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_ops_gp10b.h28
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c98
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.h21
-rw-r--r--drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h30
-rw-r--r--include/uapi/linux/nvgpu-t18x.h32
9 files changed, 317 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile
new file mode 100644
index 00000000..c583f6d5
--- /dev/null
+++ b/drivers/gpu/nvgpu/Makefile
@@ -0,0 +1,10 @@
1GCOV_PROFILE := y
2
3ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel/drivers/gpu/nvgpu
4ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel/include/linux
5ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/include
6ccflags-$(CONFIG_GK20A) += -Wno-multichar
7ccflags-$(CONFIG_GK20A) += -Werror
8
9obj-$(CONFIG_GK20A) += gp10b/
10
diff --git a/drivers/gpu/nvgpu/gp10b/Makefile b/drivers/gpu/nvgpu/gp10b/Makefile
new file mode 100644
index 00000000..64cd4179
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/Makefile
@@ -0,0 +1,13 @@
1GCOV_PROFILE := y
2
3ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel/drivers/gpu/nvgpu
4ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel/include
5ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/drivers/gpu/nvgpu
6ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/include
7ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/include/uapi
8
9ccflags-$(CONFIG_GK20A) += -Wno-multichar
10
11obj-$(CONFIG_GK20A) += \
12 gr_gp10b.o \
13 hal_gp10b.o
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
new file mode 100644
index 00000000..f4a63fad
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -0,0 +1,54 @@
1/*
2 * GP10B GPU GR
3 *
4 * Copyright (c) 2014, 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 "gk20a/gk20a.h" /* FERMI and MAXWELL classes defined here */
17
18#include "gk20a/gr_gk20a.h"
19
20#include "gm20b/gr_gm20b.h" /* for MAXWELL classes */
21#include "gp10b/gr_gp10b.h"
22
23
24bool gr_gp10b_is_valid_class(struct gk20a *g, u32 class_num)
25{
26 bool valid = false;
27
28 switch (class_num) {
29 case PASCAL_COMPUTE_A:
30 case PASCAL_A:
31 case PASCAL_DMA_COPY_A:
32 valid = true;
33 break;
34
35 case MAXWELL_COMPUTE_B:
36 case MAXWELL_B:
37 case FERMI_TWOD_A:
38 case KEPLER_DMA_COPY_A:
39 case MAXWELL_DMA_COPY_A:
40 valid = true;
41 break;
42
43 default:
44 break;
45 }
46 gk20a_dbg_info("class=0x%x valid=%d", class_num, valid);
47 return valid;
48}
49
50void gp10b_init_gr(struct gpu_ops *gops)
51{
52 gm20b_init_gr(gops);
53 gops->gr.is_valid_class = gr_gp10b_is_valid_class;
54}
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
new file mode 100644
index 00000000..58616deb
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h
@@ -0,0 +1,31 @@
1/*
2 * GM20B GPU GR
3 *
4 * Copyright (c) 2014, 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 _NVGPU_GR_GP10B_H_
17#define _NVGPU_GR_GP10B_H_
18
19struct gk20a;
20
21enum {
22 PASCAL_CHANNEL_GPFIFO_A = 0xC06F,
23 PASCAL_A = 0xC097,
24 PASCAL_COMPUTE_A = 0xC0C0,
25 PASCAL_DMA_COPY_A = 0xC0B5,
26};
27
28void gp10b_init_gr(struct gpu_ops *ops);
29
30
31#endif
diff --git a/drivers/gpu/nvgpu/gp10b/gr_ops_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_ops_gp10b.h
new file mode 100644
index 00000000..c3277017
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/gr_ops_gp10b.h
@@ -0,0 +1,28 @@
1/*
2 * GP10B GPU graphics ops
3 *
4 * Copyright (c) 2014, 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 _GR_OPS_GP10B_H_
17#define _GR_OPS_GP10B_H_
18
19#include "gr_ops.h"
20
21#define __gr_gp10b_op(X) gr_gp10b_ ## X
22#define __set_gr_gp10b_op(X) . X = gr_gp10b_ ## X
23
24bool __gr_gp10b_op(is_valid_class)(struct gk20a *, u32);
25int __gr_gp10b_op(alloc_obj_ctx)(struct channel_gk20a *, struct nvgpu_alloc_obj_ctx_args *);
26
27
28#endif
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
new file mode 100644
index 00000000..61bae5c7
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -0,0 +1,98 @@
1/*
2 * GP10B Tegra HAL interface
3 *
4 * Copyright (c) 2014, 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/types.h>
17#include <linux/printk.h>
18
19#include <linux/types.h>
20
21#include "gk20a/gk20a.h"
22
23#include "gp10b/gr_gp10b.h"
24
25#include "gm20b/ltc_gm20b.h"
26#include "gm20b/fb_gm20b.h"
27#include "gm20b/gm20b_gating_reglist.h"
28#include "gm20b/fifo_gm20b.h"
29#include "gm20b/gr_ctx_gm20b.h"
30#include "gm20b/mm_gm20b.h"
31#include "gm20b/pmu_gm20b.h"
32#include "gm20b/clk_gm20b.h"
33
34struct gpu_ops gp10b_ops = {
35 .clock_gating = {
36 .slcg_bus_load_gating_prod =
37 gm20b_slcg_bus_load_gating_prod,
38 .slcg_ce2_load_gating_prod =
39 gm20b_slcg_ce2_load_gating_prod,
40 .slcg_chiplet_load_gating_prod =
41 gm20b_slcg_chiplet_load_gating_prod,
42 .slcg_ctxsw_firmware_load_gating_prod =
43 gm20b_slcg_ctxsw_firmware_load_gating_prod,
44 .slcg_fb_load_gating_prod =
45 gm20b_slcg_fb_load_gating_prod,
46 .slcg_fifo_load_gating_prod =
47 gm20b_slcg_fifo_load_gating_prod,
48 .slcg_gr_load_gating_prod =
49 gr_gm20b_slcg_gr_load_gating_prod,
50 .slcg_ltc_load_gating_prod =
51 ltc_gm20b_slcg_ltc_load_gating_prod,
52 .slcg_perf_load_gating_prod =
53 gm20b_slcg_perf_load_gating_prod,
54 .slcg_priring_load_gating_prod =
55 gm20b_slcg_priring_load_gating_prod,
56 .slcg_pmu_load_gating_prod =
57 gm20b_slcg_pmu_load_gating_prod,
58 .slcg_therm_load_gating_prod =
59 gm20b_slcg_therm_load_gating_prod,
60 .slcg_xbar_load_gating_prod =
61 gm20b_slcg_xbar_load_gating_prod,
62 .blcg_bus_load_gating_prod =
63 gm20b_blcg_bus_load_gating_prod,
64 .blcg_ctxsw_firmware_load_gating_prod =
65 gm20b_blcg_ctxsw_firmware_load_gating_prod,
66 .blcg_fb_load_gating_prod =
67 gm20b_blcg_fb_load_gating_prod,
68 .blcg_fifo_load_gating_prod =
69 gm20b_blcg_fifo_load_gating_prod,
70 .blcg_gr_load_gating_prod =
71 gm20b_blcg_gr_load_gating_prod,
72 .blcg_ltc_load_gating_prod =
73 gm20b_blcg_ltc_load_gating_prod,
74 .blcg_pwr_csb_load_gating_prod =
75 gm20b_blcg_pwr_csb_load_gating_prod,
76 .blcg_pmu_load_gating_prod =
77 gm20b_blcg_pmu_load_gating_prod,
78 .pg_gr_load_gating_prod =
79 gr_gm20b_pg_gr_load_gating_prod,
80 }
81};
82
83int gp10b_init_hal(struct gpu_ops *gops)
84{
85 *gops = gp10b_ops;
86 gm20b_init_ltc(gops);
87 gp10b_init_gr(gops);
88 gm20b_init_ltc(gops);
89 gm20b_init_fb(gops);
90 gm20b_init_fifo(gops);
91 gm20b_init_gr_ctx(gops);
92 gm20b_init_mm(gops);
93 gm20b_init_pmu_ops(gops);
94 gm20b_init_clk_ops(gops);
95 gops->name = "gp10b";
96
97 return 0;
98}
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.h b/drivers/gpu/nvgpu/gp10b/hal_gp10b.h
new file mode 100644
index 00000000..78615ed1
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.h
@@ -0,0 +1,21 @@
1/*
2 * GP10B Tegra HAL interface
3 *
4 * Copyright (c) 2014, 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 _NVGPU_HAL_GP10B_H
17#define _NVGPU_HAL_GP10B_H
18struct gpu_ops;
19
20int gp10b_init_hal(struct gpu_ops *gops);
21#endif
diff --git a/drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h b/drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h
new file mode 100644
index 00000000..fe027fb0
--- /dev/null
+++ b/drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h
@@ -0,0 +1,30 @@
1/*
2 * NVIDIA GPU ID functions, definitions.
3 *
4 * Copyright (c) 2014, 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#ifndef _NVGPU_GPUID_T18X_H_
16#define _NVGPU_GPUID_T18X_H_
17
18#define NVGPU_GPUID_GP10B \
19 GK20A_GPUID(NVGPU_GPU_ARCH_GP100, NVGPU_GPU_IMPL_GP10B)
20
21#define NVGPU_COMPAT_TEGRA_GP10B "nvidia,tegra186-gp10b"
22#define NVGPU_COMPAT_GENERIC_GP10B "nvidia,generic-gp10b"
23
24#define TEGRA_18x_GPUID NVGPU_GPUID_GP10B
25#define TEGRA_18x_GPUID_HAL gp10b_init_hal
26#define TEGRA_18x_GPU_COMPAT_TEGRA NVGPU_COMPAT_TEGRA_GP10B
27#define TEGRA_18x_GPU_COMPAT_GENERIC NVGPU_COMPAT_GENERIC_GP10B
28struct gpu_ops;
29extern int gp10b_init_hal(struct gpu_ops *);
30#endif
diff --git a/include/uapi/linux/nvgpu-t18x.h b/include/uapi/linux/nvgpu-t18x.h
new file mode 100644
index 00000000..3ec0544a
--- /dev/null
+++ b/include/uapi/linux/nvgpu-t18x.h
@@ -0,0 +1,32 @@
1/*
2 * NVGPU Public Interface Header
3 *
4 * Copyright (c) 2011-2014, 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/* This file is meant to extend nvgpu.h, not replace it
17 * as such, be sure that nvgpu.h is actually the file performing the
18 * inclusion, to the extent that's possible.
19 */
20#ifndef _UAPI__LINUX_NVGPU_IOCTL_H
21# error "This file is to be included within nvgpu.h only."
22#endif
23
24#ifndef _UAPI__LINUX_NVGPU_T18X_IOCTL_H_
25#define _UAPI__LINUX_NVGPU_T18X_IOCTL_H_
26
27#define NVGPU_GPU_ARCH_GP100 0x00000130
28#define NVGPU_GPU_IMPL_GP10B 0x0000000B
29
30#endif /* _UAPI__LINUX_NVGPU_T18X_IOCTL_H_ */
31
32