Commit Graph

1807 Commits

Author SHA1 Message Date
Konsta Holtta
12661e4a48 gpu: nvgpu: fix nbsp in Kconfig
Replace an accidental non-breaking space character with a normal space,
fixing the "ignoring unsupported character" build warning.

Change-Id: Ib3faca8489f083bb0027a8cfea82b256221b4e43
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1165134
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-16 08:17:41 -07:00
Mahantesh Kumbar
7bd2329ab8 gpu: nvgpu: PMU version update
JIRA DNVGPU-34

Change-Id: Ib9618bdd928a02917b40e6f9619265bf27aa6879
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1162632
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-15 13:57:07 -07:00
Konsta Holtta
75f6a1dff4 gpu: nvgpu: add vidmem allocation API
Add in-nvgpu APIs for allocating and freeing mem_descs in video memory.
Changes for gmmu tables etc. will be added in upcoming changes.

Video memory is allocated via nvmap by initially registering the
aperture size to it and binding it to a struct device, and then going
via the usual dma alloc. This API allows also fixed-address allocations,
meant for reserving special memory areas at boot.

The aperture registration is skipped completely if vidmem isn't found
for the particular device.

gk20a_gmmu_alloc_attr() still uses sysmem, and the unmap/free paths
select internally the correct path by the mem_desc's aperture.

Video memory allocation is off by default, and can be turned on with
CONFIG_GK20A_VIDMEM.

JIRA DNVGPU-16

Change-Id: I77eae5ea90cbed6f4b5db0da86c5f70ddf2a34f9
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1157216
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-15 09:34:07 -07:00
Seshendra Gadagottu
e9fd9e9fe3 gpu: nvgpu: sysfs: use snprintf instead of sprintf
Use snprintf instead of sprintf to avoid
any buffer overflows.

Bug 200192125

Change-Id: I6df43c6d6ee62677f5fd4d4e99f16be77c9e101e
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1164312
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-14 14:03:12 -07:00
Alex Waterman
5900fbd954 gpu: nvgpu: Export and rename alloc_fence
Rename alloc_fence() to gk20a_alloc_fence() and allow this function
to be called by the channel_sync_gk20a.c code.

Bug 1732449
JIRA DNVGPU-12

Change-Id: Ic17131db2c8545832a2e8caacbd092cf970af4d1
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1162687
Reviewed-by: David Martinez Nieto <dmartineznie@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-14 14:01:10 -07:00
Alex Waterman
4e21f4a148 gpu: nvgpu: export gk20a_free_priv_cmdbuf
Export gk20a_free_priv_cmdbuf() so that the channel_sync_gk20a.c code
can call this function. This is necessary for error paths in the
semaphore wait/incr functions.

Bug 1732449
JIRA DNVGPU-12

Change-Id: Id2ea13e5553d50475ee1bbf94781e18590321fdf
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1162686
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-14 14:01:03 -07:00
Terje Bergstrom
1409d216e5 gpu: nvgpu: Fix gk20a_busy() in debug dump
When debug dump is called from an interrupt thread, we do not want
to call gk20a_busy() because it causes race in case rail gating is
being engaged at the same time. It has to be called from all debugfs
paths.

Bug 200198908
Bug 1770522

Change-Id: I7eda7d029b0a59cce0320ecc1b750dc2f4d7ccf0
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1163440
GVS: Gerrit_Virtual_Submit
Tested-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2016-06-14 04:50:56 -07:00
Terje Bergstrom
edd080b05a gpu: nvgpu: Disable channel watchdog
Bug 200198908

Change-Id: I4dfb3517f5467f8b5449e65290453ba1c828243d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1163439
Tested-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2016-06-14 04:50:48 -07:00
Terje Bergstrom
768dc5ad42 gpu: nvgpu: Do not register debug dump to nvhost
Do not register device for debug dump to nvhost. This can cause races
if nvhost calls debug dump spew at the same time when GPU is being
powered off.

