[PATCH 2/3] clk: rockchip: allow grf_type_sys lookup in aux_grf_table

Nicolas Frattaroli nicolas.frattaroli at collabora.com
Wed Mar 18 05:35:41 PDT 2026


On Monday, 16 March 2026 14:06:32 Central European Standard Time Daniele Briguglio wrote:
> Remove the grf_type_sys exclusion from the auxiliary GRF table lookup
> in rockchip_clk_register_branches(). Previously, branches with
> grf_type_sys always used ctx->grf directly, bypassing the aux_grf_table.
> 
> This is a problem on SoCs like RK3588 where ctx->grf points to the
> PHP_GRF (set via the CRU's rockchip,grf phandle), but GATE_GRF clock
> entries need to access the SYS_GRF instead.
> 
> With this change, grf_type_sys branches first check the aux_grf_table,
> and fall back to ctx->grf if no entry is found. This is backwards
> compatible: on SoCs that do not register grf_type_sys in the
> aux_grf_table, the behavior is unchanged.
> 
> Signed-off-by: Daniele Briguglio <hello at superkali.me>
> ---
>  drivers/clk/rockchip/clk.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
> index e8b3b0b9a4f8..911e6b610618 100644
> --- a/drivers/clk/rockchip/clk.c
> +++ b/drivers/clk/rockchip/clk.c
> @@ -509,10 +509,9 @@ void rockchip_clk_register_branches(struct rockchip_clk_provider *ctx,
>  		clk = NULL;
>  
>  		/* for GRF-dependent branches, choose the right grf first */
> -		if ((list->branch_type == branch_grf_mux ||
> -		     list->branch_type == branch_grf_gate ||
> -		     list->branch_type == branch_grf_mmc) &&
> -		    list->grf_type != grf_type_sys) {
> +		if (list->branch_type == branch_grf_mux ||
> +		    list->branch_type == branch_grf_gate ||
> +		    list->branch_type == branch_grf_mmc) {
>  			hash_for_each_possible(ctx->aux_grf_table, agrf, node, list->grf_type) {
>  				if (agrf->type == list->grf_type) {
>  					grf = agrf->grf;
> 
> 

Reviewed-by: Nicolas Frattaroli <nicolas.frattaroli at collabora.com>

Kind regards,
Nicolas Frattaroli





More information about the Linux-rockchip mailing list