clk: qcom: gcc: Add GPU and NPU clocks for SM8150
Subsystems (3)
PATCH 1/2 clk: qcom: gcc: Add GPU and NPU clocks for SM8150
Add the GPU and NPU clocks for SM8150. They were missed in earlier addition of clock driver.
--- drivers/clk/qcom/gcc-sm8150.c | 72 +++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+)
drivers/clk/qcom/gcc-sm8150.c +72 -0
@@ -1617,6 +1617,40 @@ static struct clk_branch gcc_gpu_cfg_ahb_clk = { }, }; +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_gpu_gpll0_clk_src = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x52004 , + .enable_mask =BIT (15 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_gpu_gpll0_clk_src" , + .parent_hws = (const struct clk_hw *[]){ + &gpll0.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +/* these are external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_gpu_gpll0_div_clk_src = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x52004 , + .enable_mask =BIT (16 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_gpu_gpll0_div_clk_src" , + .parent_hws = (const struct clk_hw *[]){ + &gcc_gpu_gpll0_clk_src.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_gpu_iref_clk = { .halt_reg =0x8c010 , .halt_check =BRANCH_HALT ,
@@ -1699,6 +1733,40 @@ static struct clk_branch gcc_npu_cfg_ahb_clk = { }, }; +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_npu_gpll0_clk_src = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x52004 , + .enable_mask =BIT (18 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_npu_gpll0_clk_src" , + .parent_hws = (const struct clk_hw *[]){ + &gpll0.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_npu_gpll0_div_clk_src = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x52004 , + .enable_mask =BIT (19 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_npu_gpll0_div_clk_src" , + .parent_hws = (const struct clk_hw *[]){ + &gcc_npu_gpll0_clk_src.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_npu_trig_clk = { .halt_reg =0x4d00c , .halt_check =BRANCH_VOTED ,
@@ -3375,12 +3443,16 @@ static struct clk_regmap *gcc_sm8150_clocks[] = { [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr, [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr, + [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr, + [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr, [GCC_GPU_IREF_CLK] = &gcc_gpu_iref_clk.clkr, [GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr, [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr, [GCC_NPU_AT_CLK] = &gcc_npu_at_clk.clkr, [GCC_NPU_AXI_CLK] = &gcc_npu_axi_clk.clkr, [GCC_NPU_CFG_AHB_CLK] = &gcc_npu_cfg_ahb_clk.clkr, + [GCC_NPU_GPLL0_CLK_SRC] = &gcc_npu_gpll0_clk_src.clkr, + [GCC_NPU_GPLL0_DIV_CLK_SRC] = &gcc_npu_gpll0_div_clk_src.clkr, [GCC_NPU_TRIG_CLK] = &gcc_npu_trig_clk.clkr, [GCC_PCIE0_PHY_REFGEN_CLK] = &gcc_pcie0_phy_refgen_clk.clkr, [GCC_PCIE1_PHY_REFGEN_CLK] = &gcc_pcie1_phy_refgen_clk.clkr,
Signature · 1 line
2.25.1
PATCH 2/2 clk: qcom: gcc: Add missing UFS clocks for SM8150
Add the missing ufs card and ufs phy clocks for SM8150. They were missed in earlier addition of clock driver.
--- drivers/clk/qcom/gcc-sm8150.c | 84 +++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+)
drivers/clk/qcom/gcc-sm8150.c +84 -0
@@ -2881,6 +2881,45 @@ static struct clk_branch gcc_ufs_card_phy_aux_hw_ctl_clk = { }, }; +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_card_rx_symbol_0_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x7501c , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_ufs_card_rx_symbol_0_clk" , + .ops = &clk_branch2_ops, + }, + }, +}; + +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_card_rx_symbol_1_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x750ac , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_ufs_card_rx_symbol_1_clk" , + .ops = &clk_branch2_ops, + }, + }, +}; + +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_card_tx_symbol_0_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x75018 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_ufs_card_tx_symbol_0_clk" , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_ufs_card_unipro_core_clk = { .halt_reg =0x75058 , .halt_check =BRANCH_HALT ,
@@ -3061,6 +3100,45 @@ static struct clk_branch gcc_ufs_phy_phy_aux_hw_ctl_clk = { }, }; +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_phy_rx_symbol_0_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x7701c , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_ufs_phy_rx_symbol_0_clk" , + .ops = &clk_branch2_ops, + }, + }, +}; + +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_phy_rx_symbol_1_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x770ac , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_ufs_phy_rx_symbol_1_clk" , + .ops = &clk_branch2_ops, + }, + }, +}; + +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_phy_tx_symbol_0_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x77018 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_ufs_phy_tx_symbol_0_clk" , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_ufs_phy_unipro_core_clk = { .halt_reg =0x77058 , .halt_check =BRANCH_HALT ,
@@ -3557,6 +3635,9 @@ static struct clk_regmap *gcc_sm8150_clocks[] = { [GCC_UFS_CARD_PHY_AUX_CLK_SRC] = &gcc_ufs_card_phy_aux_clk_src.clkr, [GCC_UFS_CARD_PHY_AUX_HW_CTL_CLK ] = &gcc_ufs_card_phy_aux_hw_ctl_clk.clkr, + [GCC_UFS_CARD_RX_SYMBOL_0_CLK] = &gcc_ufs_card_rx_symbol_0_clk.clkr, + [GCC_UFS_CARD_RX_SYMBOL_1_CLK] = &gcc_ufs_card_rx_symbol_1_clk.clkr, + [GCC_UFS_CARD_TX_SYMBOL_0_CLK] = &gcc_ufs_card_tx_symbol_0_clk.clkr, [GCC_UFS_CARD_UNIPRO_CORE_CLK] = &gcc_ufs_card_unipro_core_clk.clkr, [GCC_UFS_CARD_UNIPRO_CORE_CLK_SRC ] = &gcc_ufs_card_unipro_core_clk_src.clkr,
@@ -3574,6 +3655,9 @@ static struct clk_regmap *gcc_sm8150_clocks[] = { [GCC_UFS_PHY_PHY_AUX_CLK] = &gcc_ufs_phy_phy_aux_clk.clkr, [GCC_UFS_PHY_PHY_AUX_CLK_SRC] = &gcc_ufs_phy_phy_aux_clk_src.clkr, [GCC_UFS_PHY_PHY_AUX_HW_CTL_CLK] = &gcc_ufs_phy_phy_aux_hw_ctl_clk.clkr, + [GCC_UFS_PHY_RX_SYMBOL_0_CLK] = &gcc_ufs_phy_rx_symbol_0_clk.clkr, + [GCC_UFS_PHY_RX_SYMBOL_1_CLK] = &gcc_ufs_phy_rx_symbol_1_clk.clkr, + [GCC_UFS_PHY_TX_SYMBOL_0_CLK] = &gcc_ufs_phy_tx_symbol_0_clk.clkr, [GCC_UFS_PHY_UNIPRO_CORE_CLK] = &gcc_ufs_phy_unipro_core_clk.clkr, [GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC ] = &gcc_ufs_phy_unipro_core_clk_src.clkr,
Signature · 1 line
2.25.1
Stephen Boyd
maintainerRe: [PATCH 2/2] clk: qcom: gcc: Add missing UFS clocks for SM8150
Quoting Vinod Koul (2020-04-23 21:43:11)
Quoted 14 lines
Add the missing ufs card and ufs phy clocks for SM8150. They were missed in earlier addition of clock driver.
Signed-off-by Vinod Koul <[email protected]>--- drivers/clk/qcom/gcc-sm8150.c | 84 +++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+)drivers/clk/qcom/gcc-sm8150.c +0
-0@@ -2881,6 +2881,45 @@ static struct clk_branch gcc_ufs_card_phy_aux_hw_ctl_clk = { },
drivers/clk/qcom/gcc-sm8150.c static struct clk_branch gcc_ufs_card_phy_aux_hw_ctl_clk = { · line 2891
Quoted 10 lines
drivers/clk/qcom/gcc-sm8150.c +8
-0}; +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_card_rx_symbol_0_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x7501c , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_ufs_card_rx_symbol_0_clk" ,
Any reason to not use .fw_name?
Quoted 11 lines
drivers/clk/qcom/gcc-sm8150.c +11
-0+ .ops = &clk_branch2_ops, + }, + }, +}; + +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_card_rx_symbol_1_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x750ac , + .enable_mask =BIT (0 ),
Re: [PATCH 2/2] clk: qcom: gcc: Add missing UFS clocks for SM8150
Quoted 17 lines · Stephen Boyd
Quoting Vinod Koul (2020-04-23 21:43:11)
Quoted 16 lines
Add the missing ufs card and ufs phy clocks for SM8150. They were missed in earlier addition of clock driver.
Signed-off-by Vinod Koul <[email protected]>--- drivers/clk/qcom/gcc-sm8150.c | 84 +++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+)drivers/clk/qcom/gcc-sm8150.c +0
-0@@ -2881,6 +2881,45 @@ static struct clk_branch gcc_ufs_card_phy_aux_hw_ctl_clk = { }, };
Quoted 10 lines
drivers/clk/qcom/gcc-sm8150.c static struct clk_branch gcc_ufs_card_phy_aux_hw_ctl_clk = { · line 2891
Quoted 8 lines
drivers/clk/qcom/gcc-sm8150.c +8
-0+/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_card_rx_symbol_0_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x7501c , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_ufs_card_rx_symbol_0_clk" ,Any reason to not use .fw_name?
Did i understand it correct that you would like these to have .fw_name for parent? Should we start adding these clocks in DT description?
Signature · 1 line
~Vinod
Stephen Boyd
maintainerRe: [PATCH 2/2] clk: qcom: gcc: Add missing UFS clocks for SM8150
Quoting Vinod Koul (2020-04-26 21:55:34)
Quoted 29 lines · Stephen Boyd
Quoted 17 lines
Quoting Vinod Koul (2020-04-23 21:43:11)
Quoted 16 lines
Add the missing ufs card and ufs phy clocks for SM8150. They were missed in earlier addition of clock driver.
Signed-off-by Vinod Koul <[email protected]>--- drivers/clk/qcom/gcc-sm8150.c | 84 +++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+)drivers/clk/qcom/gcc-sm8150.c +0
-0@@ -2881,6 +2881,45 @@ static struct clk_branch gcc_ufs_card_phy_aux_hw_ctl_clk = { }, };Quoted 10 lines
drivers/clk/qcom/gcc-sm8150.c static struct clk_branch gcc_ufs_card_phy_aux_hw_ctl_clk = { · line 2891
Quoted 8 lines
drivers/clk/qcom/gcc-sm8150.c +8
-0+/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_card_rx_symbol_0_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x7501c , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_ufs_card_rx_symbol_0_clk" ,Any reason to not use .fw_name?
Quoted 3 lines
Did i understand it correct that you would like these to have .fw_name for parent? Should we start adding these clocks in DT description?
Sorry I misread the patch. This isn't a parent name description so .name is correct here.
Re: [PATCH 2/2] clk: qcom: gcc: Add missing UFS clocks for SM8150
Quoted 30 lines · Stephen Boyd
Quoting Vinod Koul (2020-04-26 21:55:34)
Quoted 29 lines · Stephen Boyd
Quoted 27 lines
Quoting Vinod Koul (2020-04-23 21:43:11)
Quoted 14 lines
Add the missing ufs card and ufs phy clocks for SM8150. They were missed in earlier addition of clock driver.
Signed-off-by Vinod Koul <[email protected]>--- drivers/clk/qcom/gcc-sm8150.c | 84 +++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+)drivers/clk/qcom/gcc-sm8150.c +0
-0@@ -2881,6 +2881,45 @@ static struct clk_branch gcc_ufs_card_phy_aux_hw_ctl_clk = { },drivers/clk/qcom/gcc-sm8150.c static struct clk_branch gcc_ufs_card_phy_aux_hw_ctl_clk = { · line 2891
Quoted 10 lines
drivers/clk/qcom/gcc-sm8150.c +8
-0}; +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_ufs_card_rx_symbol_0_clk = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x7501c , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_ufs_card_rx_symbol_0_clk" ,Any reason to not use .fw_name?
Quoted 5 lines
Quoted 2 lines
Did i understand it correct that you would like these to have .fw_name for parent? Should we start adding these clocks in DT description?
Sorry I misread the patch. This isn't a parent name description so .name is correct here.
No worries, I will add fixes and send the update
Thanks
Signature · 1 line
~Vinod
Stephen Boyd
maintainerQuoting Vinod Koul (2020-04-23 21:43:10)
Quoted 4 lines
Add the GPU and NPU clocks for SM8150. They were missed in earlier addition of clock driver.
Signed-off-by Vinod Koul <[email protected]>
Fixes tag? That way backporters know they're missing this.
Quoted 61 lines
--- drivers/clk/qcom/gcc-sm8150.c | 72 +++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+)drivers/clk/qcom/gcc-sm8150.c +42
-0@@ -1617,6 +1617,40 @@ static struct clk_branch gcc_gpu_cfg_ahb_clk = { }, }; +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_gpu_gpll0_clk_src = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x52004 , + .enable_mask =BIT (15 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_gpu_gpll0_clk_src" , + .parent_hws = (const struct clk_hw *[]){ + &gpll0.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +/* these are external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_gpu_gpll0_div_clk_src = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x52004 , + .enable_mask =BIT (16 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_gpu_gpll0_div_clk_src" , + .parent_hws = (const struct clk_hw *[]){ + &gcc_gpu_gpll0_clk_src.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_gpu_iref_clk = { .halt_reg =0x8c010 , .halt_check =BRANCH_HALT ,@@ -1699,6 +1733,40 @@ static struct clk_branch gcc_npu_cfg_ahb_clk = { }, }; +/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_npu_gpll0_clk_src = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x52004 , + .enable_mask =BIT (18 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_npu_gpll0_clk_src" ,
drivers/clk/qcom/gcc-sm8150.c static struct clk_branch gcc_npu_cfg_ahb_clk = { · line 1753
Quoted 10 lines
drivers/clk/qcom/gcc-sm8150.c +10
-0+ .parent_hws = (const struct clk_hw *[]){ + &gpll0.clkr.hw }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + .ops = &clk_branch2_ops, + }, + }, +}; + +/* external clocks so add BRANCH_HALT_SKIP */
None of these look external. The parents are all inside this driver. Why are we skipping the halt check?
Quoted 19 lines
drivers/clk/qcom/gcc-sm8150.c +16
-0+static struct clk_branch gcc_npu_gpll0_div_clk_src = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x52004 , + .enable_mask =BIT (19 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_npu_gpll0_div_clk_src" , + .parent_hws = (const struct clk_hw *[]){ + &gcc_npu_gpll0_clk_src.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_npu_trig_clk = { .halt_reg =0x4d00c , .halt_check =BRANCH_VOTED ,
Quoted 7 lines · Stephen Boyd
Quoting Vinod Koul (2020-04-23 21:43:10)
Quoted 4 lines
Add the GPU and NPU clocks for SM8150. They were missed in earlier addition of clock driver.
Signed-off-by Vinod Koul <[email protected]>Fixes tag? That way backporters know they're missing this.
Yes it makes sense to add here, will add.
Quoted 13 lines
Quoted 13 lines
drivers/clk/qcom/gcc-sm8150.c +13
-0+/* external clocks so add BRANCH_HALT_SKIP */ +static struct clk_branch gcc_npu_gpll0_clk_src = { + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x52004 , + .enable_mask =BIT (18 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_npu_gpll0_clk_src" , + .parent_hws = (const struct clk_hw *[]){ + &gpll0.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops,
Quoted 8 lines
drivers/clk/qcom/gcc-sm8150.c static struct clk_branch gcc_npu_cfg_ahb_clk = { · line 1753
Quoted 5 lines
drivers/clk/qcom/gcc-sm8150.c +5
-0+ }, + }, +}; + +/* external clocks so add BRANCH_HALT_SKIP */ None of these look external. The parents are all inside this driver. Why are we skipping the halt check?
yeah not sure why this got added here, tested and these look fine. I will update these and send update.
Thanks for the review
Signature · 1 line
~Vinod