Bug 200198908
Bug 1770522

Change-Id: Ia7e57437d647041e82dd4c61ffd08fb1cbe1f32f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1163441
GVS: Gerrit_Virtual_Submit
Tested-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2016-06-14 04:50:40 -07:00
Terje Bergstrom
7010afdfda gpu: nvgpu: Do not complain about default runlist
Do not spew an error when choosing the default runlist for engine. That is
normal behavior.

Change-Id: Ide786712f3f74bf59aee48de98c2186db1d97378
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1163511
GVS: Gerrit_Virtual_Submit
Reviewed-by: Lakshmanan M <lm@nvidia.com>
Tested-by: Lakshmanan M <lm@nvidia.com>
2016-06-13 22:07:59 -07:00
Alex Waterman
5cf1fddbab gpu: nvgpu: Balance curly braces
In some of the conditionally compiled code in the nvgpu driver there
are places where the code looks like:

  #ifdef LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
  some-loop {
  #else
  a-diff-loop {
  #endif
          /* Some code... */
  }

This leaves unbalanced curley braces: two open braces for one close
brace. This messes up some editors syntax highlighting and auto-
indentation features.

This patch puts in the extra brace. It's not necessary for compiling
code but it makes some editors much happier.

Change-Id: Ida28bc001cc840fe52a43982db934d49c07cc7d3
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1153668
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-13 10:27:31 -07:00
Lakshmanan M
a295d90cac gpu: nvgpu: Add uapi support for non-graphics engines
Extend the existing NVGPU_GPU_IOCTL_OPEN_CHANNEL interface to allow
opening channels for other than the primary (i.e., the graphics)
runlists. This is required to push work to dGPU engines that have
their own runlists, such as the asynchronous copy engines and the
multimedia engines.

Minor change - Added active_engines_list allocation
and assignment for fifo_vgpu back end.

JIRA DNVGPU-25

Change-Id: I3ed377e2c9a2b4dd72e8256463510a62c64e7a8f
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: http://git-master/r/1161541
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-13 07:45:19 -07:00
Konsta Holtta
987de66583 gpu: nvgpu: optimize mem_desc accessor loops
Instead of going via gk20a_mem_{wr,rd}32() on each iteration, do direct
memcpy/memset with sysmem, and minimize the enter/exit overhead with
vidmem.

JIRA DNVGPU-23

Change-Id: I5437e35f8393a746777a40636c1e9b5d93ced1f6
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1159524
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-13 07:42:26 -07:00
Terje Bergstrom
15d241a8cb gpu: nvgpu: Support third GPU version on T18x
Change-Id: I3f1645ed7a465c93b0a0a6f885ef77bea0066ed0
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1160372
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
2016-06-13 07:39:56 -07:00
Terje Bergstrom
3490cf9f2a gpu: nvgpu: Check result of gk20a_pmu_init
If PMU version is not supported, gk20a_pmu_init returns an error
code. Check the error code and fail poweron if gk20a_pmu_init
fails.

Change-Id: Ia1d6a6fcbcc5a144d2e5bc88734df778e887fa53
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1160371
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
2016-06-13 07:39:23 -07:00
Alex Waterman
832e4fce1e gpu: nvgpu: Rework the channel timeout handler messages
Rework how the messages in the channel timeout handler to be a little
bit more verbose and more clear about what is happening.

Bug 1732449
JIRA DNVGPU-12

Change-Id: Ifc018d99c647b3036caa8ad453e5e3dfc4151396
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1153669
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-13 07:38:57 -07:00
Alex Waterman
5f36481371 gpu: nvgpu: Remove dead priv_cmdbuf code
Remove the gp_get and gp_put pointers from the priv_cmdbuf code. These
pointers appear to track the position of th the priv_cmdbuf in the gp_fifo.
However, these pointers are not used for anything nor are they needed for
anything in the future. This code appears to be a relic left over from the
past.

Change-Id: Ibed1a6d51fa0cac12c5e0429760e8e2f611fc899
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1161859
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-13 07:38:14 -07:00
Lakshmanan M
823ba42456 gpu: nvgpu: Add uapi support for NVGPU_GPU_IOCTL_GET_ENGINE_INFO
Implement NVGPU_GPU_IOCTL_GET_ENGINE_INFO for retrieving the
list of supported engines and their corresponding run list id:s.

JIRA DNVGPU-25

Change-Id: I8703388660190f7dcb509c0676f283ca4b820b6f
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: http://git-master/r/1160939
Reviewed-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-10 12:26:28 -07:00
Lakshmanan M
7f6fede92c gpu: nvgpu: fix sparse warnings
Fixed the following sparse warnings:
- warning: symbol 'gm206_ce_isr' was not declared.
           Should it be static?
- warning: symbol ''gm206_ce_nonstall_isr' was not declared.
           Should it be static?

Bug 200088648

Change-Id: I30f66ba4225d5544d6110bc4a70235234ad4001d
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: http://git-master/r/1161604
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-10 12:24:59 -07:00
Deepak Nibade
2bc8f4e36d gpu: nvgpu: fix event id polling
In gk20a_event_id_poll(), we always set the mask value
and return it. This causes poll() from UMD to be always
successful irrespective of event is really generated or not

Fix this by adding a flag event_posted for each event
Set this flag while posting the event
In gk20a_event_id_poll(), set the mask value only if
this flag is set. If flag is set, set mask and clear the flag

Bug 200089620

Change-Id: If14236547c611fe4bfa1410ff5b69c9fa02d43bb
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1160253
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-10 08:14:49 -07:00
Mahantesh Kumbar
9b1bb51cf0 gpu: nvgpu: ACR interface update
- ACR interface update to support
 next GPU chip ACR boot
- Udpate falcon ID

JIRA DNVGPU-34

Change-Id: Ic9e5e1f9bd965dbb65b4feaadcf63e457b49263b
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1161695
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-09 16:56:09 -07:00
Mahantesh Kumbar
b5f2cff023 gpu: nvgpu: update PMU version, interface & code
- update PMU interface/code to support
latest version of secure boot FW
- Add PMU FW version for next GPU support
- can_elpg check in pmu_setup_hw helps
  to fix queue error

JIRA DNVGPU-34

Change-Id: Iecf47fbc5b71cbf0f4bcdfeafad5c635cb6bff82
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1161107
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-09 16:55:23 -07:00
Richard Zhao
3735dba6f8 gpu: nvgpu: vgpu: add general event support
Events like bpt int/pause will help cuda work properly.

Bug 200173403
VFND-1568

Change-Id: I29e534969028bf08aedd81c99f5a536779f431d1
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: http://git-master/r/1159621
(cherry picked from commit a266e53c514639e15ed166e2c8ce5a55efc48eda)
Reviewed-on: http://git-master/r/1152154
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-09 15:17:41 -07:00
Richard Zhao
c624f35383 gpu: nvgpu: vgpu: add channel enable support
Bug 200173403
VFND-1568

Change-Id: I3636a77bbbbd719e961dce5ca7ca7bdd5aa33881
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: http://git-master/r/1159620
(cherry picked from commit b22fb6518da15a09c3e298213af5e60b8e6907a2)
Reviewed-on: http://git-master/r/1155403
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-09 15:17:28 -07:00
Sachit Kadle
e8b20c12cd gpu: nvgpu: vgpu: add channel force reset
Add forced channel reset support for vgpu

Bug 200187507
JIRA EVLR-337

Change-Id: I48e3e2b430f3a4ae94244225232902a8c037cb07
Signed-off-by: Sachit Kadle <skadle@nvidia.com>
Reviewed-on: http://git-master/r/1154781
(cherry picked from commit abd6688801fe76c822d6f67f554c18705d9f23d6)
Reviewed-on: http://git-master/r/1161259
GVS: Gerrit_Virtual_Submit
Tested-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-09 15:17:10 -07:00
Terje Bergstrom
3daeac112b Revert "gpu: nvgpu: take power refcount in ISR"
This reverts commit 2219f38727. It leaves
GPU in on state for some tests that require powering down GPU.

Change-Id: I79d44fed729e98692021c57bbeff6a0ef2e8c983
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1161846
2016-06-09 11:20:28 -07:00
Konsta Holtta
e3162262e3 gpu: nvgpu: include matching header in mm_gm106.c
Include mm_gm106.h in mm_gm106.c to bring function declarations visible
and to fix a Sparse warning.

Bug 200088648

Change-Id: Ifbedafdd75ce0ee019b39d507b8b113cccdc8918
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1161608
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2016-06-09 04:27:53 -07:00
Konsta Holtta
d215bc1107 gpu: nvgpu: detect vidmem configuration from HW
Read video memory size from hardware during initialization for devices
that support it.

JIRA DNVGPU-14

Change-Id: If190f2d89f7148520ee274ca674f972987c8056d
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1157215
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-08 12:05:05 -07:00
Deepak Nibade
2219f38727 gpu: nvgpu: take power refcount in ISR
We sometimes see race conditions where power refcount
is zero during ISR or bottom half.
If bottom half calls gk20a_busy(), it will lead to
boot up of GPU, but it is also possible that we are
already trying to poweroff GPU since power refcount
is zero

Fix this by taking a power refcount with gk20a_busy_noresume()
in ISR and then dropping this refcount at the end of
bottom half
Add new API gk20a_idle_nosuspend() to drop a refcount
without initiating suspend

Bug 200198908
Bug 1770522

Change-Id: Iec3d4dc8d468f49b71919d2bbc327da48b97bcab
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1160035
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-08 11:22:59 -07:00
Lakshmanan M
6299b00beb gpu: nvgpu: Add multiple engine and runlist support
This CL covers the following modification,
1) Added multiple engine_info support
2) Added multiple runlist_info support
3) Initial changes for ASYNC CE support
4) Added ASYNC CE interrupt handling support
   for gm206 GPU family
5) Added generic mechanism to identify the
   CE engine pri_base address for gm206
   (CE0, CE1 and CE2)
6) Removed hard coded engine_id logic and
   made generic way
7) Code cleanup for readability

JIRA DNVGPU-26

Change-Id: I2c3846c40bcc8d10c2dfb225caa4105fc9123b65
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: http://git-master/r/1155963
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-07 12:31:34 -07:00
Supriya
3d7263d3ca drivers: gpu: nvgpu: Update PMU version for gk20a
-T124 P4 Cl for the change 20824361
-P4 CL Removes accesses to ZBC L2 save/restore
-during ELPG

Bug 1746047
Bug 200204625

Change-Id: I5a52de7de51e723eae02f82c6c6fc9a213f9cd0e
Signed-off-by: Supriya <ssharatkumar@nvidia.com>
Reviewed-on: http://git-master/r/1159464
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-07 12:07:26 -07:00
sreenivasulu velpula
abbc813fe3 gpu: nvgpu: add call back for get_cur_freq
When thermal throttling triggers gpcclk clock
changes, devfreq driver need to have call back
for get_cur_freq to get current gpu frequency.

With out this change, "17000000.gp10b/cur_freq"
interface won't show the current gpcclk frequency,
when thermal throttling triggers gpcclk frequency
changes.

