Commit Graph

881 Commits

Author SHA1 Message Date
Deepak Nibade
0398e0751f gpu: nvgpu: separate API to get failing engine data
In gk20a_fifo_handle_sched_error(), we currently have a sequence
to identify failing engine (stuck on context switch) and
corresponding failing channel with its type

Separate out this sequence in new API
gk20a_fifo_get_failing_engine_data() so that it can be
reused from else where too

Bug 200133289

Change-Id: I3cef395170cf8990c014c7505c798fd6f2e37921
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/797070
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-09-11 08:46:06 -07:00
Terje Bergstrom
f6311b58b3 gpu: nvgpu: Do not reset priv ring
Priv ring does not need to be reset from PMC at GPU boot.

Change-Id: I166472a97246b40b69bce61ffca62bde85e4e0e7
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/794406
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
2015-09-07 15:23:59 -07:00
Sami Kiminki
eade809c26 gpu: nvgpu: Separate kernel and user GPU VA regions
Separate the kernel and userspace regions in the GPU virtual address
space. Do this by reserving the last part of the GPU VA aperture for
the kernel, and extend GPU VA aperture accordingly for regular address
spaces. This prevents the kernel polluting the userspace-visible GPU
VA regions, and thus, makes the success of fixed-address mapping more
predictable.

Bug 200077571

Change-Id: I63f0e73d4c815a4a9fa4a9ce568709974690ef0f
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-on: http://git-master/r/747191
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-09-07 12:37:15 -07:00
Sri Krishna Chowdary
57034b22ca Revert "gpu: nvgpu: fix alignment calculation"
This reverts commit b12efd059070b942a33e23d06e9050145a0694ef.

Bug 1492689

Change-Id: Iae07341f246010ca0b69eddbbb9cd434b8b5f05a
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/795112
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2015-09-06 23:56:01 -07:00
Sri Krishna chowdary
47afbb71ea gpu: nvgpu: fix alignment calculation
consider buffer size as well when calculating the required alignment
for a buffer else we would be mapping a VA range greater than requested
thus allowing access to entire large page even when not needed creating
a security hole.

Bug 1492689

Change-Id: Ic404708d238621ea64c26cafd05bc30ba8e02e12
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/793229
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2015-09-06 22:59:31 -07:00
Leonid Moiseichuk
54c2ae59f0 gpu: nvgpu: cyclestats snapshot permissions rework
Cyclestats snapshot feature is expected for new devices.
The detection code was isolated in separate function and run-time
check added to validate/allow ioctl calls on the current GPU.

Bug 1674079

Change-Id: Icc2f1e5cc50d39b395d31d5292c314f99d67f3eb
Signed-off-by: Leonid Moiseichuk <lmoiseichuk@nvidia.com>
Reviewed-on: http://git-master/r/781697
(cherry picked from commit bdd23136b182c933841f91dd2829061e278a46d4)
Reviewed-on: http://git-master/r/793630
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-09-04 09:03:07 -07:00
Vijayakumar
eeb604c23d gpu: nvgpu: gm20b: update slcg prod values
bug 1670543

disable timestamp slcg

Change-Id: I65548a55fcd65449dda8efb2bfa3d6c557eb2f14
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/787140
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-09-01 07:58:05 -07:00
Sam Payne
22dacd2685 gpu: nvgpu: dump PGRAPH_PRI on error
dumps NV_PGRAPH_PRI_GPC0_GPCCS_FS_GPC
whenever pbus sends the 0xbadf13 error

bug 1662268

Change-Id: I302ffe5c86098e7235ecc8c071a5e2c852455565
Signed-off-by: Sam Payne <spayne@nvidia.com>
Reviewed-on: http://git-master/r/789090
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-08-31 14:38:05 -07:00
Yogesh
05a6b54914 gpu: nvgpu: Inject function addresses
Inject function addresses of gk20a_do_idle and
gk20a_do_unidle once the nvgpu module loads.

Bug 1476801

Change-Id: I67a8ae7fb654524616c2c2c710013cbc097a3f32
Signed-off-by: Yogesh Bhosale <ybhosale@nvidia.com>
Reviewed-on: http://git-master/r/785047
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-08-21 15:14:44 -07:00
Supriya
3fba1e929b gpu: nvgpu: Fix NS boot transcfg
Bug 1667322

Accommodate for transcfg address change

Change-Id: I7054202b8ce3be1a3fbfe0465e662be6f9740eb3
Signed-off-by: Supriya <ssharatkumar@nvidia.com>
Reviewed-on: http://git-master/r/780326
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-08-21 10:59:07 -07:00
Yogesh
e44e67333b gpu: nvgpu: Inject function address from nvgpu
This patch inserts the function address of
gk20a_debug_dump_device into host data struct once
the nvgpu module loads and removes it during unload.

Bug 1476801

Change-Id: If49262208325b2aa0807705c26086e6d7c81632c
Signed-off-by: Yogesh Bhosale <ybhosale@nvidia.com>
Reviewed-on: http://git-master/r/779397
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
2015-08-19 13:15:23 -07:00
Sami Kiminki
08f37cba39 gpu: nvgpu: Prepare for per-GPU CDE program numbers
Add gpu_ops for CDE, and add get_program_numbers function pointer for
determining horizontal and vertical CDE swizzler programs. This allows
different GPUs to have their own specific requirements for choosing
the CDE firmware programs.

Bug 1604102

Change-Id: Ib37c13abb017c8eb1c32adc8cbc6b5984488222e
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-on: http://git-master/r/784899
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-08-19 08:03:24 -07:00
Richard Zhao
a88e58cc9d gpu: nvgpu: vgpu: add t210 gm20b support
- add hal initializaiton
- create folders vgpu/gk20a and vgpu/gm20b for specific code

Bug 1653185

Change-Id: If94d45e22a1d73d2e4916673736cc29751be4e40
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: http://git-master/r/774148
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
2015-08-19 05:12:00 -07:00
Deepak Nibade
db8bce518b gpu: nvgpu: wakeup semaphores after clearing CE2 interrupt
In gk20a_ce2_nonstall_isr(), we first invoke semaphore workqueue
on all channels and then clear the interrupt
This delay in clearing the interrupt can sometimes lead to
dropping of new interrupt

If that happens, we never invoke gk20a_channel_semaphore_wakeup()
for new semaphore interrupts and semaphore waiting
never completes.

Fix this by moving gk20a_channel_semaphore_wakeup() after
we clear the interrupt

Bug 200131938

Change-Id: I26d72f04a8b49f4a3ac326bf6037cd04c741a920
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/784771
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-08-18 13:53:54 -07:00
sujeet baranwal
2b0e5ed361 gpu: nvgpu: wakeup semaphores after clearing the interrupt
Currently, we first invoke semaphore workqueue on all channels
and then clear the interrupt
This delay in clearing the interrupt can sometimes lead to
dropping of new interrupt

If that happens, we never invoke gk20a_channel_semaphore_wakeup()
for new semaphore interrupts and semaphore waiting
never completes.

Fix this by moving gk20a_channel_semaphore_wakeup() after
we clear the interrupt

Bug 200083084
Bug 200117718

Change-Id: I7278cb378728e3799961411c4ed71d266d178a32
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Signed-off-by: sujeet baranwal <sbaranwal@nvidia.com>
Reviewed-on: http://git-master/r/783175
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Tested-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2015-08-14 22:08:09 -07:00
Mahantesh Kumbar
aef94648e2 gpu: nvgpu: T186 perfmon ID update
Change-Id: Iec6aac4027c8079d10e6d09bb145fa7a37d1679b
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/779696
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-08-13 08:08:43 -07:00
Yogesh
77e608d528 gpu: nvgpu: Check for valid memory pointers
1. Before destroying the allocator for PMU dmem check if it was already
initialized. It is only initialized through certain paths like PMU ISRs.
So while testing the nvgpu module using nvgpu_submit_twod test I found
that it was never initialized.

2. Inside gk20a_init_gr_setup_sw, cleanup part calls for de-allocating
the already allocated chunk of memory. Whereas, cleanup also gets called
when memory allocation inside the same function fails. In such cases,
we should have a non-null check else we attempt to free a non-allocated
memory and kernel panics.

Bug 1476801

Change-Id: Ia2f0599ac0c35d58709acd149033e114b898b426
Signed-off-by: Yogesh Bhosale <ybhosale@nvidia.com>
Reviewed-on: http://git-master/r/777118
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-08-12 15:29:03 -07:00
Richard Zhao
9cf28bc529 gpu: nvgpu: fix memory corrupt
replace sprinf with snprintf in func gk20a_channel_syncpt_create.
sync point name can be long.

Bug 1638853

Change-Id: Ie305d04edfbb299c8b1241eca52101439bb4a6c6
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: http://git-master/r/769113
Reviewed-on: http://git-master/r/776424
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vladislav Buzov <vbuzov@nvidia.com>
2015-08-11 20:39:50 -07:00
Mahantesh Kumbar
bda01cda7a gpu: nvgpu: T186 GR FW version update
- pmu version update to sync with CL-19816709
- GPCCS version update to sync with CL-19816709

Change-Id: Ia60bb538ddba35c973183ca2d4d3a7a0013b4b59
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/779628
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-08-10 08:40:32 -07:00
Deepak Nibade
c27e094002 gpu: nvgpu: remove gk20a_busy() from channel_syncpt_incr()
gk20a_busy() is already called on all the paths to
__gk20a_channel_syncpt_incr() i.e. in gk20a_submit_channel_gpfifo()

hence remove the redundant gk20a_busy() call since it causes
deadlock scenario with VPR resize use case

Bug 200128257
Bug 1645760
Bug 200114947
Bug 200124519

Change-Id: I4cd47b7e7cdc92aaeda17256a99f2ba93833a3b3
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/778341
(cherry picked from commit 5a5dc5b5a9d38a5e8d5c1ca29dc6de425c00b605)
Reviewed-on: http://git-master/r/779070
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2015-08-06 22:20:22 -07:00
Deepak Nibade
a969bc98ae gpu: nvgpu: remove gk20a_busy() from channel_syncpt_update()
gk20a_busy() was added to gk20a_channel_syncpt_update() for possible
case of channel deletion

But API to delete a channel (i.e. gk20a_free_channel()) is already
called in paths which ensure gk20a_busy() is called before
deleting the channel

Hence, remove redundant gk20a_busy()/idle() calls

This also fixes a deadlock scenario with VPR resize use case

Bug 200128257
Bug 1645760
Bug 200114947
Bug 200124519

Change-Id: I05dc739b3be88af2ba22b0a667e5004d8100bf6f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/778340
(cherry picked from commit 306282aa950201cf1ae91a5cc48d75719b179d19)
Reviewed-on: http://git-master/r/779069
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2015-08-06 22:20:08 -07:00
Deepak Nibade
9617dcbf87 gpu: nvgpu: remove Tegra power calls from generic platform
Remove Tegra specific powergate and power-domain calls
from generic platform file

Change-Id: I86e263193e01150cbcf7ae50fd0c86f0b8b59b14
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/778682
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2015-08-05 23:46:46 -07:00
Sumit Singh
77a816e7bf Merge branch 'power-domain-t186' into 'kernel-3.18'
Add device-tree support for tegra power-domains and power-gating
for t186, then perform the related cleanup.
Also enable TEGRA_MC_DOMIANS, PM_GENERIC_DOMAINS_OF and
TEGRA_POWERGATE for t186.

Bug 200105664

Change-Id: I548c6b71a1577afa439a39a0eafc317a1c3cbc68
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
2015-08-04 12:43:12 +05:30
Deepak Nibade
ef57db8606 gpu: nvgpu: sysfs to check if GPU is railgated
Add below sysfs to check if GPU is railgated or not :
/sys/devices/platform/gpu.0/is_railgated

Bug 200124736

Change-Id: Iafac48bbe82fcd422eeb2b948490e8dc8ad3801a
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/773457
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2015-07-24 03:33:24 -07:00
Deepak Nibade
a76c6fc950 gpu: nvgpu: prepare_poweroff() in shutdown()
gk20a_pm_shutdown() is the last callback before
GPU railgate will be forced by platform code

Hence we need to call prepare_poweroff() before
returning from shutdown() to clean up below things
mainly,

1. disable interrupts to ensure that GPU is not
   processing any interrupts while railgating

2. disable clocks (and related flags) to ensure
   no h/w access from exported clock ops

Note that GPU railgate will be triggered by platform
code since config CONFIG_PM_GENERIC_DOMAINS_OF is
enabled by default

Bug 200123584

Change-Id: Ifaa0d1ba9b01d49bf5cc85d9c9a9feb3815866d8
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/770485
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2015-07-22 02:23:25 -07:00
Sumit Singh
25f0faeb37 gpu: nvgpu: clean-up the code
As CONFIG_PM_GENERIC_DOMAINS_OF is enabled, so cleaning-up
the code which remains unused when this config is enabled.

Bug 200070810

Change-Id: I884ca3d6fb8fa6acdff8c1b2fbe66a672758274a
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
2015-07-21 11:46:23 +05:30
Sumit Singh
a19024c4c3 gpu: nvgpu: Add DT support for gpu power-domain
Make modification to add DT support for gpu
power-domain for T186 chip.

Bug 200105664

Change-Id: Ief8d0a6c84918578c52d153db7eac02587b67ee7
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
2015-07-21 11:46:22 +05:30
Alex Waterman
ca26ce6f8c gpu: nvgpu: Increase VA space to 40 bits
Now that the buddy allocator is merged we can increase the VA space
without dramatically increasing memory usage by the allocator.

40 bits is the max VA space available on gk20a and gm20b.

Change-Id: I7bc8d86e35b28f041e9a435f2571c8288970c8ee
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/745076
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/771152
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2015-07-20 11:33:07 -07:00
Alex Waterman
12f245163d gpu: nvgpu: Fix address space limit computation
The address space limit was being computed with the assumption
that the va_limit field is inclusive. The va_limit field is
actually not inclusive. It points to the first invalid byte.

Thus when generating the adr_limit register the code incorrectly
calculated that the address limit should be 0. To fix this the
computation now just uses va_limit - 1.

Also, the bitwise OR of 0xfff into the lower limit word was
incorrect. The bottom 12 bits of the lower 32 bit word are
ignored by the GPU and as such should not be populated.

Change-Id: Ifcc13343aaf50776f3cf1a1e3726e73ffde5003f
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/756690
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/771151
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2015-07-20 11:33:02 -07:00
Alex Waterman
4a3f84d257 gpu: nvgpu: Fix overflow of alloc length
Fix an issue where large ( > 4GB) allocations were not being computed
correctly. The two fields, pages and page_size, were both 32 bits so
when multiplied they easily overflowed. Simple fix is to cast them to
64 bits before multiplying them.

Change-Id: I63fa54679e485de5c3a99684cbeb72c6cdc65504
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/747429
Reviewed-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/771148
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2015-07-20 11:32:57 -07:00
Sandarbh Jain
e60b7deec4 gpu: nvgpu: Use correct tpc_per_gpc for GM20b
While evaluating the broadcast register, use the correct max_tpc_per_gpc for gm20b.

Bug 200118793

Change-Id: Icdc506c05895e5ecdd424dfa2729d0d53460ff15
Reviewed-on: http://git-master/r/765147
(cherry picked from commit be5add9a2f13f787ea408d2a28b0b82c776227d4)
Signed-off-by: Sandarbh Jain <sanjain@nvidia.com>
Reviewed-on: http://git-master/r/771254
Reviewed-by: Ken Adams <kadams@nvidia.com>
Tested-by: Ken Adams <kadams@nvidia.com>
2015-07-17 07:52:19 -07:00
Vijayakumar
55c85cfa7b gpu: nvgpu: improve sched err handling
bug 200114561

1) when handling sched error, if CTXSW status reads switch
check FECS mailbox register to know whether next or current
channel caused error
2) Update recovery function to use ch id passed to it
3) Recovery function now passes mmu_engine_id to mmu fault
handler instead of fifo_engine_id

Change-Id: I3576cc4a90408b2f76b2c42cce19c27344531b1c
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/763538
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2015-07-17 01:16:48 -07:00
Sam Payne
37869170e4 gpu: nvgpu: check that GPU is powered before flush
if GPU is not powered before L2 is flushed, then
L2 cache flush is a noop. Same behavior as
gk20a_mm_L2_Invalidate()

bug 1661228

