Commit Graph

6265 Commits

Author SHA1 Message Date
Vinod G
1095f0eea3 gpu: nvgpu: Update read_pending_interrupts hal
Modify read_pending_interrupts hal to report the pending gr interrupt
bit back to isr to process.

semaphore_timeout interrupt bit is removed after gk20a chip.
Remove that bit checking from the isr function.
Remove some static functions for handling interrupt, which only calls
gk20a_gr_set_error_notifier. Call that function directly from isr

JIRA NVGPU-3016

Change-Id: Ic7084f038114fbce6d6b5c10a806dee6280e5c0a
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092876
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-12 15:33:29 -07:00
Alex Waterman
9f486ba21e gpu: nvgpu: Delete and refactor gv11b.c and gp10b.c
These two files contained the init_characteristics functions for
these two chips. move these to the hal_<chip>.c files for now.
This allows the gv11b.c and gp10b.c to be deleted and a bunch of
header includes removed.

The vGPU code required a slight update to the headers (moving the
<nvgpu/...> headers to before all the "common/..." and "hal/..."
includes since some of those headers make assumptions about what
is already present.

Also, delete the gv100/gv100.h header file and make the gv100
init_characteristics function static to be inline with the way the
gv11b and gp10b code now works. This further redecues the number
of sourece files and reduces needless complexity.

JIRA NVGPU-971
JIRA NVGPU-3074

Change-Id: Ic0ed722612ef9843e6219c7a00144ead12a73e78
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2090978
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-12 15:33:05 -07:00
Alex Waterman
28c98f0f7d gpu: nvgpu: Move ECC code into ECC hal directory
Refactor the ECC code present under gp10b/, gv11b/, and tu104/. To
do this a few things were required:

Firstly, move the ecc related C and H files under the aforementioned
directories over to their new home under hal/gr/ecc/. Also copy over
the ECC HAL code present in gp10b/gp10b.c - not sure why this was
there but it, too, needed to be refactored. Also handle all the
updated header paths and Makefiles to take these movements into
account.

Secondly add a new HAL in GR (gr.ecc) to handle ECC HAL ops. There's
only two: detect and init. init() was copied over from gr and detect
was added so that the common ECC code can call it in a chip agnostic
way. This is required so that the ECC detect can be moved out of the
gp10b init characteristics function.

Lastly update the ECC init flow in the common ecc module to call
detect() right before init().

JIRA NVGPU-3074

Change-Id: Iba1464a904f9a91a45f30902beadf6f912607e40
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2090977
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-12 15:32:50 -07:00
Antony Clince Alex
2a226092a6 gpu: nvgpu: configure ctxsw ucode wdt timeout period
At present the ctxsw ucode wdt timeout period is set to maximum.
Calculate the wdt count value as per the specified timeout and SYSCLK
frequency.

Jira NVGPU-1861

Change-Id: Id85abcccb256e69191bd0540aa7980029ddefc85
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2088572
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-12 12:13:53 -07:00
Deepak Nibade
c26ae849b5 gpu: nvgpu: create common.hal.ptimer unit
Create common.hal.ptimer unit by moving all ptimer chip files under
hal/ directory

Update Makefiles and include paths accordingly

Jira NVGPU-2028

Change-Id: Ie5ce1cf4604ee26bc51bad8856a4141df085d451
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094289
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-12 04:05:18 -07:00
Deepak Nibade
88c8baa29f gpu: nvgpu: create common.hal.regops unit
Create common.hal.regops unit by moving all regops chip files under
hal/ directory

Update Makefiles and include paths accordingly

Jira NVGPU-2037

Change-Id: Iac1833b8916d919f7d448d17f5dd7a853760f55c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094288
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-12 04:05:04 -07:00
Nitin Kumbhar
8664b3be6c gpu: nvgpu: make ctx structs private
Add ctx_priv.h header for structs which are used within
nvgpu_gr_ctx. APIs are added to manage fields of nvgpu_gr_ctx.

JIRA NVGPU-3060

Change-Id: I396fbbb5199e354c62772e901e3bbf61d135f3b1
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2090398
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-12 04:04:31 -07:00
Thomas Fleury
9f233a6ab4 gpu: nvgpu: add setup_sw and cleanup_sw for pbdma
Create common/fifo/pbdma.c and move pbdma common code:
- nvgpu_pbdma_setup_sw
- nvgpu_pbdma_cleanup_sw
- nvgpu_pbdma_find_for_runlist
- nvgpu_pbdma_init_intr_descs

Moved the following HAL from fifo to pbdma
- fifo.find_pbdma_for_runlist -> pbdma.find_for_runlist

Added the following HALs
- fifo.init_pbdma_map
- pbdma.setup_sw
- pbdma.cleanup_sw

Jira NVGPU-2950

Change-Id: I17802ee61de669c3e17792b4505efb5e2bf530d3
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092999
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-12 01:15:59 -07:00
Thomas Fleury
2dcf026e12 gpu: nvgpu: add setup_hw HAL for pbdma
Add the following HAL
- pbdma.setup_hw

This HAL takes care of setting up pbdma timeout.

Jira NVGPU-2950

Change-Id: I966d52efcd8d199c5aa5d248c7152fc47be7a431
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093000
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-12 01:15:44 -07:00
Thomas Fleury
78261af6dd gpu: nvgpu: remove apply_pb_timeout fifo HAL
None of chip HALs is implementing fifo.apply_pb_timeout.
Removing this HAL.

Jira NVGPU-2950

Change-Id: Ie2b6a9c490082f7b2caeb12fa5550406f03567e5
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092998
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-12 01:15:29 -07:00
Debarshi Dutta
ac0b97b14a gpu: nvgpu: add pbdma_timeout_register for gm20b and gp10b
Add pbdma_timeout_r register and the corresponding fields for GM20B
and GP10B.

Jira NVGPU-2950

Change-Id: I7441314b2244a9be5addb06b23b87c9b91571fba
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2086444
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Tested-by: Thomas Fleury <tfleury@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-04-12 01:14:29 -07:00
Nitin Kumbhar
6789a862e6 gpu: nvgpu: skip nvlink shutdown on invalid gpu state
A dGPU can disappear from PCI bus for various reasons. This is
detected while accessing GPU registers and system is rebooted.
If dGPU has disappeared from the system, driver shutdown cannot
access dGPU registers. Skip any such de-initialization (nvlink)
done during shutdown.

Bug 200505461

Change-Id: Ief2e84212421093e57e63ff5958b209bd6857db9
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093302
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-11 23:35:24 -07:00
Seema Khowala
66cb9495a5 gpu: nvgpu: move mmu_fault_pending ops out from mm
Moved
-mmu_fault_pending mm ops to is_mmu_fault_pending mc ops
-mmu_fault_pending fb ops to is_mmu_fault_pending fb.intr ops. This
is needed to check if mmu fault intr is pending for volta onwards.

Added
is_mmu_fault_pending fifo ops. This is needed to check if mmu fault
interrupt is pending for chips prior to volta

JIRA NVGPU-1313

Change-Id: Ie8e778387cd486cb19b18c4aee734c581dcd9229
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094895
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-11 22:25:01 -07:00
Vinod G
63fb543f63 gpu: nvgpu: Clean up gr_gk20a.h and gk20a.h
Initial cleanup process of gk20a.h
Remove unused structs. Add more structs to avoid including
gr_gk20a.h. This need more structs to be moved from gr_gk20a.h
Remove including pramin.h/acr.h/falcon.h and sim.h

Removed unused struct and netlist.h include from gr_gk20a.h

JIRA NVGPU-3132
JIRA NVGPU-3079

Change-Id: I1e965dd572e8e45bb20fca73ea566a6411aeebc1
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094732
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: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-11 22:24:46 -07:00
Seshendra Gadagottu
6fb37f04ca gpu: nvgpu: move chip specific perf files to hal
Moved chip specific perf related files to hal from common.

JIRA NVGPU-3131

Change-Id: I4fb1b6a619712ee82e20b2b08a76ad5361e690c1
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2095563
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-11 18:53:55 -07:00
Thomas Fleury
4c84bf54ff gpu: nvgpu: move runlist HALs to hal/fifo
Move runlists HALs to hal/fifo.
Update makefiles and include directives.

Renamed
- gk20a_readl -> nvgpu_readl
- gk20a_writel -> nvgpu_writel

Jira NVGPU-1988

Change-Id: Ia8f9f50d42f0863c522a0d2caca0b9c775be597a
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092749
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-11 16:45:30 -07:00
Philip Elcan
8e9ec4f1b7 gpu: nvgpu: fifo: fix MISRA 10.3 violations
MISRA Rule 10.3 prohibits assigning objects of different essential or
narrower type. This fixes MISRA 10.3 violations in the fifo unit.

JIRA NVGPU-3115

Change-Id: I5a0e1134f731631faa3aa31b5d88781c200306e0
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094444
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-11 15:05:52 -07:00
Seshendra Gadagottu
6489b140ae gpu: nvgpu: remove un-used functions from fb_gv100
Following two functions modified and moved to fb intr
sub-unit. So, cleaning-up code to remove them.

void gv100_fb_enable_hub_intr(struct gk20a *g);
void gv100_fb_disable_hub_intr(struct gk20a *g);

JIRA NVGPU-2034

Change-Id: Ic2ff88fcfb66b243a87ae4ba75177dedc68f1d2b
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094540
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: Seema Khowala <seemaj@nvidia.com>
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-04-11 14:14:59 -07:00
rmylavarapu
ad003964d3 gpu: nvgpu: Clean clk_freq_controller unit
-Removed nvgpu_ tag for clk_freq_ctlr_rpc_pmucmdhandler
function and made static as it is used only by
clk_freq_controller unit.
-Removed whitespaces
-Remvode nvgpu_clk_freq_controller_load as it is
not used.

NVGPU-1969

Change-Id: I7fc46489c64d00eaf57e466fbc18ea4b1682a5b5
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092272
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
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>
Reviewed-by: Alex Waterman <alexw@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-04-11 03:53:38 -07:00
Seema Khowala
40561a17ea gpu: nvgpu: remove fifo_gp10b.h
Delete fifo_gp10b.h

JIRA NVGPU-2950

Change-Id: Ia4abc4b3e9cb5fc16fbe40a0d008a602434a2e3d
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094656
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-11 01:38:55 -07:00
Seshendra Gadagottu
eb7ba260fb gpu: nvgpu: move chip specific netlist files to hal
Move chip specific netlist files from common to hal.

JIRA NVGPU-2040

Change-Id: I88875d0720e93c99cf470df5945efaef41abb9de
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093859
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-11 01:37:59 -07:00
Seshendra Gadagottu
03419a56bb gpu: nvgpu: clean-up tabs after file name in Makefile.sources
Makefile.sources has tab space instead of single space after file
names. It is fixed as part of this CL.

JIRA NVGPU-2040

Change-Id: I0c5019ec4e131ea597983965fbe212df688ac3e8
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093858
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-11 01:37:44 -07:00
Philip Elcan
35e02c6d29 gpu: nvgpu: gv11b: fix MISRA 10.3 violations
MISRA Rule 10.3 prohibits assigning objects of different essential or
narrower type. This fixes MISRA 10.3 violations in the gv11b unit.

JIRA NVGPU-3110

Change-Id: I6a5d7648473b35acea1417d86c402b83fc600882
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093653
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 20:54:38 -07:00
Vinod G
cd1254d524 gpu: nvgpu: Move gk20a_gr_alloc_global_ctx_buffers to gr.common
Move gk20a_gr_alloc_global_ctx_buffers from gr_gk20a.c to gr.c as
static function as gr_alloc_global_ctx_buffers. This function is
used locally by gr_init_setup_sw function.

Remove alloc_global_ctx_buffers hal function.

JIRA NVGPU-1885

Change-Id: I85f1ed85259cd564577b69af8cf01c1a2802004b
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093834
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 17:25:21 -07:00
Seema Khowala
312f91f991 gpu: nvgpu: move fence_gk20a to common/fence
Move gk20a/fence_gk20a.c to common/fence/fence.c

Renamed
gk20a_fence_from_semaphore -> nvgpu_fence_from_semaphore
gk20a_fence_from_syncpt -> nvgpu_fence_from_syncpt
gk20a_alloc_fence_pool -> nvgpu_fence_pool_alloc
gk20a_free_fence_pool -> nvgpu_fence_pool_free
gk20a_alloc_fence -> nvgpu_fence_alloc
gk20a_init_fence -> nvgpu_fence_init
gk20a_fence_put -> nvgpu_fence_put
gk20a_fence_get -> nvgpu_fence_get
gk20a_fence_wait -> nvgpu_fence_wait
gk20a_fence_is_expired -> nvgpu_fence_is_expired
gk20a_fence_install_fd -> nvgpu_fence_install_fd
gk20a_fence_ops struct -> nvgpu_fence_ops struct
gk20a_fence struct -> nvgpu_fence_type struct

JIRA NVGPU-1982

Change-Id: Ife77b2c3c386ff4368683c78ca02f00c99cddb4b
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093002
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 17:24:52 -07:00
Vinod G
f57d9f97c2 gpu: nvgpu: move gk20a_init_gr to common.gr.init
Move gk20a_init_gr function from gr_gk20a.c to
gr.c as nvgpu_gr_init.
Update all files that call gk20a_init_gr function.

JIRA NVGPU-1885

Change-Id: I318a34778e23a7372be574ee9c21c5b65011e535
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092648
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 17:24:23 -07:00
Seema Khowala
c99f13e842 gpu: nvgpu: move nvgpu_report_host_error
Move nvgpu_report_host_error from gk20a/fifo_gk20a.c to
common/fifo/fifo.c

JIRA NVGPU-2011

Change-Id: Ia42c901edafa7bc11a8da4152b92293a5d131d10
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093119
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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-04-10 16:15:59 -07:00
Seema Khowala
b4ec1c5dff gpu: nvgpu: move dump_channel_status from fifo to channel
Renamed and moved from fifo to channel
gk20a_debug_dump_all_channel_status_ramfc -> nvgpu_channel_debug_dump_all
gk20a_dump_channel_status_ramfc -> gk20a_channel_debug_dump
gv11b_dump_channel_status_ramfc -> gv11b_channel_debug_dump

Moved nvgpu_channel_dump_info struct to channel.h
Moved nvgpu_channel_hw_state struct to channel.h
Moved dump_channel_status_ramfc fifo ops to channel ops
as debug_dump

JIRA NVGPU-2978

Change-Id: I696e5029d9e6ca4dc3516651b4d4f5230fe8b0b0
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092709
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 16:15:50 -07:00
Nicolas Benech
7a753e5c39 gpu: nvgpu: fix MISRA 17.7 violations in pmu_pg
MISRA Rule-17.7 requires the return value of all functions to be
used. Fix is either to use the return value or change the function
to return void. This patch contains fixes for all 17.7 violations
in common/pmu/pg/pmu_pg.c.

JIRA NVGPU-3036.

Change-Id: I31bed3b4b83ad826eed602a5d59abacba2ca56f9
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092681
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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-04-10 16:15:35 -07:00
Nicolas Benech
5614a51dcc gpu: nvgpu: change pmu_setup_elpg to return void
MISRA Rule-17.7 requires the return value of all functions to be
used. Fix is either to use the return value or change the function
to return void. In the case of the pmu_setup_elpg operation, all
implementations were always returning 0, so this patch changes the
signature to return void instead.

JIRA NVGPU-3036

Change-Id: I6f0a79314535ba9e3c65d28399b117b058bb23ca
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092680
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 16:15:26 -07:00
Nitin Kumbhar
c649ca9fd6 gpu: nvgpu: move gr config structs to priv header
Move sm_info and nvgpu_gr_config struts to a private
header and add APIs to access member fields.

JIRA NVGPU-3060

Change-Id: I90f44333f19cb8cb939c0a0f90d9a03f6c036080
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2091563
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 15:04:21 -07:00
Abdul Salam
364c780469 gpu: nvgpu: Remove cyclic dependency between arb & vf
Remove cyclic dependency between arb and vf point units.
Remove the header files and call the functions with funciton pointers.
Remove lpwr.h as they are not used.

Jira: NVGPU-1966

Change-Id: I64b1eb810fc343d8930857793f0d00a683cfd05d
Signed-off-by: Abdul Salam <absalam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094043
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 13:55:04 -07:00
Thomas Fleury
3bb0f8ec0b gpu: nvgpu: add include file in tsg_gv11b.c
Add missing include <nvgpu/dma.h> in tsg_gv11b.c
It is needed for nvgpu_dma_* operations.

Jira NVGPU-2979

Change-Id: Iaea2ea40e58ca341f01aa35f948cd340107a1045
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094486
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Tested-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
2019-04-10 11:05:46 -07:00
Thomas Fleury
3d33907920 gpu: nvgpu: remove fifo_gm20b.* files
Removed fifo_gm20b.c and fifo_gm20b.h which do not contain
any useful declaration anymore.

Jira NVGPU-2979

Change-Id: Ief5d2954b130f49b485ed2088ba335128209ee4e
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2091017
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 10:38:10 -07:00
Thomas Fleury
9121f84e67 gpu: nvgpu: move post_event_id from fifo to tsg
Moved the following HAL from fifo to tsg:
- tsg.post_event_id

Implemented as
- nvgpu_tsg_post_event_id

Jira NVGPU-2979

Change-Id: I074233aaf96b33d011b50b1465ea5d76e0a43689
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2087186
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 10:36:44 -07:00
Thomas Fleury
35e9663bd0 gpu: nvgpu: move eng_method_bufers from fifo to tsg
Moved init/deinit eng method buffers from fifo to tsg
- tsg.init_eng_method_buffers
- tsg.deinit_eng_method_buffers

Moved gv11b_fifo_init_ramfc_eng_method_buffer to the
following tsg HAL:
- tsg.bind_channel_eng_method_buffers

This HAL is now called during bind_channel.

Added the following ramin HAL:
- ramin.set_ramfc_eng_method_buffer

Jira NVGPU-2979

Change-Id: I96f6ff15d2176d4e3714fa8fe65a9126b3fff82c
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2087185
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 10:36:28 -07:00
Thomas Fleury
bf5ed9fd9f gpu: nvgpu: move open/release from fifo to tsg
Moved the following HALs from fifo to tsg:
- tsg.open
- tsg.release

They are used only in vgpu case.

Jira NVGPU-2979

Change-Id: Icda6f6cfea063ea326b1874b7f15b57a8ea0d5b9
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2087184
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 10:36:13 -07:00
Thomas Fleury
75963b47f1 gpu: nvgpu: move bind/unbind from fifo to tsg
Moved the following HALs from fifo to tsg:
- tsg.bind_channel
- tsg.unbind_channel
- tsg.unbind_channel_check_hw_state
- tsg.unbind_channel_check_ctx_reload
- tsg.unbind_channel_check_eng_faulted

bind_channel and unbind_channel HALs are optional,
and only implemented for vgpu:
- vgpu_tsg_bind_channel
- vgpu_tsg_unbind_channel

Moved the following code from fifo to tsg:
- nvgpu_tsg_bind_channel
- nvgpu_tsg_unbind_channel
- nvgpu_tsg_unbind_channel_check_hw_state
- nvgpu_tsg_unbind_channel_check_ctx_reload
- gv11b_tsg_unbind_channel_check_eng_faulted

tsg is now explictly passed to bind/unbind operations,
along with ch

Jira NVGPU-2979

Change-Id: I337a3d73ceef5ff320b036b14739ef0e831a28ee
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2084029
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 10:35:58 -07:00
Deepak Nibade
ad0a7e77be gpu: nvgpu: add common.gr.setup api to set preemptiom modes
Add api nvgpu_gr_setup_set_preemption_mode() in common.gr.setup to
set various preemption modes

Define new hal g->ops.gr.setup.set_preemption_mode() that calls above
common api

Move corresponding code from gr_gp10b.c to common.gr.setup unit

Jira NVGPU-1886

Change-Id: I7cb0187a4809156e5f90f39727a782b17219afa3
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092170
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 09:28:43 -07:00
Deepak Nibade
f5c093d47e gpu: nvgpu: add common.gr.setup apis to allocate/free context
Add below apis in common.gr.setup to allocate/free context
nvgpu_gr_setup_alloc_obj_ctx()
nvgpu_gr_setup_free_gr_ctx()

Define two new hals
g->ops.gr.setup.alloc_obj_ctx()
g->ops.gr.setup.free_gr_ctx()

Move corresponding code from gr_gk20a.c to common.gr.setup unit

Jira NVGPU-1886

Change-Id: Icf170a6ed8979afebcedaa98e3df1483437b427b
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092169
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 09:28:28 -07:00
Sagar Kamble
d7bdca94d8 gpu: nvgpu: move sources to sec2 ipc element
SEC2 command, message, queues, sequences are part of SEC2's
infrastructure for IPC. Create common/sec2/ipc folder and
move all these sources there.

JIRA NVGPU-2075

Change-Id: Id6d7a31422fae835ec669c8ea48b3f63b9dffe24
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085756
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 09:27:42 -07:00
Sagar Kamble
0cd90a1167 gpu: nvgpu: move sec2 hal sources to hal/sec2
Move sec2_gp106.c and sec2_tu104.c to hal/sec2 as per new unit
separation requirements.

JIRA NVGPU-2024
JIRA NVGPU-2025

Change-Id: I511e1832aa63d4792729491428de0159decf2371
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085755
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 09:27:26 -07:00
Sagar Kamble
f2ad7e0916 gpu: nvgpu: separate sec2 isr into common and hal
SEC2 isr handling requires message processing in common msg unit. That
unit requires interfaces from hal to know if the msg interrupt was
received, set the msg interrupt and handle other interrupts.

JIRA NVGPU-2025

Change-Id: I3b5ad8968ea9298cc769113417931c4678009cf1
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085753
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 09:27:11 -07:00
Sagar Kamble
974ad342fa gpu: nvgpu: update sec2.h header
Update sec2.c to not dereference struct gk20a and update sec2.h to
remove unneeded header files. Move sec2.h to include/nvgpu/sec2.

JIRA NVGPU-2074

Change-Id: I1a8f4b1913323693fae422ce27c4ec0ac29de24a
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085752
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-04-10 09:26:56 -07:00
Sagar Kamble
8b304b4351 gpu: nvgpu: prepare sec2 cmd unit
sec2_ipc.c now has the SEC2 command management functionality. Let us
rename it to sec2_cmd.c. Also update the header includes.

JIRA NVGPU-2074

Change-Id: I884829c6c68344f869c19b09130078ba413dc221
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085751
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 09:26:45 -07:00
Sagar Kamble
6eae6df6da gpu: nvgpu: create sec2 lsfm unit
Bootstrapping LS falcons is done by SEC2 by sending commands to SEC2
RTOS. This requires interaction with SEC2 cmd and msg units. Hence
prepare separate unit.

JIRA NVGPU-2074

Change-Id: I5a27b4eef3fa3f11bcaac8bd9494fe771b921cf9
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085750
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 09:26:30 -07:00
Sagar Kamble
e848e9dfb8 gpu: nvgpu: prepare sec2 msg, allocator units
SEC2 message handling unit can't be part of command handling unit as it
creates circular dependencies with the SEC2 tasks (ACR bootstrap)
SEC2 allocator unit shall encompass DMEM allocator and other allocators
used by SEC2.

JIRA NVGPU-2075

Change-Id: Ic2b8204d8225f2056785f035cbecdb776a9ecfe9
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085749
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 09:26:14 -07:00
Sagar Kamble
eef3ef7773 gpu: nvgpu: prepare sec2 sequences unit
SEC2 commands and messages management is based on sharing the data
through sequences. Functions for sending commands/allocating
payload update sequence data acquiring lock and those for
working on received messages read/free the sequence data
releasing lock.

JIRA NVGPU-2075

Change-Id: I988662d6ce6f9a15d67bab2a58d3f2689ffd804a
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085748
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 09:25:59 -07:00
Sagar Kamble
c9cb1aab1c gpu: nvgpu: remove uneeded seq_desc, msg parameter of sec2_cmd_post and callback
These parameters are not required. Removing those will simplify the
refactoring of the IPC units. The plan is to keep access to sequence
struct members within IPC units.

JIRA NVGPU-2075

Change-Id: Idf62082152448230d286cfc5e7249c9886d8251a
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085747
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-04-10 09:25:43 -07:00
Sagar Kamble
270b14706f gpu: nvgpu: prepare sec2 queues unit
SEC2 command and message handling should not deal with SEC2 queues
implementation. Only generic queue APIs should be invoked. Prepare
SEC2 queues unit for this. In future if underlying queues impleme-
ntation has to be changed then it can be done in the queues unit.

JIRA NVGPU-2075

Change-Id: Ia9786255bbc22f6f2a9686bd98eef8666d1ab370
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085746
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-10 09:25:33 -07:00