* [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
* Re: [PATCH] soc/tegra: fuse: Read the platform from HIDREV on TF-A based SoCs
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
0 siblings, 1 reply; 3+ messages in thread
From: Jon Hunter @ 2026-12-01 11:56 UTC (permalink / raw)
To: Alexander Schwankner, Thierry Reding; +Cc: Kartik Rajput, linux-tegra, stable
On 30/11/2026 22:08, Alexander Schwankner wrote:
> 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.
Thanks for debugging and finding this. Can you tell me if there is a
particular version of L4T/JetPack you are using to help us understand
what ATF firmware you have?
> 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?
Yes that does not look right either. My understanding is that A01 should
be the version for Orin. Have you compared the major rev you get if you
don't call the SMCCC function to get the major rev?
>
> 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:
I need to check if this works for Tegra238 which is a variant for 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);
We may as well move all of this code under 'if
(tegra_smccc_has_platform())'. Ie. there is no point in calling
arm_smccc_get_soc_id_revision() if we don't support it for identifying
the platform.
Jon
--
nvpublic
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] soc/tegra: fuse: Read the platform from HIDREV on TF-A based SoCs
2026-12-01 11:56 ` Jon Hunter
@ 2026-12-01 21:10 ` Alexander Schwankner
0 siblings, 0 replies; 3+ messages in thread
From: Alexander Schwankner @ 2026-12-01 21:10 UTC (permalink / raw)
To: Jon Hunter; +Cc: Thierry Reding, Kartik Rajput, linux-tegra, stable
On 01/12/2026 11:56, Jon Hunter wrote:
> Thanks for debugging and finding this. Can you tell me if there is a
> particular version of L4T/JetPack you are using to help us understand
> what ATF firmware you have?
Thank you for the review!
Both of my boards had the boot firmware from Jetson Linux r36.5 in the
QSPI flash. The UEFI version is 36.5.0-gcid-43688277. My 7.4-rc5 test on
the AGX Orin ran with this firmware. Both boards report the same SMCCC
values:
SMCCC: SOC_ID: ID = jep106:036b:0234 Revision = 0x00000401
Another user saw the same revision 0x00000401 on an AGX Orin with UEFI
36.4.4.
Today I updated both boards to the newest firmware, Jetson Linux r39.2.2
(UEFI 39.2.2-gcid-48648412). With it, both report a different revision:
SMCCC: SOC_ID: ID = jep106:036b:0234 Revision = 0x00000001
So with r39.2.2 the platform bits are 0, and the problem does not show
up.
I then looked at plat_get_soc_revision() in the public TF-A sources
(gitlab.com/nvidia/nv-tegra/tegra/optee-src/atf). In jetson_35.6.5,
jetson_36.5 and jetson_36.5.2 it returns (major << 8) | minor. From
jetson_38.2 on, it returns only the minor revision for Tegra234 and
later. jetson_36.5.2 is the newest r36 tag there, so it looks to me like
the current JetPack 6 firmware still has the problem.
With my patch, both firmware versions give the right platform, because
HIDREV reports platform 0 with r36.5 and with r39.2.2. I checked this on
both boards with Linux 7.3.1. So I think the patch is still useful. But
please let me know if you prefer a different way to handle this.
> Yes that does not look right either. My understanding is that A01 should
> be the version for Orin. Have you compared the major rev you get if you
> don't call the SMCCC function to get the major rev?
Yes, I checked this today on Linux 6.18.65. In this version
tegra-apbmisc.c does not use SMCCC yet, so the values come from HIDREV:
Orin NX 16 GB: major 4, minor 1, platform 0, "Silicon A01"
AGX Orin 64 GB: major 4, minor 1, platform 0, "Silicon A01"
So HIDREV also reports major revision 4 on Orin. The NVIDIA UEFI
expects this too: edk2-nvidia defines T234_MAJOR_REV as 0x4 in
Silicon/NVIDIA/Include/Library/TegraPlatformInfoLib.h.
It looks to me like 98442683d858 ("soc/tegra: fuse: Support revision
B01") shows "B01" on Orin with and without SMCCC, because it maps every
major revision > 1 to B01. On 6.18 the revision name only used the
minor revision, so this did not show up. My patch does not change this.
Should I send a separate patch for it, or do you want to handle it?
> I need to check if this works for Tegra238 which is a variant for Tegra234.
Thank you. I do not have a Tegra238 board, and I do not know which
Jetson board uses it, so I cannot test it. As far as I can see, my
patch would also apply there if Tegra238 reports the same chip ID as
Tegra234. In the newer TF-A code, the minor-only revision is used for
all chip IDs from Tegra234 on, so I think a Tegra238 with that firmware
would not have the problem anyway.
> We may as well move all of this code under 'if
> (tegra_smccc_has_platform())'. Ie. there is no point in calling
> arm_smccc_get_soc_id_revision() if we don't support it for identifying
> the platform.
OK, I will change this in v2. I will wait for your result on Tegra238
before I send v2.
Please let me know if I got something wrong.
Thank you!
Alexander
^ permalink raw reply [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