nvadsp_da_to_va_mappings API provides the ability to get the virtual
address from the physical address. This API does not need to be exposed
as there are no other modules using it and prevent prevent speculative
load related leak.
Bug 200381256
Change-Id: Ic94497ca40402101e4246b914f00e030551b0c4c
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1652771
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This reverts commit baa2e9cd86a446e085091494be4247d2a4b64a33
since it causes ADSP tests to fail on T18x and T19x
platforms.
Bug 2057870
Change-Id: Ibfc1ec5dfcd678bf608598edc1f118a452d072e3
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1651935
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
adding ability for ADSP to share data when an exception occurs
on the ADSP. The data is shared through the shared memory across
the host.
adding shared exception data prints on host side for debugging.
bug 1868578
Change-Id: I6645e8ae6ab73e5c9df8374f583dacbed4615536
Signed-off-by: Prateek Patel <prpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1611260
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Update all Kconfig files and Makefiles to rely on the kernel overlay
feature. In particular, don't include any Kconfig files or Makefiles
from other overlays. -I directives in CFLAGS are not yet cleaned up.
Bug 1978395
Change-Id: I425d37d55f8ea61fb3a082a1504f994ff30cec03
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1561187
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Select ARM_GIC_PM by default as K4.9 nvadsp driver needs
GIC PM feature. For K4.4 there is no dependency and no such
config so it will be ignored.
Bug 200325731
Change-Id: I05735a7f5e2ae6f31df6938a45b89dc83150c7ec
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537419
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Rename Makefile and Kconfig as Makefile.nvidia and Kconfig.nvidia
respectively. This is done to allow use of downstream nvadsp
driver in kernels like K4.4, K4.9, etc.
Bug 200325731
Change-Id: I96269398089700677bdf919519295f80b40e7848
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537418
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
GVS: Gerrit_Virtual_Submit
With adma driver as module, following compilation error is seen
"undefined reference to tegra_adma_dump_ch_reg".
In the current patch, adsp code exports a function to set regdump
function call back. This function is used by adsp audio driver to
set the function pointer to tegra_adma_dump_ch_reg. This is done
in tegra210_adsp_init().
Bug 200289390
Reviewed-on: http://git-master/r/1483001
Change-Id: I1ef259cf3b988a41720fb6706d39d9bd6f86aac3
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
(cherry picked from commit 36ccba1262928a6ce8b0f4fff1d4ad2591c4305d)
Reviewed-on: https://git-master.nvidia.com/r/1528158
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537339
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Add checks for adsp os running state in adsp_override_freq()
and update_freq(). If adsp os is not running state then
communication with ADSP for freq update will not work. This
could result in failure in updating ADSP CPU frequency.
Bug 200295526
Bug 200322504
Change-Id: Iea25f542b080ac22faf562f35e82ceede43bbc83
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1526340
(cherry picked from commit 2aea120c7c1385e14f36e5fa707594e3ab6e2294)
Reviewed-on: https://git-master.nvidia.com/r/1527565
Reviewed-on: https://git-master.nvidia.com/r/1537337
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Making the "WFI wait" from interruptible to non-interruptible. This is
done because there is a probalbilty between the thread making a call to
nvadsp_os_suspend / nvadsp_os_start getting signaled or having a
pending signal before ADSP enters WFI and the CPU getting the WFI
interrupt.This results in wait_for_completion_interruptible_timeout()
returning -ERESTARTSYS, due to which nvadsp_os_suspend treats it as
failure although ADSP has entered WFI and the WFI interrupt has been
received on the CCPLEX.
Since this is a race it is not seen often.
Also, reducing the timeouts for WFI and logger wait to 800 and
500 ms respectively. The timeouts have been reduced because during
suspend there are only a few register writes and logger has been
reduced from 1 MB to 16 KB.
Bug 200317530
Bug 1893324
Change-Id: I40b3894f284763c0e4cc45647e1adf2cd074d701
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1517838
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537335
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Instead of using mailbox to communicate change in adsp cpu
freq, update it in adsp os args from ccplex-adsp shared
memory. This adsp freq update is needed by EDF scheduler
for scheduling EDF threads. The EDF scheduler gets
current adsp freq from shared memory instead of
scheduler callback.
However, for APE1 (i.e. chips = T21x), timer prescalar
must still be updated through mailbox each time adsp cpu
freq is changed.
Bug 200322504
Change-Id: I26f14f5c4f5c2369d67dfcd73dc6b9664df2ca26
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master/r/1512069
(cherry picked from commit 76e8a4c19de2fa5f0d91ebefac68aa0b864cb0eb)
Reviewed-on: https://git-master/r/1512864
(cherry picked from commit 3100911879f9ea9930a515f6d55257caefcef869)
Reviewed-on: https://git-master.nvidia.com/r/1517749
Reviewed-on: https://git-master.nvidia.com/r/1537334
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Dump mailbox queue, if it's not empty, when mailbox
is getting closed.
Also, change errornos in mailbox APIs such that those
are unique in that function.
Bug 200295526
Change-Id: I69e83146c049bb51d7cac5e954183c6c7cc97956
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/1496890
(cherry picked from commit dec73d1e0ab5c6ccddf043bd4ae7ce65d1d478e2)
Reviewed-on: https://git-master/r/1513587
Reviewed-on: https://git-master.nvidia.com/r/1537331
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Dump name (first 4 chars) of current thread and irq
number of last interrupt handled from hwmbox reg 4 and 7
respectively.
Bug 200295526
Change-Id: I4b53521cbfece2177e3cf6ed80b559b58e1d1c0a
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/1475487
(cherry picked from commit 64a799ae7d8e8f8783212fb4c28209cf760b38a7)
Reviewed-on: http://git-master/r/1478825
(cherry picked from commit cab60f6977fc8070e4206db01e2a2d444860c90c)
Reviewed-on: https://git-master/r/1513585
Reviewed-on: https://git-master.nvidia.com/r/1537329
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
The state of ADSP is logged by writing to a mailbox
register. Adding support to kernel driver to dump ADSP
state when crash happens.
Jira EMA-404
Bug 1901511
Bug 1893324
Bug 200239577
Change-Id: Ia2beb84a7d5bc871f7062bd6a661333af0b0e24d
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: http://git-master/r/1229864
(cherry picked from commit 0027e7a51f6134b4a7b332c17f7c7c26ac727ebc)
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537327
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
The request irqs are moved just before starting ADSP and freed when
adsp is suspended/stopped.
This is since the new agic driver is based on a device-driver model
and requires all interrupts to be freed before it could suspend.
Bug 200270956
Change-Id: I8ecd05ebe52020f11be79b9a1da37a85fed432ac
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/1478838
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537326
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Fix following sparse warnings by including header dev-t21x.h, which
has function declarations, in dev-t21x.c.
dev-t21x.c:284:5: warning: symbol 'nvadsp_pm_t21x_init' was not declared.
Should it be static?
dev-t21x.c:296:5: warning: symbol 'nvadsp_reset_t21x_init' was not declared.
Should it be static?
Bug 200299572
Change-Id: I5f16da0852ab9083fba7395cfbd66ec012014663
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: http://git-master/r/1474440
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537325
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Enable FIQ when ADSP driver is enabled.
An FIQ interrupt is a highest priorty interrupt and used
when ADSP crashes to put ADSP in WFI.
The ADSP needs to be put in WFI, so that all transcations on the
bus are completed.
Bug 200270956
Change-Id: Ifb177ba9e0486ff7b4761d95f68b09265510c55f
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/1468503
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537324
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Decrease the size of app message(send/receive) queue from 16KB
from 4096 bytes. This is to reduce the foot print of adsp.
Decreasing size of ADSP log buffer from 1MB to 16 KB.
This helps reducing the amount of memory used by ADSP.
Based on:
platform: nvadsp: Decrease size of app msg queue
platform: nvadsp: Reduce the size of adsp logger
Bug 1774702
Bug 200270956
Change-Id: I3b4b5d28d2fe05ad9fe2b1247327497ca63767fe
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/1468350
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537320
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
When ADSP OS is loaded from adsp.elf, it loads two sections : adsp os
and the vector table. The vector table is copied to a local buffer
before writing to the EVP registers.
There is a probability that, if the adsp.elf is hacked / modified by
an attacker, it can write to other APE register spaces. Hence, the
destination address obtained from the elf is checked with evp base
before copying.
Also, this fixes out of array-bound writing to evp buffer.
Bug 1684844
Change-Id: I8981dc5a5db8e0c0653ff46a1576df2c82e420be
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/1118936
(cherry picked from commit 9f7120e03e66b5f6e2bf67f09063da20945be238)
Reviewed-on: http://git-master/r/1458894
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1537317
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit