Re: [PATCH 6/9] soc/tegra: fuse: Implement tegra_is_silicon()
From: Jon Hunter <jonathanh@nvidia.com>
Date: 2020-09-07 19:33:28
Also in:
linux-arm-kernel
From: Jon Hunter <jonathanh@nvidia.com>
Date: 2020-09-07 19:33:28
Also in:
linux-arm-kernel
On 16/07/2020 15:18, Thierry Reding wrote:
From: Thierry Reding <redacted> This function can be used by drivers to determine whether code is running on silicon or on a simulation platform. Signed-off-by: Thierry Reding <redacted> --- drivers/soc/tegra/fuse/tegra-apbmisc.c | 13 +++++++++++++ include/soc/tegra/fuse.h | 1 + 2 files changed, 14 insertions(+)diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c index 89f1479b4d0e..be6b7fc169ca 100644 --- a/drivers/soc/tegra/fuse/tegra-apbmisc.c +++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c@@ -52,6 +52,19 @@ u8 tegra_get_platform(void) return (tegra_read_chipid() >> 20) & 0xf; } +bool tegra_is_silicon(void) +{ + switch (tegra_get_chip_id()) { + case TEGRA194: + if (tegra_get_platform() == 0) + return true; + + return false; + } + + return false; +} +
Should we do this the other way around and default to is-silicon? For devices prior to Tegra194, this will always return false. Jon -- nvpublic