aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Nischal <anischal@codeaurora.org>2018-06-11 02:38:15 -0400
committerStephen Boyd <sboyd@kernel.org>2018-07-03 13:10:36 -0400
commitcfb8282e18e292a8efc4d13ea1e4547a47dfb2d0 (patch)
tree493de635cf96dc0db70e2b89945f0e742bba2714
parentce397d215ccd07b8ae3f71db689aedb85d56ab40 (diff)
clk: qcom: Enable clocks which needs to be always on for SDM845
There are certain clocks which needs to be always enabled for system operation. Add support for the same by adding 'CLK_IS_CRITICAL' flag for such clocks. Signed-off-by: Amit Nischal <anischal@codeaurora.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
-rw-r--r--drivers/clk/qcom/gcc-sdm845.c43
-rw-r--r--include/dt-bindings/clock/qcom,gcc-sdm845.h2
2 files changed, 41 insertions, 4 deletions
diff --git a/drivers/clk/qcom/gcc-sdm845.c b/drivers/clk/qcom/gcc-sdm845.c
index e78e6f5b99fc..0f694ed4238a 100644
--- a/drivers/clk/qcom/gcc-sdm845.c
+++ b/drivers/clk/qcom/gcc-sdm845.c
@@ -1103,6 +1103,7 @@ static struct clk_branch gcc_camera_ahb_clk = {
1103 .enable_mask = BIT(0), 1103 .enable_mask = BIT(0),
1104 .hw.init = &(struct clk_init_data){ 1104 .hw.init = &(struct clk_init_data){
1105 .name = "gcc_camera_ahb_clk", 1105 .name = "gcc_camera_ahb_clk",
1106 .flags = CLK_IS_CRITICAL,
1106 .ops = &clk_branch2_ops, 1107 .ops = &clk_branch2_ops,
1107 }, 1108 },
1108 }, 1109 },
@@ -1129,6 +1130,7 @@ static struct clk_branch gcc_camera_xo_clk = {
1129 .enable_mask = BIT(0), 1130 .enable_mask = BIT(0),
1130 .hw.init = &(struct clk_init_data){ 1131 .hw.init = &(struct clk_init_data){
1131 .name = "gcc_camera_xo_clk", 1132 .name = "gcc_camera_xo_clk",
1133 .flags = CLK_IS_CRITICAL,
1132 .ops = &clk_branch2_ops, 1134 .ops = &clk_branch2_ops,
1133 }, 1135 },
1134 }, 1136 },
@@ -1270,6 +1272,7 @@ static struct clk_branch gcc_disp_ahb_clk = {
1270 .enable_mask = BIT(0), 1272 .enable_mask = BIT(0),
1271 .hw.init = &(struct clk_init_data){ 1273 .hw.init = &(struct clk_init_data){
1272 .name = "gcc_disp_ahb_clk", 1274 .name = "gcc_disp_ahb_clk",
1275 .flags = CLK_IS_CRITICAL,
1273 .ops = &clk_branch2_ops, 1276 .ops = &clk_branch2_ops,
1274 }, 1277 },
1275 }, 1278 },
@@ -1328,6 +1331,7 @@ static struct clk_branch gcc_disp_xo_clk = {
1328 .enable_mask = BIT(0), 1331 .enable_mask = BIT(0),
1329 .hw.init = &(struct clk_init_data){ 1332 .hw.init = &(struct clk_init_data){
1330 .name = "gcc_disp_xo_clk", 1333 .name = "gcc_disp_xo_clk",
1334 .flags = CLK_IS_CRITICAL,
1331 .ops = &clk_branch2_ops, 1335 .ops = &clk_branch2_ops,
1332 }, 1336 },
1333 }, 1337 },
@@ -1397,6 +1401,7 @@ static struct clk_branch gcc_gpu_cfg_ahb_clk = {
1397 .enable_mask = BIT(0), 1401 .enable_mask = BIT(0),
1398 .hw.init = &(struct clk_init_data){ 1402 .hw.init = &(struct clk_init_data){
1399 .name = "gcc_gpu_cfg_ahb_clk", 1403 .name = "gcc_gpu_cfg_ahb_clk",
1404 .flags = CLK_IS_CRITICAL,
1400 .ops = &clk_branch2_ops, 1405 .ops = &clk_branch2_ops,
1401 }, 1406 },
1402 }, 1407 },
@@ -2985,6 +2990,7 @@ static struct clk_branch gcc_video_ahb_clk = {
2985 .enable_mask = BIT(0), 2990 .enable_mask = BIT(0),
2986 .hw.init = &(struct clk_init_data){ 2991 .hw.init = &(struct clk_init_data){
2987 .name = "gcc_video_ahb_clk", 2992 .name = "gcc_video_ahb_clk",
2993 .flags = CLK_IS_CRITICAL,
2988 .ops = &clk_branch2_ops, 2994 .ops = &clk_branch2_ops,
2989 }, 2995 },
2990 }, 2996 },
@@ -3011,6 +3017,7 @@ static struct clk_branch gcc_video_xo_clk = {
3011 .enable_mask = BIT(0), 3017 .enable_mask = BIT(0),
3012 .hw.init = &(struct clk_init_data){ 3018 .hw.init = &(struct clk_init_data){
3013 .name = "gcc_video_xo_clk", 3019 .name = "gcc_video_xo_clk",
3020 .flags = CLK_IS_CRITICAL,
3014 .ops = &clk_branch2_ops, 3021 .ops = &clk_branch2_ops,
3015 }, 3022 },
3016 }, 3023 },
@@ -3049,6 +3056,36 @@ static struct clk_branch gcc_vs_ctrl_clk = {
3049 }, 3056 },
3050}; 3057};
3051 3058
3059static struct clk_branch gcc_cpuss_dvm_bus_clk = {
3060 .halt_reg = 0x48190,
3061 .halt_check = BRANCH_HALT,
3062 .clkr = {
3063 .enable_reg = 0x48190,
3064 .enable_mask = BIT(0),
3065 .hw.init = &(struct clk_init_data){
3066 .name = "gcc_cpuss_dvm_bus_clk",
3067 .flags = CLK_IS_CRITICAL,
3068 .ops = &clk_branch2_ops,
3069 },
3070 },
3071};
3072
3073static struct clk_branch gcc_cpuss_gnoc_clk = {
3074 .halt_reg = 0x48004,
3075 .halt_check = BRANCH_HALT_VOTED,
3076 .hwcg_reg = 0x48004,
3077 .hwcg_bit = 1,
3078 .clkr = {
3079 .enable_reg = 0x52004,
3080 .enable_mask = BIT(22),
3081 .hw.init = &(struct clk_init_data){
3082 .name = "gcc_cpuss_gnoc_clk",
3083 .flags = CLK_IS_CRITICAL,
3084 .ops = &clk_branch2_ops,
3085 },
3086 },
3087};
3088
3052static struct gdsc pcie_0_gdsc = { 3089static struct gdsc pcie_0_gdsc = {
3053 .gdscr = 0x6b004, 3090 .gdscr = 0x6b004,
3054 .pd = { 3091 .pd = {
@@ -3344,6 +3381,8 @@ static struct clk_regmap *gcc_sdm845_clocks[] = {
3344 [GPLL0] = &gpll0.clkr, 3381 [GPLL0] = &gpll0.clkr,
3345 [GPLL0_OUT_EVEN] = &gpll0_out_even.clkr, 3382 [GPLL0_OUT_EVEN] = &gpll0_out_even.clkr,
3346 [GPLL4] = &gpll4.clkr, 3383 [GPLL4] = &gpll4.clkr,
3384 [GCC_CPUSS_DVM_BUS_CLK] = &gcc_cpuss_dvm_bus_clk.clkr,
3385 [GCC_CPUSS_GNOC_CLK] = &gcc_cpuss_gnoc_clk.clkr,
3347}; 3386};
3348 3387
3349static const struct qcom_reset_map gcc_sdm845_resets[] = { 3388static const struct qcom_reset_map gcc_sdm845_resets[] = {
@@ -3433,10 +3472,6 @@ static int gcc_sdm845_probe(struct platform_device *pdev)
3433 regmap_update_bits(regmap, 0x09ffc, 0x3, 0x3); 3472 regmap_update_bits(regmap, 0x09ffc, 0x3, 0x3);
3434 regmap_update_bits(regmap, 0x71028, 0x3, 0x3); 3473 regmap_update_bits(regmap, 0x71028, 0x3, 0x3);
3435 3474
3436 /* Enable CPUSS clocks */
3437 regmap_update_bits(regmap, 0x48190, BIT(0), 0x1);
3438 regmap_update_bits(regmap, 0x52004, BIT(22), 0x1);
3439
3440 return qcom_cc_really_probe(pdev, &gcc_sdm845_desc, regmap); 3475 return qcom_cc_really_probe(pdev, &gcc_sdm845_desc, regmap);
3441} 3476}
3442 3477
diff --git a/include/dt-bindings/clock/qcom,gcc-sdm845.h b/include/dt-bindings/clock/qcom,gcc-sdm845.h
index aca61264f12c..f96fc2dbf60e 100644
--- a/include/dt-bindings/clock/qcom,gcc-sdm845.h
+++ b/include/dt-bindings/clock/qcom,gcc-sdm845.h
@@ -192,6 +192,8 @@
192#define GCC_VS_CTRL_CLK_SRC 182 192#define GCC_VS_CTRL_CLK_SRC 182
193#define GCC_VSENSOR_CLK_SRC 183 193#define GCC_VSENSOR_CLK_SRC 183
194#define GPLL4 184 194#define GPLL4 184
195#define GCC_CPUSS_DVM_BUS_CLK 185
196#define GCC_CPUSS_GNOC_CLK 186
195 197
196/* GCC Resets */ 198/* GCC Resets */
197#define GCC_MMSS_BCR 0 199#define GCC_MMSS_BCR 0