Commit Graph

5641 Commits

Author SHA1 Message Date
Mahantesh Kumbar
ae96316a85 gpu: nvgpu: separate ACR bootstrap functionality from common ACR
Currently  ACR bootstrap functions are mixed with common
ACR public functions file, so need to separate it out

JIRA NVGPU-2911

Change-Id: I433514f1924a13e206d80d756b78056dbb2e4841
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2033812
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-11 05:24:05 -07:00
Deepak Nibade
4ba2b6f142 gpu: nvgpu: remove ctx/method init load from GR boot
Loading of ctx/method init values from NET image is done in GR boot
sequence and also in golden image creation
Doing this during GR boot creation is unnecessary since those writes
are anyways part of golden image itself

Hence remove those method loads from gk20a_init_gr_setup_hw()

Also remove g->ops.gr.commit_global_timeslice() call since that too
is covered during golden image creation

Since above code is removed disabling and restoring fe_go_idle timeout
is also not needed

Jira NVGPU-1885

Change-Id: Ic6eb4bea7ceb36bb1420f58446785cefe25066df
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034042
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-11 04:34:44 -07:00
Seema Khowala
ffb1869144 gpu: nvgpu: add nvgpu_pg_elpg_protected_call macro
gr_gk20a_elpg_protected_call is renamed as
nvgpu_pg_elpg_protected_call and resides in common/
power_features/pg.c

JIRA NVGPU-2014

Change-Id: Id027d9a81ca93e0d47bbeeeb537d5fcd882f68d3
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034274
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-08 16:25:36 -08:00
Seema Khowala
c905858565 gpu: nvgpu: add cg and pg function
Add new power/clock gating functions that can be called by
other units.

New clock_gating functions will reside in cg.c under
common/power_features/cg unit.

New power gating functions will reside in pg.c under
common/power_features/pg unit.

Use nvgpu_pg_elpg_disable and nvgpu_pg_elpg_enable to disable/enable
elpg and also in gr_gk20a_elpg_protected macro to access gr registers.

Add cg_pg_lock to make elpg_enabled, elcg_enabled, blcg_enabled
and slcg_enabled thread safe.

JIRA NVGPU-2014

Change-Id: I00d124c2ee16242c9a3ef82e7620fbb7f1297aff
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2025493
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-08 16:24:35 -08:00
Alex Waterman
7172d96bcd gpu: nvgpu: unit: Final pd_cache requirement verification tests
These tests implement the pd_cache requirement verification tests for
all pd_cache requirements and test specifications. They cover:

  o  PD GPU address computation
  o  PD offset computation
  o  Init
  o  Multiple inits
  o  Cleanup*

[*] the cleanup needs some more POSIX memory API support: we need a way
to make sure that all outstanding allocations are freed.

JIRA NVGPU-1323

Change-Id: If6398ad09c9d38f5ac2fdad057bb933f88224599
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034273
GVS: Gerrit_Virtual_Submit
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-08 14:04:18 -08:00
Philip Elcan
40e26014d6 gpu: nvgpu: atomic: add missing atomic ops
There were a number of atomic ops that didn't have both 32bit and
64bit implementations for nvgpu. This adds the missing pieces.

JIRA NVGPU-2842

Change-Id: I985dc9ba7e1c187d2b7986f3c3e8452937134d45
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2035186
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-08 12:54:38 -08:00
Rajesh Devaraj
cf7d338c8a gpu: nvgpu: Moving chip-agnostic SDL APIs
This patch restructures the position of chip-agnostic SDL related APIs
from HALs. Specifically, it moves nvgpu_*_report_ecc_error APIs from
LTC, PMU, HUBMMU, and GR units of gv11b.

Jira NVGPU-2722

Change-Id: I19424ee71083dd3cbc0d0021e5e3721e436082a6
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034849
Reviewed-by: Raghuram Kothakota <rkothakota@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-08 09:26:47 -08:00
Deepak Nibade
8ac8b27ba4 gpu: nvgpu: move gp10b fecs_trace HAL to gr/fecs trace unit
Rename gp10b/fecs_trace_tu104.* files to
common/gr/fecs_trace/fecs_trace_gp10b.*

Also move HAL API gp10b_fecs_trace_flush() to gr/fecs_trace unit

Remove fecs_trace_gp10b.h header include from rest of the code

Jira NVGPU-1880

Change-Id: Ia27c70ed7071751c17345f65599591be1e34c49d
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2032708
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-08 07:07:43 -08:00
Deepak Nibade
3391aa9d84 gpu: nvgpu: move fecs_trace bind/unbind calls to gr/fecs_trace unit
Move below calls to gr/fecs_trace unit
gk20a_fecs_trace_bind_channel()
gk20a_fecs_trace_unbind_channel()

And rename them to
nvgpu_gr_fecs_trace_bind_channel()
nvgpu_gr_fecs_trace_unbind_channel()

We are not accessing any fifo/ch/tsg construct in gr/fecs_trace unit
hence update parameter list of above APIs to receive inst_block,
gr_ctx, subctx pointers directly instead of receiving channel_gk20a

Delete gk20a/fecs_trace_gk20a.* files since they are no longer
required. All the contents in those files are now moved to gr/fecs_trace
unit

Jira NVGPU-1880

Change-Id: I7ef9f0b66781b45155035237172ae400f02740e4
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2032707
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-08 07:07:27 -08:00
Deepak Nibade
8ce2a97d8e gpu: nvgpu: create common.gr.hwpm_map unit
Create new unit common.gr.hwpm_map with source file common/gr/hwpm_map.c
and public header include/nvgpu/gr/hwpm_map.h

Move all APIs in gr_gk20a.c that handle hwpm_map functionality to this
new unit. This unit now exposes below struct that is included in struct
gr_gk20a

struct nvgpu_gr_hwpm_map {
	u32 pm_ctxsw_image_size;

	u32 count;
	struct ctxsw_buf_offset_map_entry *map;

	bool init;
}

Expose below APIs
nvgpu_gr_hwpm_map_init() - initialize HWPM map meta-data with given size
nvgpu_gr_hwpm_map_deinit() - deinitialize HWPM map
nvgpu_gr_hwmp_map_find_priv_offset() - find a given offset in the map

The sequence to create the map by reading various netlist segments is
moved to a static API nvgpu_gr_hwpm_map_create()

Jira NVGPU-2894

Change-Id: I07d31169d2ff18a496eb79a726027b847d5f0e06
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2032777
GVS: Gerrit_Virtual_Submit
Reviewed-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-08 05:55:29 -08:00
Mahantesh Kumbar
ed530d99fe gpu: nvgpu: print PMU command/message unit-id upon RPC failure
Print PMU command/message unit-id upon RPC failure
to know which command/message failed using RPC unit-id

Bug 200499055

Change-Id: Ifbe033347c5e1902328acc5c1f96f38860093fd2
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034783
Reviewed-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 22:54:51 -08:00
Mahantesh Kumbar
c7ce4a4465 gpu: nvgpu: disable VFE frequency margin request
Disabled VFE frequency margin request to PMU as TU104 don't support
this feature currently. 

Bug 200499055

Change-Id: I8e217cae9a0cbb6f388fb3376efc22f6e40e5c89
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034728
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 22:54:42 -08:00
Philip Elcan
67caad40e9 gpu: nvgpu: unit: update misc atomics to use gcc builtins
There were a few outliers in the unit tests that were still using old
style atomics (__sync_*). This updates those to use the new standard
builtins in GCC.

JIRA NVGPU-2842

Change-Id: Ib79e0fb48e7812b57aa4634ad96c37436c2b3923
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034217
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 19:04:29 -08:00
Philip Elcan
867206ac6f gpu: nvgpu: unit: make POSIX atomic apis atomic
Update the initial POSIX atomic implementation to use GCC builtin atomic
functions for unit testing. The original implementation assumed single
access. This enables the apis to actually be atomic safe.

JIRA NVGPU-2842

Change-Id: If91f5215aed27b1efb20cab862fea2d91cbf4be0
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030723
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 19:04:20 -08:00
Philip Elcan
63621db276 gpu: nvgpu: atomic: atomic64_dec_return return val
nvgpu_atomic64_dec_return was not returning a value like it should
be. This updates functions to return a long.

JIRA NVGPU-2842

Change-Id: Ia765c763a69e55540fe51da2a6134888e3e1c3f8
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030722
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 19:04:12 -08:00
Seema Khowala
1c3fbd9dc7 gpu: nvgpu: move chip specific fuse to hal
Move chip specific fuse code from common/fuse to hal/fuse.
Replace gk20a_readl/writel with nvgpu_readl/writel
Replace 0xFFFFFFFFU with U32_MAX hash define

JIRA NVGPU-2035

Change-Id: Icaa908db036053d5e6f4ff20b9e5b1d6c0ab2fda
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2033278
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 15:14:38 -08:00
Seema Khowala
5222d0ff4f gpu: nvgpu: do not do timeout_debug_dump for non fifo_error_idle_timeout
Any recovery that goes through gk20a_fifo_recover path e.g. gr error,
mmu fault or any recovery that involves engine recovery as well, will
still dump the full debug dump. This change will just avoid dumping debug
dump for force reset channels and pbdma intr if they do not involve
engine recovery. For FIFO_ERROR_IDLE_TIMEOUT error notifiers that
involves tsg recovery only, debug_dump will happen only if
timeout_debug_dump is set. timeout_debug_dump by default is set to true
but can be changed using NVGPU_IOCTL_CHANNEL_SET_TIMEOUT_EX.

Bug 2092051

Change-Id: Ibbf3cd2c44c586d9deb9e61ffbf37945b8d9e428
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2033068
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 15:14:24 -08:00
Nicolin Chen
31ac769454 gpu: nvgpu: Remove device_is_iommuable
The downstream device_is_iommuable() is removed.
Check the dev->archdata.iommu pointer instead.

Bug 200385990

Change-Id: I1fe400beddc8b4f2262368b5e0e8726abca007a6
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030334
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 14:24:36 -08:00
Preetham Chandru R
ad351f17be gpu: nvgpu: typedefs page_table and dma_mapping.
typedef nvidia_p2p_page_table to nvidia_p2p_page_table_t and typedef
nvidia_p2p_dma_mapping to nvidia_p2p_dma_mapping_t.

Bug 200438879

Change-Id: I1278c4022990fdedb668e7b20ae35631d2da6089
Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2033843
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:47:27 -08:00
Thomas Fleury
b64ee64fa7 gpu: nvgpu: do not free individual runlists
gk20a_fifo_delete_runlist was invoking nvgpu_kfree for each
runlist, but active runlists are now stored in the
g->active_runlist_info array.

Remove nvgpu_kfree for individual runlists.
Also clear active_runlist_info and num_runlists fields in
gk20a_fifo_delete_runlist.

Bug 2470115
Bug 2522374

Change-Id: Ie678c16af31ed8345ca0f015c17d61a3965b924d
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030970
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:46:25 -08:00
Thomas Fleury
70453a8606 Revert "Revert "gpu: nvgpu: allocate only active runlists""
This reverts commit f67bc51e51.

Currently a fifo_runlist_info_gk20a structure is allocated and
initialized for each possible runlist. But only a few runlists
are actually used.

Skip allocation and initialization of inactive runlists. Active
runlists info is stored in the active_runlist_info array.If a
runlist is active, then runlist_info[runlist_id] points to one
entry in active_runlist_info. Otherwise, runlist_info[runlist_id]
is NULL.

Operations that used to walk through all runlists are modified
to walk though active runlists only.

Bug 2470115
Bug 2522374

Change-Id: I98253ebebb4b1ba5957b57329820b94444b9d41b
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030409
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:46:15 -08:00
Thomas Fleury
c23738969d Revert "Revert "gpu: nvgpu: array of pointers to runlists""
This reverts commit ade1d50cbe.

Currently a fifo_runlist_info_gk20a structure is allocated and
initialized for each possible runlist. But only a few runlists
are actually used.

Use an array of pointers to runlists in fifo_gk20a. The array
keeps existing indexing by runlist_id. In this patch a context
is still allocated for each possible runlist, but follow up
patch will allow to skip context allocation for inactive
runlists.

Bug 2470115
Bug 2522374

Change-Id: I0deb6981bc6f5152bdf121f0a44429748aa14687
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030407
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:45:59 -08:00
Preetham Chandru R
8bbbd09caa gpu: nvgpu: add compatibility version
Add compatibility version to page table and dma mapping structure.

Bug 200438879

Change-Id: I04b4601f71ae2b3e75843f39f5445ecca2b16677
Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2029086
Reviewed-by: Stephen Warren <swarren@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:45:07 -08:00
Philip Elcan
aa72f2d03a gpu: nvgpu: volt: fix MISRA 10.3 violations
Fix MISRA Rule 10.3 violations in common/pmu/volt for assigning
objects of different size or essential type.

JIRA NVGPU-1008

Change-Id: I876df3828effd52cab555cc6c1bacfec56e87d23
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2027657
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:44:36 -08:00
Philip Elcan
767dc82ccf gpu: nvgpu: clk: clean up casts for MISRA 10.3
In a previous commit the macro NV_PMU_CLK_MSG_RPC_ALLOC_OFFSET was
updated to be defined with the cast. This eliminates the need to cast
when used in clk.c.

JIRA NVGPU-1008

Change-Id: Iea2a42f3ec0d1c9e8e8e71f69bb87fc8231ad8da
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2028634
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:44:26 -08:00
Philip Elcan
538c5cbe7b gpu: nvgpu: therm: fix MISRA 10.3 violations
Fix MISRA Rule 10.3 violations in common/pmu/therm for assigning
objects of different size or essential type.

JIRA NVGPU-1008

Change-Id: I1b940515192e9c976927dae30ba466ca885297de
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2027656
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:44:15 -08:00
Philip Elcan
011b42e05f gpu: nvgpu: pmgr: fix MISRA 10.3 violations
Fix MISRA Rule 10.3 violations in common/pmu/pmgr for assigning objects
of different size or essential type.

JIRA NVGPU-1008

Change-Id: Icc6b6757d4231cbad842580b28f5fd86fdb1f79b
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2027655
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:44:05 -08:00
Philip Elcan
bfc3c57afb gpu: nvgpu: perf: fix MISRA 10.3 violations
Fix MISRA Rule 10.3 violations in common/pmu/perf for assigning objects
of different size or essential type.

JIRA NVGPU-1008

Change-Id: I7fa7f981ba80c2d6951821ed3c847a814fc8b3b6
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2027654
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:43:55 -08:00
Philip Elcan
967f6defd0 gpu: nvgpu: clk: fix MISRA 10.3 violations
This fixes MISRA 10.3 violations for assignment to narrower or different
type with the use of for_each_set_bit macros.

JIRA NVGPU-1008

Change-Id: If90428047115b09c4172252857a6b22a86197b77
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2027653
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:43:45 -08:00
Rajesh Devaraj
313109975f gpu: nvgpu: Enable the reporting of ECC errors for LTC
Enable the reporting of ECC errors on hw module LTC. These errors
will be notified to the underlying safety service.

Jira NVGPU-1857

Change-Id: I9917ecc39087a92c81d656812fbd9e13f8a42979
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2024853
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Raghuram Kothakota <rkothakota@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:43:08 -08:00
Rajesh Devaraj
8d67ec69ea gpu: nvgpu: add accessors for DSTG interrupt
Add missing register DSTG_ECC_ADDRESS and add a field INFO_RAM for
gv11b. This will be used to distinguish DSTG ECC errors in Data RAM
and Byte Enable RAM.

Jira NVGPU-1857

Change-Id: I42917e66ed38c4eff38256e0f108dd88f8c72c68
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2022516
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:42:48 -08:00
Aparna Das
85f0f1f167 gpu: nvgpu: vgpu: gp10b: delete vgpu fuse code
Fuse ops check_priv_security is obsolete as the code
was used for t18x simulation. Remove vgpu_fuse_gp10b files
that implements this op for vgpu.

Jira GVSCI-334

Change-Id: Ie47e23c711f1abad9a048df0c2e6b15573c270ff
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2013354
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:42:06 -08:00
Aparna Das
72de0a41b3 nvgpu: vgpu: remove vgpu_mm_gp10b files
vgpu_mm_gp10b files contained gp10b specific code.

- vgpu_gp10b_locked_gmmu_map function is common to all
chips. Rename this function to vgpu_locked_gmmu_map
and move this function implementation to to mm_vgpu
file.

- diable_bigpage variable is set to false in
vgpu_gp10b_init_mm_setup_hw function. This is not related
to mm hw initialization. Move this assignment to
vgpu_init_variables along with other mm specific initialization
as done for native.

