Commit Graph

6715 Commits

Author SHA1 Message Date
Mahantesh Kumbar
4e1d8519c8 gpu: nvgpu: Deleting falcon's unit gp106 & gv100 support
-Deleting GP106 & GV100 from falcon unit as GP106 & GV100
 is not supported anymore.

JIRA NVGPU-3243

Change-Id: I931ca7b3cc5d165ff1d2bbfa251079c1d4ecec66
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2168083
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-08-05 23:00:44 -07:00
Mahantesh Kumbar
b23dc81f05 gpu: nvgpu: Deleting ACR's unit GV100 support
-Deleting GV100 from ACR unit as GV100 is not
 supported anymore.

JIRA NVGPU-3243

Change-Id: I8461db05a199a32643d9ec797e9db23d1f286886
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2168050
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-08-05 23:00:27 -07:00
Vaibhav Kachore
6a799732d8 gpu: nvgpu: Remove powergating API from safety build
For safety build, powergate APIs are not supposed to be used
at run-time. Keeping needed partitions unpowergated by default
for safety builds.

Bug 200539825

Change-Id: I72148f12fd72e51cfe4d01d010f92f633c564810
Signed-off-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2165042
Reviewed-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-08-05 22:58:37 -07:00
Philip Elcan
2eb3ba4fa2 gpu: nvgpu: fbp: fix CERT-C violations
CERT-C Rule INT30-C Requires that unsigned integer operations do not
wrap. Fix these violations by using the safe ops.

JIRA NVGPU-3868
Change-Id: I79abc966425dc454f0fbcaca24506c73b63ff683
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2166260
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Kumbhar <nkumbhar@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-08-05 16:56:42 -07:00
Philip Elcan
42f5a2d806 gpu: nvgpu: fb: fix CERT-C violations
CERT-C Rule INT30-C Requires that unsigned integer operations do not
wrap. Fix these violations by using the safe ops.

JIRA NVGPU-3868

Change-Id: I51e8ee212777232b6d7c033078bea9b9c77ff898
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2166259
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Kumbhar <nkumbhar@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-08-05 16:56:33 -07:00
Philip Elcan
a09142c231 gpu: nvgpu: priv_ring: fix CERT-C violations
CERT-C Rule INT30-C Requires that unsigned integer operations do not
wrap. Fix these violations by using the safe ops.

JIRA NVGPU-3868

Change-Id: Ifc7396146d85b34d6bd04eb16675ab6234364b1b
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2166258
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Kumbhar <nkumbhar@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-08-05 16:56:23 -07:00
Sagar Kamble
faec0fde02 gpu: nvgpu: falcon: fix CERT-C violations
CERT-C INT-30 requires checking if arithmetic operations will wrap. Use
the safe ops in falcon.c and falcon_gk20a_fusa.c to fix this violation.
Also fix bulk of checkpatch issues.

JIRA NVGPU-3865

Change-Id: I05e53f49dfb19656d325cbb125b36b7ce33b14e4
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2164846
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@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-08-05 05:16:05 -07:00
Sagar Kamble
ade88cfe7c gpu: nvgpu: pass port parameter to falcon_falcon_imemt_r
In copy_to_imem, falcon_falcon_imemt_r() was accessed always for port 0.
This should be accessed based on port parameter like imemc and imemd.

JIRA NVGPU-3865

Change-Id: I83369fb589a91a80312fe1d055a13dfe06e12bef
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2166714
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@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-08-05 05:15:56 -07:00
Debarshi Dutta
0ef96e4b1a gpu: nvgpu: correct handling of pbdma rc
nvgpu_rc_pbdma_fault just checks for the id and id_type from struct
nvgpu_pbdma_status_info. These contain invalid values during chsw_load
and chsw_switch. This patch corrects the above bug by checking for the
chsw status and then loading the values for id and type.

The current code reads the pbdma_status info after clearing the
interrupt. Other interrupts can cause enough delay between clearing the
interrupt and pbdma switching the channel leading to invalid channel/tsg
ID. Correct that by reading the pbdma_status info register before
clearing of the pbdma interrupt to correctly read the context
information before the pbdma can switch out the context.

