soc/tegra: fuse: Implement tegra_is_silicon()
This function can be used by drivers to determine whether code is running on silicon or on a simulation platform. Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>zero-sugar-mainline-defconfig
parent
775edf7856
commit
52e6d399a4
|
@ -52,6 +52,25 @@ u8 tegra_get_platform(void)
|
||||||
return (tegra_read_chipid() >> 20) & 0xf;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chips prior to Tegra194 have a different way of determining whether
|
||||||
|
* they are silicon or not. Since we never supported simulation on the
|
||||||
|
* older Tegra chips, don't bother extracting the information and just
|
||||||
|
* report that we're running on silicon.
|
||||||
|
*/
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
u32 tegra_read_straps(void)
|
u32 tegra_read_straps(void)
|
||||||
{
|
{
|
||||||
WARN(!chipid, "Tegra ABP MISC not yet available\n");
|
WARN(!chipid, "Tegra ABP MISC not yet available\n");
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
u32 tegra_read_chipid(void);
|
u32 tegra_read_chipid(void);
|
||||||
u8 tegra_get_chip_id(void);
|
u8 tegra_get_chip_id(void);
|
||||||
u8 tegra_get_platform(void);
|
u8 tegra_get_platform(void);
|
||||||
|
bool tegra_is_silicon(void);
|
||||||
|
|
||||||
enum tegra_revision {
|
enum tegra_revision {
|
||||||
TEGRA_REVISION_UNKNOWN = 0,
|
TEGRA_REVISION_UNKNOWN = 0,
|
||||||
|
|
Loading…
Reference in New Issue