From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8F5D606A31C for ; Sun, 29 Nov 2026 18:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Y774h6UD; dkim=fail reason="signature verification failed" (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=RQ1ytMRn DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=4NbR0NcVljWQdYxGpBe3uA99MP0nFo1vlTAIuaOQRWU=; b=Y774h6UDBVVUzzgll5Syx6HkOC KP0MAeRynbD7wWghdnBBUwdDgF18hwgbbzdC8FZyg0CVxPxbQ5Q1RAwzyokVOKj2xzvh0HjXX0Dpg wbSKXqzzVKvJmde3XxKeOxWECLPt6yymhqd66FpoJjdKLS4y3S0JrtYVuVLy/Snmqjcdct46pKCZ8 8/Z5e+Ch7sdY0fegejRYYbxDmssn31g4vHt8R2Muk11pTsAZzEtO5hbGCV3FVuqMj0GewjTASplz+ C5kJ55nT3Gxr6j4qMzGZd5XeSipcn2XGGpO3uhT/rjUmakNTHjsdatMPmk5Chts+c8odC/+0ulR8j Yw8BFJxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXjuO-00000002MVg-2wyv; Sun, 29 Nov 2026 18:45:56 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXjuK-00000002MVE-2wag; Sun, 29 Nov 2026 18:45:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 26C521575; Sun, 29 Nov 2026 10:45:46 -0800 (PST) Received: from pluto (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7E7D43F632; Sun, 29 Nov 2026 10:45:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1795977949; bh=f01OQeovlhoNfagch6nLAE4PvrcUWFOie97fA6pmFSg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RQ1ytMRnVcHCDbJ2AHFCrkewqqLPuJC+46vIPGiu0NBRFpQCyke0de9e9/A63fYJf NPvxqV30kId1QsR8AjsJlwdrGjeICMbzh1qCnCs+E287319k6++BGUBGjQHfLZ143L tqnEvPpaY35kG43YE4AgRR40a6944LKkgFdrKGm0= Date: Sun, 29 Nov 2026 18:45:37 +0000 From: Cristian Marussi To: Lucas Tanure Cc: Jian Hu , Chuan Liu , Xianwei Zhao , Nick Xie , Neil Armstrong , Cristian Marussi , arm-scmi@vger.kernel.org, Linux ARM , linux-amlogic@lists.infradead.org Subject: Re: [BUG] T7 SCMI firmware: CLOCK_ATTRIBUTES reply is too short for the clock protocol version it reports Message-ID: References: X-Archived-By: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261129_104552_927254_7D74BF4F X-CRM114-Status: GOOD ( 31.18 ) X-Spam-Score: -4.4 (----) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Sun, Nov 29, 2026 at 09:19:03AM +0000, Lucas Tanure wrote: > Hello, Hi Lucas, > > I am working on mainline Linux support for the Amlogic T7 (A311D2) on > the Khadas VIM4. The SCMI server in the T7 firmware sends a reply that > does not match the SCMI specification. Because of it, linux-next no > longer boots on these boards, and mainline will not either once that > change is merged. > > The problem > ----------- > The firmware reports SCMI clock protocol version 2.0 or later. From > that version (SCMI v3.1) the CLOCK_ATTRIBUTES reply has a > clock_enable_latency field at the end, so the payload is 24 bytes: > attributes (4), name (16), clock_enable_latency (4). The T7 firmware > sends only 20 bytes, without clock_enable_latency. this is the typical case in which after tightening the kernel checks we broke some out-of-spec platform running in the wild. While we'd like to have the FW fixed (as per your ask) we try NOT to break existent deployment by using quirks when needed. I'll post a possible trivial quirk for you to try about this AMLOGiC issue. > > Linux log, one line per clock (37 clocks), with a debug change that > only warns: > > arm-scmi arm-scmi.0.auto: SCMI Protocol v2.0 'AMLOGIC:' Firmware version 0x0 While at it, it would be good if the FW guys could fix also the reported FW version which is now 0x0 BUT it should identify somehow the installed FW binary blob...given that all of the SCMI quirk framework is based on this. > arm-scmi arm-scmi.0.auto: Truncated reply - HDR:002C5003 > expected:24 received:20 > ... > arm-scmi arm-scmi.0.auto: Truncated reply - HDR:014C5003 > expected:24 received:20 > > (protocol 0x14 = clock, message 0x03 = CLOCK_ATTRIBUTES) > > Effect on Linux > --------------- > linux-next now checks the size of every SCMI reply ("firmware: arm_scmi: > Add centralized detection of truncated replies"). With the T7 firmware > every SCMI clock fails, so devices that use them do not probe. On the > VIM4 the SD card and eMMC hosts fail, and the board cannot mount its > root filesystem. Older kernels accepted the short reply, but they read > clock_enable_latency from past the end of it, so the value was wrong > there too. > > Two other replies from the same firmware are also out of spec: > - CLOCK_DESCRIBE_RATES: Linux needs a quirk for it > (quirk_clock_rates_triplet_out_of_spec). > - During SCMI initialisation Linux logs "Malformed reply - > real_sz:8 calc_sz:4 (loop_num_ret:1)". I have not checked which > command this is. This is an historical quirk that is enabled on any FW, because was historically present on most of original FW reference from which many vendor FW were forked....nothing really to do here...the quirk is active and working... > > Firmware on my board > -------------------- > BL2 : Built 11:37:41, Apr 12 2024, t7 projects/t7 g6adeddf > BL2E : Built 11:23:05, Apr 17 2024, t7 projects/amlogic-dev g31eecf9 > BL2X : Built 11:37:21, Apr 25 2024, t7 projects/amlogic-dev g767c913 > BL31 : v1.3.2(release):2dd964006, Built 16:38:51, Feb 1 2026, > t7 amlogic-dev-1.3 g2dd964006 > BL32 : ATOS-V3.8.0-ec8c40b03, 11 May 2024 > U-Boot: 2019.01 (Aug 02 2026), Khadas VIMs mainline build > SCMI transport: SMC > > This BL31 is the newest one Khadas has published: khadas/u-boot branch > khadas-vims-v2019.01-mainline, commit a7b06ca0498f ("bl31: bl31_1.3: > bin: update to version 3539ff675", 6 Mar 2026), which contains Amlogic > BL31 commit 2dd964006 (16 Jan 2026). > > Questions > --------- > 1. Can the SCMI server send the full 24-byte CLOCK_ATTRIBUTES reply > (clock_enable_latency may be 0), or report clock protocol version > 1.0 if version 2.0 is not fully supported? > 2. Which other SoCs use the same SCMI server code (S4, A4, others)? They > may have the same problem. > 3. Khadas: if Amlogic fixes this, can you release an updated firmware > (bootloader) for the VIM4? > > Boards that keep the current firmware will probably still need a > workaround in Linux, so a firmware fix alone does not solve this. But a > fixed firmware would help everyone who uses mainline on these boards. > I have copied Cristian Marussi, who works on the Linux SCMI code and > wrote the new size check, so that the firmware side and the Linux side > can be agreed together. I'll post a possoble quirk for you to test...it will be matching against Vendor:AMLOGIC SubVendor: FirmVersion:0x0 Feel free to adapt to your needs. Thanks, Cristian _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic