Skip to contentSkip to conversation

clk: qcom: Enable clocks which needs to be always on for SDM845

PATCH Superseded Amit Nischal 2 participants 3 messages May 29, 2018 – Jun 11, 2018

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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. Remove support for such clocks from the clock driver and enable them explicitly gcc driver probe. Also fix the target name in kernel configuration description for SDM845 gcc driver.

---

Changes in v2:
* Fix target name in kernel configuration help text for SDM845 GCC clock driver.

[v1]: https://lkml.org/lkml/2018/5/28/171

 drivers/clk/qcom/Kconfig                    |   2 +-
 drivers/clk/qcom/gcc-sdm845.c               | 119 +---------
 include/dt-bindings/clock/qcom,gcc-sdm845.h | 351 ++++++++++++++--------------
 3 files changed, 183 insertions(+), 289 deletions(-)
drivers/clk/qcom/Kconfig +1 -1
index fc3edd1..79e9144 100644
@@ -231,7 +231,7 @@ config SDM_GCC_845
 	select QCOM_GDSC
 	depends on COMMON_CLK_QCOM
 	help
-	  Support for the global clock controller on msm8998 devices.
+	  Support for the global clock controller on SDM845 devices.
 	  Say Y if you want to use peripheral devices such as UART, SPI,
 	  I2C, USB, UFS, SDDC, PCIe, etc.
 
drivers/clk/qcom/gcc-sdm845.c +10 -109

196 lines not on this page · raw message

include/dt-bindings/clock/qcom,gcc-sdm845.h +172 -179

357 lines not on this page · raw message

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

maintainer
#1 lore raw

Quoting Amit Nischal (2018-05-28 23:07:46)

Quoted 4 lines

There are certain clocks which needs to be always enabled for system operation. Remove support for such clocks from the clock driver and enable them explicitly gcc driver probe. Also fix the target name in kernel configuration description for SDM845 gcc driver.

This is why we have CLK_IS_CRITICAL.

Quoted 8 lines

---

drivers/clk/qcom/Kconfig +0 -0
index fc3edd1..79e9144 100644

drivers/clk/qcom/Kconfig config SDM_GCC_845 · line 237

Quoted 8 lines
drivers/clk/qcom/Kconfig +1 -1
@@ -231,7 +231,7 @@ config SDM_GCC_845
        select QCOM_GDSC
        depends on COMMON_CLK_QCOM
        help
-         Support for the global clock controller on msm8998 devices.
+         Support for the global clock controller on SDM845 devices.
          Say Y if you want to use peripheral devices such as UART, SPI,
          I2C, USB, UFS, SDDC, PCIe, etc.
 

This can be its own patch.

Quoted 11 lines
drivers/clk/qcom/gcc-sdm845.c +0 -3
index e78e6f5..b40aafc 100644
@@ -3433,9 +3327,16 @@ static int gcc_sdm845_probe(struct platform_device *pdev)
        regmap_update_bits(regmap, 0x09ffc, 0x3, 0x3);
        regmap_update_bits(regmap, 0x71028, 0x3, 0x3);
 
-       /* Enable CPUSS clocks */
-       regmap_update_bits(regmap, 0x48190, BIT(0), 0x1);
-       regmap_update_bits(regmap, 0x52004, BIT(22), 0x1);

drivers/clk/qcom/gcc-sdm845.c static int gcc_sdm845_probe(struct platform_device *pdev) · line 3339

Quoted 10 lines
drivers/clk/qcom/gcc-sdm845.c +10 -0
+       /* Enable clocks which are required to be always ON */
+       regmap_update_bits(regmap, 0xb004, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0xb008, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0xb00c, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0xb028, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0xb02c, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0xb030, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0x48190, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0x52004, BIT(22), BIT(22));
+       regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0));

Let's do CLK_IS_CRITICAL flag instead. That has the added benefit of checking to make sure the halt bit toggles correctly so the clks are verified to be enabled.

include/dt-bindings/clock/qcom,gcc-sdm845.h line 16

Quoted 12 lines
drivers/clk/qcom/gcc-sdm845.c +0 -0
        return qcom_cc_really_probe(pdev, &gcc_sdm845_desc, regmap);
 }
include/dt-bindings/clock/qcom,gcc-sdm845.h +0 -1
index aca6126..6330c3f 100644
@@ -13,185 +13,178 @@
 #define GCC_AGGRE_USB3_PRIM_AXI_CLK                            3
 #define GCC_AGGRE_USB3_SEC_AXI_CLK                             4
 #define GCC_BOOT_ROM_AHB_CLK                                   5
