gpu: nvgpu: GV100 support

Adds support of GV100 up to devinit.

JIRA: EVLR-1693

Change-Id: Ic7aa5f1c20714e05954139f143abb6a3459858fc
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1532747
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
David Nieto
2017-08-03 21:43:50 -07:00
committed by mobile promotions
parent 026d1f8efe
commit de8e057f7e
39 changed files with 14125 additions and 1 deletions

View File

@@ -16,7 +16,11 @@ nvgpu-y += \
$(nvgpu-t19x)/gv11b/gr_ctx_gv11b.o \ $(nvgpu-t19x)/gv11b/gr_ctx_gv11b.o \
$(nvgpu-t19x)/gv11b/pmu_gv11b.o \ $(nvgpu-t19x)/gv11b/pmu_gv11b.o \
$(nvgpu-t19x)/gv11b/subctx_gv11b.o \ $(nvgpu-t19x)/gv11b/subctx_gv11b.o \
$(nvgpu-t19x)/gv11b/regops_gv11b.o $(nvgpu-t19x)/gv11b/regops_gv11b.o \
$(nvgpu-t19x)/gv100/mm_gv100.o \
$(nvgpu-t19x)/gv100/gr_ctx_gv100.o \
$(nvgpu-t19x)/gv100/fb_gv100.o \
$(nvgpu-t19x)/gv100/hal_gv100.o
nvgpu-$(CONFIG_TEGRA_GK20A) += $(nvgpu-t19x)/gv11b/platform_gv11b_tegra.o nvgpu-$(CONFIG_TEGRA_GK20A) += $(nvgpu-t19x)/gv11b/platform_gv11b_tegra.o
nvgpu-$(CONFIG_TEGRA_GK20A_NVHOST) += $(nvgpu-t19x)/common/linux/nvhost_t19x.o nvgpu-$(CONFIG_TEGRA_GK20A_NVHOST) += $(nvgpu-t19x)/common/linux/nvhost_t19x.o

View File

@@ -0,0 +1,58 @@
/*
* GV100 FB
*
* 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/types.h>
#include <nvgpu/dma.h>
#include <nvgpu/log.h>
#include <nvgpu/enabled.h>
#include <nvgpu/gmmu.h>
#include "gk20a/gk20a.h"
#include "gv11b/fb_gv11b.h"
#include "gv100/fb_gv100.h"
#include <nvgpu/hw/gv100/hw_fb_gv100.h>
#define HW_SCRUB_TIMEOUT_DEFAULT 100 /* usec */
#define HW_SCRUB_TIMEOUT_MAX 2000000 /* usec */
static void gv100_fb_reset(struct gk20a *g)
{
u32 val;
int retries = HW_SCRUB_TIMEOUT_MAX / HW_SCRUB_TIMEOUT_DEFAULT;
nvgpu_info(g, "reset gv100 fb");
/* wait for memory to be accessible */
do {
u32 w = gk20a_readl(g, fb_niso_scrub_status_r());
if (fb_niso_scrub_status_flag_v(w)) {
nvgpu_info(g, "done");
break;
}
nvgpu_udelay(HW_SCRUB_TIMEOUT_DEFAULT);
} while (--retries);
val = gk20a_readl(g, fb_mmu_priv_level_mask_r());
val &= ~fb_mmu_priv_level_mask_write_violation_m();
gk20a_writel(g, fb_mmu_priv_level_mask_r(), val);
}
void gv100_init_fb(struct gpu_ops *gops)
{
gv11b_init_fb(gops);
gops->fb.reset = gv100_fb_reset;
}

View File

@@ -0,0 +1,22 @@
/*
* GV100 FB
*
* 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.
*/
#ifndef _NVGPU_GV100_FB
#define _NVGPU_GV100_FB
struct gpu_ops;
void gv100_init_fb(struct gpu_ops *gops);
#endif

View File

@@ -0,0 +1,38 @@
/*
* GV100 Graphics Context
*
* 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 "gk20a/gk20a.h"
#include "gr_ctx_gv100.h"
int gr_gv100_get_netlist_name(struct gk20a *g, int index, char *name)
{
u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl;
switch (ver) {
case NVGPU_GPUID_GV100:
sprintf(name, "%s/%s", "gv100",
GV100_NETLIST_IMAGE_FW_NAME);
break;
default:
nvgpu_err(g, "no support for GPUID %x", ver);
}
return 0;
}
bool gr_gv100_is_firmware_defined(void)
{
return true;
}

View File

@@ -0,0 +1,28 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GR_CTX_GV100_H__
#define __GR_CTX_GV100_H__
#include "gk20a/gr_ctx_gk20a.h"
#include "nvgpu_gpuid_t19x.h"
/* production netlist, one and only one from below */
#define GV100_NETLIST_IMAGE_FW_NAME GK20A_NETLIST_IMAGE_D
int gr_gv100_get_netlist_name(struct gk20a *g, int index, char *name);
bool gr_gv100_is_firmware_defined(void);
#endif /*__GR_CTX_GV100_H__*/

View File

@@ -0,0 +1,26 @@
/*
* GV100 Graphics
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GV100_H
#define GV100_H
#include "gk20a/gk20a.h"
int gv100_init_gpu_characteristics(struct gk20a *g);
#endif /* GV11B_H */

View File

@@ -0,0 +1,441 @@
/*
* GV100 Tegra HAL interface
*
* 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 <linux/types.h>
#include <linux/printk.h>
#include <linux/types.h>
#include <linux/tegra_gpu_t19x.h>
#include "gk20a/gk20a.h"
#include "gk20a/fifo_gk20a.h"
#include "gk20a/ctxsw_trace_gk20a.h"
#include "gk20a/fecs_trace_gk20a.h"
#include "gk20a/css_gr_gk20a.h"
#include "gk20a/mc_gk20a.h"
#include "gk20a/dbg_gpu_gk20a.h"
#include "gk20a/bus_gk20a.h"
#include "gk20a/pramin_gk20a.h"
#include "gk20a/flcn_gk20a.h"
#include "gk20a/regops_gk20a.h"
#include "gm20b/ltc_gm20b.h"
#include "gm20b/gr_gm20b.h"
#include "gm20b/fifo_gm20b.h"
#include "gp106/clk_gp106.h"
#include "gp106/clk_arb_gp106.h"
#include "gp106/pmu_gp106.h"
#include "gm206/bios_gm206.h"
#include "gp106/therm_gp106.h"
#include "gp106/xve_gp106.h"
#include "gp106/clk_gp106.h"
#include "gp106/flcn_gp106.h"
#include "gp10b/ltc_gp10b.h"
#include "gp10b/therm_gp10b.h"
#include "gp10b/mc_gp10b.h"
#include "gp10b/ce_gp10b.h"
#include "gp10b/priv_ring_gp10b.h"
#include "gp10b/fifo_gp10b.h"
#include "gp10b/fecs_trace_gp10b.h"
#include "gv11b/hal_gv11b.h"
#include "gv11b/gr_gv11b.h"
#include "gv11b/mc_gv11b.h"
#include "gv11b/ltc_gv11b.h"
#include "gv11b/gv11b.h"
#include "gv11b/ce_gv11b.h"
#include "gv100/gr_ctx_gv100.h"
#include "gv100/mm_gv100.h"
#include "gv11b/pmu_gv11b.h"
#include "gv100/fb_gv100.h"
#include "gv11b/fifo_gv11b.h"
#include "gv11b/gv11b_gating_reglist.h"
#include "gv11b/regops_gv11b.h"
#include "gv11b/subctx_gv11b.h"
#include "gv100.h"
#include "hal_gv100.h"
#include <nvgpu/debug.h>
#include <nvgpu/enabled.h>
#include <nvgpu/hw/gv100/hw_proj_gv100.h>
#include <nvgpu/hw/gv100/hw_fifo_gv100.h>
#include <nvgpu/hw/gv100/hw_ram_gv100.h>
#include <nvgpu/hw/gv100/hw_top_gv100.h>
#include <nvgpu/hw/gv100/hw_pram_gv100.h>
static int gv100_get_litter_value(struct gk20a *g, int value)
{
int ret = EINVAL;
switch (value) {
case GPU_LIT_NUM_GPCS:
ret = proj_scal_litter_num_gpcs_v();
break;
case GPU_LIT_NUM_PES_PER_GPC:
ret = proj_scal_litter_num_pes_per_gpc_v();
break;
case GPU_LIT_NUM_ZCULL_BANKS:
ret = proj_scal_litter_num_zcull_banks_v();
break;
case GPU_LIT_NUM_TPC_PER_GPC:
ret = proj_scal_litter_num_tpc_per_gpc_v();
break;
case GPU_LIT_NUM_SM_PER_TPC:
ret = proj_scal_litter_num_sm_per_tpc_v();
break;
case GPU_LIT_NUM_FBPS:
ret = proj_scal_litter_num_fbps_v();
break;
case GPU_LIT_GPC_BASE:
ret = proj_gpc_base_v();
break;
case GPU_LIT_GPC_STRIDE:
ret = proj_gpc_stride_v();
break;
case GPU_LIT_GPC_SHARED_BASE:
ret = proj_gpc_shared_base_v();
break;
case GPU_LIT_TPC_IN_GPC_BASE:
ret = proj_tpc_in_gpc_base_v();
break;
case GPU_LIT_TPC_IN_GPC_STRIDE:
ret = proj_tpc_in_gpc_stride_v();
break;
case GPU_LIT_TPC_IN_GPC_SHARED_BASE:
ret = proj_tpc_in_gpc_shared_base_v();
break;
case GPU_LIT_PPC_IN_GPC_BASE:
ret = proj_ppc_in_gpc_base_v();
case GPU_LIT_PPC_IN_GPC_STRIDE:
ret = proj_ppc_in_gpc_stride_v();
break;
case GPU_LIT_ROP_BASE:
ret = proj_rop_base_v();
break;
case GPU_LIT_ROP_STRIDE:
ret = proj_rop_stride_v();
break;
case GPU_LIT_ROP_SHARED_BASE:
ret = proj_rop_shared_base_v();
break;
case GPU_LIT_HOST_NUM_ENGINES:
ret = proj_host_num_engines_v();
break;
case GPU_LIT_HOST_NUM_PBDMA:
ret = proj_host_num_pbdma_v();
break;
case GPU_LIT_LTC_STRIDE:
ret = proj_ltc_stride_v();
break;
case GPU_LIT_LTS_STRIDE:
ret = proj_lts_stride_v();
break;
case GPU_LIT_NUM_FBPAS:
ret = proj_scal_litter_num_fbpas_v();
break;
case GPU_LIT_FBPA_STRIDE:
ret = proj_fbpa_stride_v();
break;
case GPU_LIT_SM_PRI_STRIDE:
ret = proj_sm_stride_v();
break;
default:
break;
}
return ret;
}
int gv100_init_gpu_characteristics(struct gk20a *g)
{
struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics;
int err;
err = gk20a_init_gpu_characteristics(g);
if (err)
return err;
gpu->flags |=
NVGPU_GPU_FLAGS_SUPPORT_TSG_SUBCONTEXTS;
return 0;
}
static const struct gpu_ops gv100_ops = {
.ltc = {
.determine_L2_size_bytes = gp10b_determine_L2_size_bytes,
.set_zbc_s_entry = gv11b_ltc_set_zbc_stencil_entry,
.set_zbc_color_entry = gm20b_ltc_set_zbc_color_entry,
.set_zbc_depth_entry = gm20b_ltc_set_zbc_depth_entry,
.init_cbc = NULL,
.init_fs_state = gv11b_ltc_init_fs_state,
.init_comptags = gp10b_ltc_init_comptags,
.cbc_ctrl = gm20b_ltc_cbc_ctrl,
.isr = gv11b_ltc_isr,
.cbc_fix_config = gv11b_ltc_cbc_fix_config,
.flush = gm20b_flush_ltc,
.set_enabled = gp10b_ltc_set_enabled,
},
.ce2 = {
.isr_stall = gv11b_ce_isr,
.isr_nonstall = gp10b_ce_nonstall_isr,
.get_num_pce = gv11b_ce_get_num_pce,
},
.fifo = {
.init_fifo_setup_hw = gv11b_init_fifo_setup_hw,
.bind_channel = channel_gm20b_bind,
.unbind_channel = channel_gv11b_unbind,
.disable_channel = gk20a_fifo_disable_channel,
.enable_channel = gk20a_fifo_enable_channel,
.alloc_inst = gk20a_fifo_alloc_inst,
.free_inst = gk20a_fifo_free_inst,
.setup_ramfc = channel_gv11b_setup_ramfc,
.channel_set_priority = gk20a_fifo_set_priority,
.channel_set_timeslice = gk20a_fifo_set_timeslice,
.default_timeslice_us = gk20a_fifo_default_timeslice_us,
.setup_userd = gk20a_fifo_setup_userd,
.userd_gp_get = gv11b_userd_gp_get,
.userd_gp_put = gv11b_userd_gp_put,
.userd_pb_get = gv11b_userd_pb_get,
.pbdma_acquire_val = gk20a_fifo_pbdma_acquire_val,
.preempt_channel = gv11b_fifo_preempt_channel,
.preempt_tsg = gv11b_fifo_preempt_tsg,
.update_runlist = gk20a_fifo_update_runlist,
.trigger_mmu_fault = NULL,
.get_mmu_fault_info = NULL,
.wait_engine_idle = gk20a_fifo_wait_engine_idle,
.get_num_fifos = gv11b_fifo_get_num_fifos,
.get_pbdma_signature = gp10b_fifo_get_pbdma_signature,
.set_runlist_interleave = gk20a_fifo_set_runlist_interleave,
.tsg_set_timeslice = gk20a_fifo_tsg_set_timeslice,
.force_reset_ch = gk20a_fifo_force_reset_ch,
.engine_enum_from_type = gp10b_fifo_engine_enum_from_type,
.device_info_data_parse = gp10b_device_info_data_parse,
.eng_runlist_base_size = fifo_eng_runlist_base__size_1_v,
.init_engine_info = gk20a_fifo_init_engine_info,
.runlist_entry_size = ram_rl_entry_size_v,
.get_tsg_runlist_entry = gv11b_get_tsg_runlist_entry,
.get_ch_runlist_entry = gv11b_get_ch_runlist_entry,
.is_fault_engine_subid_gpc = gv11b_is_fault_engine_subid_gpc,
.dump_pbdma_status = gk20a_dump_pbdma_status,
.dump_eng_status = gv11b_dump_eng_status,
.dump_channel_status_ramfc = gv11b_dump_channel_status_ramfc,
.intr_0_error_mask = gv11b_fifo_intr_0_error_mask,
.is_preempt_pending = gv11b_fifo_is_preempt_pending,
.init_pbdma_intr_descs = gv11b_fifo_init_pbdma_intr_descs,
.reset_enable_hw = gv11b_init_fifo_reset_enable_hw,
.teardown_ch_tsg = gv11b_fifo_teardown_ch_tsg,
.handle_sched_error = gv11b_fifo_handle_sched_error,
.handle_pbdma_intr_0 = gv11b_fifo_handle_pbdma_intr_0,
.handle_pbdma_intr_1 = gv11b_fifo_handle_pbdma_intr_1,
.init_eng_method_buffers = gv11b_fifo_init_eng_method_buffers,
.deinit_eng_method_buffers =
gv11b_fifo_deinit_eng_method_buffers,
.tsg_bind_channel = gk20a_tsg_bind_channel,
.tsg_unbind_channel = gk20a_tsg_unbind_channel,
#ifdef CONFIG_TEGRA_GK20A_NVHOST
.alloc_syncpt_buf = gv11b_fifo_alloc_syncpt_buf,
.free_syncpt_buf = gv11b_fifo_free_syncpt_buf,
.add_syncpt_wait_cmd = gv11b_fifo_add_syncpt_wait_cmd,
.get_syncpt_wait_cmd_size = gv11b_fifo_get_syncpt_wait_cmd_size,
.add_syncpt_incr_cmd = gv11b_fifo_add_syncpt_incr_cmd,
.get_syncpt_incr_cmd_size = gv11b_fifo_get_syncpt_incr_cmd_size,
#endif
.resetup_ramfc = NULL,
.device_info_fault_id = top_device_info_data_fault_id_enum_v,
.free_channel_ctx_header = gv11b_free_subctx_header,
.preempt_ch_tsg = gv11b_fifo_preempt_ch_tsg,
.handle_ctxsw_timeout = gv11b_fifo_handle_ctxsw_timeout,
},
.gr_ctx = {
.get_netlist_name = gr_gv100_get_netlist_name,
.is_fw_defined = gr_gv100_is_firmware_defined,
},
#ifdef CONFIG_GK20A_CTXSW_TRACE
.fecs_trace = {
.alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc,
.free_user_buffer = gk20a_ctxsw_dev_ring_free,
.mmap_user_buffer = gk20a_ctxsw_dev_mmap_buffer,
.init = gk20a_fecs_trace_init,
.deinit = gk20a_fecs_trace_deinit,
.enable = gk20a_fecs_trace_enable,
.disable = gk20a_fecs_trace_disable,
.is_enabled = gk20a_fecs_trace_is_enabled,
.reset = gk20a_fecs_trace_reset,
.flush = gp10b_fecs_trace_flush,
.poll = gk20a_fecs_trace_poll,
.bind_channel = gk20a_fecs_trace_bind_channel,
.unbind_channel = gk20a_fecs_trace_unbind_channel,
.max_entries = gk20a_gr_max_entries,
},
#endif /* CONFIG_GK20A_CTXSW_TRACE */
.pramin = {
.enter = gk20a_pramin_enter,
.exit = gk20a_pramin_exit,
.data032_r = pram_data032_r,
},
.clk = {
.init_clk_support = gp106_init_clk_support,
.get_crystal_clk_hz = gp106_crystal_clk_hz,
.measure_freq = gp106_clk_measure_freq,
.suspend_clk_support = gp106_suspend_clk_support,
},
.clk_arb = {
.get_arbiter_clk_domains = gp106_get_arbiter_clk_domains,
.get_arbiter_clk_range = gp106_get_arbiter_clk_range,
.get_arbiter_clk_default = gp106_get_arbiter_clk_default,
.get_current_pstate = nvgpu_clk_arb_get_current_pstate,
},
.mc = {
.intr_enable = mc_gv11b_intr_enable,
.intr_unit_config = mc_gp10b_intr_unit_config,
.isr_stall = mc_gp10b_isr_stall,
.intr_stall = mc_gp10b_intr_stall,
.intr_stall_pause = mc_gp10b_intr_stall_pause,
.intr_stall_resume = mc_gp10b_intr_stall_resume,
.intr_nonstall = mc_gp10b_intr_nonstall,
.intr_nonstall_pause = mc_gp10b_intr_nonstall_pause,
.intr_nonstall_resume = mc_gp10b_intr_nonstall_resume,
.enable = gk20a_mc_enable,
.disable = gk20a_mc_disable,
.reset = gk20a_mc_reset,
.boot_0 = gk20a_mc_boot_0,
.is_intr1_pending = mc_gp10b_is_intr1_pending,
.is_intr_hub_pending = gv11b_mc_is_intr_hub_pending,
},
.debug = {
.show_dump = gk20a_debug_show_dump,
},
.dbg_session_ops = {
.exec_reg_ops = exec_regops_gk20a,
.dbg_set_powergate = dbg_set_powergate,
.check_and_set_global_reservation =
nvgpu_check_and_set_global_reservation,
.check_and_set_context_reservation =
nvgpu_check_and_set_context_reservation,
.release_profiler_reservation =
nvgpu_release_profiler_reservation,
.perfbuffer_enable = gk20a_perfbuf_enable_locked,
.perfbuffer_disable = gk20a_perfbuf_disable_locked,
},
.bus = {
.init_hw = gk20a_bus_init_hw,
.isr = gk20a_bus_isr,
.read_ptimer = gk20a_read_ptimer,
.bar1_bind = NULL,
},
#if defined(CONFIG_GK20A_CYCLE_STATS)
.css = {
.enable_snapshot = css_hw_enable_snapshot,
.disable_snapshot = css_hw_disable_snapshot,
.check_data_available = css_hw_check_data_available,
.set_handled_snapshots = css_hw_set_handled_snapshots,
.allocate_perfmon_ids = css_gr_allocate_perfmon_ids,
.release_perfmon_ids = css_gr_release_perfmon_ids,
},
#endif
.xve = {
.sw_init = xve_sw_init_gp106,
.get_speed = xve_get_speed_gp106,
.set_speed = xve_set_speed_gp106,
.available_speeds = xve_available_speeds_gp106,
.xve_readl = xve_xve_readl_gp106,
.xve_writel = xve_xve_writel_gp106,
.disable_aspm = xve_disable_aspm_gp106,
.reset_gpu = xve_reset_gpu_gp106,
#if defined(CONFIG_PCI_MSI)
.rearm_msi = xve_rearm_msi_gp106,
#endif
.enable_shadow_rom = xve_enable_shadow_rom_gp106,
.disable_shadow_rom = xve_disable_shadow_rom_gp106,
},
.falcon = {
.falcon_hal_sw_init = gp106_falcon_hal_sw_init,
},
.priv_ring = {
.isr = gp10b_priv_ring_isr,
},
.chip_init_gpu_characteristics = gv100_init_gpu_characteristics,
.get_litter_value = gv100_get_litter_value,
.bios_init = gm206_bios_init,
};
int gv100_init_hal(struct gk20a *g)
{
struct gpu_ops *gops = &g->ops;
struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics;
gops->ltc = gv100_ops.ltc;
gops->ce2 = gv100_ops.ce2;
gops->clock_gating = gv100_ops.clock_gating;
gops->fifo = gv100_ops.fifo;
gops->gr_ctx = gv100_ops.gr_ctx;
gops->fecs_trace = gv100_ops.fecs_trace;
gops->pramin = gv100_ops.pramin;
gops->therm = gv100_ops.therm;
gops->mc = gv100_ops.mc;
gops->debug = gv100_ops.debug;
gops->dbg_session_ops = gv100_ops.dbg_session_ops;
gops->bus = gv100_ops.bus;
#if defined(CONFIG_GK20A_CYCLE_STATS)
gops->css = gv100_ops.css;
#endif
gops->xve = gv100_ops.xve;
gops->falcon = gv100_ops.falcon;
gops->priv_ring = gv100_ops.priv_ring;
/* clocks */
gops->clk.init_clk_support = gv100_ops.clk.init_clk_support;
gops->clk.get_crystal_clk_hz = gv100_ops.clk.get_crystal_clk_hz;
gops->clk.measure_freq = gv100_ops.clk.measure_freq;
gops->clk.suspend_clk_support = gv100_ops.clk.suspend_clk_support;
/* Lone functions */
gops->chip_init_gpu_characteristics =
gv100_ops.chip_init_gpu_characteristics;
gops->get_litter_value = gv100_ops.get_litter_value;
gops->bios_init = gv100_ops.bios_init;
__nvgpu_set_enabled(g, NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP, true);
__nvgpu_set_enabled(g, NVGPU_SEC_PRIVSECURITY, true);
__nvgpu_set_enabled(g, NVGPU_SEC_SECUREGPCCS, true);
/* for now */
__nvgpu_set_enabled(g, NVGPU_PMU_PSTATE, false);
g->bootstrap_owner = LSF_FALCON_ID_SEC2;
gv11b_init_gr(g);
gv100_init_fb(gops);
gv100_init_mm(gops);
gp106_init_pmu_ops(g);
g->name = "gv10x";
c->twod_class = FERMI_TWOD_A;
c->threed_class = VOLTA_A;
c->compute_class = VOLTA_COMPUTE_A;
c->gpfifo_class = VOLTA_CHANNEL_GPFIFO_A;
c->inline_to_memory_class = KEPLER_INLINE_TO_MEMORY_B;
c->dma_copy_class = VOLTA_DMA_COPY_A;
return 0;
}

