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

From: christian . koever-draxl

Date: Sun Oct 25 2026 - 15:25:54 EST


From: Christian Stefan Kövér-Draxl <ckoever@xxxxxxxxxx>

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@xxxxxxxxxx>
---
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