Commit Graph

439 Commits

Author SHA1 Message Date
Alex Frid
16723e5d28 gpu: nvgpu: Add GPCPLL parameters to GM20b debugfs
Bug 1555318

Change-Id: I0338e5d46c7f7d910faada0205dccf28aa62d6c2
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/594746
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2015-03-18 12:12:04 -07:00
Deepak Nibade
0e89e42318 gpu: nvgpu: force CAR reset in do_idle() for gm20b
In gk20a_do_idle(), we wait for platform->railgate_delay
to allow GPU to go into rail gate

But sometimes we set platform->railgate_delay = INT_MAX
to disable GPU rail gating but allow it to suspend during
low power state
Due to this, force_idle API fails (it waits for INT_MAX)

To fix this, allow forcing CAR reset instead of rail gating
with flag "force_reset_in_do_idle" defined in gk20a_platform
Set this flag for gm20b until we fix the railgate_delay

Bug 1517584

Change-Id: I031aa56f87d4db3727e2c3a3e5eeaf18503dd449
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/593704
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:12:04 -07:00
Vijayakumar
1d0e302b53 gpu: nvgpu: explicitly disable elcg during init
bug 200048467

Change-Id: I39f85a638b6bc97442ebf8e4a78e07c8575e4b20
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/592751
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:12:03 -07:00
Seshendra Gadagottu
48fa098ffb gpu: nvgpu: gm20b: remove duplicate regops whitelist
Manually removed duplicate entries in regops whitelist.
Once RM tools is available, then whitelist update will
happen through script.

Bug 1500195

Change-Id: I913c48365e43febcd350a9bfc73d42a27f24e2f7
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/592972
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:12:03 -07:00
Terje Bergstrom
afc470e867 gpu: nvgpu: Do not call ELPG if disabled
Do not call PMU ELPG calls if ELPG should be disabled. Also skips
initialization of PMU ucode if PMU is disabled.

Bug 1567274

Change-Id: Ia9cd3b553c358142ee05a1b0e0832f9412f7cf17
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/593335
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
2015-03-18 12:12:02 -07:00
Deepak Nibade
b3f575074b gpu: nvgpu: fix sparse warnings
Fix below sparse warnings :

warning: Using plain integer as NULL pointer
warning: symbol <variable/funcion> was not declared. Should it be static?
warning: Initializer entry defined twice

Also, remove dead functions

Bug 1573254

Change-Id: I29d71ecc01c841233cf6b26c9088ca8874773469
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/593363
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2015-03-18 12:12:01 -07:00
Seshendra Gadagottu
797e4dd319 gpu: nvgpu: cde: cancel delayed_work during suspend
During gpu suspend, cancel all pending delayed cde work
to avoid issues of scheduling this delayed work
during suspend/resume when gpu is not ready.

Bug 1574000

Change-Id: I2b6bfa489435a781dc576a077f9af01b1e1628ce
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/593557
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2015-03-18 12:12:01 -07:00
Deepak Nibade
c3661adef8 gpu: nvgpu: fix reset clock in gm20b
To assert reset on GPU, we store "gpu_ref" clock in
platform->clk[0] and use it to assert/deassert reset

But for gm20b, "gpu_ref" is no longer resettable.

To fix this, add two callbacks in gk20a_platform :
.reset_assert and .reset_deassert
Also, add a pointer "clk_reset" to store the clock
which needs to be reset

For gk20a specific implementation, we continue to
reset platform->clk[0]

For gm20b specific implementation, we first request
"gpu_gate" clock, store it and use it to assert reset

Bug 1513685
Bug 1517584

Change-Id: I15a583a4a07eb663b442084be8b8c7d0c7c7a142
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
2015-03-18 12:12:00 -07:00
Terje Bergstrom
ca95cc76bb gpu: nvgpu: Assign T18x an own platform data
Bug 1572701

Change-Id: Id135eb2328765d00349b478d695914f7f8c5edf0
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/592095
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
2015-03-18 12:11:59 -07:00
Aingara Paramakuru
938bea58ca gpu: nvgpu: vgpu: init vm->gmmu_page_sizes
vm->gmmu_page_sizes was not initialized properly in the
vgpu case, leading to gmmu map failures.

Bug 1570878

