[PATCH] clk: ti: Notify AVS driver upon setting clock rate

Nishanth Menon nm at ti.com
Tue Sep 19 13:14:58 CEST 2023


On 11:36-20230919, Udit Kumar wrote:
> AVS is enabled at R5 SPL stage, where clk-k3 is used
> instead if clk-sci driver.
> 
> clk-k3 driver to notify AVS driver upon setting clock rate
> so that voltage is changed accordingly.
> 
> Fixes: e0aa873bc7cd ("clk: clk-ti-sci: Notify AVS driver upon setting clock rate")
> 
> Cc: Keerthy <j-keerthy at ti.com>
> Signed-off-by: Udit Kumar <u-kumar1 at ti.com>
> ---
>  drivers/clk/ti/clk-k3.c  | 5 +++++
>  drivers/clk/ti/clk-sci.c | 5 -----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/ti/clk-k3.c b/drivers/clk/ti/clk-k3.c
> index ba925fa3c4..8016c3784a 100644
> --- a/drivers/clk/ti/clk-k3.c
> +++ b/drivers/clk/ti/clk-k3.c
> @@ -11,6 +11,7 @@
>  #include <errno.h>
>  #include <soc.h>
>  #include <clk-uclass.h>
> +#include <k3-avs.h>
>  #include "k3-clk.h"
>  
>  #define PLL_MIN_FREQ	800000000
> @@ -339,6 +340,10 @@ static ulong ti_clk_set_rate(struct clk *clk, ulong rate)
>  		}
>  	}
>  
> +	if (IS_ENABLED(CONFIG_K3_AVS0))
> +		k3_avs_notify_freq(data->map[clk->id].dev_id,
> +				   data->map[clk->id].clk_id, rate);
> +
>  	return new_rate;
>  }
>  
> diff --git a/drivers/clk/ti/clk-sci.c b/drivers/clk/ti/clk-sci.c
> index 74df5a397b..298fa9dc8b 100644
> --- a/drivers/clk/ti/clk-sci.c
> +++ b/drivers/clk/ti/clk-sci.c
> @@ -17,7 +17,6 @@
>  #include <dm/device_compat.h>
>  #include <linux/err.h>
>  #include <linux/soc/ti/ti_sci_protocol.h>
> -#include <k3-avs.h>
>  
>  /**
>   * struct ti_sci_clk_data - clock controller information structure
> @@ -94,10 +93,6 @@ static ulong ti_sci_clk_set_rate(struct clk *clk, ulong rate)
>  
>  	debug("%s(clk=%p, rate=%lu)\n", __func__, clk, rate);
>  
> -#ifdef CONFIG_K3_AVS0
> -	k3_avs_notify_freq(clk->id, clk->data, rate);
> -#endif
> -

Why drop from here? we do have am64 and am65 that use ti-sci, correct?

>  	ret = cops->set_freq(sci, clk->id, clk->data, 0, rate, ULONG_MAX);
>  	if (ret) {
>  		dev_err(clk->dev, "%s: set_freq failed (%d)\n", __func__, ret);
> -- 
> 2.34.1
> 

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D


More information about the U-Boot mailing list