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
The RTCPU driver has a dependency of the following kernel modules:
clk-group
device-group
reset-group
Rather that builds all these source files as individual drivers, which
is bloating the number of kernel modules required, compile these source
files into the main RTCPU kernel module.
Finally, remove any unneeded header files from the ivc-bus driver.
Bug 4078936
Change-Id: I0981a716db7a91556d8c00a291b81dec01dda2e3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890896
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Current mc-utils driver is specific to T234 without any support for
extending it to future SOCs. Add such support so that it can be easily
extended for future chips.
- Create a struct of function pointers of all present operations
- Set these function pointers as per SOCs
Bug 4090660
Change-Id: I93e9da987bce1e563eb03aeeb0ac8bcb9da48023
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2911894
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Actmon DFS for EMC has been moved to BPMP side. This driver simply reads
the exponential moving average counter register of the MC_ALL client and
export the value in the sysfs node to let tegrastats read the
utilization value of the EMC.
Bug 4041434
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I2b7e6592094d27c47f738fc26ee9091ea209f630
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2912315
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In absence of bl_debug_data parameter passed from Bootloader, value of
tegra_bl_debug_data_start will be 0.
This triggers a kernel panic on systems where parameter is not specified
and the module is loaded.
Fix this by first checking tegra_bl_debug_data_start and
tegra_bl_debug_data_size before accessing them.
Also add a check upfront to check if mandatory bootloader parameter
tegra_bl_prof_start is passed or not. If this parameter is not passed,
bail out the driver initialization.
Bug 3996651
Change-Id: Ibb78d6cefdae1f79ecb09836b833899deacb03ce
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2900710
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
CERT-C is reporting following issue:
- Casting cvsram_slice_data[1] from unsigned int to int without checking
its value may result in lost or misinterpreted data.
Fix this by changing the data type of slice_size.
CID 490074
Bug 3745813
Change-Id: Ic52fd016798310b69da69247a6eb2d7a626a4146
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2828530
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
In function nvcvnas_power_off casting nvcvsram_readl from unsigned int
to int without checking its value may result in lost or misinterpreted
data. Fix this by changing data type of val to u32.
CID 427418
Bug 3512545
Change-Id: I8be65b1ca73270a4a0d76380207078da745c7057
Signed-off-by: Sagar Gulab Patil <sagargulabp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2747340
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
In function nvcvnas_probe casting cvsram_slice_data[0] from unsigned
int to int without checking its value may result in lost or
misinterpreted data. Fix this by changing data type of variable.
ID 490074
Bug 3512545
Change-Id: Ia9f141f14a540f9c2c436bf605d4aec8f3489fb5
Signed-off-by: Sagar Gulab Patil <sagargulabp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2738506
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
When cvnas driver is build as OOT module, it is required
to set the following config.
CONFIG_TEGRA_FUSE_UPSTREAM
CONFIG_TEGRA_CVNAS
Set these config when CONFIG_TEGRA_OOT_MODULE is set.
Bug 3583599
Change-Id: I8deffa609cfc7abf6c9efd69405295077649c8b1
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2715735
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
By exporting cvnas_dev all the internal data of the driver is getting
exposed to any driver that uses it. This could allow drivers to corrupt
this driver data. Hence do not export cvnas_dev, use helper functions to
get it's required member elements from nvmap.
Bug 200722684
Bug 3528414
Change-Id: I17f6fa1e98c777a7ec9118dbc6f0c6359e949f22
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2704698
Reviewed-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>