Skip to contentSkip to conversation

MSM8998 Multimedia Clock Controller

PATCH Superseded Jeffrey Hugo 3 participants 13 messages May 21, 2019 – Jun 11, 2019

Subsystems (5)

v4 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

v4 cover MSM8998 Multimedia Clock Controller

The multimedia clock controller (mmcc) is the main clock controller for the multimedia subsystem and is required to enable things like display and camera.

v4:
-fix makefile to use correct config item
-pick up tags
-fix ordering of clocks and clock-names in dt
-drop MODULE_ALIAS
-wait for xo in mmcc since that was found to be useful in some debug configs

v3:
-Rebase onto linux-next to get the final version of the clk parent rewrite series
-Moved the bindings header to the bindings patch per Rob
-Made xo manditory for GCC to work around the lack of clk orphan probe defer to avoid the uart console glitch

v2:
-Rebased on the "Rewrite clk parent handling" series and updated to the clk init mechanisms introduced there.
-Marked XO clk as CLK_IGNORE_UNUSED to avoid the concern about the XO going away "incorrectly" during late init
-Corrected the name of the XO clock to "xo"
-Dropped the fake XO clock in GCC to prevent a namespace conflict -Fully enumerated the external clocks (DSI PLLs, etc) in the DT binding -Cleaned up the weird newlines in the added DT node
-Added DT header file to msm8998 DT for future clients

Jeffrey Hugo (6):
dt-bindings: clock: Document external clocks for MSM8998 gcc
arm64: dts: msm8998: Add xo clock to gcc node
clk: qcom: smd: Add XO clock for MSM8998
dt-bindings: clock: Add support for the MSM8998 mmcc
clk: qcom: Add MSM8998 Multimedia Clock Controller (MMCC) driver
arm64: dts: qcom: msm8998: Add mmcc node

 .../devicetree/bindings/clock/qcom,gcc.txt    |   10 +
 .../devicetree/bindings/clock/qcom,mmcc.txt   |   21 +
 arch/arm64/boot/dts/qcom/msm8998.dtsi         |   16 +
 drivers/clk/qcom/Kconfig                      |    9 +
 drivers/clk/qcom/Makefile                     |    1 +
 drivers/clk/qcom/clk-smd-rpm.c                |   24 +-
 drivers/clk/qcom/gcc-msm8998.c                |   29 +-
 drivers/clk/qcom/mmcc-msm8998.c               | 2915 +++++++++++++++++
 include/dt-bindings/clock/qcom,mmcc-msm8998.h |  210 ++
 9 files changed, 3214 insertions(+), 21 deletions(-)
 create mode 100644 drivers/clk/qcom/mmcc-msm8998.c
 create mode 100644 include/dt-bindings/clock/qcom,mmcc-msm8998.h
Signature · 1 line
2.17.1
#1 lore raw

PATCH v4 1/6 dt-bindings: clock: Document external clocks for MSM8998 gcc

The global clock controller on MSM8998 can consume a number of external clocks. Document them.

---
 Documentation/devicetree/bindings/clock/qcom,gcc.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/clock/qcom,gcc.txt +10 -0
index 8661c3c..7d45323 100644
@@ -28,6 +28,16 @@ Required properties :
 - #clock-cells : shall contain 1
 - #reset-cells : shall contain 1
 
+For MSM8998 only:
+	- clocks: a list of phandles and clock-specifier pairs,
+		  one for each entry in clock-names.
+	- clock-names: "xo" (required)
+		       "usb3_pipe" (optional)
+		       "ufs_rx_symbol0" (optional)
+		       "ufs_rx_symbol1" (optional)
+		       "ufs_tx_symbol0" (optional)
+		       "pcie0_pipe" (optional)
+
 Optional properties :
 - #power-domain-cells : shall contain 1
 - Qualcomm TSENS (thermal sensor device) on some devices can
Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
maintainer
#2 lore raw

Re: [PATCH v4 1/6] dt-bindings: clock: Document external clocks for MSM8998 gcc