Change-Id: I16c371f65d884f59d9c9f60c7acd391b917d04ed
Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com>
2015-03-18 12:11:59 -07:00
Aingara Paramakuru
70674c2f87 gpu: nvgpu: vgpu: add PM domain support
vgpu "poweron" and "poweroff" routines now get invoked
using the PM domain callbacks, instead of the obsolete
gk20a_get_client/gk20a_put_client routines.

Bug 1570878

Change-Id: I9a5254936904f75cb3c8a14c2bf5066f919b6588
Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-on: http://git-master/r/590492
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:59 -07:00
Terje Bergstrom
f82d6e9d19 gpu: nvgpu: Regenerate HW headers
Regenerate HW headers after adding SM debugger registers.

Change-Id: Icc47c11f8e9ff52c0cf1f3a54233fb781c2c2b67
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:59 -07:00
Konsta Holtta
7784fb18a3 gpu: nvgpu: warn on nested ctx patch begin
Add WARN_ON to a critical error condition to get a backtrace dump.

Bug 200046882

Change-Id: I76c4186024547c6e89f1465612fe17f44e27eefe
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
2015-03-18 12:11:58 -07:00
Konsta Holtta
200f63ce7b gpu: nvgpu: use correct parent for sysfs remove
sysfs_remove_link's first argument expects the kobj of the directory
where the link resides, not the kobj of the link itself.

Change-Id: I89f7d681135e8eb0ff16406271cd19bf9c04f185
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/592111
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:58 -07:00
Konsta Holtta
7bb9fe2748 gpu: nvgpu: protect channel update callback access
Protect callback races from spurious gk20a channel updates by testing if
the channel update callback still exists when in the scheduled work
(instead of only when scheduling the work to the queue), and by
canceling the work when the channel is freed. Protect access to the
callback and its data by accessing them together inside
spinlock-protected regions.

Bug 200051384

Change-Id: Ib4e1571c35f662195e1dec1e362df32ddc099eb3
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/592026
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:58 -07:00
Konsta Holtta
14577a339c gpu: nvgpu: cde: list for contexts, defer deletion
Instead of current preallocated array plus dynamically allocated
temporary contexts, use a linked list in LRU fashion, always storing
free contexts at the beginning of the list. Initialize the preallocated
contexts to the list and store dynamically allocated temporaries there
too for quick reuse as needed, with a delayed scheduled work for
deleting temporaries when the high load has diminished.

Bug 200040211

Change-Id: Ibc75a0150109ec9c44b2eeb74607450990584b18
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/562856
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:58 -07:00
Terje Bergstrom
b1088fe769 gpu: nvgpu: Use generic clk_get_rate
Instead of gk20a_clk_get_rate() use the generic clk_get_rate().

Bug 1567274

Change-Id: If955790408d2f4a5d917ea3993573ac3f254c7d3
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/592094
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
2015-03-18 12:11:58 -07:00
Vijayakumar
3c6a6376de gpu: nvgpu: disable cg in mmu error handler
With CG enabled sometimes fifo could not be idled
during firmware load.

Bug 200042729

Change-Id: I43d7551c0c7c19314c52ac5f678afed8c6df6415
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/559077
Reviewed-by: Automatic_Commit_Validation_User
2015-03-18 12:11:58 -07:00
sujeet baranwal
5febd08ae7 gpu: kernel support for suspending/resuming SMs
Kernel support for allowing a GPU debugger to suspend and resume
SMs. Invocation of "suspend" on a given channel will suspend all
SMs if the channel is resident, else remove the channel form the
runlist. Similarly, "resume" will either resume all SMs if the
channel was resident, or re-enable the channel in the runlist.

Change-Id: I3b4ae21dc1b91c1059c828ec6db8125f8a0ce194
Signed-off-by: sujeet baranwal <sbaranwal@nvidia.com>
Signed-off-by: Mayank Kaushik <mkaushik@nvidia.com>
Reviewed-on: http://git-master/r/552115
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:57 -07:00
Mayank Kaushik
3d313d0657 gpu: nvgpu: gm20b: halify tpc lookup
Since the number of TPCs is different between GM20B and GK20a,
the function to look up the number of TPCs needs to be halified.

