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>
This commit is contained in:
Viswanath L
2024-02-16 07:48:33 +00:00
committed by mobile promotions
parent 289095dfc6
commit 19c895951f
4 changed files with 8 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
tegra-bootloader-debug-objs := tegra_bootloader_debug.o tegra-bootloader-debug-objs := tegra_bootloader_debug.o
obj-m += tegra-bootloader-debug.o obj-m += tegra-bootloader-debug.o
@@ -20,7 +20,4 @@ obj-m += rtcpu/
endif endif
obj-m += aon/ obj-m += aon/
obj-m += tegra-uss-io-proxy.o obj-m += tegra-uss-io-proxy.o
ifneq ($(filter noble oot,$(patsubst -,$(space),$(NV_BUILD_KERNEL_OPTIONS))),)
obj-m += nvadsp/ obj-m += nvadsp/
endif

View File

@@ -13,7 +13,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/tegra_nvadsp.h> #include <linux/tegra_nvadsp.h>
#include <linux/version.h> #include <linux/version.h>
#include <soc/tegra/fuse.h> #include <soc/tegra/fuse-helper.h>
#include <soc/tegra/virt/hv-ivc.h> #include <soc/tegra/virt/hv-ivc.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/clk/tegra.h> #include <linux/clk/tegra.h>
@@ -130,9 +130,7 @@ static void nvadsp_bw_register(struct nvadsp_drv_data *drv_data)
{ {
struct device *dev = &drv_data->pdev->dev; struct device *dev = &drv_data->pdev->dev;
switch (tegra_get_chip_id()) { switch (__tegra_get_chip_id()) {
case TEGRA210:
case TEGRA186:
case TEGRA194: case TEGRA194:
drv_data->bwmgr = tegra_bwmgr_register( drv_data->bwmgr = tegra_bwmgr_register(
TEGRA_BWMGR_CLIENT_APE_ADSP); TEGRA_BWMGR_CLIENT_APE_ADSP);
@@ -569,7 +567,7 @@ static struct nvadsp_chipdata tegra239_adsp_chipdata = {
.amc_err_war = false, .amc_err_war = false,
/* Populate Chip ID Major Revision as well */ /* Populate Chip ID Major Revision as well */
.chipid_ext = true, .chipid_ext = 0x9,
.num_irqs = NVADSP_VIRQ_MAX, .num_irqs = NVADSP_VIRQ_MAX,
.num_regs = APE_MAX_REG, .num_regs = APE_MAX_REG,
}; };

View File

@@ -155,7 +155,7 @@ struct nvadsp_chipdata {
bool amc_not_avlbl; bool amc_not_avlbl;
bool amc_err_war; bool amc_err_war;
bool chipid_ext; u32 chipid_ext;
u32 adsp_prid; u32 adsp_prid;
char *adsp_elf; char *adsp_elf;

View File

@@ -13,7 +13,7 @@
#include <linux/firmware.h> #include <linux/firmware.h>
#include <linux/tegra_nvadsp.h> #include <linux/tegra_nvadsp.h>
#include <linux/version.h> #include <linux/version.h>
#include <soc/tegra/fuse.h> #include <soc/tegra/fuse-helper.h>
#include <soc/tegra/virt/hv-ivc.h> #include <soc/tegra/virt/hv-ivc.h>
#include <linux/elf.h> #include <linux/elf.h>
#include <linux/device.h> #include <linux/device.h>
@@ -111,9 +111,6 @@ struct nvadsp_mappings {
int len; int len;
}; };
extern u8 tegra_get_major_rev(void);
extern u8 tegra_get_minor_rev(void);
static struct nvadsp_mappings adsp_map[NM_LOAD_MAPPINGS]; static struct nvadsp_mappings adsp_map[NM_LOAD_MAPPINGS];
static int map_idx; static int map_idx;
static struct nvadsp_mbox adsp_com_mbox; static struct nvadsp_mbox adsp_com_mbox;
@@ -889,9 +886,9 @@ static void nvadsp_set_shared_mem(struct platform_device *pdev,
priv.logger.dev = dev; priv.logger.dev = dev;
priv.adsp_os_fw_loaded = true; priv.adsp_os_fw_loaded = true;
chip_id = (u32)tegra_get_chip_id(); chip_id = (u32)__tegra_get_chip_id();
if (drv_data->chip_data->chipid_ext) if (drv_data->chip_data->chipid_ext)
chip_id = (chip_id << 4) | tegra_get_major_rev(); chip_id = (chip_id << 4) | drv_data->chip_data->chipid_ext;
os_args = &shared_mem->os_args; os_args = &shared_mem->os_args;
/* Chip id info is communicated twice to ADSP /* Chip id info is communicated twice to ADSP