-#define GCC_CAMERA_AHB_CLK                                     6

Don't do this. Things should only be added to here, not removed or reshuffled.

Quoted 3 lines
include/dt-bindings/clock/qcom,gcc-sdm845.h +0 -3
-#define GCC_CAMERA_AXI_CLK                                     7
-#define GCC_CAMERA_XO_CLK                                      8
-#define GCC_CE1_AHB_CLK                                                9
#2 lore raw
Quoted 19 lines · Stephen Boyd

Quoting Amit Nischal (2018-05-28 23:07:46)

Quoted 4 lines

There are certain clocks which needs to be always enabled for system operation. Remove support for such clocks from the clock driver and enable them explicitly gcc driver probe. Also fix the target name in kernel configuration description for SDM845 gcc driver.

This is why we have CLK_IS_CRITICAL.

Quoted 11 lines

---

drivers/clk/qcom/Kconfig +0 -0
index fc3edd1..79e9144 100644
@@ -231,7 +231,7 @@ config SDM_GCC_845
        select QCOM_GDSC
        depends on COMMON_CLK_QCOM
        help
Quoted 9 lines

drivers/clk/qcom/Kconfig config SDM_GCC_845 · line 236

Quoted 6 lines
drivers/clk/qcom/Kconfig +1 -1
-         Support for the global clock controller on msm8998 devices.
+         Support for the global clock controller on SDM845 devices.
          Say Y if you want to use peripheral devices such as UART, 
 SPI,
          I2C, USB, UFS, SDDC, PCIe, etc.

This can be its own patch.

Thanks for fixing above as this is already in the clk-next branch under commit "77122d".

Quoted 18 lines
Quoted 18 lines
drivers/clk/qcom/gcc-sdm845.c +6 -3
index e78e6f5..b40aafc 100644
@@ -3433,9 +3327,16 @@ static int gcc_sdm845_probe(struct 
 platform_device *pdev)
        regmap_update_bits(regmap, 0x09ffc, 0x3, 0x3);
        regmap_update_bits(regmap, 0x71028, 0x3, 0x3);
 
-       /* Enable CPUSS clocks */
-       regmap_update_bits(regmap, 0x48190, BIT(0), 0x1);
-       regmap_update_bits(regmap, 0x52004, BIT(22), 0x1);
+       /* Enable clocks which are required to be always ON */
+       regmap_update_bits(regmap, 0xb004, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0xb008, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0xb00c, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0xb028, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0xb02c, BIT(0), BIT(0));
Quoted 9 lines

drivers/clk/qcom/gcc-sdm845.c static int gcc_sdm845_probe(struct platform_device *pdev) · line 3339

Quoted 4 lines
drivers/clk/qcom/gcc-sdm845.c +4 -0
+       regmap_update_bits(regmap, 0xb030, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0x48190, BIT(0), BIT(0));
+       regmap_update_bits(regmap, 0x52004, BIT(22), BIT(22));
+       regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0));

Let's do CLK_IS_CRITICAL flag instead. That has the added benefit of checking to make sure the halt bit toggles correctly so the clks are verified to be enabled.

I will submit the next patch for all above-listed clocks with CLK_IS_CRITICAL flag.

Quoted 24 lines

include/dt-bindings/clock/qcom,gcc-sdm845.h line 16

Quoted 12 lines
drivers/clk/qcom/gcc-sdm845.c +0 -0
        return qcom_cc_really_probe(pdev, &gcc_sdm845_desc, regmap);
 }
include/dt-bindings/clock/qcom,gcc-sdm845.h +0 -1
index aca6126..6330c3f 100644
@@ -13,185 +13,178 @@
 #define GCC_AGGRE_USB3_PRIM_AXI_CLK                            3
 #define GCC_AGGRE_USB3_SEC_AXI_CLK                             4
 #define GCC_BOOT_ROM_AHB_CLK                                   5
-#define GCC_CAMERA_AHB_CLK                                     6

Don't do this. Things should only be added to here, not removed or reshuffled.

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

Quoted 4 lines
include/dt-bindings/clock/qcom,gcc-sdm845.h +0 -3
-#define GCC_CAMERA_AXI_CLK                                     7
-#define GCC_CAMERA_XO_CLK                                      8
-#define GCC_CE1_AHB_CLK                                               
 9

--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html