From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796076602; b=HMWIwDW8lgTzWagnrnXlrArJK8JUBjHB4TcTkYbQcIDqQHhL7Z7AD0swFoGOdQaJQHUp rB0SjX436VPYwo1yoDEPEo+7Y5p5B29jJQ5SQlA1p1gFjTbbqAFfGkcMLc/RqdPCQWI4W CFra4u2AIIqtrp16qHOPKsHAT+/lReV+y1lC0a85qxIHIx+K4OPa+A2mCX55WQNXsgtBD C+8tldC+MD9CoUeY3fBRgJ8IwkA1I1Dx975hmIjHgn3eb/MDaeVQ7CrtOS3VA4+iP8GBl PDxAWR8a/6ngywQv60vgBuKmu6jXGARgr2KxSTXtCK58LsDSMzYKbPz5O97zu6gujSg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796076602; 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=fhUi+Bae0/R7y/166nkni4kyKZf5afJu3f08RsDDc69qnJg0atWX135fQtLi9o9RJj1B HQfC2y247NN6g8SG8UB6LcnooYqpNHYbv06ytiLQoRDG/TOMqEiuDy7VHGktGCrh8rU9j L/6ufxu37BZj1z1MQlLuDe4xlat4cFdV+/T81dIJPCL8s0q0Ghrw69sMdPitD2UOfnFYF mUabkxJsaLW8hPSWg70Iuh0dA6UQTMXVS4kT1y48LhEyHOZ5PxTc49ucUXrjLdjeUqa1M 93K7oOkm2jAeuj6Sijh3Lo9ISmiJUVUmy0gXu5QoOWWV6SMgZoAqW2UxTLmaRbwDOlg== 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.221.52 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 86692606A339 for ; Mon, 30 Nov 2026 22:10:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 86692606A339 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-wr1-f52.google.com with SMTP id ffacd0b85a97d-48dee593f18so10541283f8f.3 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=BA8cYSzutcd6Wlx3JFpDuyx6k1xy8hSFPAoTQgb89clu0nlqGeGtA/lz6pn8dt0JWK poj8sKrTjPwpsoCE73QlPuyrcRDG1U18dJDKaacW3qGeV6rsWyTWdYENpdglN5HCbJUv 5A9PGRr4DYnVHAqV2S3AIHbFbbxteieY687UcFlw78qKcQKwq0hGnLGGpM5ruRvLie+4 1GyOJLH0AenlXXgoB2Urp9IhZsZYql/679YebtLuOaE39OLCTBHQfk0cos80nik8icRg YCPi91Ghu/XEf9PIVBZrcUU07WIZvJQk0McW+zT4EFrYfnf9oGU3wgHJ8byYkWYjzIAX 5hBA== X-Forwarded-Encrypted: i=1; AL+hErF5c9qEP9+oB+F/3rZsTf1sNtxPwgHA15KYTPKXbc3XUEfvTaJXDYPUXiv9DOkswQ30sYkNImg=@vger.kernel.org X-Gm-Message-State: APuU4Z9qEZkCApoysCWtqclMeqt/NkDaHaDoLXH5bFcE7iWZIoDuF/mw VzURrO1M0MaCCuGlu8yUHbamK0VI2o88GgzRzsDB+NlwOKd6uj3oNFDE X-Gm-Gg: AZFdTZcYCqjjJD9GWwjWgtPH0jV1VUYWYm3yO+4TDOvw6LN+dzsYZmPDfMYFA/59PaU GtqXxkSPAJ9a1aA5bMpv4/5T3yj+C3t57EA1pZXwRtMREjdA1VwzQPZnO3YG9mjPjMvoAaqn3n8 SAkgWtmXtSUT/iqwh1QRky4+qxiCm+rEqBt7NFFRiJQALX55LGLl2nf7siNVhcsSVlARgDxbeB4 NOxsasGaXpM0wzFeMzA125iKJZVEcIhwEmW/oFVoG2y23VJjHNTBTYE9bxno5rhlbYyrkWw46pI SCu6Ow7Kea5IFJWxcxxI0KKsXDr24ZmIT3ApGJXlp2r4UyU26WikLjvH+KeXMOk7pEPOgJayx3l XlZPIM5V3WpWCtf2OrpQffaxH/NIz5coPyQgGUpcfXx4J3R5pU8FZcjqExMTll7b+6YSXy8MJmx Xt3SxjFZLT+XyySMeX6KnIRvaC75XKm16fYDFQscB41alhOcVWRaLNu4oAnHU2s1JNfjjVOg15k 5ki8Q8Mt4Oxn5ZAsL+tIE80bG0h5zNT+RWwafSGfoZb+75R+t/1CIT8VTA0k3nJTzuGaD/w4BWX ToFNZB/qUZjyiRdf9+SJGIkqsZX/iKlzNODnqHpGhvEuRwDERTnWDRq/BpxAdhvyuNtPVafhK4l c1bCw9B7E55rmRXVz28mWi2Dvwjt4KXA5B0OrXyzKyw== 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: stable@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)