Quoting Jeffrey Hugo (2019-05-21 07:46:33)

Quoted 15 lines

The global clock controller on MSM8998 can consume a number of external clocks. Document them.

---
 Documentation/devicetree/bindings/clock/qcom,gcc.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/clock/qcom,gcc.txt +0 -0
index 8661c3c..7d45323 100644

Documentation/devicetree/bindings/clock/qcom,gcc.txt Required properties : · line 31

Quoted 4 lines
Documentation/devicetree/bindings/clock/qcom,gcc.txt +1 -0
@@ -28,6 +28,16 @@ Required properties :
 - #clock-cells : shall contain 1
 - #reset-cells : shall contain 1
 
+For MSM8998 only:

It would be nice to get the rest of the SoCs supported by this binding to start listing clocks. But this is OK for now.

#3 lore raw

PATCH v4 2/6 arm64: dts: msm8998: Add xo clock to gcc node

In reply to Jeffrey Hugo

GCC is a consumer of the xo clock. Add a reference to the clock supplier to the gcc node.

---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/msm8998.dtsi +2 -0
index 574be78..141488e 100644
@@ -709,6 +709,8 @@
 			#reset-cells = <1>;
 			#power-domain-cells = <1>;
 			reg = <0x100000 0xb0000>;
+			clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>;
+			clock-names = "xo";
 		};
 
 		tlmm: pinctrl@3400000 {
Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#4 lore raw

PATCH v4 3/6 clk: qcom: smd: Add XO clock for MSM8998

In reply to Jeffrey Hugo

The XO clock generally feeds into other clock controllers as the parent for a lot of clock generators.

Drop the "fake" XO clock in GCC now that it is redundant as it will cause a namespace conflict.

---
 drivers/clk/qcom/clk-smd-rpm.c | 24 ++++++++++++++++++++----
 drivers/clk/qcom/gcc-msm8998.c | 29 ++++++++++++-----------------
 2 files changed, 32 insertions(+), 21 deletions(-)
drivers/clk/qcom/clk-smd-rpm.c +20 -4
index 22dd42a..55a622df 100644
@@ -68,7 +68,7 @@
 	}
 
 #define __DEFINE_CLK_SMD_RPM_BRANCH(_platform, _name, _active, type, r_id,    \
-				    stat_id, r, key)			      \
+				    stat_id, r, key, ignore_unused)			      \
 	static struct clk_smd_rpm _platform##_##_active;		      \
 	static struct clk_smd_rpm _platform##_##_name = {		      \
 		.rpm_res_type = (type),					      \
@@ -83,6 +83,7 @@
 			.name = #_name,					      \
 			.parent_names = (const char *[]){ "xo_board" },	      \
 			.num_parents = 1,				      \
+			.flags = (ignore_unused) ? CLK_IGNORE_UNUSED : 0,     \
 		},							      \
 	};								      \
 	static struct clk_smd_rpm _platform##_##_active = {		      \
@@ -99,6 +100,7 @@
 			.name = #_active,				      \
 			.parent_names = (const char *[]){ "xo_board" },	      \
 			.num_parents = 1,				      \
+			.flags = (ignore_unused) ? CLK_IGNORE_UNUSED : 0,     \
 		},							      \
 	}
 