Bug 2648298

Change-Id: Ic2f0682526e00d14ad58f0411472f34388183f2b
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2165047
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: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-08-05 02:56:16 -07:00
Vedashree Vidwans
8a691fcf6c gpu: nvgpu: fix CERT-C violations in mm
INT30-C requires that unsigned integer operations do not wrap.
INT31-C requires checking that data isn't misinterpreted after casting.
INT32-C requires that signed operations do not overflow.

Jira NVGPU-3882

Change-Id: I6b4c1769ec85919f8ec2aa183cba3b7c0ffa1e97
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2166124
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-08-05 00:45:53 -07:00
Deepak Nibade
3baaa28992 gpu: nvgpu: reset CE engines if CONFIG_NVGPU_CE is disabled
If CONFIG_NVGPU_CE is disabled, nvgpu right now does not even reset
the CE engines or initialize prod values.
This ultimately needs to be fixed by adding appropriate initialization
for CE engines even if CONFIG_NVGPU_CE is disabled.

For now, add the code to at least reset CE engines if CONFIG_NVGPU_CE
is disabled

Bug 2526212

Change-Id: Id0a6fbfe44ef7af62715bcee65bef056359f1c19
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2165861
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@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>
2019-08-02 01:57:37 -07:00
Philip Elcan
8eebce0ac6 gpu: nvgpu: ecc: fix CERT-C violations
INT30-C requires that unsigned integer operations do not wrap.
INT32-C requires that operations on signed integers do not result in
overflow.
FIO47-C requires use of valid format strings.
Fix CERT-C violations of these types in nvgpu.common.ecc.

JIRA NVGPU-3868

Change-Id: I72e15ae2e6d6a4db4e7e9971e13e143cf58b6dc4
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2164602
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-08-02 00:58:20 -07:00
Philip Elcan
02441457c1 gpu: nvgpu: cg: fix CERT-C INT31 violations
CERT-C Rule INT31 requires checking that no data is lost when doing
casts, so use the safe cast operations in nvgpu.hal.cg unit.

JIRA NVGPU-3868

Change-Id: I573e903c78623a2e41f7062851a1a875c88d79c2
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2164601
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-08-02 00:58:11 -07:00
Vedashree Vidwans
19c80f89be gpu: nvgpu; fix MISRA errors in nvgpu.common.mm
Rule 2.2 doesn't allow unused variable assignments. The reason is
presence of unused variable assignments may indicate error in program's
logic.
Rule 21.x doesn't allow reserved identifier or macro names starting with
'_' to be reused or defined.

Jira NVGPU-3864

Change-Id: I8ee31c0ee522cd4de00b317b0b4463868ac958ef
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2163723
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-08-01 21:57:18 -07:00
vinodg
2d93706fe1 gpu: nvgpu: reduce code complexity in gr.falcon unit
Reduce code complexity of following functions in gr.falcon unit
nvgpu_gr_falcon_load_secure_ctxsw_ucode(complexity : 14 to 5)

Create sub functions by moving the control statement codes from the
function which has high complexity above 10.

Create three sub functions from nvgpu_gr_falcon_load_secure_ctxsw_ucode function
Sub functions to do bootstrap during recovery and cold boot
Generalize sec2 and ls_pmu bootstrap to a single function.
gr_falcon_sec2_or_ls_pmu_bootstrap(with complexity : 4)
gr_falcon_recovery_bootstrap(with complexity : 4)
gr_falcon_coldboot_bootstrap(with complexity : 5)
and reduce nvgpu_gr_falcon_load_secure_ctxsw_ucode complexity to 5

Jira NVGPU-3662

Change-Id: I290580572d6c6dac6aa9bbd93b06c84ec3b93637
Signed-off-by: vinodg <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2165255
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-08-01 16:45:19 -07:00
Debarshi Dutta
48c00bbea9 gpu: nvgpu: rename channel functions
This patch makes the following changes

