Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH] soc/tegra: fuse: Read the platform from HIDREV on TF-A based SoCs
@ 2026-11-30 22:08 Alexander Schwankner
  2026-12-01 11:56 ` Jon Hunter
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Schwankner @ 2026-11-30 22:08 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter
  Cc: Kartik Rajput, linux-tegra, Alexander Schwankner, stable

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)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-01 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 22:08 [PATCH] soc/tegra: fuse: Read the platform from HIDREV on TF-A based SoCs Alexander Schwankner
2026-12-01 11:56 ` Jon Hunter
2026-12-01 21:10   ` Alexander Schwankner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox