Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Alexander Schwankner <mrmoor4@googlemail.com>
To: Thierry Reding <thierry.reding@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>
Cc: Kartik Rajput <kkartik@nvidia.com>,
	linux-tegra@vger.kernel.org,
	Alexander Schwankner <mrmoor4@googlemail.com>,
	stable@vger.kernel.org
Subject: [PATCH] soc/tegra: fuse: Read the platform from HIDREV on TF-A based SoCs
Date: Mon, 30 Nov 2026 23:08:42 +0100	[thread overview]
Message-ID: <20261130220842.95038-1-mrmoor4@googlemail.com> (raw)

Since commit 8b8ee2e56f95 ("soc/tegra: Use ARM SMCCC to get chip ID,
revision, and platform info"), tegra_get_platform() takes the platform
from bits [15:8] of the SMCCC SoC revision. But the Tegra TF-A firmware
puts the major revision there: plat_get_soc_revision() returns
(major << 8) | minor. On Jetson Orin the SoC revision is 0x401, so the
kernel reads platform 4 ("Asim QT"). /sys/devices/soc0/revision shows
"Asim QT" instead of "Silicon" and the chip revision, and
tegra_is_silicon() returns false. With NVIDIA's out-of-tree nvgpu
driver, the GPU then runs about 7x slower.

Read the platform from HIDREV again on Tegra210, Tegra186, Tegra194 and
Tegra234, which use this TF-A firmware. Keep the SMCCC platform for
Tegra241 and later. Chip ID and revision still come from SMCCC.

I found the cause and wrote this patch with the help of an AI coding
assistant (Claude Code). I reviewed the change and tested it on my
Jetson Orin boards.

Fixes: 8b8ee2e56f95 ("soc/tegra: Use ARM SMCCC to get chip ID, revision, and platform info")
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Schwankner <mrmoor4@googlemail.com>
---

Notes:
    Testing:
    - Jetson AGX Orin 64 GB devkit with v7.4-rc5 (arm64 defconfig, booted
      from USB, NVIDIA UEFI r36.5). The SMCCC SoC revision is 0x00000401.
      Without this patch: /sys/devices/soc0/revision = "Asim QT",
      platform = 4. With this patch: "Silicon B01", platform = 0.
    - Jetson Orin NX 16 GB and Jetson AGX Orin 64 GB with Linux 7.3.1 (the
      NX also with 7.3.0): /sys/devices/soc0/revision shows "Silicon A01"
      again, and the GPU has the same speed as on 6.18.
    - v7.4-rc5: drivers/soc/tegra/fuse/ builds without warnings with W=1
      for arm64 (defconfig) and arm (multi_v7_defconfig).
    - I could not test Tegra210, Tegra186 and Tegra194. For them I rely on
      plat_get_soc_revision() in upstream TF-A
      (plat/nvidia/tegra/common/tegra_platform.c).
    
    One question: since 98442683d858 ("soc/tegra: fuse: Support revision
    B01") in 7.4, my AGX Orin shows "B01" instead of "A01", because its
    major revision is 4. I am not sure if "B01" is right for Orin. Is this
    expected?

 drivers/soc/tegra/fuse/tegra-apbmisc.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c
index 3ad4629335..1aeb67b986 100644
--- a/drivers/soc/tegra/fuse/tegra-apbmisc.c
+++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c
@@ -81,12 +81,32 @@ u8 tegra_get_minor_rev(void)
 
 }
 
+#if IS_ENABLED(CONFIG_HAVE_ARM_SMCCC_DISCOVERY)
+/*
+ * The TF-A firmware on these SoCs implements the SMCCC SoC ID call, but it
+ * reports the major revision in bits [15:8] of the SoC revision rather than
+ * the platform. Their platform has to be read from HIDREV instead.
+ */
+static bool tegra_smccc_has_platform(void)
+{
+	switch (tegra_get_chip_id()) {
+	case TEGRA210:
+	case TEGRA186:
+	case TEGRA194:
+	case TEGRA234:
+		return false;
+	}
+
+	return true;
+}
+#endif
+
 u8 tegra_get_platform(void)
 {
 #if IS_ENABLED(CONFIG_HAVE_ARM_SMCCC_DISCOVERY)
 	s32 revision = arm_smccc_get_soc_id_revision();
 
-	if (revision >= 0)
+	if (revision >= 0 && tegra_smccc_has_platform())
 		return TEGRA_SMCCC_PLATFORM(revision);
 #endif
 	return (tegra_read_chipid() >> 20) & 0xf;

base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
-- 
2.54.0 (Apple Git-157)


             reply	other threads:[~2026-11-30 22:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 22:08 Alexander Schwankner [this message]
2026-12-01 11:56 ` [PATCH] soc/tegra: fuse: Read the platform from HIDREV on TF-A based SoCs Jon Hunter
2026-12-01 21:10   ` Alexander Schwankner

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=20261130220842.95038-1-mrmoor4@googlemail.com \
    --to=mrmoor4@googlemail.com \
    --cc=jonathanh@nvidia.com \
    --cc=kkartik@nvidia.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thierry.reding@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