Skip to content

Commit e5c8898

Browse files
committed
Merge branch 'for-5.10/soc' into for-5.10/firmware
2 parents 9123e3a + 52e6d39 commit e5c8898

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

drivers/soc/tegra/fuse/fuse-tegra.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static ssize_t platform_show(struct device *dev, struct device_attribute *attr,
336336
* platform type is silicon and all other non-zero values indicate
337337
* the type of simulation platform is being used.
338338
*/
339-
return sprintf(buf, "%d\n", (tegra_read_chipid() >> 20) & 0xf);
339+
return sprintf(buf, "%d\n", tegra_get_platform());
340340
}
341341

342342
static DEVICE_ATTR_RO(platform);

drivers/soc/tegra/fuse/tegra-apbmisc.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,30 @@ u8 tegra_get_minor_rev(void)
4747
return (tegra_read_chipid() >> 16) & 0xf;
4848
}
4949

50+
u8 tegra_get_platform(void)
51+
{
52+
return (tegra_read_chipid() >> 20) & 0xf;
53+
}
54+
55+
bool tegra_is_silicon(void)
56+
{
57+
switch (tegra_get_chip_id()) {
58+
case TEGRA194:
59+
if (tegra_get_platform() == 0)
60+
return true;
61+
62+
return false;
63+
}
64+
65+
/*
66+
* Chips prior to Tegra194 have a different way of determining whether
67+
* they are silicon or not. Since we never supported simulation on the
68+
* older Tegra chips, don't bother extracting the information and just
69+
* report that we're running on silicon.
70+
*/
71+
return true;
72+
}
73+
5074
u32 tegra_read_straps(void)
5175
{
5276
WARN(!chipid, "Tegra ABP MISC not yet available\n");

include/soc/tegra/fuse.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
u32 tegra_read_chipid(void);
2525
u8 tegra_get_chip_id(void);
26+
u8 tegra_get_platform(void);
27+
bool tegra_is_silicon(void);
2628

2729
enum tegra_revision {
2830
TEGRA_REVISION_UNKNOWN = 0,

0 commit comments

Comments
 (0)