[PATCH 3/4] firmware: meson: sm: add the CPU speed bin call

christian.koever-draxl at student.uibk.ac.at christian.koever-draxl at student.uibk.ac.at
Sun Oct 25 12:22:18 PDT 2026


From: Christian Stefan Kövér-Draxl <ckoever at outlook.de>

Amlogic SoCs are binned at manufacturing time and the bin selects the
CPU voltage curve. On S4 it can only be read through the secure monitor
(SMC 0x82000088, argument: cluster id), which returns the bin index.

Add the command so that a cpufreq driver can pick the right curve.

Signed-off-by: Christian Stefan Kövér-Draxl <ckoever at outlook.de>
---
 drivers/firmware/meson/meson_sm.c       | 1 +
 include/linux/firmware/meson/meson_sm.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c
index 5410386603c7..540773887fe5 100644
--- a/drivers/firmware/meson/meson_sm.c
+++ b/drivers/firmware/meson/meson_sm.c
@@ -51,6 +51,7 @@ static const struct meson_sm_chip gxbb_chip = {
 		CMD(SM_A1_PWRC_SET,		0x82000093),
 		CMD(SM_A1_PWRC_GET,		0x82000095),
 		CMD(SM_SET_POWEROFF_FLAG,	0x82000042),
+		CMD(SM_GET_CPU_SPEED_BIN,	0x82000088),
 		{ /* sentinel */ },
 	},
 };
diff --git a/include/linux/firmware/meson/meson_sm.h b/include/linux/firmware/meson/meson_sm.h
index 3f2fa160e32f..9d11832bf638 100644
--- a/include/linux/firmware/meson/meson_sm.h
+++ b/include/linux/firmware/meson/meson_sm.h
@@ -16,6 +16,7 @@ enum {
 	SM_A1_PWRC_SET,
 	SM_A1_PWRC_GET,
 	SM_SET_POWEROFF_FLAG,
+	SM_GET_CPU_SPEED_BIN,
 };
 
 struct meson_sm_firmware;
-- 
2.56.0




More information about the linux-arm-kernel mailing list