nvdla: kmd: Don't read DLA fuses for upstream Linux

The DLA fuses are not exposed via nvmem for upstream Linux kernels and
so when booting upstream Linux kernels the following warnings are seen
for DLA:

 nvdla 158c0000.nvdla1: nvmem_cell_get error -2. Assuming DLA instances
  are available
 nvdla 15880000.nvdla0: nvmem_cell_get error -2. Assuming DLA instances
  are available

Disabling DLA instances for devices that don't support DLA is handled by
the bootloader and so for Linux kernel's greater than v5.10, it is not
necessary for the kernel driver to check this.

Bug 3795915

Change-Id: Icbd5e7c522a66a827fe1ed58ed2271a98497bbcd
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2870158
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2023-03-13 12:01:10 +00:00
committed by Laxman Dewangan
parent 60c893bc80
commit 27a989988e

View File

@@ -823,6 +823,7 @@ static uint32_t nvdla_read_soft_sku_scratch_register(void)
return dla_soft_sku_opt_disable;
}
#if KERNEL_VERSION(5, 11, 0) >= LINUX_VERSION_CODE
static int nvhost_nvdla_read_chip_option_register(struct platform_device *pdev)
{
/* Read floor sweeping info using nvmem api
@@ -892,6 +893,7 @@ out:
return ret;
}
#endif
/* driver probe and init */
static struct of_device_id tegra_nvdla_of_match[] = {
@@ -921,7 +923,6 @@ static int nvdla_probe(struct platform_device *pdev)
struct nvhost_device_data *pdata = NULL;
struct nvdla_device *nvdla_dev = NULL;
struct device *dev = &pdev->dev;
int fuse_ret = 0;
uint32_t soft_fuse_ret = 0U;
#ifdef CONFIG_TEGRA_SOC_HWPM
struct tegra_soc_hwpm_ip_ops hwpm_ip_ops;
@@ -978,23 +979,25 @@ static int nvdla_probe(struct platform_device *pdev)
goto err_no_ip;
}
#if KERNEL_VERSION(5, 11, 0) >= LINUX_VERSION_CODE
} else {
fuse_ret = nvhost_nvdla_read_chip_option_register(pdev);
err = nvhost_nvdla_read_chip_option_register(pdev);
if ((fuse_ret & FUSE_OPT_DLA_0_DISABLED)
if ((err & FUSE_OPT_DLA_0_DISABLED)
&& (pdata->class == NV_DLA0_CLASS_ID)) {
dev_err(dev, "NVDLA0 IP is disabled in Fuse\n");
err = -ENODEV;
goto err_no_ip;
}
if ((fuse_ret & FUSE_OPT_DLA_1_DISABLED)
if ((err & FUSE_OPT_DLA_1_DISABLED)
&& (pdata->class == NV_DLA1_CLASS_ID)) {
dev_err(dev, "NVDLA1 IP is disabled in Fuse\n");
err = -ENODEV;
goto err_no_ip;
}
#endif
}
}