View File

@@ -0,0 +1,21 @@
/*
* GV100 Tegra HAL interface
*
* 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.
*/
#ifndef _NVGPU_HAL_GV11B_H
#define _NVGPU_HAL_GV11B_H
struct gk20a;
int gv100_init_hal(struct gk20a *gops);
#endif

View File

@@ -0,0 +1,41 @@
/*
* GV100 memory management
*
* 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 "gk20a/gk20a.h"
#include "gv11b/mm_gv11b.h"
#include "gv100/mm_gv100.h"
#include <nvgpu/hw/gv100/hw_fb_gv100.h>
static size_t gv100_mm_get_vidmem_size(struct gk20a *g)
{
u32 range = gk20a_readl(g, fb_mmu_local_memory_range_r());
u32 mag = fb_mmu_local_memory_range_lower_mag_v(range);
u32 scale = fb_mmu_local_memory_range_lower_scale_v(range);
u32 ecc = fb_mmu_local_memory_range_ecc_mode_v(range);
size_t bytes = ((size_t)mag << scale) * SZ_1M;
if (ecc)
bytes = bytes / 16 * 15;
return bytes;
}
void gv100_init_mm(struct gpu_ops *gops)
{
gv11b_init_mm(gops);
gops->mm.get_vidmem_size = gv100_mm_get_vidmem_size;
gops->mm.get_physical_addr_bits = NULL;
}

View File

@@ -0,0 +1,23 @@
/*
* GV100 memory management
*
* 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.
*/
#ifndef MM_GV100_H
#define MM_GV100_H
struct gpu_ops;
void gv100_init_mm(struct gpu_ops *gops);
#endif

View File

@@ -0,0 +1,217 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_bus_gv100_h_
#define _hw_bus_gv100_h_
static inline u32 bus_bar0_window_r(void)
{
return 0x00001700;
}
static inline u32 bus_bar0_window_base_f(u32 v)
{
return (v & 0xffffff) << 0;
}
static inline u32 bus_bar0_window_target_vid_mem_f(void)
{
return 0x0;
}
static inline u32 bus_bar0_window_target_sys_mem_coherent_f(void)
{
return 0x2000000;
}
static inline u32 bus_bar0_window_target_sys_mem_noncoherent_f(void)
{
return 0x3000000;
}
static inline u32 bus_bar0_window_target_bar0_window_base_shift_v(void)
{
return 0x00000010;
}
static inline u32 bus_bar1_block_r(void)
{
return 0x00001704;
}
static inline u32 bus_bar1_block_ptr_f(u32 v)
{
return (v & 0xfffffff) << 0;
}
static inline u32 bus_bar1_block_target_vid_mem_f(void)
{
return 0x0;
}
static inline u32 bus_bar1_block_target_sys_mem_coh_f(void)
{
return 0x20000000;
}
static inline u32 bus_bar1_block_target_sys_mem_ncoh_f(void)
{
return 0x30000000;
}
static inline u32 bus_bar1_block_mode_virtual_f(void)
{
return 0x80000000;
}
static inline u32 bus_bar2_block_r(void)
{
return 0x00001714;
}
static inline u32 bus_bar2_block_ptr_f(u32 v)
{
return (v & 0xfffffff) << 0;
}
static inline u32 bus_bar2_block_target_vid_mem_f(void)
{
return 0x0;
}
static inline u32 bus_bar2_block_target_sys_mem_coh_f(void)
{
return 0x20000000;
}
static inline u32 bus_bar2_block_target_sys_mem_ncoh_f(void)
{
return 0x30000000;
}
static inline u32 bus_bar2_block_mode_virtual_f(void)
{
return 0x80000000;
}
static inline u32 bus_bar1_block_ptr_shift_v(void)
{
return 0x0000000c;
}
static inline u32 bus_bar2_block_ptr_shift_v(void)
{
return 0x0000000c;
}
static inline u32 bus_bind_status_r(void)
{
return 0x00001710;
}
static inline u32 bus_bind_status_bar1_pending_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 bus_bind_status_bar1_pending_empty_f(void)
{
return 0x0;
}
static inline u32 bus_bind_status_bar1_pending_busy_f(void)
{
return 0x1;
}
static inline u32 bus_bind_status_bar1_outstanding_v(u32 r)
{
return (r >> 1) & 0x1;
}
static inline u32 bus_bind_status_bar1_outstanding_false_f(void)
{
return 0x0;
}
static inline u32 bus_bind_status_bar1_outstanding_true_f(void)
{
return 0x2;
}
static inline u32 bus_bind_status_bar2_pending_v(u32 r)
{
return (r >> 2) & 0x1;
}
static inline u32 bus_bind_status_bar2_pending_empty_f(void)
{
return 0x0;
}
static inline u32 bus_bind_status_bar2_pending_busy_f(void)
{
return 0x4;
}
static inline u32 bus_bind_status_bar2_outstanding_v(u32 r)
{
return (r >> 3) & 0x1;
}
static inline u32 bus_bind_status_bar2_outstanding_false_f(void)
{
return 0x0;
}
static inline u32 bus_bind_status_bar2_outstanding_true_f(void)
{
return 0x8;
}
static inline u32 bus_intr_0_r(void)
{
return 0x00001100;
}
static inline u32 bus_intr_0_pri_squash_m(void)
{
return 0x1 << 1;
}
static inline u32 bus_intr_0_pri_fecserr_m(void)
{
return 0x1 << 2;
}
static inline u32 bus_intr_0_pri_timeout_m(void)
{
return 0x1 << 3;
}
static inline u32 bus_intr_en_0_r(void)
{
return 0x00001140;
}
static inline u32 bus_intr_en_0_pri_squash_m(void)
{
return 0x1 << 1;
}
static inline u32 bus_intr_en_0_pri_fecserr_m(void)
{
return 0x1 << 2;
}
static inline u32 bus_intr_en_0_pri_timeout_m(void)
{
return 0x1 << 3;
}
#endif

View File

@@ -0,0 +1,133 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_ccsr_gv100_h_
#define _hw_ccsr_gv100_h_
static inline u32 ccsr_channel_inst_r(u32 i)
{
return 0x00800000 + i*8;
}
static inline u32 ccsr_channel_inst__size_1_v(void)
{
return 0x00001000;
}
static inline u32 ccsr_channel_inst_ptr_f(u32 v)
{
return (v & 0xfffffff) << 0;
}
static inline u32 ccsr_channel_inst_target_vid_mem_f(void)
{
return 0x0;
}
static inline u32 ccsr_channel_inst_target_sys_mem_coh_f(void)
{
return 0x20000000;
}
static inline u32 ccsr_channel_inst_target_sys_mem_ncoh_f(void)
{
return 0x30000000;
}
static inline u32 ccsr_channel_inst_bind_false_f(void)
{
return 0x0;
}
static inline u32 ccsr_channel_inst_bind_true_f(void)
{
return 0x80000000;
}
static inline u32 ccsr_channel_r(u32 i)
{
return 0x00800004 + i*8;
}
static inline u32 ccsr_channel__size_1_v(void)
{
return 0x00001000;
}
static inline u32 ccsr_channel_enable_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 ccsr_channel_enable_set_f(u32 v)
{
return (v & 0x1) << 10;
}
static inline u32 ccsr_channel_enable_set_true_f(void)
{
return 0x400;
}
static inline u32 ccsr_channel_enable_clr_true_f(void)
{
return 0x800;
}
static inline u32 ccsr_channel_status_v(u32 r)
{
return (r >> 24) & 0xf;
}
static inline u32 ccsr_channel_pbdma_faulted_f(u32 v)
{
return (v & 0x1) << 22;
}
static inline u32 ccsr_channel_pbdma_faulted_reset_f(void)
{
return 0x400000;
}
static inline u32 ccsr_channel_eng_faulted_f(u32 v)
{
return (v & 0x1) << 23;
}
static inline u32 ccsr_channel_eng_faulted_reset_f(void)
{
return 0x800000;
}
static inline u32 ccsr_channel_busy_v(u32 r)
{
return (r >> 28) & 0x1;
}
#endif

View File

@@ -0,0 +1,101 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_ce_gv100_h_
#define _hw_ce_gv100_h_
static inline u32 ce_intr_status_r(u32 i)
{
return 0x00104410 + i*128;
}
static inline u32 ce_intr_status_blockpipe_pending_f(void)
{
return 0x1;
}
static inline u32 ce_intr_status_blockpipe_reset_f(void)
{
return 0x1;
}
static inline u32 ce_intr_status_nonblockpipe_pending_f(void)
{
return 0x2;
}
static inline u32 ce_intr_status_nonblockpipe_reset_f(void)
{
return 0x2;
}
static inline u32 ce_intr_status_launcherr_pending_f(void)
{
return 0x4;
}
static inline u32 ce_intr_status_launcherr_reset_f(void)
{
return 0x4;
}
static inline u32 ce_intr_status_invalid_config_pending_f(void)
{
return 0x8;
}
static inline u32 ce_intr_status_invalid_config_reset_f(void)
{
return 0x8;
}
static inline u32 ce_intr_status_mthd_buffer_fault_pending_f(void)
{
return 0x10;
}
static inline u32 ce_intr_status_mthd_buffer_fault_reset_f(void)
{
return 0x10;
}
static inline u32 ce_pce_map_r(void)
{
return 0x00104028;
}
#endif

View File

