MSM8998 Multimedia Clock Controller
Subsystems (5)
v2 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.
Based upon the "Rewrite clk parent handling" series [1] to simplify handling of the external clocks that feed into the MMCC.
Assumes the "orphan probe defer" change [2] so that exposing XO via the RPM is safe for the UART in case of late probe per review comments.
Assumes the common clk_hw registration is in place from "Make common clk_hw registrations" [3]
[1] https://lore.kernel.org/lkml/[email protected]/T/#u
[2] https://lkml.org/lkml/2019/2/11/1895
[3] https://lkml.org/lkml/2019/2/10/132
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 (4):
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,mmcc.txt | 7 + arch/arm64/boot/dts/qcom/msm8998.dtsi | 15 + drivers/clk/qcom/Kconfig | 9 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/clk-smd-rpm.c | 4 + drivers/clk/qcom/mmcc-msm8998.c | 2937 ++++++++++++++++++++ include/dt-bindings/clock/qcom,mmcc-msm8998.h | 210 ++ 7 files changed, 3183 insertions(+) create mode 100644 drivers/clk/qcom/mmcc-msm8998.c create mode 100644 include/dt-bindings/clock/qcom,mmcc-msm8998.h
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.
PATCH v2 1/4 clk: qcom: smd: Add XO clock for MSM8998
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 can will cause a namespace conflict.
--- drivers/clk/qcom/clk-smd-rpm.c | 24 ++++++++++++++++++++---- drivers/clk/qcom/gcc-msm8998.c | 17 ----------------- 2 files changed, 20 insertions(+), 21 deletions(-)
drivers/clk/qcom/clk-smd-rpm.c +20 -4
@@ -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 const struct rpm_smd_clk_desc rpm_clk_qcs404 = { };/* 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 @@ DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(msm8998, rf_clk2_pin, rf_clk2_a_pin, 5);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 +0 -17
@@ -117,17 +117,6 @@ static const char * const gcc_parent_names_5[] = { "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 +2948,6 @@ static const struct regmap_config gcc_msm8998_regmap_config = { .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,8 +2956,6 @@ static const struct qcom_cc_desc gcc_msm8998_desc = { .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)
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.
PATCH v2 2/4 dt-bindings: clock: Add support for the MSM8998 mmcc
In reply to Jeffrey HugoDocument the multimedia clock controller found on MSM8998
--- .../devicetree/bindings/clock/qcom,mmcc.txt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)
Documentation/devicetree/bindings/clock/qcom,mmcc.txt +21 -0
@@ -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
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.
Re: [PATCH v2 2/4] dt-bindings: clock: Add support for the MSM8998 mmcc
Quoted 7 lines · Jeffrey Hugo
Document the multimedia clock controller found on MSM8998
Signed-off-by Jeffrey Hugo <[email protected]>--- .../devicetree/bindings/clock/qcom,mmcc.txt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)
PATCH v2 3/4 clk: qcom: Add MSM8998 Multimedia Clock Controller (MMCC) driver
In reply to Jeffrey HugoAdd 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 | 2915 +++++++++++++++++ include/dt-bindings/clock/qcom,mmcc-msm8998.h | 210 ++ 4 files changed, 3135 insertions(+) create mode 100644 drivers/clk/qcom/mmcc-msm8998.c create mode 100644 include/dt-bindings/clock/qcom,mmcc-msm8998.h
drivers/clk/qcom/Kconfig +9 -0
@@ -220,6 +220,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
@@ -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_8996) += 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 +2915 -0
2,915 lines not on this page · raw message
include/dt-bindings/clock/qcom,mmcc-msm8998.h new file +210 -0
63 lines not on this page · raw message
The rest of this diff is not shown. View the 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.
Part of the diff is not shown here. View the raw message.
Rob Herring
maintainerRe: [PATCH v2 3/4] clk: qcom: Add MSM8998 Multimedia Clock Controller (MMCC) driver
Quoted 10 lines · 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.
Signed-off-by Jeffrey Hugo <[email protected]>--- drivers/clk/qcom/Kconfig | 9 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/mmcc-msm8998.c | 2915 +++++++++++++++++ include/dt-bindings/clock/qcom,mmcc-msm8998.h | 210 ++
If you need to respin, this file goes in the binding patch.
Quoted 3 lines
4 files changed, 3135 insertions(+) create mode 100644 drivers/clk/qcom/mmcc-msm8998.c create mode 100644 include/dt-bindings/clock/qcom,mmcc-msm8998.h
PATCH v2 4/4 arm64: dts: qcom: msm8998: Add mmcc node
In reply to Jeffrey HugoAdd 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
@@ -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>
@@ -973,6 +974,19 @@ }; }; + mmcc: clock-controller@c8c0000 { + compatible = "qcom,mmcc-msm8998"; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + reg = <0x0c8c0000 0x40000>; + + clock-names = "xo", + "gpll0"; + clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>, + <&gcc GPLL0_OUT_MAIN>; + }; + 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.