Commit Graph

352 Commits

Author SHA1 Message Date
Seema Khowala
72b51a129f gpu: nvgpu: gv11b: detect stall intr during preemption
Check for interrupts or hangs while waiting for the preempt to complete.
During pbdma/eng preempt done polling, any stalling interrupts relating
to the runlist must be detected and handled in order for the preemption
to complete.

When PBDMA fault or CE fault occurs, the PBDMA will save out
automatically. TSG related to the context in which the fault occurred
will not be scheduled again until the fault is handled.
In the case of some other issue requiring the engine to be reset, TSG
will need to be manually preempted.

In all cases, a PBDMA interrupt may occur prior to the PBDMA being able to
switch out. SW must handle these interrupts according to the relevant handling
procedure before the PBDMA preempt can complete.

Opt for eng reset instead of waiting for preemption to be finished when
there is any stall interrupt pending during engine context preempt completion.

Bug 200277163
Bug 1945121

Change-Id: Icaef79e3046d82987b8486d15cbfc8365aa26f2e
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1522914
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: David Martinez Nieto <dmartineznie@nvidia.com>
Tested-by: David Martinez Nieto <dmartineznie@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-15 02:05:16 -08:00
Seema Khowala
f1c962daae gpu: nvgpu: gv11b: mc_elpg_enable & soc credit init moved to bpmp
-Program mc_elpg_enable and mss nvlink soc credits only
 when bpmp is not running or bpmp is running but underlying
 platorm is simulation. For simulation, bpmp does not execute
 hot reset sequence. As part of gpu unpowergate, bpmp will
 program mc_elpg_enable and also set mss nvlink soc credits
 after bringing mss nvlink out of reset
-Remove updating mc_enable as writes to this register has no
 effect
-Remove fifo_fb_iface_r read/write. This hack was added during
 initial bring up of emulation platforms

Bug 2018223
Bug 200269361

Change-Id: Ie09c259e48295a93c6d15376308186152db973fa
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1594495
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-14 15:46:40 -08:00
Seema Khowala
b8e5724399 gpu: nvgpu: gv11b: define final netlist
Use NETD firmware on gv11b.
GV11B_NETLIST_IMAGE_FW_NAME set to GK20A_NETLIST_IMAGE_D

Change-Id: I0301999851ffb14713beaf61b5b2cc97efac74eb
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1597290
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-14 10:25:40 -08:00
Deepak Nibade
4dbf6f7bd6 gpu: nvgpu: define preemption modes in common code
Use common preemption modes in common code instead of using linux specific
definitions

Jira NVGPU-392

Change-Id: Iff65ab4278973f2e2d7db33f6fedb561b2164c42
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1596931
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-14 04:58:48 -08:00
Peter Daifuku
0f52023687 gpu: nvgpu: ctx_patch_write fixes
- Update commit_global_timeslice to remove unused patch parameter
- Update calls to ctx_patch_write_begin/end to add update_patch_count param

JIRA ESRM-74
Bug 2012077

Change-Id: Ie2e640dfa0ab7193a062a58f588575f220e5efd3
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1594791
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-13 18:19:28 -08:00
Terje Bergstrom
d64241cb5a gpu: nvgpu: Include UAPI explicitly
Add explicit #includes for <uapi/linux/nvgpu.h> for source code files
that depend on it.

JIRA NVGPU-388

Change-Id: I5d834e6f3b413cee9b1e4e055d710fc9f2c8f7c2
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1596246
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-13 10:57:21 -08:00
Sami Kiminki
98bd673a73 gpu: nvgpu: Remove PTE kind code for GV100/GV11B
Remove gv11b_init_uncompressed_kind_map(), gv11b_init_kind_attr(), and
the related kind setup code. They are not needed anymore.

While we're doing these changes, remove a redundant assignment of
g->bootstrap_owner in hal_gv100.c.

Bug 1902982

Change-Id: Ib40d8f55cfbfa34143a3765c2b4913926ca021fd
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1560931
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-10 08:37:52 -08:00
seshendra Gadagottu
d99b72974d gpu: nvgpu: gv11b: clear channel status
After unbinding channel, following fields in
channel status needs to be cleared manually:
ccsr_channel_enable_clr_true
ccsr_channel_pbdma_faulted_reset
ccsr_channel_eng_faulted_reset

Unbinding channel expected to clear all other
channel status fields.

Bug 1972365

Change-Id: Ibfd84df2f41adc2eb437a026acde3f3d618d7758
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1594671
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-09 19:19:03 -08:00
seshendra Gadagottu
96cb31ea10 gpu: nvgpu: gv11b: update prod settings
Updated clock gating prod settings for HWCL # 39314184.
This is corrected output after fixing issue in register
generator tool.

