Skip to content

Commit b1e8d71

Browse files
Jeffrey Hugobebarino
authored andcommitted
clk: qcom: Add missing msm8998 ufs_unipro_core_clk_src
ufs_unipro_core_clk_src is required to allow UFS to clock scale for power savings. Fixes: b5f5f52 ("clk: qcom: Add MSM8998 Global Clock Control (GCC) driver") Signed-off-by: Jeffrey Hugo <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent d33b7eb commit b1e8d71

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

drivers/clk/qcom/gcc-msm8998.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,27 @@ static struct clk_rcg2 ufs_axi_clk_src = {
11101110
},
11111111
};
11121112

1113+
static const struct freq_tbl ftbl_ufs_unipro_core_clk_src[] = {
1114+
F(37500000, P_GPLL0_OUT_MAIN, 16, 0, 0),
1115+
F(75000000, P_GPLL0_OUT_MAIN, 8, 0, 0),
1116+
F(150000000, P_GPLL0_OUT_MAIN, 4, 0, 0),
1117+
{ }
1118+
};
1119+
1120+
static struct clk_rcg2 ufs_unipro_core_clk_src = {
1121+
.cmd_rcgr = 0x76028,
1122+
.mnd_width = 8,
1123+
.hid_width = 5,
1124+
.parent_map = gcc_parent_map_0,
1125+
.freq_tbl = ftbl_ufs_unipro_core_clk_src,
1126+
.clkr.hw.init = &(struct clk_init_data){
1127+
.name = "ufs_unipro_core_clk_src",
1128+
.parent_names = gcc_parent_names_0,
1129+
.num_parents = 4,
1130+
.ops = &clk_rcg2_ops,
1131+
},
1132+
};
1133+
11131134
static const struct freq_tbl ftbl_usb30_master_clk_src[] = {
11141135
F(19200000, P_XO, 1, 0, 0),
11151136
F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
@@ -2549,6 +2570,11 @@ static struct clk_branch gcc_ufs_unipro_core_clk = {
25492570
.enable_mask = BIT(0),
25502571
.hw.init = &(struct clk_init_data){
25512572
.name = "gcc_ufs_unipro_core_clk",
2573+
.parent_names = (const char *[]){
2574+
"ufs_unipro_core_clk_src",
2575+
},
2576+
.num_parents = 1,
2577+
.flags = CLK_SET_RATE_PARENT,
25522578
.ops = &clk_branch2_ops,
25532579
},
25542580
},
@@ -2904,6 +2930,7 @@ static struct clk_regmap *gcc_msm8998_clocks[] = {
29042930
[SDCC4_APPS_CLK_SRC] = &sdcc4_apps_clk_src.clkr,
29052931
[TSIF_REF_CLK_SRC] = &tsif_ref_clk_src.clkr,
29062932
[UFS_AXI_CLK_SRC] = &ufs_axi_clk_src.clkr,
2933+
[UFS_UNIPRO_CORE_CLK_SRC] = &ufs_unipro_core_clk_src.clkr,
29072934
[USB30_MASTER_CLK_SRC] = &usb30_master_clk_src.clkr,
29082935
[USB30_MOCK_UTMI_CLK_SRC] = &usb30_mock_utmi_clk_src.clkr,
29092936
[USB3_PHY_AUX_CLK_SRC] = &usb3_phy_aux_clk_src.clkr,

include/dt-bindings/clock/qcom,gcc-msm8998.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
#define GCC_MSS_SNOC_AXI_CLK 174
184184
#define GCC_MSS_MNOC_BIMC_AXI_CLK 175
185185
#define GCC_BIMC_GFX_CLK 176
186+
#define UFS_UNIPRO_CORE_CLK_SRC 177
186187

187188
#define PCIE_0_GDSC 0
188189
#define UFS_GDSC 1

0 commit comments

Comments
 (0)