mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: created os-agnostic sim header.
added a os-agnostic sim.h header which could be included in by any platform, moved out os specific headers to nvgpu/linux. JIRA VQRM-2368 Change-Id: I3861bfa75a6b8d2d909bc7223467fd68c208275b Signed-off-by: Antony Clince Alex <aalex@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1702816 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
50d1b0c72b
commit
7e66f2a63d
@@ -41,6 +41,7 @@
|
||||
#include <nvgpu/debug.h>
|
||||
#include <nvgpu/ctxsw_trace.h>
|
||||
#include <nvgpu/vidmem.h>
|
||||
#include <nvgpu/sim.h>
|
||||
|
||||
#include "platform_gk20a.h"
|
||||
#include "sysfs.h"
|
||||
@@ -51,7 +52,6 @@
|
||||
#include "module_usermode.h"
|
||||
#include "intr.h"
|
||||
#include "ioctl.h"
|
||||
#include "sim.h"
|
||||
|
||||
#include "os_linux.h"
|
||||
#include "ctxsw_trace.h"
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
#include "sysfs.h"
|
||||
#include "os_linux.h"
|
||||
#include "platform_gk20a.h"
|
||||
#include "sim.h"
|
||||
#include "sim_pci.h"
|
||||
#include <nvgpu/sim.h>
|
||||
|
||||
#include "pci.h"
|
||||
#include "pci_usermode.h"
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
#include <nvgpu/dma.h>
|
||||
#include <nvgpu/soc.h>
|
||||
#include <nvgpu/hw_sim.h>
|
||||
#include <nvgpu/sim.h>
|
||||
#include "gk20a/gk20a.h"
|
||||
#include "platform_gk20a.h"
|
||||
#include "os_linux.h"
|
||||
#include "module.h"
|
||||
#include "sim.h" /* will be removed in next patch */
|
||||
|
||||
void sim_writel(struct sim_nvgpu *sim, u32 r, u32 v)
|
||||
{
|
||||
@@ -51,10 +51,9 @@ void nvgpu_remove_sim_support_linux(struct gk20a *g)
|
||||
{
|
||||
struct sim_nvgpu_linux *sim_linux;
|
||||
|
||||
if (!g->sim) {
|
||||
nvgpu_warn(g, "sim not allocated or not in sim_mode");
|
||||
if (!g->sim)
|
||||
return;
|
||||
}
|
||||
|
||||
sim_linux = container_of(g->sim, struct sim_nvgpu_linux, sim);
|
||||
if (sim_linux->regs) {
|
||||
sim_writel(g->sim, sim_config_r(), sim_config_mode_disabled_v());
|
||||
|
||||
@@ -24,11 +24,10 @@
|
||||
#include <nvgpu/nvgpu_mem.h>
|
||||
#include <nvgpu/dma.h>
|
||||
#include <nvgpu/hw_sim_pci.h>
|
||||
#include <nvgpu/sim.h>
|
||||
#include "gk20a/gk20a.h"
|
||||
#include "os_linux.h"
|
||||
#include "module.h"
|
||||
#include "sim.h" /* will be removed in subsequent patches */
|
||||
#include "sim_pci.h"/* will be removed in subsequent patches */
|
||||
|
||||
static bool _nvgpu_pci_is_simulation(struct gk20a *g, u32 sim_base)
|
||||
{
|
||||
@@ -50,7 +49,6 @@ void nvgpu_remove_sim_support_linux_pci(struct gk20a *g)
|
||||
is_simulation = _nvgpu_pci_is_simulation(g, sim_r());
|
||||
|
||||
if (!is_simulation) {
|
||||
nvgpu_warn(g, "not in sim_mode");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,8 @@
|
||||
#include <nvgpu/dma.h>
|
||||
#include <nvgpu/io.h>
|
||||
#include <nvgpu/hw_sim.h>
|
||||
#include <nvgpu/sim.h>
|
||||
#include "gk20a/gk20a.h"
|
||||
#include "linux/sim.h"
|
||||
|
||||
|
||||
int nvgpu_alloc_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem)
|
||||
{
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include <nvgpu/nvgpu_mem.h>
|
||||
#include <nvgpu/dma.h>
|
||||
#include <nvgpu/hw_sim_pci.h>
|
||||
#include <nvgpu/sim.h>
|
||||
#include "gk20a/gk20a.h"
|
||||
#include "linux/sim.h"
|
||||
|
||||
static inline u32 sim_msg_header_size(void)
|
||||
{
|
||||
|
||||
@@ -63,13 +63,13 @@ struct nvgpu_ctxsw_trace_filter;
|
||||
#include <nvgpu/rwsem.h>
|
||||
#include <nvgpu/clk_arb.h>
|
||||
#include <nvgpu/nvlink.h>
|
||||
#include <nvgpu/sim.h>
|
||||
|
||||
#include "clk_gk20a.h"
|
||||
#include "ce2_gk20a.h"
|
||||
#include "fifo_gk20a.h"
|
||||
#include "tsg_gk20a.h"
|
||||
#include "gr_gk20a.h"
|
||||
#include "sim_gk20a.h"
|
||||
#include "pmu_gk20a.h"
|
||||
#include "priv_ring_gk20a.h"
|
||||
#include "therm_gk20a.h"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "gk20a.h"
|
||||
#include "sim_gk20a.h"
|
||||
#include <nvgpu/sim.h>
|
||||
#include "gr_ctx_gk20a.h"
|
||||
|
||||
#include <nvgpu/log.h>
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
#ifndef __SIM_LINUX_H__
|
||||
#define __SIM_LINUX_H__
|
||||
|
||||
#include <nvgpu/nvgpu_mem.h>
|
||||
#include "gk20a/sim_gk20a.h"
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
struct sim_nvgpu_linux {
|
||||
struct sim_nvgpu sim;
|
||||
@@ -32,11 +31,7 @@ struct sim_nvgpu_linux {
|
||||
|
||||
void sim_writel(struct sim_nvgpu *sim, u32 r, u32 v);
|
||||
u32 sim_readl(struct sim_nvgpu *sim, u32 r);
|
||||
int nvgpu_init_sim_support(struct gk20a *g); /* will be moved to common in subsequent patch */
|
||||
int nvgpu_alloc_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem); /* will be moved to common in subsequent patch */
|
||||
void nvgpu_free_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem); /* will be moved to common in subsequent patch */
|
||||
void nvgpu_free_sim_support(struct gk20a *g); /* will be moved to common in subsequent patch */
|
||||
void nvgpu_remove_sim_support(struct gk20a *g); /* will be moved to common in subsequent patch */
|
||||
|
||||
int nvgpu_init_sim_support_linux(struct gk20a *g,
|
||||
struct platform_device *dev);
|
||||
void nvgpu_remove_sim_support_linux(struct gk20a *g);
|
||||
@@ -20,10 +20,7 @@
|
||||
#ifndef __SIM_PCI_LINUX_H__
|
||||
#define __SIM_PCI_LINUX_H__
|
||||
|
||||
#include "gk20a/sim_gk20a.h"
|
||||
#include "sim.h"
|
||||
|
||||
int nvgpu_init_sim_support_pci(struct gk20a *g); /* this will be moved */
|
||||
int nvgpu_init_sim_support_linux_pci(struct gk20a *g);
|
||||
void nvgpu_remove_sim_support_linux_pci(struct gk20a *g);
|
||||
|
||||
#endif
|
||||
@@ -1,9 +1,5 @@
|
||||
/*
|
||||
* drivers/video/tegra/host/gk20a/sim_gk20a.h
|
||||
*
|
||||
* GK20A sim support
|
||||
*
|
||||
* Copyright (c) 2013-2018, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -23,11 +19,12 @@
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifndef __SIM_GK20A_H__
|
||||
#define __SIM_GK20A_H__
|
||||
#ifndef __NVGPU_SIM_H__
|
||||
#define __NVGPU_SIM_H__
|
||||
|
||||
#include <nvgpu/nvgpu_mem.h>
|
||||
|
||||
struct gk20a;
|
||||
|
||||
struct sim_nvgpu {
|
||||
struct gk20a *g;
|
||||
u32 send_ring_put;
|
||||
@@ -41,5 +38,17 @@ struct sim_nvgpu {
|
||||
int (*esc_readl)(
|
||||
struct gk20a *g, char *path, u32 index, u32 *data);
|
||||
};
|
||||
#ifdef __KERNEL__
|
||||
#include "linux/sim.h"
|
||||
#include "linux/sim_pci.h"
|
||||
#else
|
||||
|
||||
#endif /*__SIM_GK20A_H__*/
|
||||
#endif
|
||||
int nvgpu_init_sim_support(struct gk20a *g);
|
||||
int nvgpu_init_sim_support_pci(struct gk20a *g);
|
||||
int nvgpu_alloc_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem);
|
||||
void nvgpu_free_sim_buffer(struct gk20a *g, struct nvgpu_mem *mem);
|
||||
void nvgpu_free_sim_support(struct gk20a *g);
|
||||
void nvgpu_remove_sim_support(struct gk20a *g);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user