Bug 1994238

Change-Id: I646c4e1a134570016425367be636250205205005
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1594605
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-09 19:19:00 -08:00
Terje Bergstrom
01e5b17e08 gpu: nvgpu: gv11b: Move sm_arch to nvgpu_gpu_params
Move sm_arch_* fields to nvgpu_gpu_params to make them available from
common code without accessing Linux specific GPU characteristics.

JIRA NVGPU-259

Change-Id: I8e7b542642b620f161d62954400777079065f49d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1593692
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-09 19:18:39 -08:00
Terje Bergstrom
c87e85af0c gpu: nvgpu: Return GPU classes in get_litter_value
Return GPU classes in HAL get_litter_value() instead of assigning
them to GPU characteristics at HAL initialization time.

JIRA NVGPU-259

Change-Id: I92cbadf3bd07292a8715d30843972def879795f5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1593691
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-09 19:18:31 -08:00
Terje Bergstrom
5b368d3e46 gpu: nvgpu: gv1xx: Move fuse override DT handling
Move fuse override DT handling to Linux code. All the chip specific
fuse override functions did the same thing, so delete the HAL and
call the same function to read the DT overrides on all chips.

Also remove the fuse override functionality from dGPU. There are no
DT entries for PCIe devices, so it would've failed anyway.

JIRA NVGPU-259

Change-Id: Ic672e25090cdfc207d9771ab61b6cf53185113a4
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1593693
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-09 14:27:13 -08:00
Sami Kiminki
075852f042 gpu: nvgpu: Switch to newer NVGPU_AS_MAP_BUFFER flags
Switch two cases using the old NVGPU_MAP_BUFFER_FLAGS_CACHEABLE_*
flags to the newer definitions, that is,
NVGPU_AS_MAP_BUFFER_FLAGS_CACHEABLE. The legacy NVGPU_MAP_BUFFER_FLAGS_*
definitions have been deleted.

Bug 1902982

Change-Id: Ifbd2678b10005b4af2375600888469b01dd09f4e
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1592655
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-08 09:09:19 -08:00
Seema Khowala
bcd78a0be6 nvgpu: gv11b: implement railgate/unrailgate
Implement gv11b platform specific rail gating functions
by calling relevant powergate and unpowergate functions
and linux clock frmework functions:

gv11b_tegra_is_railgated
gv11b_tegra_railgate
gv11b_tegra_unrailgate

These calls will take care of hot reset sequence
required for gpu powergate and gpu unpowergate.

Bug 200269361
Bug 200273571

Change-Id: Ib1825e4324d51fc508b3b5dc9e5e2fdb252eeff4
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1589509
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-02 16:15:52 -07:00
Deepak Nibade
d73e89f984 gpu: nvgpu: move platform_gk20a.h to linux
Fix #includes in all the files to include platform_gk20a.h file with
correct path

NVGPU-316

Change-Id: Icb26d3c75076b8fdc8da992f751e1cfea22996be
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1589939
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-02 10:26:30 -07:00
Deepak Nibade
e5c3b05bb2 gpu: nvgpu: use struct gk20a for create_gr_sysfs
API gr_gv11b_create_sysfs() and GR HAL create_gr_sysfs() right now receive
linux specific struct device
But since this function is called from/declared in common code, we need to
remove linux dependency from it

Hence update the API and GR HAL to receive struct gk20a pointer instead
of device pointer

Jira NVGPU-259

Change-Id: I65d717ad9f263f0397f8efa5761c64e55c7846eb
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1588465
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-02 05:11:02 -07:00
Alex Waterman
f472922b35 gpu: nvgpu: Split ctxsw_trace API into non-Linux component
T19x component for similar change in the main nvgpu code.

JIRA NVGPU-287

Change-Id: Ib126b3d1fb562850fbb3ab89103f2a7fdaa13306
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1589430
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-01 20:15:50 -07:00
Deepak Nibade
d393d3294f gpu: nvgpu: use nvgpu_* APIs to allocate/free memory
Use nvgpu specific nvgpu_kcalloc()/nvgpu_kfree() calls instead of linux specific
kcalloc()/kfree()

Jira NVGPU-259

Change-Id: I73034ea23561d1269230b9ac10360f8b171b8d41
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1588221
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-01 00:07:11 -07:00
Seema Khowala
4f24e212cb gpu: nvgpu: gv11b: replay invalid pte faults only
Try to fix invalid pte type repalayable faults only.
All other replayable faults will be cancelled so that
next mmu fault for same fault address will be triggered
as non-replayable fault and ch/tsg teardown will take place.