Change-Id: I19dab9a7105814f86c08c92283a0bb70abb6aa00
Signed-off-by: Mayank Kaushik <mkaushik@nvidia.com>
Reviewed-on: http://git-master/r/500064
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:57 -07:00
Mayank Kaushik
50d76e9b91 gpu: nvgpu: gk20a: regops: resident channel check
Fix the code that checks if the channel passed in for
regops is resident by also accounting for the TSG id,
if the channel is part of a TSG.

Change-Id: I449344e2887a4de4d55122f4aae5d3d4efabf725
Signed-off-by: Mayank Kaushik <mkaushik@nvidia.com>
2015-03-18 12:11:57 -07:00
Mayank Kaushik
1ee103adf3 gpu: nvgpu: create a hal function for smpc war
Create a HAL function for applying the SMPC workaround.The workaround
is only needed on gk20a, and not on gm20b.

Change-Id: I9edc741df32ab7d1dad38ecc56f238828128bfef
Signed-off-by: Mayank Kaushik <mkaushik@nvidia.com>
Reviewed-on: http://git-master/r/539187
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:57 -07:00
Kenneth Adams
aec94d8093 gpu: nvgpu: T18x support
nvgpu framework and build for T18x

Bug 1567274

Change-Id: I77835302a1110573008869d1106eface512bb9b1
Signed-off-by: Ken Adams <kadams@nvidia.com>
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:57 -07:00
Terje Bergstrom
8371833f42 gpu: nvgpu: Per-chip interrupt processing
Move accesses to MC registers under HAL so that they can be
reimplemented per chip.

Do chip detection and HAL initialization only once.

Bug 1567274

Change-Id: I20bf2f439d267d284bfd536f1a1dfb5d5a2dce4c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/590385
2015-03-18 12:11:56 -07:00
Supriya
eb690cb391 gpu: nvgpu: Changes to support LS sig
Support added to send PMU and FECS signatures
to ACR ucode

Bug 200046413

Change-Id: Ie1babb640be20a697ad4d6dd18bd11161edb263c
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Signed-off-by: Supriya <ssharatkumar@nvidia.com>
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
2015-03-18 12:11:56 -07:00
Sam Payne
8c6a9fd115 Revert "gpu: nvgpu: GR and LTC HAL to use const structs"
This reverts commit 41b82e97164138f45fbdaef6ab6939d82ca9419e.

Change-Id: Iabd01fcb124e0d22cd9be62151a6552cbb27fc94
Signed-off-by: Sam Payne <spayne@nvidia.com>
Reviewed-on: http://git-master/r/592221
Tested-by: Hoang Pham <hopham@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
2015-03-18 12:11:56 -07:00
Terje Bergstrom
4f6dddcf78 gpu: nvgpu: Allow compression on 64k pages
Allow compression always when page size matches the big page
size for the context.

Bug 1558739

Change-Id: I27b0aed06c24d69bd1555626b9affb1149536615
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/590422
2015-03-18 12:11:55 -07:00
Sami Kiminki
abfc843557 gpu: nvgpu: Fix AS IOCTL return code for failed user write
Fix return code in gk20a_as_dev_ioctl() in case of failed
copy_to_user().

Change-Id: I8b86c0dfca92c8c508006dc33673ccd926497819
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-on: http://git-master/r/590813
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:55 -07:00
Konsta Holtta
8c5b39353e gpu: nvgpu: cde: move GK20A_CDE to platform data
CONFIG_GK20A_CDE has not even been used for enabling CDE, just for
initializing it at boot time, and it was disabled; initialization has
been done late when the engine is first used. Remove the config
setting and add information about CDE support in gk20a platform data,
forcing the initialization at boot time. Boot time init removes rare
race conditions when CDE would be initialized by first user.

Bug 200046882

Change-Id: I85d5fb73dc27acbbe203138d25f6e342de030d93
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/562855
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:55 -07:00
Terje Bergstrom
2d5ff668cb gpu: nvgpu: GR and LTC HAL to use const structs
Convert GR and LTC HALs to use const structs, and initialize them
with macros.

Bug 1567274

Change-Id: Ia3f24a5eccb27578d9cba69755f636818d11275c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/590371
2015-03-18 12:11:54 -07:00
Allen Yu
23a182aaa6 Revert "gpu: nvgpu: Do not wait for FE GO_IDLE"
This reverts commit ba69a53f2f9ec055d7e61a40352bb9e73ba136be
as it's causing regression in boot stress.

