diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/pci.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/sim.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/sim.h | 43 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/sim_pci.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/sim_pci.h | 29 |
6 files changed, 6 insertions, 82 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index e2b52dad..34850013 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <nvgpu/debug.h> | 41 | #include <nvgpu/debug.h> |
42 | #include <nvgpu/ctxsw_trace.h> | 42 | #include <nvgpu/ctxsw_trace.h> |
43 | #include <nvgpu/vidmem.h> | 43 | #include <nvgpu/vidmem.h> |
44 | #include <nvgpu/sim.h> | ||
44 | 45 | ||
45 | #include "platform_gk20a.h" | 46 | #include "platform_gk20a.h" |
46 | #include "sysfs.h" | 47 | #include "sysfs.h" |
@@ -51,7 +52,6 @@ | |||
51 | #include "module_usermode.h" | 52 | #include "module_usermode.h" |
52 | #include "intr.h" | 53 | #include "intr.h" |
53 | #include "ioctl.h" | 54 | #include "ioctl.h" |
54 | #include "sim.h" | ||
55 | 55 | ||
56 | #include "os_linux.h" | 56 | #include "os_linux.h" |
57 | #include "ctxsw_trace.h" | 57 | #include "ctxsw_trace.h" |
diff --git a/drivers/gpu/nvgpu/common/linux/pci.c b/drivers/gpu/nvgpu/common/linux/pci.c index a9bcca70..b860e35e 100644 --- a/drivers/gpu/nvgpu/common/linux/pci.c +++ b/drivers/gpu/nvgpu/common/linux/pci.c | |||
@@ -35,8 +35,7 @@ | |||
35 | #include "sysfs.h" | 35 | #include "sysfs.h" |
36 | #include "os_linux.h" | 36 | #include "os_linux.h" |
37 | #include "platform_gk20a.h" | 37 | #include "platform_gk20a.h" |
38 | #include "sim.h" | 38 | #include <nvgpu/sim.h> |
39 | #include "sim_pci.h" | ||
40 | 39 | ||
41 | #include "pci.h" | 40 | #include "pci.h" |
42 | #include "pci_usermode.h" | 41 | #include "pci_usermode.h" |
diff --git a/drivers/gpu/nvgpu/common/linux/sim.c b/drivers/gpu/nvgpu/common/linux/sim.c index 5406035b..8e964f39 100644 --- a/drivers/gpu/nvgpu/common/linux/sim.c +++ b/drivers/gpu/nvgpu/common/linux/sim.c | |||
@@ -25,11 +25,11 @@ | |||
25 | #include <nvgpu/dma.h> | 25 | #include <nvgpu/dma.h> |
26 | #include <nvgpu/soc.h> | 26 | #include <nvgpu/soc.h> |
27 | #include <nvgpu/hw_sim.h> | 27 | #include <nvgpu/hw_sim.h> |
28 | #include <nvgpu/sim.h> | ||
28 | #include "gk20a/gk20a.h" | 29 | #include "gk20a/gk20a.h" |
29 | #include "platform_gk20a.h" | 30 | #include "platform_gk20a.h" |
30 | #include "os_linux.h" | 31 | #include "os_linux.h" |
31 | #include "module.h" | 32 | #include "module.h" |
32 | #include "sim.h" /* will be removed in next patch */ | ||
33 | 33 | ||
34 | void sim_writel(struct sim_nvgpu *sim, u32 r, u32 v) | 34 | void sim_writel(struct sim_nvgpu *sim, u32 r, u32 v) |
35 | { | 35 | { |
@@ -51,10 +51,9 @@ void nvgpu_remove_sim_support_linux(struct gk20a *g) | |||
51 | { | 51 | { |
52 | struct sim_nvgpu_linux *sim_linux; | 52 | struct sim_nvgpu_linux *sim_linux; |
53 | 53 | ||
54 | if (!g->sim) { | 54 | if (!g->sim) |
55 | nvgpu_warn(g, "sim not allocated or not in sim_mode"); | ||
56 | return; | 55 | return; |
57 | } | 56 | |
58 | sim_linux = container_of(g->sim, struct sim_nvgpu_linux, sim); | 57 | sim_linux = container_of(g->sim, struct sim_nvgpu_linux, sim); |
59 | if (sim_linux->regs) { | 58 | if (sim_linux->regs) { |
60 | sim_writel(g->sim, sim_config_r(), sim_config_mode_disabled_v()); | 59 | sim_writel(g->sim, sim_config_r(), sim_config_mode_disabled_v()); |
diff --git a/drivers/gpu/nvgpu/common/linux/sim.h b/drivers/gpu/nvgpu/common/linux/sim.h deleted file mode 100644 index 12f1a255..00000000 --- a/drivers/gpu/nvgpu/common/linux/sim.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * nvgpu sim support | ||
4 | * | ||
5 | * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms and conditions of the GNU General Public License, | ||
9 | * version 2, as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef __SIM_LINUX_H__ | ||
21 | #define __SIM_LINUX_H__ | ||
22 | |||
23 | #include <nvgpu/nvgpu_mem.h> | ||
24 | #include "gk20a/sim_gk20a.h" | ||
25 | |||
26 | struct sim_nvgpu_linux { | ||
27 | struct sim_nvgpu sim; | ||
28 | struct resource *reg_mem; | ||
29 | void __iomem *regs; | ||
30 | void (*remove_support_linux)(struct gk20a *g); | ||
31 | }; | ||
32 | |||
33 | void sim_writel(struct sim_nvgpu *sim, u32 r, u32 v); | ||
34 | u32 sim_readl(struct sim_nvgpu *sim, u32 r); | ||
35 | int nvgpu_init_sim_support(struct gk20a *g); /* will be moved to common in subsequent patch */ | ||
36 | int nvgpu_alloc_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem); /* will be moved to common in subsequent patch */ | ||
37 | void nvgpu_free_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem); /* will be moved to common in subsequent patch */ | ||
38 | void nvgpu_free_sim_support(struct gk20a *g); /* will be moved to common in subsequent patch */ | ||
39 | void nvgpu_remove_sim_support(struct gk20a *g); /* will be moved to common in subsequent patch */ | ||
40 | int nvgpu_init_sim_support_linux(struct gk20a *g, | ||
41 | struct platform_device *dev); | ||
42 | void nvgpu_remove_sim_support_linux(struct gk20a *g); | ||
43 | #endif | ||
diff --git a/drivers/gpu/nvgpu/common/linux/sim_pci.c b/drivers/gpu/nvgpu/common/linux/sim_pci.c index 9dac630c..d37767b7 100644 --- a/drivers/gpu/nvgpu/common/linux/sim_pci.c +++ b/drivers/gpu/nvgpu/common/linux/sim_pci.c | |||
@@ -24,11 +24,10 @@ | |||
24 | #include <nvgpu/nvgpu_mem.h> | 24 | #include <nvgpu/nvgpu_mem.h> |
25 | #include <nvgpu/dma.h> | 25 | #include <nvgpu/dma.h> |
26 | #include <nvgpu/hw_sim_pci.h> | 26 | #include <nvgpu/hw_sim_pci.h> |
27 | #include <nvgpu/sim.h> | ||
27 | #include "gk20a/gk20a.h" | 28 | #include "gk20a/gk20a.h" |
28 | #include "os_linux.h" | 29 | #include "os_linux.h" |
29 | #include "module.h" | 30 | #include "module.h" |
30 | #include "sim.h" /* will be removed in subsequent patches */ | ||
31 | #include "sim_pci.h"/* will be removed in subsequent patches */ | ||
32 | 31 | ||
33 | static bool _nvgpu_pci_is_simulation(struct gk20a *g, u32 sim_base) | 32 | static bool _nvgpu_pci_is_simulation(struct gk20a *g, u32 sim_base) |
34 | { | 33 | { |
@@ -50,7 +49,6 @@ void nvgpu_remove_sim_support_linux_pci(struct gk20a *g) | |||
50 | is_simulation = _nvgpu_pci_is_simulation(g, sim_r()); | 49 | is_simulation = _nvgpu_pci_is_simulation(g, sim_r()); |
51 | 50 | ||
52 | if (!is_simulation) { | 51 | if (!is_simulation) { |
53 | nvgpu_warn(g, "not in sim_mode"); | ||
54 | return; | 52 | return; |
55 | } | 53 | } |
56 | 54 | ||
diff --git a/drivers/gpu/nvgpu/common/linux/sim_pci.h b/drivers/gpu/nvgpu/common/linux/sim_pci.h deleted file mode 100644 index 645dbdbd..00000000 --- a/drivers/gpu/nvgpu/common/linux/sim_pci.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * GK20A sim support | ||
4 | * | ||
5 | * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms and conditions of the GNU General Public License, | ||
9 | * version 2, as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef __SIM_PCI_LINUX_H__ | ||
21 | #define __SIM_PCI_LINUX_H__ | ||
22 | |||
23 | #include "gk20a/sim_gk20a.h" | ||
24 | #include "sim.h" | ||
25 | |||
26 | int nvgpu_init_sim_support_pci(struct gk20a *g); /* this will be moved */ | ||
27 | int nvgpu_init_sim_support_linux_pci(struct gk20a *g); | ||
28 | void nvgpu_remove_sim_support_linux_pci(struct gk20a *g); | ||
29 | #endif | ||