Bug 1958308

Change-Id: I63b90ce7c639ee183f87db3e771f253fd04c3567
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1566576
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-01 00:00:54 -07:00
Seema Khowala
d69e51813a gpu: nvgpu: gv11b: fix faulted channel's id/type
Teardown function should be passed appropriate id and
id_type. E.g. if a channel is marked as tsg, channel teardown/rc
function should be passed it's tsgid as id and type_tsg as
id_type

Bug 200277163

Change-Id: I2e83561c03d515fac28cbb8ce75a9f2c7bf746ac
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1557296
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-01 00:00:50 -07:00
Alex Waterman
afd1649cfc gpu: nvgpu: Move ctxsw_trace_gk20a.c to common/linux
Fixups for the change of name subject in nvgpu.

JIRA NVGPU-287

Change-Id: I6c19733079061a42786b94fc48db374d715ccbef
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1586548
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-29 11:02:24 -07:00
Seema Khowala
60f12fb2f7 gpu: nvgpu: fix implicit declaration of nvgpu_inst_block_addr
t19x changes necessary for change in core MM code.

JIRA NVGPU-30

Change-Id: Id0d66543582abcef522e3182da0b01d0042f4b14
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1585476
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-27 13:35:46 -07:00
David Nieto
2029426446 gpu: nvgpu: gv1xx: resize patch buffer
Follow the sizing consideration in bug 1753763 to support dynamic TPC modes
and subcontexts.

bug 200350539

Change-Id: Ibbdbf02f9c2ea3f082c1b2810ae7176b0775d461
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1584034
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-26 17:56:15 -07:00
Terje Bergstrom
938785f152 gpu: nvgpu: Linux specific GPU characteristics flags
Make GPU characteristics flags specific to Linux code only. The
rest of driver is moved to using nvgpu_is_enabled() API.

JIRA NVGPU-259

Change-Id: I46a5a90bb34f170e9e755e7683be142ed6b18cce
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1583992
GVS: Gerrit_Virtual_Submit
2017-10-26 14:35:38 -07:00
Terje Bergstrom
33c707d60b gpu: nvgpu: Linux specific sm_error_state_record
Create an nvgpu internal nvgpu_gr_sm_error_state to store and
propagate SM error state within driver. Use
nvgpu_dbg_gpu_sm_error_state_record only in Linux code.

JIRA NVGPU-259

Change-Id: Ia2b347d0054365bdc790b4d6f2653a568935bdb0
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1585646
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-26 13:26:30 -07:00
Peter Daifuku
1cbb5ea023 gpu: nvgpu: init_cyclestats fixes
- in the native case, replace calls for init_cyclestats with
  the gm20b version, as each chip had identical versions of the code.

- in the virtual case, use the vgpu version of the function in order
  to get the new max_css_buffer_size characteristic set to the mempool
  size.

JIRA ESRM-54
Bug 200296210

Change-Id: I475876cb392978fb1350ede58e37d0962ae095c3
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1578934
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-25 20:24:16 -07:00
Seema Khowala
914ded175c gpu: nvgpu: gv11b: update regops whitelist
Updated regops whitelist for HW CL 39314184
i.e. snap_0913 and VDK_R11

Change-Id: Ie22f0a000c4bb151023a92e0d7e877bbceb157f2
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1565684
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-25 17:29:25 -07:00
Seema Khowala
42ee5493de gpu: nvgpu: gv11b: update clock gating prod settings
Updated clock gating prod settings for HW CL 39314184
i.e. snap_0913 and VDK_R11

Change-Id: Iae6fd9e95ee5e1ec20bafbb24cd761bdce8fdc5f
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1565683
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-25 17:29:24 -07:00
seshendra Gadagottu
c6ccb5f2a1 gpu: nvgpu: gv11b: use scg perf for smid numbering
For SCG to work, smid numbering needs to be done
based on scg performance of tpcs. For gv11b and
gv11b vgpu, reuse gv100 function "gr_gv100_init_sm_id_table"
to do this.

Used local variable "index" to avoid multiple computations in
the function: gr_gv100_init_sm_id_table
index = sm_id + sm

Add deug info for printing initialized gpc/tpc/sm/global_tpc
indexs.

Bug 1842197

Change-Id: Ibf10f47f10a8ca58b86c307a22e159b2cc0d0f43
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1583916
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-25 11:23:24 -07:00
Alex Waterman
0899e11d4b gpu: nvgpu: Cleanup generic MM code
t19x changes necessary for change in core MM code.