Bug 200049711

Change-Id: Iacdba4d1b3739fd60c5a289d30f076f60389e453
Signed-off-by: Allen Yu <alleny@nvidia.com>
Reviewed-on: http://git-master/r/590634
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:54 -07:00
Vijayakumar
748475df20 gpu: nvgpu: gm20b: Support secure FECS recovery
When falcons are secured use PMU commands to reload
FECS firmware.

Bug 200042729

Change-Id: I09f2472b16dac6a510dba067bce3950075973d5f
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/552544
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:52 -07:00
Terje Bergstrom
4739499f07 gpu: nvgpu: Sync gk20a and gm20b headers
Synchronize gk20a and gm20b headers. All registers which were added
to gk20a are now added to gm20b, and some registers that are unused
are removed.

Bug 1567274

Change-Id: Ia3b7958c148e495cbff420ee56bb448db0f58680
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/590313
GVS: Gerrit_Virtual_Submit
2015-03-18 12:11:52 -07:00
Terje Bergstrom
b5bb4f53db gpu: nvgpu: Enable clocks only if defined
Enable clocks only if they are defined. This prevents panic in cases
where clock does not need to be enabled explicitly.

Bug 1567274

Change-Id: I7113c6d874b61acc2646effda9c02d3d1817c531
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:51 -07:00
Sami Kiminki
be48f4a451 gpu: nvgpu: Sanitize gk20a_gr_handle_notify_pending
Sanitize cyclestats portion of gk20a_gr_handle_notify_pending() a bit
and fix infinite loop and buffer overrun bugs in case of malformed
cyclestate element headers. Also, convert WARN_ON:s to gk20a_err:s for
malformed headers since they are userspace problems and not worth
kernel stack traces.

Bug 1566834

Change-Id: I69fbd85efdb042c5f0e745fac55eeff3aee0faa8
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
2015-03-18 12:11:51 -07:00
Terje Bergstrom
13ca1676ef gpu: nvgpu: Split L2 size calculation per chip
gk20a and gm20b calculate L2 size with different parameters. Split
the function for calculating size so that it does not query GPU id.

Bug 1567274

Change-Id: I09510c1bf0286c9df125d74e51df322c32bde646
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:51 -07:00
Konsta Holtta
83f3c09510 gpu: nvgpu: create cde context dynamically as needed
When the preallocated buffer of cde contexts is full, allocate a new
temporary one dynamically. This needs to create a totally new command
buffer but fixes possible but rare lockups in case of circular
dependencies. The temporary is deleted after the channel job has
finished.

Bug 200040211

Change-Id: Ic18d1441e8574a3e562a22f9b9dfec1acdf72b71
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/552036
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
2015-03-18 12:11:51 -07:00
Konsta Holtta
b564dc87b6 gpu: nvgpu: add update callback to gk20a channel
Add support for a callback function with user data pointer to be
scheduled from the end of gk20a_channel_update. The function and its
private data are supplied when opening a new channel.

Change-Id: Ib6b408855ea60d46a6a114a69c01904703019572
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/552014
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Tested-by: Arto Merilainen <amerilainen@nvidia.com>
2015-03-18 12:11:51 -07:00
Konsta Holtta
5ce4438380 gpu: nvgpu: find unused cde context instead of lru
When preparing a new job, loop initially through the small number of
preallocated contexts and try to find one that is already finished,
instead of blindly getting the next slot in lru order. If all have work
to do, select next in lru order. This reduces the possibility of a
deadlock between cde tasks.

Bug 200040211

Change-Id: Ib695c0a8e1bcec095d50ec4f2522f3aad39ce97b
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/552035
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
2015-03-18 12:11:50 -07:00
Terje Bergstrom
492b60fa2e gpu: nvgpu: Set page size for generic gpu
Default page size was made configurable. Set the page
size for generic GPU, too.

Bug 1567274

Change-Id: I7aa2762e0f542ec7de68e588afb9c51a6443b44f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:50 -07:00
Terje Bergstrom
cc8e05c215 gpu: nvgpu: Fix build without Tegra clk framework
Do not build clock code if TEGRA_CLK_FRAMEWORK is not defined. Also
make GK20A_DEVFREQ depend on TEGRA_CLK_FRAMEWORK, and build scaling
governor only if GK20A_DEVFREQ is enabled.

Bug 1567274

Change-Id: I6ea1462e7a110fb46c9d66ceda71167cff19699e
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/562475
2015-03-18 12:11:50 -07:00
Terje Bergstrom
fcf4a10799 gpu: nvgpu: VM size should be u64
VM size should not depend on CPU architecture. It should be always
u64.

Change-Id: I81539807f6674877fd04f0079b2bec05b2a0640d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/562466
2015-03-18 12:11:50 -07:00
Terje Bergstrom
4c12bbce39 gpu: nvgpu: Fix build break with no PM runtime
Bug 1567274

Change-Id: I6ca10e329a46edf859f5b22f18d0da9bc8f41cd6
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/562474
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
2015-03-18 12:11:50 -07:00
Terje Bergstrom
3446d89539 gpu: nvgpu: Add ioctl to create new TSG
Add ioctl to nvhost-ctrl to create a new TSG.

Bug 200042993

Change-Id: Icdd0edb1d9e374740ace6da9eb3a10c57c62617a
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:50 -07:00
Konsta Holtta
3f3844a11c gpu: nvgpu: select ucode boot init by signature
Compute a signature checksum for ctxsw ucode boot section and determine
the format of boot initialization data by it. This unifies gk20a and
gk20b ucode segment loading a lot by separating the bootloader loading
logic to separate functions.

Note: Whenever the boot segment binary changes, its updated signature
must be added here. Management of different bootloaders must be
supported for repo-crossing staging issues.

Bug 1519397

Change-Id: I96f9b905d3631dfdebf71ea3a652a0968615fd0a
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/556679
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:49 -07:00
Konsta Holtta
a870ff1d29 gpu: nvgpu: Remove get and put client routines
gk20a_get_client() and gk20a_put_client() routines are effectively dead
code. The GPU has been using pm_runtime for reference counting whether
the device should be turned on or off, and gk20a_get_client() and
gk20a_put_client() have had no positive effect on the behaviour.

In worst case these functions trigger some issues as they may trigger
code paths that should not be run. There is also a race between get/put
and busy/idle.

This patch removes the functions and reworks as_gk20a.c to correctly use
gk20a_busy()/gk20a_idle() where put/get was required.

Additionally, finalize_poweron() is moved to gk20a_busy(), similarly as
it was with gk20a_get_client(). If pm_runtime is not in use, the device
is only powered on and never off. Currently this affects vgpu power
management since it does not use pm_runtime yet.

Bug 1562096

Change-Id: I3162655f83457e9caccd9264eed36b5d51e60c52
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/414998
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Tested-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:49 -07:00
Konsta Holtta
23d15214ae gpu: nvgpu: allow building as a separate module
Include object files of gk20a, gm20b and vgpu in the same composite
object nvgpu.o in the top-level makefile, and remove the old makefiles.
This helps in building the driver as a separate module.

Bug 1476801

Change-Id: I93531c0f1a20e46904a429e492f8ed32e4f0c4a1
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/557971
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2015-03-18 12:11:49 -07:00
Terje Bergstrom
c1f8d68924 gpu: nvgpu: Do not wait for FE GO_IDLE
We do not need to wait for FE GO_IDLE counter to go to zero between
SW bundles.

Bug 1560770

Change-Id: I4cf53ea4e64b7244c589409d66c67ce8afb4a8d5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/558305
2015-03-18 12:11:48 -07:00
Alex Frid
09cc99d33d gpu: nvgpu: Protect GM20b clock init from div-by-0
Protected GM20b clock initialization from div-by-0 in case when safe
fmax at Vmin is not known, and the respective interface returns zero.

Change-Id: I2064a3182c93f283c7e85c247601203dd1f71af4
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/559059
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2015-03-18 12:11:48 -07:00
Alex Frid
4a43c42229 dvfs: tegra21: Rename thermal safe maximum frequency
Renamed field and function operated on thermal safe maximum frequency
to make it clear that it is fmax at Vmin (not global fmax).

Change-Id: Ie2b5234e87dc5dc03ccdaeb2916f0b776e56b640
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/559058
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2015-03-18 12:11:47 -07:00