Change-Id: I4aba3096a3c945b8b3f4175382ebc78322e1d16e
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2028862
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:41:50 -08:00
Aparna Das
68bbe11c45 gpu: nvgpu: vgpu: move vgpu mm files under vgpu/mm
Create a new directory mm under common vgpu path moving
all vgp common mm files under that directory. This follows
native directory structure.

Move vgpu vm functions from mm_vgpu.c to a new file vm_vgpu.c.
Rename corresponding header file from vm.h to vm_gpu.h

Jira GVSCI-334

Change-Id: Ib77efca0b919478284101894ab16919ba03f71d2
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2013352
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:41:34 -08:00
Aparna Das
b7e311ddea gpu: nvgpu: vgpu: move vgpu ltc files under vgpu/ltc
Create a new directory ltc under common vgpu path moving
all vgp common ltc files under that directory. This follows
native directory structure.

Jira GVSCI-334

Change-Id: Ia1acded37dfd1ad714c1d775dd9899016f891d22
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2013351
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:41:18 -08:00
rmylavarapu
a39fb11ce8 gpu: nvgpu: Remove VFE_INVALIDATE RPC for PS3.5
Changes:
In PSTATE3.5, VFE_INVALIDATE is triggered within the PMU
whenever the PMU processes the event. This removes the need
for the driver to explicitly trigger VFE_INVALIDATE.
So, removing VFE_INVALIDATE RPC in pmu_set_boot_clk_runcb_fn
which will be called when we receive a perf event.

Bug 200493291

Change-Id: Ied3e1dd49d148703eb3a067351245a06d0034dcc
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034476
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 08:58:54 -08:00
Philip Elcan
59356c58b0 gpu: nvgpu: pmu: fix MISRA 10.3 bugs in pmu_gp106
This fixes a number of MISRA 10.3 violations in pmu_gp106.c. MISRA
rule 10.3 prohibits implicit assignment to narrower size or different
essential type.

JIRA NVGPU-2841

Change-Id: Idf53f53c0f4b4af45d6dd7f2c8167ef992d4b486
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2032052
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 07:50:42 -08:00
Thomas Fleury
f20424ea6a gpu: nvgpu: remove channel cycle stats ioctls
Cycle stats and cycle stats snapshot ioctls have been moved to
debug node. Removing channel ioctls.

Bug 220464613

Change-Id: I3aecdf4a8310eeb38de2de5ac076048891afe436
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030992
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Raghuram Kothakota <rkothakota@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 07:50:38 -08:00
Mahantesh Kumbar
3dca832142 gpu: nvgpu: ACR chip specific init using GPUID
Currently ACR chip specific properties set using HAL ops but
need to move out from HAL ops as ACR unit doesn't access
H/W directly & uses other engines to execute ACR on chip.

To fix used GPUID to init ACR chip specific properties

JIRA NVGPU-2909

Change-Id: I8fa1abcace6f7870bd116d39f94430497d80840b
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2032666
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-06 13:13:52 -08:00
Deepak Nibade
73621db660 gpu: nvgpu: remove unused GR hal operations
Below HAL operations are not being used anywhere, hence remove them
g->ops.gr.program_active_tpc_counts()
g->ops.gr.setup_alpha_beta_tables()

Change-Id: I448ecd9aae104508d22011dc26ea70dd40a6b0f2
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2032675
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-06 10:43:57 -08:00
Philip Elcan
8d4331e13e gpu: nvgpu: pmu: fix MISRA 10.3 issues in pmu_perfmon
MISRA Rule 10.3 prohibits implicit assignment of objects of narrower
size or essential type. This fixes MISRA 10.3 violations in pmu_ipc.c

JIRA NVGPU-2841

Change-Id: I15cfd968029d57f6480c8968c56d558571d76e5e
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2027769
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-06 10:43:44 -08:00
Philip Elcan
0a57c4b93e gpu: nvgpu: pmu: fix MISRA 10.3 issues in pmu_ipc
MISRA Rule 10.3 prohibits implicit assignment of objects of narrower
size or essential type. This fixes MISRA 10.3 violations in pmu_ipc.c

JIRA NVGPU-2841

Change-Id: I97e236ce8e64407ab776611c512caee13c9186a0
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2027768
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-06 10:43:40 -08:00
Philip Elcan
0990135166 gpu: nvgpu: pmu: fix MISRA 10.3 issues in pmu_fw
MISRA Rule 10.3 prohibits implicit assignment of objects of narrower
size or essential type. This fixes MISRA 10.3 violations in pmu_fw.c

The API set_pmu_cmdline_args_secure_mode() was updated to accept a u8
for the val parameter to avoid unnecessary casts.

The APIs get_perfmon_cmd_init_offsetofvar() and
get_perfmon_cmd_start_offsetofvar() were updated to pass a u32 by
reference to get the offset value so the return value can be used
properly.

JIRA NVGPU-2841

Change-Id: I8ae34531e843022e8bfa9b5c60ad163b0f7fbf5c
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2027767
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-06 10:43:37 -08:00
Debarshi Dutta
675a2b6858 gpu: nvgpu: added non-functional changes to engines unit
The following changes are made in this patch.

1) nvgpu driver is incorrectly using u32 to store enum values in some
functions. Replaced them with correct type enum nvgpu_fifo_engine

2) change parameter type in nvgpu_engine_get_ids from engine_id[]
to *engine_ids

3) rename some function names to remove redundant characters to make
the name shorter.

4) Removed the initialization of enum nvgpu_fifo_engine in functions
where we assign a value before direct access.

Jira NVGPU-1315

Change-Id: Ic65b40c9cb1e90ad278cb36a00e1c9de51724f27
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2020230
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-06 04:45:20 -08:00
Mahantesh Kumbar
10d0799dd7 gpu: nvgpu: Support to disable LS PMU
Added support to disable/skip to load LS PMU based on PMU support flag,
when LS PMU skipped only basic PMU engine ops are needed for HS ACR
to load & execute on PMU engine falcon,

GR LS falcons cold/recovery bootstrap will be taken care by ACR as HS
ACR will be loaded for both case & exits by halting in non-secure mode.

JIRA NVGPU-173

Change-Id: I7288c185a9ca2e18b2689aa8a7e0c27a61dd12f5
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2019927
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-06 02:24:29 -08:00
Tejal Kudav
153daf7adf gpu: nvgpu: Fix MISRA 10.6 violations in nvlink
MISRA rule 10.6 does not allow assigning of composite expression
to an object with wider essential type. Fix 10.6 violations in nvlink
code by changing the data-type or by type-casting.

JIRA NVGPU-1921

Change-Id: I2d661ca7960e49ebc062c4eb8817004f73297cf5
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2022881
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-06 01:15:38 -08:00
Antony Clince Alex
ccc0f39f40 gpu: nvgpu: add fecs trace enable check in deinit path
FECS trace deinit routine was not checking if tracer was enabled
when attempting to stop the tracer thread. This causes thead stop to
fail when trace is not running.

Jira NVGPU-2801

Change-Id: I09f5eb3c4f498434e6e30394ee675e7745cfde5d
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2029941
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-05 13:17:44 -08:00
Nicolas Benech
d02c558aa4 gpu: nvgpu: fix EXPECT_BUG macro
The EXPECT_BUG macro is using setjmp/longjmp semantics but was
doing so in an inconsistent way that could cause issues if the
code was compiled with optimizations enabled (release builds).
Specifically, if setjmp is used in an "if" statement, a relational
or equality operator must be used with the right operand being an
integer constant expression. The unary ! operator cannot be used
in this case.

JIRA NVGPU-1246

Change-Id: Iebecff95aefd5b96a8f1f2f13bc178b370374563
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2029459
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-05 11:15:39 -08:00
Nicolas Benech
350c8ebf11 gpu: nvgpu: unit: handle BUG() calls in pd_cache
With the use of nvgpu_assert in pd_cache code, some tests trying
to cause failures are now causing calls to BUG() which are now
being handled with calls to EXPECT_BUG

JIRA NVGPU-677

Change-Id: Idc3696ddef30165588fe9c9dcb6ab0b7241ab5fe
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2020601
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-05 11:14:58 -08:00
Nicolas Benech
9db43bad82 gpu: nvgpu: unit: handle BUG() calls in page_table
With the use of nvgpu_assert in page_table code, some tests trying
to cause failures are now causing calls to BUG() which are now
being handled with calls to EXPECT_BUG

JIRA NVGPU-677

Change-Id: Ib73055eba307ce00a2515fed19c7c278413bdc43
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2020600
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-05 11:14:54 -08:00