@@ -0,0 +1,449 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_ctxsw_prog_gv100_h_
#define _hw_ctxsw_prog_gv100_h_
static inline u32 ctxsw_prog_fecs_header_v(void)
{
return 0x00000100;
}
static inline u32 ctxsw_prog_main_image_num_gpcs_o(void)
{
return 0x00000008;
}
static inline u32 ctxsw_prog_main_image_ctl_o(void)
{
return 0x0000000c;
}
static inline u32 ctxsw_prog_main_image_ctl_type_f(u32 v)
{
return (v & 0x3f) << 0;
}
static inline u32 ctxsw_prog_main_image_ctl_type_undefined_v(void)
{
return 0x00000000;
}
static inline u32 ctxsw_prog_main_image_ctl_type_opengl_v(void)
{
return 0x00000008;
}
static inline u32 ctxsw_prog_main_image_ctl_type_dx9_v(void)
{
return 0x00000010;
}
static inline u32 ctxsw_prog_main_image_ctl_type_dx10_v(void)
{
return 0x00000011;
}
static inline u32 ctxsw_prog_main_image_ctl_type_dx11_v(void)
{
return 0x00000012;
}
static inline u32 ctxsw_prog_main_image_ctl_type_compute_v(void)
{
return 0x00000020;
}
static inline u32 ctxsw_prog_main_image_ctl_type_per_veid_header_v(void)
{
return 0x00000021;
}
static inline u32 ctxsw_prog_main_image_patch_count_o(void)
{
return 0x00000010;
}
static inline u32 ctxsw_prog_main_image_context_id_o(void)
{
return 0x000000f0;
}
static inline u32 ctxsw_prog_main_image_patch_adr_lo_o(void)
{
return 0x00000014;
}
static inline u32 ctxsw_prog_main_image_patch_adr_hi_o(void)
{
return 0x00000018;
}
static inline u32 ctxsw_prog_main_image_zcull_o(void)
{
return 0x0000001c;
}
static inline u32 ctxsw_prog_main_image_zcull_mode_no_ctxsw_v(void)
{
return 0x00000001;
}
static inline u32 ctxsw_prog_main_image_zcull_mode_separate_buffer_v(void)
{
return 0x00000002;
}
static inline u32 ctxsw_prog_main_image_zcull_ptr_o(void)
{
return 0x00000020;
}
static inline u32 ctxsw_prog_main_image_pm_o(void)
{
return 0x00000028;
}
static inline u32 ctxsw_prog_main_image_pm_mode_m(void)
{
return 0x7 << 0;
}
static inline u32 ctxsw_prog_main_image_pm_mode_no_ctxsw_f(void)
{
return 0x0;
}
static inline u32 ctxsw_prog_main_image_pm_smpc_mode_m(void)
{
return 0x7 << 3;
}
static inline u32 ctxsw_prog_main_image_pm_smpc_mode_ctxsw_f(void)
{
return 0x8;
}
static inline u32 ctxsw_prog_main_image_pm_smpc_mode_no_ctxsw_f(void)
{
return 0x0;
}
static inline u32 ctxsw_prog_main_image_pm_ptr_o(void)
{
return 0x0000002c;
}
static inline u32 ctxsw_prog_main_image_num_save_ops_o(void)
{
return 0x000000f4;
}
static inline u32 ctxsw_prog_main_image_num_wfi_save_ops_o(void)
{
return 0x000000d0;
}
static inline u32 ctxsw_prog_main_image_num_cta_save_ops_o(void)
{
return 0x000000d4;
}
static inline u32 ctxsw_prog_main_image_num_gfxp_save_ops_o(void)
{
return 0x000000d8;
}
static inline u32 ctxsw_prog_main_image_num_cilp_save_ops_o(void)
{
return 0x000000dc;
}
static inline u32 ctxsw_prog_main_image_num_restore_ops_o(void)
{
return 0x000000f8;
}
static inline u32 ctxsw_prog_main_image_zcull_ptr_hi_o(void)
{
return 0x00000060;
}
static inline u32 ctxsw_prog_main_image_zcull_ptr_hi_v_f(u32 v)
{
return (v & 0x1ffff) << 0;
}
static inline u32 ctxsw_prog_main_image_pm_ptr_hi_o(void)
{
return 0x00000094;
}
static inline u32 ctxsw_prog_main_image_full_preemption_ptr_hi_o(void)
{
return 0x00000064;
}
static inline u32 ctxsw_prog_main_image_full_preemption_ptr_hi_v_f(u32 v)
{
return (v & 0x1ffff) << 0;
}
static inline u32 ctxsw_prog_main_image_full_preemption_ptr_o(void)
{
return 0x00000068;
}
static inline u32 ctxsw_prog_main_image_full_preemption_ptr_v_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ctxsw_prog_main_image_full_preemption_ptr_veid0_hi_o(void)
{
return 0x00000070;
}
static inline u32 ctxsw_prog_main_image_full_preemption_ptr_veid0_hi_v_f(u32 v)
{
return (v & 0x1ffff) << 0;
}
static inline u32 ctxsw_prog_main_image_full_preemption_ptr_veid0_o(void)
{
return 0x00000074;
}
static inline u32 ctxsw_prog_main_image_full_preemption_ptr_veid0_v_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ctxsw_prog_main_image_context_buffer_ptr_hi_o(void)
{
return 0x00000078;
}
static inline u32 ctxsw_prog_main_image_context_buffer_ptr_hi_v_f(u32 v)
{
return (v & 0x1ffff) << 0;
}
static inline u32 ctxsw_prog_main_image_context_buffer_ptr_o(void)
{
return 0x0000007c;
}
static inline u32 ctxsw_prog_main_image_context_buffer_ptr_v_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ctxsw_prog_main_image_magic_value_o(void)
{
return 0x000000fc;
}
static inline u32 ctxsw_prog_main_image_magic_value_v_value_v(void)
{
return 0x600dc0de;
}
static inline u32 ctxsw_prog_local_priv_register_ctl_o(void)
{
return 0x0000000c;
}
static inline u32 ctxsw_prog_local_priv_register_ctl_offset_v(u32 r)
{
return (r >> 0) & 0xffff;
}
static inline u32 ctxsw_prog_main_image_global_cb_ptr_o(void)
{
return 0x000000b8;
}
static inline u32 ctxsw_prog_main_image_global_cb_ptr_v_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ctxsw_prog_main_image_global_cb_ptr_hi_o(void)
{
return 0x000000bc;
}
static inline u32 ctxsw_prog_main_image_global_cb_ptr_hi_v_f(u32 v)
{
return (v & 0x1ffff) << 0;
}
static inline u32 ctxsw_prog_main_image_global_pagepool_ptr_o(void)
{
return 0x000000c0;
}
static inline u32 ctxsw_prog_main_image_global_pagepool_ptr_v_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ctxsw_prog_main_image_global_pagepool_ptr_hi_o(void)
{
return 0x000000c4;
}
static inline u32 ctxsw_prog_main_image_global_pagepool_ptr_hi_v_f(u32 v)
{
return (v & 0x1ffff) << 0;
}
static inline u32 ctxsw_prog_main_image_control_block_ptr_o(void)
{
return 0x000000c8;
}
static inline u32 ctxsw_prog_main_image_control_block_ptr_v_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ctxsw_prog_main_image_control_block_ptr_hi_o(void)
{
return 0x000000cc;
}
static inline u32 ctxsw_prog_main_image_control_block_ptr_hi_v_f(u32 v)
{
return (v & 0x1ffff) << 0;
}
static inline u32 ctxsw_prog_main_image_context_ramchain_buffer_addr_lo_o(void)
{
return 0x000000e0;
}
static inline u32 ctxsw_prog_main_image_context_ramchain_buffer_addr_lo_v_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ctxsw_prog_main_image_context_ramchain_buffer_addr_hi_o(void)
{
return 0x000000e4;
}
static inline u32 ctxsw_prog_main_image_context_ramchain_buffer_addr_hi_v_f(u32 v)
{
return (v & 0x1ffff) << 0;
}
static inline u32 ctxsw_prog_local_image_ppc_info_o(void)
{
return 0x000000f4;
}
static inline u32 ctxsw_prog_local_image_ppc_info_num_ppcs_v(u32 r)
{
return (r >> 0) & 0xffff;
}
static inline u32 ctxsw_prog_local_image_ppc_info_ppc_mask_v(u32 r)
{
return (r >> 16) & 0xffff;
}
static inline u32 ctxsw_prog_local_image_num_tpcs_o(void)
{
return 0x000000f8;
}
static inline u32 ctxsw_prog_local_magic_value_o(void)
{
return 0x000000fc;
}
static inline u32 ctxsw_prog_local_magic_value_v_value_v(void)
{
return 0xad0becab;
}
static inline u32 ctxsw_prog_main_extended_buffer_ctl_o(void)
{
return 0x000000ec;
}
static inline u32 ctxsw_prog_main_extended_buffer_ctl_offset_v(u32 r)
{
return (r >> 0) & 0xffff;
}
static inline u32 ctxsw_prog_main_extended_buffer_ctl_size_v(u32 r)
{
return (r >> 16) & 0xff;
}
static inline u32 ctxsw_prog_extended_buffer_segments_size_in_bytes_v(void)
{
return 0x00000100;
}
static inline u32 ctxsw_prog_extended_marker_size_in_bytes_v(void)
{
return 0x00000004;
}
static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_register_stride_v(void)
{
return 0x00000000;
}
static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_control_register_stride_v(void)
{
return 0x00000002;
}
static inline u32 ctxsw_prog_main_image_priv_access_map_config_o(void)
{
return 0x000000a0;
}
static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_s(void)
{
return 2;
}
static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_f(u32 v)
{
return (v & 0x3) << 0;
}
static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_m(void)
{
return 0x3 << 0;
}
static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_v(u32 r)
{
return (r >> 0) & 0x3;
}
static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_allow_all_f(void)
{
return 0x0;
}
static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_use_map_f(void)
{
return 0x2;
}
static inline u32 ctxsw_prog_main_image_priv_access_map_addr_lo_o(void)
{
return 0x000000a4;
}
static inline u32 ctxsw_prog_main_image_priv_access_map_addr_hi_o(void)
{
return 0x000000a8;
}
static inline u32 ctxsw_prog_main_image_misc_options_o(void)
{
return 0x0000003c;
}
static inline u32 ctxsw_prog_main_image_misc_options_verif_features_m(void)
{
return 0x1 << 3;
}
static inline u32 ctxsw_prog_main_image_misc_options_verif_features_disabled_f(void)
{
return 0x0;
}
static inline u32 ctxsw_prog_main_image_graphics_preemption_options_o(void)
{
return 0x00000080;
}
static inline u32 ctxsw_prog_main_image_graphics_preemption_options_control_f(u32 v)
{
return (v & 0x3) << 0;
}
static inline u32 ctxsw_prog_main_image_graphics_preemption_options_control_gfxp_f(void)
{
return 0x1;
}
static inline u32 ctxsw_prog_main_image_compute_preemption_options_o(void)
{
return 0x00000084;
}
static inline u32 ctxsw_prog_main_image_compute_preemption_options_control_f(u32 v)
{
return (v & 0x3) << 0;
}
static inline u32 ctxsw_prog_main_image_compute_preemption_options_control_cta_f(void)
{
return 0x1;
}
static inline u32 ctxsw_prog_main_image_compute_preemption_options_control_cilp_f(void)
{
return 0x2;
}
#endif

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,545 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_fifo_gv100_h_
#define _hw_fifo_gv100_h_
static inline u32 fifo_bar1_base_r(void)
{
return 0x00002254;
}
static inline u32 fifo_bar1_base_ptr_f(u32 v)
{
return (v & 0xfffffff) << 0;
}
static inline u32 fifo_bar1_base_ptr_align_shift_v(void)
{
return 0x0000000c;
}
static inline u32 fifo_bar1_base_valid_false_f(void)
{
return 0x0;
}
static inline u32 fifo_bar1_base_valid_true_f(void)
{
return 0x10000000;
}
static inline u32 fifo_userd_writeback_r(void)
{
return 0x0000225c;
}
static inline u32 fifo_userd_writeback_timer_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 fifo_userd_writeback_timer_disabled_v(void)
{
return 0x00000000;
}
static inline u32 fifo_userd_writeback_timer_shorter_v(void)
{
return 0x00000003;
}
static inline u32 fifo_userd_writeback_timer_100us_v(void)
{
return 0x00000064;
}
static inline u32 fifo_userd_writeback_timescale_f(u32 v)
{
return (v & 0xf) << 12;
}
static inline u32 fifo_userd_writeback_timescale_0_v(void)
{
return 0x00000000;
}
static inline u32 fifo_runlist_base_r(void)
{
return 0x00002270;
}
static inline u32 fifo_runlist_base_ptr_f(u32 v)
{
return (v & 0xfffffff) << 0;
}
static inline u32 fifo_runlist_base_target_vid_mem_f(void)
{
return 0x0;
}
static inline u32 fifo_runlist_base_target_sys_mem_coh_f(void)
{
return 0x20000000;
}
static inline u32 fifo_runlist_base_target_sys_mem_ncoh_f(void)
{
return 0x30000000;
}
static inline u32 fifo_runlist_r(void)
{
return 0x00002274;
}
static inline u32 fifo_runlist_engine_f(u32 v)
{
return (v & 0xf) << 20;
}
static inline u32 fifo_eng_runlist_base_r(u32 i)
{
return 0x00002280 + i*8;
}
static inline u32 fifo_eng_runlist_base__size_1_v(void)
{
return 0x0000000d;
}
static inline u32 fifo_eng_runlist_r(u32 i)
{
return 0x00002284 + i*8;
}
static inline u32 fifo_eng_runlist__size_1_v(void)
{
return 0x0000000d;
}
static inline u32 fifo_eng_runlist_length_f(u32 v)
{
return (v & 0xffff) << 0;
}
static inline u32 fifo_eng_runlist_length_max_v(void)
{
return 0x0000ffff;
}
static inline u32 fifo_eng_runlist_pending_true_f(void)
{
return 0x100000;
}
static inline u32 fifo_pb_timeslice_r(u32 i)
{
return 0x00002350 + i*4;
}
static inline u32 fifo_pb_timeslice_timeout_16_f(void)
{
return 0x10;
}
static inline u32 fifo_pb_timeslice_timescale_0_f(void)
{
return 0x0;
}
static inline u32 fifo_pb_timeslice_enable_true_f(void)
{
return 0x10000000;
}
static inline u32 fifo_pbdma_map_r(u32 i)
{
return 0x00002390 + i*4;
}
static inline u32 fifo_intr_0_r(void)
{
return 0x00002100;
}
static inline u32 fifo_intr_0_bind_error_pending_f(void)
{
return 0x1;
}
static inline u32 fifo_intr_0_bind_error_reset_f(void)
{
return 0x1;
}
static inline u32 fifo_intr_0_sched_error_pending_f(void)
{
return 0x100;
}
static inline u32 fifo_intr_0_sched_error_reset_f(void)
{
return 0x100;
}
static inline u32 fifo_intr_0_chsw_error_pending_f(void)
{
return 0x10000;
}
static inline u32 fifo_intr_0_chsw_error_reset_f(void)
{
return 0x10000;
}
static inline u32 fifo_intr_0_fb_flush_timeout_pending_f(void)
{
return 0x800000;
}
static inline u32 fifo_intr_0_fb_flush_timeout_reset_f(void)
{
return 0x800000;
}
static inline u32 fifo_intr_0_lb_error_pending_f(void)
{
return 0x1000000;
}
static inline u32 fifo_intr_0_lb_error_reset_f(void)
{
return 0x1000000;
}
static inline u32 fifo_intr_0_pbdma_intr_pending_f(void)
{
return 0x20000000;
}
static inline u32 fifo_intr_0_runlist_event_pending_f(void)
{
return 0x40000000;
}
static inline u32 fifo_intr_0_channel_intr_pending_f(void)
{
return 0x80000000;
}
static inline u32 fifo_intr_en_0_r(void)
{
return 0x00002140;
}
static inline u32 fifo_intr_en_0_sched_error_f(u32 v)
{
return (v & 0x1) << 8;
}
static inline u32 fifo_intr_en_0_sched_error_m(void)
{
return 0x1 << 8;
}
static inline u32 fifo_intr_en_1_r(void)
{
return 0x00002528;
}
static inline u32 fifo_intr_bind_error_r(void)
{
return 0x0000252c;
}
static inline u32 fifo_intr_sched_error_r(void)
{
return 0x0000254c;
}
static inline u32 fifo_intr_sched_error_code_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 fifo_intr_chsw_error_r(void)
{
return 0x0000256c;
}
static inline u32 fifo_intr_pbdma_id_r(void)
{
return 0x000025a0;
}
static inline u32 fifo_intr_pbdma_id_status_f(u32 v, u32 i)
{
return (v & 0x1) << (0 + i*1);
}
static inline u32 fifo_intr_pbdma_id_status_v(u32 r, u32 i)
{
return (r >> (0 + i*1)) & 0x1;
}
static inline u32 fifo_intr_pbdma_id_status__size_1_v(void)
{
return 0x0000000e;
}
static inline u32 fifo_intr_runlist_r(void)
{
return 0x00002a00;
}
static inline u32 fifo_fb_timeout_r(void)
{
return 0x00002a04;
}
static inline u32 fifo_fb_timeout_period_m(void)
{
return 0x3fffffff << 0;
}
static inline u32 fifo_fb_timeout_period_max_f(void)
{
return 0x3fffffff;
}
static inline u32 fifo_fb_timeout_period_init_f(void)
{
return 0x3c00;
}
static inline u32 fifo_sched_disable_r(void)
{
return 0x00002630;
}
static inline u32 fifo_sched_disable_runlist_f(u32 v, u32 i)
{
return (v & 0x1) << (0 + i*1);
}
static inline u32 fifo_sched_disable_runlist_m(u32 i)
{
return 0x1 << (0 + i*1);
}
static inline u32 fifo_sched_disable_true_v(void)
{
return 0x00000001;
}
static inline u32 fifo_runlist_preempt_r(void)
{
return 0x00002638;
}
static inline u32 fifo_runlist_preempt_runlist_f(u32 v, u32 i)
{
return (v & 0x1) << (0 + i*1);
}
static inline u32 fifo_runlist_preempt_runlist_m(u32 i)
{
return 0x1 << (0 + i*1);
}
static inline u32 fifo_runlist_preempt_runlist_pending_v(void)
{
return 0x00000001;
}
static inline u32 fifo_preempt_r(void)
{
return 0x00002634;
}
static inline u32 fifo_preempt_pending_true_f(void)
{
return 0x100000;
}
static inline u32 fifo_preempt_type_channel_f(void)
{
return 0x0;
}
static inline u32 fifo_preempt_type_tsg_f(void)
{
return 0x1000000;
}
static inline u32 fifo_preempt_chid_f(u32 v)
{
return (v & 0xfff) << 0;
}
static inline u32 fifo_preempt_id_f(u32 v)
{
return (v & 0xfff) << 0;
}
static inline u32 fifo_engine_status_r(u32 i)
{
return 0x00002640 + i*8;
}
static inline u32 fifo_engine_status__size_1_v(void)
{
return 0x0000000f;
}
static inline u32 fifo_engine_status_id_v(u32 r)
{
return (r >> 0) & 0xfff;
}
static inline u32 fifo_engine_status_id_type_v(u32 r)
{
return (r >> 12) & 0x1;
}
static inline u32 fifo_engine_status_id_type_chid_v(void)
{
return 0x00000000;
}
static inline u32 fifo_engine_status_id_type_tsgid_v(void)
{
return 0x00000001;
}
static inline u32 fifo_engine_status_ctx_status_v(u32 r)
{
return (r >> 13) & 0x7;
}
static inline u32 fifo_engine_status_ctx_status_valid_v(void)
{
return 0x00000001;
}
static inline u32 fifo_engine_status_ctx_status_ctxsw_load_v(void)
{
return 0x00000005;
}
static inline u32 fifo_engine_status_ctx_status_ctxsw_save_v(void)
{
return 0x00000006;
}
static inline u32 fifo_engine_status_ctx_status_ctxsw_switch_v(void)
{
return 0x00000007;
}
static inline u32 fifo_engine_status_next_id_v(u32 r)
{
return (r >> 16) & 0xfff;
}
static inline u32 fifo_engine_status_next_id_type_v(u32 r)
{
return (r >> 28) & 0x1;
}
static inline u32 fifo_engine_status_next_id_type_chid_v(void)
{
return 0x00000000;
}
static inline u32 fifo_engine_status_eng_reload_v(u32 r)
{
return (r >> 29) & 0x1;
}
static inline u32 fifo_engine_status_faulted_v(u32 r)
{
return (r >> 30) & 0x1;
}
static inline u32 fifo_engine_status_faulted_true_v(void)
{
return 0x00000001;
}
static inline u32 fifo_engine_status_engine_v(u32 r)
{
return (r >> 31) & 0x1;
}
static inline u32 fifo_engine_status_engine_idle_v(void)
{
return 0x00000000;
}
static inline u32 fifo_engine_status_engine_busy_v(void)
{
return 0x00000001;
}
static inline u32 fifo_engine_status_ctxsw_v(u32 r)
{
return (r >> 15) & 0x1;
}
static inline u32 fifo_engine_status_ctxsw_in_progress_v(void)
{
return 0x00000001;
}
static inline u32 fifo_engine_status_ctxsw_in_progress_f(void)
{
return 0x8000;
}
static inline u32 fifo_pbdma_status_r(u32 i)
{
return 0x00003080 + i*4;
}
static inline u32 fifo_pbdma_status__size_1_v(void)
{
return 0x0000000e;
}
static inline u32 fifo_pbdma_status_id_v(u32 r)
{
return (r >> 0) & 0xfff;
}
static inline u32 fifo_pbdma_status_id_type_v(u32 r)
{
return (r >> 12) & 0x1;
}
static inline u32 fifo_pbdma_status_id_type_chid_v(void)
{
return 0x00000000;
}
static inline u32 fifo_pbdma_status_id_type_tsgid_v(void)
{
return 0x00000001;
}
static inline u32 fifo_pbdma_status_chan_status_v(u32 r)
{
return (r >> 13) & 0x7;
}
static inline u32 fifo_pbdma_status_chan_status_valid_v(void)
{
return 0x00000001;
}
static inline u32 fifo_pbdma_status_chan_status_chsw_load_v(void)
{
return 0x00000005;
}
static inline u32 fifo_pbdma_status_chan_status_chsw_save_v(void)
{
return 0x00000006;
}
static inline u32 fifo_pbdma_status_chan_status_chsw_switch_v(void)
{
return 0x00000007;
}
static inline u32 fifo_pbdma_status_next_id_v(u32 r)
{
return (r >> 16) & 0xfff;
}
static inline u32 fifo_pbdma_status_next_id_type_v(u32 r)
{
return (r >> 28) & 0x1;
}
static inline u32 fifo_pbdma_status_next_id_type_chid_v(void)
{
return 0x00000000;
}
static inline u32 fifo_pbdma_status_chsw_v(u32 r)
{
return (r >> 15) & 0x1;
}
static inline u32 fifo_pbdma_status_chsw_in_progress_v(void)
{
return 0x00000001;
}
static inline u32 fifo_cfg0_r(void)
{
return 0x00002004;
}
static inline u32 fifo_cfg0_num_pbdma_v(u32 r)
{
return (r >> 0) & 0xff;
}
static inline u32 fifo_cfg0_pbdma_fault_id_v(u32 r)
{
return (r >> 16) & 0xff;
}
static inline u32 fifo_fb_iface_r(void)
{
return 0x000026f0;
}
static inline u32 fifo_fb_iface_control_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 fifo_fb_iface_control_enable_f(void)
{
return 0x1;
}
static inline u32 fifo_fb_iface_status_v(u32 r)
{
return (r >> 4) & 0x1;
}
static inline u32 fifo_fb_iface_status_enabled_f(void)
{
return 0x10;
}
#endif

View File

@@ -0,0 +1,181 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_flush_gv100_h_
#define _hw_flush_gv100_h_
static inline u32 flush_l2_system_invalidate_r(void)
{
return 0x00070004;
}
static inline u32 flush_l2_system_invalidate_pending_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 flush_l2_system_invalidate_pending_busy_v(void)
{
return 0x00000001;
}
static inline u32 flush_l2_system_invalidate_pending_busy_f(void)
{
return 0x1;
}
static inline u32 flush_l2_system_invalidate_outstanding_v(u32 r)
{
return (r >> 1) & 0x1;
}
static inline u32 flush_l2_system_invalidate_outstanding_true_v(void)
{
return 0x00000001;
}
static inline u32 flush_l2_flush_dirty_r(void)
{
return 0x00070010;
}
static inline u32 flush_l2_flush_dirty_pending_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 flush_l2_flush_dirty_pending_empty_v(void)
{
return 0x00000000;
}
static inline u32 flush_l2_flush_dirty_pending_empty_f(void)
{
return 0x0;
}
static inline u32 flush_l2_flush_dirty_pending_busy_v(void)
{
return 0x00000001;
}
static inline u32 flush_l2_flush_dirty_pending_busy_f(void)
{
return 0x1;
}
static inline u32 flush_l2_flush_dirty_outstanding_v(u32 r)
{
return (r >> 1) & 0x1;
}
static inline u32 flush_l2_flush_dirty_outstanding_false_v(void)
{
return 0x00000000;
}
static inline u32 flush_l2_flush_dirty_outstanding_false_f(void)
{
return 0x0;
}
static inline u32 flush_l2_flush_dirty_outstanding_true_v(void)
{
return 0x00000001;
}
static inline u32 flush_l2_clean_comptags_r(void)
{
return 0x0007000c;
}
static inline u32 flush_l2_clean_comptags_pending_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 flush_l2_clean_comptags_pending_empty_v(void)
{
return 0x00000000;
}
static inline u32 flush_l2_clean_comptags_pending_empty_f(void)
{
return 0x0;
}
static inline u32 flush_l2_clean_comptags_pending_busy_v(void)
{
return 0x00000001;
}
static inline u32 flush_l2_clean_comptags_pending_busy_f(void)
{
return 0x1;
}
static inline u32 flush_l2_clean_comptags_outstanding_v(u32 r)
{
return (r >> 1) & 0x1;
}
static inline u32 flush_l2_clean_comptags_outstanding_false_v(void)
{
return 0x00000000;
}
static inline u32 flush_l2_clean_comptags_outstanding_false_f(void)
{
return 0x0;
}
static inline u32 flush_l2_clean_comptags_outstanding_true_v(void)
{
return 0x00000001;
}
static inline u32 flush_fb_flush_r(void)
{
return 0x00070000;
}
static inline u32 flush_fb_flush_pending_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 flush_fb_flush_pending_busy_v(void)
{
return 0x00000001;
}
static inline u32 flush_fb_flush_pending_busy_f(void)
{
return 0x1;
}
static inline u32 flush_fb_flush_outstanding_v(u32 r)
{
return (r >> 1) & 0x1;
}
static inline u32 flush_fb_flush_outstanding_true_v(void)
{
return 0x00000001;
}
#endif

View File

