kernel: nvidia: use k5.4 fuse APIs

Selected k4.14 fuse API mapping to k5.4 fuse API used is:
	tegra_read_chipid()		->	tegra_read_chipid()
	enum tegra_chipid tegra_get_chipid() ->	u8 tegra_get_chip_id()
	u8 tegra_get_chip_id()		->	u8 tegra_get_chip_id()
	tegra_get_platform()		->	tegra_get_platform()
	tegra_hidrev_get_chipid(chipid) ->	u8 tegra_get_chip_id()
	enum tegra_revision tegra_chip_get_revision() ->
				enum tegra_revision tegra_chip_get_revision()
		(Note: chip specific revision enum removed in k5.4,
		hence chip_id and revision comparison needed now.)
	u32 tegra_get_sku_id()		->	u32 tegra_get_sku_id()

Below downstream fuse data types are no longer used in k5.4:
	enum tegra_chipid

K5.4 specific T210b01 check is done using is_t210b01_sku().

bug 200591811

Change-Id: I2a259669802cb22bccafd435fa9fb7027ee0a9d3
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2335855
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Bitan Biswas
2020-04-28 16:39:40 -07:00
committed by Laxman Dewangan
parent e5d321cc10
commit 4176935c35
2 changed files with 22 additions and 6 deletions

View File

@@ -26,6 +26,7 @@
#include <linux/dma-attrs.h>
#include <linux/dma-mapping.h>
#include <linux/uaccess.h>
#include <linux/version.h>
#include <soc/tegra/fuse.h>
#include "dev.h"
@@ -734,14 +735,22 @@ static int nvdla_probe(struct platform_device *pdev)
goto err_get_pdata;
}
#if KERNEL_VERSION(4, 15, 0) > LINUX_VERSION_CODE
if (tegra_get_chipid() == TEGRA_CHIPID_TEGRA19 &&
#else
if (tegra_get_chip_id() == TEGRA194 &&
#endif
tegra_get_sku_id() == 0x9E) {
dev_err(dev, "NVDLA IP is disabled in SKU\n");
err = -ENODEV;
goto err_no_ip;
}
#if KERNEL_VERSION(4, 15, 0) > LINUX_VERSION_CODE
if (tegra_get_chipid() == TEGRA_CHIPID_TEGRA19 &&
#else
if (tegra_get_chip_id() == TEGRA194 &&
#endif
tegra_get_sku_id() == 0x9F &&
pdata->class == NV_DLA1_CLASS_ID) {
dev_err(dev, "NVDLA1 IP is disabled in SKU\n");

View File

@@ -19,15 +19,18 @@
#include <linux/platform_device.h>
#include <linux/debugfs.h>
#include <linux/nvhost.h>
#include <linux/uaccess.h>
#include <linux/delay.h>
#include <linux/version.h>
#include <soc/tegra/fuse.h>
#if KERNEL_VERSION(4, 15, 0) > LINUX_VERSION_CODE
#include <soc/tegra/chip-id.h>
#endif
#include "host1x/host1x.h"
#include "flcn/flcn.h"
#include "flcn/hw_flcn.h"
#include "dla_os_interface.h"
#include <linux/uaccess.h>
#include <soc/tegra/fuse.h>
#include <soc/tegra/chip-id.h>
#include <linux/delay.h>
#include "nvdla/nvdla.h"
#include "nvdla_debug.h"
#include "nvhost_acm.h"
@@ -571,9 +574,13 @@ static ssize_t debug_dla_fw_a01_war_set(struct file *file,
if (val < 0) /* "0" to disable WAR, positive value to enable WAR */
return count;
#if KERNEL_VERSION(4, 15, 0) > LINUX_VERSION_CODE
if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA19) &&
(tegra_chip_get_revision() == TEGRA194_REVISION_A01))
#else
if ((tegra_get_chip_id() == TEGRA194) &&
(tegra_chip_get_revision() == TEGRA_REVISION_A01))
#endif
if (val)
nvdla_dev->quirks |= (NVDLA_QUIRK_T194_A01_WAR);
else