mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
soc/tegra: fuse-helper: Add platform helper functions
Various downstream drivers needs platform information i.e. if it is running on silicon or simulation. This patch adds following functions: * tegra_platform_is_silicon() * tegra_platform_is_sim() * tegra_platform_is_fpga() * tegra_platform_is_vdk() Bug 3777983 Change-Id: Ice319748c5bbdbf3f4e16c3464f60e4a8e316b46 Signed-off-by: Kartik <kkartik@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2807762 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2894847 GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
1244fb5669
commit
c95fa541d2
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/version.h>
|
||||
#include <linux/sys_soc.h>
|
||||
#include <soc/tegra/fuse.h>
|
||||
|
||||
#define FUSE_SKU_INFO 0x10
|
||||
@@ -19,18 +20,47 @@ static inline u32 tegra_get_sku_id(void)
|
||||
|
||||
#ifdef CONFIG_TEGRA_FUSE_UPSTREAM
|
||||
|
||||
/*
|
||||
* For upstream the following functions to determine if the
|
||||
* platform is silicon and simulator are not supported and
|
||||
* so for now, always assume that we are silicon.
|
||||
*/
|
||||
static inline bool tegra_platform_is_silicon(void)
|
||||
{
|
||||
return true;
|
||||
const struct soc_device_attribute tegra_soc_attrs[] = {
|
||||
{ .revision = "Silicon*" },
|
||||
{/* sentinel */}
|
||||
};
|
||||
|
||||
if (soc_device_match(tegra_soc_attrs))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool tegra_platform_is_sim(void)
|
||||
{
|
||||
return !tegra_platform_is_silicon();
|
||||
}
|
||||
|
||||
static inline bool tegra_platform_is_fpga(void)
|
||||
{
|
||||
const struct soc_device_attribute tegra_soc_attrs[] = {
|
||||
{ .revision = "*FPGA" },
|
||||
{/* sentinel */}
|
||||
};
|
||||
|
||||
if (soc_device_match(tegra_soc_attrs))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool tegra_platform_is_vdk(void)
|
||||
{
|
||||
const struct soc_device_attribute tegra_soc_attrs[] = {
|
||||
{ .revision = "VDK" },
|
||||
{/* sentinel */}
|
||||
};
|
||||
|
||||
if (soc_device_match(tegra_soc_attrs))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user