@@ -108,7 +110,17 @@
 
 #define DEFINE_CLK_SMD_RPM_BRANCH(_platform, _name, _active, type, r_id, r)   \
 		__DEFINE_CLK_SMD_RPM_BRANCH(_platform, _name, _active, type,  \
-		r_id, 0, r, QCOM_RPM_SMD_KEY_ENABLE)
+		r_id, 0, r, QCOM_RPM_SMD_KEY_ENABLE, false)
+
+/*
+ * Intended for XO clock where we don't want it turned off during late init
+ * if we don't have a consumer by then, but can turn it off later for deep
+ * sleep
+ */
+#define DEFINE_CLK_SMD_RPM_BRANCH_SKIP_UNUSED(_platform, _name, _active, type,\
+					      r_id, r)			      \
+		__DEFINE_CLK_SMD_RPM_BRANCH(_platform, _name, _active, type,  \
+		r_id, 0, r, QCOM_RPM_SMD_KEY_ENABLE, true)
 
 #define DEFINE_CLK_SMD_RPM_QDSS(_platform, _name, _active, type, r_id)	      \
 		__DEFINE_CLK_SMD_RPM(_platform, _name, _active, type, r_id,   \
@@ -117,12 +129,12 @@
 #define DEFINE_CLK_SMD_RPM_XO_BUFFER(_platform, _name, _active, r_id)	      \
 		__DEFINE_CLK_SMD_RPM_BRANCH(_platform, _name, _active,	      \
 		QCOM_SMD_RPM_CLK_BUF_A, r_id, 0, 1000,			      \
-		QCOM_RPM_KEY_SOFTWARE_ENABLE)
+		QCOM_RPM_KEY_SOFTWARE_ENABLE, false)
 
 #define DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(_platform, _name, _active, r_id) \
 		__DEFINE_CLK_SMD_RPM_BRANCH(_platform, _name, _active,	      \
 		QCOM_SMD_RPM_CLK_BUF_A, r_id, 0, 1000,			      \
-		QCOM_RPM_KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY)
+		QCOM_RPM_KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY, false)
 
 #define to_clk_smd_rpm(_hw) container_of(_hw, struct clk_smd_rpm, hw)
 
@@ -656,6 +668,8 @@ static int clk_smd_rpm_enable_scaling(struct qcom_smd_rpm *rpm)
 };
 
 /* msm8998 */
+DEFINE_CLK_SMD_RPM_BRANCH_SKIP_UNUSED(msm8998, xo, xo_a, QCOM_SMD_RPM_MISC_CLK,
+				      0, 19200000);
 DEFINE_CLK_SMD_RPM(msm8998, snoc_clk, snoc_a_clk, QCOM_SMD_RPM_BUS_CLK, 1);
 DEFINE_CLK_SMD_RPM(msm8998, cnoc_clk, cnoc_a_clk, QCOM_SMD_RPM_BUS_CLK, 2);
 DEFINE_CLK_SMD_RPM(msm8998, ce1_clk, ce1_a_clk, QCOM_SMD_RPM_CE_CLK, 0);
