mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
firmware: meson: sm: Add thermal calibration SMC call
Add SM_THERMAL_CALIB_READ at SMC ID 0x82000047 in the command table and implement meson_sm_get_thermal_calib(), which forwards the tsensor_id argument to the secure monitor and returns the calibration data. Also realign the CMD() column to improve readability. Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> [ dlezcano: Fixed kernel-doc format warning ] Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20260424-add-thermal-t7-vim4-v5-3-9040ca36afe2@aliel.fr
This commit is contained in:
committed by
Daniel Lezcano
parent
d0bf38194b
commit
1c5cb7391e
@@ -41,12 +41,13 @@ static const struct meson_sm_chip gxbb_chip = {
|
||||
.cmd_shmem_in_base = 0x82000020,
|
||||
.cmd_shmem_out_base = 0x82000021,
|
||||
.cmd = {
|
||||
CMD(SM_EFUSE_READ, 0x82000030),
|
||||
CMD(SM_EFUSE_WRITE, 0x82000031),
|
||||
CMD(SM_EFUSE_READ, 0x82000030),
|
||||
CMD(SM_EFUSE_WRITE, 0x82000031),
|
||||
CMD(SM_EFUSE_USER_MAX, 0x82000033),
|
||||
CMD(SM_GET_CHIP_ID, 0x82000044),
|
||||
CMD(SM_A1_PWRC_SET, 0x82000093),
|
||||
CMD(SM_A1_PWRC_GET, 0x82000095),
|
||||
CMD(SM_GET_CHIP_ID, 0x82000044),
|
||||
CMD(SM_THERMAL_CALIB_READ, 0x82000047),
|
||||
CMD(SM_A1_PWRC_SET, 0x82000093),
|
||||
CMD(SM_A1_PWRC_GET, 0x82000095),
|
||||
{ /* sentinel */ },
|
||||
},
|
||||
};
|
||||
@@ -245,6 +246,23 @@ struct meson_sm_firmware *meson_sm_get(struct device_node *sm_node)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(meson_sm_get);
|
||||
|
||||
/**
|
||||
* meson_sm_get_thermal_calib - Read thermal sensor calibration data.
|
||||
* @fw: Pointer to secure-monitor firmware.
|
||||
* @trim_info: Pointer to store the returned calibration data.
|
||||
* @tsensor_id: Sensor index to identify which sensor's calibration data
|
||||
* to retrieve
|
||||
*
|
||||
* Return: 0 on success, negative error code on failure.
|
||||
*/
|
||||
int meson_sm_get_thermal_calib(struct meson_sm_firmware *fw, u32 *trim_info,
|
||||
u32 tsensor_id)
|
||||
{
|
||||
return meson_sm_call(fw, SM_THERMAL_CALIB_READ, trim_info, tsensor_id,
|
||||
0, 0, 0, 0);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(meson_sm_get_thermal_calib);
|
||||
|
||||
#define SM_CHIP_ID_LENGTH 119
|
||||
#define SM_CHIP_ID_OFFSET 4
|
||||
#define SM_CHIP_ID_SIZE 12
|
||||
|
||||
Reference in New Issue
Block a user