Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Alexander Schwankner <mrmoor4@googlemail.com>,
	Thierry Reding <thierry.reding@kernel.org>
Cc: Kartik Rajput <kkartik@nvidia.com>,
	linux-tegra@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] soc/tegra: fuse: Read the platform from HIDREV on TF-A based SoCs
Date: Tue, 1 Dec 2026 11:56:21 +0000	[thread overview]
Message-ID: <6eaf09ad-07f0-4926-add0-177f5f91e31d@nvidia.com> (raw)
In-Reply-To: <20261130220842.95038-1-mrmoor4@googlemail.com>


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


  reply	other threads:[~2026-12-01 11:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=6eaf09ad-07f0-4926-add0-177f5f91e31d@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=kkartik@nvidia.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mrmoor4@googlemail.com \
    --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