Commit Graph

8 Commits

Author SHA1 Message Date
Jon Hunter
4b5bdb9393 nvadsp: t264: Add missing bits.h header
With Linux v6.13, the Tegra264 NVADSP driver fails to build and the
following errors are observed:

 In file included from drivers/platform/tegra/nvadsp/dev-t264.c:4:
  include/linux/reset.h:30:49: error: implicit declaration of function
  ‘BIT’ [-Werror=implicit-function-declaration]
   30 | #define RESET_CONTROL_FLAGS_BIT_ACQUIRED        BIT(2)
      |                                                 ^~~

 In file included from drivers/platform/tegra/nvadsp/dev-t264-aon.c:4:
  /include/linux/reset.h:30:49: error: implicit declaration of function
  ‘BIT’ [-Werror=implicit-function-declaration]
   30 | #define RESET_CONTROL_FLAGS_BIT_ACQUIRED        BIT(2)
      |                                                 ^~~

Fix this by adding the missing 'bits.h' header.

Bug 4991705

Change-Id: I08a6cb59339f8e5221fdc3f39b2a7323cae0cd1f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261688
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
2025-07-24 10:19:11 +00:00
Viswanath L
051d5cb932 nvadsp: t264: Toggle AON_CPU clk at suspend/resume
Enable/disable AON_CPU clock at runtime resume/suspend
so that the clock is enabled only upon need and we do not
depend on MB2 to enable the clock unconditionally.

Also disable runtime suspend/resume if AON CPU is already in
running state at driver probe, indicating always ON operation.

Bug 4777122

Change-Id: I0b6037bd47b54d012af7ccfcea2c3a6102ced781
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3223014
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233301
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
2025-07-24 10:19:08 +00:00
Viswanath L
4714f80198 nvadsp: t264: Implement AON_CPU assert/deassert
Implement CAR assert/deassert of AON_CPU so that
it is pulled into reset at os_suspend() call.

Bug 3916054

Change-Id: I6069c2f12b5809e6ec8db8f304f9e5bf65a0b636
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3181031
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Asha T <atalambedu@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
2025-07-24 10:19:07 +00:00
Viswanath L
a9663f6164 nvadsp: t264: Set HWMBOX to pass CPU freq
Set TYPE1_DATA2 register (offset 0x08050) of
HWMBOX1 to pass CPU freq to firmware.

Bug 4678940

Change-Id: I54a882cf329b3e0bb24b8cff5f6196d58b60f072
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3180576
Reviewed-by: Asha T <atalambedu@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
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
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
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