Bug 1740309

Change-Id: I2484728094883abc285b2a3808bb2cef26a4ea96
Signed-off-by: sreenivasulu velpula <svelpula@nvidia.com>
Reviewed-on: http://git-master/r/1145912
(cherry picked from commit 0a6ef7b121d1b8aeba42cefa6e8b090b1ccd15e7)
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1147652
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-07 12:05:55 -07:00
Seshendra Gadagottu
5272552ab1 gpu: nvgpu: remove clockgate_delay param
Removed platform data parameter clockgate_delay, since it is not
really used for gpu clock gating any more. Also use railgate_delay
as autosuspend delay instead of clockgate_delay.

Change-Id: I5b594b5a0e84295ed9971ecdf4865dc1a7dd936d
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1159593
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-07 12:05:05 -07:00
Konsta Holtta
8432f6d80a gpu: nvgpu: cache whole bar0_window for mem accesses
Save the whole bar0 window register that encodes also the target
aperture (vid/sys mem) instead of only the base address that could
overlap between the two.

JIRA DNVGPU-23

Change-Id: I2ccbea0e1f7c7310c1ca6b158afafe8fd974a615
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1159523
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-07 09:24:14 -07:00
Seshendra Gadagottu
697c8c1a98 gpu:nvgpu: add sysfs nodes for ptimer freq
With current ptimer_scale_factor sysfs node, some
precision is lost while converting scaling factor to
floating point and similarly more precision will be lost
while converting back to fixed point. To avoid this,
kernel will export following two sysfs nodes:

ptimer_ref_freq : ptimer reference frequency( in hz)
ptimer_src_freq : ptimer source frequency (in hz) in current
                  chip architecture.

Client will apply proper scaling factor by doing
ptimer_ref_freq / ptimer_src_freq.

Change-Id: I84516e235cc3fffe4cb9a73903416478f4050a9a
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1139985
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
2016-06-06 20:43:27 -07:00
Peter Daifuku
f48d28caa3 gpu: nvgpu: vgpu: add support for max_freq
Add vgpu support for max_freq characteristic

Bug 200182714
JIRASW VFND-1570

Change-Id: Ibeddfbba1bf0529d6f576cefcb82978dbae315d1
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: http://git-master/r/1149216
(cherry picked from commit 8e8b5979e87268401d5b0fc658a73589710a2e09)
Reviewed-on: http://git-master/r/1155416
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-06 15:35:16 -07:00
Deepak Nibade
c16d985c8a gpu: nvgpu: return if no fecs intr
In gk20a_gr_handle_fecs_error(), if we do not see
any error interrupt from gr_fecs_host_int_status_r(),
just return immediately

Bug 1646259

Change-Id: Iea037e0dab57111d2a0fb41c5c19529b7d6c83c0
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1158591
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-06 11:01:00 -07:00
Mahantesh Kumbar
dc981a25f9 gpu: nvgpu; pmu version update
- P4 CL 20527959
- pmu version update for idle slowdown ucode
  CL http://git-master/r/#/c/1029404/
- configure LDIV slowdown factor to BY16
 using linear slowdown NV_THERM_FPDIV_BY16-0x1e value

Bug 200144583

Change-Id: Id15441a88ca980ab3f4f8a70e86cae5e59976829
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1159232
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-06 10:58:00 -07:00
Terje Bergstrom
1d2e66540a gpu: nvgpu: Fix calculation of timeout
Fix calculation of timeout in multiple places. The #defines
GR_IDLE_CHECK_DEFAULT and GR_IDLE_CHECK_MAX are meant to be used
only for defining the frequency of checking for timeout. Using them
for actual timeouts makes the timeout really short.

Change-Id: I3d0f8cbc91d619be8e5a9168ee1ab1d6298f129b
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1158269
2016-06-05 20:44:19 -07:00
Mahantesh Kumbar
b77cca1d62 gpu: nvgpu: enable gm204/gm206 GPMU secure boot
enable gm204/gm206 GPMU secure boot & build.

JIRA DNVGPU-11

Change-Id: I3502d227d0baad9e3a27f46d1d6b0d2a83503b6c
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1156331
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-05 15:35:44 -07:00
Mahantesh Kumbar
b6b7da6108 gpu: nvgpu: PMU support for gm204/gm206
Adding PMU modules to boot & comunicate
with PMU F/W

JIRA DNVGPU-11

Change-Id: I5afc9209f70fc13376268f9c94daef6b75527c71
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1156028
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-05 15:35:19 -07:00
Mahantesh Kumbar
ab458d0582 gpu: nvgpu: PMU interface's for gm204/gm206
Adding PMU interface's to support gm206/gm204

JIRA DNVGPU-11

Change-Id: I55671239cdb44804e7dd740d5e22a54e668005f4
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1155940
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-05 15:35:04 -07:00
Mahantesh Kumbar
b4c355d32c gpu: nvgpu: Add gm204/gm206 ACR BL supoort
Update ACR BL desc & support for ACR boot.

JIRA DNVGPU-10

Change-Id: Iced2e10695439b2e1b47835f5c3c8a5d274e4b1e
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1155027
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-05 15:34:50 -07:00
Terje Bergstrom
3b566957fe gpu: nvgpu: Add context reset at golden context init
Part of golden context initialization is in powerup sequence, and
part done as part of first channel creation. The sequence is
missing a context reset, which causes initialization of golden
context to fail on dGPU.

Just moving the code to golden context initialization does not work,
because iGPU can be rail gated, and part of the sequence is required
in GPU boot.

Thus a part of context initialization is replicated to golden context
init after a context reset.

Change-Id: Ife1b167447018317d3a692b706880e0eda073e43
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1130698
2016-06-04 15:37:42 -07:00
Mahantesh Kumbar
f99de40936 gpu: nvgpu: WPR & PMU interface update
Update WPR interface &  PMU interface
to support latest ACR/PMU ucode versions

Change-Id: I4d1bd7a5c43751e96c1db58832cd316006d56954
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1158070
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-04 15:21:35 -07:00
Seshendra Gadagottu
608101dbfa gpu: nvgpu: use correct config for t19x
Use TEGRA_19x_GPU config instead of ARCH_TEGRA_19x_SOC for
t19x functionality. This config will defined only when gpu
repository for t19x is available.

Bug 1757988

Change-Id: I53421f31cbed49a2fb24085c150599c78b8158c0
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1158183
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-03 10:08:12 -07:00
Seshendra Gadagottu
e8b408ef27 gpu: nvgpu: source t19x specific Kconfig
Bug 1757988

Change-Id: I3efc3368cadd83c8334868d19c63f464e4925b27
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1157319
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-01 22:28:59 -07:00
Seshendra Gadagottu
6af864087c gpu: nvgpu: add t19x functionality conditionally
Include t19x functionality only when config TEGRA_T19x_GPU
is enabled.

Bug 1757988

Change-Id: I049f134d92c4ffdeeed2bc513579f7d9d396ff41
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1155297
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-01 22:28:53 -07:00
Seshendra Gadagottu
6fb4193559 gpu: nvgpu: include makefiles conditionally
Include chip specific makefiles, only if they are present
in current source tree.

Bug 1757988

Change-Id: I60a468bce6e0d20459aa643ccbce9bacbcd163bf
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1154761
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-01 14:22:52 -07:00
Deepak Nibade
8b05c705fb gpu: nvgpu: fix TSG abort sequence
In gk20a_fifo_abort_tsg(), we loop through channels of
TSG and call gk20a_channel_abort() for each channel

This is incorrect since we disable and preempt each
channel separately, whereas we should disable all channels
at once and use TSG specific API to preempt TSG

Fix this with below sequence :
- gk20a_disable_tsg() to disable all channels
- preempt tsg if required
- for each channel in TSG
  - set has_timedout flag
  - call gk20a_channel_abort_clean_up() to clean up channel state

Also, separate out common gk20a_channel_abort_clean_up() API
which can be called from both channel and TSG abort routines

In gk20a_channel_abort(), call gk20a_fifo_abort_tsg() if the
channel is part of TSG

Add new argument "preempt" to gk20a_fifo_abort_tsg() and
preempt TSG if flag is set

Bug 200205041

Change-Id: I4eff5394d26fbb53996f2d30b35140b75450f338
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1157190
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-06-01 13:04:02 -07:00