Change-Id: I0f590628928a73b7277d1b16a5a79a86e0213648
Signed-off-by: Sam Payne <spayne@nvidia.com>
Reviewed-on: http://git-master/r/768068
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
(cherry picked from commit cb4d29d34d0736aa753afa323bfb216481cc8640)
Reviewed-on: http://git-master/r/771113
GVS: Gerrit_Virtual_Submit
2015-07-16 20:54:25 -07:00
Deepak Nibade
ae2f9da28e gpu: nvgpu: fix channel close sequence
In gk20a_cde_remove_ctx(), current sequence is as below
- gk20a_channel_close()
- gk20a_deinit_cde_img()
  - gk20a_free_obj_ctx()

But gk20a_free_obj_ctx() needs reference to channel and hence
below crash is seen :

[ 3901.466223] Unable to handle kernel paging request at virtual address
00001624
...
[ 3901.535218] PC is at gk20a_free_obj_ctx+0x14/0xb0
[ 3901.539910] LR is at gk20a_deinit_cde_img+0xd8/0x12c

Fix this by closing the channel after gk20a_deinit_cde_img()

Bug 1625901

Change-Id: Ic2dc5af933b6d6ef8982c2b9f0caa28df204051f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/770322
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2015-07-16 01:53:39 -07:00
Amit Sharma (SW-TEGRA)
1b145f447b nvgpu: gk20a: include proper header file
Fixed the following sparse warning by including the "fb_gk20a.h" header file:
- fb_gk20a.c: warning: symbol 'fb_gk20a_reset' was not declared.
	      Should it be static?

Bug 200088648

Change-Id: I1ba6051455a22e81da6598eebdccfa8b45b78c3e
Signed-off-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-on: http://git-master/r/768203
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-on: http://git-master/r/770654
2015-07-15 21:54:16 -07:00
Leonid Moiseichuk
1e7b5ea793 gpu: nvgpu: cyclestats snapshots are only for t210
The cyclestats mode-e feature supported by userspace only
for t210 devices, so kernel should advertize it only for t210.

Also small check added to prevent BUG in dma-buf.c:826
if device has lack of memory.

Bug 1662506

Change-Id: I8417a8cdd9092e64126382f379d171932e4592a1
Signed-off-by: Leonid Moiseichuk <lmoiseichuk@nvidia.com>
Reviewed-on: http://git-master/r/767073
(cherry picked from commit 06f86b6e78bae5e26e32466716c18e7918efb1b1)
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/767148
Reviewed-by: Automatic_Commit_Validation_User
2015-07-10 00:31:03 -07:00
Amit Sharma (SW-TEGRA)
51c784d9a1 nvgpu: gm20b: make local function 'static'
Fixed the following sparse warning by making the local function 'static':
- warning: symbol 'gm20b_load_falcon_ucode' was not declared.
	   Should it be static?

Bug 200067946

Change-Id: I11beaa301dc45dfec6f2295a6a96c1571e0264c9
Signed-off-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-on: http://git-master/r/766361
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-on: http://git-master/r/767991
Reviewed-by: Automatic_Commit_Validation_User
2015-07-09 22:44:08 -07:00
Terje Bergstrom
16aaae648b gpu: nvgpu: Implement own rail gating code
Move rail gating sequence to happen in nvgpu driver instead of
piggybacking on Tegra power gating APIs.

Bug 200115454

Change-Id: I8514686c7b137f200021b05ead7157d0883bddc5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/761991
2015-07-07 08:23:32 -07:00
Terje Bergstrom
0c25c820d7 gpu: nvgpu: Update eng_buf_load message for T18x
eng_buf_load message structure for T18x is updated. Update kernel
code to follow.

Bug 200119744

Change-Id: Ib86c3e54ed60704470b29d9f7de612697cfd54a3
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/764458
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Tested-by: Mahantesh Kumbar <mkumbar@nvidia.com>
2015-07-06 09:47:33 -07:00
Terje Bergstrom
417bc8361a gpu: nvgpu: Reset FB also in gm20b
FB reset was added for gk20a. It should be invoked also on gm20b.

Change-Id: I0b074bc50a889108edae93d62b3194e54bfda881
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/765366
2015-07-03 19:00:22 -07:00
Terje Bergstrom
63714e7cc1 gpu: nvgpu: Implement priv pages
Implement support for privileged pages. Use them for kernel allocated buffers.

