gpu: nvgpu: make mssnvlink programming OS agnositc

Make ga10b_init_nvlink_soc_credits OS agnostic by replacing OS
specific functions with corresponding nvgpu wrappers. This function is now
assigned to gops.mssnvlink.init_soc_credits HAL.

Introduce nvgpu wrapper, nvgpu_io_map/unmap to map/unmap specified
physical address range.

Jira NVGPU-6641

Change-Id: I337bc75b8ec36552fe471bf5e42f62c19f67ed4a
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2618237
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Antony Clince Alex
2021-10-28 12:58:17 +00:00
committed by mobile promotions
parent 83dbb711bb
commit 1bcc22ab19
13 changed files with 177 additions and 39 deletions

View File

@@ -250,6 +250,9 @@
#include "hal/tpc/tpc_gv11b.h"
#endif
#ifdef CONFIG_NVGPU_HAL_NON_FUSA
#include "hal/mssnvlink/mssnvlink_ga10b.h"
#endif
#include "hal_ga10b.h"
#include "hal_ga10b_litter.h"
@@ -1673,6 +1676,12 @@ static const struct gops_grmgr ga10b_ops_grmgr = {
.discover_gpc_ids = ga10b_grmgr_discover_gpc_ids,
};
#ifdef CONFIG_NVGPU_HAL_NON_FUSA
static const struct gops_mssnvlink ga10b_ops_mssnvlink = {
.init_soc_credits = ga10b_mssnvlink_init_soc_credits
};
#endif
int ga10b_init_hal(struct gk20a *g)
{
struct gpu_ops *gops = &g->ops;
@@ -1923,6 +1932,10 @@ int ga10b_init_hal(struct gk20a *g)
gops->fb.mem_unlock = NULL;
}
#endif
#ifdef CONFIG_NVGPU_HAL_NON_FUSA
gops->mssnvlink = ga10b_ops_mssnvlink;
#endif
g->name = "ga10b";