Commit Graph

2903 Commits

Author SHA1 Message Date
omar
2e847dac66 drivers: pva: default exe_id2 to noop
default exe_id2 to noop in case og gen1 and gen2 pva.

Bug 4342102

Change-Id: Id1af21808244f128088338ad5895520adcc27f32
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3002613
Reviewed-by: Krish Agarwal <krisha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-24 23:57:17 -07:00
Mika Liljeberg
410ff5011a firmware-api: documentation for CSI control messages
Update documentation for CSI control messages and
associated structures and definitions.

Jira CAMERASW-14050

Change-Id: Ifb3caba5e6baf11fed061ca140681167ae4268ef
Reviewed-on: https://git-master.nvidia.com/r/c/tegra/camera/firmware-api/+/2996915
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3000437
(cherry picked from commit 39b92ef64169d84967a848f4d558ac0f32239669)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3002146
Reviewed-by: Pekka Pessi <ppessi@nvidia.com>
Reviewed-by: Harri Kaimio <hkaimio@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-24 23:53:41 -07:00
Mallikarjun Kasoju
644f308d71 scsi: ufs: Enable PA to VA enable control
Enable UFSHC_PA_VA_CTRL bit for ISC Fabric to consider
virtual memory when SMMU is enabled.

If UFSHC_PA_VA_CTRL is not set, ISC Fabric considers ufs
allocated memory as physical address.

Bug 4243018
Bug 4199052
Bug 4334121

Change-Id: Ia557ea510673f19f59d23ac704b068050f5e355e
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3000988
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-24 23:50:46 -07:00
Johnny Liu
1b6da7e345 gpu: host1x: Enable actmon interrupt for OFA
To support interrupt-driven DFS, we need to enable actmon interrupt for
OFA.

Bug 4310958

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I0615ad4b28bb6d4bc6cd666eb354901f294f6173
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3001885
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-24 14:00:56 -07:00
Johnny Liu
a4afff1535 drm/tegra: Register OFA as a devfreq device
Unit actmon is used to realize dynamic frequency scaling for OFA.
Therefore, registering OFA as one of devfreq devices to expose frequency
controllability to userspace.

Bug 4310958

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I6a74f4b4ae54f014091549fa7f6df94c9a9c99ef
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3001884
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-24 14:00:41 -07:00
Manish Bhardwaj
e8c5cb610a vsc: use max supported ioctl size
target is getting crash while triggering multiple
ioctl call from userpsace due to miscalculation
of mempool_virt and mempool_offset for each slot.
So use max supported ioctl size macro instead of
max supported read and write operation size.

Bug 4336445

Change-Id: I438ff50cb0dfba845f4d7852e74314c66dab196c
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3001185
Reviewed-by: Kasinadha Dendukuri <kdendukuri@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Tested-by: Tonny Liang <tonnyl@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-24 13:46:24 -07:00
Jeremy Alves
b8fca78022 Lan743/6.1 include nvidia specific changes
Updating Lan7431 nvidia-oot driver for kernel 6.1
to include NV specific changes

Include changes from:
    https://git-master.nvidia.com/r/c/linux-nv-oot/+/2924162
    https://git-master.nvidia.com/r/c/linux-nv-oot/+/2932422
for userland phy and SC7 support

Bug 4330040
Bug 4270736

Change-Id: I20e052f24757d0ac17501906b267bc746c3d43d2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3000975
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-10-22 03:23:41 -07:00
Akhil R
7cf41996cb crypto: tegra: Free CMAC fallback tfm during exit
Free the CMAC fallback tfm to fix the memory leak during CMAC operation.
The fallback tfm is setup during init but never freed.

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Change-Id: Icb9ccf330f94e93459c241ed7105a221832c0514
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2998701
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-22 03:23:04 -07:00
Mika Liljeberg
1d58216b05 firmware-api: capture message documentation
Updated documentation for VI capture channel messages and
associated structures and definitions.

Added preconditions to all control channel response messages
and clarified the descriptions a bit.

Added @brief tag to message descriptions.

Jira CAMERASW-14052

