summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/io_t19x.c
blob: 5c6b76ba383b5fcddb6001b44f82f474989d3633 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2017, 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 "common/linux/os_linux.h"
#include "gk20a/gk20a.h"

#include <nvgpu/hw/gv11b/hw_usermode_gv11b.h>

void gv11b_usermode_writel(struct gk20a *g, u32 r, u32 v)
{
	struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
	void __iomem *reg = l->t19x.usermode_regs + (r - usermode_cfg0_r());

	writel_relaxed(v, reg);
	gk20a_dbg(gpu_dbg_reg, "usermode r=0x%x v=0x%x", r, v);
}