firmware: qcom_scm: Add support to read LMH data
Add support to a new scm call to read LMH data. Change-Id: Ifb8161292363bd18fb63a389692e67c547ac8bb6 Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
This commit is contained in:
parent
ea6921b403
commit
f0092d5391
@ -1773,6 +1773,30 @@ int __qcom_scm_lmh_get_type(struct device *dev, phys_addr_t payload,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int __qcom_scm_lmh_fetch_data(struct device *dev,
|
||||
u32 node_id, u32 debug_type, uint32_t *peak, uint32_t *avg)
|
||||
{
|
||||
int ret;
|
||||
struct qcom_scm_desc desc = {
|
||||
.svc = QCOM_SCM_SVC_LMH,
|
||||
.cmd = QCOM_SCM_LMH_DEBUG_FETCH_DATA,
|
||||
.owner = ARM_SMCCC_OWNER_SIP
|
||||
};
|
||||
|
||||
desc.args[0] = node_id;
|
||||
desc.args[1] = debug_type;
|
||||
desc.arginfo = SCM_ARGS(2, QCOM_SCM_VAL, QCOM_SCM_VAL);
|
||||
|
||||
ret = qcom_scm_call(dev, &desc);
|
||||
|
||||
if (peak)
|
||||
*peak = desc.res[0];
|
||||
if (avg)
|
||||
*avg = desc.res[1];
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int __qcom_scm_smmu_change_pgtbl_format(struct device *dev, u64 dev_id,
|
||||
int cbndx)
|
||||
{
|
||||
|
@ -857,6 +857,21 @@ int qcom_scm_lmh_get_type(phys_addr_t payload, u64 payload_size,
|
||||
}
|
||||
EXPORT_SYMBOL(qcom_scm_lmh_get_type);
|
||||
|
||||
int qcom_scm_lmh_fetch_data(u32 node_id, u32 debug_type, uint32_t *peak,
|
||||
uint32_t *avg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = __qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_LMH,
|
||||
QCOM_SCM_LMH_DEBUG_FETCH_DATA);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
|
||||
return __qcom_scm_lmh_fetch_data(__scm->dev, node_id, debug_type,
|
||||
peak, avg);
|
||||
}
|
||||
EXPORT_SYMBOL(qcom_scm_lmh_fetch_data);
|
||||
|
||||
int qcom_scm_smmu_change_pgtbl_format(u64 dev_id, int cbndx)
|
||||
{
|
||||
return __qcom_scm_smmu_change_pgtbl_format(__scm->dev, dev_id, cbndx);
|
||||
|
@ -188,6 +188,7 @@ extern int __qcom_scm_hdcp_req(struct device *dev,
|
||||
#define QCOM_SCM_LMH_LIMIT_DCVSH 0x10
|
||||
#define QCOM_SCM_LMH_DEBUG_READ 0x0A
|
||||
#define QCOM_SCM_LMH_DEBUG_GET_TYPE 0x0B
|
||||
#define QCOM_SCM_LMH_DEBUG_FETCH_DATA 0x0D
|
||||
extern int __qcom_scm_lmh_read_buf_size(struct device *dev, int *size);
|
||||
extern int __qcom_scm_lmh_limit_dcvsh(struct device *dev, phys_addr_t payload,
|
||||
uint32_t payload_size, u64 limit_node, uint32_t node_id,
|
||||
@ -200,6 +201,8 @@ extern int __qcom_scm_lmh_debug_config_write(struct device *dev, u64 cmd_id,
|
||||
extern int __qcom_scm_lmh_get_type(struct device *dev, phys_addr_t payload,
|
||||
u64 payload_size, u64 debug_type, uint32_t get_from,
|
||||
uint32_t *size);
|
||||
extern int __qcom_scm_lmh_fetch_data(struct device *dev,
|
||||
u32 node_id, u32 debug_type, uint32_t *peak, uint32_t *avg);
|
||||
|
||||
#define QCOM_SCM_SVC_SMMU_PROGRAM 0x15
|
||||
#define QCOM_SCM_SMMU_CHANGE_PGTBL_FORMAT 0x01
|
||||
|
@ -174,6 +174,8 @@ extern int qcom_scm_lmh_debug_set_config_write(phys_addr_t payload,
|
||||
int payload_size, uint32_t *buf, int buf_size);
|
||||
extern int qcom_scm_lmh_get_type(phys_addr_t payload, u64 payload_size,
|
||||
u64 debug_type, uint32_t get_from, uint32_t *size);
|
||||
extern int qcom_scm_lmh_fetch_data(u32 node_id, u32 debug_type, uint32_t *peak,
|
||||
uint32_t *avg);
|
||||
extern int qcom_scm_smmu_change_pgtbl_format(u64 dev_id, int cbndx);
|
||||
extern int qcom_scm_qsmmu500_wait_safe_toggle(bool en);
|
||||
extern int qcom_scm_smmu_notify_secure_lut(u64 dev_id, bool secure);
|
||||
@ -330,6 +332,9 @@ static inline int qcom_scm_lmh_debug_set_config_write(phys_addr_t payload,
|
||||
static inline int qcom_scm_lmh_get_type(phys_addr_t payload, u64 payload_size,
|
||||
u64 debug_type, uint32_t get_from, uint32_t *size)
|
||||
{ return -ENODEV; }
|
||||
static inline int qcom_scm_lmh_fetch_data(u32 node_id, u32 debug_type,
|
||||
uint32_t *peak, uint32_t *avg)
|
||||
{ return -ENODEV; }
|
||||
static inline int qcom_scm_smmu_change_pgtbl_format(u64 dev_id, int cbndx)
|
||||
{ return -ENODEV; }
|
||||
static inline int qcom_scm_qsmmu500_wait_safe_toggle(bool en)
|
||||
|
Loading…
Reference in New Issue
Block a user