Change-Id: I40ae468b3317eee22ac08d577460e263fecc3c92
Reviewed-on: https://git-master.nvidia.com/r/c/tegra/camera/firmware-api/+/2984899
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993569
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3000506
Reviewed-by: Pekka Pessi <ppessi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 17:09:34 -07:00
Mika Liljeberg
71fe53031f firmware-api: fix kernel patch validation issues
Fix some warnings and errors raised by kernel patch validation
and correct some divergence from firmware-api.

Jira CAMERASW-16411

Change-Id: If3ce65b5996d73620d0a730e91a24a4114b7ffd5
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993559
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3000505
Reviewed-by: Pekka Pessi <ppessi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 17:09:29 -07:00
Johnny Liu
1a32649b75 drm/tegra: Support client get_rate for OFA
When actmon reports the client usage information, it will call the
get_rate callback provided by the client, and divide the number of
sampled active clock cycles from the actmon counter register with the
current client rate to determine the client usage value.

Bug 4338396

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I5e3f69b8ed1d90407fe0b8202e7c9cde75a0dd30
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3000330
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:33:31 -07:00
Johnny Liu
cbde6ba274 gpu: host1x: NULL check before get_rate
Avoid calling get_rate function pointer when it is not supported by
the client driver.

Bug 4338396

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Iee7f26865d82235de7a5b41347546c1195a7ea48
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3000315
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:33:26 -07:00
abhinayaa
f2653ba797 drivers: pva: Update desc checks for DIM3
When ECET is set to DIM3, descriptor validation should happen as
follows:
 - when SW sequencing is used, or the HW sequencing mode used is
   "descriptor addressing", both ns1 and nd1 should be positive
 - In all other cases, ns1 may be 0, nd1 must be non-zero and greater
   than or equal to ns1.
Update descriptor validation checks accordingly.

Bug 4245426

Change-Id: Ie6ae7e79fd5ea9b5a1345300c6eca5f8b5d283ec
Signed-off-by: abhinayaa <abhinayaa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2988527
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999161
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:26:16 -07:00
abhinayaa
40bb8da496 drivers: pva: Update HW SEQ config and ADB size
- Update HW SEQ configuration for next generation of PVA.
- Add additional HW SEQ validation checks required for next
  generation of PVA.
- Update ADB size for T264

Jira PVAAS-12709

Change-Id: I8dd362f2f517bc20899d51a4bb95b8077f4c636b
Signed-off-by: abhinayaa <abhinayaa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2891026
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999160
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:26:11 -07:00
Amruta Bhamidipati
49f4109b66 drivers: pva: Fix ver check to pin HW seq buffer
While trying to pin HW Sequence buffer, ensure
that chip generation is not GEN1 since
HW sequencer is not supported only in GEN1.

JIRA PVAAS-12257

Change-Id: I3684f6a05f336aeda9be21ba783836bfaf454134
Signed-off-by: abhamidipati <abhamidipati@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2948207
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999159
Reviewed-by: Krish Agarwal <krisha@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:26:06 -07:00
abhinayaa
97f5252632 drivers: pva: Update channel and descriptor limit
Update code to account for t26x channel and descriptor limits.

Also, the reserved descriptors for all generations of PVA HW are
at indices 60-63. Update KMD checks to ensure the reserved descriptors
are never patched, and are not linked to either during SW sequencing
or HW sequencing.

Jira PVAAS-13055

Change-Id: I276490d51d65648a406fabed06c47e45d9e6978a
Signed-off-by: abhinayaa <abhinayaa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2908053
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999158
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:26:00 -07:00
Michael Chen
5d5f42c1b1 drivers: pva: Skip row/col count validation
- Skip row/col count validation for HWSEQ program.
  The changes won't affect Orin's production code.
  The current row/col count check will not work for
  multi-packet scheme, which wil be supported in
  the near future.

Jira PVAAS-13419

Signed-off-by: Michael Chen <michaelch@nvidia.com>
Change-Id: I1c7abaf06fe82e3136c74fa20b5f3214a979300b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2935430
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999157
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:55 -07:00
Amruta Bhamidipati
ec2d04422b drivers: pva: Disable carveout for GEN3.
GSC path has not been enabled for gen3, use carveout
disabled settings by default.

Jira PVAAS-13339

Signed-off-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Change-Id: Ifc3ef8154f8ab71b529421137683fb910ccdaac7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2941708
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999156
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:50 -07:00
abhinayaa
5b58a2eb15 drivers: pva: update app auth for GEN3
For now, disable authetication of VPU application in GEN3 by default.
To run a system application, enable authentication using debugfs.
When this is done, all apps will be treated as system apps. This
is needed for MODS testing.

Jira PVAAS-13056

Change-Id: I01fa3bcc73784c97894393f942fdbf94b179e45c
Signed-off-by: abhinayaa <abhinayaa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2937052
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999155
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:45 -07:00
abhinayaa
6f71647c9f drivers: pva: Update descriptor validation check
When ECET is set to the third dimension, we need to ensure that at
least one of source or destination repetetion factors is not zero.

Bug 4202128
Jira PVAAS-13054

Change-Id: I86447ff20f5d264aede14146b5fdba377a253eb6
Signed-off-by: abhinayaa <abhinayaa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2914428
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999154
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Krish Agarwal <krisha@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:40 -07:00
Krish Agarwal
6c013840f0 drivers: pva: add support for exe_id2
- update submission path to accept exe_id2
 - submit additional bin info to FW

JIRA PVAAS-12334

Change-Id: Ie7b314c4cf76ecfdabd40de05a9b9f1e3d3cc049
Signed-off-by: Krish Agarwal <krisha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2860864
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999153
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:35 -07:00
Krish Agarwal
e4fc743b3b drivers: pva: rename exe_id to exe_id1
- rename exe_id in pva_submit_task to exe_id1
 - rename exe_id in nvpva_ioctl_task to exe_id1
JIRA PVAAS-12334

Change-Id: Ieba0b6b8ac3e8af8ab3340dadabdfe64df4831ea
Signed-off-by: Krish Agarwal <krisha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2874243
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999152
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:30 -07:00
Amruta Bhamidipati
ce5e1eadbb drivers: pva: Update DMA desc patching
When BL format is used, address-bit 39 needs to be set
only for T23x and older generations to indicate XBAR_RAW
swizzling is required.

Bug 4190882

Change-Id: I51805c9636bae8d3dec83b02e0665a4eb9657406
Signed-off-by: Amruta Bhamidipati <abhamidipati@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2935382
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999151
Reviewed-by: Krish Agarwal <krisha@nvidia.com>
Reviewed-by: Michael Chen (SW-TEGRA) <michaelch@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:25 -07:00
Amruta Bhamidipati
827c90d801 drivers: pva: Add polling for mailbox interrupts
Support polling on mailbox ISR and AISR status registers
when interrupts are disabled.

Change-Id: I58a65d47a9ff9269f641edf3d97dc8cebc41a521
Signed-off-by: Amruta Bhamidipati <abhamidipati@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2929381
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999150
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:20 -07:00
Amruta Bhamidipati
b2381d6aec drivers: pva: Add support for next chip
- PVA initialization and programming sequence update for next chip.
- Update to VMEM regions and addresses.

Signed-off-by: Amruta Bhamidipati <abhamidipati@nvidia.com>
Change-Id: I25b0fae260c516d5a7521aabc994a87525555577
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2925454
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sreehari Mohan <sreeharim@nvidia.com>
Reviewed-by: Krish Agarwal <krisha@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999149
Tested-by: Omar Nemri <onemri@nvidia.com>
2023-10-20 01:25:15 -07:00
Niranjan Dighe
aaa19719df sound: safety-i2s: Add support for always-on rx/tx
Add support for keeping RX/TX always ON by using amixer commands
and to not disable clocks after playback/capture usecases finish.
This is to prevent A2B master from losing internal state.

Bug 3742979

Change-Id: I01dacaa3f54c98a7a14be101d8f0a315b006d7d8
Signed-off-by: Niranjan Dighe <ndighe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2966000
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Purvi Medawala <pmedawala@nvidia.com>
2023-10-17 18:44:37 -07:00
Shreshtha SAHU
36531e7e1d virt: tegra: tegra_hv: print total IVC and mempool memory usage
bug 4115385
bug 4136301

Change-Id: Idfdf1b3a45943b4da58bb7da9070825472ec3d53
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2997776
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Kasinadha Dendukuri <kdendukuri@nvidia.com>
Tested-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-17 10:01:50 -07:00
Laxman Dewangan
9a65689ba2 mttcan: tegra: Add new prod setting support
Add new prod setting support which is the
property based on device tree. The prod
setting of each register field are new property
in DT and prod configurations are configured
via these new properties.

Bug 4097475

Change-Id: I86adc7b72a28802d73fee8a085db2bccf0d6d1cc
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996771
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-14 05:56:30 -07:00
Laxman Dewangan
1e8bd7b606 qspi: tegra: Add new prod setting support
Add new prod setting support which is the
property based on device tree. The prod
setting of each register field are new property
in DT and prod configurations are configured
via these new properties.

Bug 4097475

Change-Id: Iac61ddd20ceb5b1ea588519ab031275a926f5c41
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996302
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-14 05:54:31 -07:00
Laxman Dewangan
869fff1af3 include: Organise OOT prod headers
There is two implementation of the prod setting, legacy
where driver directly get the register offset/mask/value
and upstreamable where configuration come as property of the
respective field.

The legacy is supported till K5.15 and afterwards, the upstreamable
solution is supported.

Add the dummy header incase the core kernel have not implemented
the prods and organise the oot prod accordingly.

Bug 4097475

Change-Id: Idd0e8759342c1c4ffd88df046785595aa4fab52d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996588
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:48:15 -07:00
Jon Hunter
a4334a5009 scsi: ufs: Add missing headers
When compiling the Tegra UFS driver on certain kernels the various clk
and udelay functions are not found. Add the corresponding headers to fix
the build.

Bug 4221847

Change-Id: Ief2f20abf3704ab7c61c5c802e9eb2ec201179c7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996210
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:47:12 -07:00
Jon Hunter
e83aa807d4 scsi: ufs: Depend on CONFIG_SCSI_UFSHCD
If CONFIG_SCSI_UFSHCD is not enabled, then the Tegra UFS driver fails to
build because the various ufshcd_xxx functions are not exported by the
kernel. Update the Makefile to only build the Tegra UFS driver is
CONFIG_SCSI_UFSHCD enabled.

Bug 4221847

Change-Id: Ie0eb3773f245981a6afcc8bf5a684c193307179d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996209
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:47:07 -07:00
Jon Hunter
7f53d7ba3e nvidia-oot: Add options to disable drivers
In Linux v6.2, the Tegra IVC driver was updated to support iosys-map and
this breaks building some of the out-of-tree drivers for Linux v6.2+
kernels. In Linux v6.3, the GPIO OF APIs were removed and this breaks
building some of the out-of-tree drivers that use these legacy APIs. For
now the broken drivers are not built for these corresponding kernels.

Instead of checking the kernel version in the Makefile for the
corresponding broken driver, move the kernel version checking to the
top-level Makefile and add CONFIG definitions that can be used the
various Makefiles.

This is also needed for working with 3rd party Linux kernels that may
have upstream backports and need to set these CONFIG variables for their
Linux kernel.

Bug 4221847

Change-Id: I35ee59bccdcdb1be56e4680c453279b421692c6a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996215
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-13 15:46:10 -07:00
Jon Hunter
4e8ed5f7b7 firmware: tegra: Add support iosys-map support for IVC
Linux v6.2 update the Tegra IVC driver to use iosys-map and this broke
support for the IVC EXT driver. Update the IVC EXT driver to support
iosys-map if the kernel supports this version of the Tegra IVC driver.

Bug 4221847

Change-Id: I1f1ddb1cc4312cb2359373b53287c110831b473c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996208
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:45:59 -07:00
Ketan Patil
5c59fead46 video: tegra: nvmap: Fix data race
Consider the following execution scenario, it can lead to a data race

Thread 1                    Thread 2
-------------------------------------------------------
NvRmMemHandleAllocAttr
NvRmMemGetFd
NvRmMemHandleFromFd         close(fd), NvRmMemHandleFree

When thread 1 is executing NvRmMemHandleFromFd while thread 2 is closing
the fd and freeing the handle, then following sequence will lead to
accessing a freed dma-buf and may lead to dereference issue.

- TH1: Get handle from fd and increment handle's refcount.
- TH2: Close the fd and start execution of NvRmMemHandleFree.
- TH2: Decrement ref's dup count, it will become 0, hence ref would be
freed and dma-buf as well, but as handle's refcount is incremented in
step 1, handle won't be freed.
- TH1: Resume HandleFromFd part, call to nvmap_duplicate_handle. Ref is
already freed, so generate new ref and increment dma-buf's count but as
dma-buf is freed already, accessing dma-buf will lead to dereferene
issue. Hence, we need to add a null check here and return error value in
such scenario.

Also, add check for return value of nvmap_handle_get, at missing places.

Bug 4214453

Change-Id: Ib6ef66b4a7126bef2ed1dbb48643445a4ded1bab
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994962
(cherry picked from commit 7ba6a3abfe65f7cffeeb4004cf0868468121fc32)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994440
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:38:16 -07:00
Viswanath L
383e589822 nvadsp: Enable IOVA paths in driver
Enable driver paths that allocate IOVA memory for
ADSP OS and shared memory, where memory is required
at a fixed address.

Bug 4164138
Bug 3682950

Change-Id: I16563e14aefbcd55cc6455f88c1689664846c689
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988130
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 07:57:21 -07:00
Ankur Pawar
6038bd9e6c platform: tegra: rtcpu: use upstream icc API
Use devm_of_icc_get() in rtcpu base and debug driver.
CONFIG_TEGRA_T23X_GRHOST, CONFIG_TEGRA_ISOMGR,
CONFIG_TEGRA_BWMGR are not enabled in K5.15 so cleanup
tegra_camera_platform driver.

Don't read memory-bw from rtcpu dt, set it to max
during probe.

Bug 3997304
Bug 4311411

Change-Id: Ib76b3338749de5d33e13cd518375a6b55dd17f5b
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2899021
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 07:55:59 -07:00
Akhil R
3926014666 crypto: tegra: Fix coverity and CERT C defects
Fix the following coverity defects.

ID 10181328, CID 687742 - Uninitialized variable
ID 10181331 - Dead code
ID 10181330, CID 687711 - Uninitialize variable
ID 10181332 - Potential overflow
ID 10181329 - Wrong data type

Bug 3952896
Bug 3959323

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Change-Id: I62064ee9b0cef4ad78a1aa4980637fcd3df682d6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2995805
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-12 20:38:15 -07:00
Jon Hunter
59b14ea0b8 ASoC: tegra: Avoid kernel version checks
Rather than using kernel version checks to determine which kernel APIs
to use, add the necessary tests to the conftest script to determine
which kernel APIs are present in the kernel.

Note that the function snd_soc_dai_init_dma_data() has been present
in the Linux kernel since v3.13 and so use this for all kernel versions.
In Linux v6.3, the 'playback_dma_data' and 'capture_dma_data' members of
the snd_soc_dai_driver structure were replaced and so these could no
longer be set directly. However, the arguments to
snd_soc_dai_init_dma_data() have not changed and so can be used for
older kernels and well has the current.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: Ibac0c6bab78e93f03981dfe3d1b2025ea19d4c92
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993795
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-12 20:29:24 -07:00
Jon Hunter
5ec164e7c3 ASoC: tegra: Only compile drivers if ASoC is enabled
When compiling the out-of-tree audio drivers against a kernel that does
not have CONFIG_SND_SOC enabled, the build fails because the various
snd_soc_xxx functions are not exported by the kernel. Update the
out-of-tree Makefile to only build the Tegra ASoC drivers if
CONFIG_SND_SOC is enabled. Note that CONFIG_SOUND is enabled if
CONFIG_SND_SOC is enabled so it is not necessary to check for both.

Bug 4221847

Change-Id: I7a55e18324baa229d715fa0831df919502e2a3d3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993768
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-12 20:29:14 -07:00
Jon Hunter
86fece401a thermal: pex9749: Use conftest
Rather than using kernel version checks to determine which kernel APIs
to use, use the definitions generated by the conftest script which
determines which kernel APIs are present in the kernel.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: I160c74224c582cc3b3a327544fc16b021226d54a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993808
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-12 20:29:09 -07:00
Jon Hunter
f6e070f87e spi: aurix: Use conftest
Rather than using kernel version checks to determine which kernel APIs
to use, add the necessary tests to the conftest script to determine
which kernel APIs are present in the kernel.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: I159cd7d5feca050c8a8014d9c2a3b43e8974fdfd
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993807
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-12 20:29:04 -07:00
vasukis
610533a15d tegra: hwpm: Add HWPM-NVDEC registration mechanism
- Add support to extend NVDEC IP for HWPM profiling.

DOS-SHR-7601

Change-Id: I93efd02b348829c33d9ba90cfc39b8b824f64347
Signed-off-by: vasukis <vasukis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983398
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-12 20:13:26 -07:00
Jon Hunter
35ac3d9d5e block: virtual-storage: Drop version checks for flags
In Linux v5.17, the GENHD_FL_EXT_DEVT and GENHD_FL_NO_PART_SCAN were
removed and in Linux v5.19, the flags QUEUE_FLAG_SECERASE and
QUEUE_FLAG_DISCARD were removed. Rather than using kernel version
checks, simply check if the flag is defined. This is beneficial for
working with 3rd party Linux kernels that may have backported changes
from upstream.

Although the Tegra virtual-storage can be compiled for v5.19 kernels, it
still needs to be fixed properly for v5.19 kernels. Add some dev_WARN
prints to warn if these flags are not supported so that it will be clear
that this is not expected to work.

Bug 4119327
Bug 4311184

Change-Id: I7f7585b238ad45b26fb1d0df42b338c904ce87e7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2992552
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-12 17:27:02 -07:00
Mika Liljeberg
635466f751 firmware-api: capture ISP control MSG documentation
Update documentation for ISP capture channel control messages and
associated structures and definitions.

Jira CAMERASW-14051

Change-Id: I0f10470132b727520e278aaa3b2573f93d4053f1
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/tegra/camera/firmware-api/+/2982815
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988970
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994202
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:17:24 -07:00
Mika Liljeberg
1eb3b03e5f firmware-api: capture control MSG documentation
Update documentation for capture channel control messages and
associated structures and definitions.

Jira CAMERASW-14048

Change-Id: I525eca545eef64eb8fceac14480348b2dd173d1c
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/tegra/camera/firmware-api/+/2980882
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988969
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994201
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:17:19 -07:00
Mika Liljeberg
4e0255fbae include: soc: tegra: fix divergence to firmware-api
Fix minor differences to firmware-api that can cause conflicts
when propagating changes to kernel headers.

Jira CAMERASW-15815

Change-Id: I23239a246cdae69a8818a6ed0e2e8d23ee337f10
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988968
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994200
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:17:14 -07:00
pripatel
f7c66766b7 firmware-api:changed macro definition
Change is done to resolve
AUTOSAR C++14 M5-0-10 violations

Rule: AUTOSAR C++14 M5-0-10
Rule description : If the bitwise operators ~ and << are
applied to an operand with an underlying type of unsigned
char or unsigned short, the result shall be immediately cast
to the underlying type of the operand.

JIRA CAMERASW-12899

Change-Id: Ide1491e00094299d3785dbb1cd3366a043b3de0e
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/tegra/camera/firmware-api/+/2933961
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988965
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988977
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:17:09 -07:00
Mika Liljeberg
4e8871bdef include: soc: tegra: define tag for trace console
Define a new TLV tag for combined trace and console support.
Deprecate unused CAMRTC_TAG_NV_CAM_TRACE tag.

Bug 3898176

Change-Id: I0d6d586dd1a82d6f95a12b22b6e9bd96000efe7e
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2845583
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988964
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988976
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:17:04 -07:00
Mika Liljeberg
e69d77ec71 firmware-api: add commands for I2C over HSP
Add command specifications for RCE I2C HSP protocol.

Jira CAMERASW-1404

Change-Id: I17cbe234371140934b04e3a9683aa1cbc7d5ef91
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/tegra/camera/firmware-api/+/2701487
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988962
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988975
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:16:59 -07:00