mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
- moved reg fields to gk20a - added os abstract register accessor in nvgpu/io.h - defined linux register access abstract implementation - hook up with posix. posix implementation of the register accessor uses the high 4 bit of address to identify register apertures then call the according callbacks. It helps to unify code across OSes. Bug 2999617 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Change-Id: Ifcb737e4b4d5b1d8bae310ae50b1ce0aa04f750c Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2497937 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
27 lines
849 B
C
27 lines
849 B
C
/*
|
|
* Copyright (c) 2017-2021, 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,
|
|
* version 2, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*/
|
|
|
|
#include <nvgpu/io.h>
|
|
#include <nvgpu/types.h>
|
|
#include <nvgpu/gk20a.h>
|
|
|
|
#include "os_linux.h"
|
|
|
|
void nvgpu_usermode_writel(struct gk20a *g, u32 r, u32 v)
|
|
{
|
|
uintptr_t reg = g->usermode_regs + (r - g->ops.usermode.base(g));
|
|
|
|
nvgpu_os_writel_relaxed(v, reg);
|
|
nvgpu_log(g, gpu_dbg_reg, "usermode r=0x%x v=0x%x", r, v);
|
|
}
|