diff options
Diffstat (limited to 'include/os/linux/os_ops.c')
-rw-r--r-- | include/os/linux/os_ops.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/include/os/linux/os_ops.c b/include/os/linux/os_ops.c new file mode 100644 index 0000000..f1ab4b1 --- /dev/null +++ b/include/os/linux/os_ops.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #include "os_linux.h" | ||
18 | |||
19 | #include "os_ops_gm20b.h" | ||
20 | #include "os_ops_gp10b.h" | ||
21 | #include "os_ops_gp106.h" | ||
22 | #include "os_ops_gv11b.h" | ||
23 | #include "os_ops_gv100.h" | ||
24 | |||
25 | #if defined(CONFIG_TEGRA_GPU_NEXT) | ||
26 | #include "nvgpu_gpuid_next.h" | ||
27 | #endif | ||
28 | |||
29 | int nvgpu_init_os_linux_ops(struct nvgpu_os_linux *l) | ||
30 | { | ||
31 | struct gk20a *g = &l->g; | ||
32 | u32 ver = g->params.gpu_arch + g->params.gpu_impl; | ||
33 | |||
34 | switch (ver) { | ||
35 | case GK20A_GPUID_GM20B: | ||
36 | case GK20A_GPUID_GM20B_B: | ||
37 | nvgpu_gm20b_init_os_ops(l); | ||
38 | break; | ||
39 | case NVGPU_GPUID_GP10B: | ||
40 | nvgpu_gp10b_init_os_ops(l); | ||
41 | break; | ||
42 | case NVGPU_GPUID_GP106: | ||
43 | nvgpu_gp106_init_os_ops(l); | ||
44 | break; | ||
45 | case NVGPU_GPUID_GV100: | ||
46 | nvgpu_gv100_init_os_ops(l); | ||
47 | break; | ||
48 | case NVGPU_GPUID_GV11B: | ||
49 | nvgpu_gv11b_init_os_ops(l); | ||
50 | break; | ||
51 | #if defined(CONFIG_TEGRA_GPU_NEXT) | ||
52 | case NVGPU_GPUID_NEXT: | ||
53 | NVGPU_NEXT_INIT_OS_OPS(l); | ||
54 | break; | ||
55 | #endif | ||
56 | default: | ||
57 | break; | ||
58 | } | ||
59 | |||
60 | return 0; | ||
61 | } | ||