Commit Graph

89 Commits

Author SHA1 Message Date
Viswanath L
f985bb9f00 nvadsp: Fix priv data in show_os_version()
Fetch correct private data in show_os_version(). This function
is mapped to callback seq_file->seq_operations->show, which will
be called in seq_read() flow.

Bug 5122582

Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Change-Id: Ic8e4df342063139b91fa33297e59916ffb8b5a20
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3311120
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00: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
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
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
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
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
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
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
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
Jon Hunter
d5391a25ab drivers: Enable -Wmissing-prototypes
The compiler option -Wmissing-prototypes is being enabled globally in
the upstream Linux kernel and this causes build failures for various
drivers. The build failures occur because either the driver is missing
an include file which has the prototype or because the function is not
declared statically when it should be (ie. there are no external users).

Fix the various build failures and enable -Wmissing-prototypes to
prevent any new instances from occurring. Note that the only driver that
is not fixed at the moment is rtl8822ce due to large number of failures
and so build this with '-Wno-missing-prototypes' for now, which is not
different to how it was being compiled prior to this change.

Bug 4404965

Change-Id: Ie5572d23659e0346fa035d645d9043b0a6da5fdc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027488
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-14 02:07:24 -08:00
Laxman Dewangan
c8262cbee1 nvadsp: os: Fix the argument of iommu_map() for Linux 6.3
There is additional argument added in iommu_map() from Linux6.3.
Pass the proper argument from the drier who are using this
APIs. Using conftest methods for differentiating whether
additional argument is needed or not.

Bug 4374520

Change-Id: I0844beb3338a2d5237832867547d05da91a41a5f
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3026351
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-05 04:50:46 -08:00
Viswanath L
383e589822 nvadsp: Enable IOVA paths in driver
Enable driver paths that allocate IOVA memory for
ADSP OS and shared memory, where memory is required
at a fixed address.

Bug 4164138
Bug 3682950

Change-Id: I16563e14aefbcd55cc6455f88c1689664846c689
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988130
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 07:57:21 -07:00
Viswanath L
e45c6bc8a9 nvadsp: Move DRAM map to custom property
Move DRAM map DT entries from 'reg' to a new custom
property "nvidia,dram_map". This is to restrict the
use of 'reg' only for actual registers, which will
be tightly controlled by 'ranges' property.

Bug 4164138
Bug 3682950

Change-Id: Ia535d136b15a0ba6d7758ed3a2d70ace2c8cf763
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983549
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-26 12:10:39 -07:00
Viswanath L
fa4a7643c5 nvadsp: Remove ABRIDGE and UNIT_FPGA_RST from DT
Remove redundant DT 'reg' entries ABRIDGE and UNIT_FPGA_RST
and associated code. 0x0 in the reg entry will not be possible
when 'ranges' property explicitly defines the address ranges.

Bug 4164138
Bug 3682950

Change-Id: I4cb11f8d143b1958c586471674e87d1ab243564f
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983548
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-26 12:10:28 -07:00
Viswanath L
e2b06959b7 nvadsp: Generic changes for chip extensions
Below changes are made to support future
extensibility for new chips:

 - Chip data field 'adsp_prid' is added to specify DSP ID
 - Chip data field 'adsp_elf' is added to specify ELF file name
 - DT property "nvidia,cluster_mem" is added to specify cluster
    internal memories; ELF segments will be loaded into these
    using intermediate shadow buffers so that unaligned access
    is avoided
 - "nvidia,adsp_mem" entries are made optional (0x0 in the size
    field will indicate bypass)
 - Chip extension functions 'set_boot_vec' and 'set_boot_freqs'
    are added to support chip specific settings

Bug 4164138
Bug 3682950

Change-Id: I538ae0df57fa199a6eef75441167a9a5ba6924e8
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2894321
(cherry picked from commit fa7fc9d08af5fab9d0b2c5eb1b9b9a78446ade0e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971980
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:10:02 -07:00
Viswanath L
d5138e1c58 nvadsp: Fix build issues and enable
Fix build issues for nvadsp in OOT kernel and enable the build.

 - Below files copied from kernel/nvidia/include/linux/
    - tegra_nvadsp.h (72af3e78a6aff0fa250e9fd36b8414264d0e4c9a)
    - tegra-firmwares.h (700223e52f49f300664dd91335fa11111af733aa)
    - tegra-hsp.h (988be8f05033e1d728e046e918b506d829106082)
 - Below file copied from kernel/nvidia/include/uapi/misc/
    - adsp_console_ioctl.h (72af3e78a6aff0fa250e9fd36b8414264d0e4c9a)
 - Functions that needs additional AGIC APIs not supported in upstream
    are pushed under macro CONFIG_AGIC_EXT_APIS
 - T210 chip_data and references removed

Bug 4164138
Bug 3682950

Change-Id: I5dfb570e578ca3631896de7350cea66698612568
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971924
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:09:57 -07:00
Viswanath L
119c4f87e2 nvadsp: Update license and remove kernel ver check
- Update license of all files in nvadsp that will be used
 - Remove kernel version checks in the code

Bug 4164138
Bug 3682950

Change-Id: Ie1f9ba95c1d46c3dd9bc5614e502b1b444484df6
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2980528
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:09:52 -07:00
Viswanath L
83ee116f72 nvadsp: Check ADSP_STATUS before reset in suspend
Check L2_IDLE and L2_CLKSTOPPED in AMISC_ADSP_STATUS_0
before asserting ADSP reset in suspend flow.

Standby mode in ADSP L2CC Power Control register should be enabled
so that L2C clock is stopped after all cores enter WFI.

Bug 3700834

Change-Id: I4b89771968dd8b72dfea9920c9125562f8dfa92d
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2759621
(cherry picked from commit 7b819575670eb1e06e510a840977101cae3367be)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2765174
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Tested-by: Uday Gupta <udayg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-20 15:13:15 +00:00
Viswanath L
e6c266d6bf nvadsp: Add support for multiple FW
Support is added for launching multiple FW on ADSP (multiple
AMP, or combination of SMP and AMP). CONFIG_TEGRA_ADSP_MULTIPLE_FW
will need to be enabled.

Shared memory is communicated via the respective AHSP for the core.

For front door boot MB2 would have loaded the FW for all the cores.
Carveout allocation should be set as necessary (4x4 MB = 16 MB).

Backdoor boot via SMMU is also supported. Individual core FW for
AMP cores are loaded first, followed by core-0 FW at the end.

CCPLEX<->ADSP communication is limited to AHSP0, so only core-0
(SMP or AMP) will be accessible for command interface or signalling.

Bug 200745833

Change-Id: Ibfddd463de1ecada6fd47944ca12ef0444cd269f
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2722603
(cherry picked from commit 1e08636df25690017b8d7e1818eda210fef6da8b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2701452
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Viswanath L
9bfe26c72d nvadsp: Add chip ID major rev in T239
Extend chip ID in T239 with major revision so that
the value (=0x239) is distinct from T234.

Bug 200688972
Bug 3660611

Change-Id: If00da32ade7aa88f3dc6ba7f59038e5b4710a677
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2720497
(cherry picked from commit 246f43a203714c97b0df7e22e82d976c126b8267)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2725862
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
dramesh
2b0e81df35 audio: nvadsp: copy shared memory iova address
on Non-Secure FW load, incase FW explicitly defined a shared
memory region then ensure IOVA data populated correctly
into shared_adsp_os_data_iova.

Bug 3592962

Change-Id: I6c40f1c691f37fc14f6752759b97942e28c76f43
Signed-off-by: dramesh <dramesh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2700117
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Asha Talambedu
b1977843d8 nvadsp: Remove MBOX2 related logic
Replacing mbox2 usage with the help of existing mbox
used for os related communication with host cpu
so that the mbox2 can be used in 128 bit mbox usage

Bug 3581290

Change-Id: Iba750b6cedcc2e7b0c5ab1548e3614d77aaeb729
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2686392
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Akash Kollipara
11c878a96e audio: tegra: nvadsp: Fixed typecast warnings
- Fixed typecast warning
- Updated datatypes to make it compliant with kernel version > 5.10.0

Bug 3528414

Change-Id: Ief5cac399c35786e3f53dbe3199f70881e730df3
Signed-off-by: Akash Kollipara <akollipara@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2682497
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Niranjan Dighe
3fa96a4417 drivers: platform: nvadsp: Fix sparse issues
Fix multiple instances of the following issues -
- warning: incorrect type in argument 2 (different address spaces)
- warning: symbol 'file_size' was not declared. Should it be static?

Bug 3528414

Change-Id: I2cbda8dbfc98b134f36ec3c291a5147d96c6ff82
Signed-off-by: Niranjan Dighe <ndighe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2684747
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Uday Gupta
19cf0a1232 nvadsp: Use HWMBOX5 for ADSP OS decompression
There is a decompress_done flag in the adsp OS firmware
that was earlier used to indicate that decompress is done
at the adsp os cold boot

However this flag cannot be part of firmware
as fw needs to authenticated at the sc7 resume as well and
hence the fw should not have modifications

On fw side, the flag is removed. Instead the same information
is preserved across sc7 cycles via HWMBOX5 and this driver
enables the decompress bit to indicate the same to adsp at
cold start

Bug 3491011

Change-Id: I77d1ff6defdf1228f4cd4278cf5bb667df51fad1
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2660706
Tested-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Sharad Gupta
9b526e03db nvadsp: CERT-C Fixes
Fixed for L1 issues :

Return value check for snprintf
NULL pointer check using IS_ERR_OR_NULL

Bug 3512545

CID 407176
CID 429671
CID 471352

Signed-off-by: Sharad Gupta <sharadg@nvidia.com>
Change-Id: Ib03339db8dc669b6eff448941fac62b2feabf7bc
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2679048
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Akash Kollipara <akollipara@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Sharad gupta
3ea7c9344c nvadsp: os: CERT-C Fixes
Uploaded fix to address coverity issues.

1. Fix for string assignment to a char ptr (const)
2. Unsigned int type variable to hold AGIC IRQ number
3. Misc. : added error handling for null pointers

Bug 3512545

CID : 407176, 339372, 426068, 349597, 408235,
468432, 425451, 339564, 340901, 360199, 482718,
338388, 434000, 488442, 355983, 437791, 444590,
409920, 423102, 416511, 426540, 392115, 451458,
355042, 443648, 420343, 423532, 488763, 476874,
404805, 380630, 358854, 485375, 483303, 462651,
371708, 465040, 447093, 406990, 335646, 437343,
467012, 378419, 428324, 354351, 460155, 415702,
376737,  390977, 414736, 411426, 393560, 490887

Change-Id: I5c847fa02438931e95107d06333014fb802c8207
Signed-off-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2672112
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Viswanath L
a99d68a86e nvadsp: Add provision to specify ADSP ELF name
Provision is added to specify ADSP ELF name from DT, using prop
'nvidia,adsp_elf'. This will be picked from /lib/firmware/ when
ADSP boots in backdoor mode. Default name remains "adsp.elf", if
the prop is not specified.

Bug 200746669
Bug 200773359

Change-Id: Ie5a4ba60fa2c049b7895967326a325257a65bb82
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2662909
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Akash Kollipara
0b2760e995 nvadsp: Handles adspff init failure
- Avoids adspff init in non-secure boot mode
 - Avoids boot failure if adspff.elf is absent
   on secure boot mode

Bug 200773359
Bug 200746669

Change-Id: Ib62ce4ecae3434b7c7fde57e8735620976d2a653
Signed-off-by: Akash Kollipara <akollipara@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2641776
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Viswanath L
ac60258ffd nvadsp: Add provision to configure timeout
Provision is added to specify the OS load timeout
from DT, using property "nvidia,adsp_load_timeout".

Bug 200745795
Bug 200746669

Change-Id: Ie868a1528ad9d39200a0359f6a9d54a2832b0547
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2622380
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Viswanath L
8036a9525f nvadsp: Pass platform info to ADSP
Provision is made to pass the Tegra platform information to ADSP
("nvidia,tegra_platform" DT property, as per enum tegra_platform);
this will be useful to convey whether the platform is CMODEL, in
which case the ADSP may take CMODEL specific paths, like using
HSP shared interrupts.

Upper 16 bits of nvadsp_os_args.chip_id is used to convey the
platform information; this may be improved in future as a
separate structure member.

Bug 200745795
Bug 200746669

Change-Id: Ibd9423eebb06fc4d243c132ab1cb7c6dc558ba5e
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2622156
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Asha Talambedu
f33770d313 tegra: nvadsp: Timeout added on wait for app start
In cold boot stress test, it is observed that adsp OS
hung intermittently(1/276). Due to which
1) app init of adspff is not able to
complete as it does not receive start ack from adsp
2) wdt handler is triggered as adsp is hung for more
than 10 seconds.

