Below changes are made to support future
extensibility for new chips:
- Chip data field 'adsp_prid' is added to specify DSP ID
- Chip data field 'adsp_elf' is added to specify ELF file name
- DT property "nvidia,cluster_mem" is added to specify cluster
internal memories; ELF segments will be loaded into these
using intermediate shadow buffers so that unaligned access
is avoided
- "nvidia,adsp_mem" entries are made optional (0x0 in the size
field will indicate bypass)
- Chip extension functions 'set_boot_vec' and 'set_boot_freqs'
are added to support chip specific settings
Bug 4164138
Bug 3682950
Change-Id: I538ae0df57fa199a6eef75441167a9a5ba6924e8
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2894321
(cherry picked from commit fa7fc9d08af5fab9d0b2c5eb1b9b9a78446ade0e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971980
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
There is a decompress_done flag in the adsp OS firmware
that was earlier used to indicate that decompress is done
at the adsp os cold boot
However this flag cannot be part of firmware
as fw needs to authenticated at the sc7 resume as well and
hence the fw should not have modifications
On fw side, the flag is removed. Instead the same information
is preserved across sc7 cycles via HWMBOX5 and this driver
enables the decompress bit to indicate the same to adsp at
cold start
Bug 3491011
Change-Id: I77d1ff6defdf1228f4cd4278cf5bb667df51fad1
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2660706
Tested-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit
ACAST settings are expected to be done by the driver in backdoor
boot. Provision is added to read the ACAST address ranges and
the SMMU stream ID from DT.
ACAST settings are done either for physical memory, or for SMMU
mapped memory, as per the backdoor boot configuration.
Also, call to ACAST init function is moved from runtime resume
to device probe.
Bug 200745795
Bug 200746669
Bug 200773359
Change-Id: Ia53820968ce4d48966c39d72b4c2106be99815fa
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2644989
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Provision is made to pass the Tegra platform information to ADSP
("nvidia,tegra_platform" DT property, as per enum tegra_platform);
this will be useful to convey whether the platform is CMODEL, in
which case the ADSP may take CMODEL specific paths, like using
HSP shared interrupts.
Upper 16 bits of nvadsp_os_args.chip_id is used to convey the
platform information; this may be improved in future as a
separate structure member.
Bug 200745795
Bug 200746669
Change-Id: Ibd9423eebb06fc4d243c132ab1cb7c6dc558ba5e
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2622156
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Add Interconnect API support for ADSP Memory bandwidth requirement
handling.
From Kernel 4.14 and beyond
- On T23X and newer platforms, the interconnects driver will be initialized
and calls to BWMGR will be stubbed out.
- On T194 and earlier platforms, BWMGR driver will be initialized and calls
to interconnect framework will be stubbed out.
Added code check with K5.9 as mc_utils.h header is present from K5.9 build
For Kernel 4.9 and earlier
- T23x will not be supported.
- T194 and earlier platforms will use BWMGR. Interconnect framework is not
available.
JIRA TAS-1060
Change-Id: Ie0b4040f374a3c6102cb7aff2506d8cf2f0eab69
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2414369
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
NVADSP driver tries to allocate shared memory for ADSP
by requesting the DMA APIs to allocate at address hardcoded
in DT. This poses an issue where if kernel has already allocated
that memory to a different driver in same iommu group, this
memory becomes unavailable and ADSP does not boot
Adding support to allocate shared memory for ADSP dynamically
to avoid dependencies on other drivers
Jira EMA-1213
Change-Id: I1bc8d49f17ec8226d34f3c943cccabef97b2afb6
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2134341
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Uday Gupta <udayg@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Niranjan Dighe <ndighe@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Change adds pm ops in nvadsp driver to support suspend/resume
functionality. Without the change, if playback/capture is active when
system suspend occurs, the nvadsp driver is never suspended and hence
the clocks are not disabled.
In terms of power sequence device driver registered as late_suspend are
suspended first followed by noirq pm ops registred devices.
adsp_audio device node is registered for late suspend. To make sure
adsp_audio suspend is called first nvadsp is registered under noirq pm
ops
Jira EMA-641
Change-Id: I3a6c3d75cbafc9e25771c4207113db1cd8066d09
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1689900
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Jinyoung Park <jinyoungp@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
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>
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
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