Commit Graph

493 Commits

Author SHA1 Message Date
Asha Talambedu
bd3f20d097 nvadsp: aon: t264: Map hwmbx interrupts
Maps mbox 0's full and mbox 1's empty interrupt to
shared interrupt lines 3 and 2 respectively.

Note that this is WAR and actual fix will use single interrupt
line i.e SI_1 to map both full and empty interrupts

Bug 4165898

Change-Id: Iaf26d38dc460160d68d7b58c59500599f5afd3a2
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3139919
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:07 +00:00
Viswanath L
5442215da4 nvadsp: t264: Set no interrupt for WFI on AON
AON F1 does not generate interrupt on entering WAITI, so
set no_wfi_irq flag to true. WFI status can be queried by
reading AO_MISC register.

Bug 3916054

Change-Id: I3e9e3e66fdb4d9dab25b74484fee07df211ceab6
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3139592
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: Asha T <atalambedu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Viswanath L
f2c62be7fb nvadsp: t264: Add WAITI status query for ADSP
Implement WFI (WAITI) status check for ADSP by reading AMISC register.

Bug 3916054

Change-Id: If62bcf18ac56bba1cc9afb5a0c5e27f01e3807bc
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3139380
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Asha T <atalambedu@nvidia.com>
2025-07-24 10:19:07 +00:00
Viswanath L
d75315355c nvadsp: t264: Reorg and update chip data
- 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>
2025-07-24 10:19:07 +00:00
Aditya Bavanari
224ba02a19 nvadsp: t264: Invoke reset controls in assert/deassert
In assert and deassert callbacks, invoke the reset control
assert and deassert functions respectively through
"adsp" reset property.

Bug 3682950

Change-Id: I8bed0b3979e879e218af95d3fd1f836b6d2cca9e
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3081997
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Asha Talambedu
64b01b7616 nvadsp: t264: Extended for AON DSP
- Added function definitions to control AON from
kernel on T264.

- Copy files dev-t264-aon.c and dev-t264-aon.h to
drivers/platform/tegra/nvadsp/

- Patch chip_data,compatible and hdrs to dev.c for T264 AON

Bug 4165898

Change-Id: Iad31d89a7bff722fed47f4c28b0b7193c13ce414
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3009638
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Viswanath L
d85d5d657d nvadsp: t264: Fix include of dev.h
Allow dev.h to be included from source directory.

Bug 4164138
Bug 3682950

Change-Id: If6be232a428c843a45a14f155d957850d28847a9
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/2979502
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Viswanath L
19387d860f nvadsp: t264: Add chip support
Added chip_data and function definitions to support nvadsp
driver for T264.

 - Clock config and CAR assert/deassert are TBD
 - Booting is from default reset vector

Bug 3682950

Change-Id: If4cad64aa57a865b9d1afa8204c55904661ea5b8
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/2894325
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Jon Hunter
5a54d4161a drivers: Fix build for Linux v6.12
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>
2025-07-24 10:19:07 +00:00
fraunak
cc49f73763 nvidia-oot: add tracing support to identify isp
This change adds the isp logging to identify which isp instance is being
run in the rtcpu traces.

Jira CT26X-1790

Change-Id: I87744fd15629bb9faa96f5970b5f5ecea4b59937
Signed-off-by: fraunak <fraunak@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3221517
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Chinniah Poosapadi <cpoosapadi@nvidia.com>
2025-07-24 10:19:07 +00:00
Viswanath L
a2c75bcda2 nvadsp: Add flag for always ON operation
Add flag 'is_always_on' in driver state that will be set
if DSP CPU is already in running state at driver probe.

Bug 4777122

Change-Id: I99e255266f12f8cc0655f78e269e95ea303c1233
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3223695
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
2025-07-24 10:19:07 +00:00
Pekka Pessi
b53b1d832a rtcpu: validate trace event length
Add checks for trace event length.

A trace event with too small or too large len value could cause a
crash and kernel panic.

Bug 4446545

Change-Id: I404a4e3ba1a4dad04d05583b6ea8126556d0753b
Signed-off-by: Pekka Pessi <ppessi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3126815
(cherry picked from commit 01e1c1b3b3fabd28375aa6ef214ea759175c01f1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3132086
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Evgeny Kornev <ekornev@nvidia.com>
Reviewed-by: Jukka Kaartinen <jkaartinen@nvidia.com>
Reviewed-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Tested-by: Evgeny Kornev <ekornev@nvidia.com>
2025-07-24 10:19:07 +00:00
Manish Bhardwaj
2d8579274a nvidia-oot: use ivc APIs based on conftest flag
Bug 4551265

Change-Id: I75809a5c112b9e3cd5da570c2d9641bd89cfe07e
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3217450
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:07 +00:00
Bharat Nihalani
3361d37248 tegra_bl_debug: Read USC_TIMER base from DT
The physical address of Tegra Microsecond Timer USEC_CNTR_USECCVR_0
is currently hard-coded with the address from T234.

The address of this register changes with newer chips. Hence, read
this address from device tree.

Get rid of hard-coded values of address and size.

Change-Id: I416166f6f01cdb6009d4c53717e19f61cebe92e3
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3213600
Reviewed-by: Bhavesh Parekh <bparekh@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svc-bootloader-acv <svc-bootloader-acv@nvidia.com>
2025-07-24 10:19:07 +00:00
Eric Funsten
ec5a4957aa drivers: uncore_pmu: fix event attr
- event attr should be bits 4-19

Bug 4813144

Change-Id: If0956c64ebb5c9de52e8f223ccab17aaf5f57405
Signed-off-by: Eric Funsten <efunsten@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3204405
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Besar Wicaksono <bwicaksono@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:07 +00:00
Viswanath L
83dded8dd6 nvadsp: Access MSGQ ptrs via pointer increment
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>
2025-07-24 10:19:06 +00:00
Robert Kelly
98be04181c rtcpu: set op point via sysfs
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>
2024-08-17 10:38:56 -07:00
vinodg
d7a9c5b734 dce: update for mods test
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>
2024-08-16 11:01:46 -07:00
Bitan Biswas
4593cff331 platform: tegra: rtcpu: fix Mem abort
Fix k6.8 Mem abort after dma_sync_sg_for_cpu
call when running ap_bringup -> camera tests including
test_isp_debugfs_isp6_ob
 - Add pointer NULL check and pass same arguments
   to dma_sync_sg_for_cpu as dma_map_sg

Bug 4396374
Bug 3879036

Change-Id: I8dcad3d3fb21c1bed096d89a879a3343a0358400
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3191329
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2024-08-12 14:11:25 -07:00
Jon Hunter
951b2423a8 drivers: Fix platform_driver remove for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update all the impacted drivers
as necessary to fix this.

Bug 4749580

Change-Id: I3bb5c549777f7ccad0e3f870373fdd25726ad7ed
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3182878
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-08-11 17:20:34 -07:00
Jon Hunter
fc171fe539 drivers: Fix bus->match for Linux v6.11
In Linux v6.11, the 'bus_type' structure match() callback was updated to
make its 'drv' argument constant. Add a conftest test to detect this and
update the relevant drivers according to fix building them for Linux
v6.11.

Bug 4749580

Change-Id: I895d97241a7357074bb34b8e7a5bdfa2e31d5ca5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3183068
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-07-31 08:06:48 -07:00
Matti Ryttylainen
8bb21ea435 Camera: Add task_fence events for VI/ISP
Nsight needs task_fence events from camera engines.
Add task_fence event traces to be emitted during ISP task begin/end
and during VI frame end.

Jira CAMERASW-24223

Change-Id: Ia44baf73777f30abc823459f5e7dfd4d495d3ca6
Signed-off-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3141174
(cherry picked from commit ad0f0cba98173bbf055f5e69ebf175d9daf1ac3b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3181495
Reviewed-by: Sampatlal Arjunram Jangid <sjangid@nvidia.com>
Tested-by: Devang Kubavat <dkubavat@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Pushpesh Pranjal <ppranjal@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
2024-07-28 21:57:31 -07:00
Viswanath L
e0de45f88a nvadsp: Pass CPU freq to firmware via HWMBOX
Pass CPU freq, read from clock property "cpu_clock", to
firmware via HWMOX set in adsp_cpu_freq_hwmbox field.

Bug 4678940

Change-Id: Iebebb0cade69c8686b5d17b65a3405783fb5690e
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3180569
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Asha T <atalambedu@nvidia.com>
2024-07-25 14:05:47 -07:00
Viswanath L
13814dc9f7 nvadsp: Set shared_mem_hwmbox in resume flow
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>
2024-07-25 14:05:44 -07:00
Liang Cheng
a6d19ed508 psc: fix the spurous interrupt
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>
2024-07-19 03:11:03 -07:00
David Pu
a5b6d4a5b6 psc: fix oops when rmmod and clean up the driver
This patch fixes kernel Oops due to freeing psc_debug device multiple
times.

bug 4699764

Change-Id: I0a57317b1b064c08d657752a726d855533ec4d3c
Signed-off-by: David Pu <dpu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3166051
Tested-by: Liang Cheng (SW) <licheng@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-07-04 05:18:50 -07:00
Bharat Nihalani
a6af56f96c tegra_bl_debug: Copy profiler data to buffer
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>
2024-06-18 22:05:59 -07:00
Asha Talambedu
e670902c1f nvadsp: Fix typo in irq parsing
While parsing irqs from dt, one of the condition employs
wrong count due to typo. Fixed the same

Bug 4165898
Bug 3916054

Change-Id: I4d3225a47eea3410bb0074d0c7af1d28714c8b38
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3148652
Tested-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
2024-05-31 15:54:47 -07:00
Viswanath L
8862f64e15 nvadsp: Remove __init from probe functions
Sections placed in __init are freed after module load, which
causes kernel panic in certain flows. __init attribute adds no
value for loadable modules and hence removed.

Bug 4165898
Bug 3682950

Change-Id: I43eea5ed4e8a527e7b372c2b29322fe2aa67ea63
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3144493
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Tested-by: Ashish Mhetre <amhetre@nvidia.com>
2024-05-30 12:34:25 -07:00
Bharat Nihalani
b62173abe9 tegra_bl_debug: Do not check for bl_debug_data
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>
2024-05-21 17:51:12 -07:00
Viswanath L
c9f68ec529 nvadsp: Rely on WFI status if no interrupt
Check WFI status by regsiter query in case WFI
interrupt is not available.

Bug 3916054

Change-Id: Ideb0ac396623ad46e5d5ecf38738b99fd3366091
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3139589
Reviewed-by: Asha T <atalambedu@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-05-20 08:30:13 -07:00
Henry Lin
36d5ddcc8e platform: tegra: add tegra-hv-xhci driver
This commit adds a new driver called tegra-hv-xhci which handles xhci
IVC for virtualization.

Bug 3840188

Change-Id: I1958f8e321b3bc00fee2d103f77cd0b81a5ff3bf
Signed-off-by: Henry Lin <henryl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3118251
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jim Lin <jilin@nvidia.com>
Reviewed-by: EJ Hsu <ejh@nvidia.com>
Reviewed-by: WK Tsai <wtsai@nvidia.com>
2024-05-10 15:50:19 -07:00
Viswanath L
71ce55ca52 nvadsp: Change state dump prints to dev_err
Change state dump prints from dev_info to dev_err so that they
are captured in GVS logs upon error.

Bug 3682950

Change-Id: Ief4ffd2c03d4b8409f829271bf78df7150e917b5
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3129979
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
2024-05-07 02:22:42 -07:00
Viswanath L
52d1f0e2c1 nvadsp: Make function ptrs available in virt mode
Some device specific programming was moved from os.c to
dev-t18x.c as function pointers. Move the pointer assignments
so that they are not skipped in virt mode.

Bug 3682950

Change-Id: I8f2d0bde8cd37507d3bdfcd9ac7fb9fe344b891f
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3128039
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
2024-05-01 20:46:07 -07:00
Viswanath L
8090af66dd nvadsp: Make app completion wait uninterruptible
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>
2024-05-01 20:46:02 -07:00
Viswanath L
9da3bc6449 nvadsp: Modularize chip specific structures
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>
2024-04-11 18:05:27 -07:00
Viswanath L
27e6f14c0e nvadsp: AMC and AMISC changes for multi-instance
- 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>
2024-04-11 18:05:23 -07:00
Viswanath L
e2a1904d46 nvadsp: Add multi-instance support
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>
2024-04-11 18:05:18 -07:00
Henry Lin
b527781f64 platform: tegra: add tegra-hv-xhci-debug driver
This commit adds a new driver called tegra-hv-xhci-debug which
provides Tegra XHCI debug information (currently, only firmware
log is available) when Hypervisior is enabled.

Bug 200416215
Bug 3840188

Change-Id: I4cf471fad7079d20d1cd2d8a4e6e275d4fc9180b
Reviewed-on: https://git-master.nvidia.com/r/1534461
Reviewed-on: https://git-master.nvidia.com/r/1741129
Signed-off-by: Henry Lin <henryl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3096315
Reviewed-by: Jim Lin <jilin@nvidia.com>
Reviewed-by: WK Tsai <wtsai@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: EJ Hsu <ejh@nvidia.com>
2024-04-11 12:08:25 -07:00
rajangam
9b56ed79c0 t23x: psc: Add support to use other PSC instances
1.Updates the existing way of naming the debugfs nodes.
    2.HPSE and SB does not have SMMU ready would need to write
      all the data into the mailboxes, instead of using buffer

    JIRA: TMT-355

Change-Id: Ica5ad8a5efcc49bcdbe79eb3f3245e67458e507d
Signed-off-by: rajangam <rajangam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3084904
Reviewed-by: Liang Cheng (SW) <licheng@nvidia.com>
Reviewed-by: David Pu <dpu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-03-20 13:12:42 -07:00
Ketan Patil
2841339c6f mc-utils: Add support for t239
t239 was using mc-utils driver from kernel-nvidia folder as it was using
kernel k5.10; t239 is moving to kernel k6.1, hence update the mc-utils
driver from nvidia-oot to support t239.

Bug 4436559

Change-Id: I880a2fce377d65951983dea8876ca2954e9ddbc8
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3083702
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-03-06 23:29:21 -08:00
Bharat Nihalani
ed0204e0ae tegra_bootloader_debug: Register resume callbacks
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>
2024-03-04 15:39:15 -08:00
Jon Hunter
f0538cd58d camera: Handle probe deferral
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>
2024-02-29 15:40:34 -08:00
Viswanath L
19c895951f nvadsp: Use helper function __tegra_get_chip_id
tegra_get_chip_id() API is not exported from core kernel,
so use __tegra_get_chip_id() from fuse-helper.h instead.

Bug 4416828
Bug 4164138
Bug 3682950

Change-Id: Ieb6fde256c9fd7b5dfbd6975a030536834042cc5
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3078396
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-20 18:53:43 -08:00
Viswanath L
5713bc51b0 nvadsp: Use dynamically allocated shared mem
Upstream kernel does not export IOMMU APIs, so use dynamic
memory allocation for shared memory in non-secure boot mode.

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

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

Bug 4416828
Bug 4164138
Bug 3682950

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

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

Bug 4416828
Bug 4164138
Bug 3682950

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

Bug 4165898

Change-Id: I99cf03c06ed5d290e067b4fd3569febadbda607a
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3035268
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-01 13:48:18 -08:00
Viswanath L
dfc42d66a1 nvadsp: Add field in chip data to send boot config
Introduce a new field 'adsp_boot_config_hwmbox' in chip data
for passing boot config to ADSP, replacing the existing
method of writing chip_id into hwmbox1.

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

Bug 3682950

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

Bug 4448428

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

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

Bug 4448428

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