When poweroff is issued in such case,
the alsactl save/restore job which is part of shutdown
sequence is hung as its unable to acquire lock held by
host adsp audio driver fn that initiated nvadsp_os_start.

Therefore, timeout is added while waiting for app init.
If app init fails to happen within timeout duration,
error status is received by nvadsp_os_start
which inturn is received by host side adsp audio driver.
This ensures that lock is released in case of adsff_init
failure in nvadsp_os_start function so that shutdown
can proceed without issue.

Bug 3391964

Change-Id: Ieca54fe9dd21bf9de70d781cfaceb5ffe83809ef
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2626892
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Viswanath L
bb93b07676 nvadsp: Pass shared mem via MBX in backdoor boot
In backdoor boot if shared memory region is not defined in the
ADSP FW then assume it to be placed at the start of OS memory
and communicate the same via MBX. In case MBX is not available
then the boot is aborted.

Bug 200745795
Bug 200746669

Change-Id: I15cd4f3f07dd91c2700479906d19b9219814e2f6
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2613565
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Viswanath L
6360f074cf nvadsp: Add backdoor boot via CO memory
Support is added for backdoor boot via CO memory (i.e. no SMMU). To
use this mode, 'nvidia,adsp_os_secload' property should be removed
and reserved-memory:adspos_carveout node enabled.

ACAST mapping in this mode should span the exact CO reserved region.

Bug 200745795
Bug 200746669

Change-Id: I6bbb84d3278db8f69e60933d63a900c2797fc425
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2613521
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Asha Talambedu
8f504dc84e nvadsp: Write chip id to h/w mailbox1
Need to communicate chip id info so that ast settings
can be enabled only for t186/t194 from ADSP. Hence,
HWMBOX1 is used to communicate the same

Bug 200684491

Change-Id: If7ae5f58fc410fd7cbb19c9e0129bead8740e88b
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2529141
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Mohan Kumar
4464d26007 nvadsp: Add Interconnect support for ADSP
Add Interconnect API support for ADSP Memory bandwidth requirement
handling.

From Kernel 4.14 and beyond
- On T23X and newer platforms, the interconnects driver will be initialized
  and calls to BWMGR will be stubbed out.
- On T194 and earlier platforms, BWMGR driver will be initialized and calls
  to interconnect framework will be stubbed out.

Added code check with K5.9 as mc_utils.h header is present from K5.9 build

For Kernel 4.9 and earlier

- T23x will not be supported.
- T194 and earlier platforms will use BWMGR. Interconnect framework is not
  available.

JIRA TAS-1060

Change-Id: Ie0b4040f374a3c6102cb7aff2506d8cf2f0eab69
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2414369
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Sameer Pujar
86b6ccfd04 nvadsp: fix v5.9-rc4 build error
After v5.9-rc4 merge in dev-main-5.9 many build errors are seen with
ADSP config CONFIG_TEGRA_ADSP_LPTHREAD. Some of these build errors
are listed below.

* kernel/nvidia/drivers/platform/tegra/nvadsp/adsp_lpthread.c:15:0:
  kernel-5.9/include/linux/uaccess.h: In function ‘force_uaccess_begin’:
  kernel-5.9/include/linux/uaccess.h:20:2: error: implicit declaration
      of function ‘set_fs’; did you mean ‘get_fs’?
      [-Werror=implicit-function-declaration]
      set_fs(USER_DS);
      ^~~~~~

* kernel-5.9/arch/arm64/include/asm/uaccess.h: In function
      ‘__uaccess_mask_ptr’:
  kernel-5.9/arch/arm64/include/asm/uaccess.h:240:41: error: invalid type
      argument of ‘->’ (have ‘int’) : "r" (ptr), "r"
      (current_thread_info()->addr_limit),
                            ^~

  ...

The errors appear to be related to 'uaccess.h' header and following
inclusion order is causing build failures for some reason. Checked with
other source files with below and same behavior is seen.

  #include <asm/uaccess.h>
  #include <linux/uaccess.h>
  ...

Issue goes away after replacing 'asm/uaccess.h' with 'linux/uaccess.h'.
It should be noted that latter header by default includes the former one.
For consistency this is done for other relevant ADSP files too.

Bug 200657500

Change-Id: I7ce98c46327a825711c4fa9ab791afc65b1cbf1b
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2417265
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Sameer Pujar
08391815ee Revert "[TEMP] nvadsp: request clk_round_rate() for 600 MHz"
This reverts commit 9786bb772a32456102f4de622c9ce3ee35784920.

The original commit earlier was done to avoid a clock issue in BPMP as a
temporary fix. Since now the root cause is addressed in BPMP it can be
reverted.

Bug 200617376

Change-Id: I64df2f33e1fd294c151ae4f7b39e2d9ea321b5c6
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2354898
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Bitan Biswas
c880772741 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>
2023-06-20 15:13:15 +00:00
Sameer Pujar
134ade9bf2 nvadsp: request clk_round_rate() for 600 MHz
On 5.4 kernel clk_round_rate(), for ACLK with ULONG_MAX request, is
returning minimum possible value for ACLK and this is causing a
failure with ADSP OS load. The issue is found in BPMP where there
is a problem with data mis-alignment. Till this gets addressed a TEMP
change is provided here to unblock ADSP audio related work.

This can be reverted once original BPMP fix is merged.

Bug 200593718

Change-Id: I1965986770424f2a8560e011ca892b700cdc0258
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2345133
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Sameer Pujar
29efd1bd1b nvadsp: fix build errors due to chip-id.h
5.4 kernel no longer uses chip-id.h and instead fuse.h is used.
Currently this causes build issues in ADSP driver code and hence
related drivers are updated to make use of references as per
fuse.h for 5.4 kernel.

The issue is not seen on TOT because ADSP is not yet enabled.

Bug 200593718

Change-Id: I82af6a4f02ce64da4b20875a28f8ef9488b92e54
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2341652
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Bitan Biswas
ceb4b9f02e kernel: nvidia: use fuse.h instead of chip-id.h in k5.4
bug 200591811

Change-Id: If72122efdeda154f435f79da8f2cd9cad644d380
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2337930
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Asha Talambedu
b24ad07d95 nvadsp: Remove symbol table creation for l4t
Removed symbol table for L4T platform that has symbol stripped
adsp-fw

Bug 200536088

Change-Id: I18187479c796c98ce2dcc5865e1175dd9d7c9f5e
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
(cherry picked from commit 4089e712d554081a69f34e60a01459cb19e1978c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2308814
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Dipesh Gandhi
b72af873f4 ASoC: tegra-virt-alt: lpthread init via amixer
Change exposes lpthread/adsp usage trigger via
amixer. This is needed to make sound card aware
of lpthread state. Without this STR adsp feature
breaks as currently lpthread is written in such
a manner which does not allow adsp to suspend.

Bug 200552183

Change-Id: I2cc1e0fd805a982686bbd034b2c6e094b56df23b
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2198693
(cherry picked from commit e9bd14fd6eb0305cc583092752e6bdccc9c5e76a)
Reviewed-on: https://git-master.nvidia.com/r/2250202
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Swati Sachdeva <ssachdeva@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Niranjan Dighe
a1a7e31c61 Revert "adsp: add dma_set_mask parse"
This reverts commit 4c531e24d2a08eaef19ea5e366374d0aab6b58bd.

Jira EMA-1251

Change-Id: I3de386b442ecf3beca938db0725bbe3e673d15c1
Signed-off-by: Niranjan Dighe <ndighe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2166541
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Niranjan Dighe
15961fe4f8 nvadsp: logger: reset is_opened flag on file close
adsp_logger file could not be re-opened after closing and open call
always returned -EBUSY. This was because logger->is_opened was never
reset in the file close path. Setting it to 0 in .release callback
solves the problem.

Jira EMA-1321

Change-Id: I42834fa7af19bacc4326cd32745996b6f4e47686
Signed-off-by: Niranjan Dighe <ndighe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2153912
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Gaurav Tendolkar
857731124c nvadsp: adspff: use kthread to schedule file io
- Workqueue scheduling latency causes issues for
  adsp apps requiring real time behaviour. Hence
  use RT kthread to schedule the file io functions
- file open with O_TRUNC flag may take long time
  Hence we open the file just once and just reset
  the read/write pointers in a file close call
- Expose sysfs entry to actually close all files
  opened by kernel

Bug 1846449
Jira EMA-847

Change-Id: I3c130b36e5f5f5a0e65ddb4c44efc8754fb006d2
Signed-off-by: Gaurav Tendolkar <gtendolkar@nvidia.com>
Reviewed-on: http://git-master/r/1314984
(cherry picked from commit 00f5d0b48aa0df9a720c6fd15b4cffd827408375)
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2029203
(cherry picked from commit 6760f7d61a589b90a8c156a38e4453b518a20b05)
Reviewed-on: https://git-master.nvidia.com/r/2030551
(cherry picked from commit c136844cd4147c25478fe39a15122a1f43553079)
Reviewed-on: https://git-master.nvidia.com/r/2150778
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Niranjan Dighe <ndighe@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00