Change-Id: I720fc441008077b8e2ed218a7a685b8aab2258f0
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/761919
2015-07-03 17:59:12 -07:00
Terje Bergstrom
4cc1457703 gpu: nvgpu: Move clk bypass div code to clk init
Clock bypass divider was changed just before resetting priv ring.
Move the code to a new clk op instead so that it is executed only on
gk20a.

Change-Id: Ic8084a4a5fac23770f50b50f910ced2543ba0f28
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/764970
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
2015-07-03 07:51:42 -07:00
Sami Kiminki
e7ba93fefb gpu: nvgpu: Initial MAP_BUFFER_BATCH implementation
Add batch support for mapping and unmapping. Batching essentially
helps transform some per-map/unmap overhead to per-batch overhead,
namely gk20a_busy()/gk20a_idle() calls, GPU L2 flushes, and GPU TLB
invalidates. Batching with size 64 has been measured to yield >20x
speed-up in low-level fixed-address mapping microbenchmarks.

Bug 1614735
Bug 1623949

Change-Id: Ie22b9caea5a7c3fc68a968d1b7f8488dfce72085
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-on: http://git-master/r/733231
(cherry picked from commit de4a7cfb93e8228a4a0c6a2815755a8df4531c91)
Reviewed-on: http://git-master/r/763812
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-06-30 08:35:23 -07:00
Terje Bergstrom
ae7b988b0d gpu: nvgpu: Delete T132 specific configuration
Change-Id: I1cd97a8ea0911a657fc4d5b7a3aee534474aea47
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/762558
2015-06-29 11:27:42 -07:00
Sumit Singh
9cc23218ba Merge PM domain changes from k3.10 into 'kernel-3.18'
This change brings in all changes that were done for:

1. device-tree support for power domains
2. device-tree support for power-gating driver
3. Reverts of 3 changes from k3.18 power-domain

Bug 200070810
Bug 200105664
Bug 200100078

Change-Id: Iba93713180d66caa46f1f55c30e9bbde2be9dcc0
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
2015-06-29 12:01:45 +05:30
Sumit Singh
1f99458ed3 gpu: nvgpu: Uncomment suspend/resume ops
As upstream has removed them, but we are still using these.
So uncommenting these callback assignment.

Bug 200070810

Change-Id: I26a221f9d76f6acef70095eb8afcf440057f464c
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
2015-06-29 11:42:30 +05:30
Sumit Singh
c65d41e768 gpu: nvgpu: Add DT support for gpu power-domain for T132
Make modification to add DT support for gpu
power-domain for T132 chip.

Bug 200070810

Change-Id: Iac63c8fb5fc5280e9a9f5758e63c9da009f3813d
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
Reviewed-on: http://git-master/r/739698
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
2015-06-29 11:42:28 +05:30
Sumit Singh
c61ab8facb Revert "HACK: Disable genpd_pm_subdomain_attach"
This reverts commit 83699a4ec9ebf55f6cc12c76e57dad1d4ec2fbfa.

This hack was put in place as upstream has removed of_node
field from generic_pm_domain structure. But as we are still
using it, so removing this hack.

Bug 200100078

Change-Id: I14e533786fb814e361c580e2883ceff1f63d251f
2015-06-29 11:38:48 +05:30
Vijayakumar
30d399de30 gpu: nvgpu: load secure gpccs using dma
bug 200080684

use new cmd defined in ucode for loading
GR falcons. flip PRIV load flag in lsb
header to indicate using dma. use pmu msg
as cmd completion for new cmd instead of
polling fecs mailbox. also move
check for using dma in non secure boot path
to hal.

Change-Id: I22582a705bd1ae0603f858e1fe200d72e6794a81
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/761625
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-06-26 13:14:53 -07:00
Rich Wiley
25b540e5c9 gpu: nvgpu: More verbose BAR1 failure message
Change-Id: Ie575aa3eeea8ebddf5778be0d03cf9744ec35540
Signed-off-by: Rich Wiley <rwiley@nvidia.com>
Reviewed-on: http://git-master/r/760860
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-06-26 11:07:54 -07:00