gpu: nvgpu: refectored sim_readl/sim_writel

refactored sim_readl and sim_writel to use
os-agnostic structures.

converted all sim buffers to the type nvgpu_mem and
replaced all alloc_page and free_page calls with
corresponding nvgpu_dma_alloc/nvgpu_dma_free calls.

JIRA VQRM-2368

Change-Id: Ia9d29119d31f239ed16be932cfd16c334002c727
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1702050
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Sourab Gupta <sourabg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Antony Clince Alex
2018-04-25 10:19:01 +05:30
committed by mobile promotions
parent 703d00d730
commit 2a23cd2494
3 changed files with 168 additions and 187 deletions

View File

@@ -2,7 +2,7 @@
*
* GK20A sim support
*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -20,17 +20,16 @@
#ifndef __SIM_LINUX_H__
#define __SIM_LINUX_H__
#include <nvgpu/nvgpu_mem.h>
#include "gk20a/sim_gk20a.h"
struct sim_gk20a_linux {
struct sim_gk20a sim;
struct resource *reg_mem;
void __iomem *regs;
struct {
struct page *page;
void *kvaddr;
u64 phys;
} send_bfr, recv_bfr, msg_bfr;
struct nvgpu_mem send_bfr;
struct nvgpu_mem recv_bfr;
struct nvgpu_mem msg_bfr;
};
int gk20a_init_sim_support(struct gk20a *g);