Commit Graph

3352 Commits

Author SHA1 Message Date
Ankur Pawar
1c517ab4d5 camera: fix the kernel freeze after driver unbind
Kernel freeze is occurring due to incorrect cleanup
in vi5.c.

Fix for kernel freeze:
1 Don't call vi_channel_drv_unregister() and
  tegra_vi_media_controller_cleanup() in vi5_remove.
2 capture_vi_probe() is calling vi_channel_drv_register() and
  tegra_capture_vi_media_controller_init(), so capture_vi_remove()
  should call vi_channel_drv_unregister() and
  tegra_vi_media_controller_cleanup()
3 Use correct dev pointer in vi_channel_drv_unregister().

Code cleanup:
1 Remove use_legacy_path variable that was used for T186.
2 Removed unused t194_vi5_file_private struct.

Bug 4415340

Change-Id: I7a75d90e1d2a1fb78a6a5b083a66836b1723156c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3077660
cherry-picked from <29e88ed17e757c0129a54a3fb44990cec4a33983>
Signed-off-by: Ankur Pawar<ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2936745
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-27 20:30:14 -08:00
Ankur Pawar
41762524a3 media:i2c: fix ar1335 control command
When ar1335_common.c was ported to K5.15 it was refactored
based on the review comments. During that process index
in mcu_send_ctrl_cmd() was set to 0xFFFF which was causing
issue in setting sensor format. Pass the index from the
caller of mcu_send_ctrl_cmd().

Bug 4389285

Change-Id: Ic84a8de58051fe947f0f4d6597d1a55bc29ef9e6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3024535
cherry-picked fom <7096cb09a537bb6385489bc93148b80ff5e8fdd9>
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2848593
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-27 20:30:09 -08:00
Brad Griffis
aaee95a8eb nvidia-oot: Update OOT driver path
The installation path for the OOT drivers has been updated from 'extra'
to 'updates'.

Bug 4410785

Change-Id: I54c8ce97cb1b159095b9dc3450ef0af711eb7f9b
Signed-off-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3069039
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-24 05:24:07 -08:00
Jon Hunter
eee13a1edb drivers: Drop '-next' from driver names
The OOT variants of the host1x and tegra-drm drivers originally had
a '-next' suffix in the name to differentiate these from the upstream
versions. Now that the OOT drivers are installed under the 'updates'
directory, the '-next' suffix can be dropped because 'kmod' will
prioritise loading the variant in 'updates' over those built from the
kernel tree.

Bug 4410785

Change-Id: I29287ddb935b681a5ee8a3326428eba82715da76
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3065465
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-24 05:24:02 -08:00
Preetham Chandru Ramchandra
4008be04b4 cpuidle: tegra: Explicitly call pm_system_wakeup
During SC7 resume sometime wakekey interrupt is not generated even
if wake key is pressed.
So explicitly call pm_system_wakeup() which causes the system
to resume from SC7.

Bug 4449600

Change-Id: I8582ef22fb456f7b26b13515bce5e4874191b713
Signed-off-by: Preetham Chandru Ramchandra <pchandru@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3079822
Reviewed-by: Bhavesh Parekh <bparekh@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bhavesh Parekh <bparekh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-23 14:54:54 -08:00
Sameer Pujar
1d0f4c4ffc Revert "ASoC: tegra: use upstreamed AHUB drivers"
This reverts commit 363a679975.
This is done to unblock gvs intermittency of audio test and
kernel warning test failure.

Bug 4508166

Change-Id: I99e2b879c7ba1c7987d859b4ae9fce0ea317e41e
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3082636
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Shubham Chandra <shubhamc@nvidia.com>
2024-02-23 08:27:14 -08:00
Sameer Pujar
00c10d965b Revert "ASoC: tegra: Remove legacy AHUB OOT drivers"
This reverts commit 289095dfc6.
This is done to unblock gvs intermittency of audio test and
kernel warning test failure.

Bug 4508166

Change-Id: I989c0467fb5f2d962fb980085a1652df892128f6
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3082635
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
2024-02-23 08:27:03 -08:00
Ashish Mhetre
ed7a856cf7 video: tegra: nvmap: Take refcount on device during map
When a dma_buf is getting mapped, take refcount on that device which
will is released when dma_buf is unmapped.
The device should be alive till all its buffers are unmapped.

Bug 4402923

Change-Id: I3ad257f5bdd7e705ac94bea6e81fef0fda46fbd2
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3079901
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-22 15:46:16 -08:00
Krish Agarwal
2664f7f2b7 pva: drivers: prevent program of scr regs for gen3
Since power management is not supported on pre-
silicon platforms on GEN3 avoid programming
registers with lock bit enabled.
Bug 4500579

Signed-off-by: Krish Agarwal <krisha@nvidia.com>
Change-Id: Id4c2352d32a38e3e3408e54e38df3d5f723a4d20
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3077879
Reviewed-by: Sreehari Mohan <sreeharim@nvidia.com>
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-22 15:44:47 -08:00
Kartik
5676a53a5b soc/tegra: fuse-helper: Add __tegra_get_chip_id()
Various OOT drivers require Tegra chipid to identify the SoC they are
running on.

Add helper function __tegra_get_chip_id() which use soc_device_match()
to identify the SoC chipid on which the kernel is currently running.
Loadable drivers/modules can use this to read the chipid.

Bug 4416828

Change-Id: I6bdb95ed579b3ade9314468abb0ccc749af7bb89
Signed-off-by: Kartik <kkartik@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3078383
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Tested-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-20 18:53:49 -08:00
Viswanath L
19c895951f nvadsp: Use helper function __tegra_get_chip_id
tegra_get_chip_id() API is not exported from core kernel,
so use __tegra_get_chip_id() from fuse-helper.h instead.

Bug 4416828
Bug 4164138
Bug 3682950

Change-Id: Ieb6fde256c9fd7b5dfbd6975a030536834042cc5
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3078396
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-20 18:53:43 -08:00
Sameer Pujar
289095dfc6 ASoC: tegra: Remove legacy AHUB OOT drivers
Most of the AHUB module drivers are already upstreamed and there are
alternate ways to have the same feature parity with the legacy OOT
drivers. Thus there is no need to maintain the legacy OOT drivers
going forward. This commit removes all AHUB drivers which are already
in upstream and the same have been enabled as a default choice for
Terga234 and later chips.

Removal of OOT versions of upstreamed drivers resulted in following
build errors:

  - AFC, IQC and machine driver include "tegra210_ahub.h". Due to
    the removal of AHUB driver, the header is not found. It is found
    that there is no actual dependency for these drivers on the AHUB
    header.

    Fix this by just removing the header inclusion.

  - ARAD driver has dependency on ASRC driver for few helper functions.
    Upstream ASRC driver does not expose these helpers yet, because
    these are only required by ARAD module and all of these should go
    together for upstream.

    Fix this build error by guarding the header 'tegra186_asrc.h'
    under macro 'CONFIG_SND_SOC_TEGRA186_ASRC_WAR'. The helper function
    calls in ARAD driver are guarded under the same macro and this macro
    is not enabled. This may leave ARAD broken with upstream ASRC driver
    which is fine since there is no ARAD productization yet and this
    will be taken care in bug 4432184.

Bug 4451662
Bug 4432184
TAS-2251

Change-Id: I5aa9ee1ae5ce58f3db8910f7e940dd2980da163a
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3074654
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: Sheetal . <sheetal@nvidia.com>
Reviewed-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-by: Aditya Bavanari <abavanari@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-20 18:40:09 -08:00
Sameer Pujar
363a679975 ASoC: tegra: use upstreamed AHUB drivers
There is plan to use OOT machine driver with upstream AHUB drivers
as a first step in alignment with upstream drivers. The machine driver
will be taken up after this.

To allow usage of upstream AHUB drivers, make following changes:

  - Update OOT PCM override driver to work with codec2codec links
    as well. Note that PCM override controls in the module drivers
    were rejected in upstream and it is one of the major differences
    between upstream and OOT AHUB drivers.

  - Register dummy DAI to use with I/O DAP DAI link. Exposure of
    dummy DAIs was not encouraged in upstream from the I/O module
    drivers. The codec2codec I/O links require a codec to be present.
    Hence expose dummy DAI from machine driver and use the same in
    I/O DAI links.

Bug 4451662
TAS-2251

Change-Id: If6904073eca29167620bf5d273cdcd306196f6ba
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059819
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-20 18:40:04 -08:00
Yash Bhatt
2101eb3050 tegra: nvmap: Clean-up OOT NvMap
Remove macro-protected dead code. NVMAP_LOADABLE_MODULE enables NvMap as
an OOT module, while NVMAP_UPSTREAM_KERNEL is a config for kstable/OOT
kernel. For Kernel 5.10+ both are always defined, So the related macro
protected code can be safely removed.

Bug 4479135

Change-Id: If3d32533f26f5928bd3ef7066bddba1505b77614
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3079649
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-20 05:31:57 -08:00
Yash Bhatt
67dec54ef3 tegra: nvmap: Clean-up OOT NvMap
Remove macro-protected dead code. NVMAP_LOADABLE_MODULE enables NvMap as
an OOT module, while NVMAP_UPSTREAM_KERNEL is a config for kstable/OOT
kernel. For Kernel 5.10+ both are always defined, So the related macro
protected code can be safely removed.

Bug 4479135

Change-Id: I8e1bf930b15dfc8411d833383fb3eae2778edfe3
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3079522
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-20 05:31:16 -08:00
Yash Bhatt
25bc2a3b96 tegra: nvmap: Clean-up OOT NvMap
Remove macro-protected dead code. NVMAP_LOADABLE_MODULE enables NvMap as
an OOT module, while NVMAP_UPSTREAM_KERNEL is a config for kstable/OOT
kernel. For Kernel 5.10+ both are always defined, So the related macro
protected code can be safely removed.

Bug 4479135

Change-Id: I792f1cb2c54fd21bcf0e73ffc52e46e4efd47862
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3079420
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-20 05:31:05 -08:00
Yash Bhatt
7393789444 tegra: nvmap: Clean-up OOT NvMap
Remove macro protected deadcode which is not applicable now

Bug 4479135

Change-Id: I11939a9d549158952dee3c37de4189ada9e8a9b8
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3077715
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-17 15:54:32 -08:00
Yash Bhatt
0f3210ddb5 tegra: nvmap: Clean-up OOT NvMap
Remove macro protected deadcode which is not applicable now

Bug 4479135

Change-Id: I8c9740943fdda7b841ef56d72cb6550b76cdaacd
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3077561
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-17 15:54:27 -08:00
Yash Bhatt
89fc0fe787 tegra: nvmap: Clean-up OOT NvMap
Remove macro protected deadcode which is not applicable now

Bug 4479135

Change-Id: Id15fec351a7c43064b48ba608640b3ede86035be
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3077485
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-17 15:54:17 -08:00
Yash Bhatt
27feea2ec8 tegra: nvmap: Clean-up OOT NvMap
Remove macro protected deadcode which is not applicable now

Bug 4479135

Change-Id: I2643406a3daaadf047e6793d4a6cc353c9729f69
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3077463
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-17 15:54:12 -08:00
Yash Bhatt
37e4db0ddb tegra: nvmap: Clean-up OOT NvMap
Remove macro protected deadcode which is not applicable now

Bug 4479135

Change-Id: Ibcf155e19b0a9eb5a2d06fa7486e93e1a51769e6
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3077338
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-17 15:54:06 -08:00
Yash Bhatt
3516ab0f77 tegra: nvmap: Clean-up OOT NvMap
Remove macro protected deadcode which is not applicable now

Bug 4479135

Change-Id: I51408f04171e5dc2c34a47755c853aa705cc4cd8
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3077840
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-16 10:28:33 -08:00
Mikko Perttunen
e062e9d49c gpu: host1x: Memory context stealing
Currently, each process holding an open TegraDRM channel reserves
for itself one of the limited number of hardware memory contexts.
Attempting to allocate a channel when all contexts are in use
results in failure.

While we cannot have more contexts than the hardware supports in
active use, idle channels don't necessarily need to have a backing
memory context. As such, in this patch, we add another layer
to allow hardware memory contexts to be "stolen away" by channels
that are in active use, from idle processes.

The way this is implemented, is by keeping track of memory
mappings on each abstracted memory context. If we need to
steal that memory context's backing hardware context, we unmap
everything from it and give it away. When that abstracted
memory context is needed again (re-activated), we attempt
to allocate or steal another hardware context and re-map
the previously unmapped buffers.

Unfortunately, this means additional overhead and unpredictability
at submit time. Submit can fail if we cannot re-allocate a
backing memory context. Future work includes a provision for
un-stealable backing hardware memory contexts for processes
requiring more determinism, as well as optimization and cosmetic
improvements.

Bug 4403250
Bug 4399310

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I3d13e3476f1bff3c4757152254496cddaaafd76a
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3058905
Reviewed-by: Santosh BS <santoshb@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-16 03:04:44 -08:00
Jon Hunter
7e85d429e7 drm/tegra: Don't print error on probe defer
The following error messages are sometimes observed on boot ...

 tegra-nvjpg 15380000.nvjpg: failed to get icc write handle
 tegra-nvdec 15480000.nvdec: failed to get icc write handle
 tegra-nvjpg 15540000.nvjpg: failed to get icc write handle
 tegra-nvenc 154c0000.nvenc: failed to get icc write handle
 tegra-vic 15340000.vic: failed to get icc write handle
 tegra-nvjpg 15380000.nvjpg: failed to get icc write handle

The above messages are harmless because the ICC core is returning
-EPROBE_DEFER to indicate that the ICC provider is not available. When
-EPROBE_DEFER is returned the kernel will attempt to probe the device
again and so print an error on -EPROBE_DEFER can be misleading. Fix the
above by using the function dev_err_probe() to print error messages
because this function will only print an error message if the error code
is not -EPROBE_DEFER.

Bug 3436156
Bug 4496044

