When BWMGR is unavailable, BWMGR could be either unsupported and
disabled in BPMP firmware.
For unsupported state, MRQ_BWMGR_INT is not available to use.
For disabled state, MRQ_BWMGR_INT is available but sending any
MRQ_BWMGR_INT request will just get -BPMP_NODEV error code.
Add error handling logic to make min_freq and max_freq devfreq sysfs
nodes as read-only but still expose devfreq nodes, such as
available_frequencies, min_freq, and max_freq, to allow user space
apps to read information from.
Bug 5555075
Change-Id: Id7c2695765d3dfee148a0d1bc1f7b0552fe4b343
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3467128
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Upstream commit a55893133830 ("gpiolib: Remove unused
devm_gpio_request()") removed the devm_gpio_request() function and this
breaks the Tegra USS IO Proxy driver. The devm_gpiod_get() function has
been supported in the Linux kernel since v4.3 and now that the legacy
GPIO functions are being removed, migrate the Tegra USS IO Proxy driver
over to using GPIO descriptors.
Bug 4387902
Bug 5420210
Change-Id: I0c62977dc4ec829e14f105babdd08bbd64113fa2
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3423827
(cherry picked from commit e4572a5ff434f778178b1dfb39b4c1cf7923db6d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462463
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
When NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT is not defined the build
fails and the following errors are seen ...
drivers/platform/tegra/tegra-bpmp-bwmgr.c:101:12: error:
‘tegra_bpmp_bwmgr_devfreq_target’ defined but not used
[-Werror=unused-function]
101 | static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev,
unsigned long *freq, u32 flags)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/platform/tegra/tegra-bpmp-bwmgr.c:37:12: error:
‘tegra_bpmp_bwmgr_max_freq_notifier’ defined but not used
[-Werror=unused-function]
37 | static int tegra_bpmp_bwmgr_max_freq_notifier(struct
notifier_block *nb, unsigned long action, void *ptr)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix this by ensuring the above functions are not defined if
NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT is not defined.
Bug 5483386
Bug 5196455
Change-Id: Ie2b069d163a32220c95ffaba217ddea3686ba92b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461865
Reviewed-by: Johnny Liu <johnliu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This driver exposes EMC frequency control interface to user space via
linux devfreq framework.
Users could change EMC frequency to the frequency value from the
available frequencies of EMC clock:
$ /sys/class/devfreq/bwmgr# cat available_frequencies
665600000 2750000000 3200000000 4266000000
and update the EMC floor frequency by writing into the min_freq QoS
sysfs node:
$ /sys/class/devfreq/bwmgr# echo 4266000000 > min_freq
and update the EMC max frequency by writing into the max_rate QoS
sysfs node to cap the EMC frequency:
$ /sys/class/devfreq/bwmgr# echo 4266000000 > max_freq
This driver does not directly manage the EMC clock rate. Instead it
just delivers the min/max frequency information to BPMP, and BPMP is
still the only entity that has the full control of EMC and other
related memory clocks.
Bug 5483386
Bug 5196455
Change-Id: I6124eeb7411a13bde5c51582064534063abca8d3
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3453755
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The camera-diagnostic driver is missing a release function for the IVC
channel device that it is creating. This causes the following WARNING to
be observed when probing the camera-diagnostic driver fails ...
------------[ cut here ]------------
Device 'camera-diag' does not have a release() function, it is broken
and must be fixed. See Documentation/core-api/kobject.rst.
WARNING: CPU: 8 PID: 756 at drivers/base/core.c:2517 device_release+0x88/0xa8
...
Call trace:
device_release+0x88/0xa8
kobject_put+0xac/0x150
put_device+0x14/0x34
__mod_of__camera_diag_of_match_device_table+0x602514/0x6033a0
[camera_diagnostics]
tegra_ivc_bus_boot_sync+0x204/0x28c [ivc_bus]
really_probe+0x150/0x2c8
__driver_probe_device+0x78/0x134
driver_probe_device+0x3c/0x164
__driver_attach+0x98/0x1c4
bus_for_each_dev+0x7c/0xf4
driver_attach+0x24/0x38
bus_add_driver+0xec/0x218
driver_register+0x5c/0x13c
tegra_ivc_driver_register+0x10/0x1c [ivc_bus]
init_module+0x18/0x1000
[camera_diagnostics]
do_one_initcall+0x58/0x318
do_init_module+0x58/0x1ec
load_module+0x1f04/0x2000
init_module_from_file+0x88/0xd4
__arm64_sys_finit_module+0x148/0x330
invoke_syscall+0x48/0x134
el0_svc_common.constprop.0+0x40/0xf0
do_el0_svc+0x1c/0x30
el0_svc+0x30/0xb8
el0t_64_sync_handler+0x130/0x13c
el0t_64_sync+0x194/0x198
---[ end trace 0000000000000000 ]---
Ideally we would use the 'tegra_ivc_channel_release()' function as the
release function but because the camera-diagnostic driver does not call
'tegra_ivc_channel_create()' to create the channel and does not actually
need to free any memory, simply define a new empty function that can be
called.
Bug 5489551
Change-Id: I6a7de9893af0167409af79599b61faf005047b0e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3443095
(cherry picked from commit f75c0f228ca4f1a4c17266cb97be2db63b25a592)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3453753
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
This is for avoiding kernel hang when DCE FW fails to respond.
Failures of IPC call will return -ERESTARTSYS or -ETIMEOUT, which
will be handled by caller functions:
1. tegra_dce_client_ipc_send_recv (EXPORT_SYMBOL)
This is module export symbol and caller have the responsibility
of checking return value.
2. DCE FSM event handler
Error return will change back to previous state.
DCE_IPC_TIMEOUT_MS_MAX is set to 10000[ms]
SHA computation time on SC7 entry request can go up 2sec.
Host tolerance time must be larger than this.
Jira TDS-16567
https://nvbugspro.nvidia.com/bug/5335034
Change-Id: I5d77a9497f14f305d07b98e39a58fbcecafedf92
Signed-off-by: charliej <charliej@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3358620
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
(cherry picked from commit 6c2ab3c78ce7cba0e88455b263d51d1a88c03927)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3402917
Renamed the "control" sysfs node to "diag_control" in the camera-diagnostics
driver to avoid naming conflicts with other control nodes in the system.
This renames the associated show/store functions and updates all references
to maintain the same functionality through the new more specific node name.
The camera diagnostic control interface is now accessible through
/sys/devices/platform/.../camera-diag/diag_control instead of .../control.
Bug 5225858
Change-Id: I5ce96d6d981354f7af9edc7495cf9eef6ba1fdb6
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3345338
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bhushan Rayrikar <brayrikar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
Replace use of WARN or WARN_ON kernel with dev_warn to improve logging
behavior. This change ensures that error conditions are reported with
clear informative messages rather than kernel stack traces that can
flood logs.
Additional information:
- The files `drivers/platform/tegra/rtcpu/debug.c` and
`drivers/platform/tegra/rtcpu/hsp-combo.c` present in the original
codebase were deleted as part of unrelated refactoring in the
target repository; hence, changes related to these files in the
patch were not applied.
- Additional changes are done to replace WARN_ON at other places.
Bug 4719119
Change-Id: Id12f1b4de77f8b007b557de140257a3bd7478b52
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/3308911
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3352892
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Added suspend and resume functionality to the camera-diagnostics driver
to properly handle ISP SDL diagnostics during system power transitions.
This ensures that diagnostics are stopped before system suspend and
restarted after resume if they were running before.
Jira CAMERASW-33531
Change-Id: Ic52fe91e0cfcc2a3138cacd8433e3b5a644378e4
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3344684
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Robert Kelly <rkelly@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
The RTCPU driver fails to build with the compiler option
'-Werror=declaration-after-statement' and the following errors are
observed ...
drivers/platform/tegra/rtcpu/camera-diagnostics.c:900:17: error: ISO
C90 forbids mixed declarations and code
[-Werror=declaration-after-statement]
900 | unsigned long end_time = 0U;
| ^~~~~~~~
drivers/platform/tegra/rtcpu/camera-diagnostics.c:904:17: error: ISO
C90 forbids mixed declarations and code
[-Werror=declaration-after-statement]
904 | bool all_tests_pass = (status.executed > 0 &&
status.passed == status.executed);
| ^~~~
Fix this by declaring the necssary variables at the beginning of the
functions.
Jira CAMERASW-32042
Jira CAMERASW-32960
Change-Id: I6bc652b19f77f0a9bbbe3263cdff371acbc957d7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3334920
Reviewed-by: Zhiyuan Wang <zhiwang@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mohit Ingale <mohiti@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.15, the timer APIs hrtimer_init() and del_timer() have been
removed. The hrtimer_setup() was added in Linux v6.13 to replace
hrtimer_init() and hrtimer_init() have finally been removed. The
functions del_timer()/del_timer_sync() were renamed to
timer_delete()/timer_delete_sync() in Linux v6.15. Use conftest to
detect these changes and update the drivers as necessary.
JIRA LINQPJ14-47
Change-Id: Id3994900384aad4b91155507cda91e04898ab12c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336168
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Add detailed Doxygen documentation across all files in the RTCPU subsystem.
This documentation effort follows SWUD Doxygen guidelines and provides
complete API documentation for the entire RTCPU codebase.
Use Cursor Agent to generate SWUD doxygen headers
Jira CAMERASW-31120
Change-Id: I3095ff2e321402e72f0f8f5762bad798ea0ecf19
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3332472
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Add a new sysfs interface that allows toggling camera diagnostics on and
off at runtime without deallocating memory resources. This enhances the
camera-diagnostics driver functionality by:
- Adding a new 'control' sysfs attribute for starting/stopping diagnostics
- Implementing intelligent state checking to avoid unnecessary operations
- Providing better user feedback about the current diagnostic state
- Preserving allocated memory between stop/start cycles
The implementation checks if diagnostics are already running or already
stopped before attempting state changes, preventing redundant operations
and providing informative messages to users.
This allows us to run isp-falcon-memtest, which conflicts with
camera-diagnostics driver.
Jira CAMERASW-32042
Change-Id: I67d0e7e15a25cf000554d1c222b2890be1adce4a
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330307
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bhushan Rayrikar <brayrikar@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
This commit expands the camera-diagnostics driver to add
support for ISP PFSD tests. The implementation:
- Adds diagnostics IVC communication between kernel and RCE firmware
- Implements ISP SDL test vector loading, verification, and execution
- Provides proper memory allocation and IOMMU mapping across devices
- Supports multiple ISP instances with chip-specific configurations
(T234/ISP6 and T264/ISP7)
- Creates sysfs interface for diagnostic status reporting
- Adds proper error handling and resources cleanup
- Implements CRC validation for test vectors
The driver enables hardware safety diagnostics for camera subsystems
to ensure reliability and functional safety of the camera pipeline.
New header files:
- camrtc-diag-messages.h: Defines messages for IVC communication
- camrtc-diag.h: Contains common diagnostic data structures
Jira CAMERASW-32042
Change-Id: I9a892b40891cffc3d460723d9fdc92854c6cda85
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3313001
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Bhushan Rayrikar <brayrikar@nvidia.com>
Add support to the bootstrap command over the admin channel,
which will be called when a client registers. This command will
perform steps that must be performed only after the client is ready.
TODO: This bootstrap-2 command will be replaced by the existing
bootstrap command which we call during DCE-FW bootstrapping once
we split admin bootstrapping and RM bootstrapping in the DCE-KMD.
Jira TDS-17135
Change-Id: I55330b9ce73e1acf20e2a80d392d7984c91ed65f
Signed-off-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3274949
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Calling tegra_camrtc_reboot() can cause a memory fabric timeout error by
asserting reset when the RTCPU is in the middle of a memory transaction.
As a solution (similar to tegra_camrtc_halt), before asserting the
hardware reset, signaling the RTCPU to suspend its operations using
CAMRTC_HSP_BYE and waiting for RTCPU to enter WFI.
Bug 5051748
Change-Id: Iba8e4e837ee0983ffe9629e7627e0056ce1c2341
Signed-off-by: Petri Niemela <pniemela@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3317142
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Tested-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
Add a few microseconds delay between IVC channel reset retries.
This prevents kernel logs from flooding if dce bootstrapping takes
some time for any reason.
Based on logs below, DCE is taking around 10-30 microsecond for channel reset.
So, Keeping the delay of 10-20 microseconds.
20:26:46.637409: dce: dce_mailbox_set_full_interrupt:157 Intr bit set multiple times for MB : [0x5]
20:26:46.637421: message repeated 15 times: [ dce: dce_mailbox_set_full_interrupt:157 Intr bit set multiple times for MB : [0x5]]
---
20:26:46.637429: dce: dce_mailbox_set_full_interrupt:157 Intr bit set multiple times for MB : [0x1]
20:26:46.637458: message repeated 12 times: [ dce: dce_mailbox_set_full_interrupt:157 Intr bit set multiple times for MB : [0x1]]
----
20:26:46.637461: dce: dce_mailbox_set_full_interrupt:157 Intr bit set multiple times for MB : [0x2]
20:26:46.637471: message repeated 15 times: [ dce: dce_mailbox_set_full_interrupt:157 Intr bit set multiple times for MB : [0x2]]
Jira TDS-6381
Change-Id: I0f8d3c55058019df5a52edd232eae93b3bf84276
Signed-off-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3304216
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
- dce-client-ipc.c is a common file used by HVRTOS as well to
register as a DCE client.
- We need to refactor existing register function due to certain
HVRTOS restrictions at init time.
1) Register function will be called at init time from HVRTOS.
2) HVRTOS doesn't allow any mutex acquire calls or wait calls
during INIT phase.
JIRA TDS-16581
Change-Id: I1b3a9587c1e237c2cca8214a3acce9ff34d98cc0
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3280251
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
+ Add the following data validation checks based on
gaps identified when inspecting code for
SHR-9320:
+ FSYNC: Add check to ensure existence of generators
property before parse
+ FSYNC: Add check to ensure generators in default
group adhere to LCM rule
+ CDI: Add check to ensure reg_len / dat_len do
not exceed 2 bytes
+ CDI: Ensure err is set before jumping to err_probe
+ CDI: Jump to err_probe if IOExpander i2c-bus read
fails
+ CDI-TCA: Return error if reg_len or dat_len
out of expected range
+ FuSaCap: Ensure isp/vi-max-channels validated
+ VI: Add check for vi-mapping index found (this was
already caught in existing code, but error message
was non-specific)
+ camera_common: Add check for err that was set but
never read
+ RTCPU: Add debug prints for properties not found
Jira CAMERASW-30537
Change-Id: I9953029f594c0153d6c335913944fb8906adedd9
Signed-off-by: kevixie <kevixie@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3280557
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Mohit Ingale <mohiti@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>