Browse Source

Merge "fix(scmi): add parameter for plat_scmi_clock_rates_array" into integration

pull/2000/head
Yann Gautier 1 year ago
committed by TrustedFirmware Code Review
parent
commit
88b2d81345
  1. 8
      drivers/scmi-msg/clock.c
  2. 4
      include/drivers/scmi-msg.h
  3. 7
      plat/st/stm32mp1/stm32mp1_scmi.c

8
drivers/scmi-msg/clock.c

@ -37,7 +37,8 @@ const char *plat_scmi_clock_get_name(unsigned int agent_id __unused,
int32_t plat_scmi_clock_rates_array(unsigned int agent_id __unused,
unsigned int scmi_id __unused,
unsigned long *rates __unused,
size_t *nb_elts __unused)
size_t *nb_elts __unused,
uint32_t start_idx __unused)
{
return SCMI_NOT_SUPPORTED;
}
@ -298,7 +299,7 @@ static void scmi_clock_describe_rates(struct scmi_msg *msg)
/* Platform may support array rate description */
status = plat_scmi_clock_rates_array(msg->agent_id, clock_id, NULL,
&nb_rates);
&nb_rates, 0);
if (status == SCMI_SUCCESS) {
/* Currently 12 cells mex, so it's affordable for the stack */
unsigned long plat_rates[RATES_ARRAY_SIZE_MAX / RATE_DESC_SIZE];
@ -307,7 +308,8 @@ static void scmi_clock_describe_rates(struct scmi_msg *msg)
size_t rem_nb = nb_rates - in_args->rate_index - ret_nb;
status = plat_scmi_clock_rates_array(msg->agent_id, clock_id,
plat_rates, &ret_nb);
plat_rates, &ret_nb,
in_args->rate_index);
if (status == SCMI_SUCCESS) {
write_rate_desc_array_in_buffer(msg->out + sizeof(p2a),
plat_rates, ret_nb);

4
include/drivers/scmi-msg.h

@ -113,10 +113,12 @@ const char *plat_scmi_clock_get_name(unsigned int agent_id,
* @scmi_id: SCMI clock ID
* @rates: If NULL, function returns, else output rates array
* @nb_elts: Array size of @rates.
* @start_idx: Start index of rates array
* Return an SCMI compliant error code
*/
int32_t plat_scmi_clock_rates_array(unsigned int agent_id, unsigned int scmi_id,
unsigned long *rates, size_t *nb_elts);
unsigned long *rates, size_t *nb_elts,
uint32_t start_idx);
/*
* Get clock possible rate as range with regular steps in Hertz

7
plat/st/stm32mp1/stm32mp1_scmi.c

@ -260,7 +260,8 @@ const char *plat_scmi_clock_get_name(unsigned int agent_id,
}
int32_t plat_scmi_clock_rates_array(unsigned int agent_id, unsigned int scmi_id,
unsigned long *array, size_t *nb_elts)
unsigned long *array, size_t *nb_elts,
uint32_t start_idx)
{
struct stm32_scmi_clk *clock = find_clock(agent_id, scmi_id);
@ -272,6 +273,10 @@ int32_t plat_scmi_clock_rates_array(unsigned int agent_id, unsigned int scmi_id,
return SCMI_DENIED;
}
if (start_idx > 0) {
return SCMI_OUT_OF_RANGE;
}
if (array == NULL) {
*nb_elts = 1U;
} else if (*nb_elts == 1U) {

Loading…
Cancel
Save