Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] T7 SCMI firmware: CLOCK_ATTRIBUTES reply is too short for the clock protocol version it reports
@ 2026-11-29  9:19 Lucas Tanure
  2026-11-29 18:45 ` Cristian Marussi
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas Tanure @ 2026-11-29  9:19 UTC (permalink / raw)
  To: Jian Hu, Chuan Liu, Xianwei Zhao, Nick Xie
  Cc: Neil Armstrong, Cristian Marussi, arm-scmi, Linux ARM,
	linux-amlogic

Hello,

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.

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
  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.

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.

Thank you,
Lucas Tanure


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-29 18:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29  9:19 [BUG] T7 SCMI firmware: CLOCK_ATTRIBUTES reply is too short for the clock protocol version it reports Lucas Tanure
2026-11-29 18:45 ` Cristian Marussi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox