From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796076609; b=lapTVeGCH3xpufw6mcuTenM5xbITmDPjI1WPwY2K29eNccyEzn8jzVMgxhRzD9FLIDDT D1EodxkxDKzT4cKW40RFtMsF9/Ls6xVrAWO1BDH4v4fG+muLDkn8gWvJef1nMoYvyC14d bObNnA5df3UY6LA1NYYuKd+Btm3Y6IW6/KY1bHQBjrzFG97xFlATo8NsaQgwldAeapXBx NnDGk78oojorpk6QOvCOlr+EUXw7VQBhSVVAWCnHk9eu/WeoJJNJRyRf4oitWp3j8He9S ZvTsV0/hdD5tKb6ik4jGWgGWkBtibqER9HeynnFEn6+b/JnhYpg2oGobkW796lT4X1Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796076609; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=7PSvx38RqCXgwjGVJ0ul+cT62c9PkR/JNeihk6syo9o=; b=0ZWc0qzAPbymgHTx05AqB53xilWq3E2PJf4tkwLqwgX4HTT+DZ2QWIU+udwbWn1a1Vzi w6u2njJfjuFYxw/C3Iwt9mwUS9OUgQYBQiwT/8mE5WEjo+Xd7BnQKqmdNlDnAcQbDy7ye pLnCuzhKYpiuMh9pSIupUjWLIaE8Mb1zLzA/1G/DBnbROE78CwsjwGiJ4+QGw9psOsolp 8lseggqcFrsL2aOXGVj2nj/tm+OHAXlcDlzyjcg5906b7MBAQ6wGB5hjw7hONG25p8VjB fuwwEHk5ug+JPpAVoiY5G1yDvakvvy3+gio4PMzFW0lPU4Qt0L2EJckM3zQX2Wldb/Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=googlemail.com; spf=pass smtp.mailfrom=googlemail.com; dkim=pass header.d=googlemail.com header.i=@googlemail.com header.a=rsa-sha256 header.s=20260707 header.b=InSUkn7D; arc=none smtp.remote-ip=209.85.128.44 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F571606A33B for ; Mon, 30 Nov 2026 22:10:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8F571606A33B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=googlemail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.a=rsa-sha256 header.s=20260707 header.b=InSUkn7D Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4bb61185057so70206455e9.1 for ; Mon, 30 Nov 2026 14:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20260707; t=1796076600; x=1796681400; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=7PSvx38RqCXgwjGVJ0ul+cT62c9PkR/JNeihk6syo9o=; b=InSUkn7DkXQ/k948VdsH+gVlsDmdFSaQtZFqLy1HPY5m4GINb1z9VjBZm4VXjQBRzY g3yJfWuPhv1tCBJ6BxVGZkYzQpWgk+ATybvPQBjoGXQ5NeMe/ozzNah3KW+Yjs1l4uHn xBQnKO9O2Bl+wd56fknEDJ4jcuOh7D5gmFU1hAUmSE2kK7pLIROBNpiZ3yVduFcKTc21 3z4DMuY4e5qg1NkoPbUOQiw3q/jnPsnPHbIjFVQaQ0LJpxMZkk0dywYcjPqKGntBmg9Z DguC8vlcr3nfDRTQltRTz4r3oVBOCES2sTKbKh8+WntcVMvWSntZ78Bqn5qkHO6xXXvI +keg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796076600; x=1796681400; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=7PSvx38RqCXgwjGVJ0ul+cT62c9PkR/JNeihk6syo9o=; b=k343x9gOwlXCRbjAFrdktT7Ds6q+H42R/C0guMZ5V1vvNkUPIx24xvAJ6LV7YdVdlk qKsoI2LfQnQRaSRwOk9KlFDW/ev7HFIFYOsSG9Lu3KJ/tdnvmqYuUlzWX2DpKRPBfUFp dQr/bloW577iQLKEfh6PfHgCysiat0XM79OWBjCtOGzFSrdb0HLppFwuhGgzL7cb2bQJ Q7PvLsFR8R5AcEWHTWDCxniTAqC17yNPnREr2uuXSnSw6tEDEcgTvBjxGnPaOcJ4U7LF sQCvU1SeZnJEGT7/2Vq/jJhWHDIZtx5p/8H73/qM94i6VMRHUZTOz1+U1w2jURPL9Eox VVSA== X-Forwarded-Encrypted: i=1; AL+hErEPqeUUf+ALg9YWHcHFll2YI5k/1XhTk8hr4RmzU1UxonGNA7n3IRVgeQPfgc1w91y6UrzpyQB/9YVtJw==@vger.kernel.org X-Gm-Message-State: APuU4Z8krOBqFhC6dU0jfzEPsc1gX0hAFHvKwHp64ibfJ7tsLwcYR64I i5lIRqcnzKZ3pEMgqq1RwsKef/x7kez4EbC49f0jEYiyen8Fw/0QO6GA X-Gm-Gg: AZFdTZdMp1Xq6doZ0BRBFwFB1BzRWeeNNfzoCsiZAmPelkOamJrIiUdIzjTgYoTIpR3 IIuKTIgkm0ZU7rdz/IM6g6LV6VkI94uYuEFS2oKhRi/yW9PaKZGK1n+UTJ0Uz9XgKBrtvb/1Evz xtVk8r3mmaYr54eG9mFiLMOrKZJOg2dTFCz1on4Ety3cB0X9cD9s37VB9Rz3Lw0wNOS2PQBaT7j bcGvzejuSPhUVZbLjaC8Y0HJWwU8A1RMbRPyHDwbIIsyp2DZ37cN+MD8+f5Wl9fS2t9Ia0s8irB 1CtR/0RN4ajoqCmI6D5t+VxBF9FTSa9mqt9bvWNU0LNi8tmp4g2lTRMi0bRzu/Q70wxFJvA2pbr eNiCcEChbEvFU5XDysr5T3jl+cA14i6c8gPbuXovR2U9DPq5p5ZJd6bSsYa3w3hIuJK3DhDkeg7 dmxs5h5PE1aXZmHxRDgQKafxPzyVR/RDr72dEmLMHSTxI4dYC8x7NDudahvZnHlZYg8JMxxWt69 mnPhvH7QRF2oSn0u5ILpIc5tOb2qHHH93K1bBfi4QzvDsUqfF0T9kWZ9eDmkzWWN7OYrfLiq+xD i/yWEx15crzb60UOg+3SuDSmYZ2S4jrw7qJHUW4rv9ZJwSwDS3ZHUTAUTdUCr5Y36VophVOwtEW V7VzAQdZVATU664KLDwfAoIVyN4VR8yw8mm0dIqKawA== X-Received: by 2002:a05:600d:6512:10b0:4bb:685e:cc41 with SMTP id 5b1f17b1804b1-4bba3e35821mr281095105e9.8.1796076599697; Mon, 30 Nov 2026 14:09:59 -0800 (PST) Received: from cffb-mbp-02.schwankner.de (ip-188-192-186-065.vkd88.pools.vodafone-ip.de. [188.192.186.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb8533579csm817504355e9.2.2026.11.30.14.09.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Nov 2026 14:09:59 -0800 (PST) From: Alexander Schwankner To: Thierry Reding , Jonathan Hunter Cc: Kartik Rajput , linux-tegra@vger.kernel.org, Alexander Schwankner , 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 Message-ID: <20261130220842.95038-1-mrmoor4@googlemail.com> X-Mailer: git-send-email 2.54.0 X-Mailing-List: linux-tegra@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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)