JIRA NVGPU-30

Change-Id: I62f419450c1a33d0826390d7cbb5ad93569f8c89
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1577265
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: David Martinez Nieto <dmartineznie@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-24 15:16:49 -07:00
Deepak Goyal
86e1c3278f gpu: nvgpu: gv11b: use correct acr_dmem_desc ver.
gv11b should use acr_dmem_desc_v1 instead of acr_dmem_desc.

JIRA GPUT19X-5

Change-Id: I3ccae72541607aec12e25845ea4cb875ff11d67c
Signed-off-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1583642
Reviewed-by: Supriya Sharatkumar <ssharatkumar@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-23 11:55:18 -07:00
David Nieto
d436ed36ae gpu: nvgpu: gv10x: alloc fault buffer in sysmem
With coherency issues solved, it is no longer needed to allocate the fault
buffer in vidmem as a workaround.

JIRA: NVGPUGV100-36

Change-Id: I1c83e9bac61f27b75f38fce963899485afeed009
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1582769
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-10-22 22:15:31 -07:00
David Nieto
6114553413 gpu: nvgpu: gv100: fix timeout handling
GV100 has a larger vidmem size and a slower sideband to sysmem so timeouts
need to be adjusted to avoid false positives.

JIRA: NVGPUGV100-36

Change-Id: I3cbc19aa1158c89bc48ae1fa6ec4bc755cd9389d
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1582092
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-22 22:15:22 -07:00
Mahantesh Kumbar
2904e3ac00 gpu: nvgpu: gv100 memory unlock support
- Added method to load mem unlock binary into
  nvdec falcon & execute to perform mem unlock
  if VPR enabled.
- Updated .mem_unlock gv100 HAL to point
  method gv100_fb_memory_unlock().
- Updated .mem_unlock gv11b HAL to NULL.
- Added vpr info hw registers
- Added nvdec enable hw register

Change-Id: Ia4bf820ae103baede679d300d1d390fd748c919a
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
(cherry picked from commit 2e176ad9d47316bf4d001692a2ae07e6c1fb1ccb)
Reviewed-on: https://git-master.nvidia.com/r/1573101
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-21 17:34:34 -07:00
seshendra Gadagottu
324cf7b49e gpu: nvgpu: gv11b: memory aperture for perfbuf
Updated perf_pmasys_mem_block_target in perf_pmasys_mem_block
based on memory aperture used for perfbuf inst_block.

Bug 200327596

Change-Id: Ic3df332a2248c5ea2d6d38ceab8ba04c618ffefc
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1582788
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-20 19:04:00 -07:00
seshendra Gadagottu
cf70c925cd gpu: nvgpu: gv11b: update css ops
Updated following hal functions for css gv11b and reused
them for gv100:
enable_snapshot
disable_snapshot
check_data_available

These changes are needed because of following reasons:
1. Register offsets for perf_pmasys_* are changed
   for gv11b/gv100 from gk20a.
2. Updated memory type for perf_pmasys_mem_block_target
   based on memory aperture used for hwpm inst_block.

Bug 200327596

Change-Id: I500d17670e2f389d8d0e77884374bcc3504a41f8
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1507546
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-20 19:03:56 -07:00
seshendra Gadagottu
387ecf8a63 gpu: nvgpu: gv1xx: Remove HAL for restore_context_header
gr restore_context_header is not required any more after
enabling per context va mode for subcontext. Cleaning-up
unused function pointers from gv100 and gv11b HAL.

Change-Id: I65cc7d12d3c96726d323defd99726c3e259e7e63
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1581432
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-20 10:05:40 -07:00
Alex Waterman
62e133029d gpu: nvgpu: Refactoring nvgpu_vm functions
Change required for equivalent change on nvgpu. This is required
since a few HALs were added that must be populated for all chips.

This patch adds those HAL definitions for gv11b, gv100, and the
vgpu.

JIRA NVGPU-30
JIRA NVGPU-138

Change-Id: I65374764350a5cacce8624b15d98947fada35a4a
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1579865
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-18 16:01:08 -07:00
seshendra Gadagottu
201ccbfa85 gpu: nvgpu: gv11b: update dbg ops
Updated following hal functions for gv11b and reused
them for gv100:
perfbuffer_enable
perfbuffer_disable

These changes are needed because of following reasons:
1. Register offsets for perf_pmasys_* are changed
   for gv11b/gv100 from gk20a.
2. Updated memory type for perf_pmasys_mem_block_target
   to sys_ncoh_f().

Bug 200327596

Change-Id: Ia672ac561917c8ed36caea9cc7e74b7fc7ce8188
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1571074
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-18 11:26:10 -07:00
Terje Bergstrom
3fc7c5f75e gpu: nvgpu: gv11b: Use nvgpu_rwsem as TSG channel lock
Use abstract nvgpu_rwsem as TSG channel list lock instead of the Linux
specific rw_semaphore.

JIRA NVGPU-259

Change-Id: I5f6c918464315e3d140bea0c61a619c3712619c1
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1579934
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
2017-10-17 14:05:13 -07:00
Terje Bergstrom
99cae3dff7 gpu: nvgpu: gv11b: Use internal nvgpu_warpstate
Replace use of ioctl structure warpstate with internal
nvgpu_warptate.

JIRA NVGPU-259

Change-Id: I003c15152042e566124c04d6124e515e36157c88
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1578683
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-17 09:25:17 -07:00
Peter Daifuku
4b8dc71de5 gpu: nvgpu: vgpu: flatten out t19x vgpu hal
Instead of calling the native HAL init function then adding
multiple layers of modification for VGPU, flatten out the sequence
so that all entry points are set statically and visible in a
single file.

JIRA ESRM-30

Change-Id: I8d277aaccb0e63b2d504e7aba32eb31ef82f4ec0
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1574619
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-13 15:20:19 -07:00
Terje Bergstrom
b0092ea95c gpu: nvgpu: gv11b: Abstract IO aperture accessors
Implement T19x specific usermode aperture initialization functions.
Move usermode_regs field to nvgpu_os_linux_t19x, because it is
Linux specific.

JIRA NVGPU-259

Change-Id: I9d6ce243a692ab48209d468288ed85f89fb26770
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1569699
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-13 15:20:01 -07:00
seshendra Gadagottu
506f891f76 gpu: nvgpu: gv11b: add syncpt shim ro map
For sync-point read map, create read only map per vm
and share with all channels that are using same vm.

Now restrict rw map to single syncpoint shim memory range.

JIRA GPUT19X-2

Change-Id: Ibd0b82d1cdb8861e1dbb073b27da1f9c9ab1d2ab
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1514339
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-13 15:19:17 -07:00
Timo Alho
a693acc5b4 Revert "gpu: nvgpu: gv11b: disable cycle stat"
This reverts commit 6647e5c956.

Bug 200352825

Change-Id: Ia44d61eafce78f99be2271e0afaf69cd5c102080
Signed-off-by: Timo Alho <talho@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1577920
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Tested-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Srikar Srimath Tirumala <srikars@nvidia.com>
2017-10-12 13:46:09 -07:00
Alex Waterman
ade9f5e03f gpu: nvgpu: Remove phys_addr_t from common code
Remove phys_addr_t change for corresponding change in the nvgpu
main repo.

JIRA NVGPU-30
JIRA NVGPU-226

Change-Id: I05a19bc51e949279edef6e9ad7161226cbca51a7
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1576466
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-11 14:40:23 -07:00
David Nieto
f518304e0d gpu: nvgpu: fix GV100 hal definitions
These changes allow GV100 to init the basic HALs to pass
nvgpu_submit_twod

(1) Allocate fault buffer from vidmem instead of sysmem to prevent coherency
issues
(2) Properly enable FB
(3) Fan control requires the execution of the pre-os FW, without it the SKU201
is extremely noisy

 JIRA: NVGPUGV100-9

Change-Id: I9b2072737e45432f957e7faae6d33bc0ab43b817
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1539926
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-10 12:05:41 -07:00
Seema Khowala
bb1c38e2f5 gpu: nvgpu: gv11b: perfbuffer enable and disable dbg ops set to NULL
Will be enabled after feature is verified on volta

Bug 200352825

Change-Id: Idbe318ea82051e53f15caecf2afb15d72b99acea
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1574482
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-10-10 09:24:46 -07:00
Seema Khowala
6647e5c956 gpu: nvgpu: gv11b: disable cycle stat
Feature will be enabled after it is verified.
To disable cycle stat, do not set
NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS and
NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS_SNAPSHOT

Bug 200352825

Change-Id: I3f0d58a8095f3a0996964056029c12cff45f0a5b
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1573760
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-10 09:22:08 -07:00
Seema Khowala
6fe9bdeb9a gpu: nvgpu: gv11b: track init veid bundle
Add debug prints to track veid bundle init
and also return err for subctx init failure.

Bug 1983643

Change-Id: I9e6a32e76b1c7deba3a47157ba253976d88b2324
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1568070
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-10-10 08:10:37 -07:00