From 0cedca636fe07a62cf39548470baf3aaae9f008f Mon Sep 17 00:00:00 2001 From: Grzegorz Jaszczyk Date: Thu, 2 Jan 2020 16:14:13 +0100 Subject: [PATCH] drivers: marvell: thermal: use dedicated function for thermal SiPs Since more drivers which uses dfx register set need to be handled with use of SiP services, use dedicated and more meaningful name for thermal SiP services. Change-Id: Ic2ac27535a4902477df8edc4c86df3e34cb2344f Signed-off-by: Grzegorz Jaszczyk Reviewed-on: https://sj1git1.cavium.com/25054 Tested-by: sa_ip-sw-jenkins Reviewed-by: Kostya Porotchkin --- drivers/marvell/secure_dfx_access/armada_thermal.c | 4 ++-- drivers/marvell/secure_dfx_access/dfx.h | 4 ++-- plat/marvell/armada/common/mrvl_sip_svc.c | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/marvell/secure_dfx_access/armada_thermal.c b/drivers/marvell/secure_dfx_access/armada_thermal.c index 776fb2482..4f7191b5c 100644 --- a/drivers/marvell/secure_dfx_access/armada_thermal.c +++ b/drivers/marvell/secure_dfx_access/armada_thermal.c @@ -217,8 +217,8 @@ static void armada_is_valid(u_register_t *read) *read = (mmio_read_32(TSEN_STATUS) & TSEN_STATUS_VALID_MASK); } -int mvebu_dfx_handle(u_register_t func, u_register_t *read, u_register_t x2, - u_register_t x3) +int mvebu_dfx_thermal_handle(u_register_t func, u_register_t *read, + u_register_t x2, u_register_t x3) { debug_enter(); diff --git a/drivers/marvell/secure_dfx_access/dfx.h b/drivers/marvell/secure_dfx_access/dfx.h index e60d2f9c5..52efbf941 100644 --- a/drivers/marvell/secure_dfx_access/dfx.h +++ b/drivers/marvell/secure_dfx_access/dfx.h @@ -13,5 +13,5 @@ #define MV_SIP_DFX_THERMAL_THRESH 5 #define MV_SIP_DFX_THERMAL_SEL_CHANNEL 6 -int mvebu_dfx_handle(u_register_t func, u_register_t *read, u_register_t x2, - u_register_t x3); +int mvebu_dfx_thermal_handle(u_register_t func, u_register_t *read, + u_register_t x2, u_register_t x3); diff --git a/plat/marvell/armada/common/mrvl_sip_svc.c b/plat/marvell/armada/common/mrvl_sip_svc.c index bdf79b211..aa9439301 100644 --- a/plat/marvell/armada/common/mrvl_sip_svc.c +++ b/plat/marvell/armada/common/mrvl_sip_svc.c @@ -139,8 +139,12 @@ uintptr_t mrvl_sip_smc_handler(uint32_t smc_fid, SMC_RET1(handle, 0); #endif case MV_SIP_DFX: - ret = mvebu_dfx_handle(x1, &read, x2, x3); - SMC_RET2(handle, ret, read); + if (x1 >= MV_SIP_DFX_THERMAL_INIT && + x1 <= MV_SIP_DFX_THERMAL_SEL_CHANNEL) { + ret = mvebu_dfx_thermal_handle(x1, &read, x2, x3); + SMC_RET2(handle, ret, read); + } + SMC_RET1(handle, SMC_UNK); case MV_SIP_RNG_64: ret = eip76_rng_get_random((uint8_t *)&w2, 4 * (x1 % 2 + 1)); SMC_RET3(handle, ret, w2[0], w2[1]); -- GitLab