- Move chip data from patch files to dev-*.c files for
ease of maintenance
- Add patch file to patch compatible and chip data into
dev.c file, also add dev-*.c files to build makefile
- Add stub for dump_core_state function pointer
- ADSP updates
- Use AMISC base directly from reg DT prop as it will
be offset as per the DSP instance (drop adsp_prid)
- Set amc_not_avlbl to true for ADSP[1], so only ADSP[0]
will access AMC
- Change compatible of ADSP[0] to "nvidia,tegra264-adsp"
in order to keep continuity with previous chip
generations (unique identifier string is "adsp")
Also remove T264 adsp support from kprev.
Bug 3682950
Bug 4165898
Change-Id: I22abf3fda01f4e0e259759ba1816a9580a474d40
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3107870
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: Asha T <atalambedu@nvidia.com>
In Linux v6.12 the definition 'no_llseek' was finally removed. Since
Linux v6.0 it had been redefined as NULL. Add a test to conftest to
determine if 'no_llseek' is present and if not then it is no longer
necessary to populate this and we can leave as NULL.
Bug 4876974
Change-Id: I051fdb285b32260b5913dad89cabe0be04253f67
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3222106
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Accessing queue and payload fields of MSGQ via array index
causes out-of-bound warnings in new kernel version as they
are initialized as arrays of size 1:
index 53 is out of range for type 'int32_t [1]'
index 2045 is out of range for type 'int32_t [1]'
Addressing this by accessing the fields via pointer
increment instead of array index.
Bug 4420795
Change-Id: I873dbe08a894d1eea8866bb8a16018816d0e4db3
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3199294
Reviewed-by: Asha T <atalambedu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Create and register set and get operating point sysfs functions.
The operating point notification will contain the requested
operating point.
The nvcap resource manager will extract the operating point
from the notfication and send it to rce via the hsp command
interface.
In turn, rce will apply the operating point by adjusting the
functional clock frequencies for the following camera ip:
- rce hardware
- vi hardware
- isp hardware
- nvcsi
Jira CAMERASW-26378
Signed-off-by: Robert Kelly <rkelly@nvidia.com>
Change-Id: Ia814b2716d3738efb3cbc37307a267140b555f42
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3179593
(cherry picked from commit d259727a57ecf4b9463030b3418715891b3b1209)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3189078
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
DCE FW will run the dma test using 512 bytes of transfer
between dram and tcm for 400 iterations and alu test
generating 100 prime numbers for 200 iterations.
DCE running above 600Mhz will take nearly 50msec
for each test.
Jira TDS-16211
Change-Id: I34570acd4db6b8103bd2451833b280dc8e32131a
Signed-off-by: vinodg <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3192552
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Platforms that implement suspend-resume as clean firmware
restart need to latch the shared mem address in every
suspend-resume cycle, but mbox value may be lost due to
module reset, so ensure that shared_mem_hwmbox is written
unconditionally in os_start flow.
Bug 3916054
Change-Id: I649d70871401475d66e0e50abeeaf4c347040119
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3180285
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Asha T <atalambedu@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
ccplex side sees two interrupts. The first one is handled
properly while the second one does not have bit MBOX_OUT_VAID
being set.
Fixing this by reading psc_ext_ctrl register after writing.
Bug 4741744
Change-Id: I22ac1619b7f88a96658c8d197f09daccf3bb40d8
Signed-off-by: Liang Cheng <licheng@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3174350
Reviewed-by: David Pu <dpu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
As part of profiler show operation triggered through sysfs,
profiler data is only seen in the kernel log.
Add a change to copy the profiler contents in the profiler
buffer as well so that the buffer content is visible at the
place where sysfs read is issued.
Note that there is a limitation in buffer size used in sysfs
read and write operations, which is equal to PAGE_SIZE.
And so, checks are added to detect buffer overflow while
writing profiler data in the buffer.
Jira ASSA-934
Change-Id: Ice3eccdfffbd7734ac7a20a0a8ca52ba00af865e
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3154262
(cherry picked from commit b619de032dfd58ffc385b08d26353991e2ae3d9b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3158713
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
1. tegra_bl_debug_probe checks if either bl_prof_dataptr, bl_prof_ro_ptr
or bl_debug_data are not passed by kernel command line parameter.
Post this check, it retrieves bl_prof_dataptr and bl_prof_ro_ptr
data from DT and does not retrieve anything for bl_debug_data.
There is no need for checking bl_debug_data as it is not being
queried from DT in the probe function. Hence, remove the check for
bl_debug_data from probe.
2. Add prints in probe function to print bl_prof_dataptr and bl_prof_ro_ptr.
Bug 4454722
Change-Id: Ib8e52407d2ff227cc9605704e467790a9b65a1db
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3141122
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Change completion wait in wait_for_app_complete_timeout API
to non-interruptible so that it is woken up only at completion
signal and not by any other signal or interrupt. This is
important for predictable execution when multiple ADSPs are
run using parallel kernel threads.
Bug 3682950
Change-Id: Iaed7493686d5e05ac04612a486e64507dc9bb60d
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3123567
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Asha T <atalambedu@nvidia.com>
For easy of extensibility to future chips, below data and
functions applicable to T23x are moved to dev-t18x.c
- chip data for supported chips
- set_boot_vec: set up EVP
- set_boot_freqs: set ADSP freq as per DT property
- check_wfi_status: check WFI status from AMISC
- dump_core_state: ADSP core and state dump
Bug 3682950
Change-Id: Iffba56addc9a68ec33de390a379fe725e727cfad
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3107450
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
- With multiple ADSPs in use, only one of them may configure AMC,
so use amc_not_avlbl flag to skip reg parsing, if not needed
- Unify reg enums for ADSP and AON; this means that reg DT prop
for AON should have a dummy first entry (against AMC)
- Remove adsp_prid from chip data, as AMISC base in reg DT prop
will be offset as per the ADSP instance
Bug 3682950
Bug 4165898
Change-Id: Ic6068aeeb7bbb3540cad36371a6715f8b43ee8b6
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3106899
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
ADSP host driver is enhanced to be multi-instance
capable and reentrant:
- Trailing unique identifier string in compatible DT property, like
"adsp", "adsp1" or "aon", is used to identify the driver instances
- Each probed driver instance is inserted into a global list, from
which the handle can be fetched using 'nvadsp_get_handle' API
(passing the above unique identifier as argument)
- Above unique identifier is also used as name for the DBFS
directory (containing files like adsp_console, adsp_logger, etc.)
- 'nvadsp_get_handle' is the only exported API; all other APIs are
accessible via function pointers within 'struct nvadsp_handle'
- APIs above maintain one-is-to-one correspondence with all
legacy APIs, with the addition of a new argument
'struct nvadsp_handle *' at the beginning
- Legacy APIs continue to be supported, but they are hardwired to
work only if the kernel probes just one driver instance
- All driver files are cleaned up to not use any global state
variables (necessary for reentrancy)
Bug 3682950
Change-Id: Id5db49e861b2f81716ae8352b36b406654da2bbd
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3092701
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
1. Register resume_noirq handler for profiling the time when early
driver resume sequence is started. Since this driver is loaded after
boot, this should get called very early in the resume sequence.
2. Register PM notifier to know when resume is complete. This helps
in profiling the time when entire resume sequence is complete.
These 2 timestamps should approximately indicate the time it takes
for Linux to resume.
Adding this code in this driver removes dependency of providing this
information from some other driver.
Bug 4454722
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Change-Id: I214eb4ff2808ecb87b828cb4556a2a00cc2d4545
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3047836
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3062030
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Probing a driver can be deferred if a resource is not ready and this is
accomplished by returning -EPROBE_DEFER from the .probe function. This
tells to kernel to probe the driver again some time later. When probing
a driver is deferred it is not necessary to print an error message
because this is an expected error case. To avoid printing an error
message on probe deferral, the dev_err_probe() function can be used
which will only print an error if the error code is not -EPROBE_DEFER.
Therefore, update the camera drivers to use dev_err_probe() to avoid
printing an error message when -EPROBE_DEFER if returned from ICC.
This change will also cause the probing of the rtcpu-debug driver to
be deferred if -EPROBE_DEFER is returned and prevent the rtcpu-debug
driver from being probed at all if an real error is encountered.
Bug 4496044
Change-Id: I8a5313750e11b4bd661191c0c544c39e43478089
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3084829
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Upstream kernel does not export IOMMU APIs, so use dynamic
memory allocation for shared memory in non-secure boot mode.
Move stale code that uses IOMMU APIs under macro
CONFIG_IOMMU_API_EXPORTED. As remapping allocated IOVA to a fixed
address is no longer possible, IOVA cannot be used for OS memory;
reserved physical memory may be used in its place.
Dynamic memory allocation for shared memory will be selected if
ACSR_ADDR in "nvidia,adsp_mem" DT property is set to 0.
Bug 4416828
Bug 4164138
Bug 3682950
Change-Id: I9ea5626a14457818f2adff69610562e824f7fdda
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3067154
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
- Added num_irqs to chip data structure and modified enum to
suit the driver to both AON and ADSP
- Added num_regs to chip data and modified reg bank enum
to suit both AON and ADSP
- Added chipdata variable to indicate if amc is not available or
relevant
- Modified aram_exit to execute only if aram size is not null
- Avoid passing fw name for registration as it currently passing "APE"
- WFI status check logic is dsp specific. Hence separated out into
new API
- Mapping mbx interrupts is specific to AON. Hence added platform device
specific API to map the shared interrupts
- Avoided empty interrupt spamming for level triggered interrupts.
This fix does no harm even for edge triggered interrupts
Bug 4165898
Change-Id: I99cf03c06ed5d290e067b4fd3569febadbda607a
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3035268
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Introduce a new field 'adsp_boot_config_hwmbox' in chip data
for passing boot config to ADSP, replacing the existing
method of writing chip_id into hwmbox1.
The new field presently encodes adsp_os_secload flag. This
may be useful for firmware to do specific settings based on
boot mode, e.g. do AST settings if boot is in non-secure mode.
Bug 3682950
Change-Id: I51e5e0c8f15a8160247a7febb50998defec13d42
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3052180
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.
Bug 4448428
Change-Id: Ia40ab13f865d5631c96855ecc49145848f99c996
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032442
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
For Linux v6.8, the function strlcpy() has been removed. The function
strscpy() was added in Linux v4.3 and has been preferred over strlcpy().
See upstream Linux commit 30035e45753b ("string: provide strscpy()") for
more details. The Linux checkpatch.pl script warns against using
strlcpy().
The function strscpy() takes the same arguments as strlcpy(), but
returns a type of ssize_t instead of size_t. Update the drivers to use
strscpy() instead of strlcpy().
Bug 4448428
Change-Id: Id6f196f0e81decf1545f9aa4f74f5c63a7f72a48
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059457
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>