linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-tegra@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Jon Hunter <jonathanh@nvidia.com>
Subject: [PATCH 6/9] soc/tegra: fuse: Implement tegra_is_silicon()
Date: Thu, 16 Jul 2020 16:18:53 +0200	[thread overview]
Message-ID: <20200716141856.544718-7-thierry.reding@gmail.com> (raw)
In-Reply-To: <20200716141856.544718-1-thierry.reding@gmail.com>

From: Thierry Reding <treding@nvidia.com>

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 <treding@nvidia.com>
---
 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;
+}
+
 u32 tegra_read_straps(void)
 {
 	WARN(!chipid, "Tegra ABP MISC not yet available\n");
diff --git a/include/soc/tegra/fuse.h b/include/soc/tegra/fuse.h
index 214908fc5581..a9db917a1d06 100644
--- a/include/soc/tegra/fuse.h
+++ b/include/soc/tegra/fuse.h
@@ -24,6 +24,7 @@
 u32 tegra_read_chipid(void);
 u8 tegra_get_chip_id(void);
 u8 tegra_get_platform(void);
+bool tegra_is_silicon(void);
 
 enum tegra_revision {
 	TEGRA_REVISION_UNKNOWN = 0,
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-07-16 14:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 14:18 [PATCH 0/9] arm64: tegra: Initial Tegra234 VDK support Thierry Reding
2020-07-16 14:18 ` [PATCH 1/9] dt-bindings: tegra: Add Tegra234 VDK compatible Thierry Reding
2020-09-07 19:29   ` Jon Hunter
2020-07-16 14:18 ` [PATCH 2/9] dt-bindings: fuse: tegra: Add missing compatible strings Thierry Reding
2020-09-07 19:29   ` Jon Hunter
2020-07-16 14:18 ` [PATCH 3/9] dt-bindings: fuse: tegra: Document Tegra234 compatible string Thierry Reding
2020-09-07 19:30   ` Jon Hunter
2020-07-16 14:18 ` [PATCH 4/9] soc/tegra: fuse: Add Tegra186 and Tegra194 SoC IDs Thierry Reding
2020-07-16 14:18 ` [PATCH 5/9] soc/tegra: fuse: Extract tegra_get_platform() Thierry Reding
2020-09-07 19:30   ` Jon Hunter
2020-07-16 14:18 ` Thierry Reding [this message]
2020-09-07 19:32   ` [PATCH 6/9] soc/tegra: fuse: Implement tegra_is_silicon() Jon Hunter
2020-09-15 12:38     ` Thierry Reding
2020-07-16 14:18 ` [PATCH 7/9] soc/tegra: fuse: Add Tegra234 support Thierry Reding
2020-09-07 19:39   ` Jon Hunter
2020-07-16 14:18 ` [PATCH 8/9] firmware: tegra: Enable BPMP support on Tegra234 Thierry Reding
2020-09-07 19:43   ` Jon Hunter
2020-07-16 14:18 ` [PATCH 9/9] arm64: tegra: Initial Tegra234 VDK support Thierry Reding
2020-09-07 19:46   ` Jon Hunter
2020-09-15 12:44     ` Thierry Reding
2020-09-15 13:17       ` Jon Hunter
2020-09-15 13:49         ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200716141856.544718-7-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-tegra@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).