diff options
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/linux/sim.h | 38 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/linux/sim_pci.h | 26 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/sim.h | 54 |
3 files changed, 118 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/sim.h b/drivers/gpu/nvgpu/include/nvgpu/linux/sim.h new file mode 100644 index 00000000..c5aab899 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/sim.h | |||
@@ -0,0 +1,38 @@ | |||
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 <linux/platform_device.h> | ||
24 | |||
25 | struct sim_nvgpu_linux { | ||
26 | struct sim_nvgpu sim; | ||
27 | struct resource *reg_mem; | ||
28 | void __iomem *regs; | ||
29 | void (*remove_support_linux)(struct gk20a *g); | ||
30 | }; | ||
31 | |||
32 | void sim_writel(struct sim_nvgpu *sim, u32 r, u32 v); | ||
33 | u32 sim_readl(struct sim_nvgpu *sim, u32 r); | ||
34 | |||
35 | int nvgpu_init_sim_support_linux(struct gk20a *g, | ||
36 | struct platform_device *dev); | ||
37 | void nvgpu_remove_sim_support_linux(struct gk20a *g); | ||
38 | #endif | ||
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/sim_pci.h b/drivers/gpu/nvgpu/include/nvgpu/linux/sim_pci.h new file mode 100644 index 00000000..5784ecba --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/sim_pci.h | |||
@@ -0,0 +1,26 @@ | |||
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 | int nvgpu_init_sim_support_linux_pci(struct gk20a *g); | ||
24 | void nvgpu_remove_sim_support_linux_pci(struct gk20a *g); | ||
25 | |||
26 | #endif | ||
diff --git a/drivers/gpu/nvgpu/include/nvgpu/sim.h b/drivers/gpu/nvgpu/include/nvgpu/sim.h new file mode 100644 index 00000000..78b749dd --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/sim.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | #ifndef __NVGPU_SIM_H__ | ||
23 | #define __NVGPU_SIM_H__ | ||
24 | |||
25 | #include <nvgpu/nvgpu_mem.h> | ||
26 | |||
27 | struct gk20a; | ||
28 | struct sim_nvgpu { | ||
29 | struct gk20a *g; | ||
30 | u32 send_ring_put; | ||
31 | u32 recv_ring_get; | ||
32 | u32 recv_ring_put; | ||
33 | u32 sequence_base; | ||
34 | struct nvgpu_mem send_bfr; | ||
35 | struct nvgpu_mem recv_bfr; | ||
36 | struct nvgpu_mem msg_bfr; | ||
37 | void (*remove_support)(struct gk20a *); | ||
38 | int (*esc_readl)( | ||
39 | struct gk20a *g, char *path, u32 index, u32 *data); | ||
40 | }; | ||
41 | #ifdef __KERNEL__ | ||
42 | #include "linux/sim.h" | ||
43 | #include "linux/sim_pci.h" | ||
44 | #else | ||
45 | |||
46 | #endif | ||
47 | int nvgpu_init_sim_support(struct gk20a *g); | ||
48 | int nvgpu_init_sim_support_pci(struct gk20a *g); | ||
49 | int nvgpu_alloc_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem); | ||
50 | void nvgpu_free_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem); | ||
51 | void nvgpu_free_sim_support(struct gk20a *g); | ||
52 | void nvgpu_remove_sim_support(struct gk20a *g); | ||
53 | |||
54 | #endif | ||