@@ -678,6 +692,8 @@ static int clk_smd_rpm_enable_scaling(struct qcom_smd_rpm *rpm)
 DEFINE_CLK_SMD_RPM_XO_BUFFER(msm8998, rf_clk3, rf_clk3_a, 6);
 DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(msm8998, rf_clk3_pin, rf_clk3_a_pin, 6);
 static struct clk_smd_rpm *msm8998_clks[] = {
+	[RPM_SMD_XO_CLK_SRC] = &msm8998_xo,
+	[RPM_SMD_XO_A_CLK_SRC] = &msm8998_xo_a,
 	[RPM_SMD_SNOC_CLK] = &msm8998_snoc_clk,
 	[RPM_SMD_SNOC_A_CLK] = &msm8998_snoc_a_clk,
 	[RPM_SMD_CNOC_CLK] = &msm8998_cnoc_clk,
drivers/clk/qcom/gcc-msm8998.c +12 -17
index 0336882..47c3163 100644
@@ -11,6 +11,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/clk-provider.h>
+#include <linux/clk.h>
 #include <linux/regmap.h>
 #include <linux/reset-controller.h>
 
@@ -117,17 +118,6 @@ enum {
 	"core_bi_pll_test_se",
 };
 
-static struct clk_fixed_factor xo = {
-	.mult = 1,
-	.div = 1,
-	.hw.init = &(struct clk_init_data){
-		.name = "xo",
-		.parent_names = (const char *[]){ "xo_board" },
-		.num_parents = 1,
-		.ops = &clk_fixed_factor_ops,
-	},
-};
-
 static struct pll_vco fabia_vco[] = {
 	{ 250000000, 2000000000, 0 },
 	{ 125000000, 1000000000, 1 },
@@ -2959,10 +2949,6 @@ enum {
 	.fast_io	= true,
 };
 
-static struct clk_hw *gcc_msm8998_hws[] = {
-	&xo.hw,
-};
-
 static const struct qcom_cc_desc gcc_msm8998_desc = {
 	.config = &gcc_msm8998_regmap_config,
 	.clks = gcc_msm8998_clocks,
@@ -2971,14 +2957,23 @@ enum {
 	.num_resets = ARRAY_SIZE(gcc_msm8998_resets),
 	.gdscs = gcc_msm8998_gdscs,
 	.num_gdscs = ARRAY_SIZE(gcc_msm8998_gdscs),
-	.clk_hws = gcc_msm8998_hws,
-	.num_clk_hws = ARRAY_SIZE(gcc_msm8998_hws),
 };
 
 static int gcc_msm8998_probe(struct platform_device *pdev)
 {
 	struct regmap *regmap;
 	int ret;
+	struct clk *xo;
+
+	/*
+	 * We must have a valid XO to continue, otherwise having a missing
+	 * parent on a system critical clock like the uart core clock can
+	 * result in strange bugs.
+	 */
+	xo = clk_get(&pdev->dev, "xo");
+	if (IS_ERR(xo))
+		return PTR_ERR(xo);
+	clk_put(xo);
 
 	regmap = qcom_cc_map(pdev, &gcc_msm8998_desc);
 	if (IS_ERR(regmap))
Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#5 lore raw

PATCH v4 4/6 dt-bindings: clock: Add support for the MSM8998 mmcc

In reply to Jeffrey Hugo

Document the multimedia clock controller found on MSM8998.

---
 .../devicetree/bindings/clock/qcom,mmcc.txt        |  21 +++
 include/dt-bindings/clock/qcom,mmcc-msm8998.h      | 210 +++++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 include/dt-bindings/clock/qcom,mmcc-msm8998.h
Documentation/devicetree/bindings/clock/qcom,mmcc.txt +21 -0
index 8b0f784..a92f3cb 100644
@@ -10,11 +10,32 @@ Required properties :
 			"qcom,mmcc-msm8960"
 			"qcom,mmcc-msm8974"
 			"qcom,mmcc-msm8996"
+			"qcom,mmcc-msm8998"
 
 - reg : shall contain base register location and length
 - #clock-cells : shall contain 1
 - #reset-cells : shall contain 1
 
+For MSM8998 only:
+	- clocks: a list of phandles and clock-specifier pairs,
+		  one for each entry in clock-names.
+	- clock-names: "xo" for the xo clock.
+		       "gpll0" for the global pll 0 clock.
+		       "dsi0dsi" for the dsi0 pll dsi clock (required if dsi is
+				enabled, optional otherwise).
+		       "dsi0byte" for the dsi0 pll byte clock (required if dsi
+				is enabled, optional otherwise).
+		       "dsi1dsi" for the dsi1 pll dsi clock (required if dsi is
+				enabled, optional otherwise).
+		       "dsi1byte" for the dsi1 pll byte clock (required if dsi
+				is enabled, optional otherwise).
+		       "hdmipll" for the hdmi pll clock (required if hdmi is
+				enabled, optional otherwise).
+		       "dpvco" for the displayport pll vco clock (required if
+				dp is enabled, optional otherwise).
+		       "dplink" for the displayport pll link clock (required if
+				dp is enabled, optional otherwise).
+
 Optional properties :
 - #power-domain-cells : shall contain 1
 
include/dt-bindings/clock/qcom,mmcc-msm8998.h new file +210 -0

210 lines not on this page · raw message

Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#6 lore raw

PATCH v4 5/6 clk: qcom: Add MSM8998 Multimedia Clock Controller (MMCC) driver

In reply to Jeffrey Hugo

Add a driver for the multimedia clock controller found on MSM8998 based devices. This should allow most multimedia device drivers to probe and control their clocks.

---
 drivers/clk/qcom/Kconfig        |    9 +
 drivers/clk/qcom/Makefile       |    1 +
 drivers/clk/qcom/mmcc-msm8998.c | 2926 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 2936 insertions(+)
 create mode 100644 drivers/clk/qcom/mmcc-msm8998.c
drivers/clk/qcom/Kconfig +9 -0
index 18bdf34..8f06cd9 100644
@@ -221,6 +221,15 @@ config MSM_GCC_8998
 	  Say Y if you want to use peripheral devices such as UART, SPI,
 	  i2c, USB, UFS, SD/eMMC, PCIe, etc.
 
+config MSM_MMCC_8998
+	tristate "MSM8998 Multimedia Clock Controller"
+	select MSM_GCC_8998
+	select QCOM_GDSC
+	help
+	  Support for the multimedia clock controller on msm8998 devices.
+	  Say Y if you want to support multimedia devices such as display,
+	  graphics, video encode/decode, camera, etc.
+
 config QCS_GCC_404
 	tristate "QCS404 Global Clock Controller"
 	help
drivers/clk/qcom/Makefile +1 -0
index f0768fb..299ad7d 100644
@@ -36,6 +36,7 @@ obj-$(CONFIG_MSM_GCC_8998) += gcc-msm8998.o
 obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8960.o
 obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
 obj-$(CONFIG_MSM_MMCC_8996) += mmcc-msm8996.o
+obj-$(CONFIG_MSM_MMCC_8998) += mmcc-msm8998.o
 obj-$(CONFIG_QCOM_A53PLL) += a53-pll.o
 obj-$(CONFIG_QCOM_CLK_APCS_MSM8916) += apcs-msm8916.o
 obj-$(CONFIG_QCOM_CLK_RPM) += clk-rpm.o
drivers/clk/qcom/mmcc-msm8998.c new file +2926 -0

2,926 lines not on this page · raw message

Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#7 lore raw

PATCH v4 6/6 arm64: dts: qcom: msm8998: Add mmcc node

In reply to Jeffrey Hugo

Add MSM8998 Multimedia Clock Controller DT node.

---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/qcom/msm8998.dtsi +14 -0
index 141488e..5a32dfe 100644
@@ -3,6 +3,7 @@
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/qcom,gcc-msm8998.h>
+#include <dt-bindings/clock/qcom,mmcc-msm8998.h>
 #include <dt-bindings/clock/qcom,rpmcc.h>
 #include <dt-bindings/gpio/gpio.h>
 
@@ -1066,6 +1067,19 @@
 			status = "disabled";
 		};
 
+		mmcc: clock-controller@c8c0000 {
+			compatible = "qcom,mmcc-msm8998";
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+			#power-domain-cells = <1>;
+			reg = <0x0c8c0000 0x40000>;
+
+			clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>,
+				 <&gcc GPLL0_OUT_MAIN>;
+			clock-names = "xo",
+				      "gpll0";
+		};
+
 		timer@17920000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#8 lore raw
In reply to Jeffrey Hugo
Quoted 3 lines · Jeffrey Hugo

The multimedia clock controller (mmcc) is the main clock controller for the multimedia subsystem and is required to enable things like display and camera.

Stephen, I think this series is good to go, and I have display/gpu stuff I'm polishing that will depend on this. Would you kindly pickup patches 1, 3, 4, and 5 for 5.3? I can work with Bjorn to pick up patches 2 and 6.

Quoted 47 lines

v4:

(quoted diff) +0 -5
-fix makefile to use correct config item
-pick up tags
-fix ordering of clocks and clock-names in dt
-drop MODULE_ALIAS
-wait for xo in mmcc since that was found to be useful in some debug configs

v3:
-Rebase onto linux-next to get the final version of the clk parent rewrite series

(quoted diff) +0 -2
-Moved the bindings header to the bindings patch per Rob
-Made xo manditory for GCC to work around the lack of clk orphan probe defer

to avoid the uart console glitch

v2:
-Rebased on the "Rewrite clk parent handling" series and updated to the clk init mechanisms introduced there.
-Marked XO clk as CLK_IGNORE_UNUSED to avoid the concern about the XO going away "incorrectly" during late init

(quoted diff) +0 -5
-Corrected the name of the XO clock to "xo"
-Dropped the fake XO clock in GCC to prevent a namespace conflict
-Fully enumerated the external clocks (DSI PLLs, etc) in the DT binding
-Cleaned up the weird newlines in the added DT node
-Added DT header file to msm8998 DT for future clients

Jeffrey Hugo (6):
dt-bindings: clock: Document external clocks for MSM8998 gcc
arm64: dts: msm8998: Add xo clock to gcc node
clk: qcom: smd: Add XO clock for MSM8998
dt-bindings: clock: Add support for the MSM8998 mmcc
clk: qcom: Add MSM8998 Multimedia Clock Controller (MMCC) driver
arm64: dts: qcom: msm8998: Add mmcc node

  .../devicetree/bindings/clock/qcom,gcc.txt    |   10 +
  .../devicetree/bindings/clock/qcom,mmcc.txt   |   21 +
  arch/arm64/boot/dts/qcom/msm8998.dtsi         |   16 +
  drivers/clk/qcom/Kconfig                      |    9 +
  drivers/clk/qcom/Makefile                     |    1 +
  drivers/clk/qcom/clk-smd-rpm.c                |   24 +-
  drivers/clk/qcom/gcc-msm8998.c                |   29 +-
  drivers/clk/qcom/mmcc-msm8998.c               | 2915 +++++++++++++++++
  include/dt-bindings/clock/qcom,mmcc-msm8998.h |  210 ++
  9 files changed, 3214 insertions(+), 21 deletions(-)

create mode 100644 drivers/clk/qcom/mmcc-msm8998.c create mode 100644 include/dt-bindings/clock/qcom,mmcc-msm8998.h

Signature · 4 lines
Jeffrey Hugo
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
maintainer
#9 lore raw

Quoting Jeffrey Hugo (2019-05-21 07:52:28)

Quoted 9 lines · Jeffrey Hugo
Quoted 3 lines

The multimedia clock controller (mmcc) is the main clock controller for the multimedia subsystem and is required to enable things like display and camera.

Stephen, I think this series is good to go, and I have display/gpu stuff I'm polishing that will depend on this. Would you kindly pickup patches 1, 3, 4, and 5 for 5.3? I can work with Bjorn to pick up patches 2 and 6.

If I apply patch 3 won't it break boot until patch 2 is also in the tree? That seems to imply that I'll break bisection, and we have kernelci boot testing clk-next so this will probably set off alarms somewhere.

I thought we had some code that got removed that was going to make the transition "seamless" in the sense that it would search the tree for an RPM clk controller and then not add the XO fixed factor clk somehow. See commit 54823af9cd52 ("clk: qcom: Always add factor clock for xo clocks") for the code that we removed. So ideally we do something like this too, but now we search for a property on the calling node to see if the XO clk is there?

#10 lore raw
Quoted 12 lines · Stephen Boyd

Quoting Jeffrey Hugo (2019-05-21 07:52:28)

Quoted 9 lines · Jeffrey Hugo
Quoted 3 lines

The multimedia clock controller (mmcc) is the main clock controller for the multimedia subsystem and is required to enable things like display and camera.

Stephen, I think this series is good to go, and I have display/gpu stuff I'm polishing that will depend on this. Would you kindly pickup patches 1, 3, 4, and 5 for 5.3? I can work with Bjorn to pick up patches 2 and 6.

Quoted 4 lines

If I apply patch 3 won't it break boot until patch 2 is also in the tree? That seems to imply that I'll break bisection, and we have kernelci boot testing clk-next so this will probably set off alarms somewhere.

Yes, it'll break boot. Maybe you and Bjorn can make a deal? (more below)

Doesn't look like kernelci is running tests on 8998 anymore, so maybe no one will complain? As far as I am aware, Marc, Lee, Bjorn, and I are the only ones whom care about 8998 presently, and I think we are all good with a temporary breakage in order to get this basic functionality in since the platform isn't really well supported yet.

Quoted 9 lines

I thought we had some code that got removed that was going to make the transition "seamless" in the sense that it would search the tree for an RPM clk controller and then not add the XO fixed factor clk somehow. See commit 54823af9cd52 ("clk: qcom: Always add factor clock for xo clocks") for the code that we removed. So ideally we do something like this too, but now we search for a property on the calling node to see if the XO clk is there?

Trying to remember back a bit.

I don't think its possible. Maybe I'm wrong. I didn't see a solution to the below:

How does GCC know the following?
-RPMCC is compiled in the build (I guess this can be assumed) -RPMCC has probed
-RPMCC is not and will not be providing XO

maintainer
#11 lore raw

Quoting Jeffrey Hugo (2019-06-07 14:31:13)

Quoted 18 lines · Stephen Boyd
Quoted 12 lines

Quoting Jeffrey Hugo (2019-05-21 07:52:28)

Quoted 9 lines · Jeffrey Hugo
Quoted 3 lines

The multimedia clock controller (mmcc) is the main clock controller for the multimedia subsystem and is required to enable things like display and camera.

Stephen, I think this series is good to go, and I have display/gpu stuff I'm polishing that will depend on this. Would you kindly pickup patches 1, 3, 4, and 5 for 5.3? I can work with Bjorn to pick up patches 2 and 6.

Quoted 4 lines

If I apply patch 3 won't it break boot until patch 2 is also in the tree? That seems to imply that I'll break bisection, and we have kernelci boot testing clk-next so this will probably set off alarms somewhere.

Quoted 7 lines

Yes, it'll break boot. Maybe you and Bjorn can make a deal? (more below)

Doesn't look like kernelci is running tests on 8998 anymore, so maybe no one will complain? As far as I am aware, Marc, Lee, Bjorn, and I are the only ones whom care about 8998 presently, and I think we are all good with a temporary breakage in order to get this basic functionality in since the platform isn't really well supported yet.

Ok.

Quoted 11 lines
Quoted 10 lines

I thought we had some code that got removed that was going to make the transition "seamless" in the sense that it would search the tree for an RPM clk controller and then not add the XO fixed factor clk somehow. See commit 54823af9cd52 ("clk: qcom: Always add factor clock for xo clocks") for the code that we removed. So ideally we do something like this too, but now we search for a property on the calling node to see if the XO clk is there?

Quoted 7 lines

Trying to remember back a bit.

I don't think its possible. Maybe I'm wrong. I didn't see a solution to the below:

How does GCC know the following?
-RPMCC is compiled in the build (I guess this can be assumed)

This is the IS_ENABLED part.

Review

Quoted 2 lines
(quoted diff) +0 -2
-RPMCC has probed
-RPMCC is not and will not be providing XO

Presumably if it's enabled then it will be providing XO at some point in the future. I'm not suggesting the probe defer logic is removed, just that we don't get into a state where clk tree has merged all the patches for clk driver side and that then relies on DT to provide the clk but it doesn't do that.

So the idea is to check if RPM is compiled in and also check the GCC DT node for the clocks property having the xo clk there. Then we assume that we have the clk patches in place for the RPM clk driver to provide that clk and we skip inserting the fake clk that RPM is going to provide.

This is also a "general" solution to GCC not depending on or selecting the RPM clk driver. It may be better to just have a select statement in GCC Kconfig so that we can't enable the GCC driver without also enabling the RPM driver if it's an essential dependency to the clk tree working. But if we do this design then we can make the clk tree keep working regardless of RPM being there or not, which may be a good thing.

#12 lore raw
Quoted 43 lines · Stephen Boyd

Quoting Jeffrey Hugo (2019-06-07 14:31:13)

Quoted 18 lines · Stephen Boyd
Quoted 12 lines

Quoting Jeffrey Hugo (2019-05-21 07:52:28)

Quoted 9 lines · Jeffrey Hugo
Quoted 3 lines

The multimedia clock controller (mmcc) is the main clock controller for the multimedia subsystem and is required to enable things like display and camera.

Stephen, I think this series is good to go, and I have display/gpu stuff I'm polishing that will depend on this. Would you kindly pickup patches 1, 3, 4, and 5 for 5.3? I can work with Bjorn to pick up patches 2 and 6.

Quoted 4 lines

If I apply patch 3 won't it break boot until patch 2 is also in the tree? That seems to imply that I'll break bisection, and we have kernelci boot testing clk-next so this will probably set off alarms somewhere.

Quoted 7 lines

Yes, it'll break boot. Maybe you and Bjorn can make a deal? (more below)

Doesn't look like kernelci is running tests on 8998 anymore, so maybe no one will complain? As far as I am aware, Marc, Lee, Bjorn, and I are the only ones whom care about 8998 presently, and I think we are all good with a temporary breakage in order to get this basic functionality in since the platform isn't really well supported yet.

Ok.

Quoted 13 lines
Quoted 10 lines

I thought we had some code that got removed that was going to make the transition "seamless" in the sense that it would search the tree for an RPM clk controller and then not add the XO fixed factor clk somehow. See commit 54823af9cd52 ("clk: qcom: Always add factor clock for xo clocks") for the code that we removed. So ideally we do something like this too, but now we search for a property on the calling node to see if the XO clk is there?

Trying to remember back a bit.

Quoted 7 lines
Quoted 5 lines

I don't think its possible. Maybe I'm wrong. I didn't see a solution to the below:

How does GCC know the following?
-RPMCC is compiled in the build (I guess this can be assumed)

This is the IS_ENABLED part.

Eh, this would assume that someone hasn't compiled RPCC out of tree, but this is probably me being pedantic.

Quoted 10 lines

Review

Quoted 3 lines
(quoted diff) +0 -2
-RPMCC has probed
-RPMCC is not and will not be providing XO

Presumably if it's enabled then it will be providing XO at some point in the future. I'm not suggesting the probe defer logic is removed, just that we don't get into a state where clk tree has merged all the patches for clk driver side and that then relies on DT to provide the clk but it doesn't do that.

Quoted 5 lines

So the idea is to check if RPM is compiled in and also check the GCC DT node for the clocks property having the xo clk there. Then we assume that we have the clk patches in place for the RPM clk driver to provide that clk and we skip inserting the fake clk that RPM is going to provide.

So, I thought about this, and I don't think it works. This appears to be a solution for if RPM is not present. If, in patch 3, I check for the clocks property in the gcc DT and don't see it, and I add the fake XO as a result, I'll end up with a namespace conflict with either GCC or RPMCC failing to register XO since both will attempt it.

The issue is do we have RPM providing XO (ie patch 3) without a DT routing it to GCC (ie patch 2). Since we have patch 3, we know RPM is going to provide XO. We just might not have a handle to it to do the probe_defer logic.

I think the solution is check the DT for the clocks property, if present use that to attempt to grab XO. Otherwise, attempt to grab XO from the system map. I'll try this in the next rev.

Quoted 8 lines

This is also a "general" solution to GCC not depending on or selecting the RPM clk driver. It may be better to just have a select statement in GCC Kconfig so that we can't enable the GCC driver without also enabling the RPM driver if it's an essential dependency to the clk tree working. But if we do this design then we can make the clk tree keep working regardless of RPM being there or not, which may be a good thing.

I'm not sure attempting to sidestep the RPM dependency is worthwhile. Its not just GCC, but every clock controller that depends on XO, and thus implicitly RPM.

I suspect any real system is going to have to have the RPM, just by the nature of what the RPM controls that cannot be managed elsewhere, such as BIMC. At some point, a system is going to want to ramp up the memory bus and DDR speeds to something more than the bare minimum.

Putting in a bunch of code to try to avoid depending on the RPM seems like effort not well spent as its unlikely such code is going to be active.