1) rename public channel functions to use nvgpu_channel prefix
2) rename static channel functions to use channel prefix

Jira NVGPU-3248

Change-Id: Ib556a0d6ac24dc0882bfd3b8c68b9d2854834030
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2150729
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-08-01 04:37:31 -07:00
Debarshi Dutta
92d009e796 gpu: nvgpu: add safety build flag CONFIG_NVGPU_SW_SEMAPHORE
Added the safety build flag CONFIG_NVGPU_SW_SEMAPHORE to compile out
sw semaphore implementation in NVGPU. sw semaphore is only used for
presilicon bringup of GPU and hence is not needed for safety build.

Jira NVGPU-3172

Change-Id: I6a46ef22f1e2059437f710198f4ea49a47656fef
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2164216
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@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-07-31 23:26:19 -07:00
vinodg
feb3ba3d59 gpu: nvgpu: reduce code complexity in gr.falcon unit
Reduce code complexity of following functions in gr.falcon unit
gm20b_gr_falcon_ctx_wait_ucode(complexity : 21 to 9)

Create sub functions by moving the control statement codes from the
function which has high complexity above 10.

Create two sub functions from gm20b_gr_falcon_ctx_wait_ucode function
Sub functions to check the opcode failure and opcode success.
gm20b_gr_falcon_check_ctx_opcode_success(with complexity : 7)
gm20b_gr_falcon_check_ctx_opcode_failure(with complexity : 7)
and reduce gm20b_gr_falcon_ctx_wait_ucode complexity to 9

Jira NVGPU-3662

Change-Id: I445dab4e4149af2cc88d19a5b18b105077dece5f
Signed-off-by: vinodg <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2165217
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-31 18:25:27 -07:00
vinodg
e1e750a65a gpu: nvgpu: reduce code complexity in gr.falcon unit
Reduce code complexity of following functions in gr.falcon unit
gv11b_gr_falcon_handle_fecs_ecc_error(complexity : 12 to 8)

Create sub functions by moving the control statement codes from
the function which has high complexity above 10.

Create one sub functions from gv11b_gr_falcon_handle_fecs_ecc_error function
One sub function to set the fecs_ecc_error status locally.
gr_falcon_set_fecs_ecc_error_status(with complexity : 5) and
reduce gv11b_gr_falcon_handle_fecs_ecc_error complexity to 8

Jira NVGPU-3662

Change-Id: I9ce3cd7b6b4fb453445457ba5f19faf7086b5fc6
Signed-off-by: vinodg <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2165190
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-31 16:25:18 -07:00
Mahantesh Kumbar
3efeaf52d9 gpu: nvgpu: Add support to load sec2 FUSA RTOS ucode
-Add support to load sec2 FUSA RTOS ucode on FUSA
 SKU by checking is_fusa_sku flag check

JIRA NVGPU-3730

Change-Id: I3286238e41bb9c97411d10ebe7541c1ff74a7c42
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2164070
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-31 11:51:25 -07:00
Vedashree Vidwans
209f68be3c gpu: nvgpu: fix MISRA errors in nvgpu.hal.mc
Rule 8.6 requires each identifier with external linkage to have exactly
one external definitions.
Rule 10.x necessitates operands to have essential type; left and right
operands should be of same width and type.
Rule 17.7 requires function return value to be checked for error
information.
This patch fixes above mentioned errors in nvgpu.hal.mc.

Jira NVGPU-3855

Change-Id: I5440392de5d55dc98ed2002273af8a44a596cd3a
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2162145
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-31 06:05:45 -07:00
Seshendra Gadagottu
5f4de54535 gpu: nvgpu: move non-secure boot related HAL to non FuSa file
Moved non-secure gr falcon boot related code to non-functional safety file.
Also added HAL initialization related to these functions under
CONFIG_NVGPU_GR_FALCON_NON_SECURE_BOOT flag.

JIRA NVGPU-3741