Change-Id: I47b77e5a0f2bdb817a832daa305246c8803f456b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3075237
(cherry picked from commit 61319aef4d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3075849
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-13 20:11:45 -08:00
Stefan Kristiansson
76261f8ace bpmp: ABI headers update
abi@f6a0c4b

Change-Id: I556badc159c867d4e80cf9214ee4837574d0692b
Signed-off-by: Stefan Kristiansson <stefank@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3071497
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
2024-02-09 04:32:49 -08:00
Ahmad Chaudhry
6b403012fb drivers: only build rtk bt driver for non-ack
Realtek bluetooth driver is not used in ack and
causes build issues in ack builds.
Subsequently, only build realtek blutooth
driver conditionally if build is not ack

Bug 4476460

Signed-off-by: Ahmad Chaudhry <ahmadc@nvidia.com>
Change-Id: I2d26cc04f466ce51179dff51f14ee1ce73084990
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3069246
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-09 04:32:28 -08:00
Karthik SM
b5a59cfff2 kmd: Program 4 SCR from KMD in L4T case
- MB2 cannot program SCR values because PVA is poweredoff
- In L4T, KMD programs some of these SCR registers

Bug 4450663

Change-Id: I8a6fb7cf9c61ad30e9182f520e0122ea8ad49acc
Signed-off-by: Karthik SM <kmaheshwarap@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3068906
Reviewed-by: Arvind Prasad <arvindp@nvidia.com>
Reviewed-by: Mohnish Jain <mohnishj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-09 04:32:23 -08:00
Karthik SM
23b905c159 pva kmd: Program SCR GR registers from PVA KMD
This change programs PVA_PROC_SCR_PROC_0 and
PVA_SEC_SCR_SECEXT_INTR_EVENT_0
to its PROD values from PVA KMD.

Bug 4450663

Change-Id: I8960a3c228cc67a7d8925d14bf2440aa8629b1d6
Signed-off-by: Karthik SM <kmaheshwarap@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059388
Reviewed-by: Reshma Prabhu <rprabhu@nvidia.com>
Reviewed-by: Bhushan Patil <bhushanp@nvidia.com>
Reviewed-by: Mohnish Jain <mohnishj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
(cherry picked from commit f809201c7d57b714bc341ce435d39071ff3503e1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3068126
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-07 17:43:43 -08:00
Karthik SM
d4443f6037 kmd: Update PVA SCR values in standard build
- MB2 cannot program SCR values becuase PVA is poweredoff
- KMD cannot access these registers because they are not mapped for VM
access
- Hypervisor programs these registers but KMD needs to trap for PVA
reset usecase

Bug 4450663

Change-Id: I9e6bfdfbc09650a2b7fea0e7a10702a971bc38f4
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059459
Reviewed-by: Bhushan Patil <bhushanp@nvidia.com>
Reviewed-by: Karthik Srirangapatna Maheshwarappa <kmaheshwarap@nvidia.com>
Reviewed-by: Mohnish Jain <mohnishj@nvidia.com>
Tested-by: Karthik Srirangapatna Maheshwarappa <kmaheshwarap@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
(cherry picked from commit 2880d777f303602f72b7a7d1a6348d8272aa8238)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059488
Reviewed-by: Sai Vishal Pothula <spothula@nvidia.com>
2024-02-07 17:42:34 -08:00
Viswanath L
5713bc51b0 nvadsp: Use dynamically allocated shared mem
Upstream kernel does not export IOMMU APIs, so use dynamic
memory allocation for shared memory in non-secure boot mode.

Move stale code that uses IOMMU APIs under macro
CONFIG_IOMMU_API_EXPORTED. As remapping allocated IOVA to a fixed
address is no longer possible, IOVA cannot be used for OS memory;
reserved physical memory may be used in its place.

Dynamic memory allocation for shared memory will be selected if
ACSR_ADDR in "nvidia,adsp_mem" DT property is set to 0.

Bug 4416828
Bug 4164138
Bug 3682950

Change-Id: I9ea5626a14457818f2adff69610562e824f7fdda
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3067154
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-07 17:39:04 -08:00
Viswanath L
f0f463b06b nvadsp: Move dynamic app support under macro
Move all code for dynamic app support under macro
CONFIG_ADSP_DYNAMIC_APP.

Also use devm_kzalloc in place of kzalloc to avoid
compiler warnings.

Bug 4416828
Bug 4164138
Bug 3682950

Change-Id: Ia0528f983b81d205caedb993bd72b03bcd8ba39d
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3046858
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-07 17:38:35 -08:00
koenz
77f9756fb4 driver:misc:mods: Increase max mods SMMU devices to 32
- More tested IPs require alloc memory through SMMU

Bug 4467535

Signed-off-by: Koen Zhao <koenz@nvidia.com>
Change-Id: I41ac88d01ecbe640082ba4c70607cb701ad4f3f5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3067676
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-06 09:26:05 -08:00
Prathamesh Shete
8b4674420e BT: deprecate support for of_gpio calls
deprecate support for of_gpio calls
use devm_gpiod calls instead

Bug 4387902

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Change-Id: Ic81b5cf11a32f014f02290e2a7c84c50a3e26d6c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3043616
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jian-Min Liu <jianminl@nvidia.com>
2024-02-06 09:22:49 -08:00
Johnny Liu
a662c74302 video: tegra: remove icc request in system resume
When dla resumes back from system sleep, it should not send any
bandwidth request through ICC framework since it is in idle state.

In the job submit path for dla, nvhost will try to wakeup the device
through nvhost_module_busy, and the associated runtime resume callback
is called in the dla driver. This is the time dla driver should send
bandwidth request to BPMP for bandwidth allocation through ICC
framework.

Bug 4478515

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ie4b5cfad6593bd058860ee3be467d6a2384f1b5d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3067369
(cherry picked from commit 246e62b38e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3067689
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-03 02:24:23 -08:00
Manikanta Maddireddy
fc47fbceba PCI: Fix PCIe Endpoint device IDs
PCIe device ids 0x229a and 0x229c belongs to Root port, so this driver
is binding instead of pcieport. Tegra PCIe Endpoint production device ids
are 0x1ad4 and 0x1ad5, correct the device ids accordingly.

Bug 4477934

Change-Id: Ia86c4dcc6b4527e984a473c941713ef58dd6f74d
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3067109
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-02 04:21:13 -08:00
Asha Talambedu
2337fafd34 nvadsp: Extend to support AON DSP
- Added num_irqs to chip data structure and modified enum to
  suit the driver to both AON and ADSP
- Added num_regs to chip data and modified reg bank enum
  to suit both AON and ADSP
- Added chipdata variable to indicate if amc is not available or
  relevant
- Modified aram_exit to execute only if aram size is not null
- Avoid passing fw name for registration as it currently passing "APE"
- WFI status check logic is dsp specific. Hence separated out into
  new API
- Mapping mbx interrupts is specific to AON. Hence added platform device
  specific API to map the shared interrupts
- Avoided empty interrupt spamming for level triggered interrupts.
  This fix does no harm even for edge triggered interrupts

Bug 4165898

Change-Id: I99cf03c06ed5d290e067b4fd3569febadbda607a
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3035268
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-01 13:48:18 -08:00
Jon Hunter
5d2c7b6e3a nvhost: Remove legacy NVHOST support
Remove the legacy NVHOST support from the nvhost.h file that is no
longer needed. Eventually we will remove this file completely, but it is
currently still needed as it provides a shim layer for working with the
upstream host1x driver.

Bug 4475969

Change-Id: Id4d97b41de2590800e321e4eeb9c03b434e00dc5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3065976
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-31 21:27:07 -08:00
Jon Hunter
4c229ee929 video: tegra: Remove nvhost and host1x headers
The nvhost.h header in the ISP and VI drivers is a copy of the nvhost.h
header in the main top-level include directory. Remove these and use the
version in the top-level include directory.

Finally, remove the host1x.h header file that is not used at all.

Bug 4475969

Change-Id: I78133231203ee7eb2dc41eee7b8895ba9ce50e02
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3065975
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-31 21:27:02 -08:00
Jon Hunter
73a4985dbd video: tegra: Don't use nvhost_get_private_data
The function nvhost_get_private_data() is a wrapper around the Linux
platform_get_drvdata() function. To remove all the legacy nvhost code
that is no longer supported or needed, update the camera drivers to use
platform_get_drvdata() directly. Note that there are places in these
drivers that already use platform_get_drvdata() and so this change makes
these drivers more consistent.

Bug 4475969

Change-Id: Ie474c46c438f69c2141f41d0702bf57525597ab5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3065974
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-31 21:26:51 -08:00
Jon Hunter
072a881099 media: camera: Remove of_pwm_n_cells usage
The 'of_pwm_n_cells' has been removed from the pwm_chip structure in the
latest linux-next development branch that will eventually become Linux
v6.9. This parameter was used in function 'of_pwm_xlate_with_flags'.
The camera CDI and ISC drivers don't use the kernel's
of_pwm_xlate_with_flags xlate function and instead implement their own
xlate function. Therefore, it is safe to simply drop the usage of the
'of_pwm_n_cells' parameter completely in these drivers.

Bug 4471899

Change-Id: Id4cf4b7ac182d0654080e536457bab1a7128ad1d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3063806
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-31 21:25:42 -08:00
Krish Agarwal
85a51ae063 pva: drivers: include gen3 apps in sys allowlist
Jira PVAAS-14477

Signed-off-by: Krish Agarwal <krisha@nvidia.com>
Change-Id: I40b8de4e875b33fda1fb3b8226867fefe1a293ec
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3061864
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-31 05:10:39 -08:00
Ian Grissom
426eaddac9 misc: mods: update from Perforce
Change-Id: I12e626024579fa86ab2f79068bb57e9f41746e8a
Signed-off-by: Ian Grissom <igrissom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989905
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-27 18:25:07 -08:00
Laxman Dewangan
288de33b62 tegra_hv: Fix missing headers for Linux v6.8
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.

Bug 4448428

Change-Id: I19a0d9003aa655d12c8ae50131f15a6ee4cc59f8
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3063634
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-27 03:12:34 -08:00
Ketan Patil
d5207547eb video: tegra: nvmap: Take lock before reading dmabuf's refcount
As mentioned in previous gerrit patch 3021442, it is necessary to take a
lock before reading dmabuf's refcount and also check for both dmabuf and
dmabuf->file. This was not done in trace related code, update the code
to take care of this.
Also, add a function remove_handle_ref for removing the handle ref from
client's handle_ref rb tree.

Bug 4404709

Change-Id: Ic93536015f17a265c3dccbea8ce45c6b45af2fc2
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3046839
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-26 00:21:00 -08:00
Laxman Dewangan
932f9757ab misc: nvscic2c-pcie: Drop usage of enum pci_epc_irq_type from Linux 6.8
The enum pci_epc_irq_type is dropped from Linux 6.8 with
commit 74955cb8ccc385 ("PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions")
Use alternative definition from mainline.

Bug 4448428

Change-Id: Ic248ee2522f171c311ac1086c2792bcf3ad6ed64
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3062520
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-25 17:26:42 -08:00
Laxman Dewangan
6533bf9268 misc: nvscic2c-pcie: Fix missing headers for Linux v6.8
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.

Bug 4448428

Change-Id: Ic40e43c99ff1a7f5c4b7a7c3ab525e6e046c452b
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3062519
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-25 17:26:37 -08:00
Viswanath L
dfc42d66a1 nvadsp: Add field in chip data to send boot config
Introduce a new field 'adsp_boot_config_hwmbox' in chip data
for passing boot config to ADSP, replacing the existing
method of writing chip_id into hwmbox1.

The new field presently encodes adsp_os_secload flag. This
may be useful for firmware to do specific settings based on
boot mode, e.g. do AST settings if boot is in non-secure mode.

Bug 3682950

Change-Id: I51e5e0c8f15a8160247a7febb50998defec13d42
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3052180
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-01-25 17:03:55 -08:00
Jon Hunter
ab65399274 drivers: Fix missing headers for Linux v6.8
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.

Bug 4448428

Change-Id: Ia40ab13f865d5631c96855ecc49145848f99c996
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032442
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
2024-01-25 09:11:21 -08:00
Jon Hunter
0899829704 misc: mods: Fix headers for Linux v6.8
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.

Bug 4448428

Change-Id: Ifb484189524a3ec86aa252e71b4489f4dba5aacd
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059458
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
2024-01-25 09:11:16 -08:00
Jon Hunter
ecf383265b drivers: Don't use strlcpy()
For Linux v6.8, the function strlcpy() has been removed. The function
strscpy() was added in Linux v4.3 and has been preferred over strlcpy().
See upstream Linux commit 30035e45753b ("string: provide strscpy()") for
more details. The Linux checkpatch.pl script warns against using
strlcpy().

The function strscpy() takes the same arguments as strlcpy(), but
returns a type of ssize_t instead of size_t. Update the drivers to use
strscpy() instead of strlcpy().

Bug 4448428

Change-Id: Id6f196f0e81decf1545f9aa4f74f5c63a7f72a48
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059457
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
2024-01-25 09:11:11 -08:00