diff --git a/drivers/video/tegra/host/nvdla/nvdla.c b/drivers/video/tegra/host/nvdla/nvdla.c index b46b5388..f23b4bd1 100644 --- a/drivers/video/tegra/host/nvdla/nvdla.c +++ b/drivers/video/tegra/host/nvdla/nvdla.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -978,6 +979,8 @@ static int nvdla_probe(struct platform_device *pdev) struct nvdla_device *nvdla_dev = NULL; struct device *dev = &pdev->dev; uint32_t soft_fuse_ret = 0U; + int fuse_register_ret = 0U; + uint32_t register_value = 0U; struct tegra_soc_hwpm_ip_ops hwpm_ip_ops; #if !IS_ENABLED(CONFIG_TEGRA_GRHOST) @@ -1037,26 +1040,26 @@ static int nvdla_probe(struct platform_device *pdev) err = -ENODEV; goto err_no_ip; } - -#if KERNEL_VERSION(5, 11, 0) >= LINUX_VERSION_CODE } else { - - err = nvhost_nvdla_read_chip_option_register(pdev); - - if ((err & FUSE_OPT_DLA_0_DISABLED) +#if KERNEL_VERSION(5, 11, 0) >= LINUX_VERSION_CODE + fuse_register_ret = nvhost_nvdla_read_chip_option_register(pdev); +#else + err = tegra_fuse_readl(NVDLA_DISABLE_FUSE_REGISTER_OFFSET, ®ister_value); + fuse_register_ret = (int)register_value; +#endif + if ((fuse_register_ret & 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 ((err & FUSE_OPT_DLA_1_DISABLED) + if ((fuse_register_ret & 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 } } diff --git a/drivers/video/tegra/host/nvdla/nvdla.h b/drivers/video/tegra/host/nvdla/nvdla.h index 27eca154..1d232753 100644 --- a/drivers/video/tegra/host/nvdla/nvdla.h +++ b/drivers/video/tegra/host/nvdla/nvdla.h @@ -40,6 +40,13 @@ #endif /* CONFIG_TEGRA_HSIERRRPTINJ */ +/* DLA FUSE REGISTER + * Corresponds to the offset of "opt-dla-disable" - part of the + * struct tegra_fuse_cells of type nvmem_cell_info. + */ + +#define NVDLA_DISABLE_FUSE_REGISTER_OFFSET 0x3f0 + /* * macro to encode firmware version */