Change-Id: I72fb92c04dc6e76c338e9a0e0cd86b12109ce284
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2158936
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-30 20:55:54 -07:00
Seshendra Gadagottu
b9dbea6d5e gpu: nvgpu: add flag for non-secure gr falcon related code
Compile-out non-secure gr falcon boot related code for safety build by
adding non-secure gr falcon related code under following flag:
CONFIG_NVGPU_GR_FALCON_NON_SECURE_BOOT

Added nvgpu_gr_falcon_load_ctxsw_ucode and related functions under
CONFIG_NVGPU_GR_FALCON_NON_SECURE_BOOT flag and enabled this flag only
for non-safety builds.

JIRA NVGPU-3741

Change-Id: I817d8a7be6a675eee514faf7bb93f1382c6da5ce
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2158935
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-30 20:55:45 -07:00
Scott Long
c6b6c9b3e2 gpu: nvgpu: mm: remove misra rule 8.11 violations
Eliminate Advisory Rule 8.11 violations in gmmu_gk20a.h by
removing extern declarations of gk20a_mm_levels_64k[] and
gk20a_mm_levels_128k[].

Advisory Rule 8.11 states when an array with external linkage
is declared, its size should be explicitly specified.

Jira NVGPU-3178

Change-Id: I452a571e0561edbd9f8cd856775563587c201d40
Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2162273
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Adeel Raza <araza@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-07-30 09:56:36 -07:00
Mahantesh Kumbar
dcf69b903b gpu: nvgpu: skip scrubber for FUSA SKU
-skip scrubber if dGPU is FUSA SKU

JIRA NVGPU-3291

Change-Id: I5e3169c6555b1e1f2de906212463205ce5ef6266
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2163561
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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-07-30 07:36:57 -07:00
Mahantesh Kumbar
3ef34ac31c gpu: nvgpu: PMU/SEC2/GSP engine reset skip
-Add a FUSA check to skip reset for PMU/SEC2/GSP engine's falcon
-On dGPU FUSA SKU, reset of HS falcons SEC2, PMU and GSP will be
 handled by HS falcon ucode, so, skip reset for PMU/SEC2/GSP
 in NvGPU.

JIRA NVGPU-3728

Change-Id: I956272771994b96e4115e67869bce7bd03193196
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2163560
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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-07-30 07:36:48 -07:00
Rajesh Devaraj
fa6ada7619 gpu: nvgpu: disable hw error injection support in safety-release
This patch disables HW based fake error injection support in safety-release
build. For this purpose, it makes use of the following flag:
CONFIG_NVGPU_INJECT_HWERR.

JIRA NVGPU-3861

Change-Id: I1fa8544e67adbc53a1f3b98b340d76cf4f5bf524
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2163289
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-30 04:09:31 -07:00
Nicolas Benech
0e2a6ac44c gpu: nvgpu: do not compile some FIFO HALs for safety build
A number of HALs for older chips are not needed for safety builds
and therefore are now removed with this patch.

JIRA NVGPU-3690

Change-Id: I2987188950dda78d7955584d223b568987001b13
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2161381
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-30 04:08:57 -07:00
Nicolas Benech
3b4cf653c0 gpu: nvgpu: do not compile hal_regops for safety build
A number of hal_regops needed to be removed for FUSA.

JIRA NVGPU-3690

Change-Id: Ib16bdef3af5b08a1c65706e17ae750c4db88825d
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2161380
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-30 04:08:42 -07:00
Nicolas Benech
f576bd8f84 gpu: nvgpu: gm20b: split HALs for FUSA
Only some HALs are functionally safe (FUSA), so this patch splits
the GM20B-related HALs into FUSA and non-FUSA source files.

JIRA NVGPU-3690

Change-Id: I3a558b1f3cc713a98e9eab366c49f7ab8ee2e5a2
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2156609
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-30 04:07:02 -07:00
Sagar Kamble
e35cfa6ca3 gpu: nvgpu: falcon unit SWUD documentation
Add doxygen documentation for nvgpu.common.falcon

JIRA NVGPU-2412

Change-Id: I95d42d82437c65b27345300f8615979127552e53
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2162592
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-30 02:56:27 -07:00
Aparna Das
5e877f2985 gpu: nvgpu: vgpu: move vgpu hal files out of common
Move vgpu hal files out of nvgpu common to hal.

Jira GVSCI-1339

Change-Id: Ibf2e987a88a1bf1e5790ed746b927c52b354f790
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2162259
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 16:28:44 -07:00
Philip Elcan
2b30564839 gpu: nvgpu: mm: fix CERT-C violations in vm_area
INT-30 requires checking for overflow of arithmetic operations on
unsigned integers. Fix these violations in nvgpu.common.vm_area by
using safe ops.

JIRA NVGPU-3851

Change-Id: I1e52d5c385228cacd6d970d6a5537f4faf3f8aee
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2159726
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@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-07-29 16:27:21 -07:00
Thomas Fleury
663fd69d86 gpu: nvgpu: doxygen for channel.h
Add documentation for channel functions used in safety build.

Made nvgpu_channel_commit_va return void, as it can never fail.

Removed nvgpu_channel_recover prototype (function moved to rc unit).

Compile out refcount tracking definitions when
GK20A_CHANNEL_REFCOUNT_TRACKING is disabled.

Removed unused nvgpu_channel_set_ctx_mmu_error function.

Jira NVGPU-3588

Change-Id: Ia65a6c60ff30837230d81ca0e5f6dadafcc3af4e
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2159674
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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-07-29 16:27:01 -07:00
Vedashree Vidwans
afae2efc23 gpu: nvgpu: fix MISRA errors in nvgpu.hal.mm
Rule 8.6 requires each identifier with external linkage to have exactly
one external definitions.
Rule 10.x necessitates operands to have essential type; left and right
operands should be of same width and type.
Rule 14.3 doesn't allow controlling expressions to be invariant;
ensuring that all conditions are possible.

Jira NVGPU-3858

Change-Id: I043a3836c4a2cb9c5a52d3053516c517389f55a2
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2162295
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
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-07-29 12:45:40 -07:00
Mahantesh Kumbar
01dc65fe32 gpu: nvgpu: Add ACR-FUSA support
-Changes to support ACR AHESASC/ASB ucode HS signature verification
 for FUSA
-Load FUSA/NON_FUSA algorithm based ucodes using flag is_fusa_sku
 which will be based on pcie devid
-New defines for AHESESC/ASB FUSA ACR types

JIRA NVGPU-3727

Change-Id: Iedfc069dd540b9593207a4bf7152049957e0dc78
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2161164
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:48:44 -07:00
Mahantesh Kumbar
6290d92926 gpu: nvgpu: PCIE table update for TU104-QS
-Added PCIE device info for TU104-QS chip & marked as FUSA SKU
 using device flag
-is_fusa_sku flag will be set if device flag has FUSA SKU flag set
 & this will be checked in driver to execute functionality
 specific to FUSA SKU

JIRA NVGPU-3727

Change-Id: I49ea357133ce0b9bbf52dae72afcf8139ab01346
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2161163
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:48:33 -07:00
Mahantesh Kumbar
ca73f9207a gpu: nvgpu: ACR HS ucode signature patch update
NON-FUSA/FUSA signature varies in size, so, required to patch
the HS signature as per size fetched from signature file

JIRA NVGPU-3727

Change-Id: Ib38320bafaf233a08e02f91eb712a87d46448e7c
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2161162
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:48:23 -07:00
Sagar Kamble
cde8c5fc3e gpu: nvgpu: unit: falcon bootstrap test
Add unit test for functions nvgpu_falcon_bootstrap and
nvgpu_falcon_bl_bootstrap.

JIRA NVGPU-898

Change-Id: I32267d994c8f3afc188234227dd56c38a28c5898
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2160243
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:48:03 -07:00
Sagar Kamble
1759211915 gpu: nvgpu: unit: falcon mailbox test
Add unit test for functions nvgpu_falcon_mailbox_read|write.

JIRA NVGPU-898

