Commit Graph

3290 Commits

Author SHA1 Message Date
Jon Hunter
3d806c0cd2 gpu/drm: tegra: Fix support for Linux v6.12
In Linux v6.12, commit 641bb4394f40 ("fs: move FMODE_UNSIGNED_OFFSET to
fop_flags") moves the setting of the FMODE_UNSIGNED_OFFSET into the
various drivers and renames this flag. This change is causing various
tests to fail because opening the DRM device is failing.

Use the presence of the new FOP_UNSIGNED_OFFSET flag in the kernel to
determine if we need to set this flag in the Tegra DRM driver.

Bug 4876974

Change-Id: Ie72a9340187b1c206f0cda6d7e3dab44d603a41c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3269063
(cherry picked from commit a680b4881fb8e6ace46f409c33307f3bc10366a4)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3338872
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Ilies Chergui <ichergui@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ilies Chergui <ichergui@nvidia.com>
2025-04-11 14:08:53 -07:00
Ken Chang
785d9aa288 tegra-cec: poll WR_LOCK for TX data sync
After programming the TX Register, it takes 3-4 clock cycles for TX
data synchronization to the CEC core domain. The TX_EMPTY interrupt
should not be cleared until this data synchronization is complete.

Enable CEC HW feature to automatically clears the TX_EMPTY interrupt
after TX data synchronization is complete. It takes time for HW to
clear the interrupt and TX_EMPTY can still appear high, hence SW
needs to poll WR_LOCK until it goes to 0. This will avoid SW to
attempt the next TX block during the same TX_EMPTY interrupt.

Also read RX_REGISTER based on the buffer occupancy which is
indicated by the CEC_RX_BUFFER_STAT_0 register.

Bug 4954851

Change-Id: I3ec3792c9ae3b8a00c800c921cf4e4d09369e6b9
Signed-off-by: Ken Chang <kenc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322519
(cherry picked from commit 94cf6106402dc833dbaa4305c3e1a8f85fd80d0e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336992
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Prafull Suryawanshi <prafulls@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-04-11 06:40:40 -07:00
Jerry Chang
7bca2b2466 tegra: rtcpu: revise copyright
incorrect use of NVIDIA Properitary License in Linux driver code

Bug 5197152

Change-Id: Id23b8cbd4fd6315664c77d7f42014206d1ef8d5c
Signed-off-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330623
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-04-01 12:23:51 -07:00
Thierry Reding
eca775e222 gpu: host1x: Set up device DMA parameters
In order to store device DMA parameters, the DMA framework depends on
the device's dma_parms field to point at a valid memory location. Add
backing storage for this in struct host1x_memory_context and point to
it.

Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916133320.368620-1-thierry.reding@gmail.com
(cherry picked from commit b4ad4ef374d66cc8df3188bb1ddb65bce5fc9e50)

Bug 4876974

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I0a7f9c9f49a5e4580193d5814ff4a6a15f8014c8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3268196
(cherry picked from commit 027ee6a9a0b3848fbaae21c788064f59072c0978)
Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3326864
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-03-26 09:24:38 -07:00
Paritosh Dixit
8e353eecd4 bluetooth: realtek: Add option to disable driver
The RealTek drivers do not build against all Linux distributions because
some Linux distributions have back-ported upstream changes and so the
KERNEL_VERSION checks in the driver do not work for these distributions.

Add compilation flags for these drivers so that we can skip the building
of these drivers for certain Linux distributions.

Bug 5180190

Change-Id: I48101b5b9e199c6887a2cbde916d7df5ae1c53a7
Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3325283
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
2025-03-26 09:24:34 -07:00
Paritosh Dixit
f2f943a0d3 block: virt-storage: Add option to disable drivers
The tegra-virt-storage driver is currently not used for the L4T in the
rel-36 codeline. Add an option to disable building the driver. It
provides flexibility to disable the driver in case there are build
issues with 3rd-party distro kernels.

Bug 5180190

Change-Id: If58d8e782c564aa7b5229dc96093050c19882011
Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3323464
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-03-26 09:24:30 -07:00
Laxman Dewangan
1e837fca66 camera: Use conftest to find if media_entity_remote_pad() present
Use conftest to determine if media_entity_remote_pad()
function is present or not

This function is removed by commit b2e44430b634 ("media:
mc-entity: Rename media_entity_remote_pad to media_pad_remote_pad_first")
in Linux 6.0

Bug 4387902

Change-Id: I816016731ac44a3c093438310f8e60bd166f2fd7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037917
(cherry picked from commit b40e45535e)
Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322771
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
2025-03-26 09:24:26 -07:00
Akhil R
4b72ba2c83 crypto: tegra: Do not use IV for AES ECB
It may happen that the variable req->iv may have stale values or
zero sized buffer by default and may end up getting used during
encryption/decryption. This in turn may corrupt the results or break
the operation. Ensure not use IV for algorithms like AES ECB where IV
is not expected.

Bug 4883011

Change-Id: I309ad26f99fe54005ff71b270b3b115dc62ac168
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3319062
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-03-19 12:24:33 -07:00
Akhil R
15d7ca57b1 crypto: tegra: Reserve keyslots to allocate dynamically
The HW supports only storing 15 keys at a time. This limits the number
of tfms that can work without failutes. Reserve keyslots to solve this
and use the reserved ones during the encryption/decryption operation.
This allow users to have the capability of hardware protected keys
and faster operations if there are limited number of tfms while not
halting the operation if there are more tfms.

Bug 4883011

Change-Id: I220f1e8205dde1f078be6ed4cb09b699b6d5dfa2
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263283
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-03-19 12:24:29 -07:00
Akhil R
2f3c077115 crypto: tegra: Use separate buffer setkey
Use a separate buffer for setkey operation. setkey() is called
asynchronous to crypto engine APIs. This causes concurrency issues in
the tegra engine oprations.

Bug 4883011

Change-Id: I1ec7d0a041ee8a0a0bf350d2f3e9915091993034
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263282
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-03-19 12:24:25 -07:00
Brad Griffis
efeb1061bb Revert "crypto: tegra: Use separate buffer for each host1x command"
This reverts commit f6c3d49e92.

Reason for revert: Optimize implementation and align with upstream.

Bug 4883011

Change-Id: I32fe35daa30ddb5a272dbeee0c3316134e9ca55b
Signed-off-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3321697
Tested-by: Akhil R <akhilrajeev@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Akhil R <akhilrajeev@nvidia.com>
2025-03-19 12:24:21 -07:00
Jon Hunter
a2b53ade55 virt: hvc_sysfs: Fix build for Linux v6.13
In Linux v6.13, commit 94a20fb9af16 ("sysfs: treewide: constify
attribute callback of bin_attribute::mmap()") changed the type of the
'struct bin_attribute' argument of the bin_attribute:mmap function
pointer to const. Use conftest to detect if this argument is const or
not in the kernel the driver is being compiled against to fix the build.

Bug 4991705

Change-Id: I791d6c9dde50f1444d0339ebd8a18434045f9026
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261699
(cherry picked from commit fae042552e211199a160e5d6a82a67edd7b7e03c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3321698
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-03-19 10:23:57 -07:00
Jerry Chang
63a08013a0 capture-ivc: fix multi-cam race condition
add semaphore to avoid multi-cam race condition

Bug 4425972

Change-Id: I6e01ccb0596efed32ed53618ccf80c1e751b4f29
Signed-off-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3315501
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Shan Neng Chen <snchen@nvidia.com>
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Shan Neng Chen <snchen@nvidia.com>
2025-03-19 02:09:49 -07:00
Sushil Kumar Singh
dd71f62c3a nvethernet: disable HSI error reporting if EPL is disabled.
Issue:
During iperf test on pegasus board on customer observed below error periodically
nvethernet 6810000.ethernet: Failed to report error: reporter ID: 0x0, Error code: 0x1002, return: -19

Fix:
Disable HSI error reporting from hsi work queue function
for L4T platforms if safety component EPL is not supported.

Bug 4090612

Change-Id: Ifc51dd93fb16c1dbf7e42c648ca14443bb40550b
Signed-off-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2931249
(cherry picked from commit 983ddcae450c36cde9ec79433e16a4ed5aa89319)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3313872
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Tested-by: Wayne Wang (SW-TEGRA) <waywang@nvidia.com>
2025-03-10 09:51:36 -07:00
spatki
598f951b93 tsec: add firmware desc path as module fw
During SC7 tsec driver is unable to find the desc file for the
tsec fw and thus tsec boot fails. This might result into system
hang. Hence this change adds the tsec fw desc file path as the
module firmware so that the firmware is available to it during
SC7.

Bug 5053273

Change-Id: I4f2c9bb5288dac6973f574159fdebc48009edf2a
Signed-off-by: spatki <spatki@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3308515
Reviewed-by: Nikesh Oswal <noswal@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
rel-36_eng_2025-02-28
2025-02-25 04:53:52 -08:00
Narayan Reddy
b03396851a nvethernet: move err injec code to vltest
issue: HSI error injection logic is enabled by default
and is exposed as an ioctl which is a safety-related concern.

fix: move HSI error injection code only for
VLTEST build

Jira NET-1235
Bug 4449611
Bug 4910958

Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Change-Id: I4a15a40807466693ce673a3b9b00f51c077f2bd8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3078250
(cherry picked from commit e01c63215d861b6de8f4a26596a4e5e9450878a3)
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292992
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-02-07 00:24:31 -08:00
Sanath Kumar Gampa
00761e184e linux:nvidia: macsec sysfs nodes only if enabled
Issue: Accessing the macsec sysfs nodes is leading to crash when macsec
is disabled in DT

Fix: Do not create sysfs nodes if macsec is not enabled in DT. Also
update the instance_id reading as part of ether_probe which will be
executed even when macsec is disabled

Bug 4431523
Bug 4910958

Change-Id: I354ac142b9d49852a0d5c7557a7368e1c36b0f63
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/3043469
(cherry picked from commit acf3356b8e9cbd7c0f9e34a0ead3591e83f65b60)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/3081473
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292924
Reviewed-by: Narayana Reddy P <narayanr@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-02-07 00:24:27 -08:00
Shobek Attupurath
d641168e9e rtl8852ce: Add Nvidia changes to driver v126
- Update paths for sourcetree
- Reduce log level
- Update roam parameters

Bug 5023692
Bug 4957055

Change-Id: I9b6eed09790bc94d6976d4d680a2aa080085130a
Signed-off-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3284274
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
2025-01-29 09:54:54 -08:00
Shobek Attupurath
88c9f54b6f rtl8852ce: Update driver to version v1.19.16_nv-126
Update driver version to v1.19.16_nv-126-g455ab52c9.20241107_Certified_Module
to enable roaming and fix issues with roaming

Bug 5023692
Bug 4957055

Change-Id: I7d021f599c6483e15828a564a016e4037b238c90
Signed-off-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3284273
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-01-29 09:54:49 -08:00
Jon Hunter
f82cb5bdc8 Revert "tty: wch: update copyright headers"
This reverts commit a9ae1a62f2.

Reason for revert: Modifies original copyright and license

Change-Id: I08cfac80a758229a43cec4c22c110af1581656a2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3291558
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
2025-01-27 10:08:50 -08:00
Ankit patel
a9ae1a62f2 tty: wch: update copyright headers
Update copyright header to GPLv2, removed proprietary copyright headers

Bug 5065840

Change-Id: Ib0b8be01f3c0a4fc963244d7b49489960420dc27
Signed-off-by: Ankit patel <anpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3289171
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-01-23 05:23:59 -08:00
Revanth Kumar Uppala
a736931748 R8168: Configure Root Port MPS and MRRS in r8168 driver
This patch ensures that the Maximum Payload Size (MPS) and Maximum Read Request Size (MRRS) settings of the root port associated with r8168 ethernet endpoint are properly configured after overwritten by kernel when pcie_bus_perf is enabled.

Bug 4607316

Change-Id: I7f7b83f74e4ac2104345bd568d9d2e7c03a1441e
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3273562
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
(cherry picked from commit 6c00bf9297134760f10974383ae4169589e16fa6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3285723
2025-01-19 20:23:53 -08:00
Manish Bhardwaj
a08c7112e7 ivc: fix ivc driver issue for noble kernel
Bug 4377196

Change-Id: I4acc2d4e419f0ee95be760910f27da592369875c
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3026287
(cherry picked from commit 54e431bcc9)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3283409
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Paritosh Dixit <paritoshd@nvidia.com>
2025-01-15 06:08:50 -08:00
Ankur Pawar
3ff44d5400 media: i2c: IMX390: modify mode table
-Add gain, exposure and short exposure functions.
-Modify WDR and SDR mode table as per the settings
 provided by Sony in their camera SDK.
-Analog gain is fixed in mode table. Driver will only
 update digital gain.

Bug 4774547

Change-Id: Ia04f42062d6f1e56f16c7fbcc6e671529cb714b6
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3189759
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Shubham Chandra <shubhamc@nvidia.com>
2025-01-14 12:09:33 -08:00
Jon Hunter
74c0a6d16d drivers: Drop inline from driver remove wrapper
The driver remove function is a function pointer and therefore, it does
not make sense to define the function as an 'inline'. Update the
coccinelle script and drivers to remove the inline statement.

Bug 4749580

Change-Id: Ia03691b75c4edffe609f27468b911a92a5ddbd68
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233980
(cherry picked from commit 2c3a31c9b72785ee35ad079422b624f59a35f622)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3276870
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-01-06 06:09:10 -08:00
Jon Hunter
66afcf9c40 misc: tegra-cec: Fix build for Linux v6.11+
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update the Tegra CEC driver
as necessary to fix this.

Bug 4749580

Change-Id: I3cd34f41e519240ff48378e79bb654cf78767085
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3276923
Reviewed-by: Prafull Suryawanshi <prafulls@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-01-03 11:23:59 -08:00
Prafull Suryawanshi
0cac4c3b02 tegra-cec: remove pre-t23x support.
This change removes pre-t23x support and removing
dependency on tegra-dc module for tegra-cec driver.

Verification:
Verified on orin-slt with basic cec tx-rx data with TV.

bug 4954851

Change-Id: Ie820ba706ac5e66da282e411a4ae74bd0e6cb58b
Signed-off-by: Prafull Suryawanshi <prafulls@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3264311
Reviewed-by: Shu Zhong <shuz@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vinod Atyam <vatyam@nvidia.com>
2024-12-22 21:39:26 -08:00
Gerrit Code Review
b55e16ed87 Merge "tegra-cec: Merge remote-tracking branch 'origin/dev/dev-cec-2' into HEAD" into rel-36 2024-12-22 21:39:22 -08:00
Prafull Suryawanshi
79045f2dc7 tegra-cec: Merge remote-tracking branch 'origin/dev/dev-cec-2' into HEAD
This merge imports tegra-cec driver from linux-nvidia repo to nvidia-oot repo
with maintaining git history of tegra-cec from start.

bug 4954851

Change-Id: Icb8d066df5eeaa083a70a7f6657caf1c1593ec17
Signed-off-by: Prafull Suryawanshi <prafulls@nvidia.com>
2024-12-20 03:58:24 +00:00
Prateek Patel
6d4080d2bb drivers: cec: fix cert_c defect
Add a sanity check on cec->soc, which could be NULL.

CID 490328

Bug 3512545

Change-Id: Ibd334c5637a85342ed5307eecb697416f32e0360
Signed-off-by: Prateek Patel <prpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2710156
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-12-20 03:54:00 +00:00
prafulls
3e3bd3b5f0 misc: tegra-cec: replace dev_err with dev_info.
The probe retry message shall not be error message.
Replacing it with dev_info to fix kernel warning test.

bug 3578262

Change-Id: I8fd016e11b6edc14a402214a44c1e916bcc0d16e
Signed-off-by: prafulls <prafulls@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2685084
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Shu Zhong <shuz@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-12-20 03:54:00 +00:00
Prafull Suryawanshi
bcd8f08d84 misc: tegra-cec: add T23x support.
This change includes below -
1. For T23x, CEC engine is moved to AON partition. As AON partition
   does not powergate, skip all powergate/unpowergate calls for t23x.
2. The clock on which CEC engine operates, 32k/rtc_clk, it is always
   running clock in AON partition. So skip clock enable/disable APIs.
3. This change also skips calls to TEGRA DC engine which is not available
   from T23x.
4. RX Buffer size is increased to 64 depth from 1 depth. So new register is
   provided to program depth so that interrupt gets triggered when certain
   depth is filled. By default it is 64 depth so program it to 1 depth
   to match old behavior.
5. When tegradc is absent, read physical address from SPARE register which
   will be populated by UEFI.
6. This change also adds new register definitions in header file which
   needs to program when adding support for CEC SC7 wakeup.
7. Timing registers updated for T23x as per HW guidelines.
8. Some initialization code is changed for T23x.
9. Add devicetree binding documentation.

bug 200727002

Change-Id: I71c2d323632c61e4c4b82bcdbca9e72179761224
Signed-off-by: Prafull Suryawanshi <prafulls@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2523595
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Shu Zhong <shuz@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-12-20 03:54:00 +00:00
Ankit Patel
61e8cccc41 drivers: use overlay instead of relative path
Modified misc/tegra-cec and video/tegra/dc NVIDIA git repo Makefile, Now
overlay macro will be used instead of relative path from kernel source
tree, to find the included header file.

Bug 200606454

Signed-off-by: Ankit Patel <anpatel@nvidia.com>
Change-Id: I684388e9c81be94915c05db3cdae8b6100c6db91
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2521240
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-12-20 03:54:00 +00:00
Naveen Kumar S
9152cfd9e9 video: tegra: dc: add pm_runtime support
Add genpd/pm_runtime support to handle power domains
in Tegra Display driver. Also updated CEC and HDA_DC
drivers to add pm_runtime calls.

Added new APIs in CEC and SOR drivers to abstract
calls to pm_runtime and tegra_powergate APIs based
on specific Kernel version. Guarded powergate_id
with CONFIG_TEGRA_POWERGATE since its not needed
when pm_runtime APIs are used, and the powergate IDs
are defined in tegra_powergate.h which is not used
in K5.9.

Removed pm_runtime autosuspend setting since display
driver doesn't assign PM suspend/resume hooks at
present. Suspend/resume calls are linked to platform
device callbacks.

Removed pm_runtime_enable() call in dc_common probe
since there's logically no need of power-domains
in dc_common and also there is no power-domains node
in display_hub node in device-tree. Same with DSI.

All the power-domains handled by each DC are listed
in "power-domains" and "power-domain-names" properties
under respective dc nodes in device tree.

bug 200601926

Change-Id: I0fc9d21ff56185a69de6e0663b5932a93cf40e2b
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2358953
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Shu Zhong <shuz@nvidia.com>
Reviewed-by: Ujwal Patel <ujwalp@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-12-20 03:54:00 +00:00
Naveen Kumar S
b55afecfc2 misc: tegra-cec: fix access_ok() API's parameters
This change fixes below follow-up issues with the earlier fix
to access_ok() API done as part of
https://git-master.nvidia.com/r/c/linux-nvidia/+/2361042:

1. Definition of VERIFY_READ and VERIFY_WRITE have been removed
after K4.14. Hence, used them only for kernel versions < K5.4.
2. Changed access_type parameter of tegra_cec_access_ok() API
to bool. WRITE or READ will be chosen based on the bool value.
3. In the last CL, VERIFY_WRITE was changed to VERIFY_READ in
two access_ok() calls by mistake. Corrected them in this CL.
4. Defined access_type variable with attribute __maybe_unused
since gcc doesn't seem to consider a variable as used if only
passed as function parameter.

bug 200601926

Change-Id: I9f3540cd028280ca679b4b69d5b4a72aa943b2ae
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2394585
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shu Zhong <shuz@nvidia.com>
Reviewed-by: Ujwal Patel <ujwalp@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-12-20 03:54:00 +00:00
Naveen Kumar S
80d0f3b9fa misc: tegra-cec: update access_ok() parameters
Starting K5.9, the access type parameter (read/write) of
access_ok() API has been removed. And also, the address
parameter has been updated to "void *" type from "unsigned
long". Introduced API tegra_access_ok() to abstract the
difference in parameters across different kernel versions.

bug 200601926

Change-Id: I0d72e03f5e0c56eb935107eaf306bc2d68ed13e3
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2361042
Reviewed-by: Shu Zhong <shuz@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-12-20 03:54:00 +00:00
Bitan Biswas
b36167f31c nvidia: drivers: fix linux-5.7-rc5 build
Fix build linux-5.7-rc5 errors including following:
	- change timespec to timespec64. replace getnstimeofday
	  with ktime_get_ts64
	- replace usage of macro FIELD_SIZEOF with sizeof_field in ethtool.c
	  nvethernet and eqos files.
	- support 2 arguments for of_get_phy_mode call

bug 200617764

Change-Id: I46067d7d36d08ee9556b2722e9ccec707b8853d4
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2347244
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-12-20 03:54:00 +00:00
Ankit Patel
3c80738a18 headers : move/modified header for User-space ABI
copied/moved/modified headers from the driver directory to the
include/uapi directory, which have IOCTL components required to
get access from user space as per Linux kernel user-space ABI.

Bug 2062672

Signed-off-by: Ankit Patel <anpatel@nvidia.com>
Change-Id: Ie70b2839e0a1031a685ff3e4bb93c73741645f44
(cherry picked from commit 348c5ff55d7499222f154aea9e9893e6cfa677ce)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2318682
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-12-20 03:54:00 +00:00
Nicolin Chen
4625e85131 media: tegra: Remove temp WAR for function calls
There are two type of temp WARs in the nvidia repo:
1) Some functions are defined in driver files that depend on
   CONFIG_TEGRA_GRHOST_NVCSI. So these function call should
   have dependency protection in the header file.

2) The powergate header file is adding an unnecessary define
   check for tegra194-powergate.h and this broke two places
   that were referring one of the defines in it.

So this change fix the WARs above by:
a) Removing those temp WARs by adding dummy NOP functions for
   those platofrms that don't have CONFIG_TEGRA_GRHOST_NVCSI.
b) Removing the define check in tegra194-powergate.h and the
   version check when referring TEGRA194_POWER_DOMAIN_DISP.

Bug 2284925

Change-Id: Iad86bfe20f2981b3d31bccf5f51184799fe7e289
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1803439
GVS: Gerrit_Virtual_Submit
Reviewed-by: David Bang <dbang@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>
2024-12-20 03:54:00 +00:00
Chun Xu
9ff4833af1 tegra-cec: add interface to get post_recovery
Provide IOCTL interface for usersapce to get whether current boot is from
booting from recovery.

Bug 200394215

Change-Id: I45f492b766a75542ff470366001f92fa2fd65d23
Signed-off-by: Chun Xu <chunx@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1780659
(cherry picked from commit 8a4bda6d7e0904ce9c0cafabac4aefb49e879b8b)
Reviewed-on: https://git-master.nvidia.com/r/1792946
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prafull Suryawanshi <prafulls@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>
2024-12-20 03:54:00 +00:00
Chun Xu
cf3a533906 tegra_cec: suppport dump registers and snoop mode
Provide dump registers and changingRX snoop mode interface.

Bug 200382184

Change-Id: Idb55d22112bc6be9de89b8ff8e060e73de469507
Signed-off-by: Chun Xu <chunx@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1765068
(cherry picked from commit 3310df0f117d792d3d0bfab6326592851faaeed7)
Reviewed-on: https://git-master.nvidia.com/r/1641846
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Prafull Suryawanshi <prafulls@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>
2024-12-20 03:54:00 +00:00
Chun Xu
23461a3851 CEC: add timeout and recovery in CEC frame sending
To avoid hang on CEC frame sending, introduce timeout and recovery.

Bug 2151251

Change-Id: Ia7c87ee874734c3ed976f3a9142ecc7e2509ec43
Reviewed-on: https://git-master.nvidia.com/r/1741606
(cherry picked from commit e0010f8fb4443cc146a84d76b8666ee831010f56)
Signed-off-by: Chun Xu <chunx@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1764220
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-12-20 03:54:00 +00:00
Aly Hirani
4ca144139b misc: tegra_cec: fixing return values for wait
This change fixes the code that was checking the return value for
the wait_event_interruptible_timeout.

Change-Id: Ief6c180f1df9994dd6caa776e08cdb26e15bb32b
Signed-off-by: Aly Hirani <ahirani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1742938
(cherry picked from commit 8e4b55aa0571a10acf106d21f7c70b2d8b8108c6)
Reviewed-on: https://git-master.nvidia.com/r/1746696
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-12-20 03:54:00 +00:00
Aly Hirani
0e3c13c2f1 misc: tegra_cec: Add timeout for wait_event
Bug 2151251

Change-Id: I75d16b33d1596242c28d693f824a51d72934a5c3
Signed-off-by: Aly Hirani <ahirani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1742040
(cherry picked from commit c94751ec8838dd9edd5b2dafd5c308ecefe6a8b3)
Reviewed-on: https://git-master.nvidia.com/r/1746695
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-12-20 03:54:00 +00:00
Ishwarya Balaji Gururajan
80169e7ded misc: tegra-cec: remove NVDISPLAY ifdefs
remove NVDISPLAY ifdefs and replace it with runtime APIs

Jira TDS-2761

Change-Id: I920fe5402a91d1780b07aadf542cc15361f73398
Signed-off-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1653842
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-12-20 03:54:00 +00:00
Chun Xu
a89f31f800 misc: tegra-cec: add T194 CEC device
Bug 2039509
Bug 200375853

Change-Id: Iebe1956a94cbf0209b11ad8c66d8fc5b7335549a
Signed-off-by: Chun Xu <chunx@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1641039
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Naveen Kumar S <nkumars@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-12-20 03:54:00 +00:00
Ishan Mittal
a550d6f899 drivers: Fix references to nvidia/
drivers inside platform tegra and nvdisp
point to display repo.
changing that to nvidia/

Bug 200295104

Change-Id: I91e0356555c251df3eae98218a69f4bc7e3cd208
Signed-off-by: Ishan Mittal <imittal@nvidia.com>
2024-12-20 03:54:00 +00:00
Chun Xu
74524fa09b misc: tegra-cec: dump read/write buffer for debug
Dump read/write buffer with dev_dbg for debug.

TDS-2199

Change-Id: I1fa3dec9e2ccd78023c464085fd2f6e3f49a87f2
Signed-off-by: Chun Xu <chunx@nvidia.com>
Reviewed-on: http://git-master/r/1485394
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Prafull Suryawanshi <prafulls@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Spencer Sutterlin <ssutterlin@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2024-12-20 03:54:00 +00:00
Nicolin Chen
f79ab92d84 misc: tegra_cec: add missing cancel_work_sync()
This patch just adds missing cancel_work_sync()
in the exit path of the probe().

Bug 1887171
Bug 200289389

Change-Id: I7d42ae6d035f87b5ad1b726cbe5274fbd9755f4e
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: http://git-master/r/1463243
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2024-12-20 03:54:00 +00:00
Vince Hsu
5845f087dd misc: tegra_cec: turn some prints into debug level
To prevent too many bufferred message from flushing out to serial when
we turn on/off display and blocking other high priority task due to
disabled IRQ, we change some prints to debug level to workaround that
problem as a short-term solution. The long-term will be implemented
later.

bug 200205349

Change-Id: I6609844d5c2ee58b2df6a51e9537bb7dd1448995
Signed-off-by: Vince Hsu <vinceh@nvidia.com>
Reviewed-on: http://git-master/r/1326683
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Chun Xu <chunx@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2024-12-20 03:54:00 +00:00