Commit Graph

806 Commits

Author SHA1 Message Date
Terje Bergstrom
4492c62ffe gpu: nvgpu: Add bus HAL
Add bus HAL and move all bus related hardware sequencing to that file:
BAR1 binding, timer access, and interrupt handling.

Change-Id: Ibc5f5797dc338de10749b446a7bdbcae600fecb4
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1323353
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-03-23 08:44:07 -07:00
Alex Waterman
3ab4a992e1 gpu: nvgpu: Use new kmem API functions (gp10b/*)
Use the new kmem API functions in gp10b/*.

Bug 1799159
Bug 1823380

Change-Id: Ia643c704aca2e23e3762c9b7dbdf1aa1f2363811
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1318309
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-03-22 18:37:04 -07:00
Terje Bergstrom
66cd2f7a18 gpu: nvgpu: gp10b: Remove checks for privsec on vgpu
In virtualized platform we don't have access to fuses. Skip reading
fuse and set priv security unconditionally.

Change-Id: Idcb2670ed48a5edb760e49a6d136d53e05bc34ef
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1323283
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
Tested-by: Richard Zhao <rizhao@nvidia.com>
2017-03-20 16:40:02 -07:00
Terje Bergstrom
866fee0247 gpu: nvgpu: Remove ELPG_FLUSH
ELPG_FLUSH is not accessible in later GPUs, so we stopped using it
and instead do explicit CBC and L2 flushes. Delete the unused
function op and backing code.

Change-Id: Ic3eb97f2d32ea8fdbe5ec57bd9254268caaf9935
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1323236
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-03-20 16:40:02 -07:00
Konsta Holtta
946f1e6359 gpu: nvgpu: don't read missing gpc_tpc_count in dump
The gp10b gr status dump can get printed so early that this array is
null, so don't access it in that case.

Bug 1853519

Change-Id: I7474a7f7c50f89aea4ef8e9b16cb1644355e415b
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1321119
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-03-17 08:43:42 -07:00
Terje Bergstrom
589d6385b1 gpu: nvgpu: Implement get_rate/set_rate as GPU op
Move clock APIs from gk20a_platform to gpu_ops. At the same time
allow use of internal get_rate/set_rate for querying both GPCCLK
and PWRCLK on iGPU.

At the same time we can replace calls to clk framework with the
new HAL and drop direct dependency to clk framework.

gp10b ops were replaced as a whole at HAL initialization. That
replaces anything set in platform probe stage, so reduce that to
touch only clock gating regs.

Change-Id: Iaf219b1f000d362dbf397d45832f52d25463b31c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1300113
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-03-16 11:48:29 -07:00
Terje Bergstrom
686c3b701f gpu: nvgpu: Move platform files to Tegra Linux
Platform files are used for adding code to probe for Tegra Linux
platform. Move the files to Tegra Linux directory to make this
clear.

Change-Id: Ida66af835688325f095260c618dad90395851267
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1300112
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-03-16 11:48:24 -07:00
Terje Bergstrom
95ef0315b9 gpu: nvgpu: Use GPU's own fuse registers
Read fuse values from GPU's own fuse registers instead of Tegra fuse
registers whenever possible. This reduces the number of dependencies
to Linux fuse code.

Some fuses do not have a corresponding register in GPU, so they're
left as is.

Change-Id: Id9f2f4da897f3e20b20c300a67f705e3fa5ba35a
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1318278
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
2017-03-16 09:17:22 -07:00
Seema Khowala
a4deb1079e gpu: nvgpu: gp10b: fix stall interrupt enablement
Currently priv, pbus and ltc interrupts are enabled as non-stall but
being handled in stall isr. Fix is to configure them as stall interrupt.

Change-Id: I78a0ad3eb4207dcd70da63098234ed6139f0664a
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1320031
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-03-14 19:50:10 -07:00
Rajkumar Kasirajan
e4a131a98d Revert "gpu: nvgpu: change stall intr handling order"
This reverts commit 35f0cf0efe as
it caused lp0 suspend/resume failure.

Bug 1886110

Change-Id: Ib62207650344180361b6529f716f77b84528cd56
Signed-off-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Reviewed-on: http://git-master/r/1317986
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-03-14 11:47:05 -07:00
David Nieto
403874fa75 gpu: nvgpu: refactor interrupt handling
JIRA: EVLR-1004

(*) Refactor the non-stalling interrupt path to execute clear on the
top half, so on dGPU case processing of stalling interrupts does not
block non-stalling one.
(*) Use a worker thread to do semaphore wakeups and allow batching of
the non-stalling operations.
(*) Fix a bug where some gpus will not properly track the completion
of interrupts, preventing safe driver unloads

Change-Id: Icc90a3acba544c97ec6a9285ab235d337ab9eefa
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1312796
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Lakshmanan M <lm@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Navneet Kumar <navneetk@nvidia.com>
2017-03-14 11:46:38 -07:00
Seema Khowala
35f0cf0efe gpu: nvgpu: change stall intr handling order
-Handle pbus and priv stall interrupts first.
 In general critical interrupts should be
 handled before any other non critical ones.

-Dump info enabled with gpu_dbg_intr if priv_ring
 interrupt is flagged by fmodel.

JIRA NVGPU-25

Change-Id: Iee767d8c9c933ceb57532c1b5a7fd7812daf1b6d
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1311273
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-03-07 00:10:44 -08:00
Terje Bergstrom
d6ff5ef649 gpu: nvgpu: Disable trace_printk use by default
trace_printk() does an extra stringify operation before calling
do_trace_printk(). The string ends up unused. This has an impact
to kernel even if we never end up using trace_printk().

Disable use of trace_printk() and introduce a Kconfig option for
re-enabling it.

Change-Id: I2e1014f5231f2089d7dc3cb2539e3eb5f4d58361
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1295298
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-03-07 00:10:41 -08:00
Alex Waterman
76b78b6fdc gpu: nvgpu: Remove nvgpu_gpuid_t18x.h
Remove nvgpu_gpuid_t18x.h since this file is now visible. Migrate
the relevant definitions and defines into their expected places and
make the code use the real defines. No longer is hiding t18x specific
stuff necessary.

Bug 1799159

Change-Id: I47fa2392e46fdb7aacc70aeb0cc8c3f5ca0dc22f
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1300976
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-03-02 18:48:41 -08:00
Sandeep Shinde
ee93b20963 gpu: nvgpu: Allow compute preemption mode on PASCAL_A class
Remove restriction of setting compute preemption mode for channels
created with PASCAL_COMPUTE_A class only and allow it to be set
for PASCAL_A class too.

Also print compute preemption mode during channel closing.

Bug 200284575

Change-Id: I2de3b3acda128e91caa2ab0fd341915ce6e6520b
Signed-off-by: Sandeep Shinde <sashinde@nvidia.com>
Reviewed-on: http://git-master/r/1313286
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Donghan Ryu <dryu@nvidia.com>
2017-03-02 11:44:47 -08:00
Seema Khowala
3c3f947cf4 gpu: nvgpu: add fifo ops for *data_fault_id_enum_v
generated hw header for top_device_info_data_fault_id_enum_v
is different between legacy chips and t19x

JIRA GV11B-7

Change-Id: I877e88a5b1b1f3f41bc72b895536f4a01b4fbd4e
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1313384
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-03-02 08:53:38 -08:00
Deepak Goyal
d6e40fc07a nvgpu: gpu: pmu: Use pmu ops to call pmu_reset().
In this patch hard coded function calls for PMU
reset are replaced by PMU ops.

Change-Id: I266c43e3540163a133895244dcf91169116812f5
Signed-off-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-on: http://git-master/r/1303757
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-02-23 21:33:33 -08:00
Mahantesh Kumbar
9c68af58a9 gpu: nvgpu: ACR interface headers reorganization
-Moved ACR interface headers from acr_gm20b.h/acr_gp106.h to
Its specific header files under “drivers/gpu/nvgpu/include/nvgpu/acr/”
Folder.

- nvgpu_acr.h - Top-level header-file which include ACR interfaces
headers & defines required to communicate with ACR, including this
header file is good to get access into ACR interface & made changes
accordingly,

-Deleted acr.h & acr_t18x.h as not required anymore
& removed its include from dependent files.

Jira NVGPU-19

Change-Id: Ie404043cfe1ab32404eb63a43831f470d8436324
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1304748
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-02-23 01:04:48 -08:00
Deepak Nibade
8ee3aa4b31 gpu: nvgpu: use common nvgpu mutex/spinlock APIs
Instead of using Linux APIs for mutex and spinlocks
directly, use new APIs defined in <nvgpu/lock.h>

Replace Linux specific mutex/spinlock declaration,
init, lock, unlock APIs with new APIs
e.g
struct mutex is replaced by struct nvgpu_mutex and
mutex_lock() is replaced by nvgpu_mutex_acquire()

And also include <nvgpu/lock.h> instead of including
<linux/mutex.h> and <linux/spinlock.h>

Add explicit nvgpu/lock.h includes to below
files to fix complilation failures.
gk20a/platform_gk20a.h
include/nvgpu/allocator.h

Jira NVGPU-13

Change-Id: I81a05d21ecdbd90c2076a9f0aefd0e40b215bd33
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1293187
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-02-22 04:15:02 -08:00
Peter Boonstoppel
907adfd785 gpu: nvgpu: Add NVGPU_IOCTL_CHANNEL_SET_BOOSTED_CTX
This ioctl can be used on gp10b to set a flag in the context header
indicating this context should be run at elevated clock
frequency. FECS ctxsw ucode will read this flag as part of the context
switch and will request higher GPU clock frequencies from BPMP for the
duration of the context execution.

Bug 1819874

Change-Id: I84bf580923d95585095716d49cea24e58c9440ed
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/1292746
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-02-14 14:54:46 -08:00
Alex Waterman
aa36d3786a gpu: nvgpu: Organize semaphore_gk20a.[ch]
Move semaphore_gk20a.c drivers/gpu/nvgpu/common/ since the semaphore
code is common to all chips.

Move the semaphore_gk20a.h header file to drivers/gpu/nvgpu/include/nvgpu
and rename it to semaphore.h. Also update all places where the header
is inluced to use the new path.

This revealed an odd location for the enum gk20a_mem_rw_flag. This should
be in the mm headers. As a result many places that did not need anything
semaphore related had to include the semaphore header file. Fixing this
oddity allowed the semaphore include to be removed from many C files that
did not need it.

Bug 1799159

Change-Id: Ie017219acf34c4c481747323b9f3ac33e76e064c
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1284627
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-02-13 18:14:45 -08:00
Mahantesh Kumbar
35980eac09 gpu: nvgpu: Delete PMU fecs override interface
Deleted PMU fecs override interface from pmu_api.h
header file as feature not used anymore
& its dependent code too.

Deleted file pmu_api.h as file dont
have any interfaces left inside

Jira NVGPU-19

Change-Id: I490cf67ae60ce2f1de37da063199ee04835b940d
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1297370
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-02-09 13:44:31 -08:00
Seema Khowala
e4a17d6379 gpu: nvgpu: gp10b: removed static keyword
Removed static keyword for t19x usage
-int gp10b_tegra_get_clocks(struct device *dev);
-int gp10b_tegra_reset_assert(struct device *dev);
-int gp10b_tegra_reset_deassert(struct device *dev);

JIRA GV11B-34

Change-Id: I0bcb02db431b3a11f1b0e40776698c5dd3a9703d
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1296847
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-02-09 11:24:25 -08:00
Laxman Dewangan
27dd1ce475 gpu: nvgpu: gp10b: Use T186 POWER DOMAIN macros
The driver file gp10b/platform_gp10b_tegra.c is compiled for
T186 SOCs and hence use the T186 power domain macros directly
instead of legacy TEGRA_POWERGATE_* macros.

This helps in kernel unification to not define the TEGRA_POWERGATE_*

bug 200257351

Change-Id: I955c5dd11e6deaaf537377beb6e67a58ab7787ab
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1300524
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-02-08 04:34:11 -08:00
Cyril Raju
a58dc57282 Revert "Revert "nvgpu: gp10b:remove EMC floor when GPU Fmin""
This reverts commit 74948b73e3 ("Revert "nvgpu: 
gp10b: remove EMC floor when GPU Fmin"")

The orginal patch caused instability in GVS and was reverted
for unknown reasons.This reverts the revert.

Revert   patch : http://git-master/r/#/c/1291512/
Original patch : http://git-master/r/#/c/1284572/

Bug 1864117
Bug 1863013

Change-Id: Iaeef74296d0df4bb63d02d567e0d4be63688643a
Signed-off-by: Cyril Raju <craju@nvidia.com>
Reviewed-on: http://git-master/r/1296294
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-02-06 16:41:06 -08:00
Terje Bergstrom
fa3f8cc101 gpu: nvgpu: Remove circular dependency in PMU includes
Remove including gk20a.h from pmu_gk20a.h. This causes a fallout
as some #includes were missing.

gr_gp10b.h uses mem_desc, but did not include mm_gk20a.h. Add the
include.

Including mm_gk20a.h in gr_gp10b.h causes recursive include, as
mm_gk20a.h has some gr defines. Move the defines to gr_gk20a.h to
remove the dependency.

gr_ctx_gk20a.h used struct gk20a pointers, but did not forward
declare it. Add a forward declaration.

gr_gk20a.h uses dbg_session_gk20a, but was missing forward
declaration.

gr_gk20a.h did not include nvgpu.h but it uses preemption types from
that header. Add include.

Change-Id: I2168e2303b55e0d187b816bcb26f37c8af1649ba
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1283717
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
2017-01-27 10:53:25 -08:00
Deepak Nibade
b11cc77414 Revert "Revert "gpu: nvgpu: gp10b: fix freq rounding""
This reverts commit 28fb1de00a.

Instability on Quill-B00 is now resolved, and hence restore
original patch reviewed on http://git-master/r/#/c/1284302/

Bug 1864117
Bug 1863013

Change-Id: Ie5aa5a5f0184f3aa4db2d08f041f623de92b3dea
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1291513
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2017-01-25 02:41:03 -08:00
Deepak Nibade
74948b73e3 Revert "nvgpu: gp10b: remove EMC floor when GPU Fmin"
This reverts commit c58da17d13.

With original patch, we request 0 emc for minimum GPU
frequency, and this causes instability on Quill-B00

Hence revert this patch

Original patch : http://git-master/r/#/c/1284572/

Bug 1864117
Bug 1863013

Change-Id: I45aadba4614286f04b29a5abb7432d03d99ed6c1
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1291512
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2017-01-25 02:41:03 -08:00
Mihir Thakkar
bbc2342331 gpu: nvgpu: Debug spew for context priority & Gfxp
Prints out Timeslice value, Interleave level, Graphics preemption
mode and compute preempt mode along with chid, tsgid, pid.

Enable it with setting dbg_mask with 8192

Bug 1855710

Change-Id: I60efef9810587f8fedd4e2ba62ba67d06d84faea
Signed-off-by: Mihir Thakkar <mthakkar@nvidia.com>
Reviewed-on: http://git-master/r/1287141
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-24 14:06:06 -08:00
Laxman Dewangan
9e5208f634 drivers: gpu: nvgpu: Use soc/tegra/fuse.h for fuse header
The fuse headers are unified and moved all the content of
linux/tegra-fuse.h to the soc/tegra/fuse.h to have the
single fuse header for Tegra.

Use unified fuse header soc/tegra/fuse.h.

bug 200260692

Change-Id: Icab3ba5c3dbcd3fa831455c2f336942d356ff5ac
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1287498
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-19 00:04:59 -08:00
Deepak Goyal
fbc713e22a nvgpu: gp10b: Use gops to call pmu_bootstrap().
gops should be used to call non-secure pmu boot
functions instead of using direct func() names.

JIRA GV11B-30

Change-Id: I27da3b84b61eb978965ae9325ba58e2d02bc6ede
Signed-off-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-on: http://git-master/r/1282552
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:46:55 -08:00
Deepak Goyal
a69fa0e96c nvgpu: pmu: Use ops to get PMU queue HEAD/TAIL.
pmu_queue_head() & pmu_queue_tail() are updated
to use gops to include chip specific PMU queue
head/tail registers.

JIRA GV11B-30

Change-Id: I9c3d6a4601ba2767f9ada95642052044e2b79747
Signed-off-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-on: http://git-master/r/1283266
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:46:50 -08:00
Alex Waterman
6e2237ef62 gpu: nvgpu: Use timer API in gk20a code
Use the timers API in the gk20a code instead of Linux specific
API calls.

This also changes the behavior of several functions to wait for
the full timeout for each operation that can timeout. Previously
the timeout was shared across each operation.

Bug 1799159

Change-Id: I2bbed54630667b2b879b56a63a853266afc1e5d8
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1273826
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:46:33 -08:00
Alexander Van Brunt
28fb1de00a Revert "gpu: nvgpu: gp10b: fix freq rounding"
This reverts commit 157ff622f3.

Bug 1863013

Change-Id: I38abeb4ff729d9d7b9a7e8dc2fde708f8ace6feb
Signed-off-by: Alex Van Brunt <avanbrunt@nvidia.com>
Reviewed-on: http://git-master/r/1287613
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Tested-by: Juha Tukkinen <jtukkinen@nvidia.com>
2017-01-18 13:24:02 -08:00
Deepak Nibade
157ff622f3 gpu: nvgpu: gp10b: fix freq rounding
In gp10b_round_clk_rate(), we right now return next
higher freq value than requested if requested value
matches a value in the table

Fix this by adding a right comparison

Bug 200194487

Change-Id: Ia99abfe4b247701d5ee1cda26b3ffcc18efba353
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1284302
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2017-01-17 07:11:32 -08:00
Mahantesh Kumbar
c8d82d465c gpu: nvgpu: HAL to query LPWR feature support
HAL to query LPWR feautre's RPPG/MSCG support
based on current pstate configured.

JIRA DNVGPU-71

Change-Id: I58a34c6dca68e3eb76e222bd781578bf682eac34
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1283916
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
2017-01-16 04:53:38 -08:00
Cyril Raju
c58da17d13 nvgpu: gp10b: remove EMC floor when GPU Fmin
Remove EMC floor when GPU frequency is Fmin. At Fmin,
we most likely require a very low memory bandwidth.
At Fmin on load, actmon should sufficiently scale EMC
and hence not bottlenecking GPU.

Bug 1850297

Change-Id: I98b9dae648ea28910d534a9286ce2e9e91ea5fec
Signed-off-by: Cyril Raju <craju@nvidia.com>
Reviewed-on: http://git-master/r/1284572
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-13 16:44:01 -08:00
Alex Waterman
865514be2d gpu: nvgpu: Move gp10b HW headers
Move the gp10b HW headers to a new directory specially for them:

  include/nvgpu/hw/gp10b

And change the code to include like so:

  #include <nvgpu/hw/gp10b/hw_fb_gp10b.h>

This is part of the process to restructure the nvgpu driver.

Bug 1799159

Change-Id: Ic80ea5b7f5c280839e502e2178a345181f7a7ef9
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1280326
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-11 12:44:14 -08:00
Mahantesh Kumbar
f3e0dba8bf gpu: nvgpu: pg stat read update
- Added struct pmu_pg_stats_data to extract
data from multiple version of pmu pg statistics

- Added pmu_pg_stats_v2 interface to fetch
PG statistics data from PMU

- Added MSCG debugfs node to read mscg
statistics from PMU.

- Added pmu_elpg_statistics HAL support for
  gp106 PG statistics read.

- Made changes to gp104/gp106
  pmu_elpg_statistics HAL to support
  for struct pmu_pg_stats_data

JIRA DNVGPU-165

Change-Id: I2b9e89c0fae90deb45006c4478170b9a97b56603
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1252798
(cherry picked from commit 3c073b15fd991db8d65b3171b02c161294be40cd)
Reviewed-on: http://git-master/r/1271615
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-10 09:24:06 -08:00
Deepak Nibade
5d4ba0a6d8 gpu: nvgpu: round clock locally
In gp10b_round_clk_rate(), we currently call
clk_round_rate() to round the clock rate for us

But since the frequency table is prepared
using the frequency values supported in h/w,
we can round the rate locally using the table

Bug 1827281

Change-Id: I85d034326539590352badceb4164aa5d89ee8842
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1280630
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-06 09:13:59 -08:00
Deepak Nibade
b5c6aebe7a gpu: nvgpu: select N'th freq from all available frequencies
We right now get min and max frequencies, and then
interpolate rest of the frequencies.
With this approach, we do not select exact
frequencies as supported by h/w

Fix this so that we query all supported frequencies
using clk_round_rate() and then select every N'th
frequency to keep number of frequencies under limit

Use GP10B_FREQ_SELECT_STEP (currently set to 8)
to configure frequency selection step

Raise GP10B_MAX_SUPPORTED_FREQS to 200 since h/w
supported frequencies could be in that range

Bug 1827281

Change-Id: Id8678d7a0280a249e4affbba084ff2e33b6694e6
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1280629
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-06 09:13:59 -08:00
Terje Bergstrom
ea5a214722 gpu: nvgpu: Implement SET_RD_COALESCE
Implement SW method SET_RD_COALESCE to implement correct handling
of texture read coalescing.

Bug 200223870

Change-Id: Icd6f987b72d78e5add4076fc550e2070eba70628
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1271303
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
2017-01-05 09:13:30 -08:00
Deepak Nibade
2aa3c85f8e gpu: nvgpu: skip setting preemption modes if already set
In gr_gp10b_set_preemption_mode(), skip setting anything
if both graphics and compute preemption modes are
already set

Bug 200263471

Change-Id: I2788464750835da8f6396c6c1ca8356a63758c80
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1275465
GVS: Gerrit_Virtual_Submit
Reviewed-by: Lakshmanan M <lm@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2016-12-27 15:26:53 +05:30
Mahantesh Kumbar
76a18f5e76 gpu: nvgpu: PG statistics update
- PG statistics read support for multiple engines

JIRA DNVGPU-71

Change-Id: I2dc3aad243300d21dc3d20a54a5e4736977e071b
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1250507
(cherry picked from commit 985cb3be1d6d990bc6651e417d9e6ba9bfe306e0)
Reviewed-on: http://git-master/r/1270991
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-27 15:26:53 +05:30
Mahantesh Kumbar
e5824d8014 gpu: nvgpu: MSCG support
- update gp106 pg engine init/list/features HALs
  to support MS engine
- Added defines & interface for lpwr tables read  from vbios.
- lpwr module which reads idx/gr/ms table from vbios to
  map rppg/mscg support with respective p-state
- lpwr module public functions to control lpwr
  features enable/disable mscg/rppg & mclk-change
  request whenever change in mclk-change parameters
- lpwr public functions to know rppg/mscg support for
  requested pstate,
- added mutex t prevent PG transition while arbiter
  executes pstate transition
- nvgpu_clk_arb_get_current_pstate() of clk arbiter to
  get current pstate

JIRA DNVGPU-71

Change-Id: Ifcd640cc19ef630be1e2a9ba07ec84023d8202a0
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1247553
(cherry picked from commit 8a441dea2410e1b5196ef24e56a7768b6980e46b)
Reviewed-on: http://git-master/r/1270989
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-12-27 15:26:53 +05:30
Mahantesh Kumbar
62d13e6138 gpu: nvgpu: RPPG support
- Added rppg module to init GR/MS-RPPG.
  mscg is dependent on gr-rppg & without
  gr-rppg engage mscg does not engage.
- Update pg engines HAL to return supported
  pg engines & its sub features

JIRA DNVGPU-71

Change-Id: Ib0fd2d79b509f6f2f1dabae6e2b5aebcc80b5691
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1247486
(cherry picked from commit 86e45fa62e6a6b295f73c0173f0117ae9f78a5e9)
Reviewed-on: http://git-master/r/1270762
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-27 15:26:53 +05:30
Deepak Nibade
8f8ee32cd6 gpu: nvgpu: use common API to write TPC fuses
Use common fuse write API tegra_fuse_control_write
which should work on all kernel versions

Bug 200262155

Change-Id: I29e8514e9660549ecf94711287ec4bbf4c897a86
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1270169
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-12-27 15:26:52 +05:30
Deepak Nibade
1710bdb078 gpu: nvgpu: allow upgrading preemption modes
We currently do not allow resetting preemption
modes once set

Relax this check to allow upgrading preemption
modes. Downgrading of preemption modes is still
not allowed

Bug 200263471

Change-Id: Ie2dae910028929090899a661f4b8b9dd4d6d7ee7
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1269472
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-27 15:26:52 +05:30
Mahantesh Kumbar
fd2b0a4860 gpu: nvgpu: update pg engine init/list/features HAL
- Updated gp10b_pg_gr_init() to post init param based
  on PG engine parameter
- Assigned pg engine list/features HAL to respective
  functions/NULL

JIRA DNVGPU-71

Change-Id: I7d059796746694b22800c6ae0327cbc90331e929
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1247407
(cherry-picked from commit aee4e565ca2b475c0680674e4e6345b3b30cc502)
Reviewed-on: http://git-master/r/1269321
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-27 15:26:52 +05:30
Terje Bergstrom
206a5c2d39 gpu: nvgpu: Remove FB ISO CG from init list
Remove FB ISO clock gating register from initializion list. The
register does not exist on GPUs without own memory.

Change-Id: I86a8c8050baad88a99029771511363f2a1d44341
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1265297
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
2016-12-27 15:26:51 +05:30