Change-Id: I65020b85900a7777da6392f6e29c67e76f05e9ad
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2160242
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:47:54 -07:00
Sagar Kamble
74094aa8ea gpu: nvgpu: unit: falcon wait for halt test
Add unit test for function nvgpu_falcon_wait_for_halt.

JIRA NVGPU-898

Change-Id: Ifc5519e9d813ba03e7bf531f18a65012fa24d9e6
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2160241
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:47:43 -07:00
Sagar Kamble
1f6f9f10d2 gpu: nvgpu: unit: falcon wait for idle test
Add unit test for function nvgpu_falcon_wait_idle.

JIRA NVGPU-898

Change-Id: Iac68eb324a061efd4e6c69654590aad84bf69224
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2160240
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:47:33 -07:00
Sagar Kamble
a6f2dd2451 gpu: nvgpu: unit: falcon memory scrub test
Add unit test for function nvgpu_falcon_mem_scrub_wait.

JIRA NVGPU-898

Change-Id: Id78360ce744ac18e06bed3df9a7826db40a0a2d6
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2160239
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:47:23 -07:00
Sagar Kamble
4c89ec1cdf gpu: nvgpu: unit: falcon reset test
Add unit test for function nvgpu_falcon_reset.

JIRA NVGPU-898

Change-Id: I2794bd28dc5389385b9bbd80a1a13b50478753ea
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2160238
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:47:13 -07:00
Sagar Kamble
35f178da92 gpu: nvgpu: fix the return value for falcon_bl_bootstrap invalid case
Return error value wasn't set to -EINVAL when bootloader size is greater
than IMEM size. Fix it.

JIRA NVGPU-898

Change-Id: Iadb645d93f4d07349bd810cb698d43a2e3f595eb
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2160236
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:46:52 -07:00
Sagar Kamble
626b3275cd gpu: nvgpu: compile out non-safe code from falcon sw init function
emem related handling is specific to DGPU hence compile it out.
falcon_sw_init for platforms other than gv11b is also compiled
out.
Restored the DGPU falcons handling as the falcon common sw
init handling has case for initialization of unsupported
falcons that needs to be covered.

JIRA NVGPU-898

Change-Id: I41e886aba2aead052f3ef00278309759dd410df3
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2160233
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 07:46:42 -07:00
Mahantesh Kumbar
418e33dd09 gpu: nvgpu: TU10A PMU ucode version update
-TU10A PMU ucode version update for saftey branch
 TU10A PMU AUTO profile ucode
-P4 CL 26875342

JIRA NVGPU-3722

Change-Id: Id5cc20f24fc4cb0784d89621cd3e008649df4eb6
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2162191
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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-07-29 05:31:21 -07:00
rmylavarapu
e786c3fc35 gpu: nvgpu: Read current_volt from vol_rail_get_status
-Latest ucode doesn't support get_voltage RPC, the data
can be extracted from data obtained by volt_rail_get_status
board_obj cmd. Updating the debugfs node to read the data from
volt_rail_get_status.

JIRA NVGPU-3815

Change-Id: I85f84a757425411725773802c20f05063b222afc
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2153387
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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-07-29 05:30:28 -07:00
rmylavarapu
89eec35887 gpu: nvgpu: Disable VFE secondary entry in clk_prog obj
As support of VFE secondary entry is not POR for tu10a
profile need to disable this in our NVGPU. If not the
clkDomainsIsSecVFCurvesEnabled() check in PMU firmware
will hit an halt.

JIRA NVGPU-3810

Change-Id: Id72550393a0255e7c663c3fde0bbbdcef2d5885e
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2153124
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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-07-29 05:30:15 -07:00
rmylavarapu
47a029918a gpu: nvgpu: Handle perf RPC events in NVGPU
Added support for perf RPC events. Added new RPC event type
and PERF event types for the same.

JIRA NVGPU-3810

Change-Id: Ifd31505d63fdbc77f521d3f1f932c7152404230a
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2153123
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-07-29 05:30:02 -07:00