@@ -0,0 +1,137 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_fuse_gv100_h_
#define _hw_fuse_gv100_h_
static inline u32 fuse_status_opt_tpc_gpc_r(u32 i)
{
return 0x00021c38 + i*4;
}
static inline u32 fuse_ctrl_opt_tpc_gpc_r(u32 i)
{
return 0x00021838 + i*4;
}
static inline u32 fuse_ctrl_opt_ram_svop_pdp_r(void)
{
return 0x00021944;
}
static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_m(void)
{
return 0xff << 0;
}
static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_v(u32 r)
{
return (r >> 0) & 0xff;
}
static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_r(void)
{
return 0x00021948;
}
static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_f(u32 v)
{
return (v & 0x1) << 0;
}
static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_m(void)
{
return 0x1 << 0;
}
static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_yes_f(void)
{
return 0x1;
}
static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_no_f(void)
{
return 0x0;
}
static inline u32 fuse_status_opt_fbio_r(void)
{
return 0x00021c14;
}
static inline u32 fuse_status_opt_fbio_data_f(u32 v)
{
return (v & 0xffff) << 0;
}
static inline u32 fuse_status_opt_fbio_data_m(void)
{
return 0xffff << 0;
}
static inline u32 fuse_status_opt_fbio_data_v(u32 r)
{
return (r >> 0) & 0xffff;
}
static inline u32 fuse_status_opt_rop_l2_fbp_r(u32 i)
{
return 0x00021d70 + i*4;
}
static inline u32 fuse_status_opt_fbp_r(void)
{
return 0x00021d38;
}
static inline u32 fuse_status_opt_fbp_idx_v(u32 r, u32 i)
{
return (r >> (0 + i*1)) & 0x1;
}
static inline u32 fuse_opt_ecc_en_r(void)
{
return 0x00021228;
}
static inline u32 fuse_opt_feature_fuses_override_disable_r(void)
{
return 0x000213f0;
}
#endif

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,613 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_ltc_gv100_h_
#define _hw_ltc_gv100_h_
static inline u32 ltc_pltcg_base_v(void)
{
return 0x00140000;
}
static inline u32 ltc_pltcg_extent_v(void)
{
return 0x0017ffff;
}
static inline u32 ltc_ltc0_ltss_v(void)
{
return 0x00140200;
}
static inline u32 ltc_ltc0_lts0_v(void)
{
return 0x00140400;
}
static inline u32 ltc_ltcs_ltss_v(void)
{
return 0x0017e200;
}
static inline u32 ltc_ltcs_lts0_cbc_ctrl1_r(void)
{
return 0x0014046c;
}
static inline u32 ltc_ltc0_lts0_dstg_cfg0_r(void)
{
return 0x00140518;
}
static inline u32 ltc_ltcs_ltss_dstg_cfg0_r(void)
{
return 0x0017e318;
}
static inline u32 ltc_ltcs_ltss_dstg_cfg0_vdc_4to2_disable_m(void)
{
return 0x1 << 15;
}
static inline u32 ltc_ltc0_lts0_tstg_cfg1_r(void)
{
return 0x00140494;
}
static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_ways_v(u32 r)
{
return (r >> 0) & 0xffff;
}
static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_v(u32 r)
{
return (r >> 16) & 0x3;
}
static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_all_v(void)
{
return 0x00000000;
}
static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_half_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_quarter_v(void)
{
return 0x00000002;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl1_r(void)
{
return 0x0017e26c;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clean_active_f(void)
{
return 0x1;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl1_invalidate_active_f(void)
{
return 0x2;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_v(u32 r)
{
return (r >> 2) & 0x1;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_active_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_active_f(void)
{
return 0x4;
}
static inline u32 ltc_ltc0_lts0_cbc_ctrl1_r(void)
{
return 0x0014046c;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl2_r(void)
{
return 0x0017e270;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl2_clear_lower_bound_f(u32 v)
{
return (v & 0x3ffff) << 0;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl3_r(void)
{
return 0x0017e274;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl3_clear_upper_bound_f(u32 v)
{
return (v & 0x3ffff) << 0;
}
static inline u32 ltc_ltcs_ltss_cbc_ctrl3_clear_upper_bound_init_v(void)
{
return 0x0003ffff;
}
static inline u32 ltc_ltcs_ltss_cbc_base_r(void)
{
return 0x0017e278;
}
static inline u32 ltc_ltcs_ltss_cbc_base_alignment_shift_v(void)
{
return 0x0000000b;
}
static inline u32 ltc_ltcs_ltss_cbc_base_address_v(u32 r)
{
return (r >> 0) & 0x3ffffff;
}
static inline u32 ltc_ltcs_ltss_cbc_num_active_ltcs_r(void)
{
return 0x0017e27c;
}
static inline u32 ltc_ltcs_ltss_cbc_num_active_ltcs__v(u32 r)
{
return (r >> 0) & 0x1f;
}
static inline u32 ltc_ltcs_ltss_cbc_num_active_ltcs_nvlink_peer_through_l2_f(u32 v)
{
return (v & 0x1) << 24;
}
static inline u32 ltc_ltcs_ltss_cbc_num_active_ltcs_nvlink_peer_through_l2_v(u32 r)
{
return (r >> 24) & 0x1;
}
static inline u32 ltc_ltcs_ltss_cbc_num_active_ltcs_serialize_f(u32 v)
{
return (v & 0x1) << 25;
}
static inline u32 ltc_ltcs_ltss_cbc_num_active_ltcs_serialize_v(u32 r)
{
return (r >> 25) & 0x1;
}
static inline u32 ltc_ltcs_misc_ltc_num_active_ltcs_r(void)
{
return 0x0017e000;
}
static inline u32 ltc_ltcs_ltss_cbc_param_r(void)
{
return 0x0017e280;
}
static inline u32 ltc_ltcs_ltss_cbc_param_comptags_per_cache_line_v(u32 r)
{
return (r >> 0) & 0xffff;
}
static inline u32 ltc_ltcs_ltss_cbc_param_cache_line_size_v(u32 r)
{
return (r >> 24) & 0xf;
}
static inline u32 ltc_ltcs_ltss_cbc_param_slices_per_ltc_v(u32 r)
{
return (r >> 28) & 0xf;
}
static inline u32 ltc_ltcs_ltss_cbc_param2_r(void)
{
return 0x0017e3f4;
}
static inline u32 ltc_ltcs_ltss_cbc_param2_gobs_per_comptagline_per_slice_v(u32 r)
{
return (r >> 0) & 0xffff;
}
static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_r(void)
{
return 0x0017e2ac;
}
static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_max_ways_evict_last_f(u32 v)
{
return (v & 0x1f) << 16;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_index_r(void)
{
return 0x0017e338;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_index_address_f(u32 v)
{
return (v & 0xf) << 0;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_color_clear_value_r(u32 i)
{
return 0x0017e33c + i*4;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_color_clear_value__size_1_v(void)
{
return 0x00000004;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_r(void)
{
return 0x0017e34c;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_s(void)
{
return 32;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_m(void)
{
return 0xffffffff << 0;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_v(u32 r)
{
return (r >> 0) & 0xffffffff;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_stencil_clear_value_r(void)
{
return 0x0017e204;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_stencil_clear_value_field_s(void)
{
return 8;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_stencil_clear_value_field_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_stencil_clear_value_field_m(void)
{
return 0xff << 0;
}
static inline u32 ltc_ltcs_ltss_dstg_zbc_stencil_clear_value_field_v(u32 r)
{
return (r >> 0) & 0xff;
}
static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_r(void)
{
return 0x0017e2b0;
}
static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f(void)
{
return 0x10000000;
}
static inline u32 ltc_ltcs_ltss_g_elpg_r(void)
{
return 0x0017e214;
}
static inline u32 ltc_ltcs_ltss_g_elpg_flush_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_f(void)
{
return 0x1;
}
static inline u32 ltc_ltc0_ltss_g_elpg_r(void)
{
return 0x00140214;
}
static inline u32 ltc_ltc0_ltss_g_elpg_flush_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_f(void)
{
return 0x1;
}
static inline u32 ltc_ltc1_ltss_g_elpg_r(void)
{
return 0x00142214;
}
static inline u32 ltc_ltc1_ltss_g_elpg_flush_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 ltc_ltc1_ltss_g_elpg_flush_pending_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltc1_ltss_g_elpg_flush_pending_f(void)
{
return 0x1;
}
static inline u32 ltc_ltcs_ltss_intr_r(void)
{
return 0x0017e20c;
}
static inline u32 ltc_ltcs_ltss_intr_ecc_sec_error_pending_f(void)
{
return 0x100;
}
static inline u32 ltc_ltcs_ltss_intr_ecc_ded_error_pending_f(void)
{
return 0x200;
}
static inline u32 ltc_ltcs_ltss_intr_en_evicted_cb_m(void)
{
return 0x1 << 20;
}
static inline u32 ltc_ltcs_ltss_intr_en_illegal_compstat_access_m(void)
{
return 0x1 << 30;
}
static inline u32 ltc_ltcs_ltss_intr_en_ecc_sec_error_enabled_f(void)
{
return 0x1000000;
}
static inline u32 ltc_ltcs_ltss_intr_en_ecc_ded_error_enabled_f(void)
{
return 0x2000000;
}
static inline u32 ltc_ltc0_lts0_intr_r(void)
{
return 0x0014040c;
}
static inline u32 ltc_ltc0_lts0_dstg_ecc_report_r(void)
{
return 0x0014051c;
}
static inline u32 ltc_ltc0_lts0_dstg_ecc_report_sec_count_m(void)
{
return 0xff << 0;
}
static inline u32 ltc_ltc0_lts0_dstg_ecc_report_sec_count_v(u32 r)
{
return (r >> 0) & 0xff;
}
static inline u32 ltc_ltc0_lts0_dstg_ecc_report_ded_count_m(void)
{
return 0xff << 16;
}
static inline u32 ltc_ltc0_lts0_dstg_ecc_report_ded_count_v(u32 r)
{
return (r >> 16) & 0xff;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_r(void)
{
return 0x0017e2a0;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_pending_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_pending_f(void)
{
return 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_v(u32 r)
{
return (r >> 8) & 0xf;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_3_v(void)
{
return 0x00000003;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_3_f(void)
{
return 0x300;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_v(u32 r)
{
return (r >> 28) & 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_true_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_true_f(void)
{
return 0x10000000;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_v(u32 r)
{
return (r >> 29) & 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_true_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_true_f(void)
{
return 0x20000000;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_v(u32 r)
{
return (r >> 30) & 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_f(void)
{
return 0x40000000;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_r(void)
{
return 0x0017e2a4;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_pending_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_pending_f(void)
{
return 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_v(u32 r)
{
return (r >> 8) & 0xf;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_3_v(void)
{
return 0x00000003;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_3_f(void)
{
return 0x300;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_v(u32 r)
{
return (r >> 16) & 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_true_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_true_f(void)
{
return 0x10000;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_v(u32 r)
{
return (r >> 28) & 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_true_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_true_f(void)
{
return 0x10000000;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_v(u32 r)
{
return (r >> 29) & 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_true_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_true_f(void)
{
return 0x20000000;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_v(u32 r)
{
return (r >> 30) & 0x1;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_f(void)
{
return 0x40000000;
}
static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_r(void)
{
return 0x001402a0;
}
static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_f(void)
{
return 0x1;
}
static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_r(void)
{
return 0x001402a4;
}
static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_f(void)
{
return 0x1;
}
static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_r(void)
{
return 0x001422a0;
}
static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_pending_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_pending_f(void)
{
return 0x1;
}
static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_r(void)
{
return 0x001422a4;
}
static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_v(void)
{
return 0x00000001;
}
static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_f(void)
{
return 0x1;
}
static inline u32 ltc_ltc0_lts0_tstg_info_1_r(void)
{
return 0x0014058c;
}
static inline u32 ltc_ltc0_lts0_tstg_info_1_slice_size_in_kb_v(u32 r)
{
return (r >> 0) & 0xffff;
}
static inline u32 ltc_ltc0_lts0_tstg_info_1_slices_per_l2_v(u32 r)
{
return (r >> 16) & 0x1f;
}
#endif

View File

@@ -0,0 +1,245 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_mc_gv100_h_
#define _hw_mc_gv100_h_
static inline u32 mc_boot_0_r(void)
{
return 0x00000000;
}
static inline u32 mc_boot_0_architecture_v(u32 r)
{
return (r >> 24) & 0x1f;
}
static inline u32 mc_boot_0_implementation_v(u32 r)
{
return (r >> 20) & 0xf;
}
static inline u32 mc_boot_0_major_revision_v(u32 r)
{
return (r >> 4) & 0xf;
}
static inline u32 mc_boot_0_minor_revision_v(u32 r)
{
return (r >> 0) & 0xf;
}
static inline u32 mc_intr_r(u32 i)
{
return 0x00000100 + i*4;
}
static inline u32 mc_intr_pfifo_pending_f(void)
{
return 0x100;
}
static inline u32 mc_intr_hub_pending_f(void)
{
return 0x200;
}
static inline u32 mc_intr_pgraph_pending_f(void)
{
return 0x1000;
}
static inline u32 mc_intr_pmu_pending_f(void)
{
return 0x1000000;
}
static inline u32 mc_intr_ltc_pending_f(void)
{
return 0x2000000;
}
static inline u32 mc_intr_priv_ring_pending_f(void)
{
return 0x40000000;
}
static inline u32 mc_intr_pbus_pending_f(void)
{
return 0x10000000;
}
static inline u32 mc_intr_en_r(u32 i)
{
return 0x00000140 + i*4;
}
static inline u32 mc_intr_en_set_r(u32 i)
{
return 0x00000160 + i*4;
}
static inline u32 mc_intr_en_clear_r(u32 i)
{
return 0x00000180 + i*4;
}
static inline u32 mc_enable_r(void)
{
return 0x00000200;
}
static inline u32 mc_enable_xbar_enabled_f(void)
{
return 0x4;
}
static inline u32 mc_enable_l2_enabled_f(void)
{
return 0x8;
}
static inline u32 mc_enable_pmedia_s(void)
{
return 1;
}
static inline u32 mc_enable_pmedia_f(u32 v)
{
return (v & 0x1) << 4;
}
static inline u32 mc_enable_pmedia_m(void)
{
return 0x1 << 4;
}
static inline u32 mc_enable_pmedia_v(u32 r)
{
return (r >> 4) & 0x1;
}
static inline u32 mc_enable_ce0_m(void)
{
return 0x1 << 6;
}
static inline u32 mc_enable_pfifo_enabled_f(void)
{
return 0x100;
}
static inline u32 mc_enable_pgraph_enabled_f(void)
{
return 0x1000;
}
static inline u32 mc_enable_pwr_v(u32 r)
{
return (r >> 13) & 0x1;
}
static inline u32 mc_enable_pwr_disabled_v(void)
{
return 0x00000000;
}
static inline u32 mc_enable_pwr_enabled_f(void)
{
return 0x2000;
}
static inline u32 mc_enable_pfb_enabled_f(void)
{
return 0x100000;
}
static inline u32 mc_enable_ce2_m(void)
{
return 0x1 << 21;
}
static inline u32 mc_enable_ce2_enabled_f(void)
{
return 0x200000;
}
static inline u32 mc_enable_blg_enabled_f(void)
{
return 0x8000000;
}
static inline u32 mc_enable_perfmon_enabled_f(void)
{
return 0x10000000;
}
static inline u32 mc_enable_hub_enabled_f(void)
{
return 0x20000000;
}
static inline u32 mc_intr_ltc_r(void)
{
return 0x000001c0;
}
static inline u32 mc_enable_pb_r(void)
{
return 0x00000204;
}
static inline u32 mc_enable_pb_0_s(void)
{
return 1;
}
static inline u32 mc_enable_pb_0_f(u32 v)
{
return (v & 0x1) << 0;
}
static inline u32 mc_enable_pb_0_m(void)
{
return 0x1 << 0;
}
static inline u32 mc_enable_pb_0_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 mc_enable_pb_0_enabled_v(void)
{
return 0x00000001;
}
static inline u32 mc_enable_pb_sel_f(u32 v, u32 i)
{
return (v & 0x1) << (0 + i*1);
}
static inline u32 mc_elpg_enable_r(void)
{
return 0x0000020c;
}
static inline u32 mc_elpg_enable_xbar_enabled_f(void)
{
return 0x4;
}
static inline u32 mc_elpg_enable_pfb_enabled_f(void)
{
return 0x100000;
}
static inline u32 mc_elpg_enable_hub_enabled_f(void)
{
return 0x20000000;
}
static inline u32 mc_elpg_enable_l2_enabled_f(void)
{
return 0x8;
}
#endif

View File

@@ -0,0 +1,645 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_pbdma_gv100_h_
#define _hw_pbdma_gv100_h_
static inline u32 pbdma_gp_entry1_r(void)
{
return 0x10000004;
}
static inline u32 pbdma_gp_entry1_get_hi_v(u32 r)
{
return (r >> 0) & 0xff;
}
static inline u32 pbdma_gp_entry1_length_f(u32 v)
{
return (v & 0x1fffff) << 10;
}
static inline u32 pbdma_gp_entry1_length_v(u32 r)
{
return (r >> 10) & 0x1fffff;
}
static inline u32 pbdma_gp_base_r(u32 i)
{
return 0x00040048 + i*8192;
}
static inline u32 pbdma_gp_base__size_1_v(void)
{
return 0x0000000e;
}
static inline u32 pbdma_gp_base_offset_f(u32 v)
{
return (v & 0x1fffffff) << 3;
}
static inline u32 pbdma_gp_base_rsvd_s(void)
{
return 3;
}
static inline u32 pbdma_gp_base_hi_r(u32 i)
{
return 0x0004004c + i*8192;
}
static inline u32 pbdma_gp_base_hi_offset_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 pbdma_gp_base_hi_limit2_f(u32 v)
{
return (v & 0x1f) << 16;
}
static inline u32 pbdma_gp_fetch_r(u32 i)
{
return 0x00040050 + i*8192;
}
static inline u32 pbdma_gp_get_r(u32 i)
{
return 0x00040014 + i*8192;
}
static inline u32 pbdma_gp_put_r(u32 i)
{
return 0x00040000 + i*8192;
}
static inline u32 pbdma_pb_fetch_r(u32 i)
{
return 0x00040054 + i*8192;
}
static inline u32 pbdma_pb_fetch_hi_r(u32 i)
{
return 0x00040058 + i*8192;
}
static inline u32 pbdma_get_r(u32 i)
{
return 0x00040018 + i*8192;
}
static inline u32 pbdma_get_hi_r(u32 i)
{
return 0x0004001c + i*8192;
}
static inline u32 pbdma_put_r(u32 i)
{
return 0x0004005c + i*8192;
}
static inline u32 pbdma_put_hi_r(u32 i)
{
return 0x00040060 + i*8192;
}
static inline u32 pbdma_pb_header_r(u32 i)
{
return 0x00040084 + i*8192;
}
static inline u32 pbdma_pb_header_priv_user_f(void)
{
return 0x0;
}
static inline u32 pbdma_pb_header_method_zero_f(void)
{
return 0x0;
}
static inline u32 pbdma_pb_header_subchannel_zero_f(void)
{
return 0x0;
}
static inline u32 pbdma_pb_header_level_main_f(void)
{
return 0x0;
}
static inline u32 pbdma_pb_header_first_true_f(void)
{
return 0x400000;
}
static inline u32 pbdma_pb_header_type_inc_f(void)
{
return 0x20000000;
}
static inline u32 pbdma_pb_header_type_non_inc_f(void)
{
return 0x60000000;
}
static inline u32 pbdma_hdr_shadow_r(u32 i)
{
return 0x00040118 + i*8192;
}
static inline u32 pbdma_subdevice_r(u32 i)
{
return 0x00040094 + i*8192;
}
static inline u32 pbdma_subdevice_id_f(u32 v)
{
return (v & 0xfff) << 0;
}
static inline u32 pbdma_subdevice_status_active_f(void)
{
return 0x10000000;
}
static inline u32 pbdma_subdevice_channel_dma_enable_f(void)
{
return 0x20000000;
}
static inline u32 pbdma_method0_r(u32 i)
{
return 0x000400c0 + i*8192;
}
static inline u32 pbdma_method0_fifo_size_v(void)
{
return 0x00000004;
}
static inline u32 pbdma_method0_addr_f(u32 v)
{
return (v & 0xfff) << 2;
}
static inline u32 pbdma_method0_addr_v(u32 r)
{
return (r >> 2) & 0xfff;
}
static inline u32 pbdma_method0_subch_v(u32 r)
{
return (r >> 16) & 0x7;
}
static inline u32 pbdma_method0_first_true_f(void)
{
return 0x400000;
}
static inline u32 pbdma_method0_valid_true_f(void)
{
return 0x80000000;
}
static inline u32 pbdma_method1_r(u32 i)
{
return 0x000400c8 + i*8192;
}
static inline u32 pbdma_method2_r(u32 i)
{
return 0x000400d0 + i*8192;
}
static inline u32 pbdma_method3_r(u32 i)
{
return 0x000400d8 + i*8192;
}
static inline u32 pbdma_data0_r(u32 i)
{
return 0x000400c4 + i*8192;
}
static inline u32 pbdma_acquire_r(u32 i)
{
return 0x00040030 + i*8192;
}
static inline u32 pbdma_acquire_retry_man_2_f(void)
{
return 0x2;
}
static inline u32 pbdma_acquire_retry_exp_2_f(void)
{
return 0x100;
}
static inline u32 pbdma_acquire_timeout_exp_f(u32 v)
{
return (v & 0xf) << 11;
}
static inline u32 pbdma_acquire_timeout_exp_max_v(void)
{
return 0x0000000f;
}
static inline u32 pbdma_acquire_timeout_exp_max_f(void)
{
return 0x7800;
}
static inline u32 pbdma_acquire_timeout_man_f(u32 v)
{
return (v & 0xffff) << 15;
}
static inline u32 pbdma_acquire_timeout_man_max_v(void)
{
return 0x0000ffff;
}
static inline u32 pbdma_acquire_timeout_man_max_f(void)
{
return 0x7fff8000;
}
static inline u32 pbdma_acquire_timeout_en_enable_f(void)
{
return 0x80000000;
}
static inline u32 pbdma_acquire_timeout_en_disable_f(void)
{
return 0x0;
}
static inline u32 pbdma_status_r(u32 i)
{
return 0x00040100 + i*8192;
}
static inline u32 pbdma_channel_r(u32 i)
{
return 0x00040120 + i*8192;
}
static inline u32 pbdma_signature_r(u32 i)
{
return 0x00040010 + i*8192;
}
static inline u32 pbdma_signature_hw_valid_f(void)
{
return 0xface;
}
static inline u32 pbdma_signature_sw_zero_f(void)
{
return 0x0;
}
static inline u32 pbdma_userd_r(u32 i)
{
return 0x00040008 + i*8192;
}
static inline u32 pbdma_userd_target_vid_mem_f(void)
{
return 0x0;
}
static inline u32 pbdma_userd_target_sys_mem_coh_f(void)
{
return 0x2;
}
static inline u32 pbdma_userd_target_sys_mem_ncoh_f(void)
{
return 0x3;
}
static inline u32 pbdma_userd_addr_f(u32 v)
{
return (v & 0x7fffff) << 9;
}
static inline u32 pbdma_config_r(u32 i)
{
return 0x000400f4 + i*8192;
}
static inline u32 pbdma_config_l2_evict_first_f(void)
{
return 0x0;
}
static inline u32 pbdma_config_l2_evict_normal_f(void)
{
return 0x1;
}
static inline u32 pbdma_config_l2_evict_last_f(void)
{
return 0x2;
}
static inline u32 pbdma_config_ce_split_enable_f(void)
{
return 0x0;
}
static inline u32 pbdma_config_ce_split_disable_f(void)
{
return 0x10;
}
static inline u32 pbdma_config_auth_level_non_privileged_f(void)
{
return 0x0;
}
static inline u32 pbdma_config_auth_level_privileged_f(void)
{
return 0x100;
}
static inline u32 pbdma_config_userd_writeback_disable_f(void)
{
return 0x0;
}
static inline u32 pbdma_config_userd_writeback_enable_f(void)
{
return 0x1000;
}
static inline u32 pbdma_userd_hi_r(u32 i)
{
return 0x0004000c + i*8192;
}
static inline u32 pbdma_userd_hi_addr_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 pbdma_hce_ctrl_r(u32 i)
{
return 0x000400e4 + i*8192;
}
static inline u32 pbdma_hce_ctrl_hce_priv_mode_yes_f(void)
{
return 0x20;
}
static inline u32 pbdma_intr_0_r(u32 i)
{
return 0x00040108 + i*8192;
}
static inline u32 pbdma_intr_0_memreq_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 pbdma_intr_0_memreq_pending_f(void)
{
return 0x1;
}
static inline u32 pbdma_intr_0_memack_timeout_pending_f(void)
{
return 0x2;
}
static inline u32 pbdma_intr_0_memack_extra_pending_f(void)
{
return 0x4;
}
static inline u32 pbdma_intr_0_memdat_timeout_pending_f(void)
{
return 0x8;
}
static inline u32 pbdma_intr_0_memdat_extra_pending_f(void)
{
return 0x10;
}
static inline u32 pbdma_intr_0_memflush_pending_f(void)
{
return 0x20;
}
static inline u32 pbdma_intr_0_memop_pending_f(void)
{
return 0x40;
}
static inline u32 pbdma_intr_0_lbconnect_pending_f(void)
{
return 0x80;
}
static inline u32 pbdma_intr_0_lbreq_pending_f(void)
{
return 0x100;
}
static inline u32 pbdma_intr_0_lback_timeout_pending_f(void)
{
return 0x200;
}
static inline u32 pbdma_intr_0_lback_extra_pending_f(void)
{
return 0x400;
}
static inline u32 pbdma_intr_0_lbdat_timeout_pending_f(void)
{
return 0x800;
}
static inline u32 pbdma_intr_0_lbdat_extra_pending_f(void)
{
return 0x1000;
}
static inline u32 pbdma_intr_0_gpfifo_pending_f(void)
{
return 0x2000;
}
static inline u32 pbdma_intr_0_gpptr_pending_f(void)
{
return 0x4000;
}
static inline u32 pbdma_intr_0_gpentry_pending_f(void)
{
return 0x8000;
}
static inline u32 pbdma_intr_0_gpcrc_pending_f(void)
{
return 0x10000;
}
static inline u32 pbdma_intr_0_pbptr_pending_f(void)
{
return 0x20000;
}
static inline u32 pbdma_intr_0_pbentry_pending_f(void)
{
return 0x40000;
}
static inline u32 pbdma_intr_0_pbcrc_pending_f(void)
{
return 0x80000;
}
static inline u32 pbdma_intr_0_clear_faulted_error_pending_f(void)
{
return 0x100000;
}
static inline u32 pbdma_intr_0_method_pending_f(void)
{
return 0x200000;
}
static inline u32 pbdma_intr_0_methodcrc_pending_f(void)
{
return 0x400000;
}
static inline u32 pbdma_intr_0_device_pending_f(void)
{
return 0x800000;
}
static inline u32 pbdma_intr_0_eng_reset_pending_f(void)
{
return 0x1000000;
}
static inline u32 pbdma_intr_0_semaphore_pending_f(void)
{
return 0x2000000;
}
static inline u32 pbdma_intr_0_acquire_pending_f(void)
{
return 0x4000000;
}
static inline u32 pbdma_intr_0_pri_pending_f(void)
{
return 0x8000000;
}
static inline u32 pbdma_intr_0_no_ctxsw_seg_pending_f(void)
{
return 0x20000000;
}
static inline u32 pbdma_intr_0_pbseg_pending_f(void)
{
return 0x40000000;
}
static inline u32 pbdma_intr_0_signature_pending_f(void)
{
return 0x80000000;
}
static inline u32 pbdma_intr_1_r(u32 i)
{
return 0x00040148 + i*8192;
}
static inline u32 pbdma_intr_1_ctxnotvalid_m(void)
{
return 0x1 << 31;
}
static inline u32 pbdma_intr_1_ctxnotvalid_pending_f(void)
{
return 0x80000000;
}
static inline u32 pbdma_intr_en_0_r(u32 i)
{
return 0x0004010c + i*8192;
}
static inline u32 pbdma_intr_en_0_lbreq_enabled_f(void)
{
return 0x100;
}
static inline u32 pbdma_intr_en_1_r(u32 i)
{
return 0x0004014c + i*8192;
}
static inline u32 pbdma_intr_stall_r(u32 i)
{
return 0x0004013c + i*8192;
}
static inline u32 pbdma_intr_stall_lbreq_enabled_f(void)
{
return 0x100;
}
static inline u32 pbdma_intr_stall_1_r(u32 i)
{
return 0x00040140 + i*8192;
}
static inline u32 pbdma_udma_nop_r(void)
{
return 0x00000008;
}
static inline u32 pbdma_runlist_timeslice_r(u32 i)
{
return 0x000400f8 + i*8192;
}
static inline u32 pbdma_runlist_timeslice_timeout_128_f(void)
{
return 0x80;
}
static inline u32 pbdma_runlist_timeslice_timescale_3_f(void)
{
return 0x3000;
}
static inline u32 pbdma_runlist_timeslice_enable_true_f(void)
{
return 0x10000000;
}
static inline u32 pbdma_target_r(u32 i)
{
return 0x000400ac + i*8192;
}
static inline u32 pbdma_target_engine_sw_f(void)
{
return 0x1f;
}
static inline u32 pbdma_target_eng_ctx_valid_true_f(void)
{
return 0x10000;
}
static inline u32 pbdma_target_eng_ctx_valid_false_f(void)
{
return 0x0;
}
static inline u32 pbdma_target_ce_ctx_valid_true_f(void)
{
return 0x20000;
}
static inline u32 pbdma_target_ce_ctx_valid_false_f(void)
{
return 0x0;
}
static inline u32 pbdma_target_host_tsg_event_reason_pbdma_idle_f(void)
{
return 0x0;
}
static inline u32 pbdma_target_host_tsg_event_reason_semaphore_acquire_failure_f(void)
{
return 0x1000000;
}
static inline u32 pbdma_target_host_tsg_event_reason_tsg_yield_f(void)
{
return 0x2000000;
}
static inline u32 pbdma_target_host_tsg_event_reason_host_subchannel_switch_f(void)
{
return 0x3000000;
}
static inline u32 pbdma_target_should_send_tsg_event_true_f(void)
{
return 0x20000000;
}
static inline u32 pbdma_target_should_send_tsg_event_false_f(void)
{
return 0x0;
}
static inline u32 pbdma_target_needs_host_tsg_event_true_f(void)
{
return 0x80000000;
}
static inline u32 pbdma_target_needs_host_tsg_event_false_f(void)
{
return 0x0;
}
static inline u32 pbdma_set_channel_info_r(u32 i)
{
return 0x000400fc + i*8192;
}
static inline u32 pbdma_set_channel_info_scg_type_graphics_compute0_f(void)
{
return 0x0;
}
static inline u32 pbdma_set_channel_info_scg_type_compute1_f(void)
{
return 0x1;
}
static inline u32 pbdma_set_channel_info_veid_f(u32 v)
{
return (v & 0x3f) << 8;
}
static inline u32 pbdma_timeout_r(u32 i)
{
return 0x0004012c + i*8192;
}
static inline u32 pbdma_timeout_period_m(void)
{
return 0xffffffff << 0;
}
static inline u32 pbdma_timeout_period_max_f(void)
{
return 0xffffffff;
}
static inline u32 pbdma_timeout_period_init_f(void)
{
return 0x10000;
}
#endif

View File

@@ -0,0 +1,205 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_perf_gv100_h_
#define _hw_perf_gv100_h_
static inline u32 perf_pmasys_control_r(void)
{
return 0x0024a000;
}
static inline u32 perf_pmasys_control_membuf_status_v(u32 r)
{
return (r >> 4) & 0x1;
}
static inline u32 perf_pmasys_control_membuf_status_overflowed_v(void)
{
return 0x00000001;
}
static inline u32 perf_pmasys_control_membuf_status_overflowed_f(void)
{
return 0x10;
}
static inline u32 perf_pmasys_control_membuf_clear_status_f(u32 v)
{
return (v & 0x1) << 5;
}
static inline u32 perf_pmasys_control_membuf_clear_status_v(u32 r)
{
return (r >> 5) & 0x1;
}
static inline u32 perf_pmasys_control_membuf_clear_status_doit_v(void)
{
return 0x00000001;
}
static inline u32 perf_pmasys_control_membuf_clear_status_doit_f(void)
{
return 0x20;
}
static inline u32 perf_pmasys_mem_block_r(void)
{
return 0x0024a070;
}
static inline u32 perf_pmasys_mem_block_base_f(u32 v)
{
return (v & 0xfffffff) << 0;
}
static inline u32 perf_pmasys_mem_block_target_f(u32 v)
{
return (v & 0x3) << 28;
}
static inline u32 perf_pmasys_mem_block_target_v(u32 r)
{
return (r >> 28) & 0x3;
}
static inline u32 perf_pmasys_mem_block_target_lfb_v(void)
{
return 0x00000000;
}
static inline u32 perf_pmasys_mem_block_target_lfb_f(void)
{
return 0x0;
}
static inline u32 perf_pmasys_mem_block_target_sys_coh_v(void)
{
return 0x00000002;
}
static inline u32 perf_pmasys_mem_block_target_sys_coh_f(void)
{
return 0x20000000;
}
static inline u32 perf_pmasys_mem_block_target_sys_ncoh_v(void)
{
return 0x00000003;
}
static inline u32 perf_pmasys_mem_block_target_sys_ncoh_f(void)
{
return 0x30000000;
}
static inline u32 perf_pmasys_mem_block_valid_f(u32 v)
{
return (v & 0x1) << 31;
}
static inline u32 perf_pmasys_mem_block_valid_v(u32 r)
{
return (r >> 31) & 0x1;
}
static inline u32 perf_pmasys_mem_block_valid_true_v(void)
{
return 0x00000001;
}
static inline u32 perf_pmasys_mem_block_valid_true_f(void)
{
return 0x80000000;
}
static inline u32 perf_pmasys_mem_block_valid_false_v(void)
{
return 0x00000000;
}
static inline u32 perf_pmasys_mem_block_valid_false_f(void)
{
return 0x0;
}
static inline u32 perf_pmasys_outbase_r(void)
{
return 0x0024a074;
}
static inline u32 perf_pmasys_outbase_ptr_f(u32 v)
{
return (v & 0x7ffffff) << 5;
}
static inline u32 perf_pmasys_outbaseupper_r(void)
{
return 0x0024a078;
}
static inline u32 perf_pmasys_outbaseupper_ptr_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 perf_pmasys_outsize_r(void)
{
return 0x0024a07c;
}
static inline u32 perf_pmasys_outsize_numbytes_f(u32 v)
{
return (v & 0x7ffffff) << 5;
}
static inline u32 perf_pmasys_mem_bytes_r(void)
{
return 0x0024a084;
}
static inline u32 perf_pmasys_mem_bytes_numbytes_f(u32 v)
{
return (v & 0xfffffff) << 4;
}
static inline u32 perf_pmasys_mem_bump_r(void)
{
return 0x0024a088;
}
static inline u32 perf_pmasys_mem_bump_numbytes_f(u32 v)
{
return (v & 0xfffffff) << 4;
}
static inline u32 perf_pmasys_enginestatus_r(void)
{
return 0x0024a0a4;
}
static inline u32 perf_pmasys_enginestatus_rbufempty_f(u32 v)
{
return (v & 0x1) << 4;
}
static inline u32 perf_pmasys_enginestatus_rbufempty_empty_v(void)
{
return 0x00000001;
}
static inline u32 perf_pmasys_enginestatus_rbufempty_empty_f(void)
{
return 0x10;
}
#endif

View File

@@ -0,0 +1,57 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_pram_gv100_h_
#define _hw_pram_gv100_h_
static inline u32 pram_data032_r(u32 i)
{
return 0x00700000 + i*4;
}
#endif

View File

@@ -0,0 +1,161 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_pri_ringmaster_gv100_h_
#define _hw_pri_ringmaster_gv100_h_
static inline u32 pri_ringmaster_command_r(void)
{
return 0x0012004c;
}
static inline u32 pri_ringmaster_command_cmd_m(void)
{
return 0x3f << 0;
}
static inline u32 pri_ringmaster_command_cmd_v(u32 r)
{
return (r >> 0) & 0x3f;
}
static inline u32 pri_ringmaster_command_cmd_no_cmd_v(void)
{
return 0x00000000;
}
static inline u32 pri_ringmaster_command_cmd_start_ring_f(void)
{
return 0x1;
}
static inline u32 pri_ringmaster_command_cmd_ack_interrupt_f(void)
{
return 0x2;
}
static inline u32 pri_ringmaster_command_cmd_enumerate_stations_f(void)
{
return 0x3;
}
static inline u32 pri_ringmaster_command_cmd_enumerate_stations_bc_grp_all_f(void)
{
return 0x0;
}
static inline u32 pri_ringmaster_command_data_r(void)
{
return 0x00120048;
}
static inline u32 pri_ringmaster_start_results_r(void)
{
return 0x00120050;
}
static inline u32 pri_ringmaster_start_results_connectivity_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 pri_ringmaster_start_results_connectivity_pass_v(void)
{
return 0x00000001;
}
static inline u32 pri_ringmaster_intr_status0_r(void)
{
return 0x00120058;
}
static inline u32 pri_ringmaster_intr_status0_ring_start_conn_fault_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 pri_ringmaster_intr_status0_disconnect_fault_v(u32 r)
{
return (r >> 1) & 0x1;
}
static inline u32 pri_ringmaster_intr_status0_overflow_fault_v(u32 r)
{
return (r >> 2) & 0x1;
}
static inline u32 pri_ringmaster_intr_status0_gbl_write_error_sys_v(u32 r)
{
return (r >> 8) & 0x1;
}
static inline u32 pri_ringmaster_intr_status1_r(void)
{
return 0x0012005c;
}
static inline u32 pri_ringmaster_global_ctl_r(void)
{
return 0x00120060;
}
static inline u32 pri_ringmaster_global_ctl_ring_reset_asserted_f(void)
{
return 0x1;
}
static inline u32 pri_ringmaster_global_ctl_ring_reset_deasserted_f(void)
{
return 0x0;
}
static inline u32 pri_ringmaster_enum_fbp_r(void)
{
return 0x00120074;
}
static inline u32 pri_ringmaster_enum_fbp_count_v(u32 r)
{
return (r >> 0) & 0x1f;
}
static inline u32 pri_ringmaster_enum_gpc_r(void)
{
return 0x00120078;
}
static inline u32 pri_ringmaster_enum_gpc_count_v(u32 r)
{
return (r >> 0) & 0x1f;
}
static inline u32 pri_ringmaster_enum_ltc_r(void)
{
return 0x0012006c;
}
static inline u32 pri_ringmaster_enum_ltc_count_v(u32 r)
{
return (r >> 0) & 0x1f;
}
#endif

View File

@@ -0,0 +1,73 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_pri_ringstation_gpc_gv100_h_
#define _hw_pri_ringstation_gpc_gv100_h_
static inline u32 pri_ringstation_gpc_master_config_r(u32 i)
{
return 0x00128300 + i*4;
}
static inline u32 pri_ringstation_gpc_gpc0_priv_error_adr_r(void)
{
return 0x00128120;
}
static inline u32 pri_ringstation_gpc_gpc0_priv_error_wrdat_r(void)
{
return 0x00128124;
}
static inline u32 pri_ringstation_gpc_gpc0_priv_error_info_r(void)
{
return 0x00128128;
}
static inline u32 pri_ringstation_gpc_gpc0_priv_error_code_r(void)
{
return 0x0012812c;
}
#endif

View File

@@ -0,0 +1,85 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_pri_ringstation_sys_gv100_h_
#define _hw_pri_ringstation_sys_gv100_h_
static inline u32 pri_ringstation_sys_master_config_r(u32 i)
{
return 0x00122300 + i*4;
}
static inline u32 pri_ringstation_sys_decode_config_r(void)
{
return 0x00122204;
}
static inline u32 pri_ringstation_sys_decode_config_ring_m(void)
{
return 0x7 << 0;
}
static inline u32 pri_ringstation_sys_decode_config_ring_drop_on_ring_not_started_f(void)
{
return 0x1;
}
static inline u32 pri_ringstation_sys_priv_error_adr_r(void)
{
return 0x00122120;
}
static inline u32 pri_ringstation_sys_priv_error_wrdat_r(void)
{
return 0x00122124;
}
static inline u32 pri_ringstation_sys_priv_error_info_r(void)
{
return 0x00122128;
}
static inline u32 pri_ringstation_sys_priv_error_code_r(void)
{
return 0x0012212c;
}
#endif

View File

@@ -0,0 +1,161 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_proj_gv100_h_
#define _hw_proj_gv100_h_
static inline u32 proj_gpc_base_v(void)
{
return 0x00500000;
}
static inline u32 proj_gpc_shared_base_v(void)
{
return 0x00418000;
}
static inline u32 proj_gpc_stride_v(void)
{
return 0x00008000;
}
static inline u32 proj_ltc_stride_v(void)
{
return 0x00002000;
}
static inline u32 proj_lts_stride_v(void)
{
return 0x00000200;
}
static inline u32 proj_fbpa_stride_v(void)
{
return 0x00004000;
}
static inline u32 proj_ppc_in_gpc_base_v(void)
{
return 0x00003000;
}
static inline u32 proj_ppc_in_gpc_stride_v(void)
{
return 0x00000200;
}
static inline u32 proj_rop_base_v(void)
{
return 0x00410000;
}
static inline u32 proj_rop_shared_base_v(void)
{
return 0x00408800;
}
static inline u32 proj_rop_stride_v(void)
{
return 0x00000400;
}
static inline u32 proj_tpc_in_gpc_base_v(void)
{
return 0x00004000;
}
static inline u32 proj_tpc_in_gpc_stride_v(void)
{
return 0x00000800;
}
static inline u32 proj_tpc_in_gpc_shared_base_v(void)
{
return 0x00001800;
}
static inline u32 proj_host_num_engines_v(void)
{
return 0x0000000f;
}
static inline u32 proj_host_num_pbdma_v(void)
{
return 0x0000000e;
}
static inline u32 proj_scal_litter_num_tpc_per_gpc_v(void)
{
return 0x00000007;
}
static inline u32 proj_scal_litter_num_fbps_v(void)
{
return 0x00000008;
}
static inline u32 proj_scal_litter_num_fbpas_v(void)
{
return 0x00000010;
}
static inline u32 proj_scal_litter_num_gpcs_v(void)
{
return 0x00000006;
}
static inline u32 proj_scal_litter_num_pes_per_gpc_v(void)
{
return 0x00000003;
}
static inline u32 proj_scal_litter_num_tpcs_per_pes_v(void)
{
return 0x00000003;
}
static inline u32 proj_scal_litter_num_zcull_banks_v(void)
{
return 0x00000004;
}
static inline u32 proj_scal_litter_num_sm_per_tpc_v(void)
{
return 0x00000002;
}
static inline u32 proj_scal_max_gpcs_v(void)
{
return 0x00000020;
}
static inline u32 proj_scal_max_tpc_per_gpc_v(void)
{
return 0x00000008;
}
static inline u32 proj_sm_stride_v(void)
{
return 0x00000080;
}
#endif

View File

@@ -0,0 +1,929 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_pwr_gv100_h_
#define _hw_pwr_gv100_h_
static inline u32 pwr_falcon_irqsset_r(void)
{
return 0x0010a000;
}
static inline u32 pwr_falcon_irqsset_swgen0_set_f(void)
{
return 0x40;
}
static inline u32 pwr_falcon_irqsclr_r(void)
{
return 0x0010a004;
}
static inline u32 pwr_falcon_irqstat_r(void)
{
return 0x0010a008;
}
static inline u32 pwr_falcon_irqstat_halt_true_f(void)
{
return 0x10;
}
static inline u32 pwr_falcon_irqstat_exterr_true_f(void)
{
return 0x20;
}
static inline u32 pwr_falcon_irqstat_swgen0_true_f(void)
{
return 0x40;
}
static inline u32 pwr_falcon_irqstat_ext_second_true_f(void)
{
return 0x800;
}
static inline u32 pwr_falcon_irqmode_r(void)
{
return 0x0010a00c;
}
static inline u32 pwr_falcon_irqmset_r(void)
{
return 0x0010a010;
}
static inline u32 pwr_falcon_irqmset_gptmr_f(u32 v)
{
return (v & 0x1) << 0;
}
static inline u32 pwr_falcon_irqmset_wdtmr_f(u32 v)
{
return (v & 0x1) << 1;
}
static inline u32 pwr_falcon_irqmset_mthd_f(u32 v)
{
return (v & 0x1) << 2;
}
static inline u32 pwr_falcon_irqmset_ctxsw_f(u32 v)
{
return (v & 0x1) << 3;
}
static inline u32 pwr_falcon_irqmset_halt_f(u32 v)
{
return (v & 0x1) << 4;
}
static inline u32 pwr_falcon_irqmset_exterr_f(u32 v)
{
return (v & 0x1) << 5;
}
static inline u32 pwr_falcon_irqmset_swgen0_f(u32 v)
{
return (v & 0x1) << 6;
}
static inline u32 pwr_falcon_irqmset_swgen1_f(u32 v)
{
return (v & 0x1) << 7;
}
static inline u32 pwr_falcon_irqmset_ext_f(u32 v)
{
return (v & 0xff) << 8;
}
static inline u32 pwr_falcon_irqmset_ext_ctxe_f(u32 v)
{
return (v & 0x1) << 8;
}
static inline u32 pwr_falcon_irqmset_ext_limitv_f(u32 v)
{
return (v & 0x1) << 9;
}
static inline u32 pwr_falcon_irqmset_ext_second_f(u32 v)
{
return (v & 0x1) << 11;
}
static inline u32 pwr_falcon_irqmset_ext_therm_f(u32 v)
{
return (v & 0x1) << 12;
}
static inline u32 pwr_falcon_irqmset_ext_miscio_f(u32 v)
{
return (v & 0x1) << 13;
}
static inline u32 pwr_falcon_irqmset_ext_rttimer_f(u32 v)
{
return (v & 0x1) << 14;
}
static inline u32 pwr_falcon_irqmclr_r(void)
{
return 0x0010a014;
}
static inline u32 pwr_falcon_irqmclr_gptmr_f(u32 v)
{
return (v & 0x1) << 0;
}
static inline u32 pwr_falcon_irqmclr_wdtmr_f(u32 v)
{
return (v & 0x1) << 1;
}
static inline u32 pwr_falcon_irqmclr_mthd_f(u32 v)
{
return (v & 0x1) << 2;
}
static inline u32 pwr_falcon_irqmclr_ctxsw_f(u32 v)
{
return (v & 0x1) << 3;
}
static inline u32 pwr_falcon_irqmclr_halt_f(u32 v)
{
return (v & 0x1) << 4;
}
static inline u32 pwr_falcon_irqmclr_exterr_f(u32 v)
{
return (v & 0x1) << 5;
}
static inline u32 pwr_falcon_irqmclr_swgen0_f(u32 v)
{
return (v & 0x1) << 6;
}
static inline u32 pwr_falcon_irqmclr_swgen1_f(u32 v)
{
return (v & 0x1) << 7;
}
static inline u32 pwr_falcon_irqmclr_ext_f(u32 v)
{
return (v & 0xff) << 8;
}
static inline u32 pwr_falcon_irqmclr_ext_ctxe_f(u32 v)
{
return (v & 0x1) << 8;
}
static inline u32 pwr_falcon_irqmclr_ext_limitv_f(u32 v)
{
return (v & 0x1) << 9;
}
static inline u32 pwr_falcon_irqmclr_ext_second_f(u32 v)
{
return (v & 0x1) << 11;
}
static inline u32 pwr_falcon_irqmclr_ext_therm_f(u32 v)
{
return (v & 0x1) << 12;
}
static inline u32 pwr_falcon_irqmclr_ext_miscio_f(u32 v)
{
return (v & 0x1) << 13;
}
static inline u32 pwr_falcon_irqmclr_ext_rttimer_f(u32 v)
{
return (v & 0x1) << 14;
}
static inline u32 pwr_falcon_irqmask_r(void)
{
return 0x0010a018;
}
static inline u32 pwr_falcon_irqdest_r(void)
{
return 0x0010a01c;
}
static inline u32 pwr_falcon_irqdest_host_gptmr_f(u32 v)
{
return (v & 0x1) << 0;
}
static inline u32 pwr_falcon_irqdest_host_wdtmr_f(u32 v)
{
return (v & 0x1) << 1;
}
static inline u32 pwr_falcon_irqdest_host_mthd_f(u32 v)
{
return (v & 0x1) << 2;
}
static inline u32 pwr_falcon_irqdest_host_ctxsw_f(u32 v)
{
return (v & 0x1) << 3;
}
static inline u32 pwr_falcon_irqdest_host_halt_f(u32 v)
{
return (v & 0x1) << 4;
}
static inline u32 pwr_falcon_irqdest_host_exterr_f(u32 v)
{
return (v & 0x1) << 5;
}
static inline u32 pwr_falcon_irqdest_host_swgen0_f(u32 v)
{
return (v & 0x1) << 6;
}
static inline u32 pwr_falcon_irqdest_host_swgen1_f(u32 v)
{
return (v & 0x1) << 7;
}
static inline u32 pwr_falcon_irqdest_host_ext_f(u32 v)
{
return (v & 0xff) << 8;
}
static inline u32 pwr_falcon_irqdest_host_ext_ctxe_f(u32 v)
{
return (v & 0x1) << 8;
}
static inline u32 pwr_falcon_irqdest_host_ext_limitv_f(u32 v)
{
return (v & 0x1) << 9;
}
static inline u32 pwr_falcon_irqdest_host_ext_second_f(u32 v)
{
return (v & 0x1) << 11;
}
static inline u32 pwr_falcon_irqdest_host_ext_therm_f(u32 v)
{
return (v & 0x1) << 12;
}
static inline u32 pwr_falcon_irqdest_host_ext_miscio_f(u32 v)
{
return (v & 0x1) << 13;
}
static inline u32 pwr_falcon_irqdest_host_ext_rttimer_f(u32 v)
{
return (v & 0x1) << 14;
}
static inline u32 pwr_falcon_irqdest_target_gptmr_f(u32 v)
{
return (v & 0x1) << 16;
}
static inline u32 pwr_falcon_irqdest_target_wdtmr_f(u32 v)
{
return (v & 0x1) << 17;
}
static inline u32 pwr_falcon_irqdest_target_mthd_f(u32 v)
{
return (v & 0x1) << 18;
}
static inline u32 pwr_falcon_irqdest_target_ctxsw_f(u32 v)
{
return (v & 0x1) << 19;
}
static inline u32 pwr_falcon_irqdest_target_halt_f(u32 v)
{
return (v & 0x1) << 20;
}
static inline u32 pwr_falcon_irqdest_target_exterr_f(u32 v)
{
return (v & 0x1) << 21;
}
static inline u32 pwr_falcon_irqdest_target_swgen0_f(u32 v)
{
return (v & 0x1) << 22;
}
static inline u32 pwr_falcon_irqdest_target_swgen1_f(u32 v)
{
return (v & 0x1) << 23;
}
static inline u32 pwr_falcon_irqdest_target_ext_f(u32 v)
{
return (v & 0xff) << 24;
}
static inline u32 pwr_falcon_irqdest_target_ext_ctxe_f(u32 v)
{
return (v & 0x1) << 24;
}
static inline u32 pwr_falcon_irqdest_target_ext_limitv_f(u32 v)
{
return (v & 0x1) << 25;
}
static inline u32 pwr_falcon_irqdest_target_ext_second_f(u32 v)
{
return (v & 0x1) << 27;
}
static inline u32 pwr_falcon_irqdest_target_ext_therm_f(u32 v)
{
return (v & 0x1) << 28;
}
static inline u32 pwr_falcon_irqdest_target_ext_miscio_f(u32 v)
{
return (v & 0x1) << 29;
}
static inline u32 pwr_falcon_irqdest_target_ext_rttimer_f(u32 v)
{
return (v & 0x1) << 30;
}
static inline u32 pwr_falcon_curctx_r(void)
{
return 0x0010a050;
}
static inline u32 pwr_falcon_nxtctx_r(void)
{
return 0x0010a054;
}
static inline u32 pwr_falcon_mailbox0_r(void)
{
return 0x0010a040;
}
static inline u32 pwr_falcon_mailbox1_r(void)
{
return 0x0010a044;
}
static inline u32 pwr_falcon_itfen_r(void)
{
return 0x0010a048;
}
static inline u32 pwr_falcon_itfen_ctxen_enable_f(void)
{
return 0x1;
}
static inline u32 pwr_falcon_idlestate_r(void)
{
return 0x0010a04c;
}
static inline u32 pwr_falcon_idlestate_falcon_busy_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 pwr_falcon_idlestate_ext_busy_v(u32 r)
{
return (r >> 1) & 0x7fff;
}
static inline u32 pwr_falcon_os_r(void)
{
return 0x0010a080;
}
static inline u32 pwr_falcon_engctl_r(void)
{
return 0x0010a0a4;
}
static inline u32 pwr_falcon_cpuctl_r(void)
{
return 0x0010a100;
}
static inline u32 pwr_falcon_cpuctl_startcpu_f(u32 v)
{
return (v & 0x1) << 1;
}
static inline u32 pwr_falcon_cpuctl_halt_intr_f(u32 v)
{
return (v & 0x1) << 4;
}
static inline u32 pwr_falcon_cpuctl_halt_intr_m(void)
{
return 0x1 << 4;
}
static inline u32 pwr_falcon_cpuctl_halt_intr_v(u32 r)
{
return (r >> 4) & 0x1;
}
static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_f(u32 v)
{
return (v & 0x1) << 6;
}
static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_m(void)
{
return 0x1 << 6;
}
static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_v(u32 r)
{
return (r >> 6) & 0x1;
}
static inline u32 pwr_falcon_cpuctl_alias_r(void)
{
return 0x0010a130;
}
static inline u32 pwr_falcon_cpuctl_alias_startcpu_f(u32 v)
{
return (v & 0x1) << 1;
}
static inline u32 pwr_pmu_scpctl_stat_r(void)
{
return 0x0010ac08;
}
static inline u32 pwr_pmu_scpctl_stat_debug_mode_f(u32 v)
{
return (v & 0x1) << 20;
}
static inline u32 pwr_pmu_scpctl_stat_debug_mode_m(void)
{
return 0x1 << 20;
}
static inline u32 pwr_pmu_scpctl_stat_debug_mode_v(u32 r)
{
return (r >> 20) & 0x1;
}
static inline u32 pwr_falcon_imemc_r(u32 i)
{
return 0x0010a180 + i*16;
}
static inline u32 pwr_falcon_imemc_offs_f(u32 v)
{
return (v & 0x3f) << 2;
}
static inline u32 pwr_falcon_imemc_blk_f(u32 v)
{
return (v & 0xff) << 8;
}
static inline u32 pwr_falcon_imemc_aincw_f(u32 v)
{
return (v & 0x1) << 24;
}
static inline u32 pwr_falcon_imemd_r(u32 i)
{
return 0x0010a184 + i*16;
}
static inline u32 pwr_falcon_imemt_r(u32 i)
{
return 0x0010a188 + i*16;
}
static inline u32 pwr_falcon_sctl_r(void)
{
return 0x0010a240;
}
static inline u32 pwr_falcon_mmu_phys_sec_r(void)
{
return 0x00100ce4;
}
static inline u32 pwr_falcon_bootvec_r(void)
{
return 0x0010a104;
}
static inline u32 pwr_falcon_bootvec_vec_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 pwr_falcon_dmactl_r(void)
{
return 0x0010a10c;
}
static inline u32 pwr_falcon_dmactl_dmem_scrubbing_m(void)
{
return 0x1 << 1;
}
static inline u32 pwr_falcon_dmactl_imem_scrubbing_m(void)
{
return 0x1 << 2;
}
static inline u32 pwr_falcon_hwcfg_r(void)
{
return 0x0010a108;
}
static inline u32 pwr_falcon_hwcfg_imem_size_v(u32 r)
{
return (r >> 0) & 0x1ff;
}
static inline u32 pwr_falcon_hwcfg_dmem_size_v(u32 r)
{
return (r >> 9) & 0x1ff;
}
static inline u32 pwr_falcon_dmatrfbase_r(void)
{
return 0x0010a110;
}
static inline u32 pwr_falcon_dmatrfbase1_r(void)
{
return 0x0010a128;
}
static inline u32 pwr_falcon_dmatrfmoffs_r(void)
{
return 0x0010a114;
}
static inline u32 pwr_falcon_dmatrfcmd_r(void)
{
return 0x0010a118;
}
static inline u32 pwr_falcon_dmatrfcmd_imem_f(u32 v)
{
return (v & 0x1) << 4;
}
static inline u32 pwr_falcon_dmatrfcmd_write_f(u32 v)
{
return (v & 0x1) << 5;
}
static inline u32 pwr_falcon_dmatrfcmd_size_f(u32 v)
{
return (v & 0x7) << 8;
}
static inline u32 pwr_falcon_dmatrfcmd_ctxdma_f(u32 v)
{
return (v & 0x7) << 12;
}
static inline u32 pwr_falcon_dmatrffboffs_r(void)
{
return 0x0010a11c;
}
static inline u32 pwr_falcon_exterraddr_r(void)
{
return 0x0010a168;
}
static inline u32 pwr_falcon_exterrstat_r(void)
{
return 0x0010a16c;
}
static inline u32 pwr_falcon_exterrstat_valid_m(void)
{
return 0x1 << 31;
}
static inline u32 pwr_falcon_exterrstat_valid_v(u32 r)
{
return (r >> 31) & 0x1;
}
static inline u32 pwr_falcon_exterrstat_valid_true_v(void)
{
return 0x00000001;
}
static inline u32 pwr_pmu_falcon_icd_cmd_r(void)
{
return 0x0010a200;
}
static inline u32 pwr_pmu_falcon_icd_cmd_opc_s(void)
{
return 4;
}
static inline u32 pwr_pmu_falcon_icd_cmd_opc_f(u32 v)
{
return (v & 0xf) << 0;
}
static inline u32 pwr_pmu_falcon_icd_cmd_opc_m(void)
{
return 0xf << 0;
}
static inline u32 pwr_pmu_falcon_icd_cmd_opc_v(u32 r)
{
return (r >> 0) & 0xf;
}
static inline u32 pwr_pmu_falcon_icd_cmd_opc_rreg_f(void)
{
return 0x8;
}
static inline u32 pwr_pmu_falcon_icd_cmd_opc_rstat_f(void)
{
return 0xe;
}
static inline u32 pwr_pmu_falcon_icd_cmd_idx_f(u32 v)
{
return (v & 0x1f) << 8;
}
static inline u32 pwr_pmu_falcon_icd_rdata_r(void)
{
return 0x0010a20c;
}
static inline u32 pwr_falcon_dmemc_r(u32 i)
{
return 0x0010a1c0 + i*8;
}
static inline u32 pwr_falcon_dmemc_offs_f(u32 v)
{
return (v & 0x3f) << 2;
}
static inline u32 pwr_falcon_dmemc_offs_m(void)
{
return 0x3f << 2;
}
static inline u32 pwr_falcon_dmemc_blk_f(u32 v)
{
return (v & 0xff) << 8;
}
static inline u32 pwr_falcon_dmemc_blk_m(void)
{
return 0xff << 8;
}
static inline u32 pwr_falcon_dmemc_aincw_f(u32 v)
{
return (v & 0x1) << 24;
}
static inline u32 pwr_falcon_dmemc_aincr_f(u32 v)
{
return (v & 0x1) << 25;
}
static inline u32 pwr_falcon_dmemd_r(u32 i)
{
return 0x0010a1c4 + i*8;
}
static inline u32 pwr_pmu_new_instblk_r(void)
{
return 0x0010a480;
}
static inline u32 pwr_pmu_new_instblk_ptr_f(u32 v)
{
return (v & 0xfffffff) << 0;
}
static inline u32 pwr_pmu_new_instblk_target_fb_f(void)
{
return 0x0;
}
static inline u32 pwr_pmu_new_instblk_target_sys_coh_f(void)
{
return 0x20000000;
}
static inline u32 pwr_pmu_new_instblk_target_sys_ncoh_f(void)
{
return 0x30000000;
}
static inline u32 pwr_pmu_new_instblk_valid_f(u32 v)
{
return (v & 0x1) << 30;
}
static inline u32 pwr_pmu_mutex_id_r(void)
{
return 0x0010a488;
}
static inline u32 pwr_pmu_mutex_id_value_v(u32 r)
{
return (r >> 0) & 0xff;
}
static inline u32 pwr_pmu_mutex_id_value_init_v(void)
{
return 0x00000000;
}
static inline u32 pwr_pmu_mutex_id_value_not_avail_v(void)
{
return 0x000000ff;
}
static inline u32 pwr_pmu_mutex_id_release_r(void)
{
return 0x0010a48c;
}
static inline u32 pwr_pmu_mutex_id_release_value_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 pwr_pmu_mutex_id_release_value_m(void)
{
return 0xff << 0;
}
static inline u32 pwr_pmu_mutex_id_release_value_init_v(void)
{
return 0x00000000;
}
static inline u32 pwr_pmu_mutex_id_release_value_init_f(void)
{
return 0x0;
}
static inline u32 pwr_pmu_mutex_r(u32 i)
{
return 0x0010a580 + i*4;
}
static inline u32 pwr_pmu_mutex__size_1_v(void)
{
return 0x00000010;
}
static inline u32 pwr_pmu_mutex_value_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 pwr_pmu_mutex_value_v(u32 r)
{
return (r >> 0) & 0xff;
}
static inline u32 pwr_pmu_mutex_value_initial_lock_f(void)
{
return 0x0;
}
static inline u32 pwr_pmu_queue_head_r(u32 i)
{
return 0x0010a800 + i*4;
}
static inline u32 pwr_pmu_queue_head__size_1_v(void)
{
return 0x00000008;
}
static inline u32 pwr_pmu_queue_head_address_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 pwr_pmu_queue_head_address_v(u32 r)
{
return (r >> 0) & 0xffffffff;
}
static inline u32 pwr_pmu_queue_tail_r(u32 i)
{
return 0x0010a820 + i*4;
}
static inline u32 pwr_pmu_queue_tail__size_1_v(void)
{
return 0x00000008;
}
static inline u32 pwr_pmu_queue_tail_address_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 pwr_pmu_queue_tail_address_v(u32 r)
{
return (r >> 0) & 0xffffffff;
}
static inline u32 pwr_pmu_msgq_head_r(void)
{
return 0x0010a4c8;
}
static inline u32 pwr_pmu_msgq_head_val_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 pwr_pmu_msgq_head_val_v(u32 r)
{
return (r >> 0) & 0xffffffff;
}
static inline u32 pwr_pmu_msgq_tail_r(void)
{
return 0x0010a4cc;
}
static inline u32 pwr_pmu_msgq_tail_val_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 pwr_pmu_msgq_tail_val_v(u32 r)
{
return (r >> 0) & 0xffffffff;
}
static inline u32 pwr_pmu_idle_mask_r(u32 i)
{
return 0x0010a504 + i*16;
}
static inline u32 pwr_pmu_idle_mask_gr_enabled_f(void)
{
return 0x1;
}
static inline u32 pwr_pmu_idle_mask_ce_2_enabled_f(void)
{
return 0x200000;
}
static inline u32 pwr_pmu_idle_count_r(u32 i)
{
return 0x0010a508 + i*16;
}
static inline u32 pwr_pmu_idle_count_value_f(u32 v)
{
return (v & 0x7fffffff) << 0;
}
static inline u32 pwr_pmu_idle_count_value_v(u32 r)
{
return (r >> 0) & 0x7fffffff;
}
static inline u32 pwr_pmu_idle_count_reset_f(u32 v)
{
return (v & 0x1) << 31;
}
static inline u32 pwr_pmu_idle_ctrl_r(u32 i)
{
return 0x0010a50c + i*16;
}
static inline u32 pwr_pmu_idle_ctrl_value_m(void)
{
return 0x3 << 0;
}
static inline u32 pwr_pmu_idle_ctrl_value_busy_f(void)
{
return 0x2;
}
static inline u32 pwr_pmu_idle_ctrl_value_always_f(void)
{
return 0x3;
}
static inline u32 pwr_pmu_idle_ctrl_filter_m(void)
{
return 0x1 << 2;
}
static inline u32 pwr_pmu_idle_ctrl_filter_disabled_f(void)
{
return 0x0;
}
static inline u32 pwr_pmu_idle_mask_supp_r(u32 i)
{
return 0x0010a9f0 + i*8;
}
static inline u32 pwr_pmu_idle_mask_1_supp_r(u32 i)
{
return 0x0010a9f4 + i*8;
}
static inline u32 pwr_pmu_idle_ctrl_supp_r(u32 i)
{
return 0x0010aa30 + i*8;
}
static inline u32 pwr_pmu_debug_r(u32 i)
{
return 0x0010a5c0 + i*4;
}
static inline u32 pwr_pmu_debug__size_1_v(void)
{
return 0x00000004;
}
static inline u32 pwr_pmu_mailbox_r(u32 i)
{
return 0x0010a450 + i*4;
}
static inline u32 pwr_pmu_mailbox__size_1_v(void)
{
return 0x0000000c;
}
static inline u32 pwr_pmu_bar0_addr_r(void)
{
return 0x0010a7a0;
}
static inline u32 pwr_pmu_bar0_data_r(void)
{
return 0x0010a7a4;
}
static inline u32 pwr_pmu_bar0_ctl_r(void)
{
return 0x0010a7ac;
}
static inline u32 pwr_pmu_bar0_timeout_r(void)
{
return 0x0010a7a8;
}
static inline u32 pwr_pmu_bar0_fecs_error_r(void)
{
return 0x0010a988;
}
static inline u32 pwr_pmu_bar0_error_status_r(void)
{
return 0x0010a7b0;
}
static inline u32 pwr_pmu_pg_idlefilth_r(u32 i)
{
return 0x0010a6c0 + i*4;
}
static inline u32 pwr_pmu_pg_ppuidlefilth_r(u32 i)
{
return 0x0010a6e8 + i*4;
}
static inline u32 pwr_pmu_pg_idle_cnt_r(u32 i)
{
return 0x0010a710 + i*4;
}
static inline u32 pwr_pmu_pg_intren_r(u32 i)
{
return 0x0010a760 + i*4;
}
static inline u32 pwr_fbif_transcfg_r(u32 i)
{
return 0x0010ae00 + i*4;
}
static inline u32 pwr_fbif_transcfg_target_local_fb_f(void)
{
return 0x0;
}
static inline u32 pwr_fbif_transcfg_target_coherent_sysmem_f(void)
{
return 0x1;
}
static inline u32 pwr_fbif_transcfg_target_noncoherent_sysmem_f(void)
{
return 0x2;
}
static inline u32 pwr_fbif_transcfg_mem_type_s(void)
{
return 1;
}
static inline u32 pwr_fbif_transcfg_mem_type_f(u32 v)
{
return (v & 0x1) << 2;
}
static inline u32 pwr_fbif_transcfg_mem_type_m(void)
{
return 0x1 << 2;
}
static inline u32 pwr_fbif_transcfg_mem_type_v(u32 r)
{
return (r >> 2) & 0x1;
}
static inline u32 pwr_fbif_transcfg_mem_type_virtual_f(void)
{
return 0x0;
}
static inline u32 pwr_fbif_transcfg_mem_type_physical_f(void)
{
return 0x4;
}
#endif

View File

@@ -0,0 +1,761 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_ram_gv100_h_
#define _hw_ram_gv100_h_
static inline u32 ram_in_ramfc_s(void)
{
return 4096;
}
static inline u32 ram_in_ramfc_w(void)
{
return 0;
}
static inline u32 ram_in_page_dir_base_target_f(u32 v)
{
return (v & 0x3) << 0;
}
static inline u32 ram_in_page_dir_base_target_w(void)
{
return 128;
}
static inline u32 ram_in_page_dir_base_target_vid_mem_f(void)
{
return 0x0;
}
static inline u32 ram_in_page_dir_base_target_sys_mem_coh_f(void)
{
return 0x2;
}
static inline u32 ram_in_page_dir_base_target_sys_mem_ncoh_f(void)
{
return 0x3;
}
static inline u32 ram_in_page_dir_base_vol_w(void)
{
return 128;
}
static inline u32 ram_in_page_dir_base_vol_true_f(void)
{
return 0x4;
}
static inline u32 ram_in_page_dir_base_vol_false_f(void)
{
return 0x0;
}
static inline u32 ram_in_page_dir_base_fault_replay_tex_f(u32 v)
{
return (v & 0x1) << 4;
}
static inline u32 ram_in_page_dir_base_fault_replay_tex_m(void)
{
return 0x1 << 4;
}
static inline u32 ram_in_page_dir_base_fault_replay_tex_w(void)
{
return 128;
}
static inline u32 ram_in_page_dir_base_fault_replay_tex_true_f(void)
{
return 0x10;
}
static inline u32 ram_in_page_dir_base_fault_replay_gcc_f(u32 v)
{
return (v & 0x1) << 5;
}
static inline u32 ram_in_page_dir_base_fault_replay_gcc_m(void)
{
return 0x1 << 5;
}
static inline u32 ram_in_page_dir_base_fault_replay_gcc_w(void)
{
return 128;
}
static inline u32 ram_in_page_dir_base_fault_replay_gcc_true_f(void)
{
return 0x20;
}
static inline u32 ram_in_big_page_size_f(u32 v)
{
return (v & 0x1) << 11;
}
static inline u32 ram_in_big_page_size_m(void)
{
return 0x1 << 11;
}
static inline u32 ram_in_big_page_size_w(void)
{
return 128;
}
static inline u32 ram_in_big_page_size_128kb_f(void)
{
return 0x0;
}
static inline u32 ram_in_big_page_size_64kb_f(void)
{
return 0x800;
}
static inline u32 ram_in_page_dir_base_lo_f(u32 v)
{
return (v & 0xfffff) << 12;
}
static inline u32 ram_in_page_dir_base_lo_w(void)
{
return 128;
}
static inline u32 ram_in_page_dir_base_hi_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ram_in_page_dir_base_hi_w(void)
{
return 129;
}
static inline u32 ram_in_engine_cs_w(void)
{
return 132;
}
static inline u32 ram_in_engine_cs_wfi_v(void)
{
return 0x00000000;
}
static inline u32 ram_in_engine_cs_wfi_f(void)
{
return 0x0;
}
static inline u32 ram_in_engine_cs_fg_v(void)
{
return 0x00000001;
}
static inline u32 ram_in_engine_cs_fg_f(void)
{
return 0x8;
}
static inline u32 ram_in_engine_wfi_mode_f(u32 v)
{
return (v & 0x1) << 2;
}
static inline u32 ram_in_engine_wfi_mode_w(void)
{
return 132;
}
static inline u32 ram_in_engine_wfi_mode_physical_v(void)
{
return 0x00000000;
}
static inline u32 ram_in_engine_wfi_mode_virtual_v(void)
{
return 0x00000001;
}
static inline u32 ram_in_engine_wfi_target_f(u32 v)
{
return (v & 0x3) << 0;
}
static inline u32 ram_in_engine_wfi_target_w(void)
{
return 132;
}
static inline u32 ram_in_engine_wfi_target_sys_mem_coh_v(void)
{
return 0x00000002;
}
static inline u32 ram_in_engine_wfi_target_sys_mem_ncoh_v(void)
{
return 0x00000003;
}
static inline u32 ram_in_engine_wfi_target_local_mem_v(void)
{
return 0x00000000;
}
static inline u32 ram_in_engine_wfi_ptr_lo_f(u32 v)
{
return (v & 0xfffff) << 12;
}
static inline u32 ram_in_engine_wfi_ptr_lo_w(void)
{
return 132;
}
static inline u32 ram_in_engine_wfi_ptr_hi_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 ram_in_engine_wfi_ptr_hi_w(void)
{
return 133;
}
static inline u32 ram_in_engine_wfi_veid_f(u32 v)
{
return (v & 0x3f) << 0;
}
static inline u32 ram_in_engine_wfi_veid_w(void)
{
return 134;
}
static inline u32 ram_in_eng_method_buffer_addr_lo_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ram_in_eng_method_buffer_addr_lo_w(void)
{
return 136;
}
static inline u32 ram_in_eng_method_buffer_addr_hi_f(u32 v)
{
return (v & 0x1ffff) << 0;
}
static inline u32 ram_in_eng_method_buffer_addr_hi_w(void)
{
return 137;
}
static inline u32 ram_in_sc_page_dir_base_target_f(u32 v, u32 i)
{
return (v & 0x3) << (0 + i*0);
}
static inline u32 ram_in_sc_page_dir_base_target__size_1_v(void)
{
return 0x00000040;
}
static inline u32 ram_in_sc_page_dir_base_target_vid_mem_v(void)
{
return 0x00000000;
}
static inline u32 ram_in_sc_page_dir_base_target_invalid_v(void)
{
return 0x00000001;
}
static inline u32 ram_in_sc_page_dir_base_target_sys_mem_coh_v(void)
{
return 0x00000002;
}
static inline u32 ram_in_sc_page_dir_base_target_sys_mem_ncoh_v(void)
{
return 0x00000003;
}
static inline u32 ram_in_sc_page_dir_base_vol_f(u32 v, u32 i)
{
return (v & 0x1) << (2 + i*0);
}
static inline u32 ram_in_sc_page_dir_base_vol__size_1_v(void)
{
return 0x00000040;
}
static inline u32 ram_in_sc_page_dir_base_vol_true_v(void)
{
return 0x00000001;
}
static inline u32 ram_in_sc_page_dir_base_vol_false_v(void)
{
return 0x00000000;
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_tex_f(u32 v, u32 i)
{
return (v & 0x1) << (4 + i*0);
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_tex__size_1_v(void)
{
return 0x00000040;
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_tex_enabled_v(void)
{
return 0x00000001;
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_tex_disabled_v(void)
{
return 0x00000000;
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_gcc_f(u32 v, u32 i)
{
return (v & 0x1) << (5 + i*0);
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_gcc__size_1_v(void)
{
return 0x00000040;
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_gcc_enabled_v(void)
{
return 0x00000001;
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_gcc_disabled_v(void)
{
return 0x00000000;
}
static inline u32 ram_in_sc_use_ver2_pt_format_f(u32 v, u32 i)
{
return (v & 0x1) << (10 + i*0);
}
static inline u32 ram_in_sc_use_ver2_pt_format__size_1_v(void)
{
return 0x00000040;
}
static inline u32 ram_in_sc_use_ver2_pt_format_false_v(void)
{
return 0x00000000;
}
static inline u32 ram_in_sc_use_ver2_pt_format_true_v(void)
{
return 0x00000001;
}
static inline u32 ram_in_sc_big_page_size_f(u32 v, u32 i)
{
return (v & 0x1) << (11 + i*0);
}
static inline u32 ram_in_sc_big_page_size__size_1_v(void)
{
return 0x00000040;
}
static inline u32 ram_in_sc_big_page_size_64kb_v(void)
{
return 0x00000001;
}
static inline u32 ram_in_sc_page_dir_base_lo_f(u32 v, u32 i)
{
return (v & 0xfffff) << (12 + i*0);
}
static inline u32 ram_in_sc_page_dir_base_lo__size_1_v(void)
{
return 0x00000040;
}
static inline u32 ram_in_sc_page_dir_base_hi_f(u32 v, u32 i)
{
return (v & 0xffffffff) << (0 + i*0);
}
static inline u32 ram_in_sc_page_dir_base_hi__size_1_v(void)
{
return 0x00000040;
}
static inline u32 ram_in_sc_page_dir_base_target_0_f(u32 v)
{
return (v & 0x3) << 0;
}
static inline u32 ram_in_sc_page_dir_base_target_0_w(void)
{
return 168;
}
static inline u32 ram_in_sc_page_dir_base_vol_0_f(u32 v)
{
return (v & 0x1) << 2;
}
static inline u32 ram_in_sc_page_dir_base_vol_0_w(void)
{
return 168;
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_tex_0_f(u32 v)
{
return (v & 0x1) << 4;
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_tex_0_w(void)
{
return 168;
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_gcc_0_f(u32 v)
{
return (v & 0x1) << 5;
}
static inline u32 ram_in_sc_page_dir_base_fault_replay_gcc_0_w(void)
{
return 168;
}
static inline u32 ram_in_sc_use_ver2_pt_format_0_f(u32 v)
{
return (v & 0x1) << 10;
}
static inline u32 ram_in_sc_use_ver2_pt_format_0_w(void)
{
return 168;
}
static inline u32 ram_in_sc_big_page_size_0_f(u32 v)
{
return (v & 0x1) << 11;
}
static inline u32 ram_in_sc_big_page_size_0_w(void)
{
return 168;
}
static inline u32 ram_in_sc_page_dir_base_lo_0_f(u32 v)
{
return (v & 0xfffff) << 12;
}
static inline u32 ram_in_sc_page_dir_base_lo_0_w(void)
{
return 168;
}
static inline u32 ram_in_sc_page_dir_base_hi_0_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ram_in_sc_page_dir_base_hi_0_w(void)
{
return 169;
}
static inline u32 ram_in_base_shift_v(void)
{
return 0x0000000c;
}
static inline u32 ram_in_alloc_size_v(void)
{
return 0x00001000;
}
static inline u32 ram_fc_size_val_v(void)
{
return 0x00000200;
}
static inline u32 ram_fc_gp_put_w(void)
{
return 0;
}
static inline u32 ram_fc_userd_w(void)
{
return 2;
}
static inline u32 ram_fc_userd_hi_w(void)
{
return 3;
}
static inline u32 ram_fc_signature_w(void)
{
return 4;
}
static inline u32 ram_fc_gp_get_w(void)
{
return 5;
}
static inline u32 ram_fc_pb_get_w(void)
{
return 6;
}
static inline u32 ram_fc_pb_get_hi_w(void)
{
return 7;
}
static inline u32 ram_fc_pb_top_level_get_w(void)
{
return 8;
}
static inline u32 ram_fc_pb_top_level_get_hi_w(void)
{
return 9;
}
static inline u32 ram_fc_acquire_w(void)
{
return 12;
}
static inline u32 ram_fc_sem_addr_hi_w(void)
{
return 14;
}
static inline u32 ram_fc_sem_addr_lo_w(void)
{
return 15;
}
static inline u32 ram_fc_sem_payload_lo_w(void)
{
return 16;
}
static inline u32 ram_fc_sem_payload_hi_w(void)
{
return 39;
}
static inline u32 ram_fc_sem_execute_w(void)
{
return 17;
}
static inline u32 ram_fc_gp_base_w(void)
{
return 18;
}
static inline u32 ram_fc_gp_base_hi_w(void)
{
return 19;
}
static inline u32 ram_fc_gp_fetch_w(void)
{
return 20;
}
static inline u32 ram_fc_pb_fetch_w(void)
{
return 21;
}
static inline u32 ram_fc_pb_fetch_hi_w(void)
{
return 22;
}
static inline u32 ram_fc_pb_put_w(void)
{
return 23;
}
static inline u32 ram_fc_pb_put_hi_w(void)
{
return 24;
}
static inline u32 ram_fc_pb_header_w(void)
{
return 33;
}
static inline u32 ram_fc_pb_count_w(void)
{
return 34;
}
static inline u32 ram_fc_subdevice_w(void)
{
return 37;
}
static inline u32 ram_fc_target_w(void)
{
return 43;
}
static inline u32 ram_fc_hce_ctrl_w(void)
{
return 57;
}
static inline u32 ram_fc_chid_w(void)
{
return 58;
}
static inline u32 ram_fc_chid_id_f(u32 v)
{
return (v & 0xfff) << 0;
}
static inline u32 ram_fc_chid_id_w(void)
{
return 0;
}
static inline u32 ram_fc_config_w(void)
{
return 61;
}
static inline u32 ram_fc_runlist_timeslice_w(void)
{
return 62;
}
static inline u32 ram_fc_set_channel_info_w(void)
{
return 63;
}
static inline u32 ram_userd_base_shift_v(void)
{
return 0x00000009;
}
static inline u32 ram_userd_chan_size_v(void)
{
return 0x00000200;
}
static inline u32 ram_userd_put_w(void)
{
return 16;
}
static inline u32 ram_userd_get_w(void)
{
return 17;
}
static inline u32 ram_userd_ref_w(void)
{
return 18;
}
static inline u32 ram_userd_put_hi_w(void)
{
return 19;
}
static inline u32 ram_userd_ref_threshold_w(void)
{
return 20;
}
static inline u32 ram_userd_top_level_get_w(void)
{
return 22;
}
static inline u32 ram_userd_top_level_get_hi_w(void)
{
return 23;
}
static inline u32 ram_userd_get_hi_w(void)
{
return 24;
}
static inline u32 ram_userd_gp_get_w(void)
{
return 34;
}
static inline u32 ram_userd_gp_put_w(void)
{
return 35;
}
static inline u32 ram_userd_gp_top_level_get_w(void)
{
return 22;
}
static inline u32 ram_userd_gp_top_level_get_hi_w(void)
{
return 23;
}
static inline u32 ram_rl_entry_size_v(void)
{
return 0x00000010;
}
static inline u32 ram_rl_entry_type_f(u32 v)
{
return (v & 0x1) << 0;
}
static inline u32 ram_rl_entry_type_channel_v(void)
{
return 0x00000000;
}
static inline u32 ram_rl_entry_type_tsg_v(void)
{
return 0x00000001;
}
static inline u32 ram_rl_entry_id_f(u32 v)
{
return (v & 0xfff) << 0;
}
static inline u32 ram_rl_entry_chan_runqueue_selector_f(u32 v)
{
return (v & 0x1) << 1;
}
static inline u32 ram_rl_entry_chan_inst_target_f(u32 v)
{
return (v & 0x3) << 4;
}
static inline u32 ram_rl_entry_chan_inst_target_sys_mem_ncoh_v(void)
{
return 0x00000003;
}
static inline u32 ram_rl_entry_chan_userd_target_f(u32 v)
{
return (v & 0x3) << 6;
}
static inline u32 ram_rl_entry_chan_userd_target_vid_mem_v(void)
{
return 0x00000000;
}
static inline u32 ram_rl_entry_chan_userd_target_vid_mem_nvlink_coh_v(void)
{
return 0x00000001;
}
static inline u32 ram_rl_entry_chan_userd_target_sys_mem_coh_v(void)
{
return 0x00000002;
}
static inline u32 ram_rl_entry_chan_userd_target_sys_mem_ncoh_v(void)
{
return 0x00000003;
}
static inline u32 ram_rl_entry_chan_userd_ptr_lo_f(u32 v)
{
return (v & 0xffffff) << 8;
}
static inline u32 ram_rl_entry_chan_userd_ptr_hi_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ram_rl_entry_chid_f(u32 v)
{
return (v & 0xfff) << 0;
}
static inline u32 ram_rl_entry_chan_inst_ptr_lo_f(u32 v)
{
return (v & 0xfffff) << 12;
}
static inline u32 ram_rl_entry_chan_inst_ptr_hi_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
static inline u32 ram_rl_entry_tsg_timeslice_scale_f(u32 v)
{
return (v & 0xf) << 16;
}
static inline u32 ram_rl_entry_tsg_timeslice_scale_3_v(void)
{
return 0x00000003;
}
static inline u32 ram_rl_entry_tsg_timeslice_timeout_f(u32 v)
{
return (v & 0xff) << 24;
}
static inline u32 ram_rl_entry_tsg_timeslice_timeout_128_v(void)
{
return 0x00000080;
}
static inline u32 ram_rl_entry_tsg_timeslice_timeout_disable_v(void)
{
return 0x00000000;
}
static inline u32 ram_rl_entry_tsg_length_f(u32 v)
{
return (v & 0xff) << 0;
}
static inline u32 ram_rl_entry_tsg_length_init_v(void)
{
return 0x00000000;
}
static inline u32 ram_rl_entry_tsg_length_min_v(void)
{
return 0x00000001;
}
static inline u32 ram_rl_entry_tsg_length_max_v(void)
{
return 0x00000080;
}
static inline u32 ram_rl_entry_tsg_tsgid_f(u32 v)
{
return (v & 0xfff) << 0;
}
static inline u32 ram_rl_entry_chan_userd_ptr_align_shift_v(void)
{
return 0x00000008;
}
static inline u32 ram_rl_entry_chan_userd_align_shift_v(void)
{
return 0x00000008;
}
static inline u32 ram_rl_entry_chan_inst_ptr_align_shift_v(void)
{
return 0x0000000c;
}
#endif

View File

@@ -0,0 +1,293 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_therm_gv100_h_
#define _hw_therm_gv100_h_
static inline u32 therm_weight_1_r(void)
{
return 0x00020024;
}
static inline u32 therm_config1_r(void)
{
return 0x00020050;
}
static inline u32 therm_config2_r(void)
{
return 0x00020130;
}
static inline u32 therm_config2_slowdown_factor_extended_f(u32 v)
{
return (v & 0x1) << 24;
}
static inline u32 therm_config2_grad_enable_f(u32 v)
{
return (v & 0x1) << 31;
}
static inline u32 therm_gate_ctrl_r(u32 i)
{
return 0x00020200 + i*4;
}
static inline u32 therm_gate_ctrl_eng_clk_m(void)
{
return 0x3 << 0;
}
static inline u32 therm_gate_ctrl_eng_clk_run_f(void)
{
return 0x0;
}
static inline u32 therm_gate_ctrl_eng_clk_auto_f(void)
{
return 0x1;
}
static inline u32 therm_gate_ctrl_eng_clk_stop_f(void)
{
return 0x2;
}
static inline u32 therm_gate_ctrl_blk_clk_m(void)
{
return 0x3 << 2;
}
static inline u32 therm_gate_ctrl_blk_clk_run_f(void)
{
return 0x0;
}
static inline u32 therm_gate_ctrl_blk_clk_auto_f(void)
{
return 0x4;
}
static inline u32 therm_gate_ctrl_idle_holdoff_m(void)
{
return 0x1 << 4;
}
static inline u32 therm_gate_ctrl_idle_holdoff_off_f(void)
{
return 0x0;
}
static inline u32 therm_gate_ctrl_idle_holdoff_on_f(void)
{
return 0x10;
}
static inline u32 therm_gate_ctrl_eng_idle_filt_exp_f(u32 v)
{
return (v & 0x1f) << 8;
}
static inline u32 therm_gate_ctrl_eng_idle_filt_exp_m(void)
{
return 0x1f << 8;
}
static inline u32 therm_gate_ctrl_eng_idle_filt_mant_f(u32 v)
{
return (v & 0x7) << 13;
}
static inline u32 therm_gate_ctrl_eng_idle_filt_mant_m(void)
{
return 0x7 << 13;
}
static inline u32 therm_gate_ctrl_eng_delay_before_f(u32 v)
{
return (v & 0xf) << 16;
}
static inline u32 therm_gate_ctrl_eng_delay_before_m(void)
{
return 0xf << 16;
}
static inline u32 therm_gate_ctrl_eng_delay_after_f(u32 v)
{
return (v & 0xf) << 20;
}
static inline u32 therm_gate_ctrl_eng_delay_after_m(void)
{
return 0xf << 20;
}
static inline u32 therm_fecs_idle_filter_r(void)
{
return 0x00020288;
}
static inline u32 therm_fecs_idle_filter_value_m(void)
{
return 0xffffffff << 0;
}
static inline u32 therm_hubmmu_idle_filter_r(void)
{
return 0x0002028c;
}
static inline u32 therm_hubmmu_idle_filter_value_m(void)
{
return 0xffffffff << 0;
}
static inline u32 therm_clk_slowdown_r(u32 i)
{
return 0x00020160 + i*4;
}
static inline u32 therm_clk_slowdown_idle_factor_f(u32 v)
{
return (v & 0x3f) << 16;
}
static inline u32 therm_clk_slowdown_idle_factor_m(void)
{
return 0x3f << 16;
}
static inline u32 therm_clk_slowdown_idle_factor_v(u32 r)
{
return (r >> 16) & 0x3f;
}
static inline u32 therm_clk_slowdown_idle_factor_disabled_f(void)
{
return 0x0;
}
static inline u32 therm_grad_stepping_table_r(u32 i)
{
return 0x000202c8 + i*4;
}
static inline u32 therm_grad_stepping_table_slowdown_factor0_f(u32 v)
{
return (v & 0x3f) << 0;
}
static inline u32 therm_grad_stepping_table_slowdown_factor0_m(void)
{
return 0x3f << 0;
}
static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by1p5_f(void)
{
return 0x1;
}
static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by2_f(void)
{
return 0x2;
}
static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by4_f(void)
{
return 0x6;
}
static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f(void)
{
return 0xe;
}
static inline u32 therm_grad_stepping_table_slowdown_factor1_f(u32 v)
{
return (v & 0x3f) << 6;
}
static inline u32 therm_grad_stepping_table_slowdown_factor1_m(void)
{
return 0x3f << 6;
}
static inline u32 therm_grad_stepping_table_slowdown_factor2_f(u32 v)
{
return (v & 0x3f) << 12;
}
static inline u32 therm_grad_stepping_table_slowdown_factor2_m(void)
{
return 0x3f << 12;
}
static inline u32 therm_grad_stepping_table_slowdown_factor3_f(u32 v)
{
return (v & 0x3f) << 18;
}
static inline u32 therm_grad_stepping_table_slowdown_factor3_m(void)
{
return 0x3f << 18;
}
static inline u32 therm_grad_stepping_table_slowdown_factor4_f(u32 v)
{
return (v & 0x3f) << 24;
}
static inline u32 therm_grad_stepping_table_slowdown_factor4_m(void)
{
return 0x3f << 24;
}
static inline u32 therm_grad_stepping0_r(void)
{
return 0x000202c0;
}
static inline u32 therm_grad_stepping0_feature_s(void)
{
return 1;
}
static inline u32 therm_grad_stepping0_feature_f(u32 v)
{
return (v & 0x1) << 0;
}
static inline u32 therm_grad_stepping0_feature_m(void)
{
return 0x1 << 0;
}
static inline u32 therm_grad_stepping0_feature_v(u32 r)
{
return (r >> 0) & 0x1;
}
static inline u32 therm_grad_stepping0_feature_enable_f(void)
{
return 0x1;
}
static inline u32 therm_grad_stepping1_r(void)
{
return 0x000202c4;
}
static inline u32 therm_grad_stepping1_pdiv_duration_f(u32 v)
{
return (v & 0x1ffff) << 0;
}
static inline u32 therm_clk_timing_r(u32 i)
{
return 0x000203c0 + i*4;
}
static inline u32 therm_clk_timing_grad_slowdown_f(u32 v)
{
return (v & 0x1) << 16;
}
static inline u32 therm_clk_timing_grad_slowdown_m(void)
{
return 0x1 << 16;
}
static inline u32 therm_clk_timing_grad_slowdown_enabled_f(void)
{
return 0x10000;
}
#endif

View File

@@ -0,0 +1,109 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_timer_gv100_h_
#define _hw_timer_gv100_h_
static inline u32 timer_pri_timeout_r(void)
{
return 0x00009080;
}
static inline u32 timer_pri_timeout_period_f(u32 v)
{
return (v & 0xffffff) << 0;
}
static inline u32 timer_pri_timeout_period_m(void)
{
return 0xffffff << 0;
}
static inline u32 timer_pri_timeout_period_v(u32 r)
{
return (r >> 0) & 0xffffff;
}
static inline u32 timer_pri_timeout_en_f(u32 v)
{
return (v & 0x1) << 31;
}
static inline u32 timer_pri_timeout_en_m(void)
{
return 0x1 << 31;
}
static inline u32 timer_pri_timeout_en_v(u32 r)
{
return (r >> 31) & 0x1;
}
static inline u32 timer_pri_timeout_en_en_enabled_f(void)
{
return 0x80000000;
}
static inline u32 timer_pri_timeout_en_en_disabled_f(void)
{
return 0x0;
}
static inline u32 timer_pri_timeout_save_0_r(void)
{
return 0x00009084;
}
static inline u32 timer_pri_timeout_save_1_r(void)
{
return 0x00009088;
}
static inline u32 timer_pri_timeout_fecs_errcode_r(void)
{
return 0x0000908c;
}
static inline u32 timer_time_0_r(void)
{
return 0x00009400;
}
static inline u32 timer_time_1_r(void)
{
return 0x00009410;
}
#endif

View File

@@ -0,0 +1,229 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_top_gv100_h_
#define _hw_top_gv100_h_
static inline u32 top_num_gpcs_r(void)
{
return 0x00022430;
}
static inline u32 top_num_gpcs_value_v(u32 r)
{
return (r >> 0) & 0x1f;
}
static inline u32 top_tpc_per_gpc_r(void)
{
return 0x00022434;
}
static inline u32 top_tpc_per_gpc_value_v(u32 r)
{
return (r >> 0) & 0x1f;
}
static inline u32 top_num_fbps_r(void)
{
return 0x00022438;
}
static inline u32 top_num_fbps_value_v(u32 r)
{
return (r >> 0) & 0x1f;
}
static inline u32 top_ltc_per_fbp_r(void)
{
return 0x00022450;
}
static inline u32 top_ltc_per_fbp_value_v(u32 r)
{
return (r >> 0) & 0x1f;
}
static inline u32 top_slices_per_ltc_r(void)
{
return 0x0002245c;
}
static inline u32 top_slices_per_ltc_value_v(u32 r)
{
return (r >> 0) & 0x1f;
}
static inline u32 top_num_ltcs_r(void)
{
return 0x00022454;
}
static inline u32 top_num_ces_r(void)
{
return 0x00022444;
}
static inline u32 top_num_ces_value_v(u32 r)
{
return (r >> 0) & 0x1f;
}
static inline u32 top_device_info_r(u32 i)
{
return 0x00022700 + i*4;
}
static inline u32 top_device_info__size_1_v(void)
{
return 0x00000040;
}
static inline u32 top_device_info_chain_v(u32 r)
{
return (r >> 31) & 0x1;
}
static inline u32 top_device_info_chain_enable_v(void)
{
return 0x00000001;
}
static inline u32 top_device_info_engine_enum_v(u32 r)
{
return (r >> 26) & 0xf;
}
static inline u32 top_device_info_runlist_enum_v(u32 r)
{
return (r >> 21) & 0xf;
}
static inline u32 top_device_info_intr_enum_v(u32 r)
{
return (r >> 15) & 0x1f;
}
static inline u32 top_device_info_reset_enum_v(u32 r)
{
return (r >> 9) & 0x1f;
}
static inline u32 top_device_info_type_enum_v(u32 r)
{
return (r >> 2) & 0x1fffffff;
}
static inline u32 top_device_info_type_enum_graphics_v(void)
{
return 0x00000000;
}
static inline u32 top_device_info_type_enum_graphics_f(void)
{
return 0x0;
}
static inline u32 top_device_info_type_enum_copy2_v(void)
{
return 0x00000003;
}
static inline u32 top_device_info_type_enum_copy2_f(void)
{
return 0xc;
}
static inline u32 top_device_info_type_enum_lce_v(void)
{
return 0x00000013;
}
static inline u32 top_device_info_type_enum_lce_f(void)
{
return 0x4c;
}
static inline u32 top_device_info_engine_v(u32 r)
{
return (r >> 5) & 0x1;
}
static inline u32 top_device_info_runlist_v(u32 r)
{
return (r >> 4) & 0x1;
}
static inline u32 top_device_info_intr_v(u32 r)
{
return (r >> 3) & 0x1;
}
static inline u32 top_device_info_reset_v(u32 r)
{
return (r >> 2) & 0x1;
}
static inline u32 top_device_info_entry_v(u32 r)
{
return (r >> 0) & 0x3;
}
static inline u32 top_device_info_entry_not_valid_v(void)
{
return 0x00000000;
}
static inline u32 top_device_info_entry_enum_v(void)
{
return 0x00000002;
}
static inline u32 top_device_info_entry_data_v(void)
{
return 0x00000001;
}
static inline u32 top_device_info_data_type_v(u32 r)
{
return (r >> 30) & 0x1;
}
static inline u32 top_device_info_data_type_enum2_v(void)
{
return 0x00000000;
}
static inline u32 top_device_info_data_inst_id_v(u32 r)
{
return (r >> 26) & 0xf;
}
static inline u32 top_device_info_data_pri_base_v(u32 r)
{
return (r >> 12) & 0xfff;
}
static inline u32 top_device_info_data_pri_base_align_v(void)
{
return 0x0000000c;
}
static inline u32 top_device_info_data_fault_id_enum_v(u32 r)
{
return (r >> 3) & 0x7f;
}
static inline u32 top_device_info_data_fault_id_v(u32 r)
{
return (r >> 2) & 0x1;
}
static inline u32 top_device_info_data_fault_id_valid_v(void)
{
return 0x00000001;
}
#endif

View File

@@ -0,0 +1,89 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_usermode_gv100_h_
#define _hw_usermode_gv100_h_
static inline u32 usermode_cfg0_r(void)
{
return 0x00810000;
}
static inline u32 usermode_cfg0_class_id_f(u32 v)
{
return (v & 0xffff) << 0;
}
static inline u32 usermode_cfg0_class_id_value_v(void)
{
return 0x0000c361;
}
static inline u32 usermode_time_0_r(void)
{
return 0x00810080;
}
static inline u32 usermode_time_0_nsec_f(u32 v)
{
return (v & 0x7ffffff) << 5;
}
static inline u32 usermode_time_1_r(void)
{
return 0x00810084;
}
static inline u32 usermode_time_1_nsec_f(u32 v)
{
return (v & 0x1fffffff) << 0;
}
static inline u32 usermode_notify_channel_pending_r(void)
{
return 0x00810090;
}
static inline u32 usermode_notify_channel_pending_id_f(u32 v)
{
return (v & 0xffffffff) << 0;
}
#endif

View File

@@ -0,0 +1,137 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_xp_gv100_h_
#define _hw_xp_gv100_h_
static inline u32 xp_dl_mgr_r(u32 i)
{
return 0x0008b8c0 + i*4;
}
static inline u32 xp_dl_mgr_safe_timing_f(u32 v)
{
return (v & 0x1) << 2;
}
static inline u32 xp_pl_link_config_r(u32 i)
{
return 0x0008c040 + i*4;
}
static inline u32 xp_pl_link_config_ltssm_status_f(u32 v)
{
return (v & 0x1) << 4;
}
static inline u32 xp_pl_link_config_ltssm_status_idle_v(void)
{
return 0x00000000;
}
static inline u32 xp_pl_link_config_ltssm_directive_f(u32 v)
{
return (v & 0xf) << 0;
}
static inline u32 xp_pl_link_config_ltssm_directive_m(void)
{
return 0xf << 0;
}
static inline u32 xp_pl_link_config_ltssm_directive_normal_operations_v(void)
{
return 0x00000000;
}
static inline u32 xp_pl_link_config_ltssm_directive_change_speed_v(void)
{
return 0x00000001;
}
static inline u32 xp_pl_link_config_max_link_rate_f(u32 v)
{
return (v & 0x3) << 18;
}
static inline u32 xp_pl_link_config_max_link_rate_m(void)
{
return 0x3 << 18;
}
static inline u32 xp_pl_link_config_max_link_rate_2500_mtps_v(void)
{
return 0x00000002;
}
static inline u32 xp_pl_link_config_max_link_rate_5000_mtps_v(void)
{
return 0x00000001;
}
static inline u32 xp_pl_link_config_max_link_rate_8000_mtps_v(void)
{
return 0x00000000;
}
static inline u32 xp_pl_link_config_target_tx_width_f(u32 v)
{
return (v & 0x7) << 20;
}
static inline u32 xp_pl_link_config_target_tx_width_m(void)
{
return 0x7 << 20;
}
static inline u32 xp_pl_link_config_target_tx_width_x1_v(void)
{
return 0x00000007;
}
static inline u32 xp_pl_link_config_target_tx_width_x2_v(void)
{
return 0x00000006;
}
static inline u32 xp_pl_link_config_target_tx_width_x4_v(void)
{
return 0x00000005;
}
static inline u32 xp_pl_link_config_target_tx_width_x8_v(void)
{
return 0x00000004;
}
static inline u32 xp_pl_link_config_target_tx_width_x16_v(void)
{
return 0x00000000;
}
#endif

View File

@@ -0,0 +1,201 @@
/*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Function naming determines intended use:
*
* <x>_r(void) : Returns the offset for register <x>.
*
* <x>_o(void) : Returns the offset for element <x>.
*
* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
*
* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
*
* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
* and masked to place it at field <y> of register <x>. This value
* can be |'d with others to produce a full register value for
* register <x>.
*
* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
* value can be ~'d and then &'d to clear the value of field <y> for
* register <x>.
*
* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
* to place it at field <y> of register <x>. This value can be |'d
* with others to produce a full register value for <x>.
*
* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
* <x> value 'r' after being shifted to place its LSB at bit 0.
* This value is suitable for direct comparison with other unshifted
* values appropriate for use in field <y> of register <x>.
*
* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
* field <y> of register <x>. This value is suitable for direct
* comparison with unshifted values appropriate for use in field <y>
* of register <x>.
*/
#ifndef _hw_xve_gv100_h_
#define _hw_xve_gv100_h_
static inline u32 xve_rom_ctrl_r(void)
{
return 0x00000050;
}
static inline u32 xve_rom_ctrl_rom_shadow_f(u32 v)
{
return (v & 0x1) << 0;
}
static inline u32 xve_rom_ctrl_rom_shadow_disabled_f(void)
{
return 0x0;
}
static inline u32 xve_rom_ctrl_rom_shadow_enabled_f(void)
{
return 0x1;
}
static inline u32 xve_link_control_status_r(void)
{
return 0x00000088;
}
static inline u32 xve_link_control_status_link_speed_m(void)
{
return 0xf << 16;
}
static inline u32 xve_link_control_status_link_speed_v(u32 r)
{
return (r >> 16) & 0xf;
}
static inline u32 xve_link_control_status_link_speed_link_speed_2p5_v(void)
{
return 0x00000001;
}
static inline u32 xve_link_control_status_link_speed_link_speed_5p0_v(void)
{
return 0x00000002;
}
static inline u32 xve_link_control_status_link_speed_link_speed_8p0_v(void)
{
return 0x00000003;
}
static inline u32 xve_link_control_status_link_width_m(void)
{
return 0x3f << 20;
}
static inline u32 xve_link_control_status_link_width_v(u32 r)
{
return (r >> 20) & 0x3f;
}
static inline u32 xve_link_control_status_link_width_x1_v(void)
{
return 0x00000001;
}
static inline u32 xve_link_control_status_link_width_x2_v(void)
{
return 0x00000002;
}
static inline u32 xve_link_control_status_link_width_x4_v(void)
{
return 0x00000004;
}
static inline u32 xve_link_control_status_link_width_x8_v(void)
{
return 0x00000008;
}
static inline u32 xve_link_control_status_link_width_x16_v(void)
{
return 0x00000010;
}
static inline u32 xve_priv_xv_r(void)
{
return 0x00000150;
}
static inline u32 xve_priv_xv_cya_l0s_enable_f(u32 v)
{
return (v & 0x1) << 7;
}
static inline u32 xve_priv_xv_cya_l0s_enable_m(void)
{
return 0x1 << 7;
}
static inline u32 xve_priv_xv_cya_l0s_enable_v(u32 r)
{
return (r >> 7) & 0x1;
}
static inline u32 xve_priv_xv_cya_l1_enable_f(u32 v)
{
return (v & 0x1) << 8;
}
static inline u32 xve_priv_xv_cya_l1_enable_m(void)
{
return 0x1 << 8;
}
static inline u32 xve_priv_xv_cya_l1_enable_v(u32 r)
{
return (r >> 8) & 0x1;
}
static inline u32 xve_cya_2_r(void)
{
return 0x00000704;
}
static inline u32 xve_reset_r(void)
{
return 0x00000718;
}
static inline u32 xve_reset_reset_m(void)
{
return 0x1 << 0;
}
static inline u32 xve_reset_gpu_on_sw_reset_m(void)
{
return 0x1 << 1;
}
static inline u32 xve_reset_counter_en_m(void)
{
return 0x1 << 2;
}
static inline u32 xve_reset_counter_val_f(u32 v)
{
return (v & 0x7ff) << 4;
}
static inline u32 xve_reset_counter_val_m(void)
{
return 0x7ff << 4;
}
static inline u32 xve_reset_counter_val_v(u32 r)
{
return (r >> 4) & 0x7ff;
}
static inline u32 xve_reset_clock_on_sw_reset_m(void)
{
return 0x1 << 15;
}
static inline u32 xve_reset_clock_counter_en_m(void)
{
return 0x1 << 16;
}
static inline u32 xve_reset_clock_counter_val_f(u32 v)
{
return (v & 0x7ff) << 17;
}
static inline u32 xve_reset_clock_counter_val_m(void)
{
return 0x7ff << 17;
}
static inline u32 xve_reset_clock_counter_val_v(u32 r)
{
return (r >> 17) & 0x7ff;
}
#endif

View File

@@ -17,16 +17,25 @@
#define NVGPU_GPUID_GV11B \ #define NVGPU_GPUID_GV11B \
GK20A_GPUID(NVGPU_GPU_ARCH_GV110, NVGPU_GPU_IMPL_GV11B) GK20A_GPUID(NVGPU_GPU_ARCH_GV110, NVGPU_GPU_IMPL_GV11B)
#define NVGPU_GPUID_GV100 \
GK20A_GPUID(NVGPU_GPU_ARCH_GV100, NVGPU_GPU_IMPL_GV100)
#define NVGPU_COMPAT_TEGRA_GV11B "nvidia,gv11b" #define NVGPU_COMPAT_TEGRA_GV11B "nvidia,gv11b"
#define NVGPU_COMPAT_GENERIC_GV11B "nvidia,generic-gv11b" #define NVGPU_COMPAT_GENERIC_GV11B "nvidia,generic-gv11b"
#define TEGRA_19x_GPUID NVGPU_GPUID_GV11B #define TEGRA_19x_GPUID NVGPU_GPUID_GV11B
#define TEGRA_19x_GPUID_HAL gv11b_init_hal #define TEGRA_19x_GPUID_HAL gv11b_init_hal
#define TEGRA_19x_GPU_COMPAT_TEGRA NVGPU_COMPAT_TEGRA_GV11B #define TEGRA_19x_GPU_COMPAT_TEGRA NVGPU_COMPAT_TEGRA_GV11B
#define TEGRA_19x_GPU_COMPAT_GENERIC NVGPU_COMPAT_GENERIC_GV11B #define TEGRA_19x_GPU_COMPAT_GENERIC NVGPU_COMPAT_GENERIC_GV11B
#define BIGGPU_19x_GPUID NVGPU_GPUID_GV100
#define BIGGPU_19x_GPUID_HAL gv100_init_hal
struct gpu_ops; struct gpu_ops;
extern int gv11b_init_hal(struct gk20a *); extern int gv11b_init_hal(struct gk20a *);
extern int gv100_init_hal(struct gk20a *);
extern struct gk20a_platform t19x_gpu_tegra_platform; extern struct gk20a_platform t19x_gpu_tegra_platform;
#endif #endif

View File

@@ -25,7 +25,9 @@
#define _UAPI__LINUX_NVGPU_T19X_IOCTL_H_ #define _UAPI__LINUX_NVGPU_T19X_IOCTL_H_
#define NVGPU_GPU_ARCH_GV110 0x00000150 #define NVGPU_GPU_ARCH_GV110 0x00000150
#define NVGPU_GPU_ARCH_GV100 0x00000140
#define NVGPU_GPU_IMPL_GV11B 0x0000000B #define NVGPU_GPU_IMPL_GV11B 0x0000000B
#define NVGPU_GPU_IMPL_GV100 0x00000000
/* /*
* this flag is used in struct nvgpu_as_map_buffer_ex_args * this flag is used in struct nvgpu_as_map_buffer_ex_args