Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branches 'clk-rockchip', 'clk-thead', 'clk-microchip', 'clk-imx' and 'clk-qcom' into clk-next

* clk-rockchip:
clk: rockchip: rk3568: Add PLL rate for 132MHz

* clk-thead:
clk: thead: th1520-ap: Describe mux clocks with clk_mux
clk: thead: th1520-ap: Correctly refer the parent of osc_12m
clk: thead: Mark essential bus clocks as CLK_IGNORE_UNUSED

* clk-microchip:
clk: at91: sam9x7: update pll clk ranges

* clk-imx:
MAINTAINERS: Update i.MX Clock Entry
clk: imx95-blk-ctl: Add clock for i.MX94 LVDS/Display CSR
clk: imx95-blk-ctl: Rename lvds and displaymix csr blk
clk: imx95-blk-ctl: Fix synchronous abort
dt-bindings: clock: Add support for i.MX94 LVDS/DISPLAY CSR
clk: imx: Fix an out-of-bounds access in dispmix_csr_clk_dev_data

* clk-qcom: (65 commits)
dt-bindings: clock: qcom,sm4450-dispcc: Reference qcom,gcc.yaml
dt-bindings: clock: qcom,sm4450-camcc: Reference qcom,gcc.yaml
dt-bindings: clock: qcom,mmcc: Reference qcom,gcc.yaml
dt-bindings: clock: qcom,sm8150-camcc: Reference qcom,gcc.yaml
dt-bindings: clock: qcom: Remove double colon from description
clk: qcom: Add Video Clock controller (VIDEOCC) driver for Milos
dt-bindings: clock: qcom: document the Milos Video Clock Controller
clk: qcom: Add Graphics Clock controller (GPUCC) driver for Milos
dt-bindings: clock: qcom: document the Milos GPU Clock Controller
clk: qcom: Add Display Clock controller (DISPCC) driver for Milos
dt-bindings: clock: qcom: document the Milos Display Clock Controller
clk: qcom: Add Camera Clock controller (CAMCC) driver for Milos
dt-bindings: clock: qcom: document the Milos Camera Clock Controller
clk: qcom: Add Global Clock controller (GCC) driver for Milos
dt-bindings: clock: qcom: document the Milos Global Clock Controller
clk: qcom: common: Add support to register rcg dfs in qcom_cc_really_probe
clk: qcom: gcc-x1e80100: Add missing video resets
dt-bindings: clock: qcom,x1e80100-gcc: Add missing video resets
clk: qcom: videocc-sm8550: Add separate frequency tables for X1E80100
clk: qcom: videocc-sm8550: Allow building without SM8550/SM8560 GCC
...

+16263 -485
+2
Documentation/devicetree/bindings/clock/nxp,imx95-blk-ctl.yaml
··· 13 13 compatible: 14 14 items: 15 15 - enum: 16 + - nxp,imx94-display-csr 17 + - nxp,imx94-lvds-csr 16 18 - nxp,imx95-camera-csr 17 19 - nxp,imx95-display-csr 18 20 - nxp,imx95-hsio-blk-ctl
+2
Documentation/devicetree/bindings/clock/qcom,ipq9574-cmn-pll.yaml
··· 24 24 properties: 25 25 compatible: 26 26 enum: 27 + - qcom,ipq5018-cmn-pll 28 + - qcom,ipq5424-cmn-pll 27 29 - qcom,ipq9574-cmn-pll 28 30 29 31 reg:
+51
Documentation/devicetree/bindings/clock/qcom,milos-camcc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/clock/qcom,milos-camcc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Camera Clock & Reset Controller on Milos 8 + 9 + maintainers: 10 + - Luca Weiss <luca.weiss@fairphone.com> 11 + 12 + description: | 13 + Qualcomm camera clock control module provides the clocks, resets and power 14 + domains on Milos. 15 + 16 + See also: include/dt-bindings/clock/qcom,milos-camcc.h 17 + 18 + properties: 19 + compatible: 20 + const: qcom,milos-camcc 21 + 22 + clocks: 23 + items: 24 + - description: Board XO source 25 + - description: Sleep clock source 26 + - description: Camera AHB clock from GCC 27 + 28 + required: 29 + - compatible 30 + - clocks 31 + 32 + allOf: 33 + - $ref: qcom,gcc.yaml# 34 + 35 + unevaluatedProperties: false 36 + 37 + examples: 38 + - | 39 + #include <dt-bindings/clock/qcom,milos-gcc.h> 40 + clock-controller@adb0000 { 41 + compatible = "qcom,milos-camcc"; 42 + reg = <0x0adb0000 0x40000>; 43 + clocks = <&bi_tcxo_div2>, 44 + <&sleep_clk>, 45 + <&gcc GCC_CAMERA_AHB_CLK>; 46 + #clock-cells = <1>; 47 + #reset-cells = <1>; 48 + #power-domain-cells = <1>; 49 + }; 50 + 51 + ...
+63
Documentation/devicetree/bindings/clock/qcom,milos-dispcc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/clock/qcom,milos-dispcc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Display Clock & Reset Controller on Milos 8 + 9 + maintainers: 10 + - Luca Weiss <luca.weiss@fairphone.com> 11 + 12 + description: | 13 + Qualcomm display clock control module provides the clocks, resets and power 14 + domains on Milos. 15 + 16 + See also: include/dt-bindings/clock/qcom,milos-dispcc.h 17 + 18 + properties: 19 + compatible: 20 + const: qcom,milos-dispcc 21 + 22 + clocks: 23 + items: 24 + - description: Board XO source 25 + - description: Sleep clock source 26 + - description: Display's AHB clock 27 + - description: GPLL0 source from GCC 28 + - description: Byte clock from DSI PHY0 29 + - description: Pixel clock from DSI PHY0 30 + - description: Link clock from DP PHY0 31 + - description: VCO DIV clock from DP PHY0 32 + 33 + required: 34 + - compatible 35 + - clocks 36 + - '#power-domain-cells' 37 + 38 + allOf: 39 + - $ref: qcom,gcc.yaml# 40 + 41 + unevaluatedProperties: false 42 + 43 + examples: 44 + - | 45 + #include <dt-bindings/clock/qcom,milos-gcc.h> 46 + #include <dt-bindings/phy/phy-qcom-qmp.h> 47 + clock-controller@af00000 { 48 + compatible = "qcom,milos-dispcc"; 49 + reg = <0x0af00000 0x20000>; 50 + clocks = <&bi_tcxo_div2>, 51 + <&sleep_clk>, 52 + <&gcc GCC_DISP_AHB_CLK>, 53 + <&gcc GCC_DISP_GPLL0_DIV_CLK_SRC>, 54 + <&mdss_dsi0_phy 0>, 55 + <&mdss_dsi0_phy 1>, 56 + <&usb_dp_qmpphy QMP_USB43DP_DP_LINK_CLK>, 57 + <&usb_dp_qmpphy QMP_USB43DP_DP_VCO_DIV_CLK>; 58 + #clock-cells = <1>; 59 + #reset-cells = <1>; 60 + #power-domain-cells = <1>; 61 + }; 62 + 63 + ...
+62
Documentation/devicetree/bindings/clock/qcom,milos-gcc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/clock/qcom,milos-gcc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Global Clock & Reset Controller on Milos 8 + 9 + maintainers: 10 + - Luca Weiss <luca.weiss@fairphone.com> 11 + 12 + description: | 13 + Qualcomm global clock control module provides the clocks, resets and power 14 + domains on Milos. 15 + 16 + See also: include/dt-bindings/clock/qcom,milos-gcc.h 17 + 18 + properties: 19 + compatible: 20 + const: qcom,milos-gcc 21 + 22 + clocks: 23 + items: 24 + - description: Board XO source 25 + - description: Sleep clock source 26 + - description: PCIE 0 Pipe clock source 27 + - description: PCIE 1 Pipe clock source 28 + - description: UFS Phy Rx symbol 0 clock source 29 + - description: UFS Phy Rx symbol 1 clock source 30 + - description: UFS Phy Tx symbol 0 clock source 31 + - description: USB3 Phy wrapper pipe clock source 32 + 33 + required: 34 + - compatible 35 + - clocks 36 + - '#power-domain-cells' 37 + 38 + allOf: 39 + - $ref: qcom,gcc.yaml# 40 + 41 + unevaluatedProperties: false 42 + 43 + examples: 44 + - | 45 + #include <dt-bindings/clock/qcom,rpmh.h> 46 + clock-controller@100000 { 47 + compatible = "qcom,milos-gcc"; 48 + reg = <0x00100000 0x1f4200>; 49 + clocks = <&rpmhcc RPMH_CXO_CLK>, 50 + <&sleep_clk>, 51 + <&pcie0_phy>, 52 + <&pcie1_phy>, 53 + <&ufs_mem_phy 0>, 54 + <&ufs_mem_phy 1>, 55 + <&ufs_mem_phy 2>, 56 + <&usb_1_qmpphy>; 57 + #clock-cells = <1>; 58 + #reset-cells = <1>; 59 + #power-domain-cells = <1>; 60 + }; 61 + 62 + ...
+53
Documentation/devicetree/bindings/clock/qcom,milos-videocc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/clock/qcom,milos-videocc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Video Clock & Reset Controller on Milos 8 + 9 + maintainers: 10 + - Luca Weiss <luca.weiss@fairphone.com> 11 + 12 + description: | 13 + Qualcomm video clock control module provides the clocks, resets and power 14 + domains on Milos. 15 + 16 + See also: include/dt-bindings/clock/qcom,milos-videocc.h 17 + 18 + properties: 19 + compatible: 20 + const: qcom,milos-videocc 21 + 22 + clocks: 23 + items: 24 + - description: Board XO source 25 + - description: Board active XO source 26 + - description: Sleep clock source 27 + - description: Video AHB clock from GCC 28 + 29 + required: 30 + - compatible 31 + - clocks 32 + 33 + allOf: 34 + - $ref: qcom,gcc.yaml# 35 + 36 + unevaluatedProperties: false 37 + 38 + examples: 39 + - | 40 + #include <dt-bindings/clock/qcom,milos-gcc.h> 41 + clock-controller@aaf0000 { 42 + compatible = "qcom,milos-videocc"; 43 + reg = <0x0aaf0000 0x10000>; 44 + clocks = <&bi_tcxo_div2>, 45 + <&bi_tcxo_ao_div2>, 46 + <&sleep_clk>, 47 + <&gcc GCC_VIDEO_AHB_CLK>; 48 + #clock-cells = <1>; 49 + #reset-cells = <1>; 50 + #power-domain-cells = <1>; 51 + }; 52 + 53 + ...
+3 -21
Documentation/devicetree/bindings/clock/qcom,mmcc.yaml
··· 38 38 minItems: 7 39 39 maxItems: 13 40 40 41 - '#clock-cells': 42 - const: 1 43 - 44 - '#reset-cells': 45 - const: 1 46 - 47 - '#power-domain-cells': 48 - const: 1 49 - 50 - reg: 51 - maxItems: 1 52 - 53 - protected-clocks: 54 - description: 55 - Protected clock specifier list as per common clock binding 56 - 57 41 vdd-gfx-supply: 58 42 description: 59 43 Regulator supply for the GPU_GX GDSC 60 44 61 45 required: 62 46 - compatible 63 - - reg 64 - - '#clock-cells' 65 - - '#reset-cells' 66 47 - '#power-domain-cells' 67 48 68 - additionalProperties: false 69 - 70 49 allOf: 50 + - $ref: qcom,gcc.yaml# 71 51 - if: 72 52 properties: 73 53 compatible: ··· 330 350 - const: dsi1pllbyte 331 351 - const: dp_link_2x_clk_divsel_five 332 352 - const: dp_vco_divided_clk_src_mux 353 + 354 + unevaluatedProperties: false 333 355 334 356 examples: 335 357 # Example for MMCC for MSM8960:
+55
Documentation/devicetree/bindings/clock/qcom,qcs615-dispcc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/clock/qcom,qcs615-dispcc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Display Clock & Reset Controller on QCS615 8 + 9 + maintainers: 10 + - Taniya Das <quic_tdas@quicinc.com> 11 + 12 + description: | 13 + Qualcomm display clock control module provides the clocks, resets and power 14 + domains on QCS615. 15 + 16 + See also: include/dt-bindings/clock/qcom,qcs615-dispcc.h 17 + 18 + properties: 19 + compatible: 20 + const: qcom,qcs615-dispcc 21 + 22 + clocks: 23 + items: 24 + - description: Board XO source 25 + - description: GPLL0 clock source from GCC 26 + - description: Byte clock from DSI PHY0 27 + - description: Pixel clock from DSI PHY0 28 + - description: Pixel clock from DSI PHY1 29 + - description: Display port PLL link clock 30 + - description: Display port PLL VCO DIV clock 31 + 32 + allOf: 33 + - $ref: qcom,gcc.yaml# 34 + 35 + unevaluatedProperties: false 36 + 37 + examples: 38 + - | 39 + #include <dt-bindings/clock/qcom,rpmh.h> 40 + #include <dt-bindings/clock/qcom,qcs615-gcc.h> 41 + clock-controller@af00000 { 42 + compatible = "qcom,qcs615-dispcc"; 43 + reg = <0x0af00000 0x20000>; 44 + clocks = <&rpmhcc RPMH_CXO_CLK>, 45 + <&gcc GCC_DISP_GPLL0_DIV_CLK_SRC>, 46 + <&mdss_dsi0_phy 0>, 47 + <&mdss_dsi0_phy 1>, 48 + <&mdss_dsi1_phy 0>, 49 + <&mdss_dp_phy 0>, 50 + <&mdss_dp_vco 0>; 51 + #clock-cells = <1>; 52 + #reset-cells = <1>; 53 + #power-domain-cells = <1>; 54 + }; 55 + ...
+49
Documentation/devicetree/bindings/clock/qcom,qcs615-gpucc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/clock/qcom,qcs615-gpucc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Graphics Clock & Reset Controller on QCS615 8 + 9 + maintainers: 10 + - Taniya Das <quic_tdas@quicinc.com> 11 + 12 + description: | 13 + Qualcomm graphics clock control module provides clocks, resets and power 14 + domains on QCS615 Qualcomm SoCs. 15 + 16 + See also: include/dt-bindings/clock/qcom,qcs615-gpucc.h 17 + 18 + properties: 19 + compatible: 20 + const: qcom,qcs615-gpucc 21 + 22 + clocks: 23 + items: 24 + - description: Board XO source 25 + - description: GPLL0 main branch source 26 + - description: GPLL0 GPUCC div branch source 27 + 28 + allOf: 29 + - $ref: qcom,gcc.yaml# 30 + 31 + unevaluatedProperties: false 32 + 33 + examples: 34 + - | 35 + #include <dt-bindings/clock/qcom,rpmh.h> 36 + #include <dt-bindings/clock/qcom,qcs615-gcc.h> 37 + 38 + clock-controller@5090000 { 39 + compatible = "qcom,qcs615-gpucc"; 40 + reg = <0x5090000 0x9000>; 41 + clocks = <&rpmhcc RPMH_CXO_CLK>, 42 + <&gcc GPLL0>, 43 + <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>; 44 + 45 + #clock-cells = <1>; 46 + #reset-cells = <1>; 47 + #power-domain-cells = <1>; 48 + }; 49 + ...
+47
Documentation/devicetree/bindings/clock/qcom,qcs615-videocc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/clock/qcom,qcs615-videocc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Video Clock & Reset Controller on QCS615 8 + 9 + maintainers: 10 + - Taniya Das <quic_tdas@quicinc.com> 11 + 12 + description: | 13 + Qualcomm video clock control module provides clocks, resets and power 14 + domains on QCS615 Qualcomm SoCs. 15 + 16 + See also: include/dt-bindings/clock/qcom,qcs615-videocc.h 17 + 18 + properties: 19 + compatible: 20 + const: qcom,qcs615-videocc 21 + 22 + clocks: 23 + items: 24 + - description: Board XO source 25 + - description: Sleep clock source 26 + 27 + allOf: 28 + - $ref: qcom,gcc.yaml# 29 + 30 + unevaluatedProperties: false 31 + 32 + examples: 33 + - | 34 + #include <dt-bindings/clock/qcom,rpmh.h> 35 + #include <dt-bindings/clock/qcom,qcs615-gcc.h> 36 + 37 + clock-controller@ab00000 { 38 + compatible = "qcom,qcs615-videocc"; 39 + reg = <0xab00000 0x10000>; 40 + clocks = <&rpmhcc RPMH_CXO_CLK>, 41 + <&sleep_clk>; 42 + 43 + #clock-cells = <1>; 44 + #reset-cells = <1>; 45 + #power-domain-cells = <1>; 46 + }; 47 + ...
+1
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml
··· 17 17 properties: 18 18 compatible: 19 19 enum: 20 + - qcom,milos-rpmh-clk 20 21 - qcom,qcs615-rpmh-clk 21 22 - qcom,qdu1000-rpmh-clk 22 23 - qcom,sa8775p-rpmh-clk
+15
Documentation/devicetree/bindings/clock/qcom,sa8775p-camcc.yaml
··· 17 17 See also: 18 18 include/dt-bindings/clock/qcom,qcs8300-camcc.h 19 19 include/dt-bindings/clock/qcom,sa8775p-camcc.h 20 + include/dt-bindings/clock/qcom,sc8280xp-camcc.h 20 21 21 22 properties: 22 23 compatible: 23 24 enum: 24 25 - qcom,qcs8300-camcc 25 26 - qcom,sa8775p-camcc 27 + - qcom,sc8280xp-camcc 26 28 27 29 clocks: 28 30 items: ··· 37 35 maxItems: 1 38 36 description: MMCX power domain 39 37 38 + required-opps: 39 + description: 40 + OPP node describing required MMCX performance point. 41 + maxItems: 1 42 + 40 43 required: 41 44 - compatible 42 45 - clocks ··· 50 43 51 44 allOf: 52 45 - $ref: qcom,gcc.yaml# 46 + - if: 47 + properties: 48 + compatible: 49 + contains: 50 + const: qcom,sc8280xp-camcc 51 + then: 52 + required: 53 + - required-opps 53 54 54 55 unevaluatedProperties: false 55 56
+67
Documentation/devicetree/bindings/clock/qcom,sc8180x-camcc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/clock/qcom,sc8180x-camcc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Camera Clock & Reset Controller on SC8180X 8 + 9 + maintainers: 10 + - Satya Priya Kakitapalli <quic_skakitap@quicinc.com> 11 + 12 + description: | 13 + Qualcomm camera clock control module provides the clocks, resets and 14 + power domains on SC8180X. 15 + 16 + See also: include/dt-bindings/clock/qcom,sc8180x-camcc.h 17 + 18 + properties: 19 + compatible: 20 + const: qcom,sc8180x-camcc 21 + 22 + clocks: 23 + items: 24 + - description: Camera AHB clock from GCC 25 + - description: Board XO source 26 + - description: Sleep clock source 27 + 28 + power-domains: 29 + maxItems: 1 30 + description: 31 + A phandle and PM domain specifier for the MMCX power domain. 32 + 33 + required-opps: 34 + maxItems: 1 35 + description: 36 + A phandle to an OPP node describing required MMCX performance point. 37 + 38 + required: 39 + - compatible 40 + - clocks 41 + - power-domains 42 + - required-opps 43 + 44 + allOf: 45 + - $ref: qcom,gcc.yaml# 46 + 47 + unevaluatedProperties: false 48 + 49 + examples: 50 + - | 51 + #include <dt-bindings/clock/qcom,gcc-sc8180x.h> 52 + #include <dt-bindings/clock/qcom,rpmh.h> 53 + #include <dt-bindings/power/qcom-rpmpd.h> 54 + clock-controller@ad00000 { 55 + compatible = "qcom,sc8180x-camcc"; 56 + reg = <0x0ad00000 0x20000>; 57 + clocks = <&gcc GCC_CAMERA_AHB_CLK>, 58 + <&rpmhcc RPMH_CXO_CLK>, 59 + <&sleep_clk>; 60 + power-domains = <&rpmhpd SC8180X_MMCX>; 61 + required-opps = <&rpmhpd_opp_low_svs>; 62 + 63 + #clock-cells = <1>; 64 + #reset-cells = <1>; 65 + #power-domain-cells = <1>; 66 + }; 67 + ...
+4 -16
Documentation/devicetree/bindings/clock/qcom,sm4450-camcc.yaml
··· 20 20 compatible: 21 21 const: qcom,sm4450-camcc 22 22 23 - reg: 24 - maxItems: 1 25 - 26 23 clocks: 27 24 items: 28 25 - description: Board XO source 29 26 - description: Camera AHB clock source from GCC 30 27 31 - '#clock-cells': 32 - const: 1 33 - 34 - '#reset-cells': 35 - const: 1 36 - 37 - '#power-domain-cells': 38 - const: 1 39 - 40 28 required: 41 29 - compatible 42 - - reg 43 30 - clocks 44 - - '#clock-cells' 45 - - '#reset-cells' 46 31 - '#power-domain-cells' 47 32 48 - additionalProperties: false 33 + allOf: 34 + - $ref: qcom,gcc.yaml# 35 + 36 + unevaluatedProperties: false 49 37 50 38 examples: 51 39 - |
+4 -16
Documentation/devicetree/bindings/clock/qcom,sm4450-dispcc.yaml
··· 20 20 compatible: 21 21 const: qcom,sm4450-dispcc 22 22 23 - reg: 24 - maxItems: 1 25 - 26 23 clocks: 27 24 items: 28 25 - description: Board XO source ··· 29 32 - description: Byte clock from DSI PHY0 30 33 - description: Pixel clock from DSI PHY0 31 34 32 - '#clock-cells': 33 - const: 1 34 - 35 - '#reset-cells': 36 - const: 1 37 - 38 - '#power-domain-cells': 39 - const: 1 40 - 41 35 required: 42 36 - compatible 43 - - reg 44 37 - clocks 45 - - '#clock-cells' 46 - - '#reset-cells' 47 38 - '#power-domain-cells' 48 39 49 - additionalProperties: false 40 + allOf: 41 + - $ref: qcom,gcc.yaml# 42 + 43 + unevaluatedProperties: false 50 44 51 45 examples: 52 46 - |
+8 -3
Documentation/devicetree/bindings/clock/qcom,sm6350-camcc.yaml
··· 8 8 9 9 maintainers: 10 10 - Konrad Dybcio <konradybcio@kernel.org> 11 + - Taniya Das <quic_tdas@quicinc.com> 11 12 12 13 description: | 13 14 Qualcomm camera clock control module provides the clocks, resets and power 14 - domains on SM6350. 15 + domains on SM6350 and QCS615 SoC. 15 16 16 - See also: include/dt-bindings/clock/qcom,sm6350-camcc.h 17 + See also: 18 + include/dt-bindings/clock/qcom,qcs615-camcc.h 19 + include/dt-bindings/clock/qcom,sm6350-camcc.h 17 20 18 21 properties: 19 22 compatible: 20 - const: qcom,sm6350-camcc 23 + enum: 24 + - qcom,qcs615-camcc 25 + - qcom,sm6350-camcc 21 26 22 27 clocks: 23 28 items:
+4 -16
Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml
··· 19 19 compatible: 20 20 const: qcom,sm8150-camcc 21 21 22 - reg: 23 - maxItems: 1 24 - 25 22 clocks: 26 23 items: 27 24 - description: Board XO source ··· 34 37 description: 35 38 A phandle to an OPP node describing required MMCX performance point. 36 39 37 - '#clock-cells': 38 - const: 1 39 - 40 - '#reset-cells': 41 - const: 1 42 - 43 - '#power-domain-cells': 44 - const: 1 45 - 46 40 required: 47 41 - compatible 48 - - reg 49 42 - clocks 50 43 - power-domains 51 44 - required-opps 52 - - '#clock-cells' 53 - - '#reset-cells' 54 45 - '#power-domain-cells' 55 46 56 - additionalProperties: false 47 + allOf: 48 + - $ref: qcom,gcc.yaml# 49 + 50 + unevaluatedProperties: false 57 51 58 52 examples: 59 53 - |
+12 -8
Documentation/devicetree/bindings/clock/qcom,sm8450-camcc.yaml
··· 15 15 domains on SM8450. 16 16 17 17 See also: 18 - include/dt-bindings/clock/qcom,sc8280xp-camcc.h 19 18 include/dt-bindings/clock/qcom,sm8450-camcc.h 20 19 include/dt-bindings/clock/qcom,sm8550-camcc.h 21 20 include/dt-bindings/clock/qcom,sm8650-camcc.h ··· 22 23 properties: 23 24 compatible: 24 25 enum: 25 - - qcom,sc8280xp-camcc 26 26 - qcom,sm8450-camcc 27 27 - qcom,sm8475-camcc 28 28 - qcom,sm8550-camcc ··· 35 37 - description: Sleep clock source 36 38 37 39 power-domains: 38 - maxItems: 1 39 40 description: 40 - A phandle and PM domain specifier for the MMCX power domain. 41 + Power domains required for the clock controller to operate 42 + items: 43 + - description: MMCX power domain 44 + - description: MXC power domain 41 45 42 46 required-opps: 43 - maxItems: 1 44 47 description: 45 - A phandle to an OPP node describing required MMCX performance point. 48 + OPP nodes that describe required performance points on power domains 49 + items: 50 + - description: MMCX performance point 51 + - description: MXC performance point 46 52 47 53 reg: 48 54 maxItems: 1 ··· 84 82 <&rpmhcc RPMH_CXO_CLK>, 85 83 <&rpmhcc RPMH_CXO_CLK_A>, 86 84 <&sleep_clk>; 87 - power-domains = <&rpmhpd RPMHPD_MMCX>; 88 - required-opps = <&rpmhpd_opp_low_svs>; 85 + power-domains = <&rpmhpd RPMHPD_MMCX>, 86 + <&rpmhpd RPMHPD_MXC>; 87 + required-opps = <&rpmhpd_opp_low_svs>, 88 + <&rpmhpd_opp_low_svs>; 89 89 #clock-cells = <1>; 90 90 #reset-cells = <1>; 91 91 #power-domain-cells = <1>;
+2
Documentation/devicetree/bindings/clock/qcom,sm8450-gpucc.yaml
··· 14 14 domains on Qualcomm SoCs. 15 15 16 16 See also:: 17 + include/dt-bindings/clock/qcom,milos-gpucc.h 17 18 include/dt-bindings/clock/qcom,sar2130p-gpucc.h 18 19 include/dt-bindings/clock/qcom,sm4450-gpucc.h 19 20 include/dt-bindings/clock/qcom,sm8450-gpucc.h ··· 26 25 properties: 27 26 compatible: 28 27 enum: 28 + - qcom,milos-gpucc 29 29 - qcom,sar2130p-gpucc 30 30 - qcom,sm4450-gpucc 31 31 - qcom,sm8450-gpucc
+13 -6
Documentation/devicetree/bindings/clock/qcom,sm8450-videocc.yaml
··· 25 25 - qcom,sm8475-videocc 26 26 - qcom,sm8550-videocc 27 27 - qcom,sm8650-videocc 28 + - qcom,x1e80100-videocc 28 29 29 30 clocks: 30 31 items: ··· 33 32 - description: Video AHB clock from GCC 34 33 35 34 power-domains: 36 - maxItems: 1 37 35 description: 38 - MMCX power domain. 36 + Power domains required for the clock controller to operate 37 + items: 38 + - description: MMCX power domain 39 + - description: MXC power domain 39 40 40 41 required-opps: 41 - maxItems: 1 42 42 description: 43 - A phandle to an OPP node describing required MMCX performance point. 43 + OPP nodes that describe required performance points on power domains 44 + items: 45 + - description: MMCX performance point 46 + - description: MXC performance point 44 47 45 48 required: 46 49 - compatible ··· 77 72 reg = <0x0aaf0000 0x10000>; 78 73 clocks = <&rpmhcc RPMH_CXO_CLK>, 79 74 <&gcc GCC_VIDEO_AHB_CLK>; 80 - power-domains = <&rpmhpd RPMHPD_MMCX>; 81 - required-opps = <&rpmhpd_opp_low_svs>; 75 + power-domains = <&rpmhpd RPMHPD_MMCX>, 76 + <&rpmhpd RPMHPD_MXC>; 77 + required-opps = <&rpmhpd_opp_low_svs>, 78 + <&rpmhpd_opp_low_svs>; 82 79 #clock-cells = <1>; 83 80 #reset-cells = <1>; 84 81 #power-domain-cells = <1>;
+1
Documentation/devicetree/bindings/clock/qcom,sm8550-tcsr.yaml
··· 22 22 compatible: 23 23 items: 24 24 - enum: 25 + - qcom,milos-tcsr 25 26 - qcom,sar2130p-tcsr 26 27 - qcom,sm8550-tcsr 27 28 - qcom,sm8650-tcsr
+2 -2
MAINTAINERS
··· 17955 17955 L: imx@lists.linux.dev 17956 17956 S: Maintained 17957 17957 T: git git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux.git clk/imx 17958 - F: Documentation/devicetree/bindings/clock/imx* 17958 + F: Documentation/devicetree/bindings/clock/*imx* 17959 17959 F: drivers/clk/imx/ 17960 - F: include/dt-bindings/clock/imx* 17960 + F: include/dt-bindings/clock/*imx* 17961 17961 17962 17962 NXP PF8100/PF8121A/PF8200 PMIC REGULATOR DEVICE DRIVER 17963 17963 M: Jagan Teki <jagan@amarulasolutions.com>
+10 -10
drivers/clk/at91/sam9x7.c
··· 61 61 62 62 /* Fractional PLL core output range. */ 63 63 static const struct clk_range plla_core_outputs[] = { 64 - { .min = 375000000, .max = 1600000000 }, 64 + { .min = 800000000, .max = 1600000000 }, 65 65 }; 66 66 67 67 static const struct clk_range upll_core_outputs[] = { 68 - { .min = 600000000, .max = 1200000000 }, 68 + { .min = 600000000, .max = 960000000 }, 69 69 }; 70 70 71 71 static const struct clk_range lvdspll_core_outputs[] = { 72 - { .min = 400000000, .max = 800000000 }, 72 + { .min = 600000000, .max = 1200000000 }, 73 73 }; 74 74 75 75 static const struct clk_range audiopll_core_outputs[] = { 76 - { .min = 400000000, .max = 800000000 }, 76 + { .min = 600000000, .max = 1200000000 }, 77 77 }; 78 78 79 79 static const struct clk_range plladiv2_core_outputs[] = { 80 - { .min = 375000000, .max = 1600000000 }, 80 + { .min = 800000000, .max = 1600000000 }, 81 81 }; 82 82 83 83 /* Fractional PLL output range. */ 84 84 static const struct clk_range plla_outputs[] = { 85 - { .min = 732421, .max = 800000000 }, 85 + { .min = 400000000, .max = 800000000 }, 86 86 }; 87 87 88 88 static const struct clk_range upll_outputs[] = { 89 - { .min = 300000000, .max = 600000000 }, 89 + { .min = 300000000, .max = 480000000 }, 90 90 }; 91 91 92 92 static const struct clk_range lvdspll_outputs[] = { 93 - { .min = 10000000, .max = 800000000 }, 93 + { .min = 175000000, .max = 550000000 }, 94 94 }; 95 95 96 96 static const struct clk_range audiopll_outputs[] = { 97 - { .min = 10000000, .max = 800000000 }, 97 + { .min = 0, .max = 300000000 }, 98 98 }; 99 99 100 100 static const struct clk_range plladiv2_outputs[] = { 101 - { .min = 366210, .max = 400000000 }, 101 + { .min = 200000000, .max = 400000000 }, 102 102 }; 103 103 104 104 /* PLL characteristics. */
+74 -21
drivers/clk/imx/clk-imx95-blk-ctl.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * Copyright 2024 NXP 3 + * Copyright 2024-2025 NXP 4 4 */ 5 5 6 + #include <dt-bindings/clock/nxp,imx94-clock.h> 6 7 #include <dt-bindings/clock/nxp,imx95-clock.h> 7 8 #include <linux/clk.h> 8 9 #include <linux/clk-provider.h> ··· 157 156 .clk_reg_offset = 0, 158 157 }; 159 158 160 - static const struct imx95_blk_ctl_clk_dev_data lvds_clk_dev_data[] = { 159 + static const struct imx95_blk_ctl_clk_dev_data imx95_lvds_clk_dev_data[] = { 161 160 [IMX95_CLK_DISPMIX_LVDS_PHY_DIV] = { 162 161 .name = "ldb_phy_div", 163 162 .parent_names = (const char *[]){ "ldbpll", }, ··· 214 213 }, 215 214 }; 216 215 217 - static const struct imx95_blk_ctl_dev_data lvds_csr_dev_data = { 218 - .num_clks = ARRAY_SIZE(lvds_clk_dev_data), 219 - .clk_dev_data = lvds_clk_dev_data, 216 + static const struct imx95_blk_ctl_dev_data imx95_lvds_csr_dev_data = { 217 + .num_clks = ARRAY_SIZE(imx95_lvds_clk_dev_data), 218 + .clk_dev_data = imx95_lvds_clk_dev_data, 220 219 .clk_reg_offset = 0, 221 220 }; 222 221 223 - static const struct imx95_blk_ctl_clk_dev_data dispmix_csr_clk_dev_data[] = { 222 + static const char * const imx95_disp_engine_parents[] = { 223 + "videopll1", "dsi_pll", "ldb_pll_div7" 224 + }; 225 + 226 + static const struct imx95_blk_ctl_clk_dev_data imx95_dispmix_csr_clk_dev_data[] = { 224 227 [IMX95_CLK_DISPMIX_ENG0_SEL] = { 225 228 .name = "disp_engine0_sel", 226 - .parent_names = (const char *[]){"videopll1", "dsi_pll", "ldb_pll_div7", }, 227 - .num_parents = 4, 229 + .parent_names = imx95_disp_engine_parents, 230 + .num_parents = ARRAY_SIZE(imx95_disp_engine_parents), 228 231 .reg = 0, 229 232 .bit_idx = 0, 230 233 .bit_width = 2, ··· 237 232 }, 238 233 [IMX95_CLK_DISPMIX_ENG1_SEL] = { 239 234 .name = "disp_engine1_sel", 240 - .parent_names = (const char *[]){"videopll1", "dsi_pll", "ldb_pll_div7", }, 241 - .num_parents = 4, 235 + .parent_names = imx95_disp_engine_parents, 236 + .num_parents = ARRAY_SIZE(imx95_disp_engine_parents), 242 237 .reg = 0, 243 238 .bit_idx = 2, 244 239 .bit_width = 2, ··· 247 242 } 248 243 }; 249 244 250 - static const struct imx95_blk_ctl_dev_data dispmix_csr_dev_data = { 251 - .num_clks = ARRAY_SIZE(dispmix_csr_clk_dev_data), 252 - .clk_dev_data = dispmix_csr_clk_dev_data, 245 + static const struct imx95_blk_ctl_dev_data imx95_dispmix_csr_dev_data = { 246 + .num_clks = ARRAY_SIZE(imx95_dispmix_csr_clk_dev_data), 247 + .clk_dev_data = imx95_dispmix_csr_clk_dev_data, 253 248 .clk_reg_offset = 0, 254 249 }; 255 250 ··· 301 296 .clk_reg_offset = 0, 302 297 }; 303 298 299 + static const struct imx95_blk_ctl_clk_dev_data imx94_lvds_clk_dev_data[] = { 300 + [IMX94_CLK_DISPMIX_LVDS_CLK_GATE] = { 301 + .name = "lvds_clk_gate", 302 + .parent_names = (const char *[]){ "ldbpll", }, 303 + .num_parents = 1, 304 + .reg = 0, 305 + .bit_idx = 1, 306 + .bit_width = 1, 307 + .type = CLK_GATE, 308 + .flags = CLK_SET_RATE_PARENT, 309 + .flags2 = CLK_GATE_SET_TO_DISABLE, 310 + }, 311 + }; 312 + 313 + static const struct imx95_blk_ctl_dev_data imx94_lvds_csr_dev_data = { 314 + .num_clks = ARRAY_SIZE(imx94_lvds_clk_dev_data), 315 + .clk_dev_data = imx94_lvds_clk_dev_data, 316 + .clk_reg_offset = 0, 317 + .rpm_enabled = true, 318 + }; 319 + 320 + static const char * const imx94_disp_engine_parents[] = { 321 + "disppix", "ldb_pll_div7" 322 + }; 323 + 324 + static const struct imx95_blk_ctl_clk_dev_data imx94_dispmix_csr_clk_dev_data[] = { 325 + [IMX94_CLK_DISPMIX_CLK_SEL] = { 326 + .name = "disp_clk_sel", 327 + .parent_names = imx94_disp_engine_parents, 328 + .num_parents = ARRAY_SIZE(imx94_disp_engine_parents), 329 + .reg = 0, 330 + .bit_idx = 1, 331 + .bit_width = 1, 332 + .type = CLK_MUX, 333 + .flags = CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, 334 + }, 335 + }; 336 + 337 + static const struct imx95_blk_ctl_dev_data imx94_dispmix_csr_dev_data = { 338 + .num_clks = ARRAY_SIZE(imx94_dispmix_csr_clk_dev_data), 339 + .clk_dev_data = imx94_dispmix_csr_clk_dev_data, 340 + .clk_reg_offset = 0, 341 + .rpm_enabled = true, 342 + }; 343 + 304 344 static int imx95_bc_probe(struct platform_device *pdev) 305 345 { 306 346 struct device *dev = &pdev->dev; ··· 388 338 if (!clk_hw_data) 389 339 return -ENOMEM; 390 340 391 - if (bc_data->rpm_enabled) 392 - pm_runtime_enable(&pdev->dev); 341 + if (bc_data->rpm_enabled) { 342 + devm_pm_runtime_enable(&pdev->dev); 343 + pm_runtime_resume_and_get(&pdev->dev); 344 + } 393 345 394 346 clk_hw_data->num = bc_data->num_clks; 395 347 hws = clk_hw_data->hws; ··· 431 379 goto cleanup; 432 380 } 433 381 434 - if (pm_runtime_enabled(bc->dev)) 382 + if (pm_runtime_enabled(bc->dev)) { 383 + pm_runtime_put_sync(&pdev->dev); 435 384 clk_disable_unprepare(bc->clk_apb); 385 + } 436 386 437 387 return 0; 438 388 ··· 444 390 continue; 445 391 clk_hw_unregister(hws[i]); 446 392 } 447 - 448 - if (bc_data->rpm_enabled) 449 - pm_runtime_disable(&pdev->dev); 450 393 451 394 return ret; 452 395 } ··· 513 462 }; 514 463 515 464 static const struct of_device_id imx95_bc_of_match[] = { 465 + { .compatible = "nxp,imx94-display-csr", .data = &imx94_dispmix_csr_dev_data }, 466 + { .compatible = "nxp,imx94-lvds-csr", .data = &imx94_lvds_csr_dev_data }, 516 467 { .compatible = "nxp,imx95-camera-csr", .data = &camblk_dev_data }, 517 468 { .compatible = "nxp,imx95-display-master-csr", }, 518 - { .compatible = "nxp,imx95-lvds-csr", .data = &lvds_csr_dev_data }, 519 - { .compatible = "nxp,imx95-display-csr", .data = &dispmix_csr_dev_data }, 469 + { .compatible = "nxp,imx95-display-csr", .data = &imx95_dispmix_csr_dev_data }, 470 + { .compatible = "nxp,imx95-lvds-csr", .data = &imx95_lvds_csr_dev_data }, 520 471 { .compatible = "nxp,imx95-hsio-blk-ctl", .data = &hsio_blk_ctl_dev_data }, 521 472 { .compatible = "nxp,imx95-vpu-csr", .data = &vpublk_dev_data }, 522 473 { .compatible = "nxp,imx95-netcmix-blk-ctrl", .data = &netcmix_dev_data},
+102 -2
drivers/clk/qcom/Kconfig
··· 493 493 Say Y if you want to support display devices and functionality such as 494 494 splash screen. 495 495 496 + config QCS_DISPCC_615 497 + tristate "QCS615 Display Clock Controller" 498 + select QCM_GCC_615 499 + help 500 + Support for the display clock controller on Qualcomm Technologies, Inc 501 + QCS615 devices. 502 + Say Y if you want to support display devices and functionality such as 503 + splash screen. 504 + 505 + config QCS_CAMCC_615 506 + tristate "QCS615 Camera Clock Controller" 507 + depends on ARM64 || COMPILE_TEST 508 + select QCS_GCC_615 509 + help 510 + Support for the camera clock controller on Qualcomm Technologies, Inc 511 + QCS615 devices. 512 + Say Y if you want to support camera devices and functionality such as 513 + capturing pictures. 514 + 496 515 config QCS_GCC_404 497 516 tristate "QCS404 Global Clock Controller" 498 517 help ··· 548 529 Say Y if you want to use multimedia devices or peripheral 549 530 devices such as UART, SPI, I2C, USB, SD/eMMC, PCIe etc. 550 531 532 + config QCS_GPUCC_615 533 + tristate "QCS615 Graphics clock controller" 534 + select QCS_GCC_615 535 + help 536 + Support for the graphics clock controller on QCS615 devices. 537 + Say Y if you want to support graphics controller devices and 538 + functionality such as 3D graphics. 539 + 540 + config QCS_VIDEOCC_615 541 + tristate "QCS615 Video Clock Controller" 542 + select QCS_GCC_615 543 + help 544 + Support for the video clock controller on QCS615 devices. 545 + Say Y if you want to support video devices and functionality such as 546 + video encode and decode. 547 + 551 548 config SC_CAMCC_7180 552 549 tristate "SC7180 Camera Clock Controller" 553 550 depends on ARM64 || COMPILE_TEST ··· 581 546 help 582 547 Support for the camera clock controller on Qualcomm Technologies, Inc 583 548 SC7280 devices. 549 + Say Y if you want to support camera devices and functionality such as 550 + capturing pictures. 551 + 552 + config SC_CAMCC_8180X 553 + tristate "SC8180X Camera Clock Controller" 554 + depends on ARM64 || COMPILE_TEST 555 + select SC_GCC_8180X 556 + help 557 + Support for the camera clock controller on Qualcomm Technologies, Inc 558 + SC8180X devices. 584 559 Say Y if you want to support camera devices and functionality such as 585 560 capturing pictures. 586 561 ··· 969 924 Support for the camera clock controller on SM7150 devices. 970 925 Say Y if you want to support camera devices and camera functionality. 971 926 927 + config SM_CAMCC_MILOS 928 + tristate "Milos Camera Clock Controller" 929 + depends on ARM64 || COMPILE_TEST 930 + select SM_GCC_MILOS 931 + help 932 + Support for the camera clock controller on Milos devices. 933 + Say Y if you want to support camera devices and camera functionality. 934 + 972 935 config SM_CAMCC_8150 973 936 tristate "SM8150 Camera Clock Controller" 974 937 depends on ARM64 || COMPILE_TEST ··· 1089 1036 Say Y if you want to support display devices and functionality such as 1090 1037 splash screen. 1091 1038 1039 + config SM_DISPCC_MILOS 1040 + tristate "Milos Display Clock Controller" 1041 + depends on ARM64 || COMPILE_TEST 1042 + depends on SM_GCC_MILOS 1043 + help 1044 + Support for the display clock controller on Qualcomm Technologies, Inc 1045 + Milos devices. 1046 + Say Y if you want to support display devices and functionality such as 1047 + splash screen. 1048 + 1092 1049 config SM_DISPCC_8450 1093 1050 tristate "SM8450 Display Clock Controller" 1094 1051 depends on ARM64 || COMPILE_TEST ··· 1181 1118 select QCOM_GDSC 1182 1119 help 1183 1120 Support for the global clock controller on SM7150 devices. 1121 + Say Y if you want to use peripheral devices such as UART, 1122 + SPI, I2C, USB, SD/UFS, PCIe etc. 1123 + 1124 + config SM_GCC_MILOS 1125 + tristate "Milos Global Clock Controller" 1126 + depends on ARM64 || COMPILE_TEST 1127 + select QCOM_GDSC 1128 + help 1129 + Support for the global clock controller on Milos devices. 1184 1130 Say Y if you want to use peripheral devices such as UART, 1185 1131 SPI, I2C, USB, SD/UFS, PCIe etc. 1186 1132 ··· 1302 1230 Say Y if you want to support graphics controller devices and 1303 1231 functionality such as 3D graphics. 1304 1232 1233 + config SM_GPUCC_MILOS 1234 + tristate "Milos Graphics Clock Controller" 1235 + depends on ARM64 || COMPILE_TEST 1236 + select SM_GCC_MILOS 1237 + help 1238 + Support for the graphics clock controller on Milos devices. 1239 + Say Y if you want to support graphics controller devices and 1240 + functionality such as 3D graphics. 1241 + 1305 1242 config SM_GPUCC_8150 1306 1243 tristate "SM8150 Graphics Clock Controller" 1307 1244 depends on ARM64 || COMPILE_TEST ··· 1410 1329 Say Y if you want to support video devices and functionality such as 1411 1330 video encode/decode. 1412 1331 1332 + config SM_VIDEOCC_6350 1333 + tristate "SM6350 Video Clock Controller" 1334 + select SM_GCC_6350 1335 + select QCOM_GDSC 1336 + help 1337 + Support for the video clock controller on SM6350 devices. 1338 + Say Y if you want to support video devices and functionality such as 1339 + video encode and decode. 1340 + 1413 1341 config SM_VIDEOCC_7150 1414 1342 tristate "SM7150 Video Clock Controller" 1415 1343 depends on ARM64 || COMPILE_TEST ··· 1428 1338 Support for the video clock controller on SM7150 devices. 1429 1339 Say Y if you want to support video devices and functionality such as 1430 1340 video encode and decode. 1341 + 1342 + config SM_VIDEOCC_MILOS 1343 + tristate "Milos Video Clock Controller" 1344 + depends on ARM64 || COMPILE_TEST 1345 + select SM_GCC_MILOS 1346 + select QCOM_GDSC 1347 + help 1348 + Support for the video clock controller on Qualcomm Technologies, Inc. 1349 + Milos devices. 1350 + Say Y if you want to support video devices and functionality such as 1351 + video encode/decode. 1431 1352 1432 1353 config SM_VIDEOCC_8150 1433 1354 tristate "SM8150 Video Clock Controller" ··· 1473 1372 config SM_VIDEOCC_8550 1474 1373 tristate "SM8550 Video Clock Controller" 1475 1374 depends on ARM64 || COMPILE_TEST 1476 - depends on SM_GCC_8550 || SM_GCC_8650 1477 1375 select QCOM_GDSC 1478 1376 help 1479 1377 Support for the video clock controller on Qualcomm Technologies, Inc. 1480 - SM8550 or SM8650 devices. 1378 + SM8550 or SM8650 or X1E80100 devices. 1481 1379 Say Y if you want to support video devices and functionality such as 1482 1380 video encode/decode. 1483 1381
+11
drivers/clk/qcom/Makefile
··· 73 73 obj-$(CONFIG_QCOM_CLK_SMD_RPM) += clk-smd-rpm.o 74 74 obj-$(CONFIG_QCM_GCC_2290) += gcc-qcm2290.o 75 75 obj-$(CONFIG_QCM_DISPCC_2290) += dispcc-qcm2290.o 76 + obj-$(CONFIG_QCS_DISPCC_615) += dispcc-qcs615.o 77 + obj-$(CONFIG_QCS_CAMCC_615) += camcc-qcs615.o 76 78 obj-$(CONFIG_QCS_GCC_404) += gcc-qcs404.o 77 79 obj-$(CONFIG_QCS_GCC_615) += gcc-qcs615.o 78 80 obj-$(CONFIG_QCS_GCC_8300) += gcc-qcs8300.o 81 + obj-$(CONFIG_QCS_GPUCC_615) += gpucc-qcs615.o 82 + obj-$(CONFIG_QCS_VIDEOCC_615) += videocc-qcs615.o 79 83 obj-$(CONFIG_QCS_Q6SSTOP_404) += q6sstop-qcs404.o 80 84 obj-$(CONFIG_QCS_TURING_404) += turingcc-qcs404.o 81 85 obj-$(CONFIG_QDU_ECPRICC_1000) += ecpricc-qdu1000.o 82 86 obj-$(CONFIG_QDU_GCC_1000) += gcc-qdu1000.o 83 87 obj-$(CONFIG_SC_CAMCC_7180) += camcc-sc7180.o 84 88 obj-$(CONFIG_SC_CAMCC_7280) += camcc-sc7280.o 89 + obj-$(CONFIG_SC_CAMCC_8180X) += camcc-sc8180x.o 85 90 obj-$(CONFIG_SC_CAMCC_8280XP) += camcc-sc8280xp.o 86 91 obj-$(CONFIG_SC_DISPCC_7180) += dispcc-sc7180.o 87 92 obj-$(CONFIG_SC_DISPCC_7280) += dispcc-sc7280.o ··· 131 126 obj-$(CONFIG_SM_CAMCC_8450) += camcc-sm8450.o 132 127 obj-$(CONFIG_SM_CAMCC_8550) += camcc-sm8550.o 133 128 obj-$(CONFIG_SM_CAMCC_8650) += camcc-sm8650.o 129 + obj-$(CONFIG_SM_CAMCC_MILOS) += camcc-milos.o 134 130 obj-$(CONFIG_SM_DISPCC_4450) += dispcc-sm4450.o 135 131 obj-$(CONFIG_SM_DISPCC_6115) += dispcc-sm6115.o 136 132 obj-$(CONFIG_SM_DISPCC_6125) += dispcc-sm6125.o ··· 142 136 obj-$(CONFIG_SM_DISPCC_8450) += dispcc-sm8450.o 143 137 obj-$(CONFIG_SM_DISPCC_8550) += dispcc-sm8550.o 144 138 obj-$(CONFIG_SM_DISPCC_8750) += dispcc-sm8750.o 139 + obj-$(CONFIG_SM_DISPCC_MILOS) += dispcc-milos.o 145 140 obj-$(CONFIG_SM_GCC_4450) += gcc-sm4450.o 146 141 obj-$(CONFIG_SM_GCC_6115) += gcc-sm6115.o 147 142 obj-$(CONFIG_SM_GCC_6125) += gcc-sm6125.o ··· 156 149 obj-$(CONFIG_SM_GCC_8550) += gcc-sm8550.o 157 150 obj-$(CONFIG_SM_GCC_8650) += gcc-sm8650.o 158 151 obj-$(CONFIG_SM_GCC_8750) += gcc-sm8750.o 152 + obj-$(CONFIG_SM_GCC_MILOS) += gcc-milos.o 159 153 obj-$(CONFIG_SM_GPUCC_4450) += gpucc-sm4450.o 160 154 obj-$(CONFIG_SM_GPUCC_6115) += gpucc-sm6115.o 161 155 obj-$(CONFIG_SM_GPUCC_6125) += gpucc-sm6125.o ··· 168 160 obj-$(CONFIG_SM_GPUCC_8450) += gpucc-sm8450.o 169 161 obj-$(CONFIG_SM_GPUCC_8550) += gpucc-sm8550.o 170 162 obj-$(CONFIG_SM_GPUCC_8650) += gpucc-sm8650.o 163 + obj-$(CONFIG_SM_GPUCC_MILOS) += gpucc-milos.o 171 164 obj-$(CONFIG_SM_LPASSCC_6115) += lpasscc-sm6115.o 172 165 obj-$(CONFIG_SM_TCSRCC_8550) += tcsrcc-sm8550.o 173 166 obj-$(CONFIG_SM_TCSRCC_8650) += tcsrcc-sm8650.o 174 167 obj-$(CONFIG_SM_TCSRCC_8750) += tcsrcc-sm8750.o 168 + obj-$(CONFIG_SM_VIDEOCC_6350) += videocc-sm6350.o 175 169 obj-$(CONFIG_SM_VIDEOCC_7150) += videocc-sm7150.o 176 170 obj-$(CONFIG_SM_VIDEOCC_8150) += videocc-sm8150.o 177 171 obj-$(CONFIG_SM_VIDEOCC_8250) += videocc-sm8250.o 178 172 obj-$(CONFIG_SM_VIDEOCC_8350) += videocc-sm8350.o 179 173 obj-$(CONFIG_SM_VIDEOCC_8450) += videocc-sm8450.o 180 174 obj-$(CONFIG_SM_VIDEOCC_8550) += videocc-sm8550.o 175 + obj-$(CONFIG_SM_VIDEOCC_MILOS) += videocc-milos.o 181 176 obj-$(CONFIG_SPMI_PMIC_CLKDIV) += clk-spmi-pmic-div.o 182 177 obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o 183 178 obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
+2161
drivers/clk/qcom/camcc-milos.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 5 + */ 6 + 7 + #include <linux/clk-provider.h> 8 + #include <linux/mod_devicetable.h> 9 + #include <linux/module.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/regmap.h> 12 + 13 + #include <dt-bindings/clock/qcom,milos-camcc.h> 14 + 15 + #include "clk-alpha-pll.h" 16 + #include "clk-branch.h" 17 + #include "clk-pll.h" 18 + #include "clk-rcg.h" 19 + #include "clk-regmap.h" 20 + #include "clk-regmap-divider.h" 21 + #include "clk-regmap-mux.h" 22 + #include "common.h" 23 + #include "gdsc.h" 24 + #include "reset.h" 25 + 26 + /* Need to match the order of clocks in DT binding */ 27 + enum { 28 + DT_BI_TCXO, 29 + DT_SLEEP_CLK, 30 + DT_IFACE, 31 + }; 32 + 33 + enum { 34 + P_BI_TCXO, 35 + P_CAM_CC_PLL0_OUT_EVEN, 36 + P_CAM_CC_PLL0_OUT_MAIN, 37 + P_CAM_CC_PLL0_OUT_ODD, 38 + P_CAM_CC_PLL1_OUT_EVEN, 39 + P_CAM_CC_PLL1_OUT_MAIN, 40 + P_CAM_CC_PLL2_OUT_MAIN, 41 + P_CAM_CC_PLL3_OUT_EVEN, 42 + P_CAM_CC_PLL4_OUT_EVEN, 43 + P_CAM_CC_PLL4_OUT_MAIN, 44 + P_CAM_CC_PLL5_OUT_EVEN, 45 + P_CAM_CC_PLL5_OUT_MAIN, 46 + P_CAM_CC_PLL6_OUT_EVEN, 47 + P_CAM_CC_PLL6_OUT_MAIN, 48 + P_SLEEP_CLK, 49 + }; 50 + 51 + static const struct pll_vco lucid_ole_vco[] = { 52 + { 249600000, 2300000000, 0 }, 53 + }; 54 + 55 + static const struct pll_vco rivian_ole_vco[] = { 56 + { 777000000, 1285000000, 0 }, 57 + }; 58 + 59 + /* 1200.0 MHz Configuration */ 60 + static const struct alpha_pll_config cam_cc_pll0_config = { 61 + .l = 0x3e, 62 + .alpha = 0x8000, 63 + .config_ctl_val = 0x20485699, 64 + .config_ctl_hi_val = 0x00182261, 65 + .config_ctl_hi1_val = 0x82aa299c, 66 + .test_ctl_val = 0x00000000, 67 + .test_ctl_hi_val = 0x00000003, 68 + .test_ctl_hi1_val = 0x00009000, 69 + .test_ctl_hi2_val = 0x00000034, 70 + .user_ctl_val = 0x00008400, 71 + .user_ctl_hi_val = 0x00000005, 72 + }; 73 + 74 + static struct clk_alpha_pll cam_cc_pll0 = { 75 + .offset = 0x0, 76 + .config = &cam_cc_pll0_config, 77 + .vco_table = lucid_ole_vco, 78 + .num_vco = ARRAY_SIZE(lucid_ole_vco), 79 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 80 + .clkr = { 81 + .hw.init = &(const struct clk_init_data) { 82 + .name = "cam_cc_pll0", 83 + .parent_data = &(const struct clk_parent_data) { 84 + .index = DT_BI_TCXO, 85 + }, 86 + .num_parents = 1, 87 + .ops = &clk_alpha_pll_lucid_evo_ops, 88 + }, 89 + }, 90 + }; 91 + 92 + static const struct clk_div_table post_div_table_cam_cc_pll0_out_even[] = { 93 + { 0x1, 2 }, 94 + { } 95 + }; 96 + 97 + static struct clk_alpha_pll_postdiv cam_cc_pll0_out_even = { 98 + .offset = 0x0, 99 + .post_div_shift = 10, 100 + .post_div_table = post_div_table_cam_cc_pll0_out_even, 101 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll0_out_even), 102 + .width = 4, 103 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 104 + .clkr.hw.init = &(const struct clk_init_data) { 105 + .name = "cam_cc_pll0_out_even", 106 + .parent_hws = (const struct clk_hw*[]) { 107 + &cam_cc_pll0.clkr.hw, 108 + }, 109 + .num_parents = 1, 110 + .flags = CLK_SET_RATE_PARENT, 111 + .ops = &clk_alpha_pll_postdiv_lucid_ole_ops, 112 + }, 113 + }; 114 + 115 + static const struct clk_div_table post_div_table_cam_cc_pll0_out_odd[] = { 116 + { 0x2, 3 }, 117 + { } 118 + }; 119 + 120 + static struct clk_alpha_pll_postdiv cam_cc_pll0_out_odd = { 121 + .offset = 0x0, 122 + .post_div_shift = 14, 123 + .post_div_table = post_div_table_cam_cc_pll0_out_odd, 124 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll0_out_odd), 125 + .width = 4, 126 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 127 + .clkr.hw.init = &(const struct clk_init_data) { 128 + .name = "cam_cc_pll0_out_odd", 129 + .parent_hws = (const struct clk_hw*[]) { 130 + &cam_cc_pll0.clkr.hw, 131 + }, 132 + .num_parents = 1, 133 + .flags = CLK_SET_RATE_PARENT, 134 + .ops = &clk_alpha_pll_postdiv_lucid_ole_ops, 135 + }, 136 + }; 137 + 138 + /* 600.0 MHz Configuration */ 139 + static const struct alpha_pll_config cam_cc_pll1_config = { 140 + .l = 0x1f, 141 + .alpha = 0x4000, 142 + .config_ctl_val = 0x20485699, 143 + .config_ctl_hi_val = 0x00182261, 144 + .config_ctl_hi1_val = 0x82aa299c, 145 + .test_ctl_val = 0x00000000, 146 + .test_ctl_hi_val = 0x00000003, 147 + .test_ctl_hi1_val = 0x00009000, 148 + .test_ctl_hi2_val = 0x00000034, 149 + .user_ctl_val = 0x00000400, 150 + .user_ctl_hi_val = 0x00000005, 151 + }; 152 + 153 + static struct clk_alpha_pll cam_cc_pll1 = { 154 + .offset = 0x1000, 155 + .config = &cam_cc_pll1_config, 156 + .vco_table = lucid_ole_vco, 157 + .num_vco = ARRAY_SIZE(lucid_ole_vco), 158 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 159 + .clkr = { 160 + .hw.init = &(const struct clk_init_data) { 161 + .name = "cam_cc_pll1", 162 + .parent_data = &(const struct clk_parent_data) { 163 + .index = DT_BI_TCXO, 164 + }, 165 + .num_parents = 1, 166 + .ops = &clk_alpha_pll_lucid_evo_ops, 167 + }, 168 + }, 169 + }; 170 + 171 + static const struct clk_div_table post_div_table_cam_cc_pll1_out_even[] = { 172 + { 0x1, 2 }, 173 + { } 174 + }; 175 + 176 + static struct clk_alpha_pll_postdiv cam_cc_pll1_out_even = { 177 + .offset = 0x1000, 178 + .post_div_shift = 10, 179 + .post_div_table = post_div_table_cam_cc_pll1_out_even, 180 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll1_out_even), 181 + .width = 4, 182 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 183 + .clkr.hw.init = &(const struct clk_init_data) { 184 + .name = "cam_cc_pll1_out_even", 185 + .parent_hws = (const struct clk_hw*[]) { 186 + &cam_cc_pll1.clkr.hw, 187 + }, 188 + .num_parents = 1, 189 + .flags = CLK_SET_RATE_PARENT, 190 + .ops = &clk_alpha_pll_postdiv_lucid_ole_ops, 191 + }, 192 + }; 193 + 194 + /* 960.0 MHz Configuration */ 195 + static const struct alpha_pll_config cam_cc_pll2_config = { 196 + .l = 0x32, 197 + .alpha = 0x0, 198 + .config_ctl_val = 0x10000030, 199 + .config_ctl_hi_val = 0x80890263, 200 + .config_ctl_hi1_val = 0x00000217, 201 + .user_ctl_val = 0x00000001, 202 + .user_ctl_hi_val = 0x00100000, 203 + }; 204 + 205 + static struct clk_alpha_pll cam_cc_pll2 = { 206 + .offset = 0x2000, 207 + .config = &cam_cc_pll2_config, 208 + .vco_table = rivian_ole_vco, 209 + .num_vco = ARRAY_SIZE(rivian_ole_vco), 210 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_RIVIAN_EVO], 211 + .clkr = { 212 + .hw.init = &(const struct clk_init_data) { 213 + .name = "cam_cc_pll2", 214 + .parent_data = &(const struct clk_parent_data) { 215 + .index = DT_BI_TCXO, 216 + }, 217 + .num_parents = 1, 218 + .ops = &clk_alpha_pll_rivian_evo_ops, 219 + }, 220 + }, 221 + }; 222 + 223 + /* 600.0 MHz Configuration */ 224 + static const struct alpha_pll_config cam_cc_pll3_config = { 225 + .l = 0x1f, 226 + .alpha = 0x4000, 227 + .config_ctl_val = 0x20485699, 228 + .config_ctl_hi_val = 0x00182261, 229 + .config_ctl_hi1_val = 0x82aa299c, 230 + .test_ctl_val = 0x00000000, 231 + .test_ctl_hi_val = 0x00000003, 232 + .test_ctl_hi1_val = 0x00009000, 233 + .test_ctl_hi2_val = 0x00000034, 234 + .user_ctl_val = 0x00000400, 235 + .user_ctl_hi_val = 0x00000005, 236 + }; 237 + 238 + static struct clk_alpha_pll cam_cc_pll3 = { 239 + .offset = 0x3000, 240 + .config = &cam_cc_pll3_config, 241 + .vco_table = lucid_ole_vco, 242 + .num_vco = ARRAY_SIZE(lucid_ole_vco), 243 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 244 + .clkr = { 245 + .hw.init = &(const struct clk_init_data) { 246 + .name = "cam_cc_pll3", 247 + .parent_data = &(const struct clk_parent_data) { 248 + .index = DT_BI_TCXO, 249 + }, 250 + .num_parents = 1, 251 + .ops = &clk_alpha_pll_lucid_evo_ops, 252 + }, 253 + }, 254 + }; 255 + 256 + static const struct clk_div_table post_div_table_cam_cc_pll3_out_even[] = { 257 + { 0x1, 2 }, 258 + { } 259 + }; 260 + 261 + static struct clk_alpha_pll_postdiv cam_cc_pll3_out_even = { 262 + .offset = 0x3000, 263 + .post_div_shift = 10, 264 + .post_div_table = post_div_table_cam_cc_pll3_out_even, 265 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll3_out_even), 266 + .width = 4, 267 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 268 + .clkr.hw.init = &(const struct clk_init_data) { 269 + .name = "cam_cc_pll3_out_even", 270 + .parent_hws = (const struct clk_hw*[]) { 271 + &cam_cc_pll3.clkr.hw, 272 + }, 273 + .num_parents = 1, 274 + .flags = CLK_SET_RATE_PARENT, 275 + .ops = &clk_alpha_pll_postdiv_lucid_ole_ops, 276 + }, 277 + }; 278 + 279 + /* 700.0 MHz Configuration */ 280 + static const struct alpha_pll_config cam_cc_pll4_config = { 281 + .l = 0x24, 282 + .alpha = 0x7555, 283 + .config_ctl_val = 0x20485699, 284 + .config_ctl_hi_val = 0x00182261, 285 + .config_ctl_hi1_val = 0x82aa299c, 286 + .test_ctl_val = 0x00000000, 287 + .test_ctl_hi_val = 0x00000003, 288 + .test_ctl_hi1_val = 0x00009000, 289 + .test_ctl_hi2_val = 0x00000034, 290 + .user_ctl_val = 0x00000400, 291 + .user_ctl_hi_val = 0x00000005, 292 + }; 293 + 294 + static struct clk_alpha_pll cam_cc_pll4 = { 295 + .offset = 0x4000, 296 + .config = &cam_cc_pll4_config, 297 + .vco_table = lucid_ole_vco, 298 + .num_vco = ARRAY_SIZE(lucid_ole_vco), 299 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 300 + .clkr = { 301 + .hw.init = &(const struct clk_init_data) { 302 + .name = "cam_cc_pll4", 303 + .parent_data = &(const struct clk_parent_data) { 304 + .index = DT_BI_TCXO, 305 + }, 306 + .num_parents = 1, 307 + .ops = &clk_alpha_pll_lucid_evo_ops, 308 + }, 309 + }, 310 + }; 311 + 312 + static const struct clk_div_table post_div_table_cam_cc_pll4_out_even[] = { 313 + { 0x1, 2 }, 314 + { } 315 + }; 316 + 317 + static struct clk_alpha_pll_postdiv cam_cc_pll4_out_even = { 318 + .offset = 0x4000, 319 + .post_div_shift = 10, 320 + .post_div_table = post_div_table_cam_cc_pll4_out_even, 321 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll4_out_even), 322 + .width = 4, 323 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 324 + .clkr.hw.init = &(const struct clk_init_data) { 325 + .name = "cam_cc_pll4_out_even", 326 + .parent_hws = (const struct clk_hw*[]) { 327 + &cam_cc_pll4.clkr.hw, 328 + }, 329 + .num_parents = 1, 330 + .flags = CLK_SET_RATE_PARENT, 331 + .ops = &clk_alpha_pll_postdiv_lucid_ole_ops, 332 + }, 333 + }; 334 + 335 + /* 700.0 MHz Configuration */ 336 + static const struct alpha_pll_config cam_cc_pll5_config = { 337 + .l = 0x24, 338 + .alpha = 0x7555, 339 + .config_ctl_val = 0x20485699, 340 + .config_ctl_hi_val = 0x00182261, 341 + .config_ctl_hi1_val = 0x82aa299c, 342 + .test_ctl_val = 0x00000000, 343 + .test_ctl_hi_val = 0x00000003, 344 + .test_ctl_hi1_val = 0x00009000, 345 + .test_ctl_hi2_val = 0x00000034, 346 + .user_ctl_val = 0x00000400, 347 + .user_ctl_hi_val = 0x00000005, 348 + }; 349 + 350 + static struct clk_alpha_pll cam_cc_pll5 = { 351 + .offset = 0x5000, 352 + .config = &cam_cc_pll5_config, 353 + .vco_table = lucid_ole_vco, 354 + .num_vco = ARRAY_SIZE(lucid_ole_vco), 355 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 356 + .clkr = { 357 + .hw.init = &(const struct clk_init_data) { 358 + .name = "cam_cc_pll5", 359 + .parent_data = &(const struct clk_parent_data) { 360 + .index = DT_BI_TCXO, 361 + }, 362 + .num_parents = 1, 363 + .ops = &clk_alpha_pll_lucid_evo_ops, 364 + }, 365 + }, 366 + }; 367 + 368 + static const struct clk_div_table post_div_table_cam_cc_pll5_out_even[] = { 369 + { 0x1, 2 }, 370 + { } 371 + }; 372 + 373 + static struct clk_alpha_pll_postdiv cam_cc_pll5_out_even = { 374 + .offset = 0x5000, 375 + .post_div_shift = 10, 376 + .post_div_table = post_div_table_cam_cc_pll5_out_even, 377 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll5_out_even), 378 + .width = 4, 379 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 380 + .clkr.hw.init = &(const struct clk_init_data) { 381 + .name = "cam_cc_pll5_out_even", 382 + .parent_hws = (const struct clk_hw*[]) { 383 + &cam_cc_pll5.clkr.hw, 384 + }, 385 + .num_parents = 1, 386 + .flags = CLK_SET_RATE_PARENT, 387 + .ops = &clk_alpha_pll_postdiv_lucid_ole_ops, 388 + }, 389 + }; 390 + 391 + /* 700.0 MHz Configuration */ 392 + static const struct alpha_pll_config cam_cc_pll6_config = { 393 + .l = 0x24, 394 + .alpha = 0x7555, 395 + .config_ctl_val = 0x20485699, 396 + .config_ctl_hi_val = 0x00182261, 397 + .config_ctl_hi1_val = 0x82aa299c, 398 + .test_ctl_val = 0x00000000, 399 + .test_ctl_hi_val = 0x00000003, 400 + .test_ctl_hi1_val = 0x00009000, 401 + .test_ctl_hi2_val = 0x00000034, 402 + .user_ctl_val = 0x00000400, 403 + .user_ctl_hi_val = 0x00000005, 404 + }; 405 + 406 + static struct clk_alpha_pll cam_cc_pll6 = { 407 + .offset = 0x6000, 408 + .config = &cam_cc_pll6_config, 409 + .vco_table = lucid_ole_vco, 410 + .num_vco = ARRAY_SIZE(lucid_ole_vco), 411 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 412 + .clkr = { 413 + .hw.init = &(const struct clk_init_data) { 414 + .name = "cam_cc_pll6", 415 + .parent_data = &(const struct clk_parent_data) { 416 + .index = DT_BI_TCXO, 417 + }, 418 + .num_parents = 1, 419 + .ops = &clk_alpha_pll_lucid_evo_ops, 420 + }, 421 + }, 422 + }; 423 + 424 + static const struct clk_div_table post_div_table_cam_cc_pll6_out_even[] = { 425 + { 0x1, 2 }, 426 + { } 427 + }; 428 + 429 + static struct clk_alpha_pll_postdiv cam_cc_pll6_out_even = { 430 + .offset = 0x6000, 431 + .post_div_shift = 10, 432 + .post_div_table = post_div_table_cam_cc_pll6_out_even, 433 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll6_out_even), 434 + .width = 4, 435 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 436 + .clkr.hw.init = &(const struct clk_init_data) { 437 + .name = "cam_cc_pll6_out_even", 438 + .parent_hws = (const struct clk_hw*[]) { 439 + &cam_cc_pll6.clkr.hw, 440 + }, 441 + .num_parents = 1, 442 + .flags = CLK_SET_RATE_PARENT, 443 + .ops = &clk_alpha_pll_postdiv_lucid_ole_ops, 444 + }, 445 + }; 446 + 447 + static const struct parent_map cam_cc_parent_map_0[] = { 448 + { P_BI_TCXO, 0 }, 449 + { P_CAM_CC_PLL0_OUT_MAIN, 1 }, 450 + { P_CAM_CC_PLL0_OUT_ODD, 5 }, 451 + { P_CAM_CC_PLL0_OUT_EVEN, 6 }, 452 + }; 453 + 454 + static const struct clk_parent_data cam_cc_parent_data_0[] = { 455 + { .index = DT_BI_TCXO }, 456 + { .hw = &cam_cc_pll0.clkr.hw }, 457 + { .hw = &cam_cc_pll0_out_odd.clkr.hw }, 458 + { .hw = &cam_cc_pll0_out_even.clkr.hw }, 459 + }; 460 + 461 + static const struct parent_map cam_cc_parent_map_1[] = { 462 + { P_BI_TCXO, 0 }, 463 + { P_CAM_CC_PLL2_OUT_MAIN, 4 }, 464 + }; 465 + 466 + static const struct clk_parent_data cam_cc_parent_data_1[] = { 467 + { .index = DT_BI_TCXO }, 468 + { .hw = &cam_cc_pll2.clkr.hw }, 469 + }; 470 + 471 + static const struct parent_map cam_cc_parent_map_2[] = { 472 + { P_BI_TCXO, 0 }, 473 + { P_CAM_CC_PLL0_OUT_MAIN, 1 }, 474 + { P_CAM_CC_PLL1_OUT_MAIN, 2 }, 475 + { P_CAM_CC_PLL1_OUT_EVEN, 3 }, 476 + { P_CAM_CC_PLL0_OUT_ODD, 5 }, 477 + { P_CAM_CC_PLL0_OUT_EVEN, 6 }, 478 + }; 479 + 480 + static const struct clk_parent_data cam_cc_parent_data_2[] = { 481 + { .index = DT_BI_TCXO }, 482 + { .hw = &cam_cc_pll0.clkr.hw }, 483 + { .hw = &cam_cc_pll1.clkr.hw }, 484 + { .hw = &cam_cc_pll1_out_even.clkr.hw }, 485 + { .hw = &cam_cc_pll0_out_odd.clkr.hw }, 486 + { .hw = &cam_cc_pll0_out_even.clkr.hw }, 487 + }; 488 + 489 + static const struct parent_map cam_cc_parent_map_3[] = { 490 + { P_BI_TCXO, 0 }, 491 + { P_CAM_CC_PLL0_OUT_ODD, 5 }, 492 + { P_CAM_CC_PLL0_OUT_EVEN, 6 }, 493 + }; 494 + 495 + static const struct clk_parent_data cam_cc_parent_data_3[] = { 496 + { .index = DT_BI_TCXO }, 497 + { .hw = &cam_cc_pll0_out_odd.clkr.hw }, 498 + { .hw = &cam_cc_pll0_out_even.clkr.hw }, 499 + }; 500 + 501 + static const struct parent_map cam_cc_parent_map_4[] = { 502 + { P_BI_TCXO, 0 }, 503 + { P_CAM_CC_PLL0_OUT_MAIN, 1 }, 504 + { P_CAM_CC_PLL0_OUT_EVEN, 6 }, 505 + }; 506 + 507 + static const struct clk_parent_data cam_cc_parent_data_4[] = { 508 + { .index = DT_BI_TCXO }, 509 + { .hw = &cam_cc_pll0.clkr.hw }, 510 + { .hw = &cam_cc_pll0_out_even.clkr.hw }, 511 + }; 512 + 513 + static const struct parent_map cam_cc_parent_map_5[] = { 514 + { P_BI_TCXO, 0 }, 515 + { P_CAM_CC_PLL0_OUT_MAIN, 1 }, 516 + { P_CAM_CC_PLL3_OUT_EVEN, 5 }, 517 + { P_CAM_CC_PLL0_OUT_EVEN, 6 }, 518 + }; 519 + 520 + static const struct clk_parent_data cam_cc_parent_data_5[] = { 521 + { .index = DT_BI_TCXO }, 522 + { .hw = &cam_cc_pll0.clkr.hw }, 523 + { .hw = &cam_cc_pll3_out_even.clkr.hw }, 524 + { .hw = &cam_cc_pll0_out_even.clkr.hw }, 525 + }; 526 + 527 + static const struct parent_map cam_cc_parent_map_6[] = { 528 + { P_SLEEP_CLK, 0 }, 529 + }; 530 + 531 + static const struct clk_parent_data cam_cc_parent_data_6_ao[] = { 532 + { .index = DT_SLEEP_CLK }, 533 + }; 534 + 535 + static const struct parent_map cam_cc_parent_map_7[] = { 536 + { P_BI_TCXO, 0 }, 537 + { P_CAM_CC_PLL0_OUT_MAIN, 1 }, 538 + { P_CAM_CC_PLL4_OUT_EVEN, 2 }, 539 + { P_CAM_CC_PLL4_OUT_MAIN, 3 }, 540 + { P_CAM_CC_PLL0_OUT_ODD, 5 }, 541 + { P_CAM_CC_PLL0_OUT_EVEN, 6 }, 542 + }; 543 + 544 + static const struct clk_parent_data cam_cc_parent_data_7[] = { 545 + { .index = DT_BI_TCXO }, 546 + { .hw = &cam_cc_pll0.clkr.hw }, 547 + { .hw = &cam_cc_pll4_out_even.clkr.hw }, 548 + { .hw = &cam_cc_pll4.clkr.hw }, 549 + { .hw = &cam_cc_pll0_out_odd.clkr.hw }, 550 + { .hw = &cam_cc_pll0_out_even.clkr.hw }, 551 + }; 552 + 553 + static const struct parent_map cam_cc_parent_map_8[] = { 554 + { P_BI_TCXO, 0 }, 555 + { P_CAM_CC_PLL0_OUT_MAIN, 1 }, 556 + { P_CAM_CC_PLL5_OUT_EVEN, 2 }, 557 + { P_CAM_CC_PLL5_OUT_MAIN, 3 }, 558 + { P_CAM_CC_PLL0_OUT_ODD, 5 }, 559 + { P_CAM_CC_PLL0_OUT_EVEN, 6 }, 560 + }; 561 + 562 + static const struct clk_parent_data cam_cc_parent_data_8[] = { 563 + { .index = DT_BI_TCXO }, 564 + { .hw = &cam_cc_pll0.clkr.hw }, 565 + { .hw = &cam_cc_pll5_out_even.clkr.hw }, 566 + { .hw = &cam_cc_pll5.clkr.hw }, 567 + { .hw = &cam_cc_pll0_out_odd.clkr.hw }, 568 + { .hw = &cam_cc_pll0_out_even.clkr.hw }, 569 + }; 570 + 571 + static const struct parent_map cam_cc_parent_map_9[] = { 572 + { P_BI_TCXO, 0 }, 573 + { P_CAM_CC_PLL0_OUT_MAIN, 1 }, 574 + { P_CAM_CC_PLL6_OUT_EVEN, 2 }, 575 + { P_CAM_CC_PLL6_OUT_MAIN, 3 }, 576 + { P_CAM_CC_PLL0_OUT_ODD, 5 }, 577 + { P_CAM_CC_PLL0_OUT_EVEN, 6 }, 578 + }; 579 + 580 + static const struct clk_parent_data cam_cc_parent_data_9[] = { 581 + { .index = DT_BI_TCXO }, 582 + { .hw = &cam_cc_pll0.clkr.hw }, 583 + { .hw = &cam_cc_pll6_out_even.clkr.hw }, 584 + { .hw = &cam_cc_pll6.clkr.hw }, 585 + { .hw = &cam_cc_pll0_out_odd.clkr.hw }, 586 + { .hw = &cam_cc_pll0_out_even.clkr.hw }, 587 + }; 588 + 589 + static const struct parent_map cam_cc_parent_map_10[] = { 590 + { P_BI_TCXO, 0 }, 591 + }; 592 + 593 + static const struct clk_parent_data cam_cc_parent_data_10[] = { 594 + { .index = DT_BI_TCXO }, 595 + }; 596 + 597 + static const struct freq_tbl ftbl_cam_cc_bps_clk_src[] = { 598 + F(300000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0), 599 + F(410000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0), 600 + F(460000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0), 601 + F(600000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0), 602 + F(700000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0), 603 + { } 604 + }; 605 + 606 + static struct clk_rcg2 cam_cc_bps_clk_src = { 607 + .cmd_rcgr = 0x1a004, 608 + .mnd_width = 0, 609 + .hid_width = 5, 610 + .parent_map = cam_cc_parent_map_2, 611 + .freq_tbl = ftbl_cam_cc_bps_clk_src, 612 + .clkr.hw.init = &(const struct clk_init_data) { 613 + .name = "cam_cc_bps_clk_src", 614 + .parent_data = cam_cc_parent_data_2, 615 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_2), 616 + .flags = CLK_SET_RATE_PARENT, 617 + .ops = &clk_rcg2_shared_ops, 618 + }, 619 + }; 620 + 621 + static const struct freq_tbl ftbl_cam_cc_camnoc_axi_clk_src[] = { 622 + F(150000000, P_CAM_CC_PLL0_OUT_EVEN, 4, 0, 0), 623 + F(240000000, P_CAM_CC_PLL0_OUT_EVEN, 2.5, 0, 0), 624 + F(300000000, P_CAM_CC_PLL0_OUT_EVEN, 2, 0, 0), 625 + F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0), 626 + { } 627 + }; 628 + 629 + static struct clk_rcg2 cam_cc_camnoc_axi_clk_src = { 630 + .cmd_rcgr = 0x2401c, 631 + .mnd_width = 0, 632 + .hid_width = 5, 633 + .parent_map = cam_cc_parent_map_0, 634 + .freq_tbl = ftbl_cam_cc_camnoc_axi_clk_src, 635 + .clkr.hw.init = &(const struct clk_init_data) { 636 + .name = "cam_cc_camnoc_axi_clk_src", 637 + .parent_data = cam_cc_parent_data_0, 638 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 639 + .flags = CLK_SET_RATE_PARENT, 640 + .ops = &clk_rcg2_shared_ops, 641 + }, 642 + }; 643 + 644 + static const struct freq_tbl ftbl_cam_cc_cci_0_clk_src[] = { 645 + F(37500000, P_CAM_CC_PLL0_OUT_EVEN, 16, 0, 0), 646 + F(50000000, P_CAM_CC_PLL0_OUT_EVEN, 12, 0, 0), 647 + F(100000000, P_CAM_CC_PLL0_OUT_EVEN, 6, 0, 0), 648 + { } 649 + }; 650 + 651 + static struct clk_rcg2 cam_cc_cci_0_clk_src = { 652 + .cmd_rcgr = 0x21004, 653 + .mnd_width = 8, 654 + .hid_width = 5, 655 + .parent_map = cam_cc_parent_map_3, 656 + .freq_tbl = ftbl_cam_cc_cci_0_clk_src, 657 + .clkr.hw.init = &(const struct clk_init_data) { 658 + .name = "cam_cc_cci_0_clk_src", 659 + .parent_data = cam_cc_parent_data_3, 660 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_3), 661 + .flags = CLK_SET_RATE_PARENT, 662 + .ops = &clk_rcg2_shared_ops, 663 + }, 664 + }; 665 + 666 + static struct clk_rcg2 cam_cc_cci_1_clk_src = { 667 + .cmd_rcgr = 0x22004, 668 + .mnd_width = 8, 669 + .hid_width = 5, 670 + .parent_map = cam_cc_parent_map_3, 671 + .freq_tbl = ftbl_cam_cc_cci_0_clk_src, 672 + .clkr.hw.init = &(const struct clk_init_data) { 673 + .name = "cam_cc_cci_1_clk_src", 674 + .parent_data = cam_cc_parent_data_3, 675 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_3), 676 + .flags = CLK_SET_RATE_PARENT, 677 + .ops = &clk_rcg2_shared_ops, 678 + }, 679 + }; 680 + 681 + static const struct freq_tbl ftbl_cam_cc_cphy_rx_clk_src[] = { 682 + F(200000000, P_CAM_CC_PLL0_OUT_EVEN, 3, 0, 0), 683 + F(300000000, P_CAM_CC_PLL0_OUT_EVEN, 2, 0, 0), 684 + F(400000000, P_CAM_CC_PLL0_OUT_EVEN, 1.5, 0, 0), 685 + { } 686 + }; 687 + 688 + static struct clk_rcg2 cam_cc_cphy_rx_clk_src = { 689 + .cmd_rcgr = 0x1c05c, 690 + .mnd_width = 0, 691 + .hid_width = 5, 692 + .parent_map = cam_cc_parent_map_0, 693 + .freq_tbl = ftbl_cam_cc_cphy_rx_clk_src, 694 + .clkr.hw.init = &(const struct clk_init_data) { 695 + .name = "cam_cc_cphy_rx_clk_src", 696 + .parent_data = cam_cc_parent_data_0, 697 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 698 + .flags = CLK_SET_RATE_PARENT, 699 + .ops = &clk_rcg2_shared_ops, 700 + }, 701 + }; 702 + 703 + static const struct freq_tbl ftbl_cam_cc_cre_clk_src[] = { 704 + F(300000000, P_CAM_CC_PLL0_OUT_EVEN, 2, 0, 0), 705 + F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0), 706 + F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0), 707 + { } 708 + }; 709 + 710 + static struct clk_rcg2 cam_cc_cre_clk_src = { 711 + .cmd_rcgr = 0x27004, 712 + .mnd_width = 0, 713 + .hid_width = 5, 714 + .parent_map = cam_cc_parent_map_2, 715 + .freq_tbl = ftbl_cam_cc_cre_clk_src, 716 + .clkr.hw.init = &(const struct clk_init_data) { 717 + .name = "cam_cc_cre_clk_src", 718 + .parent_data = cam_cc_parent_data_2, 719 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_2), 720 + .flags = CLK_SET_RATE_PARENT, 721 + .ops = &clk_rcg2_shared_ops, 722 + }, 723 + }; 724 + 725 + static const struct freq_tbl ftbl_cam_cc_csi0phytimer_clk_src[] = { 726 + F(300000000, P_CAM_CC_PLL0_OUT_EVEN, 2, 0, 0), 727 + { } 728 + }; 729 + 730 + static struct clk_rcg2 cam_cc_csi0phytimer_clk_src = { 731 + .cmd_rcgr = 0x19004, 732 + .mnd_width = 0, 733 + .hid_width = 5, 734 + .parent_map = cam_cc_parent_map_0, 735 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 736 + .clkr.hw.init = &(const struct clk_init_data) { 737 + .name = "cam_cc_csi0phytimer_clk_src", 738 + .parent_data = cam_cc_parent_data_0, 739 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 740 + .flags = CLK_SET_RATE_PARENT, 741 + .ops = &clk_rcg2_shared_ops, 742 + }, 743 + }; 744 + 745 + static struct clk_rcg2 cam_cc_csi1phytimer_clk_src = { 746 + .cmd_rcgr = 0x19028, 747 + .mnd_width = 0, 748 + .hid_width = 5, 749 + .parent_map = cam_cc_parent_map_0, 750 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 751 + .clkr.hw.init = &(const struct clk_init_data) { 752 + .name = "cam_cc_csi1phytimer_clk_src", 753 + .parent_data = cam_cc_parent_data_0, 754 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 755 + .flags = CLK_SET_RATE_PARENT, 756 + .ops = &clk_rcg2_shared_ops, 757 + }, 758 + }; 759 + 760 + static struct clk_rcg2 cam_cc_csi2phytimer_clk_src = { 761 + .cmd_rcgr = 0x1904c, 762 + .mnd_width = 0, 763 + .hid_width = 5, 764 + .parent_map = cam_cc_parent_map_0, 765 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 766 + .clkr.hw.init = &(const struct clk_init_data) { 767 + .name = "cam_cc_csi2phytimer_clk_src", 768 + .parent_data = cam_cc_parent_data_0, 769 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 770 + .flags = CLK_SET_RATE_PARENT, 771 + .ops = &clk_rcg2_shared_ops, 772 + }, 773 + }; 774 + 775 + static struct clk_rcg2 cam_cc_csi3phytimer_clk_src = { 776 + .cmd_rcgr = 0x19070, 777 + .mnd_width = 0, 778 + .hid_width = 5, 779 + .parent_map = cam_cc_parent_map_0, 780 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 781 + .clkr.hw.init = &(const struct clk_init_data) { 782 + .name = "cam_cc_csi3phytimer_clk_src", 783 + .parent_data = cam_cc_parent_data_0, 784 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 785 + .flags = CLK_SET_RATE_PARENT, 786 + .ops = &clk_rcg2_shared_ops, 787 + }, 788 + }; 789 + 790 + static const struct freq_tbl ftbl_cam_cc_fast_ahb_clk_src[] = { 791 + F(100000000, P_CAM_CC_PLL0_OUT_EVEN, 6, 0, 0), 792 + F(150000000, P_CAM_CC_PLL0_OUT_EVEN, 4, 0, 0), 793 + F(200000000, P_CAM_CC_PLL0_OUT_MAIN, 6, 0, 0), 794 + F(240000000, P_CAM_CC_PLL0_OUT_MAIN, 5, 0, 0), 795 + { } 796 + }; 797 + 798 + static struct clk_rcg2 cam_cc_fast_ahb_clk_src = { 799 + .cmd_rcgr = 0x1a030, 800 + .mnd_width = 0, 801 + .hid_width = 5, 802 + .parent_map = cam_cc_parent_map_0, 803 + .freq_tbl = ftbl_cam_cc_fast_ahb_clk_src, 804 + .clkr.hw.init = &(const struct clk_init_data) { 805 + .name = "cam_cc_fast_ahb_clk_src", 806 + .parent_data = cam_cc_parent_data_0, 807 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 808 + .flags = CLK_SET_RATE_PARENT, 809 + .ops = &clk_rcg2_shared_ops, 810 + }, 811 + }; 812 + 813 + static const struct freq_tbl ftbl_cam_cc_icp_clk_src[] = { 814 + F(400000000, P_CAM_CC_PLL0_OUT_MAIN, 3, 0, 0), 815 + F(480000000, P_CAM_CC_PLL0_OUT_MAIN, 2.5, 0, 0), 816 + F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0), 817 + { } 818 + }; 819 + 820 + static struct clk_rcg2 cam_cc_icp_clk_src = { 821 + .cmd_rcgr = 0x20014, 822 + .mnd_width = 0, 823 + .hid_width = 5, 824 + .parent_map = cam_cc_parent_map_4, 825 + .freq_tbl = ftbl_cam_cc_icp_clk_src, 826 + .clkr.hw.init = &(const struct clk_init_data) { 827 + .name = "cam_cc_icp_clk_src", 828 + .parent_data = cam_cc_parent_data_4, 829 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_4), 830 + .flags = CLK_SET_RATE_PARENT, 831 + .ops = &clk_rcg2_shared_ops, 832 + }, 833 + }; 834 + 835 + static const struct freq_tbl ftbl_cam_cc_mclk0_clk_src[] = { 836 + F(19200000, P_CAM_CC_PLL2_OUT_MAIN, 1, 1, 50), 837 + F(24000000, P_CAM_CC_PLL2_OUT_MAIN, 10, 1, 4), 838 + F(64000000, P_CAM_CC_PLL2_OUT_MAIN, 15, 0, 0), 839 + { } 840 + }; 841 + 842 + static struct clk_rcg2 cam_cc_mclk0_clk_src = { 843 + .cmd_rcgr = 0x18004, 844 + .mnd_width = 8, 845 + .hid_width = 5, 846 + .parent_map = cam_cc_parent_map_1, 847 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 848 + .clkr.hw.init = &(const struct clk_init_data) { 849 + .name = "cam_cc_mclk0_clk_src", 850 + .parent_data = cam_cc_parent_data_1, 851 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 852 + .flags = CLK_SET_RATE_PARENT, 853 + .ops = &clk_rcg2_shared_ops, 854 + }, 855 + }; 856 + 857 + static struct clk_rcg2 cam_cc_mclk1_clk_src = { 858 + .cmd_rcgr = 0x18024, 859 + .mnd_width = 8, 860 + .hid_width = 5, 861 + .parent_map = cam_cc_parent_map_1, 862 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 863 + .clkr.hw.init = &(const struct clk_init_data) { 864 + .name = "cam_cc_mclk1_clk_src", 865 + .parent_data = cam_cc_parent_data_1, 866 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 867 + .flags = CLK_SET_RATE_PARENT, 868 + .ops = &clk_rcg2_shared_ops, 869 + }, 870 + }; 871 + 872 + static struct clk_rcg2 cam_cc_mclk2_clk_src = { 873 + .cmd_rcgr = 0x18044, 874 + .mnd_width = 8, 875 + .hid_width = 5, 876 + .parent_map = cam_cc_parent_map_1, 877 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 878 + .clkr.hw.init = &(const struct clk_init_data) { 879 + .name = "cam_cc_mclk2_clk_src", 880 + .parent_data = cam_cc_parent_data_1, 881 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 882 + .flags = CLK_SET_RATE_PARENT, 883 + .ops = &clk_rcg2_shared_ops, 884 + }, 885 + }; 886 + 887 + static struct clk_rcg2 cam_cc_mclk3_clk_src = { 888 + .cmd_rcgr = 0x18064, 889 + .mnd_width = 8, 890 + .hid_width = 5, 891 + .parent_map = cam_cc_parent_map_1, 892 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 893 + .clkr.hw.init = &(const struct clk_init_data) { 894 + .name = "cam_cc_mclk3_clk_src", 895 + .parent_data = cam_cc_parent_data_1, 896 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 897 + .flags = CLK_SET_RATE_PARENT, 898 + .ops = &clk_rcg2_shared_ops, 899 + }, 900 + }; 901 + 902 + static struct clk_rcg2 cam_cc_mclk4_clk_src = { 903 + .cmd_rcgr = 0x18084, 904 + .mnd_width = 8, 905 + .hid_width = 5, 906 + .parent_map = cam_cc_parent_map_1, 907 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 908 + .clkr.hw.init = &(const struct clk_init_data) { 909 + .name = "cam_cc_mclk4_clk_src", 910 + .parent_data = cam_cc_parent_data_1, 911 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 912 + .flags = CLK_SET_RATE_PARENT, 913 + .ops = &clk_rcg2_shared_ops, 914 + }, 915 + }; 916 + 917 + static const struct freq_tbl ftbl_cam_cc_ope_0_clk_src[] = { 918 + F(300000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0), 919 + F(410000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0), 920 + F(520000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0), 921 + F(645000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0), 922 + F(700000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0), 923 + { } 924 + }; 925 + 926 + static struct clk_rcg2 cam_cc_ope_0_clk_src = { 927 + .cmd_rcgr = 0x1b004, 928 + .mnd_width = 0, 929 + .hid_width = 5, 930 + .parent_map = cam_cc_parent_map_5, 931 + .freq_tbl = ftbl_cam_cc_ope_0_clk_src, 932 + .clkr.hw.init = &(const struct clk_init_data) { 933 + .name = "cam_cc_ope_0_clk_src", 934 + .parent_data = cam_cc_parent_data_5, 935 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_5), 936 + .flags = CLK_SET_RATE_PARENT, 937 + .ops = &clk_rcg2_shared_ops, 938 + }, 939 + }; 940 + 941 + static const struct freq_tbl ftbl_cam_cc_sleep_clk_src[] = { 942 + F(32000, P_SLEEP_CLK, 1, 0, 0), 943 + { } 944 + }; 945 + 946 + static struct clk_rcg2 cam_cc_sleep_clk_src = { 947 + .cmd_rcgr = 0x25044, 948 + .mnd_width = 0, 949 + .hid_width = 5, 950 + .parent_map = cam_cc_parent_map_6, 951 + .freq_tbl = ftbl_cam_cc_sleep_clk_src, 952 + .clkr.hw.init = &(const struct clk_init_data) { 953 + .name = "cam_cc_sleep_clk_src", 954 + .parent_data = cam_cc_parent_data_6_ao, 955 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_6_ao), 956 + .flags = CLK_SET_RATE_PARENT, 957 + .ops = &clk_rcg2_ops, 958 + }, 959 + }; 960 + 961 + static const struct freq_tbl ftbl_cam_cc_slow_ahb_clk_src[] = { 962 + F(80000000, P_CAM_CC_PLL0_OUT_EVEN, 7.5, 0, 0), 963 + { } 964 + }; 965 + 966 + static struct clk_rcg2 cam_cc_slow_ahb_clk_src = { 967 + .cmd_rcgr = 0x1a04c, 968 + .mnd_width = 0, 969 + .hid_width = 5, 970 + .parent_map = cam_cc_parent_map_0, 971 + .freq_tbl = ftbl_cam_cc_slow_ahb_clk_src, 972 + .clkr.hw.init = &(const struct clk_init_data) { 973 + .name = "cam_cc_slow_ahb_clk_src", 974 + .parent_data = cam_cc_parent_data_0, 975 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 976 + .flags = CLK_SET_RATE_PARENT, 977 + .ops = &clk_rcg2_shared_ops, 978 + }, 979 + }; 980 + 981 + static const struct freq_tbl ftbl_cam_cc_tfe_0_clk_src[] = { 982 + F(350000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0), 983 + F(570000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0), 984 + F(600000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0), 985 + F(725000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0), 986 + { } 987 + }; 988 + 989 + static struct clk_rcg2 cam_cc_tfe_0_clk_src = { 990 + .cmd_rcgr = 0x1c004, 991 + .mnd_width = 0, 992 + .hid_width = 5, 993 + .parent_map = cam_cc_parent_map_7, 994 + .freq_tbl = ftbl_cam_cc_tfe_0_clk_src, 995 + .clkr.hw.init = &(const struct clk_init_data) { 996 + .name = "cam_cc_tfe_0_clk_src", 997 + .parent_data = cam_cc_parent_data_7, 998 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_7), 999 + .flags = CLK_SET_RATE_PARENT, 1000 + .ops = &clk_rcg2_shared_ops, 1001 + }, 1002 + }; 1003 + 1004 + static struct clk_rcg2 cam_cc_tfe_0_csid_clk_src = { 1005 + .cmd_rcgr = 0x1c030, 1006 + .mnd_width = 0, 1007 + .hid_width = 5, 1008 + .parent_map = cam_cc_parent_map_0, 1009 + .freq_tbl = ftbl_cam_cc_cphy_rx_clk_src, 1010 + .clkr.hw.init = &(const struct clk_init_data) { 1011 + .name = "cam_cc_tfe_0_csid_clk_src", 1012 + .parent_data = cam_cc_parent_data_0, 1013 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 1014 + .flags = CLK_SET_RATE_PARENT, 1015 + .ops = &clk_rcg2_shared_ops, 1016 + }, 1017 + }; 1018 + 1019 + static const struct freq_tbl ftbl_cam_cc_tfe_1_clk_src[] = { 1020 + F(350000000, P_CAM_CC_PLL5_OUT_EVEN, 1, 0, 0), 1021 + F(570000000, P_CAM_CC_PLL5_OUT_EVEN, 1, 0, 0), 1022 + F(600000000, P_CAM_CC_PLL5_OUT_EVEN, 1, 0, 0), 1023 + F(725000000, P_CAM_CC_PLL5_OUT_EVEN, 1, 0, 0), 1024 + { } 1025 + }; 1026 + 1027 + static struct clk_rcg2 cam_cc_tfe_1_clk_src = { 1028 + .cmd_rcgr = 0x1d004, 1029 + .mnd_width = 0, 1030 + .hid_width = 5, 1031 + .parent_map = cam_cc_parent_map_8, 1032 + .freq_tbl = ftbl_cam_cc_tfe_1_clk_src, 1033 + .clkr.hw.init = &(const struct clk_init_data) { 1034 + .name = "cam_cc_tfe_1_clk_src", 1035 + .parent_data = cam_cc_parent_data_8, 1036 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_8), 1037 + .flags = CLK_SET_RATE_PARENT, 1038 + .ops = &clk_rcg2_shared_ops, 1039 + }, 1040 + }; 1041 + 1042 + static struct clk_rcg2 cam_cc_tfe_1_csid_clk_src = { 1043 + .cmd_rcgr = 0x1d030, 1044 + .mnd_width = 0, 1045 + .hid_width = 5, 1046 + .parent_map = cam_cc_parent_map_0, 1047 + .freq_tbl = ftbl_cam_cc_cphy_rx_clk_src, 1048 + .clkr.hw.init = &(const struct clk_init_data) { 1049 + .name = "cam_cc_tfe_1_csid_clk_src", 1050 + .parent_data = cam_cc_parent_data_0, 1051 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 1052 + .flags = CLK_SET_RATE_PARENT, 1053 + .ops = &clk_rcg2_shared_ops, 1054 + }, 1055 + }; 1056 + 1057 + static const struct freq_tbl ftbl_cam_cc_tfe_2_clk_src[] = { 1058 + F(350000000, P_CAM_CC_PLL6_OUT_EVEN, 1, 0, 0), 1059 + F(570000000, P_CAM_CC_PLL6_OUT_EVEN, 1, 0, 0), 1060 + F(600000000, P_CAM_CC_PLL6_OUT_EVEN, 1, 0, 0), 1061 + F(725000000, P_CAM_CC_PLL6_OUT_EVEN, 1, 0, 0), 1062 + { } 1063 + }; 1064 + 1065 + static struct clk_rcg2 cam_cc_tfe_2_clk_src = { 1066 + .cmd_rcgr = 0x1e004, 1067 + .mnd_width = 0, 1068 + .hid_width = 5, 1069 + .parent_map = cam_cc_parent_map_9, 1070 + .freq_tbl = ftbl_cam_cc_tfe_2_clk_src, 1071 + .clkr.hw.init = &(const struct clk_init_data) { 1072 + .name = "cam_cc_tfe_2_clk_src", 1073 + .parent_data = cam_cc_parent_data_9, 1074 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_9), 1075 + .flags = CLK_SET_RATE_PARENT, 1076 + .ops = &clk_rcg2_shared_ops, 1077 + }, 1078 + }; 1079 + 1080 + static struct clk_rcg2 cam_cc_tfe_2_csid_clk_src = { 1081 + .cmd_rcgr = 0x1e030, 1082 + .mnd_width = 0, 1083 + .hid_width = 5, 1084 + .parent_map = cam_cc_parent_map_0, 1085 + .freq_tbl = ftbl_cam_cc_cphy_rx_clk_src, 1086 + .clkr.hw.init = &(const struct clk_init_data) { 1087 + .name = "cam_cc_tfe_2_csid_clk_src", 1088 + .parent_data = cam_cc_parent_data_0, 1089 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 1090 + .flags = CLK_SET_RATE_PARENT, 1091 + .ops = &clk_rcg2_shared_ops, 1092 + }, 1093 + }; 1094 + 1095 + static const struct freq_tbl ftbl_cam_cc_xo_clk_src[] = { 1096 + F(19200000, P_BI_TCXO, 1, 0, 0), 1097 + { } 1098 + }; 1099 + 1100 + static struct clk_rcg2 cam_cc_xo_clk_src = { 1101 + .cmd_rcgr = 0x25020, 1102 + .mnd_width = 0, 1103 + .hid_width = 5, 1104 + .parent_map = cam_cc_parent_map_10, 1105 + .freq_tbl = ftbl_cam_cc_xo_clk_src, 1106 + .clkr.hw.init = &(const struct clk_init_data) { 1107 + .name = "cam_cc_xo_clk_src", 1108 + .parent_data = cam_cc_parent_data_10, 1109 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_10), 1110 + .flags = CLK_SET_RATE_PARENT, 1111 + .ops = &clk_rcg2_ops, 1112 + }, 1113 + }; 1114 + 1115 + static struct clk_branch cam_cc_bps_ahb_clk = { 1116 + .halt_reg = 0x1a064, 1117 + .halt_check = BRANCH_HALT, 1118 + .clkr = { 1119 + .enable_reg = 0x1a064, 1120 + .enable_mask = BIT(0), 1121 + .hw.init = &(const struct clk_init_data) { 1122 + .name = "cam_cc_bps_ahb_clk", 1123 + .parent_hws = (const struct clk_hw*[]) { 1124 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1125 + }, 1126 + .num_parents = 1, 1127 + .flags = CLK_SET_RATE_PARENT, 1128 + .ops = &clk_branch2_ops, 1129 + }, 1130 + }, 1131 + }; 1132 + 1133 + static struct clk_branch cam_cc_bps_areg_clk = { 1134 + .halt_reg = 0x1a048, 1135 + .halt_check = BRANCH_HALT, 1136 + .clkr = { 1137 + .enable_reg = 0x1a048, 1138 + .enable_mask = BIT(0), 1139 + .hw.init = &(const struct clk_init_data) { 1140 + .name = "cam_cc_bps_areg_clk", 1141 + .parent_hws = (const struct clk_hw*[]) { 1142 + &cam_cc_fast_ahb_clk_src.clkr.hw, 1143 + }, 1144 + .num_parents = 1, 1145 + .flags = CLK_SET_RATE_PARENT, 1146 + .ops = &clk_branch2_ops, 1147 + }, 1148 + }, 1149 + }; 1150 + 1151 + static struct clk_branch cam_cc_bps_clk = { 1152 + .halt_reg = 0x1a01c, 1153 + .halt_check = BRANCH_HALT, 1154 + .clkr = { 1155 + .enable_reg = 0x1a01c, 1156 + .enable_mask = BIT(0), 1157 + .hw.init = &(const struct clk_init_data) { 1158 + .name = "cam_cc_bps_clk", 1159 + .parent_hws = (const struct clk_hw*[]) { 1160 + &cam_cc_bps_clk_src.clkr.hw, 1161 + }, 1162 + .num_parents = 1, 1163 + .flags = CLK_SET_RATE_PARENT, 1164 + .ops = &clk_branch2_ops, 1165 + }, 1166 + }, 1167 + }; 1168 + 1169 + static struct clk_branch cam_cc_camnoc_atb_clk = { 1170 + .halt_reg = 0x24040, 1171 + .halt_check = BRANCH_HALT, 1172 + .clkr = { 1173 + .enable_reg = 0x24040, 1174 + .enable_mask = BIT(0), 1175 + .hw.init = &(const struct clk_init_data) { 1176 + .name = "cam_cc_camnoc_atb_clk", 1177 + .ops = &clk_branch2_ops, 1178 + }, 1179 + }, 1180 + }; 1181 + 1182 + static struct clk_branch cam_cc_camnoc_axi_hf_clk = { 1183 + .halt_reg = 0x24010, 1184 + .halt_check = BRANCH_HALT, 1185 + .clkr = { 1186 + .enable_reg = 0x24010, 1187 + .enable_mask = BIT(0), 1188 + .hw.init = &(const struct clk_init_data) { 1189 + .name = "cam_cc_camnoc_axi_hf_clk", 1190 + .ops = &clk_branch2_ops, 1191 + }, 1192 + }, 1193 + }; 1194 + 1195 + static struct clk_branch cam_cc_camnoc_axi_sf_clk = { 1196 + .halt_reg = 0x24004, 1197 + .halt_check = BRANCH_HALT, 1198 + .clkr = { 1199 + .enable_reg = 0x24004, 1200 + .enable_mask = BIT(0), 1201 + .hw.init = &(const struct clk_init_data) { 1202 + .name = "cam_cc_camnoc_axi_sf_clk", 1203 + .ops = &clk_branch2_ops, 1204 + }, 1205 + }, 1206 + }; 1207 + 1208 + static struct clk_branch cam_cc_camnoc_nrt_axi_clk = { 1209 + .halt_reg = 0x2404c, 1210 + .halt_check = BRANCH_HALT_VOTED, 1211 + .hwcg_reg = 0x2404c, 1212 + .hwcg_bit = 1, 1213 + .clkr = { 1214 + .enable_reg = 0x2404c, 1215 + .enable_mask = BIT(0), 1216 + .hw.init = &(const struct clk_init_data) { 1217 + .name = "cam_cc_camnoc_nrt_axi_clk", 1218 + .parent_hws = (const struct clk_hw*[]) { 1219 + &cam_cc_camnoc_axi_clk_src.clkr.hw, 1220 + }, 1221 + .num_parents = 1, 1222 + .flags = CLK_SET_RATE_PARENT, 1223 + .ops = &clk_branch2_ops, 1224 + }, 1225 + }, 1226 + }; 1227 + 1228 + static struct clk_branch cam_cc_camnoc_rt_axi_clk = { 1229 + .halt_reg = 0x24034, 1230 + .halt_check = BRANCH_HALT, 1231 + .clkr = { 1232 + .enable_reg = 0x24034, 1233 + .enable_mask = BIT(0), 1234 + .hw.init = &(const struct clk_init_data) { 1235 + .name = "cam_cc_camnoc_rt_axi_clk", 1236 + .parent_hws = (const struct clk_hw*[]) { 1237 + &cam_cc_camnoc_axi_clk_src.clkr.hw, 1238 + }, 1239 + .num_parents = 1, 1240 + .flags = CLK_SET_RATE_PARENT, 1241 + .ops = &clk_branch2_ops, 1242 + }, 1243 + }, 1244 + }; 1245 + 1246 + static struct clk_branch cam_cc_cci_0_clk = { 1247 + .halt_reg = 0x2101c, 1248 + .halt_check = BRANCH_HALT, 1249 + .clkr = { 1250 + .enable_reg = 0x2101c, 1251 + .enable_mask = BIT(0), 1252 + .hw.init = &(const struct clk_init_data) { 1253 + .name = "cam_cc_cci_0_clk", 1254 + .parent_hws = (const struct clk_hw*[]) { 1255 + &cam_cc_cci_0_clk_src.clkr.hw, 1256 + }, 1257 + .num_parents = 1, 1258 + .flags = CLK_SET_RATE_PARENT, 1259 + .ops = &clk_branch2_ops, 1260 + }, 1261 + }, 1262 + }; 1263 + 1264 + static struct clk_branch cam_cc_cci_1_clk = { 1265 + .halt_reg = 0x2201c, 1266 + .halt_check = BRANCH_HALT, 1267 + .clkr = { 1268 + .enable_reg = 0x2201c, 1269 + .enable_mask = BIT(0), 1270 + .hw.init = &(const struct clk_init_data) { 1271 + .name = "cam_cc_cci_1_clk", 1272 + .parent_hws = (const struct clk_hw*[]) { 1273 + &cam_cc_cci_1_clk_src.clkr.hw, 1274 + }, 1275 + .num_parents = 1, 1276 + .flags = CLK_SET_RATE_PARENT, 1277 + .ops = &clk_branch2_ops, 1278 + }, 1279 + }, 1280 + }; 1281 + 1282 + static struct clk_branch cam_cc_core_ahb_clk = { 1283 + .halt_reg = 0x2501c, 1284 + .halt_check = BRANCH_HALT_DELAY, 1285 + .clkr = { 1286 + .enable_reg = 0x2501c, 1287 + .enable_mask = BIT(0), 1288 + .hw.init = &(const struct clk_init_data) { 1289 + .name = "cam_cc_core_ahb_clk", 1290 + .parent_hws = (const struct clk_hw*[]) { 1291 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1292 + }, 1293 + .num_parents = 1, 1294 + .flags = CLK_SET_RATE_PARENT, 1295 + .ops = &clk_branch2_ops, 1296 + }, 1297 + }, 1298 + }; 1299 + 1300 + static struct clk_branch cam_cc_cpas_ahb_clk = { 1301 + .halt_reg = 0x23004, 1302 + .halt_check = BRANCH_HALT, 1303 + .clkr = { 1304 + .enable_reg = 0x23004, 1305 + .enable_mask = BIT(0), 1306 + .hw.init = &(const struct clk_init_data) { 1307 + .name = "cam_cc_cpas_ahb_clk", 1308 + .parent_hws = (const struct clk_hw*[]) { 1309 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1310 + }, 1311 + .num_parents = 1, 1312 + .flags = CLK_SET_RATE_PARENT, 1313 + .ops = &clk_branch2_ops, 1314 + }, 1315 + }, 1316 + }; 1317 + 1318 + static struct clk_branch cam_cc_cre_ahb_clk = { 1319 + .halt_reg = 0x27020, 1320 + .halt_check = BRANCH_HALT, 1321 + .clkr = { 1322 + .enable_reg = 0x27020, 1323 + .enable_mask = BIT(0), 1324 + .hw.init = &(const struct clk_init_data) { 1325 + .name = "cam_cc_cre_ahb_clk", 1326 + .parent_hws = (const struct clk_hw*[]) { 1327 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1328 + }, 1329 + .num_parents = 1, 1330 + .flags = CLK_SET_RATE_PARENT, 1331 + .ops = &clk_branch2_ops, 1332 + }, 1333 + }, 1334 + }; 1335 + 1336 + static struct clk_branch cam_cc_cre_clk = { 1337 + .halt_reg = 0x2701c, 1338 + .halt_check = BRANCH_HALT, 1339 + .clkr = { 1340 + .enable_reg = 0x2701c, 1341 + .enable_mask = BIT(0), 1342 + .hw.init = &(const struct clk_init_data) { 1343 + .name = "cam_cc_cre_clk", 1344 + .parent_hws = (const struct clk_hw*[]) { 1345 + &cam_cc_cre_clk_src.clkr.hw, 1346 + }, 1347 + .num_parents = 1, 1348 + .flags = CLK_SET_RATE_PARENT, 1349 + .ops = &clk_branch2_ops, 1350 + }, 1351 + }, 1352 + }; 1353 + 1354 + static struct clk_branch cam_cc_csi0phytimer_clk = { 1355 + .halt_reg = 0x1901c, 1356 + .halt_check = BRANCH_HALT, 1357 + .clkr = { 1358 + .enable_reg = 0x1901c, 1359 + .enable_mask = BIT(0), 1360 + .hw.init = &(const struct clk_init_data) { 1361 + .name = "cam_cc_csi0phytimer_clk", 1362 + .parent_hws = (const struct clk_hw*[]) { 1363 + &cam_cc_csi0phytimer_clk_src.clkr.hw, 1364 + }, 1365 + .num_parents = 1, 1366 + .flags = CLK_SET_RATE_PARENT, 1367 + .ops = &clk_branch2_ops, 1368 + }, 1369 + }, 1370 + }; 1371 + 1372 + static struct clk_branch cam_cc_csi1phytimer_clk = { 1373 + .halt_reg = 0x19040, 1374 + .halt_check = BRANCH_HALT, 1375 + .clkr = { 1376 + .enable_reg = 0x19040, 1377 + .enable_mask = BIT(0), 1378 + .hw.init = &(const struct clk_init_data) { 1379 + .name = "cam_cc_csi1phytimer_clk", 1380 + .parent_hws = (const struct clk_hw*[]) { 1381 + &cam_cc_csi1phytimer_clk_src.clkr.hw, 1382 + }, 1383 + .num_parents = 1, 1384 + .flags = CLK_SET_RATE_PARENT, 1385 + .ops = &clk_branch2_ops, 1386 + }, 1387 + }, 1388 + }; 1389 + 1390 + static struct clk_branch cam_cc_csi2phytimer_clk = { 1391 + .halt_reg = 0x19064, 1392 + .halt_check = BRANCH_HALT, 1393 + .clkr = { 1394 + .enable_reg = 0x19064, 1395 + .enable_mask = BIT(0), 1396 + .hw.init = &(const struct clk_init_data) { 1397 + .name = "cam_cc_csi2phytimer_clk", 1398 + .parent_hws = (const struct clk_hw*[]) { 1399 + &cam_cc_csi2phytimer_clk_src.clkr.hw, 1400 + }, 1401 + .num_parents = 1, 1402 + .flags = CLK_SET_RATE_PARENT, 1403 + .ops = &clk_branch2_ops, 1404 + }, 1405 + }, 1406 + }; 1407 + 1408 + static struct clk_branch cam_cc_csi3phytimer_clk = { 1409 + .halt_reg = 0x19088, 1410 + .halt_check = BRANCH_HALT, 1411 + .clkr = { 1412 + .enable_reg = 0x19088, 1413 + .enable_mask = BIT(0), 1414 + .hw.init = &(const struct clk_init_data) { 1415 + .name = "cam_cc_csi3phytimer_clk", 1416 + .parent_hws = (const struct clk_hw*[]) { 1417 + &cam_cc_csi3phytimer_clk_src.clkr.hw, 1418 + }, 1419 + .num_parents = 1, 1420 + .flags = CLK_SET_RATE_PARENT, 1421 + .ops = &clk_branch2_ops, 1422 + }, 1423 + }, 1424 + }; 1425 + 1426 + static struct clk_branch cam_cc_csiphy0_clk = { 1427 + .halt_reg = 0x19020, 1428 + .halt_check = BRANCH_HALT, 1429 + .clkr = { 1430 + .enable_reg = 0x19020, 1431 + .enable_mask = BIT(0), 1432 + .hw.init = &(const struct clk_init_data) { 1433 + .name = "cam_cc_csiphy0_clk", 1434 + .parent_hws = (const struct clk_hw*[]) { 1435 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1436 + }, 1437 + .num_parents = 1, 1438 + .flags = CLK_SET_RATE_PARENT, 1439 + .ops = &clk_branch2_ops, 1440 + }, 1441 + }, 1442 + }; 1443 + 1444 + static struct clk_branch cam_cc_csiphy1_clk = { 1445 + .halt_reg = 0x19044, 1446 + .halt_check = BRANCH_HALT, 1447 + .clkr = { 1448 + .enable_reg = 0x19044, 1449 + .enable_mask = BIT(0), 1450 + .hw.init = &(const struct clk_init_data) { 1451 + .name = "cam_cc_csiphy1_clk", 1452 + .parent_hws = (const struct clk_hw*[]) { 1453 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1454 + }, 1455 + .num_parents = 1, 1456 + .flags = CLK_SET_RATE_PARENT, 1457 + .ops = &clk_branch2_ops, 1458 + }, 1459 + }, 1460 + }; 1461 + 1462 + static struct clk_branch cam_cc_csiphy2_clk = { 1463 + .halt_reg = 0x19068, 1464 + .halt_check = BRANCH_HALT, 1465 + .clkr = { 1466 + .enable_reg = 0x19068, 1467 + .enable_mask = BIT(0), 1468 + .hw.init = &(const struct clk_init_data) { 1469 + .name = "cam_cc_csiphy2_clk", 1470 + .parent_hws = (const struct clk_hw*[]) { 1471 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1472 + }, 1473 + .num_parents = 1, 1474 + .flags = CLK_SET_RATE_PARENT, 1475 + .ops = &clk_branch2_ops, 1476 + }, 1477 + }, 1478 + }; 1479 + 1480 + static struct clk_branch cam_cc_csiphy3_clk = { 1481 + .halt_reg = 0x1908c, 1482 + .halt_check = BRANCH_HALT, 1483 + .clkr = { 1484 + .enable_reg = 0x1908c, 1485 + .enable_mask = BIT(0), 1486 + .hw.init = &(const struct clk_init_data) { 1487 + .name = "cam_cc_csiphy3_clk", 1488 + .parent_hws = (const struct clk_hw*[]) { 1489 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1490 + }, 1491 + .num_parents = 1, 1492 + .flags = CLK_SET_RATE_PARENT, 1493 + .ops = &clk_branch2_ops, 1494 + }, 1495 + }, 1496 + }; 1497 + 1498 + static struct clk_branch cam_cc_icp_atb_clk = { 1499 + .halt_reg = 0x20004, 1500 + .halt_check = BRANCH_HALT, 1501 + .clkr = { 1502 + .enable_reg = 0x20004, 1503 + .enable_mask = BIT(0), 1504 + .hw.init = &(const struct clk_init_data) { 1505 + .name = "cam_cc_icp_atb_clk", 1506 + .ops = &clk_branch2_ops, 1507 + }, 1508 + }, 1509 + }; 1510 + 1511 + static struct clk_branch cam_cc_icp_clk = { 1512 + .halt_reg = 0x2002c, 1513 + .halt_check = BRANCH_HALT, 1514 + .clkr = { 1515 + .enable_reg = 0x2002c, 1516 + .enable_mask = BIT(0), 1517 + .hw.init = &(const struct clk_init_data) { 1518 + .name = "cam_cc_icp_clk", 1519 + .parent_hws = (const struct clk_hw*[]) { 1520 + &cam_cc_icp_clk_src.clkr.hw, 1521 + }, 1522 + .num_parents = 1, 1523 + .flags = CLK_SET_RATE_PARENT, 1524 + .ops = &clk_branch2_ops, 1525 + }, 1526 + }, 1527 + }; 1528 + 1529 + static struct clk_branch cam_cc_icp_cti_clk = { 1530 + .halt_reg = 0x20008, 1531 + .halt_check = BRANCH_HALT, 1532 + .clkr = { 1533 + .enable_reg = 0x20008, 1534 + .enable_mask = BIT(0), 1535 + .hw.init = &(const struct clk_init_data) { 1536 + .name = "cam_cc_icp_cti_clk", 1537 + .ops = &clk_branch2_ops, 1538 + }, 1539 + }, 1540 + }; 1541 + 1542 + static struct clk_branch cam_cc_icp_ts_clk = { 1543 + .halt_reg = 0x2000c, 1544 + .halt_check = BRANCH_HALT, 1545 + .clkr = { 1546 + .enable_reg = 0x2000c, 1547 + .enable_mask = BIT(0), 1548 + .hw.init = &(const struct clk_init_data) { 1549 + .name = "cam_cc_icp_ts_clk", 1550 + .ops = &clk_branch2_ops, 1551 + }, 1552 + }, 1553 + }; 1554 + 1555 + static struct clk_branch cam_cc_mclk0_clk = { 1556 + .halt_reg = 0x1801c, 1557 + .halt_check = BRANCH_HALT, 1558 + .clkr = { 1559 + .enable_reg = 0x1801c, 1560 + .enable_mask = BIT(0), 1561 + .hw.init = &(const struct clk_init_data) { 1562 + .name = "cam_cc_mclk0_clk", 1563 + .parent_hws = (const struct clk_hw*[]) { 1564 + &cam_cc_mclk0_clk_src.clkr.hw, 1565 + }, 1566 + .num_parents = 1, 1567 + .flags = CLK_SET_RATE_PARENT, 1568 + .ops = &clk_branch2_ops, 1569 + }, 1570 + }, 1571 + }; 1572 + 1573 + static struct clk_branch cam_cc_mclk1_clk = { 1574 + .halt_reg = 0x1803c, 1575 + .halt_check = BRANCH_HALT, 1576 + .clkr = { 1577 + .enable_reg = 0x1803c, 1578 + .enable_mask = BIT(0), 1579 + .hw.init = &(const struct clk_init_data) { 1580 + .name = "cam_cc_mclk1_clk", 1581 + .parent_hws = (const struct clk_hw*[]) { 1582 + &cam_cc_mclk1_clk_src.clkr.hw, 1583 + }, 1584 + .num_parents = 1, 1585 + .flags = CLK_SET_RATE_PARENT, 1586 + .ops = &clk_branch2_ops, 1587 + }, 1588 + }, 1589 + }; 1590 + 1591 + static struct clk_branch cam_cc_mclk2_clk = { 1592 + .halt_reg = 0x1805c, 1593 + .halt_check = BRANCH_HALT, 1594 + .clkr = { 1595 + .enable_reg = 0x1805c, 1596 + .enable_mask = BIT(0), 1597 + .hw.init = &(const struct clk_init_data) { 1598 + .name = "cam_cc_mclk2_clk", 1599 + .parent_hws = (const struct clk_hw*[]) { 1600 + &cam_cc_mclk2_clk_src.clkr.hw, 1601 + }, 1602 + .num_parents = 1, 1603 + .flags = CLK_SET_RATE_PARENT, 1604 + .ops = &clk_branch2_ops, 1605 + }, 1606 + }, 1607 + }; 1608 + 1609 + static struct clk_branch cam_cc_mclk3_clk = { 1610 + .halt_reg = 0x1807c, 1611 + .halt_check = BRANCH_HALT, 1612 + .clkr = { 1613 + .enable_reg = 0x1807c, 1614 + .enable_mask = BIT(0), 1615 + .hw.init = &(const struct clk_init_data) { 1616 + .name = "cam_cc_mclk3_clk", 1617 + .parent_hws = (const struct clk_hw*[]) { 1618 + &cam_cc_mclk3_clk_src.clkr.hw, 1619 + }, 1620 + .num_parents = 1, 1621 + .flags = CLK_SET_RATE_PARENT, 1622 + .ops = &clk_branch2_ops, 1623 + }, 1624 + }, 1625 + }; 1626 + 1627 + static struct clk_branch cam_cc_mclk4_clk = { 1628 + .halt_reg = 0x1809c, 1629 + .halt_check = BRANCH_HALT, 1630 + .clkr = { 1631 + .enable_reg = 0x1809c, 1632 + .enable_mask = BIT(0), 1633 + .hw.init = &(const struct clk_init_data) { 1634 + .name = "cam_cc_mclk4_clk", 1635 + .parent_hws = (const struct clk_hw*[]) { 1636 + &cam_cc_mclk4_clk_src.clkr.hw, 1637 + }, 1638 + .num_parents = 1, 1639 + .flags = CLK_SET_RATE_PARENT, 1640 + .ops = &clk_branch2_ops, 1641 + }, 1642 + }, 1643 + }; 1644 + 1645 + static struct clk_branch cam_cc_ope_0_ahb_clk = { 1646 + .halt_reg = 0x1b034, 1647 + .halt_check = BRANCH_HALT, 1648 + .clkr = { 1649 + .enable_reg = 0x1b034, 1650 + .enable_mask = BIT(0), 1651 + .hw.init = &(const struct clk_init_data) { 1652 + .name = "cam_cc_ope_0_ahb_clk", 1653 + .parent_hws = (const struct clk_hw*[]) { 1654 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1655 + }, 1656 + .num_parents = 1, 1657 + .flags = CLK_SET_RATE_PARENT, 1658 + .ops = &clk_branch2_ops, 1659 + }, 1660 + }, 1661 + }; 1662 + 1663 + static struct clk_branch cam_cc_ope_0_areg_clk = { 1664 + .halt_reg = 0x1b030, 1665 + .halt_check = BRANCH_HALT, 1666 + .clkr = { 1667 + .enable_reg = 0x1b030, 1668 + .enable_mask = BIT(0), 1669 + .hw.init = &(const struct clk_init_data) { 1670 + .name = "cam_cc_ope_0_areg_clk", 1671 + .parent_hws = (const struct clk_hw*[]) { 1672 + &cam_cc_fast_ahb_clk_src.clkr.hw, 1673 + }, 1674 + .num_parents = 1, 1675 + .flags = CLK_SET_RATE_PARENT, 1676 + .ops = &clk_branch2_ops, 1677 + }, 1678 + }, 1679 + }; 1680 + 1681 + static struct clk_branch cam_cc_ope_0_clk = { 1682 + .halt_reg = 0x1b01c, 1683 + .halt_check = BRANCH_HALT, 1684 + .clkr = { 1685 + .enable_reg = 0x1b01c, 1686 + .enable_mask = BIT(0), 1687 + .hw.init = &(const struct clk_init_data) { 1688 + .name = "cam_cc_ope_0_clk", 1689 + .parent_hws = (const struct clk_hw*[]) { 1690 + &cam_cc_ope_0_clk_src.clkr.hw, 1691 + }, 1692 + .num_parents = 1, 1693 + .flags = CLK_SET_RATE_PARENT, 1694 + .ops = &clk_branch2_ops, 1695 + }, 1696 + }, 1697 + }; 1698 + 1699 + static struct clk_branch cam_cc_soc_ahb_clk = { 1700 + .halt_reg = 0x25018, 1701 + .halt_check = BRANCH_HALT, 1702 + .clkr = { 1703 + .enable_reg = 0x25018, 1704 + .enable_mask = BIT(0), 1705 + .hw.init = &(const struct clk_init_data) { 1706 + .name = "cam_cc_soc_ahb_clk", 1707 + .ops = &clk_branch2_ops, 1708 + }, 1709 + }, 1710 + }; 1711 + 1712 + static struct clk_branch cam_cc_sys_tmr_clk = { 1713 + .halt_reg = 0x20038, 1714 + .halt_check = BRANCH_HALT, 1715 + .clkr = { 1716 + .enable_reg = 0x20038, 1717 + .enable_mask = BIT(0), 1718 + .hw.init = &(const struct clk_init_data) { 1719 + .name = "cam_cc_sys_tmr_clk", 1720 + .parent_hws = (const struct clk_hw*[]) { 1721 + &cam_cc_xo_clk_src.clkr.hw, 1722 + }, 1723 + .num_parents = 1, 1724 + .flags = CLK_SET_RATE_PARENT, 1725 + .ops = &clk_branch2_ops, 1726 + }, 1727 + }, 1728 + }; 1729 + 1730 + static struct clk_branch cam_cc_tfe_0_ahb_clk = { 1731 + .halt_reg = 0x1c078, 1732 + .halt_check = BRANCH_HALT, 1733 + .clkr = { 1734 + .enable_reg = 0x1c078, 1735 + .enable_mask = BIT(0), 1736 + .hw.init = &(const struct clk_init_data) { 1737 + .name = "cam_cc_tfe_0_ahb_clk", 1738 + .parent_hws = (const struct clk_hw*[]) { 1739 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1740 + }, 1741 + .num_parents = 1, 1742 + .flags = CLK_SET_RATE_PARENT, 1743 + .ops = &clk_branch2_ops, 1744 + }, 1745 + }, 1746 + }; 1747 + 1748 + static struct clk_branch cam_cc_tfe_0_clk = { 1749 + .halt_reg = 0x1c01c, 1750 + .halt_check = BRANCH_HALT, 1751 + .clkr = { 1752 + .enable_reg = 0x1c01c, 1753 + .enable_mask = BIT(0), 1754 + .hw.init = &(const struct clk_init_data) { 1755 + .name = "cam_cc_tfe_0_clk", 1756 + .parent_hws = (const struct clk_hw*[]) { 1757 + &cam_cc_tfe_0_clk_src.clkr.hw, 1758 + }, 1759 + .num_parents = 1, 1760 + .flags = CLK_SET_RATE_PARENT, 1761 + .ops = &clk_branch2_ops, 1762 + }, 1763 + }, 1764 + }; 1765 + 1766 + static struct clk_branch cam_cc_tfe_0_cphy_rx_clk = { 1767 + .halt_reg = 0x1c074, 1768 + .halt_check = BRANCH_HALT, 1769 + .clkr = { 1770 + .enable_reg = 0x1c074, 1771 + .enable_mask = BIT(0), 1772 + .hw.init = &(const struct clk_init_data) { 1773 + .name = "cam_cc_tfe_0_cphy_rx_clk", 1774 + .parent_hws = (const struct clk_hw*[]) { 1775 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1776 + }, 1777 + .num_parents = 1, 1778 + .flags = CLK_SET_RATE_PARENT, 1779 + .ops = &clk_branch2_ops, 1780 + }, 1781 + }, 1782 + }; 1783 + 1784 + static struct clk_branch cam_cc_tfe_0_csid_clk = { 1785 + .halt_reg = 0x1c048, 1786 + .halt_check = BRANCH_HALT, 1787 + .clkr = { 1788 + .enable_reg = 0x1c048, 1789 + .enable_mask = BIT(0), 1790 + .hw.init = &(const struct clk_init_data) { 1791 + .name = "cam_cc_tfe_0_csid_clk", 1792 + .parent_hws = (const struct clk_hw*[]) { 1793 + &cam_cc_tfe_0_csid_clk_src.clkr.hw, 1794 + }, 1795 + .num_parents = 1, 1796 + .flags = CLK_SET_RATE_PARENT, 1797 + .ops = &clk_branch2_ops, 1798 + }, 1799 + }, 1800 + }; 1801 + 1802 + static struct clk_branch cam_cc_tfe_1_ahb_clk = { 1803 + .halt_reg = 0x1d058, 1804 + .halt_check = BRANCH_HALT, 1805 + .clkr = { 1806 + .enable_reg = 0x1d058, 1807 + .enable_mask = BIT(0), 1808 + .hw.init = &(const struct clk_init_data) { 1809 + .name = "cam_cc_tfe_1_ahb_clk", 1810 + .parent_hws = (const struct clk_hw*[]) { 1811 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1812 + }, 1813 + .num_parents = 1, 1814 + .flags = CLK_SET_RATE_PARENT, 1815 + .ops = &clk_branch2_ops, 1816 + }, 1817 + }, 1818 + }; 1819 + 1820 + static struct clk_branch cam_cc_tfe_1_clk = { 1821 + .halt_reg = 0x1d01c, 1822 + .halt_check = BRANCH_HALT, 1823 + .clkr = { 1824 + .enable_reg = 0x1d01c, 1825 + .enable_mask = BIT(0), 1826 + .hw.init = &(const struct clk_init_data) { 1827 + .name = "cam_cc_tfe_1_clk", 1828 + .parent_hws = (const struct clk_hw*[]) { 1829 + &cam_cc_tfe_1_clk_src.clkr.hw, 1830 + }, 1831 + .num_parents = 1, 1832 + .flags = CLK_SET_RATE_PARENT, 1833 + .ops = &clk_branch2_ops, 1834 + }, 1835 + }, 1836 + }; 1837 + 1838 + static struct clk_branch cam_cc_tfe_1_cphy_rx_clk = { 1839 + .halt_reg = 0x1d054, 1840 + .halt_check = BRANCH_HALT, 1841 + .clkr = { 1842 + .enable_reg = 0x1d054, 1843 + .enable_mask = BIT(0), 1844 + .hw.init = &(const struct clk_init_data) { 1845 + .name = "cam_cc_tfe_1_cphy_rx_clk", 1846 + .parent_hws = (const struct clk_hw*[]) { 1847 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1848 + }, 1849 + .num_parents = 1, 1850 + .flags = CLK_SET_RATE_PARENT, 1851 + .ops = &clk_branch2_ops, 1852 + }, 1853 + }, 1854 + }; 1855 + 1856 + static struct clk_branch cam_cc_tfe_1_csid_clk = { 1857 + .halt_reg = 0x1d048, 1858 + .halt_check = BRANCH_HALT, 1859 + .clkr = { 1860 + .enable_reg = 0x1d048, 1861 + .enable_mask = BIT(0), 1862 + .hw.init = &(const struct clk_init_data) { 1863 + .name = "cam_cc_tfe_1_csid_clk", 1864 + .parent_hws = (const struct clk_hw*[]) { 1865 + &cam_cc_tfe_1_csid_clk_src.clkr.hw, 1866 + }, 1867 + .num_parents = 1, 1868 + .flags = CLK_SET_RATE_PARENT, 1869 + .ops = &clk_branch2_ops, 1870 + }, 1871 + }, 1872 + }; 1873 + 1874 + static struct clk_branch cam_cc_tfe_2_ahb_clk = { 1875 + .halt_reg = 0x1e058, 1876 + .halt_check = BRANCH_HALT, 1877 + .clkr = { 1878 + .enable_reg = 0x1e058, 1879 + .enable_mask = BIT(0), 1880 + .hw.init = &(const struct clk_init_data) { 1881 + .name = "cam_cc_tfe_2_ahb_clk", 1882 + .parent_hws = (const struct clk_hw*[]) { 1883 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1884 + }, 1885 + .num_parents = 1, 1886 + .flags = CLK_SET_RATE_PARENT, 1887 + .ops = &clk_branch2_ops, 1888 + }, 1889 + }, 1890 + }; 1891 + 1892 + static struct clk_branch cam_cc_tfe_2_clk = { 1893 + .halt_reg = 0x1e01c, 1894 + .halt_check = BRANCH_HALT, 1895 + .clkr = { 1896 + .enable_reg = 0x1e01c, 1897 + .enable_mask = BIT(0), 1898 + .hw.init = &(const struct clk_init_data) { 1899 + .name = "cam_cc_tfe_2_clk", 1900 + .parent_hws = (const struct clk_hw*[]) { 1901 + &cam_cc_tfe_2_clk_src.clkr.hw, 1902 + }, 1903 + .num_parents = 1, 1904 + .flags = CLK_SET_RATE_PARENT, 1905 + .ops = &clk_branch2_ops, 1906 + }, 1907 + }, 1908 + }; 1909 + 1910 + static struct clk_branch cam_cc_tfe_2_cphy_rx_clk = { 1911 + .halt_reg = 0x1e054, 1912 + .halt_check = BRANCH_HALT, 1913 + .clkr = { 1914 + .enable_reg = 0x1e054, 1915 + .enable_mask = BIT(0), 1916 + .hw.init = &(const struct clk_init_data) { 1917 + .name = "cam_cc_tfe_2_cphy_rx_clk", 1918 + .parent_hws = (const struct clk_hw*[]) { 1919 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1920 + }, 1921 + .num_parents = 1, 1922 + .flags = CLK_SET_RATE_PARENT, 1923 + .ops = &clk_branch2_ops, 1924 + }, 1925 + }, 1926 + }; 1927 + 1928 + static struct clk_branch cam_cc_tfe_2_csid_clk = { 1929 + .halt_reg = 0x1e048, 1930 + .halt_check = BRANCH_HALT, 1931 + .clkr = { 1932 + .enable_reg = 0x1e048, 1933 + .enable_mask = BIT(0), 1934 + .hw.init = &(const struct clk_init_data) { 1935 + .name = "cam_cc_tfe_2_csid_clk", 1936 + .parent_hws = (const struct clk_hw*[]) { 1937 + &cam_cc_tfe_2_csid_clk_src.clkr.hw, 1938 + }, 1939 + .num_parents = 1, 1940 + .flags = CLK_SET_RATE_PARENT, 1941 + .ops = &clk_branch2_ops, 1942 + }, 1943 + }, 1944 + }; 1945 + 1946 + static struct clk_branch cam_cc_top_shift_clk = { 1947 + .halt_reg = 0x25040, 1948 + .halt_check = BRANCH_HALT_VOTED, 1949 + .clkr = { 1950 + .enable_reg = 0x25040, 1951 + .enable_mask = BIT(0), 1952 + .hw.init = &(const struct clk_init_data) { 1953 + .name = "cam_cc_top_shift_clk", 1954 + .parent_hws = (const struct clk_hw*[]) { 1955 + &cam_cc_xo_clk_src.clkr.hw, 1956 + }, 1957 + .num_parents = 1, 1958 + .flags = CLK_SET_RATE_PARENT, 1959 + .ops = &clk_branch2_ops, 1960 + }, 1961 + }, 1962 + }; 1963 + 1964 + static struct gdsc cam_cc_camss_top_gdsc = { 1965 + .gdscr = 0x25004, 1966 + .en_rest_wait_val = 0x2, 1967 + .en_few_wait_val = 0x2, 1968 + .clk_dis_wait_val = 0xf, 1969 + .pd = { 1970 + .name = "cam_cc_camss_top_gdsc", 1971 + }, 1972 + .pwrsts = PWRSTS_OFF_ON, 1973 + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 1974 + }; 1975 + 1976 + static struct clk_regmap *cam_cc_milos_clocks[] = { 1977 + [CAM_CC_BPS_AHB_CLK] = &cam_cc_bps_ahb_clk.clkr, 1978 + [CAM_CC_BPS_AREG_CLK] = &cam_cc_bps_areg_clk.clkr, 1979 + [CAM_CC_BPS_CLK] = &cam_cc_bps_clk.clkr, 1980 + [CAM_CC_BPS_CLK_SRC] = &cam_cc_bps_clk_src.clkr, 1981 + [CAM_CC_CAMNOC_ATB_CLK] = &cam_cc_camnoc_atb_clk.clkr, 1982 + [CAM_CC_CAMNOC_AXI_CLK_SRC] = &cam_cc_camnoc_axi_clk_src.clkr, 1983 + [CAM_CC_CAMNOC_AXI_HF_CLK] = &cam_cc_camnoc_axi_hf_clk.clkr, 1984 + [CAM_CC_CAMNOC_AXI_SF_CLK] = &cam_cc_camnoc_axi_sf_clk.clkr, 1985 + [CAM_CC_CAMNOC_NRT_AXI_CLK] = &cam_cc_camnoc_nrt_axi_clk.clkr, 1986 + [CAM_CC_CAMNOC_RT_AXI_CLK] = &cam_cc_camnoc_rt_axi_clk.clkr, 1987 + [CAM_CC_CCI_0_CLK] = &cam_cc_cci_0_clk.clkr, 1988 + [CAM_CC_CCI_0_CLK_SRC] = &cam_cc_cci_0_clk_src.clkr, 1989 + [CAM_CC_CCI_1_CLK] = &cam_cc_cci_1_clk.clkr, 1990 + [CAM_CC_CCI_1_CLK_SRC] = &cam_cc_cci_1_clk_src.clkr, 1991 + [CAM_CC_CORE_AHB_CLK] = &cam_cc_core_ahb_clk.clkr, 1992 + [CAM_CC_CPAS_AHB_CLK] = &cam_cc_cpas_ahb_clk.clkr, 1993 + [CAM_CC_CPHY_RX_CLK_SRC] = &cam_cc_cphy_rx_clk_src.clkr, 1994 + [CAM_CC_CRE_AHB_CLK] = &cam_cc_cre_ahb_clk.clkr, 1995 + [CAM_CC_CRE_CLK] = &cam_cc_cre_clk.clkr, 1996 + [CAM_CC_CRE_CLK_SRC] = &cam_cc_cre_clk_src.clkr, 1997 + [CAM_CC_CSI0PHYTIMER_CLK] = &cam_cc_csi0phytimer_clk.clkr, 1998 + [CAM_CC_CSI0PHYTIMER_CLK_SRC] = &cam_cc_csi0phytimer_clk_src.clkr, 1999 + [CAM_CC_CSI1PHYTIMER_CLK] = &cam_cc_csi1phytimer_clk.clkr, 2000 + [CAM_CC_CSI1PHYTIMER_CLK_SRC] = &cam_cc_csi1phytimer_clk_src.clkr, 2001 + [CAM_CC_CSI2PHYTIMER_CLK] = &cam_cc_csi2phytimer_clk.clkr, 2002 + [CAM_CC_CSI2PHYTIMER_CLK_SRC] = &cam_cc_csi2phytimer_clk_src.clkr, 2003 + [CAM_CC_CSI3PHYTIMER_CLK] = &cam_cc_csi3phytimer_clk.clkr, 2004 + [CAM_CC_CSI3PHYTIMER_CLK_SRC] = &cam_cc_csi3phytimer_clk_src.clkr, 2005 + [CAM_CC_CSIPHY0_CLK] = &cam_cc_csiphy0_clk.clkr, 2006 + [CAM_CC_CSIPHY1_CLK] = &cam_cc_csiphy1_clk.clkr, 2007 + [CAM_CC_CSIPHY2_CLK] = &cam_cc_csiphy2_clk.clkr, 2008 + [CAM_CC_CSIPHY3_CLK] = &cam_cc_csiphy3_clk.clkr, 2009 + [CAM_CC_FAST_AHB_CLK_SRC] = &cam_cc_fast_ahb_clk_src.clkr, 2010 + [CAM_CC_ICP_ATB_CLK] = &cam_cc_icp_atb_clk.clkr, 2011 + [CAM_CC_ICP_CLK] = &cam_cc_icp_clk.clkr, 2012 + [CAM_CC_ICP_CLK_SRC] = &cam_cc_icp_clk_src.clkr, 2013 + [CAM_CC_ICP_CTI_CLK] = &cam_cc_icp_cti_clk.clkr, 2014 + [CAM_CC_ICP_TS_CLK] = &cam_cc_icp_ts_clk.clkr, 2015 + [CAM_CC_MCLK0_CLK] = &cam_cc_mclk0_clk.clkr, 2016 + [CAM_CC_MCLK0_CLK_SRC] = &cam_cc_mclk0_clk_src.clkr, 2017 + [CAM_CC_MCLK1_CLK] = &cam_cc_mclk1_clk.clkr, 2018 + [CAM_CC_MCLK1_CLK_SRC] = &cam_cc_mclk1_clk_src.clkr, 2019 + [CAM_CC_MCLK2_CLK] = &cam_cc_mclk2_clk.clkr, 2020 + [CAM_CC_MCLK2_CLK_SRC] = &cam_cc_mclk2_clk_src.clkr, 2021 + [CAM_CC_MCLK3_CLK] = &cam_cc_mclk3_clk.clkr, 2022 + [CAM_CC_MCLK3_CLK_SRC] = &cam_cc_mclk3_clk_src.clkr, 2023 + [CAM_CC_MCLK4_CLK] = &cam_cc_mclk4_clk.clkr, 2024 + [CAM_CC_MCLK4_CLK_SRC] = &cam_cc_mclk4_clk_src.clkr, 2025 + [CAM_CC_OPE_0_AHB_CLK] = &cam_cc_ope_0_ahb_clk.clkr, 2026 + [CAM_CC_OPE_0_AREG_CLK] = &cam_cc_ope_0_areg_clk.clkr, 2027 + [CAM_CC_OPE_0_CLK] = &cam_cc_ope_0_clk.clkr, 2028 + [CAM_CC_OPE_0_CLK_SRC] = &cam_cc_ope_0_clk_src.clkr, 2029 + [CAM_CC_PLL0] = &cam_cc_pll0.clkr, 2030 + [CAM_CC_PLL0_OUT_EVEN] = &cam_cc_pll0_out_even.clkr, 2031 + [CAM_CC_PLL0_OUT_ODD] = &cam_cc_pll0_out_odd.clkr, 2032 + [CAM_CC_PLL1] = &cam_cc_pll1.clkr, 2033 + [CAM_CC_PLL1_OUT_EVEN] = &cam_cc_pll1_out_even.clkr, 2034 + [CAM_CC_PLL2] = &cam_cc_pll2.clkr, 2035 + [CAM_CC_PLL3] = &cam_cc_pll3.clkr, 2036 + [CAM_CC_PLL3_OUT_EVEN] = &cam_cc_pll3_out_even.clkr, 2037 + [CAM_CC_PLL4] = &cam_cc_pll4.clkr, 2038 + [CAM_CC_PLL4_OUT_EVEN] = &cam_cc_pll4_out_even.clkr, 2039 + [CAM_CC_PLL5] = &cam_cc_pll5.clkr, 2040 + [CAM_CC_PLL5_OUT_EVEN] = &cam_cc_pll5_out_even.clkr, 2041 + [CAM_CC_PLL6] = &cam_cc_pll6.clkr, 2042 + [CAM_CC_PLL6_OUT_EVEN] = &cam_cc_pll6_out_even.clkr, 2043 + [CAM_CC_SLEEP_CLK_SRC] = &cam_cc_sleep_clk_src.clkr, 2044 + [CAM_CC_SLOW_AHB_CLK_SRC] = &cam_cc_slow_ahb_clk_src.clkr, 2045 + [CAM_CC_SOC_AHB_CLK] = &cam_cc_soc_ahb_clk.clkr, 2046 + [CAM_CC_SYS_TMR_CLK] = &cam_cc_sys_tmr_clk.clkr, 2047 + [CAM_CC_TFE_0_AHB_CLK] = &cam_cc_tfe_0_ahb_clk.clkr, 2048 + [CAM_CC_TFE_0_CLK] = &cam_cc_tfe_0_clk.clkr, 2049 + [CAM_CC_TFE_0_CLK_SRC] = &cam_cc_tfe_0_clk_src.clkr, 2050 + [CAM_CC_TFE_0_CPHY_RX_CLK] = &cam_cc_tfe_0_cphy_rx_clk.clkr, 2051 + [CAM_CC_TFE_0_CSID_CLK] = &cam_cc_tfe_0_csid_clk.clkr, 2052 + [CAM_CC_TFE_0_CSID_CLK_SRC] = &cam_cc_tfe_0_csid_clk_src.clkr, 2053 + [CAM_CC_TFE_1_AHB_CLK] = &cam_cc_tfe_1_ahb_clk.clkr, 2054 + [CAM_CC_TFE_1_CLK] = &cam_cc_tfe_1_clk.clkr, 2055 + [CAM_CC_TFE_1_CLK_SRC] = &cam_cc_tfe_1_clk_src.clkr, 2056 + [CAM_CC_TFE_1_CPHY_RX_CLK] = &cam_cc_tfe_1_cphy_rx_clk.clkr, 2057 + [CAM_CC_TFE_1_CSID_CLK] = &cam_cc_tfe_1_csid_clk.clkr, 2058 + [CAM_CC_TFE_1_CSID_CLK_SRC] = &cam_cc_tfe_1_csid_clk_src.clkr, 2059 + [CAM_CC_TFE_2_AHB_CLK] = &cam_cc_tfe_2_ahb_clk.clkr, 2060 + [CAM_CC_TFE_2_CLK] = &cam_cc_tfe_2_clk.clkr, 2061 + [CAM_CC_TFE_2_CLK_SRC] = &cam_cc_tfe_2_clk_src.clkr, 2062 + [CAM_CC_TFE_2_CPHY_RX_CLK] = &cam_cc_tfe_2_cphy_rx_clk.clkr, 2063 + [CAM_CC_TFE_2_CSID_CLK] = &cam_cc_tfe_2_csid_clk.clkr, 2064 + [CAM_CC_TFE_2_CSID_CLK_SRC] = &cam_cc_tfe_2_csid_clk_src.clkr, 2065 + [CAM_CC_TOP_SHIFT_CLK] = &cam_cc_top_shift_clk.clkr, 2066 + [CAM_CC_XO_CLK_SRC] = &cam_cc_xo_clk_src.clkr, 2067 + }; 2068 + 2069 + static const struct qcom_reset_map cam_cc_milos_resets[] = { 2070 + [CAM_CC_BPS_BCR] = { 0x1a000 }, 2071 + [CAM_CC_CAMNOC_BCR] = { 0x24000 }, 2072 + [CAM_CC_CAMSS_TOP_BCR] = { 0x25000 }, 2073 + [CAM_CC_CCI_0_BCR] = { 0x21000 }, 2074 + [CAM_CC_CCI_1_BCR] = { 0x22000 }, 2075 + [CAM_CC_CPAS_BCR] = { 0x23000 }, 2076 + [CAM_CC_CRE_BCR] = { 0x27000 }, 2077 + [CAM_CC_CSI0PHY_BCR] = { 0x19000 }, 2078 + [CAM_CC_CSI1PHY_BCR] = { 0x19024 }, 2079 + [CAM_CC_CSI2PHY_BCR] = { 0x19048 }, 2080 + [CAM_CC_CSI3PHY_BCR] = { 0x1906c }, 2081 + [CAM_CC_ICP_BCR] = { 0x20000 }, 2082 + [CAM_CC_MCLK0_BCR] = { 0x18000 }, 2083 + [CAM_CC_MCLK1_BCR] = { 0x18020 }, 2084 + [CAM_CC_MCLK2_BCR] = { 0x18040 }, 2085 + [CAM_CC_MCLK3_BCR] = { 0x18060 }, 2086 + [CAM_CC_MCLK4_BCR] = { 0x18080 }, 2087 + [CAM_CC_OPE_0_BCR] = { 0x1b000 }, 2088 + [CAM_CC_TFE_0_BCR] = { 0x1c000 }, 2089 + [CAM_CC_TFE_1_BCR] = { 0x1d000 }, 2090 + [CAM_CC_TFE_2_BCR] = { 0x1e000 }, 2091 + }; 2092 + 2093 + static struct gdsc *cam_cc_milos_gdscs[] = { 2094 + [CAM_CC_CAMSS_TOP_GDSC] = &cam_cc_camss_top_gdsc, 2095 + }; 2096 + 2097 + static struct clk_alpha_pll *cam_cc_milos_plls[] = { 2098 + &cam_cc_pll0, 2099 + &cam_cc_pll1, 2100 + &cam_cc_pll2, 2101 + &cam_cc_pll3, 2102 + &cam_cc_pll4, 2103 + &cam_cc_pll5, 2104 + &cam_cc_pll6, 2105 + }; 2106 + 2107 + static u32 cam_cc_milos_critical_cbcrs[] = { 2108 + 0x25038, /* CAM_CC_GDSC_CLK */ 2109 + 0x2505c, /* CAM_CC_SLEEP_CLK */ 2110 + }; 2111 + 2112 + static const struct regmap_config cam_cc_milos_regmap_config = { 2113 + .reg_bits = 32, 2114 + .reg_stride = 4, 2115 + .val_bits = 32, 2116 + .max_register = 0x30728, 2117 + .fast_io = true, 2118 + }; 2119 + 2120 + static struct qcom_cc_driver_data cam_cc_milos_driver_data = { 2121 + .alpha_plls = cam_cc_milos_plls, 2122 + .num_alpha_plls = ARRAY_SIZE(cam_cc_milos_plls), 2123 + .clk_cbcrs = cam_cc_milos_critical_cbcrs, 2124 + .num_clk_cbcrs = ARRAY_SIZE(cam_cc_milos_critical_cbcrs), 2125 + }; 2126 + 2127 + static struct qcom_cc_desc cam_cc_milos_desc = { 2128 + .config = &cam_cc_milos_regmap_config, 2129 + .clks = cam_cc_milos_clocks, 2130 + .num_clks = ARRAY_SIZE(cam_cc_milos_clocks), 2131 + .resets = cam_cc_milos_resets, 2132 + .num_resets = ARRAY_SIZE(cam_cc_milos_resets), 2133 + .gdscs = cam_cc_milos_gdscs, 2134 + .num_gdscs = ARRAY_SIZE(cam_cc_milos_gdscs), 2135 + .use_rpm = true, 2136 + .driver_data = &cam_cc_milos_driver_data, 2137 + }; 2138 + 2139 + static const struct of_device_id cam_cc_milos_match_table[] = { 2140 + { .compatible = "qcom,milos-camcc" }, 2141 + { } 2142 + }; 2143 + MODULE_DEVICE_TABLE(of, cam_cc_milos_match_table); 2144 + 2145 + static int cam_cc_milos_probe(struct platform_device *pdev) 2146 + { 2147 + return qcom_cc_probe(pdev, &cam_cc_milos_desc); 2148 + } 2149 + 2150 + static struct platform_driver cam_cc_milos_driver = { 2151 + .probe = cam_cc_milos_probe, 2152 + .driver = { 2153 + .name = "cam_cc-milos", 2154 + .of_match_table = cam_cc_milos_match_table, 2155 + }, 2156 + }; 2157 + 2158 + module_platform_driver(cam_cc_milos_driver); 2159 + 2160 + MODULE_DESCRIPTION("QTI CAM_CC Milos Driver"); 2161 + MODULE_LICENSE("GPL");
+1597
drivers/clk/qcom/camcc-qcs615.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #include <linux/clk-provider.h> 7 + #include <linux/module.h> 8 + #include <linux/mod_devicetable.h> 9 + #include <linux/of.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/regmap.h> 12 + 13 + #include <dt-bindings/clock/qcom,qcs615-camcc.h> 14 + 15 + #include "clk-alpha-pll.h" 16 + #include "clk-branch.h" 17 + #include "clk-pll.h" 18 + #include "clk-rcg.h" 19 + #include "clk-regmap.h" 20 + #include "clk-regmap-divider.h" 21 + #include "clk-regmap-mux.h" 22 + #include "common.h" 23 + #include "gdsc.h" 24 + #include "reset.h" 25 + 26 + enum { 27 + DT_BI_TCXO, 28 + }; 29 + 30 + enum { 31 + P_BI_TCXO, 32 + P_CAM_CC_PLL0_OUT_AUX, 33 + P_CAM_CC_PLL1_OUT_AUX, 34 + P_CAM_CC_PLL2_OUT_AUX2, 35 + P_CAM_CC_PLL2_OUT_EARLY, 36 + P_CAM_CC_PLL3_OUT_MAIN, 37 + }; 38 + 39 + static const struct pll_vco brammo_vco[] = { 40 + { 500000000, 1250000000, 0 }, 41 + }; 42 + 43 + static const struct pll_vco spark_vco[] = { 44 + { 1000000000, 2100000000, 0 }, 45 + { 750000000, 1500000000, 1 }, 46 + { 500000000, 1000000000, 2 }, 47 + { 300000000, 500000000, 3 }, 48 + { 550000000, 1100000000, 4 }, 49 + }; 50 + 51 + /* 600MHz configuration VCO - 2 */ 52 + static const struct alpha_pll_config cam_cc_pll0_config = { 53 + .l = 0x1f, 54 + .alpha_hi = 0x40, 55 + .alpha_en_mask = BIT(24), 56 + .vco_val = BIT(21), 57 + .vco_mask = GENMASK(21, 20), 58 + .aux_output_mask = BIT(1), 59 + .config_ctl_val = 0x4001055b, 60 + .test_ctl_hi_val = 0x1, 61 + .test_ctl_hi_mask = 0x1, 62 + }; 63 + 64 + static struct clk_alpha_pll cam_cc_pll0 = { 65 + .offset = 0x0, 66 + .config = &cam_cc_pll0_config, 67 + .vco_table = spark_vco, 68 + .num_vco = ARRAY_SIZE(spark_vco), 69 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 70 + .clkr = { 71 + .hw.init = &(const struct clk_init_data) { 72 + .name = "cam_cc_pll0", 73 + .parent_data = &(const struct clk_parent_data) { 74 + .index = DT_BI_TCXO, 75 + }, 76 + .num_parents = 1, 77 + .ops = &clk_alpha_pll_ops, 78 + }, 79 + }, 80 + }; 81 + 82 + /* 808MHz configuration VCO - 2 */ 83 + static struct alpha_pll_config cam_cc_pll1_config = { 84 + .l = 0x2a, 85 + .alpha_hi = 0x15, 86 + .alpha = 0x55555555, 87 + .alpha_en_mask = BIT(24), 88 + .vco_val = BIT(21), 89 + .vco_mask = GENMASK(21, 20), 90 + .aux_output_mask = BIT(1), 91 + .config_ctl_val = 0x4001055b, 92 + .test_ctl_hi_val = 0x1, 93 + .test_ctl_hi_mask = 0x1, 94 + }; 95 + 96 + static struct clk_alpha_pll cam_cc_pll1 = { 97 + .offset = 0x1000, 98 + .config = &cam_cc_pll1_config, 99 + .vco_table = spark_vco, 100 + .num_vco = ARRAY_SIZE(spark_vco), 101 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 102 + .clkr = { 103 + .hw.init = &(const struct clk_init_data) { 104 + .name = "cam_cc_pll1", 105 + .parent_data = &(const struct clk_parent_data) { 106 + .index = DT_BI_TCXO, 107 + }, 108 + .num_parents = 1, 109 + .ops = &clk_alpha_pll_ops, 110 + }, 111 + }, 112 + }; 113 + 114 + /* 960MHz configuration VCO - 0 */ 115 + static struct alpha_pll_config cam_cc_pll2_config = { 116 + .l = 0x32, 117 + .vco_val = 0x0, 118 + .vco_mask = GENMASK(21, 20), 119 + .early_output_mask = BIT(3), 120 + .aux2_output_mask = BIT(2), 121 + .post_div_val = 0x1 << 8, 122 + .post_div_mask = 0x3 << 8, 123 + .config_ctl_val = 0x04289, 124 + .test_ctl_val = 0x08000000, 125 + .test_ctl_mask = 0x08000000, 126 + }; 127 + 128 + static struct clk_alpha_pll cam_cc_pll2 = { 129 + .offset = 0x2000, 130 + .config = &cam_cc_pll2_config, 131 + .vco_table = brammo_vco, 132 + .num_vco = ARRAY_SIZE(brammo_vco), 133 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_BRAMMO], 134 + .clkr = { 135 + .hw.init = &(const struct clk_init_data) { 136 + .name = "cam_cc_pll2", 137 + .parent_data = &(const struct clk_parent_data) { 138 + .index = DT_BI_TCXO, 139 + }, 140 + .num_parents = 1, 141 + .ops = &clk_alpha_pll_ops, 142 + }, 143 + }, 144 + }; 145 + 146 + static const struct clk_div_table post_div_table_cam_cc_pll2_out_aux2[] = { 147 + { 0x1, 2 }, 148 + { } 149 + }; 150 + 151 + static struct clk_alpha_pll_postdiv cam_cc_pll2_out_aux2 = { 152 + .offset = 0x2000, 153 + .post_div_shift = 8, 154 + .post_div_table = post_div_table_cam_cc_pll2_out_aux2, 155 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll2_out_aux2), 156 + .width = 2, 157 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_BRAMMO], 158 + .clkr.hw.init = &(const struct clk_init_data) { 159 + .name = "cam_cc_pll2_out_aux2", 160 + .parent_hws = (const struct clk_hw*[]) { 161 + &cam_cc_pll2.clkr.hw, 162 + }, 163 + .num_parents = 1, 164 + .ops = &clk_alpha_pll_postdiv_ops, 165 + }, 166 + }; 167 + 168 + /* 1080MHz configuration - VCO - 0 */ 169 + static struct alpha_pll_config cam_cc_pll3_config = { 170 + .l = 0x38, 171 + .alpha_hi = 0x40, 172 + .alpha_en_mask = BIT(24), 173 + .vco_val = 0x0, 174 + .vco_mask = GENMASK(21, 20), 175 + .main_output_mask = BIT(0), 176 + .config_ctl_val = 0x4001055b, 177 + .test_ctl_hi_val = 0x1, 178 + .test_ctl_hi_mask = 0x1, 179 + }; 180 + 181 + static struct clk_alpha_pll cam_cc_pll3 = { 182 + .offset = 0x3000, 183 + .config = &cam_cc_pll3_config, 184 + .vco_table = spark_vco, 185 + .num_vco = ARRAY_SIZE(spark_vco), 186 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 187 + .clkr = { 188 + .hw.init = &(const struct clk_init_data) { 189 + .name = "cam_cc_pll3", 190 + .parent_data = &(const struct clk_parent_data) { 191 + .index = DT_BI_TCXO, 192 + }, 193 + .num_parents = 1, 194 + .ops = &clk_alpha_pll_ops, 195 + }, 196 + }, 197 + }; 198 + 199 + static const struct parent_map cam_cc_parent_map_0[] = { 200 + { P_BI_TCXO, 0 }, 201 + { P_CAM_CC_PLL1_OUT_AUX, 2 }, 202 + { P_CAM_CC_PLL0_OUT_AUX, 6 }, 203 + }; 204 + 205 + static const struct clk_parent_data cam_cc_parent_data_0[] = { 206 + { .index = DT_BI_TCXO }, 207 + { .hw = &cam_cc_pll1.clkr.hw }, 208 + { .hw = &cam_cc_pll0.clkr.hw }, 209 + }; 210 + 211 + static const struct parent_map cam_cc_parent_map_1[] = { 212 + { P_BI_TCXO, 0 }, 213 + { P_CAM_CC_PLL2_OUT_EARLY, 4 }, 214 + { P_CAM_CC_PLL3_OUT_MAIN, 5 }, 215 + { P_CAM_CC_PLL0_OUT_AUX, 6 }, 216 + }; 217 + 218 + static const struct clk_parent_data cam_cc_parent_data_1[] = { 219 + { .index = DT_BI_TCXO }, 220 + { .hw = &cam_cc_pll2.clkr.hw }, 221 + { .hw = &cam_cc_pll3.clkr.hw }, 222 + { .hw = &cam_cc_pll0.clkr.hw }, 223 + }; 224 + 225 + static const struct parent_map cam_cc_parent_map_2[] = { 226 + { P_BI_TCXO, 0 }, 227 + { P_CAM_CC_PLL1_OUT_AUX, 2 }, 228 + { P_CAM_CC_PLL2_OUT_EARLY, 4 }, 229 + { P_CAM_CC_PLL3_OUT_MAIN, 5 }, 230 + { P_CAM_CC_PLL0_OUT_AUX, 6 }, 231 + }; 232 + 233 + static const struct clk_parent_data cam_cc_parent_data_2[] = { 234 + { .index = DT_BI_TCXO }, 235 + { .hw = &cam_cc_pll1.clkr.hw }, 236 + { .hw = &cam_cc_pll2.clkr.hw }, 237 + { .hw = &cam_cc_pll3.clkr.hw }, 238 + { .hw = &cam_cc_pll0.clkr.hw }, 239 + }; 240 + 241 + static const struct parent_map cam_cc_parent_map_3[] = { 242 + { P_BI_TCXO, 0 }, 243 + { P_CAM_CC_PLL2_OUT_AUX2, 1 }, 244 + }; 245 + 246 + static const struct clk_parent_data cam_cc_parent_data_3[] = { 247 + { .index = DT_BI_TCXO }, 248 + { .hw = &cam_cc_pll2_out_aux2.clkr.hw }, 249 + }; 250 + 251 + static const struct parent_map cam_cc_parent_map_4[] = { 252 + { P_BI_TCXO, 0 }, 253 + { P_CAM_CC_PLL3_OUT_MAIN, 5 }, 254 + { P_CAM_CC_PLL0_OUT_AUX, 6 }, 255 + }; 256 + 257 + static const struct clk_parent_data cam_cc_parent_data_4[] = { 258 + { .index = DT_BI_TCXO }, 259 + { .hw = &cam_cc_pll3.clkr.hw }, 260 + { .hw = &cam_cc_pll0.clkr.hw }, 261 + }; 262 + 263 + static const struct parent_map cam_cc_parent_map_5[] = { 264 + { P_BI_TCXO, 0 }, 265 + { P_CAM_CC_PLL0_OUT_AUX, 6 }, 266 + }; 267 + 268 + static const struct clk_parent_data cam_cc_parent_data_5[] = { 269 + { .index = DT_BI_TCXO }, 270 + { .hw = &cam_cc_pll0.clkr.hw }, 271 + }; 272 + 273 + static const struct parent_map cam_cc_parent_map_6[] = { 274 + { P_BI_TCXO, 0 }, 275 + { P_CAM_CC_PLL1_OUT_AUX, 2 }, 276 + { P_CAM_CC_PLL3_OUT_MAIN, 5 }, 277 + { P_CAM_CC_PLL0_OUT_AUX, 6 }, 278 + }; 279 + 280 + static const struct clk_parent_data cam_cc_parent_data_6[] = { 281 + { .index = DT_BI_TCXO }, 282 + { .hw = &cam_cc_pll1.clkr.hw }, 283 + { .hw = &cam_cc_pll3.clkr.hw }, 284 + { .hw = &cam_cc_pll0.clkr.hw }, 285 + }; 286 + 287 + static const struct freq_tbl ftbl_cam_cc_bps_clk_src[] = { 288 + F(200000000, P_CAM_CC_PLL0_OUT_AUX, 3, 0, 0), 289 + F(360000000, P_CAM_CC_PLL3_OUT_MAIN, 3, 0, 0), 290 + F(432000000, P_CAM_CC_PLL3_OUT_MAIN, 2.5, 0, 0), 291 + F(480000000, P_CAM_CC_PLL2_OUT_EARLY, 2, 0, 0), 292 + F(540000000, P_CAM_CC_PLL3_OUT_MAIN, 2, 0, 0), 293 + F(600000000, P_CAM_CC_PLL0_OUT_AUX, 1, 0, 0), 294 + { } 295 + }; 296 + 297 + static struct clk_rcg2 cam_cc_bps_clk_src = { 298 + .cmd_rcgr = 0x6010, 299 + .mnd_width = 0, 300 + .hid_width = 5, 301 + .parent_map = cam_cc_parent_map_1, 302 + .freq_tbl = ftbl_cam_cc_bps_clk_src, 303 + .clkr.hw.init = &(const struct clk_init_data) { 304 + .name = "cam_cc_bps_clk_src", 305 + .parent_data = cam_cc_parent_data_1, 306 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 307 + .ops = &clk_rcg2_shared_ops, 308 + }, 309 + }; 310 + 311 + static const struct freq_tbl ftbl_cam_cc_cci_clk_src[] = { 312 + F(37500000, P_CAM_CC_PLL0_OUT_AUX, 16, 0, 0), 313 + F(50000000, P_CAM_CC_PLL0_OUT_AUX, 12, 0, 0), 314 + F(100000000, P_CAM_CC_PLL0_OUT_AUX, 6, 0, 0), 315 + { } 316 + }; 317 + 318 + static struct clk_rcg2 cam_cc_cci_clk_src = { 319 + .cmd_rcgr = 0xb0d8, 320 + .mnd_width = 8, 321 + .hid_width = 5, 322 + .parent_map = cam_cc_parent_map_5, 323 + .freq_tbl = ftbl_cam_cc_cci_clk_src, 324 + .clkr.hw.init = &(const struct clk_init_data) { 325 + .name = "cam_cc_cci_clk_src", 326 + .parent_data = cam_cc_parent_data_5, 327 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_5), 328 + .ops = &clk_rcg2_shared_ops, 329 + }, 330 + }; 331 + 332 + static const struct freq_tbl ftbl_cam_cc_cphy_rx_clk_src[] = { 333 + F(100000000, P_CAM_CC_PLL0_OUT_AUX, 6, 0, 0), 334 + F(200000000, P_CAM_CC_PLL0_OUT_AUX, 3, 0, 0), 335 + F(269333333, P_CAM_CC_PLL1_OUT_AUX, 3, 0, 0), 336 + F(320000000, P_CAM_CC_PLL2_OUT_EARLY, 3, 0, 0), 337 + F(384000000, P_CAM_CC_PLL2_OUT_EARLY, 2.5, 0, 0), 338 + { } 339 + }; 340 + 341 + static struct clk_rcg2 cam_cc_cphy_rx_clk_src = { 342 + .cmd_rcgr = 0x9064, 343 + .mnd_width = 0, 344 + .hid_width = 5, 345 + .parent_map = cam_cc_parent_map_2, 346 + .freq_tbl = ftbl_cam_cc_cphy_rx_clk_src, 347 + .clkr.hw.init = &(const struct clk_init_data) { 348 + .name = "cam_cc_cphy_rx_clk_src", 349 + .parent_data = cam_cc_parent_data_2, 350 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_2), 351 + .ops = &clk_rcg2_shared_ops, 352 + }, 353 + }; 354 + 355 + static const struct freq_tbl ftbl_cam_cc_csi0phytimer_clk_src[] = { 356 + F(100000000, P_CAM_CC_PLL0_OUT_AUX, 6, 0, 0), 357 + F(200000000, P_CAM_CC_PLL0_OUT_AUX, 3, 0, 0), 358 + F(269333333, P_CAM_CC_PLL1_OUT_AUX, 3, 0, 0), 359 + { } 360 + }; 361 + 362 + static struct clk_rcg2 cam_cc_csi0phytimer_clk_src = { 363 + .cmd_rcgr = 0x5004, 364 + .mnd_width = 0, 365 + .hid_width = 5, 366 + .parent_map = cam_cc_parent_map_0, 367 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 368 + .clkr.hw.init = &(const struct clk_init_data) { 369 + .name = "cam_cc_csi0phytimer_clk_src", 370 + .parent_data = cam_cc_parent_data_0, 371 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 372 + .ops = &clk_rcg2_shared_ops, 373 + }, 374 + }; 375 + 376 + static struct clk_rcg2 cam_cc_csi1phytimer_clk_src = { 377 + .cmd_rcgr = 0x5028, 378 + .mnd_width = 0, 379 + .hid_width = 5, 380 + .parent_map = cam_cc_parent_map_0, 381 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 382 + .clkr.hw.init = &(const struct clk_init_data) { 383 + .name = "cam_cc_csi1phytimer_clk_src", 384 + .parent_data = cam_cc_parent_data_0, 385 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 386 + .ops = &clk_rcg2_shared_ops, 387 + }, 388 + }; 389 + 390 + static struct clk_rcg2 cam_cc_csi2phytimer_clk_src = { 391 + .cmd_rcgr = 0x504c, 392 + .mnd_width = 0, 393 + .hid_width = 5, 394 + .parent_map = cam_cc_parent_map_0, 395 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 396 + .clkr.hw.init = &(const struct clk_init_data) { 397 + .name = "cam_cc_csi2phytimer_clk_src", 398 + .parent_data = cam_cc_parent_data_0, 399 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 400 + .ops = &clk_rcg2_shared_ops, 401 + }, 402 + }; 403 + 404 + static const struct freq_tbl ftbl_cam_cc_fast_ahb_clk_src[] = { 405 + F(100000000, P_CAM_CC_PLL0_OUT_AUX, 6, 0, 0), 406 + F(200000000, P_CAM_CC_PLL0_OUT_AUX, 3, 0, 0), 407 + F(300000000, P_CAM_CC_PLL0_OUT_AUX, 2, 0, 0), 408 + F(404000000, P_CAM_CC_PLL1_OUT_AUX, 2, 0, 0), 409 + { } 410 + }; 411 + 412 + static struct clk_rcg2 cam_cc_fast_ahb_clk_src = { 413 + .cmd_rcgr = 0x603c, 414 + .mnd_width = 0, 415 + .hid_width = 5, 416 + .parent_map = cam_cc_parent_map_0, 417 + .freq_tbl = ftbl_cam_cc_fast_ahb_clk_src, 418 + .clkr.hw.init = &(const struct clk_init_data) { 419 + .name = "cam_cc_fast_ahb_clk_src", 420 + .parent_data = cam_cc_parent_data_0, 421 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 422 + .ops = &clk_rcg2_shared_ops, 423 + }, 424 + }; 425 + 426 + static const struct freq_tbl ftbl_cam_cc_icp_clk_src[] = { 427 + F(240000000, P_CAM_CC_PLL0_OUT_AUX, 2.5, 0, 0), 428 + F(360000000, P_CAM_CC_PLL3_OUT_MAIN, 3, 0, 0), 429 + F(432000000, P_CAM_CC_PLL3_OUT_MAIN, 2.5, 0, 0), 430 + F(480000000, P_CAM_CC_PLL2_OUT_EARLY, 2, 0, 0), 431 + F(540000000, P_CAM_CC_PLL3_OUT_MAIN, 2, 0, 0), 432 + F(600000000, P_CAM_CC_PLL0_OUT_AUX, 1, 0, 0), 433 + { } 434 + }; 435 + 436 + static struct clk_rcg2 cam_cc_icp_clk_src = { 437 + .cmd_rcgr = 0xb088, 438 + .mnd_width = 0, 439 + .hid_width = 5, 440 + .parent_map = cam_cc_parent_map_1, 441 + .freq_tbl = ftbl_cam_cc_icp_clk_src, 442 + .clkr.hw.init = &(const struct clk_init_data) { 443 + .name = "cam_cc_icp_clk_src", 444 + .parent_data = cam_cc_parent_data_1, 445 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 446 + .ops = &clk_rcg2_shared_ops, 447 + }, 448 + }; 449 + 450 + static const struct freq_tbl ftbl_cam_cc_ife_0_clk_src[] = { 451 + F(240000000, P_CAM_CC_PLL0_OUT_AUX, 2.5, 0, 0), 452 + F(360000000, P_CAM_CC_PLL3_OUT_MAIN, 3, 0, 0), 453 + F(432000000, P_CAM_CC_PLL3_OUT_MAIN, 2.5, 0, 0), 454 + F(540000000, P_CAM_CC_PLL3_OUT_MAIN, 2, 0, 0), 455 + F(600000000, P_CAM_CC_PLL0_OUT_AUX, 1, 0, 0), 456 + { } 457 + }; 458 + 459 + static struct clk_rcg2 cam_cc_ife_0_clk_src = { 460 + .cmd_rcgr = 0x9010, 461 + .mnd_width = 0, 462 + .hid_width = 5, 463 + .parent_map = cam_cc_parent_map_4, 464 + .freq_tbl = ftbl_cam_cc_ife_0_clk_src, 465 + .clkr.hw.init = &(const struct clk_init_data) { 466 + .name = "cam_cc_ife_0_clk_src", 467 + .parent_data = cam_cc_parent_data_4, 468 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_4), 469 + .ops = &clk_rcg2_shared_ops, 470 + }, 471 + }; 472 + 473 + static const struct freq_tbl ftbl_cam_cc_ife_0_csid_clk_src[] = { 474 + F(100000000, P_CAM_CC_PLL0_OUT_AUX, 6, 0, 0), 475 + F(200000000, P_CAM_CC_PLL0_OUT_AUX, 3, 0, 0), 476 + F(320000000, P_CAM_CC_PLL2_OUT_EARLY, 3, 0, 0), 477 + F(404000000, P_CAM_CC_PLL1_OUT_AUX, 2, 0, 0), 478 + F(480000000, P_CAM_CC_PLL2_OUT_EARLY, 2, 0, 0), 479 + F(540000000, P_CAM_CC_PLL3_OUT_MAIN, 2, 0, 0), 480 + { } 481 + }; 482 + 483 + static struct clk_rcg2 cam_cc_ife_0_csid_clk_src = { 484 + .cmd_rcgr = 0x903c, 485 + .mnd_width = 0, 486 + .hid_width = 5, 487 + .parent_map = cam_cc_parent_map_2, 488 + .freq_tbl = ftbl_cam_cc_ife_0_csid_clk_src, 489 + .clkr.hw.init = &(const struct clk_init_data) { 490 + .name = "cam_cc_ife_0_csid_clk_src", 491 + .parent_data = cam_cc_parent_data_2, 492 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_2), 493 + .ops = &clk_rcg2_shared_ops, 494 + }, 495 + }; 496 + 497 + static struct clk_rcg2 cam_cc_ife_1_clk_src = { 498 + .cmd_rcgr = 0xa010, 499 + .mnd_width = 0, 500 + .hid_width = 5, 501 + .parent_map = cam_cc_parent_map_4, 502 + .freq_tbl = ftbl_cam_cc_ife_0_clk_src, 503 + .clkr.hw.init = &(const struct clk_init_data) { 504 + .name = "cam_cc_ife_1_clk_src", 505 + .parent_data = cam_cc_parent_data_4, 506 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_4), 507 + .ops = &clk_rcg2_shared_ops, 508 + }, 509 + }; 510 + 511 + static struct clk_rcg2 cam_cc_ife_1_csid_clk_src = { 512 + .cmd_rcgr = 0xa034, 513 + .mnd_width = 0, 514 + .hid_width = 5, 515 + .parent_map = cam_cc_parent_map_2, 516 + .freq_tbl = ftbl_cam_cc_ife_0_csid_clk_src, 517 + .clkr.hw.init = &(const struct clk_init_data) { 518 + .name = "cam_cc_ife_1_csid_clk_src", 519 + .parent_data = cam_cc_parent_data_2, 520 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_2), 521 + .ops = &clk_rcg2_shared_ops, 522 + }, 523 + }; 524 + 525 + static struct clk_rcg2 cam_cc_ife_lite_clk_src = { 526 + .cmd_rcgr = 0xb004, 527 + .mnd_width = 0, 528 + .hid_width = 5, 529 + .parent_map = cam_cc_parent_map_4, 530 + .freq_tbl = ftbl_cam_cc_ife_0_clk_src, 531 + .clkr.hw.init = &(const struct clk_init_data) { 532 + .name = "cam_cc_ife_lite_clk_src", 533 + .parent_data = cam_cc_parent_data_4, 534 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_4), 535 + .ops = &clk_rcg2_shared_ops, 536 + }, 537 + }; 538 + 539 + static struct clk_rcg2 cam_cc_ife_lite_csid_clk_src = { 540 + .cmd_rcgr = 0xb024, 541 + .mnd_width = 0, 542 + .hid_width = 5, 543 + .parent_map = cam_cc_parent_map_2, 544 + .freq_tbl = ftbl_cam_cc_ife_0_csid_clk_src, 545 + .clkr.hw.init = &(const struct clk_init_data) { 546 + .name = "cam_cc_ife_lite_csid_clk_src", 547 + .parent_data = cam_cc_parent_data_2, 548 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_2), 549 + .ops = &clk_rcg2_shared_ops, 550 + }, 551 + }; 552 + 553 + static struct clk_rcg2 cam_cc_ipe_0_clk_src = { 554 + .cmd_rcgr = 0x7010, 555 + .mnd_width = 0, 556 + .hid_width = 5, 557 + .parent_map = cam_cc_parent_map_1, 558 + .freq_tbl = ftbl_cam_cc_icp_clk_src, 559 + .clkr.hw.init = &(const struct clk_init_data) { 560 + .name = "cam_cc_ipe_0_clk_src", 561 + .parent_data = cam_cc_parent_data_1, 562 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 563 + .ops = &clk_rcg2_shared_ops, 564 + }, 565 + }; 566 + 567 + static const struct freq_tbl ftbl_cam_cc_jpeg_clk_src[] = { 568 + F(66666667, P_CAM_CC_PLL0_OUT_AUX, 9, 0, 0), 569 + F(133333333, P_CAM_CC_PLL0_OUT_AUX, 4.5, 0, 0), 570 + F(216000000, P_CAM_CC_PLL3_OUT_MAIN, 5, 0, 0), 571 + F(320000000, P_CAM_CC_PLL2_OUT_EARLY, 3, 0, 0), 572 + F(480000000, P_CAM_CC_PLL2_OUT_EARLY, 2, 0, 0), 573 + F(600000000, P_CAM_CC_PLL0_OUT_AUX, 1, 0, 0), 574 + { } 575 + }; 576 + 577 + static struct clk_rcg2 cam_cc_jpeg_clk_src = { 578 + .cmd_rcgr = 0xb04c, 579 + .mnd_width = 0, 580 + .hid_width = 5, 581 + .parent_map = cam_cc_parent_map_1, 582 + .freq_tbl = ftbl_cam_cc_jpeg_clk_src, 583 + .clkr.hw.init = &(const struct clk_init_data) { 584 + .name = "cam_cc_jpeg_clk_src", 585 + .parent_data = cam_cc_parent_data_1, 586 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 587 + .ops = &clk_rcg2_shared_ops, 588 + }, 589 + }; 590 + 591 + static const struct freq_tbl ftbl_cam_cc_lrme_clk_src[] = { 592 + F(200000000, P_CAM_CC_PLL0_OUT_AUX, 3, 0, 0), 593 + F(216000000, P_CAM_CC_PLL3_OUT_MAIN, 5, 0, 0), 594 + F(300000000, P_CAM_CC_PLL0_OUT_AUX, 2, 0, 0), 595 + F(404000000, P_CAM_CC_PLL1_OUT_AUX, 2, 0, 0), 596 + { } 597 + }; 598 + 599 + static struct clk_rcg2 cam_cc_lrme_clk_src = { 600 + .cmd_rcgr = 0xb0f8, 601 + .mnd_width = 0, 602 + .hid_width = 5, 603 + .parent_map = cam_cc_parent_map_6, 604 + .freq_tbl = ftbl_cam_cc_lrme_clk_src, 605 + .clkr.hw.init = &(const struct clk_init_data) { 606 + .name = "cam_cc_lrme_clk_src", 607 + .parent_data = cam_cc_parent_data_6, 608 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_6), 609 + .ops = &clk_rcg2_shared_ops, 610 + }, 611 + }; 612 + 613 + static const struct freq_tbl ftbl_cam_cc_mclk0_clk_src[] = { 614 + F(19200000, P_BI_TCXO, 1, 0, 0), 615 + F(24000000, P_CAM_CC_PLL2_OUT_AUX2, 10, 1, 2), 616 + F(34285714, P_CAM_CC_PLL2_OUT_AUX2, 14, 0, 0), 617 + { } 618 + }; 619 + 620 + static struct clk_rcg2 cam_cc_mclk0_clk_src = { 621 + .cmd_rcgr = 0x4004, 622 + .mnd_width = 8, 623 + .hid_width = 5, 624 + .parent_map = cam_cc_parent_map_3, 625 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 626 + .clkr.hw.init = &(const struct clk_init_data) { 627 + .name = "cam_cc_mclk0_clk_src", 628 + .parent_data = cam_cc_parent_data_3, 629 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_3), 630 + .ops = &clk_rcg2_shared_ops, 631 + }, 632 + }; 633 + 634 + static struct clk_rcg2 cam_cc_mclk1_clk_src = { 635 + .cmd_rcgr = 0x4024, 636 + .mnd_width = 8, 637 + .hid_width = 5, 638 + .parent_map = cam_cc_parent_map_3, 639 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 640 + .clkr.hw.init = &(const struct clk_init_data) { 641 + .name = "cam_cc_mclk1_clk_src", 642 + .parent_data = cam_cc_parent_data_3, 643 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_3), 644 + .ops = &clk_rcg2_shared_ops, 645 + }, 646 + }; 647 + 648 + static struct clk_rcg2 cam_cc_mclk2_clk_src = { 649 + .cmd_rcgr = 0x4044, 650 + .mnd_width = 8, 651 + .hid_width = 5, 652 + .parent_map = cam_cc_parent_map_3, 653 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 654 + .clkr.hw.init = &(const struct clk_init_data) { 655 + .name = "cam_cc_mclk2_clk_src", 656 + .parent_data = cam_cc_parent_data_3, 657 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_3), 658 + .ops = &clk_rcg2_shared_ops, 659 + }, 660 + }; 661 + 662 + static struct clk_rcg2 cam_cc_mclk3_clk_src = { 663 + .cmd_rcgr = 0x4064, 664 + .mnd_width = 8, 665 + .hid_width = 5, 666 + .parent_map = cam_cc_parent_map_3, 667 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 668 + .clkr.hw.init = &(const struct clk_init_data) { 669 + .name = "cam_cc_mclk3_clk_src", 670 + .parent_data = cam_cc_parent_data_3, 671 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_3), 672 + .ops = &clk_rcg2_shared_ops, 673 + }, 674 + }; 675 + 676 + static const struct freq_tbl ftbl_cam_cc_slow_ahb_clk_src[] = { 677 + F(80000000, P_CAM_CC_PLL0_OUT_AUX, 7.5, 0, 0), 678 + { } 679 + }; 680 + 681 + static struct clk_rcg2 cam_cc_slow_ahb_clk_src = { 682 + .cmd_rcgr = 0x6058, 683 + .mnd_width = 0, 684 + .hid_width = 5, 685 + .parent_map = cam_cc_parent_map_0, 686 + .freq_tbl = ftbl_cam_cc_slow_ahb_clk_src, 687 + .clkr.hw.init = &(const struct clk_init_data) { 688 + .name = "cam_cc_slow_ahb_clk_src", 689 + .parent_data = cam_cc_parent_data_0, 690 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 691 + .ops = &clk_rcg2_shared_ops, 692 + }, 693 + }; 694 + 695 + static struct clk_branch cam_cc_bps_ahb_clk = { 696 + .halt_reg = 0x6070, 697 + .halt_check = BRANCH_HALT, 698 + .clkr = { 699 + .enable_reg = 0x6070, 700 + .enable_mask = BIT(0), 701 + .hw.init = &(const struct clk_init_data) { 702 + .name = "cam_cc_bps_ahb_clk", 703 + .parent_hws = (const struct clk_hw*[]) { 704 + &cam_cc_slow_ahb_clk_src.clkr.hw, 705 + }, 706 + .num_parents = 1, 707 + .flags = CLK_SET_RATE_PARENT, 708 + .ops = &clk_branch2_ops, 709 + }, 710 + }, 711 + }; 712 + 713 + static struct clk_branch cam_cc_bps_areg_clk = { 714 + .halt_reg = 0x6054, 715 + .halt_check = BRANCH_HALT, 716 + .clkr = { 717 + .enable_reg = 0x6054, 718 + .enable_mask = BIT(0), 719 + .hw.init = &(const struct clk_init_data) { 720 + .name = "cam_cc_bps_areg_clk", 721 + .parent_hws = (const struct clk_hw*[]) { 722 + &cam_cc_fast_ahb_clk_src.clkr.hw, 723 + }, 724 + .num_parents = 1, 725 + .flags = CLK_SET_RATE_PARENT, 726 + .ops = &clk_branch2_ops, 727 + }, 728 + }, 729 + }; 730 + 731 + static struct clk_branch cam_cc_bps_axi_clk = { 732 + .halt_reg = 0x6038, 733 + .halt_check = BRANCH_HALT, 734 + .clkr = { 735 + .enable_reg = 0x6038, 736 + .enable_mask = BIT(0), 737 + .hw.init = &(const struct clk_init_data) { 738 + .name = "cam_cc_bps_axi_clk", 739 + .ops = &clk_branch2_ops, 740 + }, 741 + }, 742 + }; 743 + 744 + static struct clk_branch cam_cc_bps_clk = { 745 + .halt_reg = 0x6028, 746 + .halt_check = BRANCH_HALT, 747 + .clkr = { 748 + .enable_reg = 0x6028, 749 + .enable_mask = BIT(0), 750 + .hw.init = &(const struct clk_init_data) { 751 + .name = "cam_cc_bps_clk", 752 + .parent_hws = (const struct clk_hw*[]) { 753 + &cam_cc_bps_clk_src.clkr.hw, 754 + }, 755 + .num_parents = 1, 756 + .flags = CLK_SET_RATE_PARENT, 757 + .ops = &clk_branch2_ops, 758 + }, 759 + }, 760 + }; 761 + 762 + static struct clk_branch cam_cc_camnoc_axi_clk = { 763 + .halt_reg = 0xb124, 764 + .halt_check = BRANCH_HALT, 765 + .clkr = { 766 + .enable_reg = 0xb124, 767 + .enable_mask = BIT(0), 768 + .hw.init = &(const struct clk_init_data) { 769 + .name = "cam_cc_camnoc_axi_clk", 770 + .ops = &clk_branch2_ops, 771 + }, 772 + }, 773 + }; 774 + 775 + static struct clk_branch cam_cc_cci_clk = { 776 + .halt_reg = 0xb0f0, 777 + .halt_check = BRANCH_HALT, 778 + .clkr = { 779 + .enable_reg = 0xb0f0, 780 + .enable_mask = BIT(0), 781 + .hw.init = &(const struct clk_init_data) { 782 + .name = "cam_cc_cci_clk", 783 + .parent_hws = (const struct clk_hw*[]) { 784 + &cam_cc_cci_clk_src.clkr.hw, 785 + }, 786 + .num_parents = 1, 787 + .flags = CLK_SET_RATE_PARENT, 788 + .ops = &clk_branch2_ops, 789 + }, 790 + }, 791 + }; 792 + 793 + static struct clk_branch cam_cc_core_ahb_clk = { 794 + .halt_reg = 0xb144, 795 + .halt_check = BRANCH_HALT_VOTED, 796 + .clkr = { 797 + .enable_reg = 0xb144, 798 + .enable_mask = BIT(0), 799 + .hw.init = &(const struct clk_init_data) { 800 + .name = "cam_cc_core_ahb_clk", 801 + .parent_hws = (const struct clk_hw*[]) { 802 + &cam_cc_slow_ahb_clk_src.clkr.hw, 803 + }, 804 + .num_parents = 1, 805 + .flags = CLK_SET_RATE_PARENT, 806 + .ops = &clk_branch2_ops, 807 + }, 808 + }, 809 + }; 810 + 811 + static struct clk_branch cam_cc_cpas_ahb_clk = { 812 + .halt_reg = 0xb11c, 813 + .halt_check = BRANCH_HALT, 814 + .clkr = { 815 + .enable_reg = 0xb11c, 816 + .enable_mask = BIT(0), 817 + .hw.init = &(const struct clk_init_data) { 818 + .name = "cam_cc_cpas_ahb_clk", 819 + .parent_hws = (const struct clk_hw*[]) { 820 + &cam_cc_slow_ahb_clk_src.clkr.hw, 821 + }, 822 + .num_parents = 1, 823 + .flags = CLK_SET_RATE_PARENT, 824 + .ops = &clk_branch2_ops, 825 + }, 826 + }, 827 + }; 828 + 829 + static struct clk_branch cam_cc_csi0phytimer_clk = { 830 + .halt_reg = 0x501c, 831 + .halt_check = BRANCH_HALT, 832 + .clkr = { 833 + .enable_reg = 0x501c, 834 + .enable_mask = BIT(0), 835 + .hw.init = &(const struct clk_init_data) { 836 + .name = "cam_cc_csi0phytimer_clk", 837 + .parent_hws = (const struct clk_hw*[]) { 838 + &cam_cc_csi0phytimer_clk_src.clkr.hw, 839 + }, 840 + .num_parents = 1, 841 + .flags = CLK_SET_RATE_PARENT, 842 + .ops = &clk_branch2_ops, 843 + }, 844 + }, 845 + }; 846 + 847 + static struct clk_branch cam_cc_csi1phytimer_clk = { 848 + .halt_reg = 0x5040, 849 + .halt_check = BRANCH_HALT, 850 + .clkr = { 851 + .enable_reg = 0x5040, 852 + .enable_mask = BIT(0), 853 + .hw.init = &(const struct clk_init_data) { 854 + .name = "cam_cc_csi1phytimer_clk", 855 + .parent_hws = (const struct clk_hw*[]) { 856 + &cam_cc_csi1phytimer_clk_src.clkr.hw, 857 + }, 858 + .num_parents = 1, 859 + .flags = CLK_SET_RATE_PARENT, 860 + .ops = &clk_branch2_ops, 861 + }, 862 + }, 863 + }; 864 + 865 + static struct clk_branch cam_cc_csi2phytimer_clk = { 866 + .halt_reg = 0x5064, 867 + .halt_check = BRANCH_HALT, 868 + .clkr = { 869 + .enable_reg = 0x5064, 870 + .enable_mask = BIT(0), 871 + .hw.init = &(const struct clk_init_data) { 872 + .name = "cam_cc_csi2phytimer_clk", 873 + .parent_hws = (const struct clk_hw*[]) { 874 + &cam_cc_csi2phytimer_clk_src.clkr.hw, 875 + }, 876 + .num_parents = 1, 877 + .flags = CLK_SET_RATE_PARENT, 878 + .ops = &clk_branch2_ops, 879 + }, 880 + }, 881 + }; 882 + 883 + static struct clk_branch cam_cc_csiphy0_clk = { 884 + .halt_reg = 0x5020, 885 + .halt_check = BRANCH_HALT, 886 + .clkr = { 887 + .enable_reg = 0x5020, 888 + .enable_mask = BIT(0), 889 + .hw.init = &(const struct clk_init_data) { 890 + .name = "cam_cc_csiphy0_clk", 891 + .parent_hws = (const struct clk_hw*[]) { 892 + &cam_cc_cphy_rx_clk_src.clkr.hw, 893 + }, 894 + .num_parents = 1, 895 + .flags = CLK_SET_RATE_PARENT, 896 + .ops = &clk_branch2_ops, 897 + }, 898 + }, 899 + }; 900 + 901 + static struct clk_branch cam_cc_csiphy1_clk = { 902 + .halt_reg = 0x5044, 903 + .halt_check = BRANCH_HALT, 904 + .clkr = { 905 + .enable_reg = 0x5044, 906 + .enable_mask = BIT(0), 907 + .hw.init = &(const struct clk_init_data) { 908 + .name = "cam_cc_csiphy1_clk", 909 + .parent_hws = (const struct clk_hw*[]) { 910 + &cam_cc_cphy_rx_clk_src.clkr.hw, 911 + }, 912 + .num_parents = 1, 913 + .flags = CLK_SET_RATE_PARENT, 914 + .ops = &clk_branch2_ops, 915 + }, 916 + }, 917 + }; 918 + 919 + static struct clk_branch cam_cc_csiphy2_clk = { 920 + .halt_reg = 0x5068, 921 + .halt_check = BRANCH_HALT, 922 + .clkr = { 923 + .enable_reg = 0x5068, 924 + .enable_mask = BIT(0), 925 + .hw.init = &(const struct clk_init_data) { 926 + .name = "cam_cc_csiphy2_clk", 927 + .parent_hws = (const struct clk_hw*[]) { 928 + &cam_cc_cphy_rx_clk_src.clkr.hw, 929 + }, 930 + .num_parents = 1, 931 + .flags = CLK_SET_RATE_PARENT, 932 + .ops = &clk_branch2_ops, 933 + }, 934 + }, 935 + }; 936 + 937 + static struct clk_branch cam_cc_icp_clk = { 938 + .halt_reg = 0xb0a0, 939 + .halt_check = BRANCH_HALT, 940 + .clkr = { 941 + .enable_reg = 0xb0a0, 942 + .enable_mask = BIT(0), 943 + .hw.init = &(const struct clk_init_data) { 944 + .name = "cam_cc_icp_clk", 945 + .parent_hws = (const struct clk_hw*[]) { 946 + &cam_cc_icp_clk_src.clkr.hw, 947 + }, 948 + .num_parents = 1, 949 + .flags = CLK_SET_RATE_PARENT, 950 + .ops = &clk_branch2_ops, 951 + }, 952 + }, 953 + }; 954 + 955 + static struct clk_branch cam_cc_ife_0_axi_clk = { 956 + .halt_reg = 0x9080, 957 + .halt_check = BRANCH_HALT, 958 + .clkr = { 959 + .enable_reg = 0x9080, 960 + .enable_mask = BIT(0), 961 + .hw.init = &(const struct clk_init_data) { 962 + .name = "cam_cc_ife_0_axi_clk", 963 + .ops = &clk_branch2_ops, 964 + }, 965 + }, 966 + }; 967 + 968 + static struct clk_branch cam_cc_ife_0_clk = { 969 + .halt_reg = 0x9028, 970 + .halt_check = BRANCH_HALT, 971 + .clkr = { 972 + .enable_reg = 0x9028, 973 + .enable_mask = BIT(0), 974 + .hw.init = &(const struct clk_init_data) { 975 + .name = "cam_cc_ife_0_clk", 976 + .parent_hws = (const struct clk_hw*[]) { 977 + &cam_cc_ife_0_clk_src.clkr.hw, 978 + }, 979 + .num_parents = 1, 980 + .flags = CLK_SET_RATE_PARENT, 981 + .ops = &clk_branch2_ops, 982 + }, 983 + }, 984 + }; 985 + 986 + static struct clk_branch cam_cc_ife_0_cphy_rx_clk = { 987 + .halt_reg = 0x907c, 988 + .halt_check = BRANCH_HALT, 989 + .clkr = { 990 + .enable_reg = 0x907c, 991 + .enable_mask = BIT(0), 992 + .hw.init = &(const struct clk_init_data) { 993 + .name = "cam_cc_ife_0_cphy_rx_clk", 994 + .parent_hws = (const struct clk_hw*[]) { 995 + &cam_cc_cphy_rx_clk_src.clkr.hw, 996 + }, 997 + .num_parents = 1, 998 + .flags = CLK_SET_RATE_PARENT, 999 + .ops = &clk_branch2_ops, 1000 + }, 1001 + }, 1002 + }; 1003 + 1004 + static struct clk_branch cam_cc_ife_0_csid_clk = { 1005 + .halt_reg = 0x9054, 1006 + .halt_check = BRANCH_HALT, 1007 + .clkr = { 1008 + .enable_reg = 0x9054, 1009 + .enable_mask = BIT(0), 1010 + .hw.init = &(const struct clk_init_data) { 1011 + .name = "cam_cc_ife_0_csid_clk", 1012 + .parent_hws = (const struct clk_hw*[]) { 1013 + &cam_cc_ife_0_csid_clk_src.clkr.hw, 1014 + }, 1015 + .num_parents = 1, 1016 + .flags = CLK_SET_RATE_PARENT, 1017 + .ops = &clk_branch2_ops, 1018 + }, 1019 + }, 1020 + }; 1021 + 1022 + static struct clk_branch cam_cc_ife_0_dsp_clk = { 1023 + .halt_reg = 0x9038, 1024 + .halt_check = BRANCH_HALT, 1025 + .clkr = { 1026 + .enable_reg = 0x9038, 1027 + .enable_mask = BIT(0), 1028 + .hw.init = &(const struct clk_init_data) { 1029 + .name = "cam_cc_ife_0_dsp_clk", 1030 + .parent_hws = (const struct clk_hw*[]) { 1031 + &cam_cc_ife_0_clk_src.clkr.hw, 1032 + }, 1033 + .num_parents = 1, 1034 + .flags = CLK_SET_RATE_PARENT, 1035 + .ops = &clk_branch2_ops, 1036 + }, 1037 + }, 1038 + }; 1039 + 1040 + static struct clk_branch cam_cc_ife_1_axi_clk = { 1041 + .halt_reg = 0xa058, 1042 + .halt_check = BRANCH_HALT, 1043 + .clkr = { 1044 + .enable_reg = 0xa058, 1045 + .enable_mask = BIT(0), 1046 + .hw.init = &(const struct clk_init_data) { 1047 + .name = "cam_cc_ife_1_axi_clk", 1048 + .ops = &clk_branch2_ops, 1049 + }, 1050 + }, 1051 + }; 1052 + 1053 + static struct clk_branch cam_cc_ife_1_clk = { 1054 + .halt_reg = 0xa028, 1055 + .halt_check = BRANCH_HALT, 1056 + .clkr = { 1057 + .enable_reg = 0xa028, 1058 + .enable_mask = BIT(0), 1059 + .hw.init = &(const struct clk_init_data) { 1060 + .name = "cam_cc_ife_1_clk", 1061 + .parent_hws = (const struct clk_hw*[]) { 1062 + &cam_cc_ife_1_clk_src.clkr.hw, 1063 + }, 1064 + .num_parents = 1, 1065 + .flags = CLK_SET_RATE_PARENT, 1066 + .ops = &clk_branch2_ops, 1067 + }, 1068 + }, 1069 + }; 1070 + 1071 + static struct clk_branch cam_cc_ife_1_cphy_rx_clk = { 1072 + .halt_reg = 0xa054, 1073 + .halt_check = BRANCH_HALT, 1074 + .clkr = { 1075 + .enable_reg = 0xa054, 1076 + .enable_mask = BIT(0), 1077 + .hw.init = &(const struct clk_init_data) { 1078 + .name = "cam_cc_ife_1_cphy_rx_clk", 1079 + .parent_hws = (const struct clk_hw*[]) { 1080 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1081 + }, 1082 + .num_parents = 1, 1083 + .flags = CLK_SET_RATE_PARENT, 1084 + .ops = &clk_branch2_ops, 1085 + }, 1086 + }, 1087 + }; 1088 + 1089 + static struct clk_branch cam_cc_ife_1_csid_clk = { 1090 + .halt_reg = 0xa04c, 1091 + .halt_check = BRANCH_HALT, 1092 + .clkr = { 1093 + .enable_reg = 0xa04c, 1094 + .enable_mask = BIT(0), 1095 + .hw.init = &(const struct clk_init_data) { 1096 + .name = "cam_cc_ife_1_csid_clk", 1097 + .parent_hws = (const struct clk_hw*[]) { 1098 + &cam_cc_ife_1_csid_clk_src.clkr.hw, 1099 + }, 1100 + .num_parents = 1, 1101 + .flags = CLK_SET_RATE_PARENT, 1102 + .ops = &clk_branch2_ops, 1103 + }, 1104 + }, 1105 + }; 1106 + 1107 + static struct clk_branch cam_cc_ife_1_dsp_clk = { 1108 + .halt_reg = 0xa030, 1109 + .halt_check = BRANCH_HALT, 1110 + .clkr = { 1111 + .enable_reg = 0xa030, 1112 + .enable_mask = BIT(0), 1113 + .hw.init = &(const struct clk_init_data) { 1114 + .name = "cam_cc_ife_1_dsp_clk", 1115 + .parent_hws = (const struct clk_hw*[]) { 1116 + &cam_cc_ife_1_clk_src.clkr.hw, 1117 + }, 1118 + .num_parents = 1, 1119 + .flags = CLK_SET_RATE_PARENT, 1120 + .ops = &clk_branch2_ops, 1121 + }, 1122 + }, 1123 + }; 1124 + 1125 + static struct clk_branch cam_cc_ife_lite_clk = { 1126 + .halt_reg = 0xb01c, 1127 + .halt_check = BRANCH_HALT, 1128 + .clkr = { 1129 + .enable_reg = 0xb01c, 1130 + .enable_mask = BIT(0), 1131 + .hw.init = &(const struct clk_init_data) { 1132 + .name = "cam_cc_ife_lite_clk", 1133 + .parent_hws = (const struct clk_hw*[]) { 1134 + &cam_cc_ife_lite_clk_src.clkr.hw, 1135 + }, 1136 + .num_parents = 1, 1137 + .flags = CLK_SET_RATE_PARENT, 1138 + .ops = &clk_branch2_ops, 1139 + }, 1140 + }, 1141 + }; 1142 + 1143 + static struct clk_branch cam_cc_ife_lite_cphy_rx_clk = { 1144 + .halt_reg = 0xb044, 1145 + .halt_check = BRANCH_HALT, 1146 + .clkr = { 1147 + .enable_reg = 0xb044, 1148 + .enable_mask = BIT(0), 1149 + .hw.init = &(const struct clk_init_data) { 1150 + .name = "cam_cc_ife_lite_cphy_rx_clk", 1151 + .parent_hws = (const struct clk_hw*[]) { 1152 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1153 + }, 1154 + .num_parents = 1, 1155 + .flags = CLK_SET_RATE_PARENT, 1156 + .ops = &clk_branch2_ops, 1157 + }, 1158 + }, 1159 + }; 1160 + 1161 + static struct clk_branch cam_cc_ife_lite_csid_clk = { 1162 + .halt_reg = 0xb03c, 1163 + .halt_check = BRANCH_HALT, 1164 + .clkr = { 1165 + .enable_reg = 0xb03c, 1166 + .enable_mask = BIT(0), 1167 + .hw.init = &(const struct clk_init_data) { 1168 + .name = "cam_cc_ife_lite_csid_clk", 1169 + .parent_hws = (const struct clk_hw*[]) { 1170 + &cam_cc_ife_lite_csid_clk_src.clkr.hw, 1171 + }, 1172 + .num_parents = 1, 1173 + .flags = CLK_SET_RATE_PARENT, 1174 + .ops = &clk_branch2_ops, 1175 + }, 1176 + }, 1177 + }; 1178 + 1179 + static struct clk_branch cam_cc_ipe_0_ahb_clk = { 1180 + .halt_reg = 0x7040, 1181 + .halt_check = BRANCH_HALT, 1182 + .clkr = { 1183 + .enable_reg = 0x7040, 1184 + .enable_mask = BIT(0), 1185 + .hw.init = &(const struct clk_init_data) { 1186 + .name = "cam_cc_ipe_0_ahb_clk", 1187 + .parent_hws = (const struct clk_hw*[]) { 1188 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1189 + }, 1190 + .num_parents = 1, 1191 + .flags = CLK_SET_RATE_PARENT, 1192 + .ops = &clk_branch2_ops, 1193 + }, 1194 + }, 1195 + }; 1196 + 1197 + static struct clk_branch cam_cc_ipe_0_areg_clk = { 1198 + .halt_reg = 0x703c, 1199 + .halt_check = BRANCH_HALT, 1200 + .clkr = { 1201 + .enable_reg = 0x703c, 1202 + .enable_mask = BIT(0), 1203 + .hw.init = &(const struct clk_init_data) { 1204 + .name = "cam_cc_ipe_0_areg_clk", 1205 + .parent_hws = (const struct clk_hw*[]) { 1206 + &cam_cc_fast_ahb_clk_src.clkr.hw, 1207 + }, 1208 + .num_parents = 1, 1209 + .flags = CLK_SET_RATE_PARENT, 1210 + .ops = &clk_branch2_ops, 1211 + }, 1212 + }, 1213 + }; 1214 + 1215 + static struct clk_branch cam_cc_ipe_0_axi_clk = { 1216 + .halt_reg = 0x7038, 1217 + .halt_check = BRANCH_HALT, 1218 + .clkr = { 1219 + .enable_reg = 0x7038, 1220 + .enable_mask = BIT(0), 1221 + .hw.init = &(const struct clk_init_data) { 1222 + .name = "cam_cc_ipe_0_axi_clk", 1223 + .ops = &clk_branch2_ops, 1224 + }, 1225 + }, 1226 + }; 1227 + 1228 + static struct clk_branch cam_cc_ipe_0_clk = { 1229 + .halt_reg = 0x7028, 1230 + .halt_check = BRANCH_HALT, 1231 + .clkr = { 1232 + .enable_reg = 0x7028, 1233 + .enable_mask = BIT(0), 1234 + .hw.init = &(const struct clk_init_data) { 1235 + .name = "cam_cc_ipe_0_clk", 1236 + .parent_hws = (const struct clk_hw*[]) { 1237 + &cam_cc_ipe_0_clk_src.clkr.hw, 1238 + }, 1239 + .num_parents = 1, 1240 + .flags = CLK_SET_RATE_PARENT, 1241 + .ops = &clk_branch2_ops, 1242 + }, 1243 + }, 1244 + }; 1245 + 1246 + static struct clk_branch cam_cc_jpeg_clk = { 1247 + .halt_reg = 0xb064, 1248 + .halt_check = BRANCH_HALT, 1249 + .clkr = { 1250 + .enable_reg = 0xb064, 1251 + .enable_mask = BIT(0), 1252 + .hw.init = &(const struct clk_init_data) { 1253 + .name = "cam_cc_jpeg_clk", 1254 + .parent_hws = (const struct clk_hw*[]) { 1255 + &cam_cc_jpeg_clk_src.clkr.hw, 1256 + }, 1257 + .num_parents = 1, 1258 + .flags = CLK_SET_RATE_PARENT, 1259 + .ops = &clk_branch2_ops, 1260 + }, 1261 + }, 1262 + }; 1263 + 1264 + static struct clk_branch cam_cc_lrme_clk = { 1265 + .halt_reg = 0xb110, 1266 + .halt_check = BRANCH_HALT, 1267 + .clkr = { 1268 + .enable_reg = 0xb110, 1269 + .enable_mask = BIT(0), 1270 + .hw.init = &(const struct clk_init_data) { 1271 + .name = "cam_cc_lrme_clk", 1272 + .parent_hws = (const struct clk_hw*[]) { 1273 + &cam_cc_lrme_clk_src.clkr.hw, 1274 + }, 1275 + .num_parents = 1, 1276 + .flags = CLK_SET_RATE_PARENT, 1277 + .ops = &clk_branch2_ops, 1278 + }, 1279 + }, 1280 + }; 1281 + 1282 + static struct clk_branch cam_cc_mclk0_clk = { 1283 + .halt_reg = 0x401c, 1284 + .halt_check = BRANCH_HALT, 1285 + .clkr = { 1286 + .enable_reg = 0x401c, 1287 + .enable_mask = BIT(0), 1288 + .hw.init = &(const struct clk_init_data) { 1289 + .name = "cam_cc_mclk0_clk", 1290 + .parent_hws = (const struct clk_hw*[]) { 1291 + &cam_cc_mclk0_clk_src.clkr.hw, 1292 + }, 1293 + .num_parents = 1, 1294 + .flags = CLK_SET_RATE_PARENT, 1295 + .ops = &clk_branch2_ops, 1296 + }, 1297 + }, 1298 + }; 1299 + 1300 + static struct clk_branch cam_cc_mclk1_clk = { 1301 + .halt_reg = 0x403c, 1302 + .halt_check = BRANCH_HALT, 1303 + .clkr = { 1304 + .enable_reg = 0x403c, 1305 + .enable_mask = BIT(0), 1306 + .hw.init = &(const struct clk_init_data) { 1307 + .name = "cam_cc_mclk1_clk", 1308 + .parent_hws = (const struct clk_hw*[]) { 1309 + &cam_cc_mclk1_clk_src.clkr.hw, 1310 + }, 1311 + .num_parents = 1, 1312 + .flags = CLK_SET_RATE_PARENT, 1313 + .ops = &clk_branch2_ops, 1314 + }, 1315 + }, 1316 + }; 1317 + 1318 + static struct clk_branch cam_cc_mclk2_clk = { 1319 + .halt_reg = 0x405c, 1320 + .halt_check = BRANCH_HALT, 1321 + .clkr = { 1322 + .enable_reg = 0x405c, 1323 + .enable_mask = BIT(0), 1324 + .hw.init = &(const struct clk_init_data) { 1325 + .name = "cam_cc_mclk2_clk", 1326 + .parent_hws = (const struct clk_hw*[]) { 1327 + &cam_cc_mclk2_clk_src.clkr.hw, 1328 + }, 1329 + .num_parents = 1, 1330 + .flags = CLK_SET_RATE_PARENT, 1331 + .ops = &clk_branch2_ops, 1332 + }, 1333 + }, 1334 + }; 1335 + 1336 + static struct clk_branch cam_cc_mclk3_clk = { 1337 + .halt_reg = 0x407c, 1338 + .halt_check = BRANCH_HALT, 1339 + .clkr = { 1340 + .enable_reg = 0x407c, 1341 + .enable_mask = BIT(0), 1342 + .hw.init = &(const struct clk_init_data) { 1343 + .name = "cam_cc_mclk3_clk", 1344 + .parent_hws = (const struct clk_hw*[]) { 1345 + &cam_cc_mclk3_clk_src.clkr.hw, 1346 + }, 1347 + .num_parents = 1, 1348 + .flags = CLK_SET_RATE_PARENT, 1349 + .ops = &clk_branch2_ops, 1350 + }, 1351 + }, 1352 + }; 1353 + 1354 + static struct clk_branch cam_cc_soc_ahb_clk = { 1355 + .halt_reg = 0xb140, 1356 + .halt_check = BRANCH_HALT, 1357 + .clkr = { 1358 + .enable_reg = 0xb140, 1359 + .enable_mask = BIT(0), 1360 + .hw.init = &(const struct clk_init_data) { 1361 + .name = "cam_cc_soc_ahb_clk", 1362 + .ops = &clk_branch2_ops, 1363 + }, 1364 + }, 1365 + }; 1366 + 1367 + static struct clk_branch cam_cc_sys_tmr_clk = { 1368 + .halt_reg = 0xb0a8, 1369 + .halt_check = BRANCH_HALT, 1370 + .clkr = { 1371 + .enable_reg = 0xb0a8, 1372 + .enable_mask = BIT(0), 1373 + .hw.init = &(const struct clk_init_data) { 1374 + .name = "cam_cc_sys_tmr_clk", 1375 + .ops = &clk_branch2_ops, 1376 + }, 1377 + }, 1378 + }; 1379 + 1380 + static struct gdsc titan_top_gdsc = { 1381 + .gdscr = 0xb134, 1382 + .en_rest_wait_val = 0x2, 1383 + .en_few_wait_val = 0x2, 1384 + .clk_dis_wait_val = 0xf, 1385 + .pd = { 1386 + .name = "titan_top_gdsc", 1387 + }, 1388 + .pwrsts = PWRSTS_OFF_ON, 1389 + .flags = POLL_CFG_GDSCR, 1390 + }; 1391 + 1392 + static struct gdsc bps_gdsc = { 1393 + .gdscr = 0x6004, 1394 + .en_rest_wait_val = 0x2, 1395 + .en_few_wait_val = 0x2, 1396 + .clk_dis_wait_val = 0xf, 1397 + .pd = { 1398 + .name = "bps_gdsc", 1399 + }, 1400 + .pwrsts = PWRSTS_OFF_ON, 1401 + .parent = &titan_top_gdsc.pd, 1402 + .flags = POLL_CFG_GDSCR, 1403 + }; 1404 + 1405 + static struct gdsc ife_0_gdsc = { 1406 + .gdscr = 0x9004, 1407 + .en_rest_wait_val = 0x2, 1408 + .en_few_wait_val = 0x2, 1409 + .clk_dis_wait_val = 0xf, 1410 + .pd = { 1411 + .name = "ife_0_gdsc", 1412 + }, 1413 + .pwrsts = PWRSTS_OFF_ON, 1414 + .parent = &titan_top_gdsc.pd, 1415 + .flags = POLL_CFG_GDSCR, 1416 + }; 1417 + 1418 + static struct gdsc ife_1_gdsc = { 1419 + .gdscr = 0xa004, 1420 + .en_rest_wait_val = 0x2, 1421 + .en_few_wait_val = 0x2, 1422 + .clk_dis_wait_val = 0xf, 1423 + .pd = { 1424 + .name = "ife_1_gdsc", 1425 + }, 1426 + .pwrsts = PWRSTS_OFF_ON, 1427 + .parent = &titan_top_gdsc.pd, 1428 + .flags = POLL_CFG_GDSCR, 1429 + }; 1430 + 1431 + static struct gdsc ipe_0_gdsc = { 1432 + .gdscr = 0x7004, 1433 + .en_rest_wait_val = 0x2, 1434 + .en_few_wait_val = 0x2, 1435 + .clk_dis_wait_val = 0xf, 1436 + .pd = { 1437 + .name = "ipe_0_gdsc", 1438 + }, 1439 + .pwrsts = PWRSTS_OFF_ON, 1440 + .parent = &titan_top_gdsc.pd, 1441 + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 1442 + }; 1443 + 1444 + static struct clk_regmap *cam_cc_qcs615_clocks[] = { 1445 + [CAM_CC_BPS_AHB_CLK] = &cam_cc_bps_ahb_clk.clkr, 1446 + [CAM_CC_BPS_AREG_CLK] = &cam_cc_bps_areg_clk.clkr, 1447 + [CAM_CC_BPS_AXI_CLK] = &cam_cc_bps_axi_clk.clkr, 1448 + [CAM_CC_BPS_CLK] = &cam_cc_bps_clk.clkr, 1449 + [CAM_CC_BPS_CLK_SRC] = &cam_cc_bps_clk_src.clkr, 1450 + [CAM_CC_CAMNOC_AXI_CLK] = &cam_cc_camnoc_axi_clk.clkr, 1451 + [CAM_CC_CCI_CLK] = &cam_cc_cci_clk.clkr, 1452 + [CAM_CC_CCI_CLK_SRC] = &cam_cc_cci_clk_src.clkr, 1453 + [CAM_CC_CORE_AHB_CLK] = &cam_cc_core_ahb_clk.clkr, 1454 + [CAM_CC_CPAS_AHB_CLK] = &cam_cc_cpas_ahb_clk.clkr, 1455 + [CAM_CC_CPHY_RX_CLK_SRC] = &cam_cc_cphy_rx_clk_src.clkr, 1456 + [CAM_CC_CSI0PHYTIMER_CLK] = &cam_cc_csi0phytimer_clk.clkr, 1457 + [CAM_CC_CSI0PHYTIMER_CLK_SRC] = &cam_cc_csi0phytimer_clk_src.clkr, 1458 + [CAM_CC_CSI1PHYTIMER_CLK] = &cam_cc_csi1phytimer_clk.clkr, 1459 + [CAM_CC_CSI1PHYTIMER_CLK_SRC] = &cam_cc_csi1phytimer_clk_src.clkr, 1460 + [CAM_CC_CSI2PHYTIMER_CLK] = &cam_cc_csi2phytimer_clk.clkr, 1461 + [CAM_CC_CSI2PHYTIMER_CLK_SRC] = &cam_cc_csi2phytimer_clk_src.clkr, 1462 + [CAM_CC_CSIPHY0_CLK] = &cam_cc_csiphy0_clk.clkr, 1463 + [CAM_CC_CSIPHY1_CLK] = &cam_cc_csiphy1_clk.clkr, 1464 + [CAM_CC_CSIPHY2_CLK] = &cam_cc_csiphy2_clk.clkr, 1465 + [CAM_CC_FAST_AHB_CLK_SRC] = &cam_cc_fast_ahb_clk_src.clkr, 1466 + [CAM_CC_ICP_CLK] = &cam_cc_icp_clk.clkr, 1467 + [CAM_CC_ICP_CLK_SRC] = &cam_cc_icp_clk_src.clkr, 1468 + [CAM_CC_IFE_0_AXI_CLK] = &cam_cc_ife_0_axi_clk.clkr, 1469 + [CAM_CC_IFE_0_CLK] = &cam_cc_ife_0_clk.clkr, 1470 + [CAM_CC_IFE_0_CLK_SRC] = &cam_cc_ife_0_clk_src.clkr, 1471 + [CAM_CC_IFE_0_CPHY_RX_CLK] = &cam_cc_ife_0_cphy_rx_clk.clkr, 1472 + [CAM_CC_IFE_0_CSID_CLK] = &cam_cc_ife_0_csid_clk.clkr, 1473 + [CAM_CC_IFE_0_CSID_CLK_SRC] = &cam_cc_ife_0_csid_clk_src.clkr, 1474 + [CAM_CC_IFE_0_DSP_CLK] = &cam_cc_ife_0_dsp_clk.clkr, 1475 + [CAM_CC_IFE_1_AXI_CLK] = &cam_cc_ife_1_axi_clk.clkr, 1476 + [CAM_CC_IFE_1_CLK] = &cam_cc_ife_1_clk.clkr, 1477 + [CAM_CC_IFE_1_CLK_SRC] = &cam_cc_ife_1_clk_src.clkr, 1478 + [CAM_CC_IFE_1_CPHY_RX_CLK] = &cam_cc_ife_1_cphy_rx_clk.clkr, 1479 + [CAM_CC_IFE_1_CSID_CLK] = &cam_cc_ife_1_csid_clk.clkr, 1480 + [CAM_CC_IFE_1_CSID_CLK_SRC] = &cam_cc_ife_1_csid_clk_src.clkr, 1481 + [CAM_CC_IFE_1_DSP_CLK] = &cam_cc_ife_1_dsp_clk.clkr, 1482 + [CAM_CC_IFE_LITE_CLK] = &cam_cc_ife_lite_clk.clkr, 1483 + [CAM_CC_IFE_LITE_CLK_SRC] = &cam_cc_ife_lite_clk_src.clkr, 1484 + [CAM_CC_IFE_LITE_CPHY_RX_CLK] = &cam_cc_ife_lite_cphy_rx_clk.clkr, 1485 + [CAM_CC_IFE_LITE_CSID_CLK] = &cam_cc_ife_lite_csid_clk.clkr, 1486 + [CAM_CC_IFE_LITE_CSID_CLK_SRC] = &cam_cc_ife_lite_csid_clk_src.clkr, 1487 + [CAM_CC_IPE_0_AHB_CLK] = &cam_cc_ipe_0_ahb_clk.clkr, 1488 + [CAM_CC_IPE_0_AREG_CLK] = &cam_cc_ipe_0_areg_clk.clkr, 1489 + [CAM_CC_IPE_0_AXI_CLK] = &cam_cc_ipe_0_axi_clk.clkr, 1490 + [CAM_CC_IPE_0_CLK] = &cam_cc_ipe_0_clk.clkr, 1491 + [CAM_CC_IPE_0_CLK_SRC] = &cam_cc_ipe_0_clk_src.clkr, 1492 + [CAM_CC_JPEG_CLK] = &cam_cc_jpeg_clk.clkr, 1493 + [CAM_CC_JPEG_CLK_SRC] = &cam_cc_jpeg_clk_src.clkr, 1494 + [CAM_CC_LRME_CLK] = &cam_cc_lrme_clk.clkr, 1495 + [CAM_CC_LRME_CLK_SRC] = &cam_cc_lrme_clk_src.clkr, 1496 + [CAM_CC_MCLK0_CLK] = &cam_cc_mclk0_clk.clkr, 1497 + [CAM_CC_MCLK0_CLK_SRC] = &cam_cc_mclk0_clk_src.clkr, 1498 + [CAM_CC_MCLK1_CLK] = &cam_cc_mclk1_clk.clkr, 1499 + [CAM_CC_MCLK1_CLK_SRC] = &cam_cc_mclk1_clk_src.clkr, 1500 + [CAM_CC_MCLK2_CLK] = &cam_cc_mclk2_clk.clkr, 1501 + [CAM_CC_MCLK2_CLK_SRC] = &cam_cc_mclk2_clk_src.clkr, 1502 + [CAM_CC_MCLK3_CLK] = &cam_cc_mclk3_clk.clkr, 1503 + [CAM_CC_MCLK3_CLK_SRC] = &cam_cc_mclk3_clk_src.clkr, 1504 + [CAM_CC_PLL0] = &cam_cc_pll0.clkr, 1505 + [CAM_CC_PLL1] = &cam_cc_pll1.clkr, 1506 + [CAM_CC_PLL2] = &cam_cc_pll2.clkr, 1507 + [CAM_CC_PLL2_OUT_AUX2] = &cam_cc_pll2_out_aux2.clkr, 1508 + [CAM_CC_PLL3] = &cam_cc_pll3.clkr, 1509 + [CAM_CC_SLOW_AHB_CLK_SRC] = &cam_cc_slow_ahb_clk_src.clkr, 1510 + [CAM_CC_SOC_AHB_CLK] = &cam_cc_soc_ahb_clk.clkr, 1511 + [CAM_CC_SYS_TMR_CLK] = &cam_cc_sys_tmr_clk.clkr, 1512 + }; 1513 + 1514 + static struct gdsc *cam_cc_qcs615_gdscs[] = { 1515 + [BPS_GDSC] = &bps_gdsc, 1516 + [IFE_0_GDSC] = &ife_0_gdsc, 1517 + [IFE_1_GDSC] = &ife_1_gdsc, 1518 + [IPE_0_GDSC] = &ipe_0_gdsc, 1519 + [TITAN_TOP_GDSC] = &titan_top_gdsc, 1520 + }; 1521 + 1522 + static const struct qcom_reset_map cam_cc_qcs615_resets[] = { 1523 + [CAM_CC_BPS_BCR] = { 0x6000 }, 1524 + [CAM_CC_CAMNOC_BCR] = { 0xb120 }, 1525 + [CAM_CC_CCI_BCR] = { 0xb0d4 }, 1526 + [CAM_CC_CPAS_BCR] = { 0xb118 }, 1527 + [CAM_CC_CSI0PHY_BCR] = { 0x5000 }, 1528 + [CAM_CC_CSI1PHY_BCR] = { 0x5024 }, 1529 + [CAM_CC_CSI2PHY_BCR] = { 0x5048 }, 1530 + [CAM_CC_ICP_BCR] = { 0xb074 }, 1531 + [CAM_CC_IFE_0_BCR] = { 0x9000 }, 1532 + [CAM_CC_IFE_1_BCR] = { 0xa000 }, 1533 + [CAM_CC_IFE_LITE_BCR] = { 0xb000 }, 1534 + [CAM_CC_IPE_0_BCR] = { 0x7000 }, 1535 + [CAM_CC_JPEG_BCR] = { 0xb048 }, 1536 + [CAM_CC_LRME_BCR] = { 0xb0f4 }, 1537 + [CAM_CC_MCLK0_BCR] = { 0x4000 }, 1538 + [CAM_CC_MCLK1_BCR] = { 0x4020 }, 1539 + [CAM_CC_MCLK2_BCR] = { 0x4040 }, 1540 + [CAM_CC_MCLK3_BCR] = { 0x4060 }, 1541 + [CAM_CC_TITAN_TOP_BCR] = { 0xb130 }, 1542 + }; 1543 + 1544 + static struct clk_alpha_pll *cam_cc_qcs615_plls[] = { 1545 + &cam_cc_pll0, 1546 + &cam_cc_pll1, 1547 + &cam_cc_pll2, 1548 + &cam_cc_pll3, 1549 + }; 1550 + 1551 + static const struct regmap_config cam_cc_qcs615_regmap_config = { 1552 + .reg_bits = 32, 1553 + .reg_stride = 4, 1554 + .val_bits = 32, 1555 + .max_register = 0xd004, 1556 + .fast_io = true, 1557 + }; 1558 + 1559 + static struct qcom_cc_driver_data cam_cc_qcs615_driver_data = { 1560 + .alpha_plls = cam_cc_qcs615_plls, 1561 + .num_alpha_plls = ARRAY_SIZE(cam_cc_qcs615_plls), 1562 + }; 1563 + 1564 + static const struct qcom_cc_desc cam_cc_qcs615_desc = { 1565 + .config = &cam_cc_qcs615_regmap_config, 1566 + .clks = cam_cc_qcs615_clocks, 1567 + .num_clks = ARRAY_SIZE(cam_cc_qcs615_clocks), 1568 + .resets = cam_cc_qcs615_resets, 1569 + .num_resets = ARRAY_SIZE(cam_cc_qcs615_resets), 1570 + .gdscs = cam_cc_qcs615_gdscs, 1571 + .num_gdscs = ARRAY_SIZE(cam_cc_qcs615_gdscs), 1572 + .driver_data = &cam_cc_qcs615_driver_data, 1573 + }; 1574 + 1575 + static const struct of_device_id cam_cc_qcs615_match_table[] = { 1576 + { .compatible = "qcom,qcs615-camcc" }, 1577 + { } 1578 + }; 1579 + MODULE_DEVICE_TABLE(of, cam_cc_qcs615_match_table); 1580 + 1581 + static int cam_cc_qcs615_probe(struct platform_device *pdev) 1582 + { 1583 + return qcom_cc_probe(pdev, &cam_cc_qcs615_desc); 1584 + } 1585 + 1586 + static struct platform_driver cam_cc_qcs615_driver = { 1587 + .probe = cam_cc_qcs615_probe, 1588 + .driver = { 1589 + .name = "camcc-qcs615", 1590 + .of_match_table = cam_cc_qcs615_match_table, 1591 + }, 1592 + }; 1593 + 1594 + module_platform_driver(cam_cc_qcs615_driver); 1595 + 1596 + MODULE_DESCRIPTION("QTI CAMCC QCS615 Driver"); 1597 + MODULE_LICENSE("GPL");
+2889
drivers/clk/qcom/camcc-sc8180x.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #include <linux/clk-provider.h> 7 + #include <linux/mod_devicetable.h> 8 + #include <linux/module.h> 9 + #include <linux/platform_device.h> 10 + #include <linux/pm_runtime.h> 11 + #include <linux/regmap.h> 12 + 13 + #include <dt-bindings/clock/qcom,sc8180x-camcc.h> 14 + 15 + #include "clk-alpha-pll.h" 16 + #include "clk-branch.h" 17 + #include "clk-rcg.h" 18 + #include "clk-regmap.h" 19 + #include "common.h" 20 + #include "gdsc.h" 21 + #include "reset.h" 22 + 23 + enum { 24 + DT_IFACE, 25 + DT_BI_TCXO, 26 + DT_SLEEP_CLK, 27 + }; 28 + 29 + enum { 30 + P_BI_TCXO, 31 + P_CAM_CC_PLL0_OUT_EVEN, 32 + P_CAM_CC_PLL0_OUT_MAIN, 33 + P_CAM_CC_PLL0_OUT_ODD, 34 + P_CAM_CC_PLL1_OUT_EVEN, 35 + P_CAM_CC_PLL2_OUT_EARLY, 36 + P_CAM_CC_PLL2_OUT_MAIN, 37 + P_CAM_CC_PLL3_OUT_EVEN, 38 + P_CAM_CC_PLL4_OUT_EVEN, 39 + P_CAM_CC_PLL5_OUT_EVEN, 40 + P_CAM_CC_PLL6_OUT_EVEN, 41 + P_SLEEP_CLK, 42 + }; 43 + 44 + static const struct pll_vco regera_vco[] = { 45 + { 600000000, 3300000000, 0 }, 46 + }; 47 + 48 + static const struct pll_vco trion_vco[] = { 49 + { 249600000, 2000000000, 0 }, 50 + }; 51 + 52 + static const struct alpha_pll_config cam_cc_pll0_config = { 53 + .l = 0x3e, 54 + .alpha = 0x8000, 55 + .config_ctl_val = 0x20485699, 56 + .config_ctl_hi_val = 0x00002267, 57 + .config_ctl_hi1_val = 0x00000024, 58 + .test_ctl_hi1_val = 0x00000020, 59 + .user_ctl_val = 0x00003100, 60 + .user_ctl_hi_val = 0x00000805, 61 + .user_ctl_hi1_val = 0x000000d0, 62 + }; 63 + 64 + static struct clk_alpha_pll cam_cc_pll0 = { 65 + .offset = 0x0, 66 + .vco_table = trion_vco, 67 + .num_vco = ARRAY_SIZE(trion_vco), 68 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION], 69 + .clkr = { 70 + .hw.init = &(const struct clk_init_data) { 71 + .name = "cam_cc_pll0", 72 + .parent_data = &(const struct clk_parent_data) { 73 + .index = DT_BI_TCXO, 74 + }, 75 + .num_parents = 1, 76 + .ops = &clk_alpha_pll_trion_ops, 77 + }, 78 + }, 79 + }; 80 + 81 + static const struct clk_div_table post_div_table_cam_cc_pll0_out_even[] = { 82 + { 0x1, 2 }, 83 + { } 84 + }; 85 + 86 + static struct clk_alpha_pll_postdiv cam_cc_pll0_out_even = { 87 + .offset = 0x0, 88 + .post_div_shift = 8, 89 + .post_div_table = post_div_table_cam_cc_pll0_out_even, 90 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll0_out_even), 91 + .width = 4, 92 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION], 93 + .clkr.hw.init = &(const struct clk_init_data) { 94 + .name = "cam_cc_pll0_out_even", 95 + .parent_hws = (const struct clk_hw*[]) { 96 + &cam_cc_pll0.clkr.hw, 97 + }, 98 + .num_parents = 1, 99 + .flags = CLK_SET_RATE_PARENT, 100 + .ops = &clk_alpha_pll_postdiv_trion_ops, 101 + }, 102 + }; 103 + 104 + static const struct clk_div_table post_div_table_cam_cc_pll0_out_odd[] = { 105 + { 0x3, 3 }, 106 + { } 107 + }; 108 + 109 + static struct clk_alpha_pll_postdiv cam_cc_pll0_out_odd = { 110 + .offset = 0x0, 111 + .post_div_shift = 12, 112 + .post_div_table = post_div_table_cam_cc_pll0_out_odd, 113 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll0_out_odd), 114 + .width = 4, 115 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION], 116 + .clkr.hw.init = &(const struct clk_init_data) { 117 + .name = "cam_cc_pll0_out_odd", 118 + .parent_hws = (const struct clk_hw*[]) { 119 + &cam_cc_pll0.clkr.hw, 120 + }, 121 + .num_parents = 1, 122 + .flags = CLK_SET_RATE_PARENT, 123 + .ops = &clk_alpha_pll_postdiv_trion_ops, 124 + }, 125 + }; 126 + 127 + static const struct alpha_pll_config cam_cc_pll1_config = { 128 + .l = 0x13, 129 + .alpha = 0x8800, 130 + .config_ctl_val = 0x20485699, 131 + .config_ctl_hi_val = 0x00002267, 132 + .config_ctl_hi1_val = 0x00000024, 133 + .test_ctl_hi1_val = 0x00000020, 134 + .user_ctl_val = 0x00000000, 135 + .user_ctl_hi_val = 0x00000805, 136 + .user_ctl_hi1_val = 0x000000d0, 137 + }; 138 + 139 + static struct clk_alpha_pll cam_cc_pll1 = { 140 + .offset = 0x1000, 141 + .vco_table = trion_vco, 142 + .num_vco = ARRAY_SIZE(trion_vco), 143 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION], 144 + .clkr = { 145 + .hw.init = &(const struct clk_init_data) { 146 + .name = "cam_cc_pll1", 147 + .parent_data = &(const struct clk_parent_data) { 148 + .index = DT_BI_TCXO, 149 + }, 150 + .num_parents = 1, 151 + .ops = &clk_alpha_pll_trion_ops, 152 + }, 153 + }, 154 + }; 155 + 156 + static const struct alpha_pll_config cam_cc_pll2_config = { 157 + .l = 0x32, 158 + .alpha = 0x0, 159 + .config_ctl_val = 0x10000807, 160 + .config_ctl_hi_val = 0x00000011, 161 + .config_ctl_hi1_val = 0x04300142, 162 + .test_ctl_val = 0x04000400, 163 + .test_ctl_hi_val = 0x00004000, 164 + .test_ctl_hi1_val = 0x00000000, 165 + .user_ctl_val = 0x00000100, 166 + }; 167 + 168 + static struct clk_alpha_pll cam_cc_pll2 = { 169 + .offset = 0x2000, 170 + .vco_table = regera_vco, 171 + .num_vco = ARRAY_SIZE(regera_vco), 172 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_REGERA], 173 + .clkr = { 174 + .hw.init = &(const struct clk_init_data) { 175 + .name = "cam_cc_pll2", 176 + .parent_data = &(const struct clk_parent_data) { 177 + .index = DT_BI_TCXO, 178 + }, 179 + .num_parents = 1, 180 + .ops = &clk_alpha_pll_regera_ops, 181 + }, 182 + }, 183 + }; 184 + 185 + static const struct clk_div_table post_div_table_cam_cc_pll2_out_main[] = { 186 + { 0x1, 2 }, 187 + { } 188 + }; 189 + 190 + static struct clk_alpha_pll_postdiv cam_cc_pll2_out_main = { 191 + .offset = 0x2000, 192 + .post_div_shift = 8, 193 + .post_div_table = post_div_table_cam_cc_pll2_out_main, 194 + .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll2_out_main), 195 + .width = 2, 196 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_REGERA], 197 + .clkr.hw.init = &(const struct clk_init_data) { 198 + .name = "cam_cc_pll2_out_main", 199 + .parent_hws = (const struct clk_hw*[]) { 200 + &cam_cc_pll2.clkr.hw, 201 + }, 202 + .num_parents = 1, 203 + .flags = CLK_SET_RATE_PARENT, 204 + .ops = &clk_alpha_pll_postdiv_trion_ops, 205 + }, 206 + }; 207 + 208 + static const struct alpha_pll_config cam_cc_pll3_config = { 209 + .l = 0x14, 210 + .alpha = 0xd555, 211 + .config_ctl_val = 0x20485699, 212 + .config_ctl_hi_val = 0x00002267, 213 + .config_ctl_hi1_val = 0x00000024, 214 + .test_ctl_hi1_val = 0x00000020, 215 + .user_ctl_val = 0x00000000, 216 + .user_ctl_hi_val = 0x00000805, 217 + .user_ctl_hi1_val = 0x000000d0, 218 + }; 219 + 220 + static struct clk_alpha_pll cam_cc_pll3 = { 221 + .offset = 0x3000, 222 + .vco_table = trion_vco, 223 + .num_vco = ARRAY_SIZE(trion_vco), 224 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION], 225 + .clkr = { 226 + .hw.init = &(const struct clk_init_data) { 227 + .name = "cam_cc_pll3", 228 + .parent_data = &(const struct clk_parent_data) { 229 + .index = DT_BI_TCXO, 230 + }, 231 + .num_parents = 1, 232 + .ops = &clk_alpha_pll_trion_ops, 233 + }, 234 + }, 235 + }; 236 + 237 + static const struct alpha_pll_config cam_cc_pll4_config = { 238 + .l = 0x14, 239 + .alpha = 0xd555, 240 + .config_ctl_val = 0x20485699, 241 + .config_ctl_hi_val = 0x00002267, 242 + .config_ctl_hi1_val = 0x00000024, 243 + .test_ctl_hi1_val = 0x00000020, 244 + .user_ctl_val = 0x00000000, 245 + .user_ctl_hi_val = 0x00000805, 246 + .user_ctl_hi1_val = 0x000000d0, 247 + }; 248 + 249 + static struct clk_alpha_pll cam_cc_pll4 = { 250 + .offset = 0x4000, 251 + .vco_table = trion_vco, 252 + .num_vco = ARRAY_SIZE(trion_vco), 253 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION], 254 + .clkr = { 255 + .hw.init = &(const struct clk_init_data) { 256 + .name = "cam_cc_pll4", 257 + .parent_data = &(const struct clk_parent_data) { 258 + .index = DT_BI_TCXO, 259 + }, 260 + .num_parents = 1, 261 + .ops = &clk_alpha_pll_trion_ops, 262 + }, 263 + }, 264 + }; 265 + 266 + static const struct alpha_pll_config cam_cc_pll5_config = { 267 + .l = 0x14, 268 + .alpha = 0xd555, 269 + .config_ctl_val = 0x20485699, 270 + .config_ctl_hi_val = 0x00002267, 271 + .config_ctl_hi1_val = 0x00000024, 272 + .test_ctl_hi1_val = 0x00000020, 273 + .user_ctl_val = 0x00000000, 274 + .user_ctl_hi_val = 0x00000805, 275 + .user_ctl_hi1_val = 0x000000d0, 276 + }; 277 + 278 + static struct clk_alpha_pll cam_cc_pll5 = { 279 + .offset = 0x4078, 280 + .vco_table = trion_vco, 281 + .num_vco = ARRAY_SIZE(trion_vco), 282 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION], 283 + .clkr = { 284 + .hw.init = &(const struct clk_init_data) { 285 + .name = "cam_cc_pll5", 286 + .parent_data = &(const struct clk_parent_data) { 287 + .index = DT_BI_TCXO, 288 + }, 289 + .num_parents = 1, 290 + .ops = &clk_alpha_pll_trion_ops, 291 + }, 292 + }, 293 + }; 294 + 295 + static const struct alpha_pll_config cam_cc_pll6_config = { 296 + .l = 0x14, 297 + .alpha = 0xd555, 298 + .config_ctl_val = 0x20485699, 299 + .config_ctl_hi_val = 0x00002267, 300 + .config_ctl_hi1_val = 0x00000024, 301 + .test_ctl_hi1_val = 0x00000020, 302 + .user_ctl_val = 0x00000000, 303 + .user_ctl_hi_val = 0x00000805, 304 + .user_ctl_hi1_val = 0x000000d0, 305 + }; 306 + 307 + static struct clk_alpha_pll cam_cc_pll6 = { 308 + .offset = 0x40f0, 309 + .vco_table = trion_vco, 310 + .num_vco = ARRAY_SIZE(trion_vco), 311 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION], 312 + .clkr = { 313 + .hw.init = &(const struct clk_init_data) { 314 + .name = "cam_cc_pll6", 315 + .parent_data = &(const struct clk_parent_data) { 316 + .index = DT_BI_TCXO, 317 + }, 318 + .num_parents = 1, 319 + .ops = &clk_alpha_pll_trion_ops, 320 + }, 321 + }, 322 + }; 323 + 324 + static const struct parent_map cam_cc_parent_map_0[] = { 325 + { P_BI_TCXO, 0 }, 326 + { P_CAM_CC_PLL0_OUT_MAIN, 1 }, 327 + { P_CAM_CC_PLL0_OUT_EVEN, 2 }, 328 + { P_CAM_CC_PLL0_OUT_ODD, 3 }, 329 + { P_CAM_CC_PLL2_OUT_MAIN, 5 }, 330 + }; 331 + 332 + static const struct clk_parent_data cam_cc_parent_data_0[] = { 333 + { .index = DT_BI_TCXO }, 334 + { .hw = &cam_cc_pll0.clkr.hw }, 335 + { .hw = &cam_cc_pll0_out_even.clkr.hw }, 336 + { .hw = &cam_cc_pll0_out_odd.clkr.hw }, 337 + { .hw = &cam_cc_pll2_out_main.clkr.hw }, 338 + }; 339 + 340 + static const struct parent_map cam_cc_parent_map_1[] = { 341 + { P_BI_TCXO, 0 }, 342 + { P_CAM_CC_PLL2_OUT_EARLY, 5 }, 343 + }; 344 + 345 + static const struct clk_parent_data cam_cc_parent_data_1[] = { 346 + { .index = DT_BI_TCXO }, 347 + { .hw = &cam_cc_pll2.clkr.hw }, 348 + }; 349 + 350 + static const struct parent_map cam_cc_parent_map_2[] = { 351 + { P_BI_TCXO, 0 }, 352 + { P_CAM_CC_PLL3_OUT_EVEN, 6 }, 353 + }; 354 + 355 + static const struct clk_parent_data cam_cc_parent_data_2[] = { 356 + { .index = DT_BI_TCXO }, 357 + { .hw = &cam_cc_pll3.clkr.hw }, 358 + }; 359 + 360 + static const struct parent_map cam_cc_parent_map_3[] = { 361 + { P_BI_TCXO, 0 }, 362 + { P_CAM_CC_PLL4_OUT_EVEN, 6 }, 363 + }; 364 + 365 + static const struct clk_parent_data cam_cc_parent_data_3[] = { 366 + { .index = DT_BI_TCXO }, 367 + { .hw = &cam_cc_pll4.clkr.hw }, 368 + }; 369 + 370 + static const struct parent_map cam_cc_parent_map_4[] = { 371 + { P_BI_TCXO, 0 }, 372 + { P_CAM_CC_PLL5_OUT_EVEN, 6 }, 373 + }; 374 + 375 + static const struct clk_parent_data cam_cc_parent_data_4[] = { 376 + { .index = DT_BI_TCXO }, 377 + { .hw = &cam_cc_pll5.clkr.hw }, 378 + }; 379 + 380 + static const struct parent_map cam_cc_parent_map_5[] = { 381 + { P_BI_TCXO, 0 }, 382 + { P_CAM_CC_PLL6_OUT_EVEN, 6 }, 383 + }; 384 + 385 + static const struct clk_parent_data cam_cc_parent_data_5[] = { 386 + { .index = DT_BI_TCXO }, 387 + { .hw = &cam_cc_pll6.clkr.hw }, 388 + }; 389 + 390 + static const struct parent_map cam_cc_parent_map_6[] = { 391 + { P_BI_TCXO, 0 }, 392 + { P_CAM_CC_PLL1_OUT_EVEN, 4 }, 393 + }; 394 + 395 + static const struct clk_parent_data cam_cc_parent_data_6[] = { 396 + { .index = DT_BI_TCXO }, 397 + { .hw = &cam_cc_pll1.clkr.hw }, 398 + }; 399 + 400 + static const struct parent_map cam_cc_parent_map_7[] = { 401 + { P_BI_TCXO, 0 }, 402 + }; 403 + 404 + static const struct clk_parent_data cam_cc_parent_data_7[] = { 405 + { .index = DT_BI_TCXO }, 406 + }; 407 + 408 + static const struct freq_tbl ftbl_cam_cc_bps_clk_src[] = { 409 + F(19200000, P_BI_TCXO, 1, 0, 0), 410 + F(100000000, P_CAM_CC_PLL0_OUT_EVEN, 6, 0, 0), 411 + F(200000000, P_CAM_CC_PLL0_OUT_ODD, 2, 0, 0), 412 + F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0), 413 + F(480000000, P_CAM_CC_PLL2_OUT_MAIN, 1, 0, 0), 414 + F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0), 415 + { } 416 + }; 417 + 418 + static struct clk_rcg2 cam_cc_bps_clk_src = { 419 + .cmd_rcgr = 0x7010, 420 + .mnd_width = 0, 421 + .hid_width = 5, 422 + .parent_map = cam_cc_parent_map_0, 423 + .freq_tbl = ftbl_cam_cc_bps_clk_src, 424 + .clkr.hw.init = &(const struct clk_init_data) { 425 + .name = "cam_cc_bps_clk_src", 426 + .parent_data = cam_cc_parent_data_0, 427 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 428 + .flags = CLK_SET_RATE_PARENT, 429 + .ops = &clk_rcg2_shared_ops, 430 + }, 431 + }; 432 + 433 + static const struct freq_tbl ftbl_cam_cc_camnoc_axi_clk_src[] = { 434 + F(19200000, P_BI_TCXO, 1, 0, 0), 435 + F(150000000, P_CAM_CC_PLL0_OUT_EVEN, 4, 0, 0), 436 + F(266666667, P_CAM_CC_PLL0_OUT_ODD, 1.5, 0, 0), 437 + F(320000000, P_CAM_CC_PLL2_OUT_MAIN, 1.5, 0, 0), 438 + F(400000000, P_CAM_CC_PLL0_OUT_MAIN, 3, 0, 0), 439 + F(480000000, P_CAM_CC_PLL2_OUT_MAIN, 1, 0, 0), 440 + { } 441 + }; 442 + 443 + static struct clk_rcg2 cam_cc_camnoc_axi_clk_src = { 444 + .cmd_rcgr = 0xc170, 445 + .mnd_width = 0, 446 + .hid_width = 5, 447 + .parent_map = cam_cc_parent_map_0, 448 + .freq_tbl = ftbl_cam_cc_camnoc_axi_clk_src, 449 + .clkr.hw.init = &(const struct clk_init_data) { 450 + .name = "cam_cc_camnoc_axi_clk_src", 451 + .parent_data = cam_cc_parent_data_0, 452 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 453 + .flags = CLK_SET_RATE_PARENT, 454 + .ops = &clk_rcg2_shared_ops, 455 + }, 456 + }; 457 + 458 + static const struct freq_tbl ftbl_cam_cc_cci_0_clk_src[] = { 459 + F(19200000, P_BI_TCXO, 1, 0, 0), 460 + F(37500000, P_CAM_CC_PLL0_OUT_EVEN, 16, 0, 0), 461 + { } 462 + }; 463 + 464 + static struct clk_rcg2 cam_cc_cci_0_clk_src = { 465 + .cmd_rcgr = 0xc108, 466 + .mnd_width = 8, 467 + .hid_width = 5, 468 + .parent_map = cam_cc_parent_map_0, 469 + .freq_tbl = ftbl_cam_cc_cci_0_clk_src, 470 + .clkr.hw.init = &(const struct clk_init_data) { 471 + .name = "cam_cc_cci_0_clk_src", 472 + .parent_data = cam_cc_parent_data_0, 473 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 474 + .flags = CLK_SET_RATE_PARENT, 475 + .ops = &clk_rcg2_shared_ops, 476 + }, 477 + }; 478 + 479 + static struct clk_rcg2 cam_cc_cci_1_clk_src = { 480 + .cmd_rcgr = 0xc124, 481 + .mnd_width = 8, 482 + .hid_width = 5, 483 + .parent_map = cam_cc_parent_map_0, 484 + .freq_tbl = ftbl_cam_cc_cci_0_clk_src, 485 + .clkr.hw.init = &(const struct clk_init_data) { 486 + .name = "cam_cc_cci_1_clk_src", 487 + .parent_data = cam_cc_parent_data_0, 488 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 489 + .flags = CLK_SET_RATE_PARENT, 490 + .ops = &clk_rcg2_shared_ops, 491 + }, 492 + }; 493 + 494 + static struct clk_rcg2 cam_cc_cci_2_clk_src = { 495 + .cmd_rcgr = 0xc204, 496 + .mnd_width = 8, 497 + .hid_width = 5, 498 + .parent_map = cam_cc_parent_map_0, 499 + .freq_tbl = ftbl_cam_cc_cci_0_clk_src, 500 + .clkr.hw.init = &(const struct clk_init_data) { 501 + .name = "cam_cc_cci_2_clk_src", 502 + .parent_data = cam_cc_parent_data_0, 503 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 504 + .flags = CLK_SET_RATE_PARENT, 505 + .ops = &clk_rcg2_shared_ops, 506 + }, 507 + }; 508 + 509 + static struct clk_rcg2 cam_cc_cci_3_clk_src = { 510 + .cmd_rcgr = 0xc220, 511 + .mnd_width = 8, 512 + .hid_width = 5, 513 + .parent_map = cam_cc_parent_map_0, 514 + .freq_tbl = ftbl_cam_cc_cci_0_clk_src, 515 + .clkr.hw.init = &(const struct clk_init_data) { 516 + .name = "cam_cc_cci_3_clk_src", 517 + .parent_data = cam_cc_parent_data_0, 518 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 519 + .flags = CLK_SET_RATE_PARENT, 520 + .ops = &clk_rcg2_shared_ops, 521 + }, 522 + }; 523 + 524 + static const struct freq_tbl ftbl_cam_cc_cphy_rx_clk_src[] = { 525 + F(19200000, P_BI_TCXO, 1, 0, 0), 526 + F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0), 527 + { } 528 + }; 529 + 530 + static struct clk_rcg2 cam_cc_cphy_rx_clk_src = { 531 + .cmd_rcgr = 0xa064, 532 + .mnd_width = 0, 533 + .hid_width = 5, 534 + .parent_map = cam_cc_parent_map_0, 535 + .freq_tbl = ftbl_cam_cc_cphy_rx_clk_src, 536 + .clkr.hw.init = &(const struct clk_init_data) { 537 + .name = "cam_cc_cphy_rx_clk_src", 538 + .parent_data = cam_cc_parent_data_0, 539 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 540 + .flags = CLK_SET_RATE_PARENT, 541 + .ops = &clk_rcg2_shared_ops, 542 + }, 543 + }; 544 + 545 + static const struct freq_tbl ftbl_cam_cc_csi0phytimer_clk_src[] = { 546 + F(19200000, P_BI_TCXO, 1, 0, 0), 547 + F(300000000, P_CAM_CC_PLL0_OUT_EVEN, 2, 0, 0), 548 + { } 549 + }; 550 + 551 + static struct clk_rcg2 cam_cc_csi0phytimer_clk_src = { 552 + .cmd_rcgr = 0x6004, 553 + .mnd_width = 0, 554 + .hid_width = 5, 555 + .parent_map = cam_cc_parent_map_0, 556 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 557 + .clkr.hw.init = &(const struct clk_init_data) { 558 + .name = "cam_cc_csi0phytimer_clk_src", 559 + .parent_data = cam_cc_parent_data_0, 560 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 561 + .flags = CLK_SET_RATE_PARENT, 562 + .ops = &clk_rcg2_shared_ops, 563 + }, 564 + }; 565 + 566 + static struct clk_rcg2 cam_cc_csi1phytimer_clk_src = { 567 + .cmd_rcgr = 0x6028, 568 + .mnd_width = 0, 569 + .hid_width = 5, 570 + .parent_map = cam_cc_parent_map_0, 571 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 572 + .clkr.hw.init = &(const struct clk_init_data) { 573 + .name = "cam_cc_csi1phytimer_clk_src", 574 + .parent_data = cam_cc_parent_data_0, 575 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 576 + .flags = CLK_SET_RATE_PARENT, 577 + .ops = &clk_rcg2_shared_ops, 578 + }, 579 + }; 580 + 581 + static struct clk_rcg2 cam_cc_csi2phytimer_clk_src = { 582 + .cmd_rcgr = 0x604c, 583 + .mnd_width = 0, 584 + .hid_width = 5, 585 + .parent_map = cam_cc_parent_map_0, 586 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 587 + .clkr.hw.init = &(const struct clk_init_data) { 588 + .name = "cam_cc_csi2phytimer_clk_src", 589 + .parent_data = cam_cc_parent_data_0, 590 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 591 + .flags = CLK_SET_RATE_PARENT, 592 + .ops = &clk_rcg2_shared_ops, 593 + }, 594 + }; 595 + 596 + static struct clk_rcg2 cam_cc_csi3phytimer_clk_src = { 597 + .cmd_rcgr = 0x6070, 598 + .mnd_width = 0, 599 + .hid_width = 5, 600 + .parent_map = cam_cc_parent_map_0, 601 + .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src, 602 + .clkr.hw.init = &(const struct clk_init_data) { 603 + .name = "cam_cc_csi3phytimer_clk_src", 604 + .parent_data = cam_cc_parent_data_0, 605 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 606 + .flags = CLK_SET_RATE_PARENT, 607 + .ops = &clk_rcg2_shared_ops, 608 + }, 609 + }; 610 + 611 + static const struct freq_tbl ftbl_cam_cc_fast_ahb_clk_src[] = { 612 + F(19200000, P_BI_TCXO, 1, 0, 0), 613 + F(50000000, P_CAM_CC_PLL0_OUT_EVEN, 12, 0, 0), 614 + F(100000000, P_CAM_CC_PLL0_OUT_EVEN, 6, 0, 0), 615 + F(200000000, P_CAM_CC_PLL0_OUT_EVEN, 3, 0, 0), 616 + F(300000000, P_CAM_CC_PLL0_OUT_MAIN, 4, 0, 0), 617 + F(400000000, P_CAM_CC_PLL0_OUT_MAIN, 3, 0, 0), 618 + { } 619 + }; 620 + 621 + static struct clk_rcg2 cam_cc_fast_ahb_clk_src = { 622 + .cmd_rcgr = 0x703c, 623 + .mnd_width = 0, 624 + .hid_width = 5, 625 + .parent_map = cam_cc_parent_map_0, 626 + .freq_tbl = ftbl_cam_cc_fast_ahb_clk_src, 627 + .clkr.hw.init = &(const struct clk_init_data) { 628 + .name = "cam_cc_fast_ahb_clk_src", 629 + .parent_data = cam_cc_parent_data_0, 630 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 631 + .flags = CLK_SET_RATE_PARENT, 632 + .ops = &clk_rcg2_shared_ops, 633 + }, 634 + }; 635 + 636 + static const struct freq_tbl ftbl_cam_cc_fd_core_clk_src[] = { 637 + F(19200000, P_BI_TCXO, 1, 0, 0), 638 + F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0), 639 + F(480000000, P_CAM_CC_PLL2_OUT_MAIN, 1, 0, 0), 640 + F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0), 641 + { } 642 + }; 643 + 644 + static struct clk_rcg2 cam_cc_fd_core_clk_src = { 645 + .cmd_rcgr = 0xc0e0, 646 + .mnd_width = 0, 647 + .hid_width = 5, 648 + .parent_map = cam_cc_parent_map_0, 649 + .freq_tbl = ftbl_cam_cc_fd_core_clk_src, 650 + .clkr.hw.init = &(const struct clk_init_data) { 651 + .name = "cam_cc_fd_core_clk_src", 652 + .parent_data = cam_cc_parent_data_0, 653 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 654 + .flags = CLK_SET_RATE_PARENT, 655 + .ops = &clk_rcg2_shared_ops, 656 + }, 657 + }; 658 + 659 + static const struct freq_tbl ftbl_cam_cc_icp_clk_src[] = { 660 + F(19200000, P_BI_TCXO, 1, 0, 0), 661 + F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0), 662 + F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0), 663 + { } 664 + }; 665 + 666 + static struct clk_rcg2 cam_cc_icp_clk_src = { 667 + .cmd_rcgr = 0xc0b8, 668 + .mnd_width = 0, 669 + .hid_width = 5, 670 + .parent_map = cam_cc_parent_map_0, 671 + .freq_tbl = ftbl_cam_cc_icp_clk_src, 672 + .clkr.hw.init = &(const struct clk_init_data) { 673 + .name = "cam_cc_icp_clk_src", 674 + .parent_data = cam_cc_parent_data_0, 675 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 676 + .flags = CLK_SET_RATE_PARENT, 677 + .ops = &clk_rcg2_shared_ops, 678 + }, 679 + }; 680 + 681 + static const struct freq_tbl ftbl_cam_cc_ife_0_clk_src[] = { 682 + F(19200000, P_BI_TCXO, 1, 0, 0), 683 + F(400000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0), 684 + F(558000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0), 685 + F(637000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0), 686 + F(760000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0), 687 + { } 688 + }; 689 + 690 + static struct clk_rcg2 cam_cc_ife_0_clk_src = { 691 + .cmd_rcgr = 0xa010, 692 + .mnd_width = 0, 693 + .hid_width = 5, 694 + .parent_map = cam_cc_parent_map_2, 695 + .freq_tbl = ftbl_cam_cc_ife_0_clk_src, 696 + .clkr.hw.init = &(const struct clk_init_data) { 697 + .name = "cam_cc_ife_0_clk_src", 698 + .parent_data = cam_cc_parent_data_2, 699 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_2), 700 + .flags = CLK_SET_RATE_PARENT, 701 + .ops = &clk_rcg2_shared_ops, 702 + }, 703 + }; 704 + 705 + static const struct freq_tbl ftbl_cam_cc_ife_0_csid_clk_src[] = { 706 + F(19200000, P_BI_TCXO, 1, 0, 0), 707 + F(75000000, P_CAM_CC_PLL0_OUT_EVEN, 8, 0, 0), 708 + F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0), 709 + F(480000000, P_CAM_CC_PLL2_OUT_MAIN, 1, 0, 0), 710 + F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0), 711 + { } 712 + }; 713 + 714 + static struct clk_rcg2 cam_cc_ife_0_csid_clk_src = { 715 + .cmd_rcgr = 0xa03c, 716 + .mnd_width = 0, 717 + .hid_width = 5, 718 + .parent_map = cam_cc_parent_map_0, 719 + .freq_tbl = ftbl_cam_cc_ife_0_csid_clk_src, 720 + .clkr.hw.init = &(const struct clk_init_data) { 721 + .name = "cam_cc_ife_0_csid_clk_src", 722 + .parent_data = cam_cc_parent_data_0, 723 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 724 + .flags = CLK_SET_RATE_PARENT, 725 + .ops = &clk_rcg2_shared_ops, 726 + }, 727 + }; 728 + 729 + static const struct freq_tbl ftbl_cam_cc_ife_1_clk_src[] = { 730 + F(19200000, P_BI_TCXO, 1, 0, 0), 731 + F(400000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0), 732 + F(558000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0), 733 + F(637000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0), 734 + F(760000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0), 735 + { } 736 + }; 737 + 738 + static struct clk_rcg2 cam_cc_ife_1_clk_src = { 739 + .cmd_rcgr = 0xb010, 740 + .mnd_width = 0, 741 + .hid_width = 5, 742 + .parent_map = cam_cc_parent_map_3, 743 + .freq_tbl = ftbl_cam_cc_ife_1_clk_src, 744 + .clkr.hw.init = &(const struct clk_init_data) { 745 + .name = "cam_cc_ife_1_clk_src", 746 + .parent_data = cam_cc_parent_data_3, 747 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_3), 748 + .flags = CLK_SET_RATE_PARENT, 749 + .ops = &clk_rcg2_shared_ops, 750 + }, 751 + }; 752 + 753 + static struct clk_rcg2 cam_cc_ife_1_csid_clk_src = { 754 + .cmd_rcgr = 0xb034, 755 + .mnd_width = 0, 756 + .hid_width = 5, 757 + .parent_map = cam_cc_parent_map_0, 758 + .freq_tbl = ftbl_cam_cc_ife_0_csid_clk_src, 759 + .clkr.hw.init = &(const struct clk_init_data) { 760 + .name = "cam_cc_ife_1_csid_clk_src", 761 + .parent_data = cam_cc_parent_data_0, 762 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 763 + .flags = CLK_SET_RATE_PARENT, 764 + .ops = &clk_rcg2_shared_ops, 765 + }, 766 + }; 767 + 768 + static const struct freq_tbl ftbl_cam_cc_ife_2_clk_src[] = { 769 + F(19200000, P_BI_TCXO, 1, 0, 0), 770 + F(400000000, P_CAM_CC_PLL5_OUT_EVEN, 1, 0, 0), 771 + F(558000000, P_CAM_CC_PLL5_OUT_EVEN, 1, 0, 0), 772 + F(637000000, P_CAM_CC_PLL5_OUT_EVEN, 1, 0, 0), 773 + F(760000000, P_CAM_CC_PLL5_OUT_EVEN, 1, 0, 0), 774 + { } 775 + }; 776 + 777 + static struct clk_rcg2 cam_cc_ife_2_clk_src = { 778 + .cmd_rcgr = 0xf010, 779 + .mnd_width = 0, 780 + .hid_width = 5, 781 + .parent_map = cam_cc_parent_map_4, 782 + .freq_tbl = ftbl_cam_cc_ife_2_clk_src, 783 + .clkr.hw.init = &(const struct clk_init_data) { 784 + .name = "cam_cc_ife_2_clk_src", 785 + .parent_data = cam_cc_parent_data_4, 786 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_4), 787 + .flags = CLK_SET_RATE_PARENT, 788 + .ops = &clk_rcg2_shared_ops, 789 + }, 790 + }; 791 + 792 + static struct clk_rcg2 cam_cc_ife_2_csid_clk_src = { 793 + .cmd_rcgr = 0xf03c, 794 + .mnd_width = 0, 795 + .hid_width = 5, 796 + .parent_map = cam_cc_parent_map_0, 797 + .freq_tbl = ftbl_cam_cc_fd_core_clk_src, 798 + .clkr.hw.init = &(const struct clk_init_data) { 799 + .name = "cam_cc_ife_2_csid_clk_src", 800 + .parent_data = cam_cc_parent_data_0, 801 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 802 + .flags = CLK_SET_RATE_PARENT, 803 + .ops = &clk_rcg2_shared_ops, 804 + }, 805 + }; 806 + 807 + static const struct freq_tbl ftbl_cam_cc_ife_3_clk_src[] = { 808 + F(19200000, P_BI_TCXO, 1, 0, 0), 809 + F(400000000, P_CAM_CC_PLL6_OUT_EVEN, 1, 0, 0), 810 + F(558000000, P_CAM_CC_PLL6_OUT_EVEN, 1, 0, 0), 811 + F(637000000, P_CAM_CC_PLL6_OUT_EVEN, 1, 0, 0), 812 + F(760000000, P_CAM_CC_PLL6_OUT_EVEN, 1, 0, 0), 813 + { } 814 + }; 815 + 816 + static struct clk_rcg2 cam_cc_ife_3_clk_src = { 817 + .cmd_rcgr = 0xf07c, 818 + .mnd_width = 0, 819 + .hid_width = 5, 820 + .parent_map = cam_cc_parent_map_5, 821 + .freq_tbl = ftbl_cam_cc_ife_3_clk_src, 822 + .clkr.hw.init = &(const struct clk_init_data) { 823 + .name = "cam_cc_ife_3_clk_src", 824 + .parent_data = cam_cc_parent_data_5, 825 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_5), 826 + .flags = CLK_SET_RATE_PARENT, 827 + .ops = &clk_rcg2_shared_ops, 828 + }, 829 + }; 830 + 831 + static struct clk_rcg2 cam_cc_ife_3_csid_clk_src = { 832 + .cmd_rcgr = 0xf0a8, 833 + .mnd_width = 0, 834 + .hid_width = 5, 835 + .parent_map = cam_cc_parent_map_0, 836 + .freq_tbl = ftbl_cam_cc_fd_core_clk_src, 837 + .clkr.hw.init = &(const struct clk_init_data) { 838 + .name = "cam_cc_ife_3_csid_clk_src", 839 + .parent_data = cam_cc_parent_data_0, 840 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 841 + .flags = CLK_SET_RATE_PARENT, 842 + .ops = &clk_rcg2_shared_ops, 843 + }, 844 + }; 845 + 846 + static const struct freq_tbl ftbl_cam_cc_ife_lite_0_clk_src[] = { 847 + F(19200000, P_BI_TCXO, 1, 0, 0), 848 + F(320000000, P_CAM_CC_PLL2_OUT_MAIN, 1.5, 0, 0), 849 + F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0), 850 + F(480000000, P_CAM_CC_PLL2_OUT_MAIN, 1, 0, 0), 851 + F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0), 852 + { } 853 + }; 854 + 855 + static struct clk_rcg2 cam_cc_ife_lite_0_clk_src = { 856 + .cmd_rcgr = 0xc004, 857 + .mnd_width = 0, 858 + .hid_width = 5, 859 + .parent_map = cam_cc_parent_map_0, 860 + .freq_tbl = ftbl_cam_cc_ife_lite_0_clk_src, 861 + .clkr.hw.init = &(const struct clk_init_data) { 862 + .name = "cam_cc_ife_lite_0_clk_src", 863 + .parent_data = cam_cc_parent_data_0, 864 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 865 + .flags = CLK_SET_RATE_PARENT, 866 + .ops = &clk_rcg2_shared_ops, 867 + }, 868 + }; 869 + 870 + static struct clk_rcg2 cam_cc_ife_lite_0_csid_clk_src = { 871 + .cmd_rcgr = 0xc020, 872 + .mnd_width = 0, 873 + .hid_width = 5, 874 + .parent_map = cam_cc_parent_map_0, 875 + .freq_tbl = ftbl_cam_cc_fd_core_clk_src, 876 + .clkr.hw.init = &(const struct clk_init_data) { 877 + .name = "cam_cc_ife_lite_0_csid_clk_src", 878 + .parent_data = cam_cc_parent_data_0, 879 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 880 + .flags = CLK_SET_RATE_PARENT, 881 + .ops = &clk_rcg2_shared_ops, 882 + }, 883 + }; 884 + 885 + static struct clk_rcg2 cam_cc_ife_lite_1_clk_src = { 886 + .cmd_rcgr = 0xc048, 887 + .mnd_width = 0, 888 + .hid_width = 5, 889 + .parent_map = cam_cc_parent_map_0, 890 + .freq_tbl = ftbl_cam_cc_ife_lite_0_clk_src, 891 + .clkr.hw.init = &(const struct clk_init_data) { 892 + .name = "cam_cc_ife_lite_1_clk_src", 893 + .parent_data = cam_cc_parent_data_0, 894 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 895 + .flags = CLK_SET_RATE_PARENT, 896 + .ops = &clk_rcg2_shared_ops, 897 + }, 898 + }; 899 + 900 + static struct clk_rcg2 cam_cc_ife_lite_1_csid_clk_src = { 901 + .cmd_rcgr = 0xc064, 902 + .mnd_width = 0, 903 + .hid_width = 5, 904 + .parent_map = cam_cc_parent_map_0, 905 + .freq_tbl = ftbl_cam_cc_fd_core_clk_src, 906 + .clkr.hw.init = &(const struct clk_init_data) { 907 + .name = "cam_cc_ife_lite_1_csid_clk_src", 908 + .parent_data = cam_cc_parent_data_0, 909 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 910 + .flags = CLK_SET_RATE_PARENT, 911 + .ops = &clk_rcg2_shared_ops, 912 + }, 913 + }; 914 + 915 + static struct clk_rcg2 cam_cc_ife_lite_2_clk_src = { 916 + .cmd_rcgr = 0xc240, 917 + .mnd_width = 0, 918 + .hid_width = 5, 919 + .parent_map = cam_cc_parent_map_0, 920 + .freq_tbl = ftbl_cam_cc_ife_lite_0_clk_src, 921 + .clkr.hw.init = &(const struct clk_init_data) { 922 + .name = "cam_cc_ife_lite_2_clk_src", 923 + .parent_data = cam_cc_parent_data_0, 924 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 925 + .flags = CLK_SET_RATE_PARENT, 926 + .ops = &clk_rcg2_shared_ops, 927 + }, 928 + }; 929 + 930 + static struct clk_rcg2 cam_cc_ife_lite_2_csid_clk_src = { 931 + .cmd_rcgr = 0xc25c, 932 + .mnd_width = 0, 933 + .hid_width = 5, 934 + .parent_map = cam_cc_parent_map_0, 935 + .freq_tbl = ftbl_cam_cc_fd_core_clk_src, 936 + .clkr.hw.init = &(const struct clk_init_data) { 937 + .name = "cam_cc_ife_lite_2_csid_clk_src", 938 + .parent_data = cam_cc_parent_data_0, 939 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 940 + .flags = CLK_SET_RATE_PARENT, 941 + .ops = &clk_rcg2_shared_ops, 942 + }, 943 + }; 944 + 945 + static struct clk_rcg2 cam_cc_ife_lite_3_clk_src = { 946 + .cmd_rcgr = 0xc284, 947 + .mnd_width = 0, 948 + .hid_width = 5, 949 + .parent_map = cam_cc_parent_map_0, 950 + .freq_tbl = ftbl_cam_cc_ife_lite_0_clk_src, 951 + .clkr.hw.init = &(const struct clk_init_data) { 952 + .name = "cam_cc_ife_lite_3_clk_src", 953 + .parent_data = cam_cc_parent_data_0, 954 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 955 + .flags = CLK_SET_RATE_PARENT, 956 + .ops = &clk_rcg2_shared_ops, 957 + }, 958 + }; 959 + 960 + static struct clk_rcg2 cam_cc_ife_lite_3_csid_clk_src = { 961 + .cmd_rcgr = 0xc2a0, 962 + .mnd_width = 0, 963 + .hid_width = 5, 964 + .parent_map = cam_cc_parent_map_0, 965 + .freq_tbl = ftbl_cam_cc_fd_core_clk_src, 966 + .clkr.hw.init = &(const struct clk_init_data) { 967 + .name = "cam_cc_ife_lite_3_csid_clk_src", 968 + .parent_data = cam_cc_parent_data_0, 969 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 970 + .flags = CLK_SET_RATE_PARENT, 971 + .ops = &clk_rcg2_shared_ops, 972 + }, 973 + }; 974 + 975 + static const struct freq_tbl ftbl_cam_cc_ipe_0_clk_src[] = { 976 + F(19200000, P_BI_TCXO, 1, 0, 0), 977 + F(375000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0), 978 + F(475000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0), 979 + F(520000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0), 980 + F(600000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0), 981 + { } 982 + }; 983 + 984 + static struct clk_rcg2 cam_cc_ipe_0_clk_src = { 985 + .cmd_rcgr = 0x8010, 986 + .mnd_width = 0, 987 + .hid_width = 5, 988 + .parent_map = cam_cc_parent_map_6, 989 + .freq_tbl = ftbl_cam_cc_ipe_0_clk_src, 990 + .clkr.hw.init = &(const struct clk_init_data) { 991 + .name = "cam_cc_ipe_0_clk_src", 992 + .parent_data = cam_cc_parent_data_6, 993 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_6), 994 + .flags = CLK_SET_RATE_PARENT, 995 + .ops = &clk_rcg2_shared_ops, 996 + }, 997 + }; 998 + 999 + static struct clk_rcg2 cam_cc_jpeg_clk_src = { 1000 + .cmd_rcgr = 0xc08c, 1001 + .mnd_width = 0, 1002 + .hid_width = 5, 1003 + .parent_map = cam_cc_parent_map_0, 1004 + .freq_tbl = ftbl_cam_cc_bps_clk_src, 1005 + .clkr.hw.init = &(const struct clk_init_data) { 1006 + .name = "cam_cc_jpeg_clk_src", 1007 + .parent_data = cam_cc_parent_data_0, 1008 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 1009 + .flags = CLK_SET_RATE_PARENT, 1010 + .ops = &clk_rcg2_shared_ops, 1011 + }, 1012 + }; 1013 + 1014 + static const struct freq_tbl ftbl_cam_cc_lrme_clk_src[] = { 1015 + F(19200000, P_BI_TCXO, 1, 0, 0), 1016 + F(100000000, P_CAM_CC_PLL0_OUT_EVEN, 6, 0, 0), 1017 + F(240000000, P_CAM_CC_PLL2_OUT_MAIN, 2, 0, 0), 1018 + F(300000000, P_CAM_CC_PLL0_OUT_EVEN, 2, 0, 0), 1019 + F(320000000, P_CAM_CC_PLL2_OUT_MAIN, 1.5, 0, 0), 1020 + F(400000000, P_CAM_CC_PLL0_OUT_MAIN, 3, 0, 0), 1021 + { } 1022 + }; 1023 + 1024 + static struct clk_rcg2 cam_cc_lrme_clk_src = { 1025 + .cmd_rcgr = 0xc144, 1026 + .mnd_width = 0, 1027 + .hid_width = 5, 1028 + .parent_map = cam_cc_parent_map_0, 1029 + .freq_tbl = ftbl_cam_cc_lrme_clk_src, 1030 + .clkr.hw.init = &(const struct clk_init_data) { 1031 + .name = "cam_cc_lrme_clk_src", 1032 + .parent_data = cam_cc_parent_data_0, 1033 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 1034 + .flags = CLK_SET_RATE_PARENT, 1035 + .ops = &clk_rcg2_shared_ops, 1036 + }, 1037 + }; 1038 + 1039 + static const struct freq_tbl ftbl_cam_cc_mclk0_clk_src[] = { 1040 + F(19200000, P_BI_TCXO, 1, 0, 0), 1041 + F(24000000, P_CAM_CC_PLL2_OUT_EARLY, 10, 1, 4), 1042 + F(68571429, P_CAM_CC_PLL2_OUT_EARLY, 14, 0, 0), 1043 + { } 1044 + }; 1045 + 1046 + static struct clk_rcg2 cam_cc_mclk0_clk_src = { 1047 + .cmd_rcgr = 0x5004, 1048 + .mnd_width = 8, 1049 + .hid_width = 5, 1050 + .parent_map = cam_cc_parent_map_1, 1051 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 1052 + .clkr.hw.init = &(const struct clk_init_data) { 1053 + .name = "cam_cc_mclk0_clk_src", 1054 + .parent_data = cam_cc_parent_data_1, 1055 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 1056 + .flags = CLK_SET_RATE_PARENT, 1057 + .ops = &clk_rcg2_shared_ops, 1058 + }, 1059 + }; 1060 + 1061 + static struct clk_rcg2 cam_cc_mclk1_clk_src = { 1062 + .cmd_rcgr = 0x5024, 1063 + .mnd_width = 8, 1064 + .hid_width = 5, 1065 + .parent_map = cam_cc_parent_map_1, 1066 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 1067 + .clkr.hw.init = &(const struct clk_init_data) { 1068 + .name = "cam_cc_mclk1_clk_src", 1069 + .parent_data = cam_cc_parent_data_1, 1070 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 1071 + .flags = CLK_SET_RATE_PARENT, 1072 + .ops = &clk_rcg2_shared_ops, 1073 + }, 1074 + }; 1075 + 1076 + static struct clk_rcg2 cam_cc_mclk2_clk_src = { 1077 + .cmd_rcgr = 0x5044, 1078 + .mnd_width = 8, 1079 + .hid_width = 5, 1080 + .parent_map = cam_cc_parent_map_1, 1081 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 1082 + .clkr.hw.init = &(const struct clk_init_data) { 1083 + .name = "cam_cc_mclk2_clk_src", 1084 + .parent_data = cam_cc_parent_data_1, 1085 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 1086 + .flags = CLK_SET_RATE_PARENT, 1087 + .ops = &clk_rcg2_shared_ops, 1088 + }, 1089 + }; 1090 + 1091 + static struct clk_rcg2 cam_cc_mclk3_clk_src = { 1092 + .cmd_rcgr = 0x5064, 1093 + .mnd_width = 8, 1094 + .hid_width = 5, 1095 + .parent_map = cam_cc_parent_map_1, 1096 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 1097 + .clkr.hw.init = &(const struct clk_init_data) { 1098 + .name = "cam_cc_mclk3_clk_src", 1099 + .parent_data = cam_cc_parent_data_1, 1100 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 1101 + .flags = CLK_SET_RATE_PARENT, 1102 + .ops = &clk_rcg2_shared_ops, 1103 + }, 1104 + }; 1105 + 1106 + static struct clk_rcg2 cam_cc_mclk4_clk_src = { 1107 + .cmd_rcgr = 0x5084, 1108 + .mnd_width = 8, 1109 + .hid_width = 5, 1110 + .parent_map = cam_cc_parent_map_1, 1111 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 1112 + .clkr.hw.init = &(const struct clk_init_data) { 1113 + .name = "cam_cc_mclk4_clk_src", 1114 + .parent_data = cam_cc_parent_data_1, 1115 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 1116 + .flags = CLK_SET_RATE_PARENT, 1117 + .ops = &clk_rcg2_shared_ops, 1118 + }, 1119 + }; 1120 + 1121 + static struct clk_rcg2 cam_cc_mclk5_clk_src = { 1122 + .cmd_rcgr = 0x50a4, 1123 + .mnd_width = 8, 1124 + .hid_width = 5, 1125 + .parent_map = cam_cc_parent_map_1, 1126 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 1127 + .clkr.hw.init = &(const struct clk_init_data) { 1128 + .name = "cam_cc_mclk5_clk_src", 1129 + .parent_data = cam_cc_parent_data_1, 1130 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 1131 + .flags = CLK_SET_RATE_PARENT, 1132 + .ops = &clk_rcg2_shared_ops, 1133 + }, 1134 + }; 1135 + 1136 + static struct clk_rcg2 cam_cc_mclk6_clk_src = { 1137 + .cmd_rcgr = 0x50c4, 1138 + .mnd_width = 8, 1139 + .hid_width = 5, 1140 + .parent_map = cam_cc_parent_map_1, 1141 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 1142 + .clkr.hw.init = &(const struct clk_init_data) { 1143 + .name = "cam_cc_mclk6_clk_src", 1144 + .parent_data = cam_cc_parent_data_1, 1145 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 1146 + .flags = CLK_SET_RATE_PARENT, 1147 + .ops = &clk_rcg2_shared_ops, 1148 + }, 1149 + }; 1150 + 1151 + static struct clk_rcg2 cam_cc_mclk7_clk_src = { 1152 + .cmd_rcgr = 0x50e4, 1153 + .mnd_width = 8, 1154 + .hid_width = 5, 1155 + .parent_map = cam_cc_parent_map_1, 1156 + .freq_tbl = ftbl_cam_cc_mclk0_clk_src, 1157 + .clkr.hw.init = &(const struct clk_init_data) { 1158 + .name = "cam_cc_mclk7_clk_src", 1159 + .parent_data = cam_cc_parent_data_1, 1160 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_1), 1161 + .flags = CLK_SET_RATE_PARENT, 1162 + .ops = &clk_rcg2_shared_ops, 1163 + }, 1164 + }; 1165 + 1166 + static const struct freq_tbl ftbl_cam_cc_slow_ahb_clk_src[] = { 1167 + F(19200000, P_BI_TCXO, 1, 0, 0), 1168 + F(80000000, P_CAM_CC_PLL0_OUT_EVEN, 7.5, 0, 0), 1169 + { } 1170 + }; 1171 + 1172 + static struct clk_rcg2 cam_cc_slow_ahb_clk_src = { 1173 + .cmd_rcgr = 0x7058, 1174 + .mnd_width = 8, 1175 + .hid_width = 5, 1176 + .parent_map = cam_cc_parent_map_0, 1177 + .freq_tbl = ftbl_cam_cc_slow_ahb_clk_src, 1178 + .clkr.hw.init = &(const struct clk_init_data) { 1179 + .name = "cam_cc_slow_ahb_clk_src", 1180 + .parent_data = cam_cc_parent_data_0, 1181 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_0), 1182 + .flags = CLK_SET_RATE_PARENT, 1183 + .ops = &clk_rcg2_shared_ops, 1184 + }, 1185 + }; 1186 + 1187 + static const struct freq_tbl ftbl_cam_cc_xo_clk_src[] = { 1188 + F(19200000, P_BI_TCXO, 1, 0, 0), 1189 + { } 1190 + }; 1191 + 1192 + static struct clk_rcg2 cam_cc_xo_clk_src = { 1193 + .cmd_rcgr = 0xc1cc, 1194 + .mnd_width = 0, 1195 + .hid_width = 5, 1196 + .parent_map = cam_cc_parent_map_7, 1197 + .freq_tbl = ftbl_cam_cc_xo_clk_src, 1198 + .clkr.hw.init = &(const struct clk_init_data) { 1199 + .name = "cam_cc_xo_clk_src", 1200 + .parent_data = cam_cc_parent_data_7, 1201 + .num_parents = ARRAY_SIZE(cam_cc_parent_data_7), 1202 + .flags = CLK_SET_RATE_PARENT, 1203 + .ops = &clk_rcg2_shared_ops, 1204 + }, 1205 + }; 1206 + 1207 + static struct clk_branch cam_cc_bps_ahb_clk = { 1208 + .halt_reg = 0x7070, 1209 + .halt_check = BRANCH_HALT, 1210 + .clkr = { 1211 + .enable_reg = 0x7070, 1212 + .enable_mask = BIT(0), 1213 + .hw.init = &(const struct clk_init_data) { 1214 + .name = "cam_cc_bps_ahb_clk", 1215 + .parent_hws = (const struct clk_hw*[]) { 1216 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1217 + }, 1218 + .num_parents = 1, 1219 + .flags = CLK_SET_RATE_PARENT, 1220 + .ops = &clk_branch2_ops, 1221 + }, 1222 + }, 1223 + }; 1224 + 1225 + static struct clk_branch cam_cc_bps_areg_clk = { 1226 + .halt_reg = 0x7054, 1227 + .halt_check = BRANCH_HALT, 1228 + .clkr = { 1229 + .enable_reg = 0x7054, 1230 + .enable_mask = BIT(0), 1231 + .hw.init = &(const struct clk_init_data) { 1232 + .name = "cam_cc_bps_areg_clk", 1233 + .parent_hws = (const struct clk_hw*[]) { 1234 + &cam_cc_fast_ahb_clk_src.clkr.hw, 1235 + }, 1236 + .num_parents = 1, 1237 + .flags = CLK_SET_RATE_PARENT, 1238 + .ops = &clk_branch2_ops, 1239 + }, 1240 + }, 1241 + }; 1242 + 1243 + static struct clk_branch cam_cc_bps_axi_clk = { 1244 + .halt_reg = 0x7038, 1245 + .halt_check = BRANCH_HALT, 1246 + .clkr = { 1247 + .enable_reg = 0x7038, 1248 + .enable_mask = BIT(0), 1249 + .hw.init = &(const struct clk_init_data) { 1250 + .name = "cam_cc_bps_axi_clk", 1251 + .parent_hws = (const struct clk_hw*[]) { 1252 + &cam_cc_camnoc_axi_clk_src.clkr.hw, 1253 + }, 1254 + .num_parents = 1, 1255 + .flags = CLK_SET_RATE_PARENT, 1256 + .ops = &clk_branch2_ops, 1257 + }, 1258 + }, 1259 + }; 1260 + 1261 + static struct clk_branch cam_cc_bps_clk = { 1262 + .halt_reg = 0x7028, 1263 + .halt_check = BRANCH_HALT, 1264 + .clkr = { 1265 + .enable_reg = 0x7028, 1266 + .enable_mask = BIT(0), 1267 + .hw.init = &(const struct clk_init_data) { 1268 + .name = "cam_cc_bps_clk", 1269 + .parent_hws = (const struct clk_hw*[]) { 1270 + &cam_cc_bps_clk_src.clkr.hw, 1271 + }, 1272 + .num_parents = 1, 1273 + .flags = CLK_SET_RATE_PARENT, 1274 + .ops = &clk_branch2_ops, 1275 + }, 1276 + }, 1277 + }; 1278 + 1279 + static struct clk_branch cam_cc_camnoc_axi_clk = { 1280 + .halt_reg = 0xc18c, 1281 + .halt_check = BRANCH_HALT, 1282 + .clkr = { 1283 + .enable_reg = 0xc18c, 1284 + .enable_mask = BIT(0), 1285 + .hw.init = &(const struct clk_init_data) { 1286 + .name = "cam_cc_camnoc_axi_clk", 1287 + .parent_hws = (const struct clk_hw*[]) { 1288 + &cam_cc_camnoc_axi_clk_src.clkr.hw, 1289 + }, 1290 + .num_parents = 1, 1291 + .flags = CLK_SET_RATE_PARENT, 1292 + .ops = &clk_branch2_ops, 1293 + }, 1294 + }, 1295 + }; 1296 + 1297 + static struct clk_branch cam_cc_camnoc_dcd_xo_clk = { 1298 + .halt_reg = 0xc194, 1299 + .halt_check = BRANCH_HALT, 1300 + .clkr = { 1301 + .enable_reg = 0xc194, 1302 + .enable_mask = BIT(0), 1303 + .hw.init = &(const struct clk_init_data) { 1304 + .name = "cam_cc_camnoc_dcd_xo_clk", 1305 + .parent_hws = (const struct clk_hw*[]) { 1306 + &cam_cc_xo_clk_src.clkr.hw, 1307 + }, 1308 + .num_parents = 1, 1309 + .flags = CLK_SET_RATE_PARENT, 1310 + .ops = &clk_branch2_ops, 1311 + }, 1312 + }, 1313 + }; 1314 + 1315 + static struct clk_branch cam_cc_cci_0_clk = { 1316 + .halt_reg = 0xc120, 1317 + .halt_check = BRANCH_HALT, 1318 + .clkr = { 1319 + .enable_reg = 0xc120, 1320 + .enable_mask = BIT(0), 1321 + .hw.init = &(const struct clk_init_data) { 1322 + .name = "cam_cc_cci_0_clk", 1323 + .parent_hws = (const struct clk_hw*[]) { 1324 + &cam_cc_cci_0_clk_src.clkr.hw, 1325 + }, 1326 + .num_parents = 1, 1327 + .flags = CLK_SET_RATE_PARENT, 1328 + .ops = &clk_branch2_ops, 1329 + }, 1330 + }, 1331 + }; 1332 + 1333 + static struct clk_branch cam_cc_cci_1_clk = { 1334 + .halt_reg = 0xc13c, 1335 + .halt_check = BRANCH_HALT, 1336 + .clkr = { 1337 + .enable_reg = 0xc13c, 1338 + .enable_mask = BIT(0), 1339 + .hw.init = &(const struct clk_init_data) { 1340 + .name = "cam_cc_cci_1_clk", 1341 + .parent_hws = (const struct clk_hw*[]) { 1342 + &cam_cc_cci_1_clk_src.clkr.hw, 1343 + }, 1344 + .num_parents = 1, 1345 + .flags = CLK_SET_RATE_PARENT, 1346 + .ops = &clk_branch2_ops, 1347 + }, 1348 + }, 1349 + }; 1350 + 1351 + static struct clk_branch cam_cc_cci_2_clk = { 1352 + .halt_reg = 0xc21c, 1353 + .halt_check = BRANCH_HALT, 1354 + .clkr = { 1355 + .enable_reg = 0xc21c, 1356 + .enable_mask = BIT(0), 1357 + .hw.init = &(const struct clk_init_data) { 1358 + .name = "cam_cc_cci_2_clk", 1359 + .parent_hws = (const struct clk_hw*[]) { 1360 + &cam_cc_cci_2_clk_src.clkr.hw, 1361 + }, 1362 + .num_parents = 1, 1363 + .flags = CLK_SET_RATE_PARENT, 1364 + .ops = &clk_branch2_ops, 1365 + }, 1366 + }, 1367 + }; 1368 + 1369 + static struct clk_branch cam_cc_cci_3_clk = { 1370 + .halt_reg = 0xc238, 1371 + .halt_check = BRANCH_HALT, 1372 + .clkr = { 1373 + .enable_reg = 0xc238, 1374 + .enable_mask = BIT(0), 1375 + .hw.init = &(const struct clk_init_data) { 1376 + .name = "cam_cc_cci_3_clk", 1377 + .parent_hws = (const struct clk_hw*[]) { 1378 + &cam_cc_cci_3_clk_src.clkr.hw, 1379 + }, 1380 + .num_parents = 1, 1381 + .flags = CLK_SET_RATE_PARENT, 1382 + .ops = &clk_branch2_ops, 1383 + }, 1384 + }, 1385 + }; 1386 + 1387 + static struct clk_branch cam_cc_core_ahb_clk = { 1388 + .halt_reg = 0xc1c8, 1389 + .halt_check = BRANCH_HALT_VOTED, 1390 + .clkr = { 1391 + .enable_reg = 0xc1c8, 1392 + .enable_mask = BIT(0), 1393 + .hw.init = &(const struct clk_init_data) { 1394 + .name = "cam_cc_core_ahb_clk", 1395 + .parent_hws = (const struct clk_hw*[]) { 1396 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1397 + }, 1398 + .num_parents = 1, 1399 + .flags = CLK_SET_RATE_PARENT, 1400 + .ops = &clk_branch2_ops, 1401 + }, 1402 + }, 1403 + }; 1404 + 1405 + static struct clk_branch cam_cc_cpas_ahb_clk = { 1406 + .halt_reg = 0xc168, 1407 + .halt_check = BRANCH_HALT, 1408 + .clkr = { 1409 + .enable_reg = 0xc168, 1410 + .enable_mask = BIT(0), 1411 + .hw.init = &(const struct clk_init_data) { 1412 + .name = "cam_cc_cpas_ahb_clk", 1413 + .parent_hws = (const struct clk_hw*[]) { 1414 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1415 + }, 1416 + .num_parents = 1, 1417 + .flags = CLK_SET_RATE_PARENT, 1418 + .ops = &clk_branch2_ops, 1419 + }, 1420 + }, 1421 + }; 1422 + 1423 + static struct clk_branch cam_cc_csi0phytimer_clk = { 1424 + .halt_reg = 0x601c, 1425 + .halt_check = BRANCH_HALT, 1426 + .clkr = { 1427 + .enable_reg = 0x601c, 1428 + .enable_mask = BIT(0), 1429 + .hw.init = &(const struct clk_init_data) { 1430 + .name = "cam_cc_csi0phytimer_clk", 1431 + .parent_hws = (const struct clk_hw*[]) { 1432 + &cam_cc_csi0phytimer_clk_src.clkr.hw, 1433 + }, 1434 + .num_parents = 1, 1435 + .flags = CLK_SET_RATE_PARENT, 1436 + .ops = &clk_branch2_ops, 1437 + }, 1438 + }, 1439 + }; 1440 + 1441 + static struct clk_branch cam_cc_csi1phytimer_clk = { 1442 + .halt_reg = 0x6040, 1443 + .halt_check = BRANCH_HALT, 1444 + .clkr = { 1445 + .enable_reg = 0x6040, 1446 + .enable_mask = BIT(0), 1447 + .hw.init = &(const struct clk_init_data) { 1448 + .name = "cam_cc_csi1phytimer_clk", 1449 + .parent_hws = (const struct clk_hw*[]) { 1450 + &cam_cc_csi1phytimer_clk_src.clkr.hw, 1451 + }, 1452 + .num_parents = 1, 1453 + .flags = CLK_SET_RATE_PARENT, 1454 + .ops = &clk_branch2_ops, 1455 + }, 1456 + }, 1457 + }; 1458 + 1459 + static struct clk_branch cam_cc_csi2phytimer_clk = { 1460 + .halt_reg = 0x6064, 1461 + .halt_check = BRANCH_HALT, 1462 + .clkr = { 1463 + .enable_reg = 0x6064, 1464 + .enable_mask = BIT(0), 1465 + .hw.init = &(const struct clk_init_data) { 1466 + .name = "cam_cc_csi2phytimer_clk", 1467 + .parent_hws = (const struct clk_hw*[]) { 1468 + &cam_cc_csi2phytimer_clk_src.clkr.hw, 1469 + }, 1470 + .num_parents = 1, 1471 + .flags = CLK_SET_RATE_PARENT, 1472 + .ops = &clk_branch2_ops, 1473 + }, 1474 + }, 1475 + }; 1476 + 1477 + static struct clk_branch cam_cc_csi3phytimer_clk = { 1478 + .halt_reg = 0x6088, 1479 + .halt_check = BRANCH_HALT, 1480 + .clkr = { 1481 + .enable_reg = 0x6088, 1482 + .enable_mask = BIT(0), 1483 + .hw.init = &(const struct clk_init_data) { 1484 + .name = "cam_cc_csi3phytimer_clk", 1485 + .parent_hws = (const struct clk_hw*[]) { 1486 + &cam_cc_csi3phytimer_clk_src.clkr.hw, 1487 + }, 1488 + .num_parents = 1, 1489 + .flags = CLK_SET_RATE_PARENT, 1490 + .ops = &clk_branch2_ops, 1491 + }, 1492 + }, 1493 + }; 1494 + 1495 + static struct clk_branch cam_cc_csiphy0_clk = { 1496 + .halt_reg = 0x6020, 1497 + .halt_check = BRANCH_HALT, 1498 + .clkr = { 1499 + .enable_reg = 0x6020, 1500 + .enable_mask = BIT(0), 1501 + .hw.init = &(const struct clk_init_data) { 1502 + .name = "cam_cc_csiphy0_clk", 1503 + .parent_hws = (const struct clk_hw*[]) { 1504 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1505 + }, 1506 + .num_parents = 1, 1507 + .flags = CLK_SET_RATE_PARENT, 1508 + .ops = &clk_branch2_ops, 1509 + }, 1510 + }, 1511 + }; 1512 + 1513 + static struct clk_branch cam_cc_csiphy1_clk = { 1514 + .halt_reg = 0x6044, 1515 + .halt_check = BRANCH_HALT, 1516 + .clkr = { 1517 + .enable_reg = 0x6044, 1518 + .enable_mask = BIT(0), 1519 + .hw.init = &(const struct clk_init_data) { 1520 + .name = "cam_cc_csiphy1_clk", 1521 + .parent_hws = (const struct clk_hw*[]) { 1522 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1523 + }, 1524 + .num_parents = 1, 1525 + .flags = CLK_SET_RATE_PARENT, 1526 + .ops = &clk_branch2_ops, 1527 + }, 1528 + }, 1529 + }; 1530 + 1531 + static struct clk_branch cam_cc_csiphy2_clk = { 1532 + .halt_reg = 0x6068, 1533 + .halt_check = BRANCH_HALT, 1534 + .clkr = { 1535 + .enable_reg = 0x6068, 1536 + .enable_mask = BIT(0), 1537 + .hw.init = &(const struct clk_init_data) { 1538 + .name = "cam_cc_csiphy2_clk", 1539 + .parent_hws = (const struct clk_hw*[]) { 1540 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1541 + }, 1542 + .num_parents = 1, 1543 + .flags = CLK_SET_RATE_PARENT, 1544 + .ops = &clk_branch2_ops, 1545 + }, 1546 + }, 1547 + }; 1548 + 1549 + static struct clk_branch cam_cc_csiphy3_clk = { 1550 + .halt_reg = 0x608c, 1551 + .halt_check = BRANCH_HALT, 1552 + .clkr = { 1553 + .enable_reg = 0x608c, 1554 + .enable_mask = BIT(0), 1555 + .hw.init = &(const struct clk_init_data) { 1556 + .name = "cam_cc_csiphy3_clk", 1557 + .parent_hws = (const struct clk_hw*[]) { 1558 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1559 + }, 1560 + .num_parents = 1, 1561 + .flags = CLK_SET_RATE_PARENT, 1562 + .ops = &clk_branch2_ops, 1563 + }, 1564 + }, 1565 + }; 1566 + 1567 + static struct clk_branch cam_cc_fd_core_clk = { 1568 + .halt_reg = 0xc0f8, 1569 + .halt_check = BRANCH_HALT, 1570 + .clkr = { 1571 + .enable_reg = 0xc0f8, 1572 + .enable_mask = BIT(0), 1573 + .hw.init = &(const struct clk_init_data) { 1574 + .name = "cam_cc_fd_core_clk", 1575 + .parent_hws = (const struct clk_hw*[]) { 1576 + &cam_cc_fd_core_clk_src.clkr.hw, 1577 + }, 1578 + .num_parents = 1, 1579 + .flags = CLK_SET_RATE_PARENT, 1580 + .ops = &clk_branch2_ops, 1581 + }, 1582 + }, 1583 + }; 1584 + 1585 + static struct clk_branch cam_cc_fd_core_uar_clk = { 1586 + .halt_reg = 0xc100, 1587 + .halt_check = BRANCH_HALT, 1588 + .clkr = { 1589 + .enable_reg = 0xc100, 1590 + .enable_mask = BIT(0), 1591 + .hw.init = &(const struct clk_init_data) { 1592 + .name = "cam_cc_fd_core_uar_clk", 1593 + .parent_hws = (const struct clk_hw*[]) { 1594 + &cam_cc_fd_core_clk_src.clkr.hw, 1595 + }, 1596 + .num_parents = 1, 1597 + .flags = CLK_SET_RATE_PARENT, 1598 + .ops = &clk_branch2_ops, 1599 + }, 1600 + }, 1601 + }; 1602 + 1603 + static struct clk_branch cam_cc_icp_ahb_clk = { 1604 + .halt_reg = 0xc0d8, 1605 + .halt_check = BRANCH_HALT, 1606 + .clkr = { 1607 + .enable_reg = 0xc0d8, 1608 + .enable_mask = BIT(0), 1609 + .hw.init = &(const struct clk_init_data) { 1610 + .name = "cam_cc_icp_ahb_clk", 1611 + .parent_hws = (const struct clk_hw*[]) { 1612 + &cam_cc_slow_ahb_clk_src.clkr.hw, 1613 + }, 1614 + .num_parents = 1, 1615 + .flags = CLK_SET_RATE_PARENT, 1616 + .ops = &clk_branch2_ops, 1617 + }, 1618 + }, 1619 + }; 1620 + 1621 + static struct clk_branch cam_cc_icp_clk = { 1622 + .halt_reg = 0xc0d0, 1623 + .halt_check = BRANCH_HALT, 1624 + .clkr = { 1625 + .enable_reg = 0xc0d0, 1626 + .enable_mask = BIT(0), 1627 + .hw.init = &(const struct clk_init_data) { 1628 + .name = "cam_cc_icp_clk", 1629 + .parent_hws = (const struct clk_hw*[]) { 1630 + &cam_cc_icp_clk_src.clkr.hw, 1631 + }, 1632 + .num_parents = 1, 1633 + .flags = CLK_SET_RATE_PARENT, 1634 + .ops = &clk_branch2_ops, 1635 + }, 1636 + }, 1637 + }; 1638 + 1639 + static struct clk_branch cam_cc_ife_0_axi_clk = { 1640 + .halt_reg = 0xa080, 1641 + .halt_check = BRANCH_HALT, 1642 + .clkr = { 1643 + .enable_reg = 0xa080, 1644 + .enable_mask = BIT(0), 1645 + .hw.init = &(const struct clk_init_data) { 1646 + .name = "cam_cc_ife_0_axi_clk", 1647 + .parent_hws = (const struct clk_hw*[]) { 1648 + &cam_cc_camnoc_axi_clk_src.clkr.hw, 1649 + }, 1650 + .num_parents = 1, 1651 + .flags = CLK_SET_RATE_PARENT, 1652 + .ops = &clk_branch2_ops, 1653 + }, 1654 + }, 1655 + }; 1656 + 1657 + static struct clk_branch cam_cc_ife_0_clk = { 1658 + .halt_reg = 0xa028, 1659 + .halt_check = BRANCH_HALT, 1660 + .clkr = { 1661 + .enable_reg = 0xa028, 1662 + .enable_mask = BIT(0), 1663 + .hw.init = &(const struct clk_init_data) { 1664 + .name = "cam_cc_ife_0_clk", 1665 + .parent_hws = (const struct clk_hw*[]) { 1666 + &cam_cc_ife_0_clk_src.clkr.hw, 1667 + }, 1668 + .num_parents = 1, 1669 + .flags = CLK_SET_RATE_PARENT, 1670 + .ops = &clk_branch2_ops, 1671 + }, 1672 + }, 1673 + }; 1674 + 1675 + static struct clk_branch cam_cc_ife_0_cphy_rx_clk = { 1676 + .halt_reg = 0xa07c, 1677 + .halt_check = BRANCH_HALT, 1678 + .clkr = { 1679 + .enable_reg = 0xa07c, 1680 + .enable_mask = BIT(0), 1681 + .hw.init = &(const struct clk_init_data) { 1682 + .name = "cam_cc_ife_0_cphy_rx_clk", 1683 + .parent_hws = (const struct clk_hw*[]) { 1684 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1685 + }, 1686 + .num_parents = 1, 1687 + .flags = CLK_SET_RATE_PARENT, 1688 + .ops = &clk_branch2_ops, 1689 + }, 1690 + }, 1691 + }; 1692 + 1693 + static struct clk_branch cam_cc_ife_0_csid_clk = { 1694 + .halt_reg = 0xa054, 1695 + .halt_check = BRANCH_HALT, 1696 + .clkr = { 1697 + .enable_reg = 0xa054, 1698 + .enable_mask = BIT(0), 1699 + .hw.init = &(const struct clk_init_data) { 1700 + .name = "cam_cc_ife_0_csid_clk", 1701 + .parent_hws = (const struct clk_hw*[]) { 1702 + &cam_cc_ife_0_csid_clk_src.clkr.hw, 1703 + }, 1704 + .num_parents = 1, 1705 + .flags = CLK_SET_RATE_PARENT, 1706 + .ops = &clk_branch2_ops, 1707 + }, 1708 + }, 1709 + }; 1710 + 1711 + static struct clk_branch cam_cc_ife_0_dsp_clk = { 1712 + .halt_reg = 0xa038, 1713 + .halt_check = BRANCH_HALT, 1714 + .clkr = { 1715 + .enable_reg = 0xa038, 1716 + .enable_mask = BIT(0), 1717 + .hw.init = &(const struct clk_init_data) { 1718 + .name = "cam_cc_ife_0_dsp_clk", 1719 + .parent_hws = (const struct clk_hw*[]) { 1720 + &cam_cc_ife_0_clk_src.clkr.hw, 1721 + }, 1722 + .num_parents = 1, 1723 + .flags = CLK_SET_RATE_PARENT, 1724 + .ops = &clk_branch2_ops, 1725 + }, 1726 + }, 1727 + }; 1728 + 1729 + static struct clk_branch cam_cc_ife_1_axi_clk = { 1730 + .halt_reg = 0xb058, 1731 + .halt_check = BRANCH_HALT, 1732 + .clkr = { 1733 + .enable_reg = 0xb058, 1734 + .enable_mask = BIT(0), 1735 + .hw.init = &(const struct clk_init_data) { 1736 + .name = "cam_cc_ife_1_axi_clk", 1737 + .parent_hws = (const struct clk_hw*[]) { 1738 + &cam_cc_camnoc_axi_clk_src.clkr.hw, 1739 + }, 1740 + .num_parents = 1, 1741 + .flags = CLK_SET_RATE_PARENT, 1742 + .ops = &clk_branch2_ops, 1743 + }, 1744 + }, 1745 + }; 1746 + 1747 + static struct clk_branch cam_cc_ife_1_clk = { 1748 + .halt_reg = 0xb028, 1749 + .halt_check = BRANCH_HALT, 1750 + .clkr = { 1751 + .enable_reg = 0xb028, 1752 + .enable_mask = BIT(0), 1753 + .hw.init = &(const struct clk_init_data) { 1754 + .name = "cam_cc_ife_1_clk", 1755 + .parent_hws = (const struct clk_hw*[]) { 1756 + &cam_cc_ife_1_clk_src.clkr.hw, 1757 + }, 1758 + .num_parents = 1, 1759 + .flags = CLK_SET_RATE_PARENT, 1760 + .ops = &clk_branch2_ops, 1761 + }, 1762 + }, 1763 + }; 1764 + 1765 + static struct clk_branch cam_cc_ife_1_cphy_rx_clk = { 1766 + .halt_reg = 0xb054, 1767 + .halt_check = BRANCH_HALT, 1768 + .clkr = { 1769 + .enable_reg = 0xb054, 1770 + .enable_mask = BIT(0), 1771 + .hw.init = &(const struct clk_init_data) { 1772 + .name = "cam_cc_ife_1_cphy_rx_clk", 1773 + .parent_hws = (const struct clk_hw*[]) { 1774 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1775 + }, 1776 + .num_parents = 1, 1777 + .flags = CLK_SET_RATE_PARENT, 1778 + .ops = &clk_branch2_ops, 1779 + }, 1780 + }, 1781 + }; 1782 + 1783 + static struct clk_branch cam_cc_ife_1_csid_clk = { 1784 + .halt_reg = 0xb04c, 1785 + .halt_check = BRANCH_HALT, 1786 + .clkr = { 1787 + .enable_reg = 0xb04c, 1788 + .enable_mask = BIT(0), 1789 + .hw.init = &(const struct clk_init_data) { 1790 + .name = "cam_cc_ife_1_csid_clk", 1791 + .parent_hws = (const struct clk_hw*[]) { 1792 + &cam_cc_ife_1_csid_clk_src.clkr.hw, 1793 + }, 1794 + .num_parents = 1, 1795 + .flags = CLK_SET_RATE_PARENT, 1796 + .ops = &clk_branch2_ops, 1797 + }, 1798 + }, 1799 + }; 1800 + 1801 + static struct clk_branch cam_cc_ife_1_dsp_clk = { 1802 + .halt_reg = 0xb030, 1803 + .halt_check = BRANCH_HALT, 1804 + .clkr = { 1805 + .enable_reg = 0xb030, 1806 + .enable_mask = BIT(0), 1807 + .hw.init = &(const struct clk_init_data) { 1808 + .name = "cam_cc_ife_1_dsp_clk", 1809 + .parent_hws = (const struct clk_hw*[]) { 1810 + &cam_cc_ife_1_clk_src.clkr.hw, 1811 + }, 1812 + .num_parents = 1, 1813 + .flags = CLK_SET_RATE_PARENT, 1814 + .ops = &clk_branch2_ops, 1815 + }, 1816 + }, 1817 + }; 1818 + 1819 + static struct clk_branch cam_cc_ife_2_axi_clk = { 1820 + .halt_reg = 0xf068, 1821 + .halt_check = BRANCH_HALT, 1822 + .clkr = { 1823 + .enable_reg = 0xf068, 1824 + .enable_mask = BIT(0), 1825 + .hw.init = &(const struct clk_init_data) { 1826 + .name = "cam_cc_ife_2_axi_clk", 1827 + .parent_hws = (const struct clk_hw*[]) { 1828 + &cam_cc_camnoc_axi_clk_src.clkr.hw, 1829 + }, 1830 + .num_parents = 1, 1831 + .flags = CLK_SET_RATE_PARENT, 1832 + .ops = &clk_branch2_ops, 1833 + }, 1834 + }, 1835 + }; 1836 + 1837 + static struct clk_branch cam_cc_ife_2_clk = { 1838 + .halt_reg = 0xf028, 1839 + .halt_check = BRANCH_HALT, 1840 + .clkr = { 1841 + .enable_reg = 0xf028, 1842 + .enable_mask = BIT(0), 1843 + .hw.init = &(const struct clk_init_data) { 1844 + .name = "cam_cc_ife_2_clk", 1845 + .parent_hws = (const struct clk_hw*[]) { 1846 + &cam_cc_ife_2_clk_src.clkr.hw, 1847 + }, 1848 + .num_parents = 1, 1849 + .flags = CLK_SET_RATE_PARENT, 1850 + .ops = &clk_branch2_ops, 1851 + }, 1852 + }, 1853 + }; 1854 + 1855 + static struct clk_branch cam_cc_ife_2_cphy_rx_clk = { 1856 + .halt_reg = 0xf064, 1857 + .halt_check = BRANCH_HALT, 1858 + .clkr = { 1859 + .enable_reg = 0xf064, 1860 + .enable_mask = BIT(0), 1861 + .hw.init = &(const struct clk_init_data) { 1862 + .name = "cam_cc_ife_2_cphy_rx_clk", 1863 + .parent_hws = (const struct clk_hw*[]) { 1864 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1865 + }, 1866 + .num_parents = 1, 1867 + .flags = CLK_SET_RATE_PARENT, 1868 + .ops = &clk_branch2_ops, 1869 + }, 1870 + }, 1871 + }; 1872 + 1873 + static struct clk_branch cam_cc_ife_2_csid_clk = { 1874 + .halt_reg = 0xf054, 1875 + .halt_check = BRANCH_HALT, 1876 + .clkr = { 1877 + .enable_reg = 0xf054, 1878 + .enable_mask = BIT(0), 1879 + .hw.init = &(const struct clk_init_data) { 1880 + .name = "cam_cc_ife_2_csid_clk", 1881 + .parent_hws = (const struct clk_hw*[]) { 1882 + &cam_cc_ife_2_csid_clk_src.clkr.hw, 1883 + }, 1884 + .num_parents = 1, 1885 + .flags = CLK_SET_RATE_PARENT, 1886 + .ops = &clk_branch2_ops, 1887 + }, 1888 + }, 1889 + }; 1890 + 1891 + static struct clk_branch cam_cc_ife_2_dsp_clk = { 1892 + .halt_reg = 0xf038, 1893 + .halt_check = BRANCH_HALT, 1894 + .clkr = { 1895 + .enable_reg = 0xf038, 1896 + .enable_mask = BIT(0), 1897 + .hw.init = &(const struct clk_init_data) { 1898 + .name = "cam_cc_ife_2_dsp_clk", 1899 + .parent_hws = (const struct clk_hw*[]) { 1900 + &cam_cc_ife_2_clk_src.clkr.hw, 1901 + }, 1902 + .num_parents = 1, 1903 + .flags = CLK_SET_RATE_PARENT, 1904 + .ops = &clk_branch2_ops, 1905 + }, 1906 + }, 1907 + }; 1908 + 1909 + static struct clk_branch cam_cc_ife_3_axi_clk = { 1910 + .halt_reg = 0xf0d4, 1911 + .halt_check = BRANCH_HALT, 1912 + .clkr = { 1913 + .enable_reg = 0xf0d4, 1914 + .enable_mask = BIT(0), 1915 + .hw.init = &(const struct clk_init_data) { 1916 + .name = "cam_cc_ife_3_axi_clk", 1917 + .parent_hws = (const struct clk_hw*[]) { 1918 + &cam_cc_camnoc_axi_clk_src.clkr.hw, 1919 + }, 1920 + .num_parents = 1, 1921 + .flags = CLK_SET_RATE_PARENT, 1922 + .ops = &clk_branch2_ops, 1923 + }, 1924 + }, 1925 + }; 1926 + 1927 + static struct clk_branch cam_cc_ife_3_clk = { 1928 + .halt_reg = 0xf094, 1929 + .halt_check = BRANCH_HALT, 1930 + .clkr = { 1931 + .enable_reg = 0xf094, 1932 + .enable_mask = BIT(0), 1933 + .hw.init = &(const struct clk_init_data) { 1934 + .name = "cam_cc_ife_3_clk", 1935 + .parent_hws = (const struct clk_hw*[]) { 1936 + &cam_cc_ife_3_clk_src.clkr.hw, 1937 + }, 1938 + .num_parents = 1, 1939 + .flags = CLK_SET_RATE_PARENT, 1940 + .ops = &clk_branch2_ops, 1941 + }, 1942 + }, 1943 + }; 1944 + 1945 + static struct clk_branch cam_cc_ife_3_cphy_rx_clk = { 1946 + .halt_reg = 0xf0d0, 1947 + .halt_check = BRANCH_HALT, 1948 + .clkr = { 1949 + .enable_reg = 0xf0d0, 1950 + .enable_mask = BIT(0), 1951 + .hw.init = &(const struct clk_init_data) { 1952 + .name = "cam_cc_ife_3_cphy_rx_clk", 1953 + .parent_hws = (const struct clk_hw*[]) { 1954 + &cam_cc_cphy_rx_clk_src.clkr.hw, 1955 + }, 1956 + .num_parents = 1, 1957 + .flags = CLK_SET_RATE_PARENT, 1958 + .ops = &clk_branch2_ops, 1959 + }, 1960 + }, 1961 + }; 1962 + 1963 + static struct clk_branch cam_cc_ife_3_csid_clk = { 1964 + .halt_reg = 0xf0c0, 1965 + .halt_check = BRANCH_HALT, 1966 + .clkr = { 1967 + .enable_reg = 0xf0c0, 1968 + .enable_mask = BIT(0), 1969 + .hw.init = &(const struct clk_init_data) { 1970 + .name = "cam_cc_ife_3_csid_clk", 1971 + .parent_hws = (const struct clk_hw*[]) { 1972 + &cam_cc_ife_3_csid_clk_src.clkr.hw, 1973 + }, 1974 + .num_parents = 1, 1975 + .flags = CLK_SET_RATE_PARENT, 1976 + .ops = &clk_branch2_ops, 1977 + }, 1978 + }, 1979 + }; 1980 + 1981 + static struct clk_branch cam_cc_ife_3_dsp_clk = { 1982 + .halt_reg = 0xf0a4, 1983 + .halt_check = BRANCH_HALT, 1984 + .clkr = { 1985 + .enable_reg = 0xf0a4, 1986 + .enable_mask = BIT(0), 1987 + .hw.init = &(const struct clk_init_data) { 1988 + .name = "cam_cc_ife_3_dsp_clk", 1989 + .parent_hws = (const struct clk_hw*[]) { 1990 + &cam_cc_ife_3_clk_src.clkr.hw, 1991 + }, 1992 + .num_parents = 1, 1993 + .flags = CLK_SET_RATE_PARENT, 1994 + .ops = &clk_branch2_ops, 1995 + }, 1996 + }, 1997 + }; 1998 + 1999 + static struct clk_branch cam_cc_ife_lite_0_clk = { 2000 + .halt_reg = 0xc01c, 2001 + .halt_check = BRANCH_HALT, 2002 + .clkr = { 2003 + .enable_reg = 0xc01c, 2004 + .enable_mask = BIT(0), 2005 + .hw.init = &(const struct clk_init_data) { 2006 + .name = "cam_cc_ife_lite_0_clk", 2007 + .parent_hws = (const struct clk_hw*[]) { 2008 + &cam_cc_ife_lite_0_clk_src.clkr.hw, 2009 + }, 2010 + .num_parents = 1, 2011 + .flags = CLK_SET_RATE_PARENT, 2012 + .ops = &clk_branch2_ops, 2013 + }, 2014 + }, 2015 + }; 2016 + 2017 + static struct clk_branch cam_cc_ife_lite_0_cphy_rx_clk = { 2018 + .halt_reg = 0xc040, 2019 + .halt_check = BRANCH_HALT, 2020 + .clkr = { 2021 + .enable_reg = 0xc040, 2022 + .enable_mask = BIT(0), 2023 + .hw.init = &(const struct clk_init_data) { 2024 + .name = "cam_cc_ife_lite_0_cphy_rx_clk", 2025 + .parent_hws = (const struct clk_hw*[]) { 2026 + &cam_cc_cphy_rx_clk_src.clkr.hw, 2027 + }, 2028 + .num_parents = 1, 2029 + .flags = CLK_SET_RATE_PARENT, 2030 + .ops = &clk_branch2_ops, 2031 + }, 2032 + }, 2033 + }; 2034 + 2035 + static struct clk_branch cam_cc_ife_lite_0_csid_clk = { 2036 + .halt_reg = 0xc038, 2037 + .halt_check = BRANCH_HALT, 2038 + .clkr = { 2039 + .enable_reg = 0xc038, 2040 + .enable_mask = BIT(0), 2041 + .hw.init = &(const struct clk_init_data) { 2042 + .name = "cam_cc_ife_lite_0_csid_clk", 2043 + .parent_hws = (const struct clk_hw*[]) { 2044 + &cam_cc_ife_lite_0_csid_clk_src.clkr.hw, 2045 + }, 2046 + .num_parents = 1, 2047 + .flags = CLK_SET_RATE_PARENT, 2048 + .ops = &clk_branch2_ops, 2049 + }, 2050 + }, 2051 + }; 2052 + 2053 + static struct clk_branch cam_cc_ife_lite_1_clk = { 2054 + .halt_reg = 0xc060, 2055 + .halt_check = BRANCH_HALT, 2056 + .clkr = { 2057 + .enable_reg = 0xc060, 2058 + .enable_mask = BIT(0), 2059 + .hw.init = &(const struct clk_init_data) { 2060 + .name = "cam_cc_ife_lite_1_clk", 2061 + .parent_hws = (const struct clk_hw*[]) { 2062 + &cam_cc_ife_lite_1_clk_src.clkr.hw, 2063 + }, 2064 + .num_parents = 1, 2065 + .flags = CLK_SET_RATE_PARENT, 2066 + .ops = &clk_branch2_ops, 2067 + }, 2068 + }, 2069 + }; 2070 + 2071 + static struct clk_branch cam_cc_ife_lite_1_cphy_rx_clk = { 2072 + .halt_reg = 0xc084, 2073 + .halt_check = BRANCH_HALT, 2074 + .clkr = { 2075 + .enable_reg = 0xc084, 2076 + .enable_mask = BIT(0), 2077 + .hw.init = &(const struct clk_init_data) { 2078 + .name = "cam_cc_ife_lite_1_cphy_rx_clk", 2079 + .parent_hws = (const struct clk_hw*[]) { 2080 + &cam_cc_cphy_rx_clk_src.clkr.hw, 2081 + }, 2082 + .num_parents = 1, 2083 + .flags = CLK_SET_RATE_PARENT, 2084 + .ops = &clk_branch2_ops, 2085 + }, 2086 + }, 2087 + }; 2088 + 2089 + static struct clk_branch cam_cc_ife_lite_1_csid_clk = { 2090 + .halt_reg = 0xc07c, 2091 + .halt_check = BRANCH_HALT, 2092 + .clkr = { 2093 + .enable_reg = 0xc07c, 2094 + .enable_mask = BIT(0), 2095 + .hw.init = &(const struct clk_init_data) { 2096 + .name = "cam_cc_ife_lite_1_csid_clk", 2097 + .parent_hws = (const struct clk_hw*[]) { 2098 + &cam_cc_ife_lite_1_csid_clk_src.clkr.hw, 2099 + }, 2100 + .num_parents = 1, 2101 + .flags = CLK_SET_RATE_PARENT, 2102 + .ops = &clk_branch2_ops, 2103 + }, 2104 + }, 2105 + }; 2106 + 2107 + static struct clk_branch cam_cc_ife_lite_2_clk = { 2108 + .halt_reg = 0xc258, 2109 + .halt_check = BRANCH_HALT, 2110 + .clkr = { 2111 + .enable_reg = 0xc258, 2112 + .enable_mask = BIT(0), 2113 + .hw.init = &(const struct clk_init_data) { 2114 + .name = "cam_cc_ife_lite_2_clk", 2115 + .parent_hws = (const struct clk_hw*[]) { 2116 + &cam_cc_ife_lite_2_clk_src.clkr.hw, 2117 + }, 2118 + .num_parents = 1, 2119 + .flags = CLK_SET_RATE_PARENT, 2120 + .ops = &clk_branch2_ops, 2121 + }, 2122 + }, 2123 + }; 2124 + 2125 + static struct clk_branch cam_cc_ife_lite_2_cphy_rx_clk = { 2126 + .halt_reg = 0xc27c, 2127 + .halt_check = BRANCH_HALT, 2128 + .clkr = { 2129 + .enable_reg = 0xc27c, 2130 + .enable_mask = BIT(0), 2131 + .hw.init = &(const struct clk_init_data) { 2132 + .name = "cam_cc_ife_lite_2_cphy_rx_clk", 2133 + .parent_hws = (const struct clk_hw*[]) { 2134 + &cam_cc_cphy_rx_clk_src.clkr.hw, 2135 + }, 2136 + .num_parents = 1, 2137 + .flags = CLK_SET_RATE_PARENT, 2138 + .ops = &clk_branch2_ops, 2139 + }, 2140 + }, 2141 + }; 2142 + 2143 + static struct clk_branch cam_cc_ife_lite_2_csid_clk = { 2144 + .halt_reg = 0xc274, 2145 + .halt_check = BRANCH_HALT, 2146 + .clkr = { 2147 + .enable_reg = 0xc274, 2148 + .enable_mask = BIT(0), 2149 + .hw.init = &(const struct clk_init_data) { 2150 + .name = "cam_cc_ife_lite_2_csid_clk", 2151 + .parent_hws = (const struct clk_hw*[]) { 2152 + &cam_cc_ife_lite_2_csid_clk_src.clkr.hw, 2153 + }, 2154 + .num_parents = 1, 2155 + .flags = CLK_SET_RATE_PARENT, 2156 + .ops = &clk_branch2_ops, 2157 + }, 2158 + }, 2159 + }; 2160 + 2161 + static struct clk_branch cam_cc_ife_lite_3_clk = { 2162 + .halt_reg = 0xc29c, 2163 + .halt_check = BRANCH_HALT, 2164 + .clkr = { 2165 + .enable_reg = 0xc29c, 2166 + .enable_mask = BIT(0), 2167 + .hw.init = &(const struct clk_init_data) { 2168 + .name = "cam_cc_ife_lite_3_clk", 2169 + .parent_hws = (const struct clk_hw*[]) { 2170 + &cam_cc_ife_lite_3_clk_src.clkr.hw, 2171 + }, 2172 + .num_parents = 1, 2173 + .flags = CLK_SET_RATE_PARENT, 2174 + .ops = &clk_branch2_ops, 2175 + }, 2176 + }, 2177 + }; 2178 + 2179 + static struct clk_branch cam_cc_ife_lite_3_cphy_rx_clk = { 2180 + .halt_reg = 0xc2c0, 2181 + .halt_check = BRANCH_HALT, 2182 + .clkr = { 2183 + .enable_reg = 0xc2c0, 2184 + .enable_mask = BIT(0), 2185 + .hw.init = &(const struct clk_init_data) { 2186 + .name = "cam_cc_ife_lite_3_cphy_rx_clk", 2187 + .parent_hws = (const struct clk_hw*[]) { 2188 + &cam_cc_cphy_rx_clk_src.clkr.hw, 2189 + }, 2190 + .num_parents = 1, 2191 + .flags = CLK_SET_RATE_PARENT, 2192 + .ops = &clk_branch2_ops, 2193 + }, 2194 + }, 2195 + }; 2196 + 2197 + static struct clk_branch cam_cc_ife_lite_3_csid_clk = { 2198 + .halt_reg = 0xc2b8, 2199 + .halt_check = BRANCH_HALT, 2200 + .clkr = { 2201 + .enable_reg = 0xc2b8, 2202 + .enable_mask = BIT(0), 2203 + .hw.init = &(const struct clk_init_data) { 2204 + .name = "cam_cc_ife_lite_3_csid_clk", 2205 + .parent_hws = (const struct clk_hw*[]) { 2206 + &cam_cc_ife_lite_3_csid_clk_src.clkr.hw, 2207 + }, 2208 + .num_parents = 1, 2209 + .flags = CLK_SET_RATE_PARENT, 2210 + .ops = &clk_branch2_ops, 2211 + }, 2212 + }, 2213 + }; 2214 + 2215 + static struct clk_branch cam_cc_ipe_0_ahb_clk = { 2216 + .halt_reg = 0x8040, 2217 + .halt_check = BRANCH_HALT, 2218 + .clkr = { 2219 + .enable_reg = 0x8040, 2220 + .enable_mask = BIT(0), 2221 + .hw.init = &(const struct clk_init_data) { 2222 + .name = "cam_cc_ipe_0_ahb_clk", 2223 + .parent_hws = (const struct clk_hw*[]) { 2224 + &cam_cc_slow_ahb_clk_src.clkr.hw, 2225 + }, 2226 + .num_parents = 1, 2227 + .flags = CLK_SET_RATE_PARENT, 2228 + .ops = &clk_branch2_ops, 2229 + }, 2230 + }, 2231 + }; 2232 + 2233 + static struct clk_branch cam_cc_ipe_0_areg_clk = { 2234 + .halt_reg = 0x803c, 2235 + .halt_check = BRANCH_HALT, 2236 + .clkr = { 2237 + .enable_reg = 0x803c, 2238 + .enable_mask = BIT(0), 2239 + .hw.init = &(const struct clk_init_data) { 2240 + .name = "cam_cc_ipe_0_areg_clk", 2241 + .parent_hws = (const struct clk_hw*[]) { 2242 + &cam_cc_fast_ahb_clk_src.clkr.hw, 2243 + }, 2244 + .num_parents = 1, 2245 + .flags = CLK_SET_RATE_PARENT, 2246 + .ops = &clk_branch2_ops, 2247 + }, 2248 + }, 2249 + }; 2250 + 2251 + static struct clk_branch cam_cc_ipe_0_axi_clk = { 2252 + .halt_reg = 0x8038, 2253 + .halt_check = BRANCH_HALT, 2254 + .clkr = { 2255 + .enable_reg = 0x8038, 2256 + .enable_mask = BIT(0), 2257 + .hw.init = &(const struct clk_init_data) { 2258 + .name = "cam_cc_ipe_0_axi_clk", 2259 + .parent_hws = (const struct clk_hw*[]) { 2260 + &cam_cc_camnoc_axi_clk_src.clkr.hw, 2261 + }, 2262 + .num_parents = 1, 2263 + .flags = CLK_SET_RATE_PARENT, 2264 + .ops = &clk_branch2_ops, 2265 + }, 2266 + }, 2267 + }; 2268 + 2269 + static struct clk_branch cam_cc_ipe_0_clk = { 2270 + .halt_reg = 0x8028, 2271 + .halt_check = BRANCH_HALT, 2272 + .clkr = { 2273 + .enable_reg = 0x8028, 2274 + .enable_mask = BIT(0), 2275 + .hw.init = &(const struct clk_init_data) { 2276 + .name = "cam_cc_ipe_0_clk", 2277 + .parent_hws = (const struct clk_hw*[]) { 2278 + &cam_cc_ipe_0_clk_src.clkr.hw, 2279 + }, 2280 + .num_parents = 1, 2281 + .flags = CLK_SET_RATE_PARENT, 2282 + .ops = &clk_branch2_ops, 2283 + }, 2284 + }, 2285 + }; 2286 + 2287 + static struct clk_branch cam_cc_ipe_1_ahb_clk = { 2288 + .halt_reg = 0x9028, 2289 + .halt_check = BRANCH_HALT, 2290 + .clkr = { 2291 + .enable_reg = 0x9028, 2292 + .enable_mask = BIT(0), 2293 + .hw.init = &(const struct clk_init_data) { 2294 + .name = "cam_cc_ipe_1_ahb_clk", 2295 + .parent_hws = (const struct clk_hw*[]) { 2296 + &cam_cc_slow_ahb_clk_src.clkr.hw, 2297 + }, 2298 + .num_parents = 1, 2299 + .flags = CLK_SET_RATE_PARENT, 2300 + .ops = &clk_branch2_ops, 2301 + }, 2302 + }, 2303 + }; 2304 + 2305 + static struct clk_branch cam_cc_ipe_1_areg_clk = { 2306 + .halt_reg = 0x9024, 2307 + .halt_check = BRANCH_HALT, 2308 + .clkr = { 2309 + .enable_reg = 0x9024, 2310 + .enable_mask = BIT(0), 2311 + .hw.init = &(const struct clk_init_data) { 2312 + .name = "cam_cc_ipe_1_areg_clk", 2313 + .parent_hws = (const struct clk_hw*[]) { 2314 + &cam_cc_fast_ahb_clk_src.clkr.hw, 2315 + }, 2316 + .num_parents = 1, 2317 + .flags = CLK_SET_RATE_PARENT, 2318 + .ops = &clk_branch2_ops, 2319 + }, 2320 + }, 2321 + }; 2322 + 2323 + static struct clk_branch cam_cc_ipe_1_axi_clk = { 2324 + .halt_reg = 0x9020, 2325 + .halt_check = BRANCH_HALT, 2326 + .clkr = { 2327 + .enable_reg = 0x9020, 2328 + .enable_mask = BIT(0), 2329 + .hw.init = &(const struct clk_init_data) { 2330 + .name = "cam_cc_ipe_1_axi_clk", 2331 + .parent_hws = (const struct clk_hw*[]) { 2332 + &cam_cc_camnoc_axi_clk_src.clkr.hw, 2333 + }, 2334 + .num_parents = 1, 2335 + .flags = CLK_SET_RATE_PARENT, 2336 + .ops = &clk_branch2_ops, 2337 + }, 2338 + }, 2339 + }; 2340 + 2341 + static struct clk_branch cam_cc_ipe_1_clk = { 2342 + .halt_reg = 0x9010, 2343 + .halt_check = BRANCH_HALT, 2344 + .clkr = { 2345 + .enable_reg = 0x9010, 2346 + .enable_mask = BIT(0), 2347 + .hw.init = &(const struct clk_init_data) { 2348 + .name = "cam_cc_ipe_1_clk", 2349 + .parent_hws = (const struct clk_hw*[]) { 2350 + &cam_cc_ipe_0_clk_src.clkr.hw, 2351 + }, 2352 + .num_parents = 1, 2353 + .flags = CLK_SET_RATE_PARENT, 2354 + .ops = &clk_branch2_ops, 2355 + }, 2356 + }, 2357 + }; 2358 + 2359 + static struct clk_branch cam_cc_jpeg_clk = { 2360 + .halt_reg = 0xc0a4, 2361 + .halt_check = BRANCH_HALT, 2362 + .clkr = { 2363 + .enable_reg = 0xc0a4, 2364 + .enable_mask = BIT(0), 2365 + .hw.init = &(const struct clk_init_data) { 2366 + .name = "cam_cc_jpeg_clk", 2367 + .parent_hws = (const struct clk_hw*[]) { 2368 + &cam_cc_jpeg_clk_src.clkr.hw, 2369 + }, 2370 + .num_parents = 1, 2371 + .flags = CLK_SET_RATE_PARENT, 2372 + .ops = &clk_branch2_ops, 2373 + }, 2374 + }, 2375 + }; 2376 + 2377 + static struct clk_branch cam_cc_lrme_clk = { 2378 + .halt_reg = 0xc15c, 2379 + .halt_check = BRANCH_HALT, 2380 + .clkr = { 2381 + .enable_reg = 0xc15c, 2382 + .enable_mask = BIT(0), 2383 + .hw.init = &(const struct clk_init_data) { 2384 + .name = "cam_cc_lrme_clk", 2385 + .parent_hws = (const struct clk_hw*[]) { 2386 + &cam_cc_lrme_clk_src.clkr.hw, 2387 + }, 2388 + .num_parents = 1, 2389 + .flags = CLK_SET_RATE_PARENT, 2390 + .ops = &clk_branch2_ops, 2391 + }, 2392 + }, 2393 + }; 2394 + 2395 + static struct clk_branch cam_cc_mclk0_clk = { 2396 + .halt_reg = 0x501c, 2397 + .halt_check = BRANCH_HALT, 2398 + .clkr = { 2399 + .enable_reg = 0x501c, 2400 + .enable_mask = BIT(0), 2401 + .hw.init = &(const struct clk_init_data) { 2402 + .name = "cam_cc_mclk0_clk", 2403 + .parent_hws = (const struct clk_hw*[]) { 2404 + &cam_cc_mclk0_clk_src.clkr.hw, 2405 + }, 2406 + .num_parents = 1, 2407 + .flags = CLK_SET_RATE_PARENT, 2408 + .ops = &clk_branch2_ops, 2409 + }, 2410 + }, 2411 + }; 2412 + 2413 + static struct clk_branch cam_cc_mclk1_clk = { 2414 + .halt_reg = 0x503c, 2415 + .halt_check = BRANCH_HALT, 2416 + .clkr = { 2417 + .enable_reg = 0x503c, 2418 + .enable_mask = BIT(0), 2419 + .hw.init = &(const struct clk_init_data) { 2420 + .name = "cam_cc_mclk1_clk", 2421 + .parent_hws = (const struct clk_hw*[]) { 2422 + &cam_cc_mclk1_clk_src.clkr.hw, 2423 + }, 2424 + .num_parents = 1, 2425 + .flags = CLK_SET_RATE_PARENT, 2426 + .ops = &clk_branch2_ops, 2427 + }, 2428 + }, 2429 + }; 2430 + 2431 + static struct clk_branch cam_cc_mclk2_clk = { 2432 + .halt_reg = 0x505c, 2433 + .halt_check = BRANCH_HALT, 2434 + .clkr = { 2435 + .enable_reg = 0x505c, 2436 + .enable_mask = BIT(0), 2437 + .hw.init = &(const struct clk_init_data) { 2438 + .name = "cam_cc_mclk2_clk", 2439 + .parent_hws = (const struct clk_hw*[]) { 2440 + &cam_cc_mclk2_clk_src.clkr.hw, 2441 + }, 2442 + .num_parents = 1, 2443 + .flags = CLK_SET_RATE_PARENT, 2444 + .ops = &clk_branch2_ops, 2445 + }, 2446 + }, 2447 + }; 2448 + 2449 + static struct clk_branch cam_cc_mclk3_clk = { 2450 + .halt_reg = 0x507c, 2451 + .halt_check = BRANCH_HALT, 2452 + .clkr = { 2453 + .enable_reg = 0x507c, 2454 + .enable_mask = BIT(0), 2455 + .hw.init = &(const struct clk_init_data) { 2456 + .name = "cam_cc_mclk3_clk", 2457 + .parent_hws = (const struct clk_hw*[]) { 2458 + &cam_cc_mclk3_clk_src.clkr.hw, 2459 + }, 2460 + .num_parents = 1, 2461 + .flags = CLK_SET_RATE_PARENT, 2462 + .ops = &clk_branch2_ops, 2463 + }, 2464 + }, 2465 + }; 2466 + 2467 + static struct clk_branch cam_cc_mclk4_clk = { 2468 + .halt_reg = 0x509c, 2469 + .halt_check = BRANCH_HALT, 2470 + .clkr = { 2471 + .enable_reg = 0x509c, 2472 + .enable_mask = BIT(0), 2473 + .hw.init = &(const struct clk_init_data) { 2474 + .name = "cam_cc_mclk4_clk", 2475 + .parent_hws = (const struct clk_hw*[]) { 2476 + &cam_cc_mclk4_clk_src.clkr.hw, 2477 + }, 2478 + .num_parents = 1, 2479 + .flags = CLK_SET_RATE_PARENT, 2480 + .ops = &clk_branch2_ops, 2481 + }, 2482 + }, 2483 + }; 2484 + 2485 + static struct clk_branch cam_cc_mclk5_clk = { 2486 + .halt_reg = 0x50bc, 2487 + .halt_check = BRANCH_HALT, 2488 + .clkr = { 2489 + .enable_reg = 0x50bc, 2490 + .enable_mask = BIT(0), 2491 + .hw.init = &(const struct clk_init_data) { 2492 + .name = "cam_cc_mclk5_clk", 2493 + .parent_hws = (const struct clk_hw*[]) { 2494 + &cam_cc_mclk5_clk_src.clkr.hw, 2495 + }, 2496 + .num_parents = 1, 2497 + .flags = CLK_SET_RATE_PARENT, 2498 + .ops = &clk_branch2_ops, 2499 + }, 2500 + }, 2501 + }; 2502 + 2503 + static struct clk_branch cam_cc_mclk6_clk = { 2504 + .halt_reg = 0x50dc, 2505 + .halt_check = BRANCH_HALT, 2506 + .clkr = { 2507 + .enable_reg = 0x50dc, 2508 + .enable_mask = BIT(0), 2509 + .hw.init = &(const struct clk_init_data) { 2510 + .name = "cam_cc_mclk6_clk", 2511 + .parent_hws = (const struct clk_hw*[]) { 2512 + &cam_cc_mclk6_clk_src.clkr.hw, 2513 + }, 2514 + .num_parents = 1, 2515 + .flags = CLK_SET_RATE_PARENT, 2516 + .ops = &clk_branch2_ops, 2517 + }, 2518 + }, 2519 + }; 2520 + 2521 + static struct clk_branch cam_cc_mclk7_clk = { 2522 + .halt_reg = 0x50fc, 2523 + .halt_check = BRANCH_HALT, 2524 + .clkr = { 2525 + .enable_reg = 0x50fc, 2526 + .enable_mask = BIT(0), 2527 + .hw.init = &(const struct clk_init_data) { 2528 + .name = "cam_cc_mclk7_clk", 2529 + .parent_hws = (const struct clk_hw*[]) { 2530 + &cam_cc_mclk7_clk_src.clkr.hw, 2531 + }, 2532 + .num_parents = 1, 2533 + .flags = CLK_SET_RATE_PARENT, 2534 + .ops = &clk_branch2_ops, 2535 + }, 2536 + }, 2537 + }; 2538 + 2539 + static struct gdsc titan_top_gdsc = { 2540 + .gdscr = 0xc1bc, 2541 + .en_rest_wait_val = 0x2, 2542 + .en_few_wait_val = 0x2, 2543 + .clk_dis_wait_val = 0xf, 2544 + .pd = { 2545 + .name = "titan_top_gdsc", 2546 + }, 2547 + .pwrsts = PWRSTS_OFF_ON, 2548 + .flags = POLL_CFG_GDSCR, 2549 + }; 2550 + 2551 + static struct gdsc bps_gdsc = { 2552 + .gdscr = 0x7004, 2553 + .en_rest_wait_val = 0x2, 2554 + .en_few_wait_val = 0x2, 2555 + .clk_dis_wait_val = 0xf, 2556 + .pd = { 2557 + .name = "bps_gdsc", 2558 + }, 2559 + .pwrsts = PWRSTS_OFF_ON, 2560 + .parent = &titan_top_gdsc.pd, 2561 + .flags = POLL_CFG_GDSCR, 2562 + }; 2563 + 2564 + static struct gdsc ife_0_gdsc = { 2565 + .gdscr = 0xa004, 2566 + .en_rest_wait_val = 0x2, 2567 + .en_few_wait_val = 0x2, 2568 + .clk_dis_wait_val = 0xf, 2569 + .pd = { 2570 + .name = "ife_0_gdsc", 2571 + }, 2572 + .pwrsts = PWRSTS_OFF_ON, 2573 + .parent = &titan_top_gdsc.pd, 2574 + .flags = POLL_CFG_GDSCR, 2575 + }; 2576 + 2577 + static struct gdsc ife_1_gdsc = { 2578 + .gdscr = 0xb004, 2579 + .en_rest_wait_val = 0x2, 2580 + .en_few_wait_val = 0x2, 2581 + .clk_dis_wait_val = 0xf, 2582 + .pd = { 2583 + .name = "ife_1_gdsc", 2584 + }, 2585 + .pwrsts = PWRSTS_OFF_ON, 2586 + .parent = &titan_top_gdsc.pd, 2587 + .flags = POLL_CFG_GDSCR, 2588 + }; 2589 + 2590 + static struct gdsc ife_2_gdsc = { 2591 + .gdscr = 0xf004, 2592 + .en_rest_wait_val = 0x2, 2593 + .en_few_wait_val = 0x2, 2594 + .clk_dis_wait_val = 0xf, 2595 + .pd = { 2596 + .name = "ife_2_gdsc", 2597 + }, 2598 + .pwrsts = PWRSTS_OFF_ON, 2599 + .parent = &titan_top_gdsc.pd, 2600 + .flags = POLL_CFG_GDSCR, 2601 + }; 2602 + 2603 + static struct gdsc ife_3_gdsc = { 2604 + .gdscr = 0xf070, 2605 + .en_rest_wait_val = 0x2, 2606 + .en_few_wait_val = 0x2, 2607 + .clk_dis_wait_val = 0xf, 2608 + .pd = { 2609 + .name = "ife_3_gdsc", 2610 + }, 2611 + .pwrsts = PWRSTS_OFF_ON, 2612 + .parent = &titan_top_gdsc.pd, 2613 + .flags = POLL_CFG_GDSCR, 2614 + }; 2615 + 2616 + static struct gdsc ipe_0_gdsc = { 2617 + .gdscr = 0x8004, 2618 + .en_rest_wait_val = 0x2, 2619 + .en_few_wait_val = 0x2, 2620 + .clk_dis_wait_val = 0xf, 2621 + .pd = { 2622 + .name = "ipe_0_gdsc", 2623 + }, 2624 + .pwrsts = PWRSTS_OFF_ON, 2625 + .parent = &titan_top_gdsc.pd, 2626 + .flags = POLL_CFG_GDSCR, 2627 + }; 2628 + 2629 + static struct gdsc ipe_1_gdsc = { 2630 + .gdscr = 0x9004, 2631 + .en_rest_wait_val = 0x2, 2632 + .en_few_wait_val = 0x2, 2633 + .clk_dis_wait_val = 0xf, 2634 + .pd = { 2635 + .name = "ipe_1_gdsc", 2636 + }, 2637 + .pwrsts = PWRSTS_OFF_ON, 2638 + .parent = &titan_top_gdsc.pd, 2639 + .flags = POLL_CFG_GDSCR, 2640 + }; 2641 + 2642 + static struct clk_regmap *cam_cc_sc8180x_clocks[] = { 2643 + [CAM_CC_BPS_AHB_CLK] = &cam_cc_bps_ahb_clk.clkr, 2644 + [CAM_CC_BPS_AREG_CLK] = &cam_cc_bps_areg_clk.clkr, 2645 + [CAM_CC_BPS_AXI_CLK] = &cam_cc_bps_axi_clk.clkr, 2646 + [CAM_CC_BPS_CLK] = &cam_cc_bps_clk.clkr, 2647 + [CAM_CC_BPS_CLK_SRC] = &cam_cc_bps_clk_src.clkr, 2648 + [CAM_CC_CAMNOC_AXI_CLK] = &cam_cc_camnoc_axi_clk.clkr, 2649 + [CAM_CC_CAMNOC_AXI_CLK_SRC] = &cam_cc_camnoc_axi_clk_src.clkr, 2650 + [CAM_CC_CAMNOC_DCD_XO_CLK] = &cam_cc_camnoc_dcd_xo_clk.clkr, 2651 + [CAM_CC_CCI_0_CLK] = &cam_cc_cci_0_clk.clkr, 2652 + [CAM_CC_CCI_0_CLK_SRC] = &cam_cc_cci_0_clk_src.clkr, 2653 + [CAM_CC_CCI_1_CLK] = &cam_cc_cci_1_clk.clkr, 2654 + [CAM_CC_CCI_1_CLK_SRC] = &cam_cc_cci_1_clk_src.clkr, 2655 + [CAM_CC_CCI_2_CLK] = &cam_cc_cci_2_clk.clkr, 2656 + [CAM_CC_CCI_2_CLK_SRC] = &cam_cc_cci_2_clk_src.clkr, 2657 + [CAM_CC_CCI_3_CLK] = &cam_cc_cci_3_clk.clkr, 2658 + [CAM_CC_CCI_3_CLK_SRC] = &cam_cc_cci_3_clk_src.clkr, 2659 + [CAM_CC_CORE_AHB_CLK] = &cam_cc_core_ahb_clk.clkr, 2660 + [CAM_CC_CPAS_AHB_CLK] = &cam_cc_cpas_ahb_clk.clkr, 2661 + [CAM_CC_CPHY_RX_CLK_SRC] = &cam_cc_cphy_rx_clk_src.clkr, 2662 + [CAM_CC_CSI0PHYTIMER_CLK] = &cam_cc_csi0phytimer_clk.clkr, 2663 + [CAM_CC_CSI0PHYTIMER_CLK_SRC] = &cam_cc_csi0phytimer_clk_src.clkr, 2664 + [CAM_CC_CSI1PHYTIMER_CLK] = &cam_cc_csi1phytimer_clk.clkr, 2665 + [CAM_CC_CSI1PHYTIMER_CLK_SRC] = &cam_cc_csi1phytimer_clk_src.clkr, 2666 + [CAM_CC_CSI2PHYTIMER_CLK] = &cam_cc_csi2phytimer_clk.clkr, 2667 + [CAM_CC_CSI2PHYTIMER_CLK_SRC] = &cam_cc_csi2phytimer_clk_src.clkr, 2668 + [CAM_CC_CSI3PHYTIMER_CLK] = &cam_cc_csi3phytimer_clk.clkr, 2669 + [CAM_CC_CSI3PHYTIMER_CLK_SRC] = &cam_cc_csi3phytimer_clk_src.clkr, 2670 + [CAM_CC_CSIPHY0_CLK] = &cam_cc_csiphy0_clk.clkr, 2671 + [CAM_CC_CSIPHY1_CLK] = &cam_cc_csiphy1_clk.clkr, 2672 + [CAM_CC_CSIPHY2_CLK] = &cam_cc_csiphy2_clk.clkr, 2673 + [CAM_CC_CSIPHY3_CLK] = &cam_cc_csiphy3_clk.clkr, 2674 + [CAM_CC_FAST_AHB_CLK_SRC] = &cam_cc_fast_ahb_clk_src.clkr, 2675 + [CAM_CC_FD_CORE_CLK] = &cam_cc_fd_core_clk.clkr, 2676 + [CAM_CC_FD_CORE_CLK_SRC] = &cam_cc_fd_core_clk_src.clkr, 2677 + [CAM_CC_FD_CORE_UAR_CLK] = &cam_cc_fd_core_uar_clk.clkr, 2678 + [CAM_CC_ICP_AHB_CLK] = &cam_cc_icp_ahb_clk.clkr, 2679 + [CAM_CC_ICP_CLK] = &cam_cc_icp_clk.clkr, 2680 + [CAM_CC_ICP_CLK_SRC] = &cam_cc_icp_clk_src.clkr, 2681 + [CAM_CC_IFE_0_AXI_CLK] = &cam_cc_ife_0_axi_clk.clkr, 2682 + [CAM_CC_IFE_0_CLK] = &cam_cc_ife_0_clk.clkr, 2683 + [CAM_CC_IFE_0_CLK_SRC] = &cam_cc_ife_0_clk_src.clkr, 2684 + [CAM_CC_IFE_0_CPHY_RX_CLK] = &cam_cc_ife_0_cphy_rx_clk.clkr, 2685 + [CAM_CC_IFE_0_CSID_CLK] = &cam_cc_ife_0_csid_clk.clkr, 2686 + [CAM_CC_IFE_0_CSID_CLK_SRC] = &cam_cc_ife_0_csid_clk_src.clkr, 2687 + [CAM_CC_IFE_0_DSP_CLK] = &cam_cc_ife_0_dsp_clk.clkr, 2688 + [CAM_CC_IFE_1_AXI_CLK] = &cam_cc_ife_1_axi_clk.clkr, 2689 + [CAM_CC_IFE_1_CLK] = &cam_cc_ife_1_clk.clkr, 2690 + [CAM_CC_IFE_1_CLK_SRC] = &cam_cc_ife_1_clk_src.clkr, 2691 + [CAM_CC_IFE_1_CPHY_RX_CLK] = &cam_cc_ife_1_cphy_rx_clk.clkr, 2692 + [CAM_CC_IFE_1_CSID_CLK] = &cam_cc_ife_1_csid_clk.clkr, 2693 + [CAM_CC_IFE_1_CSID_CLK_SRC] = &cam_cc_ife_1_csid_clk_src.clkr, 2694 + [CAM_CC_IFE_1_DSP_CLK] = &cam_cc_ife_1_dsp_clk.clkr, 2695 + [CAM_CC_IFE_2_AXI_CLK] = &cam_cc_ife_2_axi_clk.clkr, 2696 + [CAM_CC_IFE_2_CLK] = &cam_cc_ife_2_clk.clkr, 2697 + [CAM_CC_IFE_2_CLK_SRC] = &cam_cc_ife_2_clk_src.clkr, 2698 + [CAM_CC_IFE_2_CPHY_RX_CLK] = &cam_cc_ife_2_cphy_rx_clk.clkr, 2699 + [CAM_CC_IFE_2_CSID_CLK] = &cam_cc_ife_2_csid_clk.clkr, 2700 + [CAM_CC_IFE_2_CSID_CLK_SRC] = &cam_cc_ife_2_csid_clk_src.clkr, 2701 + [CAM_CC_IFE_2_DSP_CLK] = &cam_cc_ife_2_dsp_clk.clkr, 2702 + [CAM_CC_IFE_3_AXI_CLK] = &cam_cc_ife_3_axi_clk.clkr, 2703 + [CAM_CC_IFE_3_CLK] = &cam_cc_ife_3_clk.clkr, 2704 + [CAM_CC_IFE_3_CLK_SRC] = &cam_cc_ife_3_clk_src.clkr, 2705 + [CAM_CC_IFE_3_CPHY_RX_CLK] = &cam_cc_ife_3_cphy_rx_clk.clkr, 2706 + [CAM_CC_IFE_3_CSID_CLK] = &cam_cc_ife_3_csid_clk.clkr, 2707 + [CAM_CC_IFE_3_CSID_CLK_SRC] = &cam_cc_ife_3_csid_clk_src.clkr, 2708 + [CAM_CC_IFE_3_DSP_CLK] = &cam_cc_ife_3_dsp_clk.clkr, 2709 + [CAM_CC_IFE_LITE_0_CLK] = &cam_cc_ife_lite_0_clk.clkr, 2710 + [CAM_CC_IFE_LITE_0_CLK_SRC] = &cam_cc_ife_lite_0_clk_src.clkr, 2711 + [CAM_CC_IFE_LITE_0_CPHY_RX_CLK] = &cam_cc_ife_lite_0_cphy_rx_clk.clkr, 2712 + [CAM_CC_IFE_LITE_0_CSID_CLK] = &cam_cc_ife_lite_0_csid_clk.clkr, 2713 + [CAM_CC_IFE_LITE_0_CSID_CLK_SRC] = &cam_cc_ife_lite_0_csid_clk_src.clkr, 2714 + [CAM_CC_IFE_LITE_1_CLK] = &cam_cc_ife_lite_1_clk.clkr, 2715 + [CAM_CC_IFE_LITE_1_CLK_SRC] = &cam_cc_ife_lite_1_clk_src.clkr, 2716 + [CAM_CC_IFE_LITE_1_CPHY_RX_CLK] = &cam_cc_ife_lite_1_cphy_rx_clk.clkr, 2717 + [CAM_CC_IFE_LITE_1_CSID_CLK] = &cam_cc_ife_lite_1_csid_clk.clkr, 2718 + [CAM_CC_IFE_LITE_1_CSID_CLK_SRC] = &cam_cc_ife_lite_1_csid_clk_src.clkr, 2719 + [CAM_CC_IFE_LITE_2_CLK] = &cam_cc_ife_lite_2_clk.clkr, 2720 + [CAM_CC_IFE_LITE_2_CLK_SRC] = &cam_cc_ife_lite_2_clk_src.clkr, 2721 + [CAM_CC_IFE_LITE_2_CPHY_RX_CLK] = &cam_cc_ife_lite_2_cphy_rx_clk.clkr, 2722 + [CAM_CC_IFE_LITE_2_CSID_CLK] = &cam_cc_ife_lite_2_csid_clk.clkr, 2723 + [CAM_CC_IFE_LITE_2_CSID_CLK_SRC] = &cam_cc_ife_lite_2_csid_clk_src.clkr, 2724 + [CAM_CC_IFE_LITE_3_CLK] = &cam_cc_ife_lite_3_clk.clkr, 2725 + [CAM_CC_IFE_LITE_3_CLK_SRC] = &cam_cc_ife_lite_3_clk_src.clkr, 2726 + [CAM_CC_IFE_LITE_3_CPHY_RX_CLK] = &cam_cc_ife_lite_3_cphy_rx_clk.clkr, 2727 + [CAM_CC_IFE_LITE_3_CSID_CLK] = &cam_cc_ife_lite_3_csid_clk.clkr, 2728 + [CAM_CC_IFE_LITE_3_CSID_CLK_SRC] = &cam_cc_ife_lite_3_csid_clk_src.clkr, 2729 + [CAM_CC_IPE_0_AHB_CLK] = &cam_cc_ipe_0_ahb_clk.clkr, 2730 + [CAM_CC_IPE_0_AREG_CLK] = &cam_cc_ipe_0_areg_clk.clkr, 2731 + [CAM_CC_IPE_0_AXI_CLK] = &cam_cc_ipe_0_axi_clk.clkr, 2732 + [CAM_CC_IPE_0_CLK] = &cam_cc_ipe_0_clk.clkr, 2733 + [CAM_CC_IPE_0_CLK_SRC] = &cam_cc_ipe_0_clk_src.clkr, 2734 + [CAM_CC_IPE_1_AHB_CLK] = &cam_cc_ipe_1_ahb_clk.clkr, 2735 + [CAM_CC_IPE_1_AREG_CLK] = &cam_cc_ipe_1_areg_clk.clkr, 2736 + [CAM_CC_IPE_1_AXI_CLK] = &cam_cc_ipe_1_axi_clk.clkr, 2737 + [CAM_CC_IPE_1_CLK] = &cam_cc_ipe_1_clk.clkr, 2738 + [CAM_CC_JPEG_CLK] = &cam_cc_jpeg_clk.clkr, 2739 + [CAM_CC_JPEG_CLK_SRC] = &cam_cc_jpeg_clk_src.clkr, 2740 + [CAM_CC_LRME_CLK] = &cam_cc_lrme_clk.clkr, 2741 + [CAM_CC_LRME_CLK_SRC] = &cam_cc_lrme_clk_src.clkr, 2742 + [CAM_CC_MCLK0_CLK] = &cam_cc_mclk0_clk.clkr, 2743 + [CAM_CC_MCLK0_CLK_SRC] = &cam_cc_mclk0_clk_src.clkr, 2744 + [CAM_CC_MCLK1_CLK] = &cam_cc_mclk1_clk.clkr, 2745 + [CAM_CC_MCLK1_CLK_SRC] = &cam_cc_mclk1_clk_src.clkr, 2746 + [CAM_CC_MCLK2_CLK] = &cam_cc_mclk2_clk.clkr, 2747 + [CAM_CC_MCLK2_CLK_SRC] = &cam_cc_mclk2_clk_src.clkr, 2748 + [CAM_CC_MCLK3_CLK] = &cam_cc_mclk3_clk.clkr, 2749 + [CAM_CC_MCLK3_CLK_SRC] = &cam_cc_mclk3_clk_src.clkr, 2750 + [CAM_CC_MCLK4_CLK] = &cam_cc_mclk4_clk.clkr, 2751 + [CAM_CC_MCLK4_CLK_SRC] = &cam_cc_mclk4_clk_src.clkr, 2752 + [CAM_CC_MCLK5_CLK] = &cam_cc_mclk5_clk.clkr, 2753 + [CAM_CC_MCLK5_CLK_SRC] = &cam_cc_mclk5_clk_src.clkr, 2754 + [CAM_CC_MCLK6_CLK] = &cam_cc_mclk6_clk.clkr, 2755 + [CAM_CC_MCLK6_CLK_SRC] = &cam_cc_mclk6_clk_src.clkr, 2756 + [CAM_CC_MCLK7_CLK] = &cam_cc_mclk7_clk.clkr, 2757 + [CAM_CC_MCLK7_CLK_SRC] = &cam_cc_mclk7_clk_src.clkr, 2758 + [CAM_CC_PLL0] = &cam_cc_pll0.clkr, 2759 + [CAM_CC_PLL0_OUT_EVEN] = &cam_cc_pll0_out_even.clkr, 2760 + [CAM_CC_PLL0_OUT_ODD] = &cam_cc_pll0_out_odd.clkr, 2761 + [CAM_CC_PLL1] = &cam_cc_pll1.clkr, 2762 + [CAM_CC_PLL2] = &cam_cc_pll2.clkr, 2763 + [CAM_CC_PLL2_OUT_MAIN] = &cam_cc_pll2_out_main.clkr, 2764 + [CAM_CC_PLL3] = &cam_cc_pll3.clkr, 2765 + [CAM_CC_PLL4] = &cam_cc_pll4.clkr, 2766 + [CAM_CC_PLL5] = &cam_cc_pll5.clkr, 2767 + [CAM_CC_PLL6] = &cam_cc_pll6.clkr, 2768 + [CAM_CC_SLOW_AHB_CLK_SRC] = &cam_cc_slow_ahb_clk_src.clkr, 2769 + [CAM_CC_XO_CLK_SRC] = &cam_cc_xo_clk_src.clkr, 2770 + }; 2771 + 2772 + static struct gdsc *cam_cc_sc8180x_gdscs[] = { 2773 + [BPS_GDSC] = &bps_gdsc, 2774 + [IFE_0_GDSC] = &ife_0_gdsc, 2775 + [IFE_1_GDSC] = &ife_1_gdsc, 2776 + [IFE_2_GDSC] = &ife_2_gdsc, 2777 + [IFE_3_GDSC] = &ife_3_gdsc, 2778 + [IPE_0_GDSC] = &ipe_0_gdsc, 2779 + [IPE_1_GDSC] = &ipe_1_gdsc, 2780 + [TITAN_TOP_GDSC] = &titan_top_gdsc, 2781 + }; 2782 + 2783 + static const struct qcom_reset_map cam_cc_sc8180x_resets[] = { 2784 + [CAM_CC_BPS_BCR] = { 0x7000 }, 2785 + [CAM_CC_CAMNOC_BCR] = { 0xc16c }, 2786 + [CAM_CC_CCI_BCR] = { 0xc104 }, 2787 + [CAM_CC_CPAS_BCR] = { 0xc164 }, 2788 + [CAM_CC_CSI0PHY_BCR] = { 0x6000 }, 2789 + [CAM_CC_CSI1PHY_BCR] = { 0x6024 }, 2790 + [CAM_CC_CSI2PHY_BCR] = { 0x6048 }, 2791 + [CAM_CC_CSI3PHY_BCR] = { 0x606c }, 2792 + [CAM_CC_FD_BCR] = { 0xc0dc }, 2793 + [CAM_CC_ICP_BCR] = { 0xc0b4 }, 2794 + [CAM_CC_IFE_0_BCR] = { 0xa000 }, 2795 + [CAM_CC_IFE_1_BCR] = { 0xb000 }, 2796 + [CAM_CC_IFE_2_BCR] = { 0xf000 }, 2797 + [CAM_CC_IFE_3_BCR] = { 0xf06c }, 2798 + [CAM_CC_IFE_LITE_0_BCR] = { 0xc000 }, 2799 + [CAM_CC_IFE_LITE_1_BCR] = { 0xc044 }, 2800 + [CAM_CC_IFE_LITE_2_BCR] = { 0xc23c }, 2801 + [CAM_CC_IFE_LITE_3_BCR] = { 0xc280 }, 2802 + [CAM_CC_IPE_0_BCR] = { 0x8000 }, 2803 + [CAM_CC_IPE_1_BCR] = { 0x9000 }, 2804 + [CAM_CC_JPEG_BCR] = { 0xc088 }, 2805 + [CAM_CC_LRME_BCR] = { 0xc140 }, 2806 + [CAM_CC_MCLK0_BCR] = { 0x5000 }, 2807 + [CAM_CC_MCLK1_BCR] = { 0x5020 }, 2808 + [CAM_CC_MCLK2_BCR] = { 0x5040 }, 2809 + [CAM_CC_MCLK3_BCR] = { 0x5060 }, 2810 + [CAM_CC_MCLK4_BCR] = { 0x5080 }, 2811 + [CAM_CC_MCLK5_BCR] = { 0x50a0 }, 2812 + [CAM_CC_MCLK6_BCR] = { 0x50c0 }, 2813 + [CAM_CC_MCLK7_BCR] = { 0x50e0 }, 2814 + }; 2815 + 2816 + static const struct regmap_config cam_cc_sc8180x_regmap_config = { 2817 + .reg_bits = 32, 2818 + .reg_stride = 4, 2819 + .val_bits = 32, 2820 + .max_register = 0xf0d4, 2821 + .fast_io = true, 2822 + }; 2823 + 2824 + static const struct qcom_cc_desc cam_cc_sc8180x_desc = { 2825 + .config = &cam_cc_sc8180x_regmap_config, 2826 + .clks = cam_cc_sc8180x_clocks, 2827 + .num_clks = ARRAY_SIZE(cam_cc_sc8180x_clocks), 2828 + .resets = cam_cc_sc8180x_resets, 2829 + .num_resets = ARRAY_SIZE(cam_cc_sc8180x_resets), 2830 + .gdscs = cam_cc_sc8180x_gdscs, 2831 + .num_gdscs = ARRAY_SIZE(cam_cc_sc8180x_gdscs), 2832 + }; 2833 + 2834 + static const struct of_device_id cam_cc_sc8180x_match_table[] = { 2835 + { .compatible = "qcom,sc8180x-camcc" }, 2836 + { } 2837 + }; 2838 + MODULE_DEVICE_TABLE(of, cam_cc_sc8180x_match_table); 2839 + 2840 + static int cam_cc_sc8180x_probe(struct platform_device *pdev) 2841 + { 2842 + struct regmap *regmap; 2843 + int ret; 2844 + 2845 + ret = devm_pm_runtime_enable(&pdev->dev); 2846 + if (ret) 2847 + return ret; 2848 + 2849 + ret = pm_runtime_resume_and_get(&pdev->dev); 2850 + if (ret) 2851 + return ret; 2852 + 2853 + regmap = qcom_cc_map(pdev, &cam_cc_sc8180x_desc); 2854 + if (IS_ERR(regmap)) { 2855 + pm_runtime_put(&pdev->dev); 2856 + return PTR_ERR(regmap); 2857 + } 2858 + 2859 + clk_trion_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config); 2860 + clk_trion_pll_configure(&cam_cc_pll1, regmap, &cam_cc_pll1_config); 2861 + clk_regera_pll_configure(&cam_cc_pll2, regmap, &cam_cc_pll2_config); 2862 + clk_trion_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config); 2863 + clk_trion_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config); 2864 + clk_trion_pll_configure(&cam_cc_pll5, regmap, &cam_cc_pll5_config); 2865 + clk_trion_pll_configure(&cam_cc_pll6, regmap, &cam_cc_pll6_config); 2866 + 2867 + /* Keep some clocks always enabled */ 2868 + qcom_branch_set_clk_en(regmap, 0xc1e4); /* CAM_CC_GDSC_CLK */ 2869 + qcom_branch_set_clk_en(regmap, 0xc200); /* CAM_CC_SLEEP_CLK */ 2870 + 2871 + ret = qcom_cc_really_probe(&pdev->dev, &cam_cc_sc8180x_desc, regmap); 2872 + 2873 + pm_runtime_put(&pdev->dev); 2874 + 2875 + return ret; 2876 + } 2877 + 2878 + static struct platform_driver cam_cc_sc8180x_driver = { 2879 + .probe = cam_cc_sc8180x_probe, 2880 + .driver = { 2881 + .name = "camcc-sc8180x", 2882 + .of_match_table = cam_cc_sc8180x_match_table, 2883 + }, 2884 + }; 2885 + 2886 + module_platform_driver(cam_cc_sc8180x_driver); 2887 + 2888 + MODULE_DESCRIPTION("QTI CAMCC SC8180X Driver"); 2889 + MODULE_LICENSE("GPL");
+44 -45
drivers/clk/qcom/camcc-sm8450.c
··· 86 86 87 87 static struct clk_alpha_pll cam_cc_pll0 = { 88 88 .offset = 0x0, 89 + .config = &cam_cc_pll0_config, 89 90 .vco_table = lucid_evo_vco, 90 91 .num_vco = ARRAY_SIZE(lucid_evo_vco), 91 92 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO], ··· 192 191 193 192 static struct clk_alpha_pll cam_cc_pll1 = { 194 193 .offset = 0x1000, 194 + .config = &cam_cc_pll1_config, 195 195 .vco_table = lucid_evo_vco, 196 196 .num_vco = ARRAY_SIZE(lucid_evo_vco), 197 197 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO], ··· 259 257 260 258 static struct clk_alpha_pll cam_cc_pll2 = { 261 259 .offset = 0x2000, 260 + .config = &cam_cc_pll2_config, 262 261 .vco_table = rivian_evo_vco, 263 262 .num_vco = ARRAY_SIZE(rivian_evo_vco), 264 263 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_RIVIAN_EVO], ··· 299 296 300 297 static struct clk_alpha_pll cam_cc_pll3 = { 301 298 .offset = 0x3000, 299 + .config = &cam_cc_pll3_config, 302 300 .vco_table = lucid_evo_vco, 303 301 .num_vco = ARRAY_SIZE(lucid_evo_vco), 304 302 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO], ··· 372 368 373 369 static struct clk_alpha_pll cam_cc_pll4 = { 374 370 .offset = 0x4000, 371 + .config = &cam_cc_pll4_config, 375 372 .vco_table = lucid_evo_vco, 376 373 .num_vco = ARRAY_SIZE(lucid_evo_vco), 377 374 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO], ··· 445 440 446 441 static struct clk_alpha_pll cam_cc_pll5 = { 447 442 .offset = 0x5000, 443 + .config = &cam_cc_pll5_config, 448 444 .vco_table = lucid_evo_vco, 449 445 .num_vco = ARRAY_SIZE(lucid_evo_vco), 450 446 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO], ··· 518 512 519 513 static struct clk_alpha_pll cam_cc_pll6 = { 520 514 .offset = 0x6000, 515 + .config = &cam_cc_pll6_config, 521 516 .vco_table = lucid_evo_vco, 522 517 .num_vco = ARRAY_SIZE(lucid_evo_vco), 523 518 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO], ··· 591 584 592 585 static struct clk_alpha_pll cam_cc_pll7 = { 593 586 .offset = 0x7000, 587 + .config = &cam_cc_pll7_config, 594 588 .vco_table = lucid_evo_vco, 595 589 .num_vco = ARRAY_SIZE(lucid_evo_vco), 596 590 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO], ··· 664 656 665 657 static struct clk_alpha_pll cam_cc_pll8 = { 666 658 .offset = 0x8000, 659 + .config = &cam_cc_pll8_config, 667 660 .vco_table = lucid_evo_vco, 668 661 .num_vco = ARRAY_SIZE(lucid_evo_vco), 669 662 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO], ··· 1482 1473 .num_parents = ARRAY_SIZE(cam_cc_parent_data_9_ao), 1483 1474 .flags = CLK_SET_RATE_PARENT, 1484 1475 .ops = &clk_rcg2_ops, 1485 - }, 1486 - }; 1487 - 1488 - static struct clk_branch cam_cc_gdsc_clk = { 1489 - .halt_reg = 0x1320c, 1490 - .halt_check = BRANCH_HALT, 1491 - .clkr = { 1492 - .enable_reg = 0x1320c, 1493 - .enable_mask = BIT(0), 1494 - .hw.init = &(const struct clk_init_data) { 1495 - .name = "cam_cc_gdsc_clk", 1496 - .parent_hws = (const struct clk_hw*[]) { 1497 - &cam_cc_xo_clk_src.clkr.hw, 1498 - }, 1499 - .num_parents = 1, 1500 - .flags = CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 1501 - .ops = &clk_branch2_ops, 1502 - }, 1503 1476 }, 1504 1477 }; 1505 1478 ··· 2810 2819 [CAM_CC_CSIPHY4_CLK] = &cam_cc_csiphy4_clk.clkr, 2811 2820 [CAM_CC_CSIPHY5_CLK] = &cam_cc_csiphy5_clk.clkr, 2812 2821 [CAM_CC_FAST_AHB_CLK_SRC] = &cam_cc_fast_ahb_clk_src.clkr, 2813 - [CAM_CC_GDSC_CLK] = &cam_cc_gdsc_clk.clkr, 2814 2822 [CAM_CC_ICP_AHB_CLK] = &cam_cc_icp_ahb_clk.clkr, 2815 2823 [CAM_CC_ICP_CLK] = &cam_cc_icp_clk.clkr, 2816 2824 [CAM_CC_ICP_CLK_SRC] = &cam_cc_icp_clk_src.clkr, ··· 2901 2911 [CAM_CC_SBI_BCR] = { 0x100cc }, 2902 2912 [CAM_CC_SFE_0_BCR] = { 0x1304c }, 2903 2913 [CAM_CC_SFE_1_BCR] = { 0x13094 }, 2914 + }; 2915 + 2916 + static struct clk_alpha_pll *cam_cc_sm8450_plls[] = { 2917 + &cam_cc_pll0, 2918 + &cam_cc_pll1, 2919 + &cam_cc_pll2, 2920 + &cam_cc_pll3, 2921 + &cam_cc_pll4, 2922 + &cam_cc_pll5, 2923 + &cam_cc_pll6, 2924 + &cam_cc_pll7, 2925 + &cam_cc_pll8, 2926 + }; 2927 + 2928 + static u32 cam_cc_sm8450_critical_cbcrs[] = { 2929 + 0x1320c, /* CAM_CC_GDSC_CLK */ 2904 2930 }; 2905 2931 2906 2932 static const struct regmap_config cam_cc_sm8450_regmap_config = { ··· 3027 3021 [TITAN_TOP_GDSC] = &titan_top_gdsc, 3028 3022 }; 3029 3023 3024 + static struct qcom_cc_driver_data cam_cc_sm8450_driver_data = { 3025 + .alpha_plls = cam_cc_sm8450_plls, 3026 + .num_alpha_plls = ARRAY_SIZE(cam_cc_sm8450_plls), 3027 + .clk_cbcrs = cam_cc_sm8450_critical_cbcrs, 3028 + .num_clk_cbcrs = ARRAY_SIZE(cam_cc_sm8450_critical_cbcrs), 3029 + }; 3030 + 3030 3031 static const struct qcom_cc_desc cam_cc_sm8450_desc = { 3031 3032 .config = &cam_cc_sm8450_regmap_config, 3032 3033 .clks = cam_cc_sm8450_clocks, ··· 3042 3029 .num_resets = ARRAY_SIZE(cam_cc_sm8450_resets), 3043 3030 .gdscs = cam_cc_sm8450_gdscs, 3044 3031 .num_gdscs = ARRAY_SIZE(cam_cc_sm8450_gdscs), 3032 + .use_rpm = true, 3033 + .driver_data = &cam_cc_sm8450_driver_data, 3045 3034 }; 3046 3035 3047 3036 static const struct of_device_id cam_cc_sm8450_match_table[] = { ··· 3055 3040 3056 3041 static int cam_cc_sm8450_probe(struct platform_device *pdev) 3057 3042 { 3058 - struct regmap *regmap; 3059 - 3060 - regmap = qcom_cc_map(pdev, &cam_cc_sm8450_desc); 3061 - if (IS_ERR(regmap)) 3062 - return PTR_ERR(regmap); 3063 - 3064 3043 if (of_device_is_compatible(pdev->dev.of_node, "qcom,sm8475-camcc")) { 3065 3044 /* Update CAMCC PLL0 */ 3066 3045 cam_cc_pll0.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE]; ··· 3101 3092 cam_cc_pll8_out_even.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE]; 3102 3093 cam_cc_pll8_out_even.clkr.hw.init = &sm8475_cam_cc_pll8_out_even_init; 3103 3094 3104 - clk_lucid_ole_pll_configure(&cam_cc_pll0, regmap, &sm8475_cam_cc_pll0_config); 3105 - clk_lucid_ole_pll_configure(&cam_cc_pll1, regmap, &sm8475_cam_cc_pll1_config); 3106 - clk_rivian_evo_pll_configure(&cam_cc_pll2, regmap, &sm8475_cam_cc_pll2_config); 3107 - clk_lucid_ole_pll_configure(&cam_cc_pll3, regmap, &sm8475_cam_cc_pll3_config); 3108 - clk_lucid_ole_pll_configure(&cam_cc_pll4, regmap, &sm8475_cam_cc_pll4_config); 3109 - clk_lucid_ole_pll_configure(&cam_cc_pll5, regmap, &sm8475_cam_cc_pll5_config); 3110 - clk_lucid_ole_pll_configure(&cam_cc_pll6, regmap, &sm8475_cam_cc_pll6_config); 3111 - clk_lucid_ole_pll_configure(&cam_cc_pll7, regmap, &sm8475_cam_cc_pll7_config); 3112 - clk_lucid_ole_pll_configure(&cam_cc_pll8, regmap, &sm8475_cam_cc_pll8_config); 3113 - } else { 3114 - clk_lucid_evo_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config); 3115 - clk_lucid_evo_pll_configure(&cam_cc_pll1, regmap, &cam_cc_pll1_config); 3116 - clk_rivian_evo_pll_configure(&cam_cc_pll2, regmap, &cam_cc_pll2_config); 3117 - clk_lucid_evo_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config); 3118 - clk_lucid_evo_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config); 3119 - clk_lucid_evo_pll_configure(&cam_cc_pll5, regmap, &cam_cc_pll5_config); 3120 - clk_lucid_evo_pll_configure(&cam_cc_pll6, regmap, &cam_cc_pll6_config); 3121 - clk_lucid_evo_pll_configure(&cam_cc_pll7, regmap, &cam_cc_pll7_config); 3122 - clk_lucid_evo_pll_configure(&cam_cc_pll8, regmap, &cam_cc_pll8_config); 3095 + cam_cc_pll0.config = &sm8475_cam_cc_pll0_config; 3096 + cam_cc_pll1.config = &sm8475_cam_cc_pll1_config; 3097 + cam_cc_pll2.config = &sm8475_cam_cc_pll2_config; 3098 + cam_cc_pll3.config = &sm8475_cam_cc_pll3_config; 3099 + cam_cc_pll4.config = &sm8475_cam_cc_pll4_config; 3100 + cam_cc_pll5.config = &sm8475_cam_cc_pll5_config; 3101 + cam_cc_pll6.config = &sm8475_cam_cc_pll6_config; 3102 + cam_cc_pll7.config = &sm8475_cam_cc_pll7_config; 3103 + cam_cc_pll8.config = &sm8475_cam_cc_pll8_config; 3123 3104 } 3124 3105 3125 - return qcom_cc_really_probe(&pdev->dev, &cam_cc_sm8450_desc, regmap); 3106 + return qcom_cc_probe(pdev, &cam_cc_sm8450_desc); 3126 3107 } 3127 3108 3128 3109 static struct platform_driver cam_cc_sm8450_driver = {
+44 -41
drivers/clk/qcom/camcc-sm8550.c
··· 7 7 #include <linux/mod_devicetable.h> 8 8 #include <linux/module.h> 9 9 #include <linux/platform_device.h> 10 - #include <linux/pm_runtime.h> 11 10 #include <linux/regmap.h> 12 11 13 12 #include <dt-bindings/clock/qcom,sm8550-camcc.h> ··· 73 74 74 75 static struct clk_alpha_pll cam_cc_pll0 = { 75 76 .offset = 0x0, 77 + .config = &cam_cc_pll0_config, 76 78 .vco_table = lucid_ole_vco, 77 79 .num_vco = ARRAY_SIZE(lucid_ole_vco), 78 80 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 151 151 152 152 static struct clk_alpha_pll cam_cc_pll1 = { 153 153 .offset = 0x1000, 154 + .config = &cam_cc_pll1_config, 154 155 .vco_table = lucid_ole_vco, 155 156 .num_vco = ARRAY_SIZE(lucid_ole_vco), 156 157 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 202 201 203 202 static struct clk_alpha_pll cam_cc_pll2 = { 204 203 .offset = 0x2000, 204 + .config = &cam_cc_pll2_config, 205 205 .vco_table = rivian_ole_vco, 206 206 .num_vco = ARRAY_SIZE(rivian_ole_vco), 207 207 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_RIVIAN_EVO], ··· 234 232 235 233 static struct clk_alpha_pll cam_cc_pll3 = { 236 234 .offset = 0x3000, 235 + .config = &cam_cc_pll3_config, 237 236 .vco_table = lucid_ole_vco, 238 237 .num_vco = ARRAY_SIZE(lucid_ole_vco), 239 238 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 289 286 290 287 static struct clk_alpha_pll cam_cc_pll4 = { 291 288 .offset = 0x4000, 289 + .config = &cam_cc_pll4_config, 292 290 .vco_table = lucid_ole_vco, 293 291 .num_vco = ARRAY_SIZE(lucid_ole_vco), 294 292 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 344 340 345 341 static struct clk_alpha_pll cam_cc_pll5 = { 346 342 .offset = 0x5000, 343 + .config = &cam_cc_pll5_config, 347 344 .vco_table = lucid_ole_vco, 348 345 .num_vco = ARRAY_SIZE(lucid_ole_vco), 349 346 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 399 394 400 395 static struct clk_alpha_pll cam_cc_pll6 = { 401 396 .offset = 0x6000, 397 + .config = &cam_cc_pll6_config, 402 398 .vco_table = lucid_ole_vco, 403 399 .num_vco = ARRAY_SIZE(lucid_ole_vco), 404 400 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 454 448 455 449 static struct clk_alpha_pll cam_cc_pll7 = { 456 450 .offset = 0x7000, 451 + .config = &cam_cc_pll7_config, 457 452 .vco_table = lucid_ole_vco, 458 453 .num_vco = ARRAY_SIZE(lucid_ole_vco), 459 454 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 509 502 510 503 static struct clk_alpha_pll cam_cc_pll8 = { 511 504 .offset = 0x8000, 505 + .config = &cam_cc_pll8_config, 512 506 .vco_table = lucid_ole_vco, 513 507 .num_vco = ARRAY_SIZE(lucid_ole_vco), 514 508 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 564 556 565 557 static struct clk_alpha_pll cam_cc_pll9 = { 566 558 .offset = 0x9000, 559 + .config = &cam_cc_pll9_config, 567 560 .vco_table = lucid_ole_vco, 568 561 .num_vco = ARRAY_SIZE(lucid_ole_vco), 569 562 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 619 610 620 611 static struct clk_alpha_pll cam_cc_pll10 = { 621 612 .offset = 0xa000, 613 + .config = &cam_cc_pll10_config, 622 614 .vco_table = lucid_ole_vco, 623 615 .num_vco = ARRAY_SIZE(lucid_ole_vco), 624 616 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 674 664 675 665 static struct clk_alpha_pll cam_cc_pll11 = { 676 666 .offset = 0xb000, 667 + .config = &cam_cc_pll11_config, 677 668 .vco_table = lucid_ole_vco, 678 669 .num_vco = ARRAY_SIZE(lucid_ole_vco), 679 670 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 729 718 730 719 static struct clk_alpha_pll cam_cc_pll12 = { 731 720 .offset = 0xc000, 721 + .config = &cam_cc_pll12_config, 732 722 .vco_table = lucid_ole_vco, 733 723 .num_vco = ARRAY_SIZE(lucid_ole_vco), 734 724 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 3491 3479 [CAM_CC_SFE_1_BCR] = { 0x133dc }, 3492 3480 }; 3493 3481 3482 + static struct clk_alpha_pll *cam_cc_sm8550_plls[] = { 3483 + &cam_cc_pll0, 3484 + &cam_cc_pll1, 3485 + &cam_cc_pll2, 3486 + &cam_cc_pll3, 3487 + &cam_cc_pll4, 3488 + &cam_cc_pll5, 3489 + &cam_cc_pll6, 3490 + &cam_cc_pll7, 3491 + &cam_cc_pll8, 3492 + &cam_cc_pll9, 3493 + &cam_cc_pll10, 3494 + &cam_cc_pll11, 3495 + &cam_cc_pll12, 3496 + }; 3497 + 3498 + static u32 cam_cc_sm8550_critical_cbcrs[] = { 3499 + 0x1419c, /* CAM_CC_GDSC_CLK */ 3500 + 0x142cc, /* CAM_CC_SLEEP_CLK */ 3501 + }; 3502 + 3494 3503 static const struct regmap_config cam_cc_sm8550_regmap_config = { 3495 3504 .reg_bits = 32, 3496 3505 .reg_stride = 4, 3497 3506 .val_bits = 32, 3498 3507 .max_register = 0x16320, 3499 3508 .fast_io = true, 3509 + }; 3510 + 3511 + static struct qcom_cc_driver_data cam_cc_sm8550_driver_data = { 3512 + .alpha_plls = cam_cc_sm8550_plls, 3513 + .num_alpha_plls = ARRAY_SIZE(cam_cc_sm8550_plls), 3514 + .clk_cbcrs = cam_cc_sm8550_critical_cbcrs, 3515 + .num_clk_cbcrs = ARRAY_SIZE(cam_cc_sm8550_critical_cbcrs), 3500 3516 }; 3501 3517 3502 3518 static const struct qcom_cc_desc cam_cc_sm8550_desc = { ··· 3535 3495 .num_resets = ARRAY_SIZE(cam_cc_sm8550_resets), 3536 3496 .gdscs = cam_cc_sm8550_gdscs, 3537 3497 .num_gdscs = ARRAY_SIZE(cam_cc_sm8550_gdscs), 3498 + .use_rpm = true, 3499 + .driver_data = &cam_cc_sm8550_driver_data, 3538 3500 }; 3539 3501 3540 3502 static const struct of_device_id cam_cc_sm8550_match_table[] = { ··· 3547 3505 3548 3506 static int cam_cc_sm8550_probe(struct platform_device *pdev) 3549 3507 { 3550 - struct regmap *regmap; 3551 - int ret; 3552 - 3553 - ret = devm_pm_runtime_enable(&pdev->dev); 3554 - if (ret) 3555 - return ret; 3556 - 3557 - ret = pm_runtime_resume_and_get(&pdev->dev); 3558 - if (ret) 3559 - return ret; 3560 - 3561 - regmap = qcom_cc_map(pdev, &cam_cc_sm8550_desc); 3562 - if (IS_ERR(regmap)) { 3563 - pm_runtime_put(&pdev->dev); 3564 - return PTR_ERR(regmap); 3565 - } 3566 - 3567 - clk_lucid_ole_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config); 3568 - clk_lucid_ole_pll_configure(&cam_cc_pll1, regmap, &cam_cc_pll1_config); 3569 - clk_rivian_evo_pll_configure(&cam_cc_pll2, regmap, &cam_cc_pll2_config); 3570 - clk_lucid_ole_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config); 3571 - clk_lucid_ole_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config); 3572 - clk_lucid_ole_pll_configure(&cam_cc_pll5, regmap, &cam_cc_pll5_config); 3573 - clk_lucid_ole_pll_configure(&cam_cc_pll6, regmap, &cam_cc_pll6_config); 3574 - clk_lucid_ole_pll_configure(&cam_cc_pll7, regmap, &cam_cc_pll7_config); 3575 - clk_lucid_ole_pll_configure(&cam_cc_pll8, regmap, &cam_cc_pll8_config); 3576 - clk_lucid_ole_pll_configure(&cam_cc_pll9, regmap, &cam_cc_pll9_config); 3577 - clk_lucid_ole_pll_configure(&cam_cc_pll10, regmap, &cam_cc_pll10_config); 3578 - clk_lucid_ole_pll_configure(&cam_cc_pll11, regmap, &cam_cc_pll11_config); 3579 - clk_lucid_ole_pll_configure(&cam_cc_pll12, regmap, &cam_cc_pll12_config); 3580 - 3581 - /* Keep some clocks always-on */ 3582 - qcom_branch_set_clk_en(regmap, 0x1419c); /* CAM_CC_GDSC_CLK */ 3583 - qcom_branch_set_clk_en(regmap, 0x142cc); /* CAM_CC_SLEEP_CLK */ 3584 - 3585 - ret = qcom_cc_really_probe(&pdev->dev, &cam_cc_sm8550_desc, regmap); 3586 - 3587 - pm_runtime_put(&pdev->dev); 3588 - 3589 - return ret; 3508 + return qcom_cc_probe(pdev, &cam_cc_sm8550_desc); 3590 3509 } 3591 3510 3592 3511 static struct platform_driver cam_cc_sm8550_driver = {
+42 -41
drivers/clk/qcom/camcc-sm8650.c
··· 7 7 #include <linux/mod_devicetable.h> 8 8 #include <linux/module.h> 9 9 #include <linux/platform_device.h> 10 - #include <linux/pm_runtime.h> 11 10 #include <linux/regmap.h> 12 11 13 12 #include <dt-bindings/clock/qcom,sm8650-camcc.h> ··· 71 72 72 73 static struct clk_alpha_pll cam_cc_pll0 = { 73 74 .offset = 0x0, 75 + .config = &cam_cc_pll0_config, 74 76 .vco_table = lucid_ole_vco, 75 77 .num_vco = ARRAY_SIZE(lucid_ole_vco), 76 78 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 149 149 150 150 static struct clk_alpha_pll cam_cc_pll1 = { 151 151 .offset = 0x1000, 152 + .config = &cam_cc_pll1_config, 152 153 .vco_table = lucid_ole_vco, 153 154 .num_vco = ARRAY_SIZE(lucid_ole_vco), 154 155 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 200 199 201 200 static struct clk_alpha_pll cam_cc_pll2 = { 202 201 .offset = 0x2000, 202 + .config = &cam_cc_pll2_config, 203 203 .vco_table = rivian_ole_vco, 204 204 .num_vco = ARRAY_SIZE(rivian_ole_vco), 205 205 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_RIVIAN_EVO], ··· 232 230 233 231 static struct clk_alpha_pll cam_cc_pll3 = { 234 232 .offset = 0x3000, 233 + .config = &cam_cc_pll3_config, 235 234 .vco_table = lucid_ole_vco, 236 235 .num_vco = ARRAY_SIZE(lucid_ole_vco), 237 236 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 287 284 288 285 static struct clk_alpha_pll cam_cc_pll4 = { 289 286 .offset = 0x4000, 287 + .config = &cam_cc_pll4_config, 290 288 .vco_table = lucid_ole_vco, 291 289 .num_vco = ARRAY_SIZE(lucid_ole_vco), 292 290 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 342 338 343 339 static struct clk_alpha_pll cam_cc_pll5 = { 344 340 .offset = 0x5000, 341 + .config = &cam_cc_pll5_config, 345 342 .vco_table = lucid_ole_vco, 346 343 .num_vco = ARRAY_SIZE(lucid_ole_vco), 347 344 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 397 392 398 393 static struct clk_alpha_pll cam_cc_pll6 = { 399 394 .offset = 0x6000, 395 + .config = &cam_cc_pll6_config, 400 396 .vco_table = lucid_ole_vco, 401 397 .num_vco = ARRAY_SIZE(lucid_ole_vco), 402 398 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 452 446 453 447 static struct clk_alpha_pll cam_cc_pll7 = { 454 448 .offset = 0x7000, 449 + .config = &cam_cc_pll7_config, 455 450 .vco_table = lucid_ole_vco, 456 451 .num_vco = ARRAY_SIZE(lucid_ole_vco), 457 452 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 507 500 508 501 static struct clk_alpha_pll cam_cc_pll8 = { 509 502 .offset = 0x8000, 503 + .config = &cam_cc_pll8_config, 510 504 .vco_table = lucid_ole_vco, 511 505 .num_vco = ARRAY_SIZE(lucid_ole_vco), 512 506 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 562 554 563 555 static struct clk_alpha_pll cam_cc_pll9 = { 564 556 .offset = 0x9000, 557 + .config = &cam_cc_pll9_config, 565 558 .vco_table = lucid_ole_vco, 566 559 .num_vco = ARRAY_SIZE(lucid_ole_vco), 567 560 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 640 631 641 632 static struct clk_alpha_pll cam_cc_pll10 = { 642 633 .offset = 0xa000, 634 + .config = &cam_cc_pll10_config, 643 635 .vco_table = lucid_ole_vco, 644 636 .num_vco = ARRAY_SIZE(lucid_ole_vco), 645 637 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 3519 3509 [CAM_CC_SFE_2_BCR] = { 0x130f4 }, 3520 3510 }; 3521 3511 3512 + static struct clk_alpha_pll *cam_cc_sm8650_plls[] = { 3513 + &cam_cc_pll0, 3514 + &cam_cc_pll1, 3515 + &cam_cc_pll2, 3516 + &cam_cc_pll3, 3517 + &cam_cc_pll4, 3518 + &cam_cc_pll5, 3519 + &cam_cc_pll6, 3520 + &cam_cc_pll7, 3521 + &cam_cc_pll8, 3522 + &cam_cc_pll9, 3523 + &cam_cc_pll10, 3524 + }; 3525 + 3526 + static u32 cam_cc_sm8650_critical_cbcrs[] = { 3527 + 0x132ec, /* CAM_CC_GDSC_CLK */ 3528 + 0x13308, /* CAM_CC_SLEEP_CLK */ 3529 + 0x13314, /* CAM_CC_DRV_XO_CLK */ 3530 + 0x13318, /* CAM_CC_DRV_AHB_CLK */ 3531 + }; 3532 + 3522 3533 static const struct regmap_config cam_cc_sm8650_regmap_config = { 3523 3534 .reg_bits = 32, 3524 3535 .reg_stride = 4, 3525 3536 .val_bits = 32, 3526 3537 .max_register = 0x1603c, 3527 3538 .fast_io = true, 3539 + }; 3540 + 3541 + static struct qcom_cc_driver_data cam_cc_sm8650_driver_data = { 3542 + .alpha_plls = cam_cc_sm8650_plls, 3543 + .num_alpha_plls = ARRAY_SIZE(cam_cc_sm8650_plls), 3544 + .clk_cbcrs = cam_cc_sm8650_critical_cbcrs, 3545 + .num_clk_cbcrs = ARRAY_SIZE(cam_cc_sm8650_critical_cbcrs), 3528 3546 }; 3529 3547 3530 3548 static const struct qcom_cc_desc cam_cc_sm8650_desc = { ··· 3563 3525 .num_resets = ARRAY_SIZE(cam_cc_sm8650_resets), 3564 3526 .gdscs = cam_cc_sm8650_gdscs, 3565 3527 .num_gdscs = ARRAY_SIZE(cam_cc_sm8650_gdscs), 3528 + .use_rpm = true, 3529 + .driver_data = &cam_cc_sm8650_driver_data, 3566 3530 }; 3567 3531 3568 3532 static const struct of_device_id cam_cc_sm8650_match_table[] = { ··· 3575 3535 3576 3536 static int cam_cc_sm8650_probe(struct platform_device *pdev) 3577 3537 { 3578 - struct regmap *regmap; 3579 - int ret; 3580 - 3581 - ret = devm_pm_runtime_enable(&pdev->dev); 3582 - if (ret) 3583 - return ret; 3584 - 3585 - ret = pm_runtime_resume_and_get(&pdev->dev); 3586 - if (ret) 3587 - return ret; 3588 - 3589 - regmap = qcom_cc_map(pdev, &cam_cc_sm8650_desc); 3590 - if (IS_ERR(regmap)) { 3591 - pm_runtime_put(&pdev->dev); 3592 - return PTR_ERR(regmap); 3593 - } 3594 - 3595 - clk_lucid_ole_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config); 3596 - clk_lucid_ole_pll_configure(&cam_cc_pll1, regmap, &cam_cc_pll1_config); 3597 - clk_rivian_evo_pll_configure(&cam_cc_pll2, regmap, &cam_cc_pll2_config); 3598 - clk_lucid_ole_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config); 3599 - clk_lucid_ole_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config); 3600 - clk_lucid_ole_pll_configure(&cam_cc_pll5, regmap, &cam_cc_pll5_config); 3601 - clk_lucid_ole_pll_configure(&cam_cc_pll6, regmap, &cam_cc_pll6_config); 3602 - clk_lucid_ole_pll_configure(&cam_cc_pll7, regmap, &cam_cc_pll7_config); 3603 - clk_lucid_ole_pll_configure(&cam_cc_pll8, regmap, &cam_cc_pll8_config); 3604 - clk_lucid_ole_pll_configure(&cam_cc_pll9, regmap, &cam_cc_pll9_config); 3605 - clk_lucid_ole_pll_configure(&cam_cc_pll10, regmap, &cam_cc_pll10_config); 3606 - 3607 - /* Keep clocks always enabled */ 3608 - qcom_branch_set_clk_en(regmap, 0x13318); /* CAM_CC_DRV_AHB_CLK */ 3609 - qcom_branch_set_clk_en(regmap, 0x13314); /* CAM_CC_DRV_XO_CLK */ 3610 - qcom_branch_set_clk_en(regmap, 0x132ec); /* CAM_CC_GDSC_CLK */ 3611 - qcom_branch_set_clk_en(regmap, 0x13308); /* CAM_CC_SLEEP_CLK */ 3612 - 3613 - ret = qcom_cc_really_probe(&pdev->dev, &cam_cc_sm8650_desc, regmap); 3614 - 3615 - pm_runtime_put(&pdev->dev); 3616 - 3617 - return ret; 3538 + return qcom_cc_probe(pdev, &cam_cc_sm8650_desc); 3618 3539 } 3619 3540 3620 3541 static struct platform_driver cam_cc_sm8650_driver = {
+32 -35
drivers/clk/qcom/camcc-x1e80100.c
··· 7 7 #include <linux/mod_devicetable.h> 8 8 #include <linux/module.h> 9 9 #include <linux/platform_device.h> 10 - #include <linux/pm_runtime.h> 11 10 #include <linux/regmap.h> 12 11 13 12 #include <dt-bindings/clock/qcom,x1e80100-camcc.h> ··· 66 67 67 68 static struct clk_alpha_pll cam_cc_pll0 = { 68 69 .offset = 0x0, 70 + .config = &cam_cc_pll0_config, 69 71 .vco_table = lucid_ole_vco, 70 72 .num_vco = ARRAY_SIZE(lucid_ole_vco), 71 73 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 144 144 145 145 static struct clk_alpha_pll cam_cc_pll1 = { 146 146 .offset = 0x1000, 147 + .config = &cam_cc_pll1_config, 147 148 .vco_table = lucid_ole_vco, 148 149 .num_vco = ARRAY_SIZE(lucid_ole_vco), 149 150 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 195 194 196 195 static struct clk_alpha_pll cam_cc_pll2 = { 197 196 .offset = 0x2000, 197 + .config = &cam_cc_pll2_config, 198 198 .vco_table = rivian_ole_vco, 199 199 .num_vco = ARRAY_SIZE(rivian_ole_vco), 200 200 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_RIVIAN_EVO], ··· 227 225 228 226 static struct clk_alpha_pll cam_cc_pll3 = { 229 227 .offset = 0x3000, 228 + .config = &cam_cc_pll3_config, 230 229 .vco_table = lucid_ole_vco, 231 230 .num_vco = ARRAY_SIZE(lucid_ole_vco), 232 231 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 282 279 283 280 static struct clk_alpha_pll cam_cc_pll4 = { 284 281 .offset = 0x4000, 282 + .config = &cam_cc_pll4_config, 285 283 .vco_table = lucid_ole_vco, 286 284 .num_vco = ARRAY_SIZE(lucid_ole_vco), 287 285 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 337 333 338 334 static struct clk_alpha_pll cam_cc_pll6 = { 339 335 .offset = 0x6000, 336 + .config = &cam_cc_pll6_config, 340 337 .vco_table = lucid_ole_vco, 341 338 .num_vco = ARRAY_SIZE(lucid_ole_vco), 342 339 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 392 387 393 388 static struct clk_alpha_pll cam_cc_pll8 = { 394 389 .offset = 0x8000, 390 + .config = &cam_cc_pll8_config, 395 391 .vco_table = lucid_ole_vco, 396 392 .num_vco = ARRAY_SIZE(lucid_ole_vco), 397 393 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 2424 2418 [CAM_CC_SFE_0_BCR] = { 0x1327c }, 2425 2419 }; 2426 2420 2421 + static struct clk_alpha_pll *cam_cc_x1e80100_plls[] = { 2422 + &cam_cc_pll0, 2423 + &cam_cc_pll1, 2424 + &cam_cc_pll2, 2425 + &cam_cc_pll3, 2426 + &cam_cc_pll4, 2427 + &cam_cc_pll6, 2428 + &cam_cc_pll8, 2429 + }; 2430 + 2431 + static u32 cam_cc_x1e80100_critical_cbcrs[] = { 2432 + 0x13a9c, /* CAM_CC_GDSC_CLK */ 2433 + 0x13ab8, /* CAM_CC_SLEEP_CLK */ 2434 + }; 2435 + 2427 2436 static const struct regmap_config cam_cc_x1e80100_regmap_config = { 2428 2437 .reg_bits = 32, 2429 2438 .reg_stride = 4, 2430 2439 .val_bits = 32, 2431 2440 .max_register = 0x1603c, 2432 2441 .fast_io = true, 2442 + }; 2443 + 2444 + static struct qcom_cc_driver_data cam_cc_x1e80100_driver_data = { 2445 + .alpha_plls = cam_cc_x1e80100_plls, 2446 + .num_alpha_plls = ARRAY_SIZE(cam_cc_x1e80100_plls), 2447 + .clk_cbcrs = cam_cc_x1e80100_critical_cbcrs, 2448 + .num_clk_cbcrs = ARRAY_SIZE(cam_cc_x1e80100_critical_cbcrs), 2433 2449 }; 2434 2450 2435 2451 static const struct qcom_cc_desc cam_cc_x1e80100_desc = { ··· 2462 2434 .num_resets = ARRAY_SIZE(cam_cc_x1e80100_resets), 2463 2435 .gdscs = cam_cc_x1e80100_gdscs, 2464 2436 .num_gdscs = ARRAY_SIZE(cam_cc_x1e80100_gdscs), 2437 + .use_rpm = true, 2438 + .driver_data = &cam_cc_x1e80100_driver_data, 2465 2439 }; 2466 2440 2467 2441 static const struct of_device_id cam_cc_x1e80100_match_table[] = { ··· 2474 2444 2475 2445 static int cam_cc_x1e80100_probe(struct platform_device *pdev) 2476 2446 { 2477 - struct regmap *regmap; 2478 - int ret; 2479 - 2480 - ret = devm_pm_runtime_enable(&pdev->dev); 2481 - if (ret) 2482 - return ret; 2483 - 2484 - ret = pm_runtime_resume_and_get(&pdev->dev); 2485 - if (ret) 2486 - return ret; 2487 - 2488 - regmap = qcom_cc_map(pdev, &cam_cc_x1e80100_desc); 2489 - if (IS_ERR(regmap)) { 2490 - pm_runtime_put(&pdev->dev); 2491 - return PTR_ERR(regmap); 2492 - } 2493 - 2494 - clk_lucid_ole_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config); 2495 - clk_lucid_ole_pll_configure(&cam_cc_pll1, regmap, &cam_cc_pll1_config); 2496 - clk_rivian_evo_pll_configure(&cam_cc_pll2, regmap, &cam_cc_pll2_config); 2497 - clk_lucid_ole_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config); 2498 - clk_lucid_ole_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config); 2499 - clk_lucid_ole_pll_configure(&cam_cc_pll6, regmap, &cam_cc_pll6_config); 2500 - clk_lucid_ole_pll_configure(&cam_cc_pll8, regmap, &cam_cc_pll8_config); 2501 - 2502 - /* Keep clocks always enabled */ 2503 - qcom_branch_set_clk_en(regmap, 0x13a9c); /* CAM_CC_GDSC_CLK */ 2504 - qcom_branch_set_clk_en(regmap, 0x13ab8); /* CAM_CC_SLEEP_CLK */ 2505 - 2506 - ret = qcom_cc_really_probe(&pdev->dev, &cam_cc_x1e80100_desc, regmap); 2507 - 2508 - pm_runtime_put(&pdev->dev); 2509 - 2510 - return ret; 2447 + return qcom_cc_probe(pdev, &cam_cc_x1e80100_desc); 2511 2448 } 2512 2449 2513 2450 static struct platform_driver cam_cc_x1e80100_driver = {
+231 -18
drivers/clk/qcom/clk-alpha-pll.c
··· 63 63 #define PLL_OPMODE(p) ((p)->offset + (p)->regs[PLL_OFF_OPMODE]) 64 64 #define PLL_FRAC(p) ((p)->offset + (p)->regs[PLL_OFF_FRAC]) 65 65 66 + #define GET_PLL_TYPE(pll) (((pll)->regs - clk_alpha_pll_regs[0]) / PLL_OFF_MAX_REGS) 67 + 66 68 const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = { 67 69 [CLK_ALPHA_PLL_TYPE_DEFAULT] = { 68 70 [PLL_OFF_L_VAL] = 0x04, ··· 790 788 return __clk_alpha_pll_update_latch(pll); 791 789 } 792 790 791 + static void clk_alpha_pll_update_configs(struct clk_alpha_pll *pll, const struct pll_vco *vco, 792 + u32 l, u64 alpha, u32 alpha_width, bool alpha_en) 793 + { 794 + regmap_write(pll->clkr.regmap, PLL_L_VAL(pll), l); 795 + 796 + if (alpha_width > ALPHA_BITWIDTH) 797 + alpha <<= alpha_width - ALPHA_BITWIDTH; 798 + 799 + if (alpha_width > 32) 800 + regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL_U(pll), upper_32_bits(alpha)); 801 + 802 + regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL(pll), lower_32_bits(alpha)); 803 + 804 + if (vco) { 805 + regmap_update_bits(pll->clkr.regmap, PLL_USER_CTL(pll), 806 + PLL_VCO_MASK << PLL_VCO_SHIFT, 807 + vco->val << PLL_VCO_SHIFT); 808 + } 809 + 810 + if (alpha_en) 811 + regmap_set_bits(pll->clkr.regmap, PLL_USER_CTL(pll), PLL_ALPHA_EN); 812 + } 813 + 793 814 static int __clk_alpha_pll_set_rate(struct clk_hw *hw, unsigned long rate, 794 815 unsigned long prate, 795 816 int (*is_enabled)(struct clk_hw *)) ··· 830 805 return -EINVAL; 831 806 } 832 807 833 - regmap_write(pll->clkr.regmap, PLL_L_VAL(pll), l); 834 - 835 - if (alpha_width > ALPHA_BITWIDTH) 836 - a <<= alpha_width - ALPHA_BITWIDTH; 837 - 838 - if (alpha_width > 32) 839 - regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL_U(pll), a >> 32); 840 - 841 - regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL(pll), a); 842 - 843 - if (vco) { 844 - regmap_update_bits(pll->clkr.regmap, PLL_USER_CTL(pll), 845 - PLL_VCO_MASK << PLL_VCO_SHIFT, 846 - vco->val << PLL_VCO_SHIFT); 847 - } 848 - 849 - regmap_update_bits(pll->clkr.regmap, PLL_USER_CTL(pll), 850 - PLL_ALPHA_EN, PLL_ALPHA_EN); 808 + clk_alpha_pll_update_configs(pll, vco, l, a, alpha_width, true); 851 809 852 810 return clk_alpha_pll_update_latch(pll, is_enabled); 853 811 } ··· 2968 2960 .set_rate = clk_zonda_pll_set_rate, 2969 2961 }; 2970 2962 EXPORT_SYMBOL_GPL(clk_alpha_pll_regera_ops); 2963 + 2964 + void qcom_clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap) 2965 + { 2966 + const struct clk_init_data *init = pll->clkr.hw.init; 2967 + 2968 + switch (GET_PLL_TYPE(pll)) { 2969 + case CLK_ALPHA_PLL_TYPE_LUCID_OLE: 2970 + clk_lucid_ole_pll_configure(pll, regmap, pll->config); 2971 + break; 2972 + case CLK_ALPHA_PLL_TYPE_LUCID_EVO: 2973 + clk_lucid_evo_pll_configure(pll, regmap, pll->config); 2974 + break; 2975 + case CLK_ALPHA_PLL_TYPE_TAYCAN_ELU: 2976 + clk_taycan_elu_pll_configure(pll, regmap, pll->config); 2977 + break; 2978 + case CLK_ALPHA_PLL_TYPE_RIVIAN_EVO: 2979 + clk_rivian_evo_pll_configure(pll, regmap, pll->config); 2980 + break; 2981 + case CLK_ALPHA_PLL_TYPE_TRION: 2982 + clk_trion_pll_configure(pll, regmap, pll->config); 2983 + break; 2984 + case CLK_ALPHA_PLL_TYPE_HUAYRA_2290: 2985 + clk_huayra_2290_pll_configure(pll, regmap, pll->config); 2986 + break; 2987 + case CLK_ALPHA_PLL_TYPE_FABIA: 2988 + clk_fabia_pll_configure(pll, regmap, pll->config); 2989 + break; 2990 + case CLK_ALPHA_PLL_TYPE_AGERA: 2991 + clk_agera_pll_configure(pll, regmap, pll->config); 2992 + break; 2993 + case CLK_ALPHA_PLL_TYPE_PONGO_ELU: 2994 + clk_pongo_elu_pll_configure(pll, regmap, pll->config); 2995 + break; 2996 + case CLK_ALPHA_PLL_TYPE_ZONDA: 2997 + case CLK_ALPHA_PLL_TYPE_ZONDA_OLE: 2998 + clk_zonda_pll_configure(pll, regmap, pll->config); 2999 + break; 3000 + case CLK_ALPHA_PLL_TYPE_STROMER: 3001 + case CLK_ALPHA_PLL_TYPE_STROMER_PLUS: 3002 + clk_stromer_pll_configure(pll, regmap, pll->config); 3003 + break; 3004 + case CLK_ALPHA_PLL_TYPE_DEFAULT: 3005 + case CLK_ALPHA_PLL_TYPE_DEFAULT_EVO: 3006 + case CLK_ALPHA_PLL_TYPE_HUAYRA: 3007 + case CLK_ALPHA_PLL_TYPE_HUAYRA_APSS: 3008 + case CLK_ALPHA_PLL_TYPE_BRAMMO: 3009 + case CLK_ALPHA_PLL_TYPE_BRAMMO_EVO: 3010 + clk_alpha_pll_configure(pll, regmap, pll->config); 3011 + break; 3012 + default: 3013 + WARN(1, "%s: invalid pll type\n", init->name); 3014 + break; 3015 + } 3016 + } 3017 + EXPORT_SYMBOL_GPL(qcom_clk_alpha_pll_configure); 3018 + 3019 + static int clk_alpha_pll_slew_update(struct clk_alpha_pll *pll) 3020 + { 3021 + u32 val; 3022 + int ret; 3023 + 3024 + regmap_set_bits(pll->clkr.regmap, PLL_MODE(pll), PLL_UPDATE); 3025 + regmap_read(pll->clkr.regmap, PLL_MODE(pll), &val); 3026 + 3027 + ret = wait_for_pll_update(pll); 3028 + if (ret) 3029 + return ret; 3030 + /* 3031 + * Hardware programming mandates a wait of at least 570ns before polling the LOCK 3032 + * detect bit. Have a delay of 1us just to be safe. 3033 + */ 3034 + udelay(1); 3035 + 3036 + return wait_for_pll_enable_lock(pll); 3037 + } 3038 + 3039 + static int clk_alpha_pll_slew_set_rate(struct clk_hw *hw, unsigned long rate, 3040 + unsigned long parent_rate) 3041 + { 3042 + struct clk_alpha_pll *pll = to_clk_alpha_pll(hw); 3043 + const struct pll_vco *curr_vco, *vco; 3044 + unsigned long freq_hz; 3045 + u64 a; 3046 + u32 l; 3047 + 3048 + freq_hz = alpha_pll_round_rate(rate, parent_rate, &l, &a, ALPHA_REG_BITWIDTH); 3049 + if (freq_hz != rate) { 3050 + pr_err("alpha_pll: Call clk_set_rate with rounded rates!\n"); 3051 + return -EINVAL; 3052 + } 3053 + 3054 + curr_vco = alpha_pll_find_vco(pll, clk_hw_get_rate(hw)); 3055 + if (!curr_vco) { 3056 + pr_err("alpha pll: not in a valid vco range\n"); 3057 + return -EINVAL; 3058 + } 3059 + 3060 + vco = alpha_pll_find_vco(pll, freq_hz); 3061 + if (!vco) { 3062 + pr_err("alpha pll: not in a valid vco range\n"); 3063 + return -EINVAL; 3064 + } 3065 + 3066 + /* 3067 + * Dynamic pll update will not support switching frequencies across 3068 + * vco ranges. In those cases fall back to normal alpha set rate. 3069 + */ 3070 + if (curr_vco->val != vco->val) 3071 + return clk_alpha_pll_set_rate(hw, rate, parent_rate); 3072 + 3073 + clk_alpha_pll_update_configs(pll, NULL, l, a, ALPHA_REG_BITWIDTH, false); 3074 + 3075 + /* Ensure that the write above goes before slewing the PLL */ 3076 + mb(); 3077 + 3078 + if (clk_hw_is_enabled(hw)) 3079 + return clk_alpha_pll_slew_update(pll); 3080 + 3081 + return 0; 3082 + } 3083 + 3084 + /* 3085 + * Slewing plls should be bought up at frequency which is in the middle of the 3086 + * desired VCO range. So after bringing up the pll at calibration freq, set it 3087 + * back to desired frequency(that was set by previous clk_set_rate). 3088 + */ 3089 + static int clk_alpha_pll_calibrate(struct clk_hw *hw) 3090 + { 3091 + struct clk_alpha_pll *pll = to_clk_alpha_pll(hw); 3092 + struct clk_hw *parent; 3093 + const struct pll_vco *vco; 3094 + unsigned long calibration_freq, freq_hz; 3095 + u64 a; 3096 + u32 l; 3097 + int rc; 3098 + 3099 + parent = clk_hw_get_parent(hw); 3100 + if (!parent) { 3101 + pr_err("alpha pll: no valid parent found\n"); 3102 + return -EINVAL; 3103 + } 3104 + 3105 + vco = alpha_pll_find_vco(pll, clk_hw_get_rate(hw)); 3106 + if (!vco) { 3107 + pr_err("alpha pll: not in a valid vco range\n"); 3108 + return -EINVAL; 3109 + } 3110 + 3111 + /* 3112 + * As during slewing plls vco_sel won't be allowed to change, vco table 3113 + * should have only one entry table, i.e. index = 0, find the 3114 + * calibration frequency. 3115 + */ 3116 + calibration_freq = (pll->vco_table[0].min_freq + pll->vco_table[0].max_freq) / 2; 3117 + 3118 + freq_hz = alpha_pll_round_rate(calibration_freq, clk_hw_get_rate(parent), 3119 + &l, &a, ALPHA_REG_BITWIDTH); 3120 + if (freq_hz != calibration_freq) { 3121 + pr_err("alpha_pll: call clk_set_rate with rounded rates!\n"); 3122 + return -EINVAL; 3123 + } 3124 + 3125 + clk_alpha_pll_update_configs(pll, vco, l, a, ALPHA_REG_BITWIDTH, false); 3126 + 3127 + /* Bringup the pll at calibration frequency */ 3128 + rc = clk_alpha_pll_enable(hw); 3129 + if (rc) { 3130 + pr_err("alpha pll calibration failed\n"); 3131 + return rc; 3132 + } 3133 + 3134 + /* 3135 + * PLL is already running at calibration frequency. 3136 + * So slew pll to the previously set frequency. 3137 + */ 3138 + freq_hz = alpha_pll_round_rate(clk_hw_get_rate(hw), 3139 + clk_hw_get_rate(parent), &l, &a, ALPHA_REG_BITWIDTH); 3140 + 3141 + pr_debug("pll %s: setting back to required rate %lu, freq_hz %ld\n", 3142 + clk_hw_get_name(hw), clk_hw_get_rate(hw), freq_hz); 3143 + 3144 + clk_alpha_pll_update_configs(pll, NULL, l, a, ALPHA_REG_BITWIDTH, true); 3145 + 3146 + return clk_alpha_pll_slew_update(pll); 3147 + } 3148 + 3149 + static int clk_alpha_pll_slew_enable(struct clk_hw *hw) 3150 + { 3151 + int rc; 3152 + 3153 + rc = clk_alpha_pll_calibrate(hw); 3154 + if (rc) 3155 + return rc; 3156 + 3157 + return clk_alpha_pll_enable(hw); 3158 + } 3159 + 3160 + const struct clk_ops clk_alpha_pll_slew_ops = { 3161 + .enable = clk_alpha_pll_slew_enable, 3162 + .disable = clk_alpha_pll_disable, 3163 + .recalc_rate = clk_alpha_pll_recalc_rate, 3164 + .round_rate = clk_alpha_pll_round_rate, 3165 + .set_rate = clk_alpha_pll_slew_set_rate, 3166 + }; 3167 + EXPORT_SYMBOL(clk_alpha_pll_slew_ops);
+4
drivers/clk/qcom/clk-alpha-pll.h
··· 81 81 * struct clk_alpha_pll - phase locked loop (PLL) 82 82 * @offset: base address of registers 83 83 * @regs: alpha pll register map (see @clk_alpha_pll_regs) 84 + * @config: array of pll settings 84 85 * @vco_table: array of VCO settings 85 86 * @num_vco: number of VCO settings in @vco_table 86 87 * @flags: bitmask to indicate features supported by the hardware ··· 91 90 u32 offset; 92 91 const u8 *regs; 93 92 93 + const struct alpha_pll_config *config; 94 94 const struct pll_vco *vco_table; 95 95 size_t num_vco; 96 96 #define SUPPORTS_OFFLINE_REQ BIT(0) ··· 206 204 #define clk_alpha_pll_postdiv_rivian_evo_ops clk_alpha_pll_postdiv_fabia_ops 207 205 208 206 extern const struct clk_ops clk_alpha_pll_regera_ops; 207 + extern const struct clk_ops clk_alpha_pll_slew_ops; 209 208 210 209 void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, 211 210 const struct alpha_pll_config *config); ··· 240 237 const struct alpha_pll_config *config); 241 238 void clk_regera_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, 242 239 const struct alpha_pll_config *config); 240 + void qcom_clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap); 243 241 244 242 #endif
+5 -5
drivers/clk/qcom/clk-rpm.c
··· 351 351 return 0; 352 352 } 353 353 354 - static long clk_rpm_round_rate(struct clk_hw *hw, unsigned long rate, 355 - unsigned long *parent_rate) 354 + static int clk_rpm_determine_rate(struct clk_hw *hw, 355 + struct clk_rate_request *req) 356 356 { 357 357 /* 358 358 * RPM handles rate rounding and we don't have a way to 359 359 * know what the rate will be, so just return whatever 360 360 * rate is requested. 361 361 */ 362 - return rate; 362 + return 0; 363 363 } 364 364 365 365 static unsigned long clk_rpm_recalc_rate(struct clk_hw *hw, ··· 383 383 static const struct clk_ops clk_rpm_fixed_ops = { 384 384 .prepare = clk_rpm_fixed_prepare, 385 385 .unprepare = clk_rpm_fixed_unprepare, 386 - .round_rate = clk_rpm_round_rate, 386 + .determine_rate = clk_rpm_determine_rate, 387 387 .recalc_rate = clk_rpm_recalc_rate, 388 388 }; 389 389 ··· 391 391 .prepare = clk_rpm_prepare, 392 392 .unprepare = clk_rpm_unprepare, 393 393 .set_rate = clk_rpm_set_rate, 394 - .round_rate = clk_rpm_round_rate, 394 + .determine_rate = clk_rpm_determine_rate, 395 395 .recalc_rate = clk_rpm_recalc_rate, 396 396 }; 397 397
+30 -4
drivers/clk/qcom/clk-rpmh.c
··· 321 321 return 0; 322 322 } 323 323 324 - static long clk_rpmh_round_rate(struct clk_hw *hw, unsigned long rate, 325 - unsigned long *parent_rate) 324 + static int clk_rpmh_determine_rate(struct clk_hw *hw, 325 + struct clk_rate_request *req) 326 326 { 327 - return rate; 327 + return 0; 328 328 } 329 329 330 330 static unsigned long clk_rpmh_bcm_recalc_rate(struct clk_hw *hw, ··· 339 339 .prepare = clk_rpmh_bcm_prepare, 340 340 .unprepare = clk_rpmh_bcm_unprepare, 341 341 .set_rate = clk_rpmh_bcm_set_rate, 342 - .round_rate = clk_rpmh_round_rate, 342 + .determine_rate = clk_rpmh_determine_rate, 343 343 .recalc_rate = clk_rpmh_bcm_recalc_rate, 344 344 }; 345 345 ··· 385 385 DEFINE_CLK_RPMH_VRM(clk6, _a2, "clka6", 2); 386 386 DEFINE_CLK_RPMH_VRM(clk7, _a2, "clka7", 2); 387 387 DEFINE_CLK_RPMH_VRM(clk8, _a2, "clka8", 2); 388 + 389 + DEFINE_CLK_RPMH_VRM(clk7, _a4, "clka7", 4); 388 390 389 391 DEFINE_CLK_RPMH_VRM(div_clk1, _div2, "divclka1", 2); 390 392 ··· 541 539 static const struct clk_rpmh_desc clk_rpmh_sc8180x = { 542 540 .clks = sc8180x_rpmh_clocks, 543 541 .num_clks = ARRAY_SIZE(sc8180x_rpmh_clocks), 542 + }; 543 + 544 + static struct clk_hw *milos_rpmh_clocks[] = { 545 + [RPMH_CXO_CLK] = &clk_rpmh_bi_tcxo_div4.hw, 546 + [RPMH_CXO_CLK_A] = &clk_rpmh_bi_tcxo_div4_ao.hw, 547 + [RPMH_LN_BB_CLK2] = &clk_rpmh_clk7_a4.hw, 548 + [RPMH_LN_BB_CLK2_A] = &clk_rpmh_clk7_a4_ao.hw, 549 + /* 550 + * RPMH_LN_BB_CLK3(_A) and RPMH_LN_BB_CLK4(_A) are marked as optional 551 + * downstream, but do not exist in cmd-db on SM7635, so skip them. 552 + */ 553 + [RPMH_RF_CLK1] = &clk_rpmh_clk1_a1.hw, 554 + [RPMH_RF_CLK1_A] = &clk_rpmh_clk1_a1_ao.hw, 555 + [RPMH_RF_CLK2] = &clk_rpmh_clk2_a1.hw, 556 + [RPMH_RF_CLK2_A] = &clk_rpmh_clk2_a1_ao.hw, 557 + [RPMH_RF_CLK3] = &clk_rpmh_clk3_a1.hw, 558 + [RPMH_RF_CLK3_A] = &clk_rpmh_clk3_a1_ao.hw, 559 + [RPMH_IPA_CLK] = &clk_rpmh_ipa.hw, 560 + }; 561 + 562 + static const struct clk_rpmh_desc clk_rpmh_milos = { 563 + .clks = milos_rpmh_clocks, 564 + .num_clks = ARRAY_SIZE(milos_rpmh_clocks), 544 565 }; 545 566 546 567 static struct clk_hw *sm8250_rpmh_clocks[] = { ··· 968 943 } 969 944 970 945 static const struct of_device_id clk_rpmh_match_table[] = { 946 + { .compatible = "qcom,milos-rpmh-clk", .data = &clk_rpmh_milos}, 971 947 { .compatible = "qcom,qcs615-rpmh-clk", .data = &clk_rpmh_qcs615}, 972 948 { .compatible = "qcom,qdu1000-rpmh-clk", .data = &clk_rpmh_qdu1000}, 973 949 { .compatible = "qcom,sa8775p-rpmh-clk", .data = &clk_rpmh_sa8775p},
+4 -4
drivers/clk/qcom/clk-smd-rpm.c
··· 370 370 return 0; 371 371 } 372 372 373 - static long clk_smd_rpm_round_rate(struct clk_hw *hw, unsigned long rate, 374 - unsigned long *parent_rate) 373 + static int clk_smd_rpm_determine_rate(struct clk_hw *hw, 374 + struct clk_rate_request *req) 375 375 { 376 376 /* 377 377 * RPM handles rate rounding and we don't have a way to 378 378 * know what the rate will be, so just return whatever 379 379 * rate is requested. 380 380 */ 381 - return rate; 381 + return 0; 382 382 } 383 383 384 384 static unsigned long clk_smd_rpm_recalc_rate(struct clk_hw *hw, ··· 427 427 .prepare = clk_smd_rpm_prepare, 428 428 .unprepare = clk_smd_rpm_unprepare, 429 429 .set_rate = clk_smd_rpm_set_rate, 430 - .round_rate = clk_smd_rpm_round_rate, 430 + .determine_rate = clk_smd_rpm_determine_rate, 431 431 .recalc_rate = clk_smd_rpm_recalc_rate, 432 432 }; 433 433
+7 -5
drivers/clk/qcom/clk-spmi-pmic-div.c
··· 112 112 spin_unlock_irqrestore(&clkdiv->lock, flags); 113 113 } 114 114 115 - static long clk_spmi_pmic_div_round_rate(struct clk_hw *hw, unsigned long rate, 116 - unsigned long *parent_rate) 115 + static int clk_spmi_pmic_div_determine_rate(struct clk_hw *hw, 116 + struct clk_rate_request *req) 117 117 { 118 118 unsigned int div, div_factor; 119 119 120 - div = DIV_ROUND_UP(*parent_rate, rate); 120 + div = DIV_ROUND_UP(req->best_parent_rate, req->rate); 121 121 div_factor = div_to_div_factor(div); 122 122 div = div_factor_to_div(div_factor); 123 123 124 - return *parent_rate / div; 124 + req->rate = req->best_parent_rate / div; 125 + 126 + return 0; 125 127 } 126 128 127 129 static unsigned long ··· 171 169 .disable = clk_spmi_pmic_div_disable, 172 170 .set_rate = clk_spmi_pmic_div_set_rate, 173 171 .recalc_rate = clk_spmi_pmic_div_recalc_rate, 174 - .round_rate = clk_spmi_pmic_div_round_rate, 172 + .determine_rate = clk_spmi_pmic_div_determine_rate, 175 173 }; 176 174 177 175 struct spmi_pmic_div_clk_cc {
+82 -9
drivers/clk/qcom/common.c
··· 9 9 #include <linux/platform_device.h> 10 10 #include <linux/clk-provider.h> 11 11 #include <linux/interconnect-clk.h> 12 + #include <linux/pm_runtime.h> 12 13 #include <linux/reset-controller.h> 13 14 #include <linux/of.h> 14 15 15 16 #include "common.h" 17 + #include "clk-alpha-pll.h" 18 + #include "clk-branch.h" 16 19 #include "clk-rcg.h" 17 20 #include "clk-regmap.h" 18 21 #include "reset.h" ··· 287 284 desc->num_icc_hws, icd); 288 285 } 289 286 287 + static int qcom_cc_clk_pll_configure(const struct qcom_cc_driver_data *data, 288 + struct regmap *regmap) 289 + { 290 + const struct clk_init_data *init; 291 + struct clk_alpha_pll *pll; 292 + int i; 293 + 294 + for (i = 0; i < data->num_alpha_plls; i++) { 295 + pll = data->alpha_plls[i]; 296 + init = pll->clkr.hw.init; 297 + 298 + if (!pll->config || !pll->regs) { 299 + pr_err("%s: missing pll config or regs\n", init->name); 300 + return -EINVAL; 301 + } 302 + 303 + qcom_clk_alpha_pll_configure(pll, regmap); 304 + } 305 + 306 + return 0; 307 + } 308 + 309 + static void qcom_cc_clk_regs_configure(struct device *dev, const struct qcom_cc_driver_data *data, 310 + struct regmap *regmap) 311 + { 312 + int i; 313 + 314 + for (i = 0; i < data->num_clk_cbcrs; i++) 315 + qcom_branch_set_clk_en(regmap, data->clk_cbcrs[i]); 316 + 317 + if (data->clk_regs_configure) 318 + data->clk_regs_configure(dev, regmap); 319 + } 320 + 290 321 int qcom_cc_really_probe(struct device *dev, 291 322 const struct qcom_cc_desc *desc, struct regmap *regmap) 292 323 { ··· 341 304 if (ret < 0 && ret != -EEXIST) 342 305 return ret; 343 306 307 + if (desc->use_rpm) { 308 + ret = devm_pm_runtime_enable(dev); 309 + if (ret) 310 + return ret; 311 + 312 + ret = pm_runtime_resume_and_get(dev); 313 + if (ret) 314 + return ret; 315 + } 316 + 317 + if (desc->driver_data) { 318 + ret = qcom_cc_clk_pll_configure(desc->driver_data, regmap); 319 + if (ret) 320 + goto put_rpm; 321 + 322 + qcom_cc_clk_regs_configure(dev, desc->driver_data, regmap); 323 + } 324 + 344 325 reset = &cc->reset; 345 326 reset->rcdev.of_node = dev->of_node; 346 327 reset->rcdev.ops = &qcom_reset_ops; ··· 369 314 370 315 ret = devm_reset_controller_register(dev, &reset->rcdev); 371 316 if (ret) 372 - return ret; 317 + goto put_rpm; 373 318 374 319 if (desc->gdscs && desc->num_gdscs) { 375 320 scd = devm_kzalloc(dev, sizeof(*scd), GFP_KERNEL); 376 - if (!scd) 377 - return -ENOMEM; 321 + if (!scd) { 322 + ret = -ENOMEM; 323 + goto put_rpm; 324 + } 378 325 scd->dev = dev; 379 326 scd->scs = desc->gdscs; 380 327 scd->num = desc->num_gdscs; 381 328 scd->pd_list = cc->pd_list; 382 329 ret = gdsc_register(scd, &reset->rcdev, regmap); 383 330 if (ret) 384 - return ret; 331 + goto put_rpm; 385 332 ret = devm_add_action_or_reset(dev, qcom_cc_gdsc_unregister, 386 333 scd); 387 334 if (ret) 388 - return ret; 335 + goto put_rpm; 336 + } 337 + 338 + if (desc->driver_data && 339 + desc->driver_data->dfs_rcgs && 340 + desc->driver_data->num_dfs_rcgs) { 341 + ret = qcom_cc_register_rcg_dfs(regmap, 342 + desc->driver_data->dfs_rcgs, 343 + desc->driver_data->num_dfs_rcgs); 344 + if (ret) 345 + goto put_rpm; 389 346 } 390 347 391 348 cc->rclks = rclks; ··· 408 341 for (i = 0; i < num_clk_hws; i++) { 409 342 ret = devm_clk_hw_register(dev, clk_hws[i]); 410 343 if (ret) 411 - return ret; 344 + goto put_rpm; 412 345 } 413 346 414 347 for (i = 0; i < num_clks; i++) { ··· 417 350 418 351 ret = devm_clk_register_regmap(dev, rclks[i]); 419 352 if (ret) 420 - return ret; 353 + goto put_rpm; 421 354 } 422 355 423 356 ret = devm_of_clk_add_hw_provider(dev, qcom_cc_clk_hw_get, cc); 424 357 if (ret) 425 - return ret; 358 + goto put_rpm; 426 359 427 - return qcom_cc_icc_register(dev, desc); 360 + ret = qcom_cc_icc_register(dev, desc); 361 + 362 + put_rpm: 363 + if (desc->use_rpm) 364 + pm_runtime_put(dev); 365 + 366 + return ret; 428 367 } 429 368 EXPORT_SYMBOL_GPL(qcom_cc_really_probe); 430 369
+12
drivers/clk/qcom/common.h
··· 25 25 int clk_id; 26 26 }; 27 27 28 + struct qcom_cc_driver_data { 29 + struct clk_alpha_pll **alpha_plls; 30 + size_t num_alpha_plls; 31 + u32 *clk_cbcrs; 32 + size_t num_clk_cbcrs; 33 + const struct clk_rcg_dfs_data *dfs_rcgs; 34 + size_t num_dfs_rcgs; 35 + void (*clk_regs_configure)(struct device *dev, struct regmap *regmap); 36 + }; 37 + 28 38 struct qcom_cc_desc { 29 39 const struct regmap_config *config; 30 40 struct clk_regmap **clks; ··· 48 38 const struct qcom_icc_hws_data *icc_hws; 49 39 size_t num_icc_hws; 50 40 unsigned int icc_first_node_id; 41 + bool use_rpm; 42 + struct qcom_cc_driver_data *driver_data; 51 43 }; 52 44 53 45 /**
+974
drivers/clk/qcom/dispcc-milos.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 5 + */ 6 + 7 + #include <linux/clk.h> 8 + #include <linux/clk-provider.h> 9 + #include <linux/err.h> 10 + #include <linux/kernel.h> 11 + #include <linux/module.h> 12 + #include <linux/of.h> 13 + #include <linux/platform_device.h> 14 + #include <linux/regmap.h> 15 + 16 + #include <dt-bindings/clock/qcom,milos-dispcc.h> 17 + 18 + #include "common.h" 19 + #include "clk-alpha-pll.h" 20 + #include "clk-branch.h" 21 + #include "clk-pll.h" 22 + #include "clk-rcg.h" 23 + #include "clk-regmap.h" 24 + #include "clk-regmap-divider.h" 25 + #include "clk-regmap-mux.h" 26 + #include "reset.h" 27 + #include "gdsc.h" 28 + 29 + /* Need to match the order of clocks in DT binding */ 30 + enum { 31 + DT_BI_TCXO, 32 + DT_SLEEP_CLK, 33 + DT_AHB_CLK, 34 + DT_GCC_DISP_GPLL0_CLK, 35 + DT_DSI0_PHY_PLL_OUT_BYTECLK, 36 + DT_DSI0_PHY_PLL_OUT_DSICLK, 37 + DT_DP0_PHY_PLL_LINK_CLK, 38 + DT_DP0_PHY_PLL_VCO_DIV_CLK, 39 + }; 40 + 41 + #define DISP_CC_MISC_CMD 0xF000 42 + 43 + enum { 44 + P_BI_TCXO, 45 + P_DISP_CC_PLL0_OUT_EVEN, 46 + P_DISP_CC_PLL0_OUT_MAIN, 47 + P_DP0_PHY_PLL_LINK_CLK, 48 + P_DP0_PHY_PLL_VCO_DIV_CLK, 49 + P_DSI0_PHY_PLL_OUT_BYTECLK, 50 + P_DSI0_PHY_PLL_OUT_DSICLK, 51 + P_GCC_DISP_GPLL0_CLK, 52 + P_SLEEP_CLK, 53 + }; 54 + 55 + static const struct pll_vco lucid_ole_vco[] = { 56 + { 249600000, 2300000000, 0 }, 57 + }; 58 + 59 + /* 257.142858 MHz Configuration */ 60 + static const struct alpha_pll_config disp_cc_pll0_config = { 61 + .l = 0xd, 62 + .alpha = 0x6492, 63 + .config_ctl_val = 0x20485699, 64 + .config_ctl_hi_val = 0x00182261, 65 + .config_ctl_hi1_val = 0x82aa299c, 66 + .test_ctl_val = 0x00000000, 67 + .test_ctl_hi_val = 0x00000003, 68 + .test_ctl_hi1_val = 0x00009000, 69 + .test_ctl_hi2_val = 0x00000034, 70 + .user_ctl_val = 0x00000000, 71 + .user_ctl_hi_val = 0x00000005, 72 + }; 73 + 74 + static struct clk_alpha_pll disp_cc_pll0 = { 75 + .offset = 0x0, 76 + .config = &disp_cc_pll0_config, 77 + .vco_table = lucid_ole_vco, 78 + .num_vco = ARRAY_SIZE(lucid_ole_vco), 79 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 80 + .clkr = { 81 + .hw.init = &(const struct clk_init_data) { 82 + .name = "disp_cc_pll0", 83 + .parent_data = &(const struct clk_parent_data) { 84 + .index = DT_BI_TCXO, 85 + }, 86 + .num_parents = 1, 87 + .ops = &clk_alpha_pll_lucid_evo_ops, 88 + }, 89 + }, 90 + }; 91 + 92 + static const struct parent_map disp_cc_parent_map_0[] = { 93 + { P_BI_TCXO, 0 }, 94 + }; 95 + 96 + static const struct clk_parent_data disp_cc_parent_data_0[] = { 97 + { .index = DT_BI_TCXO }, 98 + }; 99 + 100 + static const struct parent_map disp_cc_parent_map_1[] = { 101 + { P_BI_TCXO, 0 }, 102 + { P_DSI0_PHY_PLL_OUT_DSICLK, 1 }, 103 + { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 }, 104 + }; 105 + 106 + static const struct clk_parent_data disp_cc_parent_data_1[] = { 107 + { .index = DT_BI_TCXO }, 108 + { .index = DT_DSI0_PHY_PLL_OUT_DSICLK }, 109 + { .index = DT_DSI0_PHY_PLL_OUT_BYTECLK }, 110 + }; 111 + 112 + static const struct parent_map disp_cc_parent_map_2[] = { 113 + { P_BI_TCXO, 0 }, 114 + { P_DP0_PHY_PLL_LINK_CLK, 1 }, 115 + { P_DP0_PHY_PLL_VCO_DIV_CLK, 2 }, 116 + }; 117 + 118 + static const struct clk_parent_data disp_cc_parent_data_2[] = { 119 + { .index = DT_BI_TCXO }, 120 + { .index = DT_DP0_PHY_PLL_LINK_CLK }, 121 + { .index = DT_DP0_PHY_PLL_VCO_DIV_CLK }, 122 + }; 123 + 124 + static const struct parent_map disp_cc_parent_map_3[] = { 125 + { P_BI_TCXO, 0 }, 126 + { P_GCC_DISP_GPLL0_CLK, 4 }, 127 + }; 128 + 129 + static const struct clk_parent_data disp_cc_parent_data_3[] = { 130 + { .index = DT_BI_TCXO }, 131 + { .index = DT_GCC_DISP_GPLL0_CLK }, 132 + }; 133 + 134 + static const struct parent_map disp_cc_parent_map_4[] = { 135 + { P_BI_TCXO, 0 }, 136 + { P_DP0_PHY_PLL_LINK_CLK, 1 }, 137 + }; 138 + 139 + static const struct clk_parent_data disp_cc_parent_data_4[] = { 140 + { .index = DT_BI_TCXO }, 141 + { .index = DT_DP0_PHY_PLL_LINK_CLK }, 142 + }; 143 + 144 + static const struct parent_map disp_cc_parent_map_5[] = { 145 + { P_BI_TCXO, 0 }, 146 + { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 }, 147 + }; 148 + 149 + static const struct clk_parent_data disp_cc_parent_data_5[] = { 150 + { .index = DT_BI_TCXO }, 151 + { .index = DT_DSI0_PHY_PLL_OUT_BYTECLK }, 152 + }; 153 + 154 + static const struct parent_map disp_cc_parent_map_6[] = { 155 + { P_BI_TCXO, 0 }, 156 + { P_DISP_CC_PLL0_OUT_MAIN, 1 }, 157 + { P_GCC_DISP_GPLL0_CLK, 4 }, 158 + { P_DISP_CC_PLL0_OUT_EVEN, 6 }, 159 + }; 160 + 161 + static const struct clk_parent_data disp_cc_parent_data_6[] = { 162 + { .index = DT_BI_TCXO }, 163 + { .hw = &disp_cc_pll0.clkr.hw }, 164 + { .index = DT_GCC_DISP_GPLL0_CLK }, 165 + { .hw = &disp_cc_pll0.clkr.hw }, 166 + }; 167 + 168 + static const struct parent_map disp_cc_parent_map_7[] = { 169 + { P_SLEEP_CLK, 0 }, 170 + }; 171 + 172 + static const struct clk_parent_data disp_cc_parent_data_7_ao[] = { 173 + { .index = DT_SLEEP_CLK }, 174 + }; 175 + 176 + static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = { 177 + F(19200000, P_BI_TCXO, 1, 0, 0), 178 + F(37500000, P_GCC_DISP_GPLL0_CLK, 8, 0, 0), 179 + F(75000000, P_GCC_DISP_GPLL0_CLK, 4, 0, 0), 180 + { } 181 + }; 182 + 183 + static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = { 184 + .cmd_rcgr = 0x8130, 185 + .mnd_width = 0, 186 + .hid_width = 5, 187 + .parent_map = disp_cc_parent_map_3, 188 + .freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src, 189 + .clkr.hw.init = &(const struct clk_init_data) { 190 + .name = "disp_cc_mdss_ahb_clk_src", 191 + .parent_data = disp_cc_parent_data_3, 192 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_3), 193 + .flags = CLK_SET_RATE_PARENT, 194 + .ops = &clk_rcg2_shared_ops, 195 + }, 196 + }; 197 + 198 + static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = { 199 + .cmd_rcgr = 0x8098, 200 + .mnd_width = 0, 201 + .hid_width = 5, 202 + .parent_map = disp_cc_parent_map_1, 203 + .clkr.hw.init = &(const struct clk_init_data) { 204 + .name = "disp_cc_mdss_byte0_clk_src", 205 + .parent_data = disp_cc_parent_data_1, 206 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_1), 207 + .flags = CLK_SET_RATE_PARENT, 208 + .ops = &clk_byte2_ops, 209 + }, 210 + }; 211 + 212 + static const struct freq_tbl ftbl_disp_cc_mdss_dptx0_aux_clk_src[] = { 213 + F(19200000, P_BI_TCXO, 1, 0, 0), 214 + { } 215 + }; 216 + 217 + static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = { 218 + .cmd_rcgr = 0x8118, 219 + .mnd_width = 0, 220 + .hid_width = 5, 221 + .parent_map = disp_cc_parent_map_0, 222 + .freq_tbl = ftbl_disp_cc_mdss_dptx0_aux_clk_src, 223 + .clkr.hw.init = &(const struct clk_init_data) { 224 + .name = "disp_cc_mdss_dptx0_aux_clk_src", 225 + .parent_data = disp_cc_parent_data_0, 226 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), 227 + .flags = CLK_SET_RATE_PARENT, 228 + .ops = &clk_rcg2_ops, 229 + }, 230 + }; 231 + 232 + static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = { 233 + .cmd_rcgr = 0x80cc, 234 + .mnd_width = 0, 235 + .hid_width = 5, 236 + .parent_map = disp_cc_parent_map_4, 237 + .clkr.hw.init = &(const struct clk_init_data) { 238 + .name = "disp_cc_mdss_dptx0_link_clk_src", 239 + .parent_data = disp_cc_parent_data_4, 240 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_4), 241 + .flags = CLK_SET_RATE_PARENT, 242 + .ops = &clk_byte2_ops, 243 + }, 244 + }; 245 + 246 + static struct clk_rcg2 disp_cc_mdss_dptx0_pixel0_clk_src = { 247 + .cmd_rcgr = 0x80e8, 248 + .mnd_width = 16, 249 + .hid_width = 5, 250 + .parent_map = disp_cc_parent_map_2, 251 + .clkr.hw.init = &(const struct clk_init_data) { 252 + .name = "disp_cc_mdss_dptx0_pixel0_clk_src", 253 + .parent_data = disp_cc_parent_data_2, 254 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_2), 255 + .flags = CLK_SET_RATE_PARENT, 256 + .ops = &clk_dp_ops, 257 + }, 258 + }; 259 + 260 + static struct clk_rcg2 disp_cc_mdss_dptx0_pixel1_clk_src = { 261 + .cmd_rcgr = 0x8100, 262 + .mnd_width = 16, 263 + .hid_width = 5, 264 + .parent_map = disp_cc_parent_map_2, 265 + .clkr.hw.init = &(const struct clk_init_data) { 266 + .name = "disp_cc_mdss_dptx0_pixel1_clk_src", 267 + .parent_data = disp_cc_parent_data_2, 268 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_2), 269 + .flags = CLK_SET_RATE_PARENT, 270 + .ops = &clk_dp_ops, 271 + }, 272 + }; 273 + 274 + static const struct freq_tbl ftbl_disp_cc_mdss_esc0_clk_src[] = { 275 + F(9600000, P_BI_TCXO, 2, 0, 0), 276 + F(12800000, P_BI_TCXO, 1.5, 0, 0), 277 + F(19200000, P_BI_TCXO, 1, 0, 0), 278 + { } 279 + }; 280 + static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = { 281 + .cmd_rcgr = 0x80b4, 282 + .mnd_width = 0, 283 + .hid_width = 5, 284 + .parent_map = disp_cc_parent_map_5, 285 + .freq_tbl = ftbl_disp_cc_mdss_esc0_clk_src, 286 + .clkr.hw.init = &(const struct clk_init_data) { 287 + .name = "disp_cc_mdss_esc0_clk_src", 288 + .parent_data = disp_cc_parent_data_5, 289 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_5), 290 + .flags = CLK_SET_RATE_PARENT, 291 + .ops = &clk_rcg2_ops, 292 + }, 293 + }; 294 + 295 + static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = { 296 + F(19200000, P_BI_TCXO, 1, 0, 0), 297 + F(85714286, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 298 + F(100000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 299 + F(200000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 300 + F(342000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 301 + F(402000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 302 + F(535000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 303 + F(600000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 304 + F(630000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 305 + { } 306 + }; 307 + 308 + static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = { 309 + .cmd_rcgr = 0x8068, 310 + .mnd_width = 0, 311 + .hid_width = 5, 312 + .parent_map = disp_cc_parent_map_6, 313 + .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src, 314 + .clkr.hw.init = &(const struct clk_init_data) { 315 + .name = "disp_cc_mdss_mdp_clk_src", 316 + .parent_data = disp_cc_parent_data_6, 317 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_6), 318 + .flags = CLK_SET_RATE_PARENT, 319 + .ops = &clk_rcg2_shared_ops, 320 + }, 321 + }; 322 + 323 + static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = { 324 + .cmd_rcgr = 0x8050, 325 + .mnd_width = 8, 326 + .hid_width = 5, 327 + .parent_map = disp_cc_parent_map_1, 328 + .clkr.hw.init = &(const struct clk_init_data) { 329 + .name = "disp_cc_mdss_pclk0_clk_src", 330 + .parent_data = disp_cc_parent_data_1, 331 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_1), 332 + .flags = CLK_SET_RATE_PARENT, 333 + .ops = &clk_pixel_ops, 334 + }, 335 + }; 336 + 337 + static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = { 338 + .cmd_rcgr = 0x8080, 339 + .mnd_width = 0, 340 + .hid_width = 5, 341 + .parent_map = disp_cc_parent_map_0, 342 + .freq_tbl = ftbl_disp_cc_mdss_dptx0_aux_clk_src, 343 + .clkr.hw.init = &(const struct clk_init_data) { 344 + .name = "disp_cc_mdss_vsync_clk_src", 345 + .parent_data = disp_cc_parent_data_0, 346 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), 347 + .flags = CLK_SET_RATE_PARENT, 348 + .ops = &clk_rcg2_ops, 349 + }, 350 + }; 351 + 352 + static const struct freq_tbl ftbl_disp_cc_sleep_clk_src[] = { 353 + F(32000, P_SLEEP_CLK, 1, 0, 0), 354 + { } 355 + }; 356 + 357 + static struct clk_rcg2 disp_cc_sleep_clk_src = { 358 + .cmd_rcgr = 0xe054, 359 + .mnd_width = 0, 360 + .hid_width = 5, 361 + .parent_map = disp_cc_parent_map_7, 362 + .freq_tbl = ftbl_disp_cc_sleep_clk_src, 363 + .clkr.hw.init = &(const struct clk_init_data) { 364 + .name = "disp_cc_sleep_clk_src", 365 + .parent_data = disp_cc_parent_data_7_ao, 366 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_7_ao), 367 + .flags = CLK_SET_RATE_PARENT, 368 + .ops = &clk_rcg2_ops, 369 + }, 370 + }; 371 + 372 + static struct clk_rcg2 disp_cc_xo_clk_src = { 373 + .cmd_rcgr = 0xe034, 374 + .mnd_width = 0, 375 + .hid_width = 5, 376 + .parent_map = disp_cc_parent_map_0, 377 + .freq_tbl = ftbl_disp_cc_mdss_dptx0_aux_clk_src, 378 + .clkr.hw.init = &(const struct clk_init_data) { 379 + .name = "disp_cc_xo_clk_src", 380 + .parent_data = disp_cc_parent_data_0, 381 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), 382 + .flags = CLK_SET_RATE_PARENT, 383 + .ops = &clk_rcg2_ops, 384 + }, 385 + }; 386 + 387 + static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = { 388 + .reg = 0x80b0, 389 + .shift = 0, 390 + .width = 4, 391 + .clkr.hw.init = &(const struct clk_init_data) { 392 + .name = "disp_cc_mdss_byte0_div_clk_src", 393 + .parent_hws = (const struct clk_hw*[]) { 394 + &disp_cc_mdss_byte0_clk_src.clkr.hw, 395 + }, 396 + .num_parents = 1, 397 + .flags = CLK_SET_RATE_PARENT, 398 + .ops = &clk_regmap_div_ops, 399 + }, 400 + }; 401 + 402 + static struct clk_regmap_div disp_cc_mdss_dptx0_link_div_clk_src = { 403 + .reg = 0x80e4, 404 + .shift = 0, 405 + .width = 4, 406 + .clkr.hw.init = &(const struct clk_init_data) { 407 + .name = "disp_cc_mdss_dptx0_link_div_clk_src", 408 + .parent_hws = (const struct clk_hw*[]) { 409 + &disp_cc_mdss_dptx0_link_clk_src.clkr.hw, 410 + }, 411 + .num_parents = 1, 412 + .flags = CLK_SET_RATE_PARENT, 413 + .ops = &clk_regmap_div_ro_ops, 414 + }, 415 + }; 416 + 417 + static struct clk_branch disp_cc_mdss_accu_clk = { 418 + .halt_reg = 0xe050, 419 + .halt_check = BRANCH_HALT_VOTED, 420 + .clkr = { 421 + .enable_reg = 0xe050, 422 + .enable_mask = BIT(0), 423 + .hw.init = &(const struct clk_init_data) { 424 + .name = "disp_cc_mdss_accu_clk", 425 + .parent_hws = (const struct clk_hw*[]) { 426 + &disp_cc_xo_clk_src.clkr.hw, 427 + }, 428 + .num_parents = 1, 429 + .flags = CLK_SET_RATE_PARENT, 430 + .ops = &clk_branch2_ops, 431 + }, 432 + }, 433 + }; 434 + 435 + static struct clk_branch disp_cc_mdss_ahb1_clk = { 436 + .halt_reg = 0xa020, 437 + .halt_check = BRANCH_HALT, 438 + .clkr = { 439 + .enable_reg = 0xa020, 440 + .enable_mask = BIT(0), 441 + .hw.init = &(const struct clk_init_data) { 442 + .name = "disp_cc_mdss_ahb1_clk", 443 + .parent_hws = (const struct clk_hw*[]) { 444 + &disp_cc_mdss_ahb_clk_src.clkr.hw, 445 + }, 446 + .num_parents = 1, 447 + .flags = CLK_SET_RATE_PARENT, 448 + .ops = &clk_branch2_ops, 449 + }, 450 + }, 451 + }; 452 + 453 + static struct clk_branch disp_cc_mdss_ahb_clk = { 454 + .halt_reg = 0x804c, 455 + .halt_check = BRANCH_HALT, 456 + .clkr = { 457 + .enable_reg = 0x804c, 458 + .enable_mask = BIT(0), 459 + .hw.init = &(const struct clk_init_data) { 460 + .name = "disp_cc_mdss_ahb_clk", 461 + .parent_hws = (const struct clk_hw*[]) { 462 + &disp_cc_mdss_ahb_clk_src.clkr.hw, 463 + }, 464 + .num_parents = 1, 465 + .flags = CLK_SET_RATE_PARENT, 466 + .ops = &clk_branch2_ops, 467 + }, 468 + }, 469 + }; 470 + 471 + static struct clk_branch disp_cc_mdss_byte0_clk = { 472 + .halt_reg = 0x8024, 473 + .halt_check = BRANCH_HALT, 474 + .clkr = { 475 + .enable_reg = 0x8024, 476 + .enable_mask = BIT(0), 477 + .hw.init = &(const struct clk_init_data) { 478 + .name = "disp_cc_mdss_byte0_clk", 479 + .parent_hws = (const struct clk_hw*[]) { 480 + &disp_cc_mdss_byte0_clk_src.clkr.hw, 481 + }, 482 + .num_parents = 1, 483 + .flags = CLK_SET_RATE_PARENT, 484 + .ops = &clk_branch2_ops, 485 + }, 486 + }, 487 + }; 488 + 489 + static struct clk_branch disp_cc_mdss_byte0_intf_clk = { 490 + .halt_reg = 0x8028, 491 + .halt_check = BRANCH_HALT, 492 + .clkr = { 493 + .enable_reg = 0x8028, 494 + .enable_mask = BIT(0), 495 + .hw.init = &(const struct clk_init_data) { 496 + .name = "disp_cc_mdss_byte0_intf_clk", 497 + .parent_hws = (const struct clk_hw*[]) { 498 + &disp_cc_mdss_byte0_div_clk_src.clkr.hw, 499 + }, 500 + .num_parents = 1, 501 + .flags = CLK_SET_RATE_PARENT, 502 + .ops = &clk_branch2_ops, 503 + }, 504 + }, 505 + }; 506 + 507 + static struct clk_branch disp_cc_mdss_dptx0_aux_clk = { 508 + .halt_reg = 0x8048, 509 + .halt_check = BRANCH_HALT, 510 + .clkr = { 511 + .enable_reg = 0x8048, 512 + .enable_mask = BIT(0), 513 + .hw.init = &(const struct clk_init_data) { 514 + .name = "disp_cc_mdss_dptx0_aux_clk", 515 + .parent_hws = (const struct clk_hw*[]) { 516 + &disp_cc_mdss_dptx0_aux_clk_src.clkr.hw, 517 + }, 518 + .num_parents = 1, 519 + .flags = CLK_SET_RATE_PARENT, 520 + .ops = &clk_branch2_ops, 521 + }, 522 + }, 523 + }; 524 + 525 + static struct clk_branch disp_cc_mdss_dptx0_crypto_clk = { 526 + .halt_reg = 0x803c, 527 + .halt_check = BRANCH_HALT, 528 + .clkr = { 529 + .enable_reg = 0x803c, 530 + .enable_mask = BIT(0), 531 + .hw.init = &(const struct clk_init_data) { 532 + .name = "disp_cc_mdss_dptx0_crypto_clk", 533 + .parent_hws = (const struct clk_hw*[]) { 534 + &disp_cc_mdss_dptx0_link_clk_src.clkr.hw, 535 + }, 536 + .num_parents = 1, 537 + .flags = CLK_SET_RATE_PARENT, 538 + .ops = &clk_branch2_ops, 539 + }, 540 + }, 541 + }; 542 + 543 + static struct clk_branch disp_cc_mdss_dptx0_link_clk = { 544 + .halt_reg = 0x8030, 545 + .halt_check = BRANCH_HALT, 546 + .clkr = { 547 + .enable_reg = 0x8030, 548 + .enable_mask = BIT(0), 549 + .hw.init = &(const struct clk_init_data) { 550 + .name = "disp_cc_mdss_dptx0_link_clk", 551 + .parent_hws = (const struct clk_hw*[]) { 552 + &disp_cc_mdss_dptx0_link_clk_src.clkr.hw, 553 + }, 554 + .num_parents = 1, 555 + .flags = CLK_SET_RATE_PARENT, 556 + .ops = &clk_branch2_ops, 557 + }, 558 + }, 559 + }; 560 + 561 + static struct clk_branch disp_cc_mdss_dptx0_link_intf_clk = { 562 + .halt_reg = 0x8038, 563 + .halt_check = BRANCH_HALT, 564 + .clkr = { 565 + .enable_reg = 0x8038, 566 + .enable_mask = BIT(0), 567 + .hw.init = &(const struct clk_init_data) { 568 + .name = "disp_cc_mdss_dptx0_link_intf_clk", 569 + .parent_hws = (const struct clk_hw*[]) { 570 + &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw, 571 + }, 572 + .num_parents = 1, 573 + .flags = CLK_SET_RATE_PARENT, 574 + .ops = &clk_branch2_ops, 575 + }, 576 + }, 577 + }; 578 + 579 + static struct clk_branch disp_cc_mdss_dptx0_pixel0_clk = { 580 + .halt_reg = 0x8040, 581 + .halt_check = BRANCH_HALT, 582 + .clkr = { 583 + .enable_reg = 0x8040, 584 + .enable_mask = BIT(0), 585 + .hw.init = &(const struct clk_init_data) { 586 + .name = "disp_cc_mdss_dptx0_pixel0_clk", 587 + .parent_hws = (const struct clk_hw*[]) { 588 + &disp_cc_mdss_dptx0_pixel0_clk_src.clkr.hw, 589 + }, 590 + .num_parents = 1, 591 + .flags = CLK_SET_RATE_PARENT, 592 + .ops = &clk_branch2_ops, 593 + }, 594 + }, 595 + }; 596 + 597 + static struct clk_branch disp_cc_mdss_dptx0_pixel1_clk = { 598 + .halt_reg = 0x8044, 599 + .halt_check = BRANCH_HALT, 600 + .clkr = { 601 + .enable_reg = 0x8044, 602 + .enable_mask = BIT(0), 603 + .hw.init = &(const struct clk_init_data) { 604 + .name = "disp_cc_mdss_dptx0_pixel1_clk", 605 + .parent_hws = (const struct clk_hw*[]) { 606 + &disp_cc_mdss_dptx0_pixel1_clk_src.clkr.hw, 607 + }, 608 + .num_parents = 1, 609 + .flags = CLK_SET_RATE_PARENT, 610 + .ops = &clk_branch2_ops, 611 + }, 612 + }, 613 + }; 614 + 615 + static struct clk_branch disp_cc_mdss_dptx0_usb_router_link_intf_clk = { 616 + .halt_reg = 0x8034, 617 + .halt_check = BRANCH_HALT, 618 + .clkr = { 619 + .enable_reg = 0x8034, 620 + .enable_mask = BIT(0), 621 + .hw.init = &(const struct clk_init_data) { 622 + .name = "disp_cc_mdss_dptx0_usb_router_link_intf_clk", 623 + .parent_hws = (const struct clk_hw*[]) { 624 + &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw, 625 + }, 626 + .num_parents = 1, 627 + .flags = CLK_SET_RATE_PARENT, 628 + .ops = &clk_branch2_ops, 629 + }, 630 + }, 631 + }; 632 + 633 + static struct clk_branch disp_cc_mdss_esc0_clk = { 634 + .halt_reg = 0x802c, 635 + .halt_check = BRANCH_HALT, 636 + .clkr = { 637 + .enable_reg = 0x802c, 638 + .enable_mask = BIT(0), 639 + .hw.init = &(const struct clk_init_data) { 640 + .name = "disp_cc_mdss_esc0_clk", 641 + .parent_hws = (const struct clk_hw*[]) { 642 + &disp_cc_mdss_esc0_clk_src.clkr.hw, 643 + }, 644 + .num_parents = 1, 645 + .flags = CLK_SET_RATE_PARENT, 646 + .ops = &clk_branch2_ops, 647 + }, 648 + }, 649 + }; 650 + 651 + static struct clk_branch disp_cc_mdss_mdp1_clk = { 652 + .halt_reg = 0xa004, 653 + .halt_check = BRANCH_HALT, 654 + .clkr = { 655 + .enable_reg = 0xa004, 656 + .enable_mask = BIT(0), 657 + .hw.init = &(const struct clk_init_data) { 658 + .name = "disp_cc_mdss_mdp1_clk", 659 + .parent_hws = (const struct clk_hw*[]) { 660 + &disp_cc_mdss_mdp_clk_src.clkr.hw, 661 + }, 662 + .num_parents = 1, 663 + .flags = CLK_SET_RATE_PARENT, 664 + .ops = &clk_branch2_ops, 665 + }, 666 + }, 667 + }; 668 + 669 + static struct clk_branch disp_cc_mdss_mdp_clk = { 670 + .halt_reg = 0x8008, 671 + .halt_check = BRANCH_HALT, 672 + .clkr = { 673 + .enable_reg = 0x8008, 674 + .enable_mask = BIT(0), 675 + .hw.init = &(const struct clk_init_data) { 676 + .name = "disp_cc_mdss_mdp_clk", 677 + .parent_hws = (const struct clk_hw*[]) { 678 + &disp_cc_mdss_mdp_clk_src.clkr.hw, 679 + }, 680 + .num_parents = 1, 681 + .flags = CLK_SET_RATE_PARENT, 682 + .ops = &clk_branch2_ops, 683 + }, 684 + }, 685 + }; 686 + 687 + static struct clk_branch disp_cc_mdss_mdp_lut1_clk = { 688 + .halt_reg = 0xa010, 689 + .halt_check = BRANCH_HALT, 690 + .clkr = { 691 + .enable_reg = 0xa010, 692 + .enable_mask = BIT(0), 693 + .hw.init = &(const struct clk_init_data) { 694 + .name = "disp_cc_mdss_mdp_lut1_clk", 695 + .parent_hws = (const struct clk_hw*[]) { 696 + &disp_cc_mdss_mdp_clk_src.clkr.hw, 697 + }, 698 + .num_parents = 1, 699 + .flags = CLK_SET_RATE_PARENT, 700 + .ops = &clk_branch2_ops, 701 + }, 702 + }, 703 + }; 704 + 705 + static struct clk_branch disp_cc_mdss_mdp_lut_clk = { 706 + .halt_reg = 0x8014, 707 + .halt_check = BRANCH_HALT_VOTED, 708 + .clkr = { 709 + .enable_reg = 0x8014, 710 + .enable_mask = BIT(0), 711 + .hw.init = &(const struct clk_init_data) { 712 + .name = "disp_cc_mdss_mdp_lut_clk", 713 + .parent_hws = (const struct clk_hw*[]) { 714 + &disp_cc_mdss_mdp_clk_src.clkr.hw, 715 + }, 716 + .num_parents = 1, 717 + .flags = CLK_SET_RATE_PARENT, 718 + .ops = &clk_branch2_ops, 719 + }, 720 + }, 721 + }; 722 + 723 + static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = { 724 + .halt_reg = 0xc004, 725 + .halt_check = BRANCH_HALT_VOTED, 726 + .clkr = { 727 + .enable_reg = 0xc004, 728 + .enable_mask = BIT(0), 729 + .hw.init = &(const struct clk_init_data) { 730 + .name = "disp_cc_mdss_non_gdsc_ahb_clk", 731 + .parent_hws = (const struct clk_hw*[]) { 732 + &disp_cc_mdss_ahb_clk_src.clkr.hw, 733 + }, 734 + .num_parents = 1, 735 + .flags = CLK_SET_RATE_PARENT, 736 + .ops = &clk_branch2_ops, 737 + }, 738 + }, 739 + }; 740 + 741 + static struct clk_branch disp_cc_mdss_pclk0_clk = { 742 + .halt_reg = 0x8004, 743 + .halt_check = BRANCH_HALT, 744 + .clkr = { 745 + .enable_reg = 0x8004, 746 + .enable_mask = BIT(0), 747 + .hw.init = &(const struct clk_init_data) { 748 + .name = "disp_cc_mdss_pclk0_clk", 749 + .parent_hws = (const struct clk_hw*[]) { 750 + &disp_cc_mdss_pclk0_clk_src.clkr.hw, 751 + }, 752 + .num_parents = 1, 753 + .flags = CLK_SET_RATE_PARENT, 754 + .ops = &clk_branch2_ops, 755 + }, 756 + }, 757 + }; 758 + 759 + static struct clk_branch disp_cc_mdss_rscc_ahb_clk = { 760 + .halt_reg = 0xc00c, 761 + .halt_check = BRANCH_HALT, 762 + .clkr = { 763 + .enable_reg = 0xc00c, 764 + .enable_mask = BIT(0), 765 + .hw.init = &(const struct clk_init_data) { 766 + .name = "disp_cc_mdss_rscc_ahb_clk", 767 + .parent_hws = (const struct clk_hw*[]) { 768 + &disp_cc_mdss_ahb_clk_src.clkr.hw, 769 + }, 770 + .num_parents = 1, 771 + .flags = CLK_SET_RATE_PARENT, 772 + .ops = &clk_branch2_ops, 773 + }, 774 + }, 775 + }; 776 + 777 + static struct clk_branch disp_cc_mdss_rscc_vsync_clk = { 778 + .halt_reg = 0xc008, 779 + .halt_check = BRANCH_HALT, 780 + .clkr = { 781 + .enable_reg = 0xc008, 782 + .enable_mask = BIT(0), 783 + .hw.init = &(const struct clk_init_data) { 784 + .name = "disp_cc_mdss_rscc_vsync_clk", 785 + .parent_hws = (const struct clk_hw*[]) { 786 + &disp_cc_mdss_vsync_clk_src.clkr.hw, 787 + }, 788 + .num_parents = 1, 789 + .flags = CLK_SET_RATE_PARENT, 790 + .ops = &clk_branch2_ops, 791 + }, 792 + }, 793 + }; 794 + 795 + static struct clk_branch disp_cc_mdss_vsync1_clk = { 796 + .halt_reg = 0xa01c, 797 + .halt_check = BRANCH_HALT, 798 + .clkr = { 799 + .enable_reg = 0xa01c, 800 + .enable_mask = BIT(0), 801 + .hw.init = &(const struct clk_init_data) { 802 + .name = "disp_cc_mdss_vsync1_clk", 803 + .parent_hws = (const struct clk_hw*[]) { 804 + &disp_cc_mdss_vsync_clk_src.clkr.hw, 805 + }, 806 + .num_parents = 1, 807 + .flags = CLK_SET_RATE_PARENT, 808 + .ops = &clk_branch2_ops, 809 + }, 810 + }, 811 + }; 812 + 813 + static struct clk_branch disp_cc_mdss_vsync_clk = { 814 + .halt_reg = 0x8020, 815 + .halt_check = BRANCH_HALT, 816 + .clkr = { 817 + .enable_reg = 0x8020, 818 + .enable_mask = BIT(0), 819 + .hw.init = &(const struct clk_init_data) { 820 + .name = "disp_cc_mdss_vsync_clk", 821 + .parent_hws = (const struct clk_hw*[]) { 822 + &disp_cc_mdss_vsync_clk_src.clkr.hw, 823 + }, 824 + .num_parents = 1, 825 + .flags = CLK_SET_RATE_PARENT, 826 + .ops = &clk_branch2_ops, 827 + }, 828 + }, 829 + }; 830 + 831 + static struct gdsc disp_cc_mdss_core_gdsc = { 832 + .gdscr = 0x9000, 833 + .en_rest_wait_val = 0x2, 834 + .en_few_wait_val = 0x2, 835 + .clk_dis_wait_val = 0xf, 836 + .pd = { 837 + .name = "disp_cc_mdss_core_gdsc", 838 + }, 839 + .pwrsts = PWRSTS_OFF_ON, 840 + .flags = POLL_CFG_GDSCR | HW_CTRL | RETAIN_FF_ENABLE, 841 + }; 842 + 843 + static struct gdsc disp_cc_mdss_core_int2_gdsc = { 844 + .gdscr = 0xb000, 845 + .en_rest_wait_val = 0x2, 846 + .en_few_wait_val = 0x2, 847 + .clk_dis_wait_val = 0xf, 848 + .pd = { 849 + .name = "disp_cc_mdss_core_int2_gdsc", 850 + }, 851 + .pwrsts = PWRSTS_OFF_ON, 852 + .flags = POLL_CFG_GDSCR | HW_CTRL | RETAIN_FF_ENABLE, 853 + }; 854 + 855 + static struct clk_regmap *disp_cc_milos_clocks[] = { 856 + [DISP_CC_MDSS_ACCU_CLK] = &disp_cc_mdss_accu_clk.clkr, 857 + [DISP_CC_MDSS_AHB1_CLK] = &disp_cc_mdss_ahb1_clk.clkr, 858 + [DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr, 859 + [DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr, 860 + [DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr, 861 + [DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr, 862 + [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC] = &disp_cc_mdss_byte0_div_clk_src.clkr, 863 + [DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr, 864 + [DISP_CC_MDSS_DPTX0_AUX_CLK] = &disp_cc_mdss_dptx0_aux_clk.clkr, 865 + [DISP_CC_MDSS_DPTX0_AUX_CLK_SRC] = &disp_cc_mdss_dptx0_aux_clk_src.clkr, 866 + [DISP_CC_MDSS_DPTX0_CRYPTO_CLK] = &disp_cc_mdss_dptx0_crypto_clk.clkr, 867 + [DISP_CC_MDSS_DPTX0_LINK_CLK] = &disp_cc_mdss_dptx0_link_clk.clkr, 868 + [DISP_CC_MDSS_DPTX0_LINK_CLK_SRC] = &disp_cc_mdss_dptx0_link_clk_src.clkr, 869 + [DISP_CC_MDSS_DPTX0_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx0_link_div_clk_src.clkr, 870 + [DISP_CC_MDSS_DPTX0_LINK_INTF_CLK] = &disp_cc_mdss_dptx0_link_intf_clk.clkr, 871 + [DISP_CC_MDSS_DPTX0_PIXEL0_CLK] = &disp_cc_mdss_dptx0_pixel0_clk.clkr, 872 + [DISP_CC_MDSS_DPTX0_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx0_pixel0_clk_src.clkr, 873 + [DISP_CC_MDSS_DPTX0_PIXEL1_CLK] = &disp_cc_mdss_dptx0_pixel1_clk.clkr, 874 + [DISP_CC_MDSS_DPTX0_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx0_pixel1_clk_src.clkr, 875 + [DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK] = 876 + &disp_cc_mdss_dptx0_usb_router_link_intf_clk.clkr, 877 + [DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr, 878 + [DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr, 879 + [DISP_CC_MDSS_MDP1_CLK] = &disp_cc_mdss_mdp1_clk.clkr, 880 + [DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr, 881 + [DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr, 882 + [DISP_CC_MDSS_MDP_LUT1_CLK] = &disp_cc_mdss_mdp_lut1_clk.clkr, 883 + [DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr, 884 + [DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr, 885 + [DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr, 886 + [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr, 887 + [DISP_CC_MDSS_RSCC_AHB_CLK] = &disp_cc_mdss_rscc_ahb_clk.clkr, 888 + [DISP_CC_MDSS_RSCC_VSYNC_CLK] = &disp_cc_mdss_rscc_vsync_clk.clkr, 889 + [DISP_CC_MDSS_VSYNC1_CLK] = &disp_cc_mdss_vsync1_clk.clkr, 890 + [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr, 891 + [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr, 892 + [DISP_CC_PLL0] = &disp_cc_pll0.clkr, 893 + [DISP_CC_SLEEP_CLK_SRC] = &disp_cc_sleep_clk_src.clkr, 894 + [DISP_CC_XO_CLK_SRC] = &disp_cc_xo_clk_src.clkr, 895 + }; 896 + 897 + static const struct qcom_reset_map disp_cc_milos_resets[] = { 898 + [DISP_CC_MDSS_CORE_BCR] = { 0x8000 }, 899 + [DISP_CC_MDSS_CORE_INT2_BCR] = { 0xa000 }, 900 + [DISP_CC_MDSS_RSCC_BCR] = { 0xc000 }, 901 + }; 902 + 903 + static struct gdsc *disp_cc_milos_gdscs[] = { 904 + [DISP_CC_MDSS_CORE_GDSC] = &disp_cc_mdss_core_gdsc, 905 + [DISP_CC_MDSS_CORE_INT2_GDSC] = &disp_cc_mdss_core_int2_gdsc, 906 + }; 907 + 908 + static struct clk_alpha_pll *disp_cc_milos_plls[] = { 909 + &disp_cc_pll0, 910 + }; 911 + 912 + static u32 disp_cc_milos_critical_cbcrs[] = { 913 + 0xe06c, /* DISP_CC_SLEEP_CLK */ 914 + 0xe04c, /* DISP_CC_XO_CLK */ 915 + }; 916 + 917 + static const struct regmap_config disp_cc_milos_regmap_config = { 918 + .reg_bits = 32, 919 + .reg_stride = 4, 920 + .val_bits = 32, 921 + .max_register = 0x11008, 922 + .fast_io = true, 923 + }; 924 + 925 + static void disp_cc_milos_clk_regs_configure(struct device *dev, struct regmap *regmap) 926 + { 927 + /* Enable clock gating for MDP clocks */ 928 + regmap_update_bits(regmap, DISP_CC_MISC_CMD, 0x10, 0x10); 929 + } 930 + 931 + 932 + static struct qcom_cc_driver_data disp_cc_milos_driver_data = { 933 + .alpha_plls = disp_cc_milos_plls, 934 + .num_alpha_plls = ARRAY_SIZE(disp_cc_milos_plls), 935 + .clk_cbcrs = disp_cc_milos_critical_cbcrs, 936 + .num_clk_cbcrs = ARRAY_SIZE(disp_cc_milos_critical_cbcrs), 937 + .clk_regs_configure = disp_cc_milos_clk_regs_configure, 938 + }; 939 + 940 + static struct qcom_cc_desc disp_cc_milos_desc = { 941 + .config = &disp_cc_milos_regmap_config, 942 + .clks = disp_cc_milos_clocks, 943 + .num_clks = ARRAY_SIZE(disp_cc_milos_clocks), 944 + .resets = disp_cc_milos_resets, 945 + .num_resets = ARRAY_SIZE(disp_cc_milos_resets), 946 + .gdscs = disp_cc_milos_gdscs, 947 + .num_gdscs = ARRAY_SIZE(disp_cc_milos_gdscs), 948 + .use_rpm = true, 949 + .driver_data = &disp_cc_milos_driver_data, 950 + }; 951 + 952 + static const struct of_device_id disp_cc_milos_match_table[] = { 953 + { .compatible = "qcom,milos-dispcc" }, 954 + { } 955 + }; 956 + MODULE_DEVICE_TABLE(of, disp_cc_milos_match_table); 957 + 958 + static int disp_cc_milos_probe(struct platform_device *pdev) 959 + { 960 + return qcom_cc_probe(pdev, &disp_cc_milos_desc); 961 + } 962 + 963 + static struct platform_driver disp_cc_milos_driver = { 964 + .probe = disp_cc_milos_probe, 965 + .driver = { 966 + .name = "disp_cc-milos", 967 + .of_match_table = disp_cc_milos_match_table, 968 + }, 969 + }; 970 + 971 + module_platform_driver(disp_cc_milos_driver); 972 + 973 + MODULE_DESCRIPTION("QTI DISP_CC Milos Driver"); 974 + MODULE_LICENSE("GPL");
+792
drivers/clk/qcom/dispcc-qcs615.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #include <linux/clk-provider.h> 7 + #include <linux/module.h> 8 + #include <linux/mod_devicetable.h> 9 + #include <linux/of.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/regmap.h> 12 + 13 + #include <dt-bindings/clock/qcom,qcs615-dispcc.h> 14 + 15 + #include "clk-alpha-pll.h" 16 + #include "clk-branch.h" 17 + #include "clk-pll.h" 18 + #include "clk-rcg.h" 19 + #include "clk-regmap.h" 20 + #include "clk-regmap-divider.h" 21 + #include "clk-regmap-mux.h" 22 + #include "common.h" 23 + #include "gdsc.h" 24 + #include "reset.h" 25 + 26 + enum { 27 + DT_BI_TCXO, 28 + DT_GPLL0, 29 + DT_DSI0_PHY_PLL_OUT_BYTECLK, 30 + DT_DSI0_PHY_PLL_OUT_DSICLK, 31 + DT_DSI1_PHY_PLL_OUT_DSICLK, 32 + DT_DP_PHY_PLL_LINK_CLK, 33 + DT_DP_PHY_PLL_VCO_DIV_CLK, 34 + }; 35 + 36 + enum { 37 + P_BI_TCXO, 38 + P_DISP_CC_PLL0_OUT_MAIN, 39 + P_DP_PHY_PLL_LINK_CLK, 40 + P_DP_PHY_PLL_VCO_DIV_CLK, 41 + P_DSI0_PHY_PLL_OUT_BYTECLK, 42 + P_DSI0_PHY_PLL_OUT_DSICLK, 43 + P_DSI1_PHY_PLL_OUT_DSICLK, 44 + P_GPLL0_OUT_MAIN, 45 + }; 46 + 47 + static const struct pll_vco disp_cc_pll_vco[] = { 48 + { 500000000, 1000000000, 2 }, 49 + }; 50 + 51 + /* 576MHz configuration VCO - 2 */ 52 + static struct alpha_pll_config disp_cc_pll0_config = { 53 + .l = 0x1e, 54 + .vco_val = BIT(21), 55 + .vco_mask = GENMASK(21, 20), 56 + .main_output_mask = BIT(0), 57 + .config_ctl_val = 0x4001055b, 58 + .test_ctl_hi_val = 0x1, 59 + .test_ctl_hi_mask = 0x1, 60 + }; 61 + 62 + static struct clk_alpha_pll disp_cc_pll0 = { 63 + .offset = 0x0, 64 + .config = &disp_cc_pll0_config, 65 + .vco_table = disp_cc_pll_vco, 66 + .num_vco = ARRAY_SIZE(disp_cc_pll_vco), 67 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 68 + .clkr = { 69 + .hw.init = &(const struct clk_init_data) { 70 + .name = "disp_cc_pll0", 71 + .parent_data = &(const struct clk_parent_data) { 72 + .index = DT_BI_TCXO, 73 + }, 74 + .num_parents = 1, 75 + .ops = &clk_alpha_pll_slew_ops, 76 + }, 77 + }, 78 + }; 79 + 80 + static const struct parent_map disp_cc_parent_map_0[] = { 81 + { P_BI_TCXO, 0 }, 82 + { P_DP_PHY_PLL_LINK_CLK, 1 }, 83 + { P_DP_PHY_PLL_VCO_DIV_CLK, 2 }, 84 + }; 85 + 86 + static const struct clk_parent_data disp_cc_parent_data_0[] = { 87 + { .index = DT_BI_TCXO }, 88 + { .index = DT_DP_PHY_PLL_LINK_CLK }, 89 + { .index = DT_DP_PHY_PLL_VCO_DIV_CLK }, 90 + }; 91 + 92 + static const struct parent_map disp_cc_parent_map_1[] = { 93 + { P_BI_TCXO, 0 }, 94 + }; 95 + 96 + static const struct clk_parent_data disp_cc_parent_data_1[] = { 97 + { .index = DT_BI_TCXO }, 98 + }; 99 + 100 + static const struct parent_map disp_cc_parent_map_2[] = { 101 + { P_BI_TCXO, 0 }, 102 + { P_DSI0_PHY_PLL_OUT_BYTECLK, 1 }, 103 + }; 104 + 105 + static const struct clk_parent_data disp_cc_parent_data_2[] = { 106 + { .index = DT_BI_TCXO }, 107 + { .index = DT_DSI0_PHY_PLL_OUT_BYTECLK }, 108 + }; 109 + 110 + static const struct parent_map disp_cc_parent_map_3[] = { 111 + { P_BI_TCXO, 0 }, 112 + { P_DISP_CC_PLL0_OUT_MAIN, 1 }, 113 + { P_GPLL0_OUT_MAIN, 4 }, 114 + }; 115 + 116 + static const struct clk_parent_data disp_cc_parent_data_3[] = { 117 + { .index = DT_BI_TCXO }, 118 + { .hw = &disp_cc_pll0.clkr.hw }, 119 + { .index = DT_GPLL0 }, 120 + }; 121 + 122 + static const struct parent_map disp_cc_parent_map_4[] = { 123 + { P_BI_TCXO, 0 }, 124 + { P_GPLL0_OUT_MAIN, 4 }, 125 + }; 126 + 127 + static const struct clk_parent_data disp_cc_parent_data_4[] = { 128 + { .index = DT_BI_TCXO }, 129 + { .index = DT_GPLL0 }, 130 + }; 131 + 132 + static const struct parent_map disp_cc_parent_map_5[] = { 133 + { P_BI_TCXO, 0 }, 134 + { P_DSI0_PHY_PLL_OUT_DSICLK, 1 }, 135 + { P_DSI1_PHY_PLL_OUT_DSICLK, 2 }, 136 + }; 137 + 138 + static const struct clk_parent_data disp_cc_parent_data_5[] = { 139 + { .index = DT_BI_TCXO }, 140 + { .index = DT_DSI0_PHY_PLL_OUT_DSICLK }, 141 + { .index = DT_DSI1_PHY_PLL_OUT_DSICLK }, 142 + }; 143 + 144 + static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = { 145 + F(19200000, P_BI_TCXO, 1, 0, 0), 146 + F(37500000, P_GPLL0_OUT_MAIN, 8, 0, 0), 147 + F(75000000, P_GPLL0_OUT_MAIN, 4, 0, 0), 148 + { } 149 + }; 150 + 151 + static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = { 152 + .cmd_rcgr = 0x2170, 153 + .mnd_width = 0, 154 + .hid_width = 5, 155 + .parent_map = disp_cc_parent_map_4, 156 + .freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src, 157 + .clkr.hw.init = &(const struct clk_init_data) { 158 + .name = "disp_cc_mdss_ahb_clk_src", 159 + .parent_data = disp_cc_parent_data_4, 160 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_4), 161 + .ops = &clk_rcg2_shared_ops, 162 + }, 163 + }; 164 + 165 + static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = { 166 + .cmd_rcgr = 0x20c0, 167 + .mnd_width = 0, 168 + .hid_width = 5, 169 + .parent_map = disp_cc_parent_map_2, 170 + .clkr.hw.init = &(const struct clk_init_data) { 171 + .name = "disp_cc_mdss_byte0_clk_src", 172 + .parent_data = disp_cc_parent_data_2, 173 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_2), 174 + .flags = CLK_SET_RATE_PARENT, 175 + .ops = &clk_byte2_ops, 176 + }, 177 + }; 178 + 179 + static const struct freq_tbl ftbl_disp_cc_mdss_dp_aux1_clk_src[] = { 180 + F(19200000, P_BI_TCXO, 1, 0, 0), 181 + { } 182 + }; 183 + 184 + static struct clk_rcg2 disp_cc_mdss_dp_aux_clk_src = { 185 + .cmd_rcgr = 0x2158, 186 + .mnd_width = 0, 187 + .hid_width = 5, 188 + .parent_map = disp_cc_parent_map_1, 189 + .freq_tbl = ftbl_disp_cc_mdss_dp_aux1_clk_src, 190 + .clkr.hw.init = &(struct clk_init_data){ 191 + .name = "disp_cc_mdss_dp_aux_clk_src", 192 + .parent_data = disp_cc_parent_data_1, 193 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_1), 194 + .ops = &clk_rcg2_shared_ops, 195 + }, 196 + }; 197 + 198 + static struct clk_rcg2 disp_cc_mdss_dp_crypto_clk_src = { 199 + .cmd_rcgr = 0x2110, 200 + .mnd_width = 0, 201 + .hid_width = 5, 202 + .parent_map = disp_cc_parent_map_0, 203 + .clkr.hw.init = &(const struct clk_init_data) { 204 + .name = "disp_cc_mdss_dp_crypto_clk_src", 205 + .parent_data = disp_cc_parent_data_0, 206 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), 207 + .ops = &clk_byte2_ops, 208 + }, 209 + }; 210 + 211 + static struct clk_rcg2 disp_cc_mdss_dp_link_clk_src = { 212 + .cmd_rcgr = 0x20f4, 213 + .mnd_width = 0, 214 + .hid_width = 5, 215 + .parent_map = disp_cc_parent_map_0, 216 + .clkr.hw.init = &(const struct clk_init_data) { 217 + .name = "disp_cc_mdss_dp_link_clk_src", 218 + .parent_data = disp_cc_parent_data_0, 219 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), 220 + .flags = CLK_SET_RATE_PARENT, 221 + .ops = &clk_byte2_ops, 222 + }, 223 + }; 224 + 225 + static struct clk_rcg2 disp_cc_mdss_dp_pixel1_clk_src = { 226 + .cmd_rcgr = 0x2140, 227 + .mnd_width = 16, 228 + .hid_width = 5, 229 + .parent_map = disp_cc_parent_map_0, 230 + .clkr.hw.init = &(const struct clk_init_data) { 231 + .name = "disp_cc_mdss_dp_pixel1_clk_src", 232 + .parent_data = disp_cc_parent_data_0, 233 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), 234 + .flags = CLK_SET_RATE_PARENT, 235 + .ops = &clk_dp_ops, 236 + }, 237 + }; 238 + 239 + static struct clk_rcg2 disp_cc_mdss_dp_pixel_clk_src = { 240 + .cmd_rcgr = 0x2128, 241 + .mnd_width = 16, 242 + .hid_width = 5, 243 + .parent_map = disp_cc_parent_map_0, 244 + .clkr.hw.init = &(const struct clk_init_data) { 245 + .name = "disp_cc_mdss_dp_pixel_clk_src", 246 + .parent_data = disp_cc_parent_data_0, 247 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), 248 + .flags = CLK_SET_RATE_PARENT, 249 + .ops = &clk_dp_ops, 250 + }, 251 + }; 252 + 253 + static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = { 254 + .cmd_rcgr = 0x20dc, 255 + .mnd_width = 0, 256 + .hid_width = 5, 257 + .parent_map = disp_cc_parent_map_2, 258 + .freq_tbl = ftbl_disp_cc_mdss_dp_aux1_clk_src, 259 + .clkr.hw.init = &(struct clk_init_data){ 260 + .name = "disp_cc_mdss_esc0_clk_src", 261 + .parent_data = disp_cc_parent_data_2, 262 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_2), 263 + .ops = &clk_rcg2_ops, 264 + }, 265 + }; 266 + 267 + static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = { 268 + F(19200000, P_BI_TCXO, 1, 0, 0), 269 + F(192000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 270 + F(256000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 271 + F(307000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0), 272 + { } 273 + }; 274 + 275 + static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = { 276 + .cmd_rcgr = 0x2078, 277 + .mnd_width = 0, 278 + .hid_width = 5, 279 + .parent_map = disp_cc_parent_map_3, 280 + .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src, 281 + .clkr.hw.init = &(const struct clk_init_data) { 282 + .name = "disp_cc_mdss_mdp_clk_src", 283 + .parent_data = disp_cc_parent_data_3, 284 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_3), 285 + .flags = CLK_SET_RATE_PARENT, 286 + .ops = &clk_rcg2_shared_ops, 287 + }, 288 + }; 289 + 290 + static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = { 291 + .cmd_rcgr = 0x2060, 292 + .mnd_width = 8, 293 + .hid_width = 5, 294 + .parent_map = disp_cc_parent_map_5, 295 + .clkr.hw.init = &(const struct clk_init_data) { 296 + .name = "disp_cc_mdss_pclk0_clk_src", 297 + .parent_data = disp_cc_parent_data_5, 298 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_5), 299 + .flags = CLK_SET_RATE_PARENT, 300 + .ops = &clk_pixel_ops, 301 + }, 302 + }; 303 + 304 + static struct clk_rcg2 disp_cc_mdss_rot_clk_src = { 305 + .cmd_rcgr = 0x2090, 306 + .mnd_width = 0, 307 + .hid_width = 5, 308 + .parent_map = disp_cc_parent_map_3, 309 + .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src, 310 + .clkr.hw.init = &(const struct clk_init_data) { 311 + .name = "disp_cc_mdss_rot_clk_src", 312 + .parent_data = disp_cc_parent_data_3, 313 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_3), 314 + .flags = CLK_SET_RATE_PARENT, 315 + .ops = &clk_rcg2_shared_ops, 316 + }, 317 + }; 318 + 319 + static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = { 320 + .cmd_rcgr = 0x20a8, 321 + .mnd_width = 0, 322 + .hid_width = 5, 323 + .parent_map = disp_cc_parent_map_1, 324 + .freq_tbl = ftbl_disp_cc_mdss_dp_aux1_clk_src, 325 + .clkr.hw.init = &(struct clk_init_data){ 326 + .name = "disp_cc_mdss_vsync_clk_src", 327 + .parent_data = disp_cc_parent_data_1, 328 + .num_parents = ARRAY_SIZE(disp_cc_parent_data_1), 329 + .ops = &clk_rcg2_shared_ops, 330 + }, 331 + }; 332 + 333 + static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = { 334 + .reg = 0x20d8, 335 + .shift = 0, 336 + .width = 2, 337 + .clkr.hw.init = &(const struct clk_init_data) { 338 + .name = "disp_cc_mdss_byte0_div_clk_src", 339 + .parent_hws = (const struct clk_hw*[]) { 340 + &disp_cc_mdss_byte0_clk_src.clkr.hw, 341 + }, 342 + .num_parents = 1, 343 + .ops = &clk_regmap_div_ro_ops, 344 + }, 345 + }; 346 + 347 + static struct clk_regmap_div disp_cc_mdss_dp_link_div_clk_src = { 348 + .reg = 0x210c, 349 + .shift = 0, 350 + .width = 2, 351 + .clkr.hw.init = &(const struct clk_init_data) { 352 + .name = "disp_cc_mdss_dp_link_div_clk_src", 353 + .parent_hws = (const struct clk_hw*[]) { 354 + &disp_cc_mdss_dp_link_clk_src.clkr.hw, 355 + }, 356 + .num_parents = 1, 357 + .flags = CLK_SET_RATE_PARENT, 358 + .ops = &clk_regmap_div_ro_ops, 359 + }, 360 + }; 361 + 362 + static struct clk_branch disp_cc_mdss_ahb_clk = { 363 + .halt_reg = 0x2048, 364 + .halt_check = BRANCH_HALT, 365 + .clkr = { 366 + .enable_reg = 0x2048, 367 + .enable_mask = BIT(0), 368 + .hw.init = &(const struct clk_init_data) { 369 + .name = "disp_cc_mdss_ahb_clk", 370 + .parent_hws = (const struct clk_hw*[]) { 371 + &disp_cc_mdss_ahb_clk_src.clkr.hw, 372 + }, 373 + .num_parents = 1, 374 + .flags = CLK_SET_RATE_PARENT, 375 + .ops = &clk_branch2_ops, 376 + }, 377 + }, 378 + }; 379 + 380 + static struct clk_branch disp_cc_mdss_byte0_clk = { 381 + .halt_reg = 0x2024, 382 + .halt_check = BRANCH_HALT, 383 + .clkr = { 384 + .enable_reg = 0x2024, 385 + .enable_mask = BIT(0), 386 + .hw.init = &(const struct clk_init_data) { 387 + .name = "disp_cc_mdss_byte0_clk", 388 + .parent_hws = (const struct clk_hw*[]) { 389 + &disp_cc_mdss_byte0_clk_src.clkr.hw, 390 + }, 391 + .num_parents = 1, 392 + .flags = CLK_SET_RATE_PARENT, 393 + .ops = &clk_branch2_ops, 394 + }, 395 + }, 396 + }; 397 + 398 + static struct clk_branch disp_cc_mdss_byte0_intf_clk = { 399 + .halt_reg = 0x2028, 400 + .halt_check = BRANCH_HALT, 401 + .clkr = { 402 + .enable_reg = 0x2028, 403 + .enable_mask = BIT(0), 404 + .hw.init = &(const struct clk_init_data) { 405 + .name = "disp_cc_mdss_byte0_intf_clk", 406 + .parent_hws = (const struct clk_hw*[]) { 407 + &disp_cc_mdss_byte0_div_clk_src.clkr.hw, 408 + }, 409 + .num_parents = 1, 410 + .flags = CLK_SET_RATE_PARENT, 411 + .ops = &clk_branch2_ops, 412 + }, 413 + }, 414 + }; 415 + 416 + static struct clk_branch disp_cc_mdss_dp_aux_clk = { 417 + .halt_reg = 0x2044, 418 + .halt_check = BRANCH_HALT, 419 + .clkr = { 420 + .enable_reg = 0x2044, 421 + .enable_mask = BIT(0), 422 + .hw.init = &(const struct clk_init_data) { 423 + .name = "disp_cc_mdss_dp_aux_clk", 424 + .parent_hws = (const struct clk_hw*[]) { 425 + &disp_cc_mdss_dp_aux_clk_src.clkr.hw, 426 + }, 427 + .num_parents = 1, 428 + .flags = CLK_SET_RATE_PARENT, 429 + .ops = &clk_branch2_ops, 430 + }, 431 + }, 432 + }; 433 + 434 + static struct clk_branch disp_cc_mdss_dp_crypto_clk = { 435 + .halt_reg = 0x2038, 436 + .halt_check = BRANCH_HALT, 437 + .clkr = { 438 + .enable_reg = 0x2038, 439 + .enable_mask = BIT(0), 440 + .hw.init = &(const struct clk_init_data) { 441 + .name = "disp_cc_mdss_dp_crypto_clk", 442 + .parent_hws = (const struct clk_hw*[]) { 443 + &disp_cc_mdss_dp_crypto_clk_src.clkr.hw, 444 + }, 445 + .num_parents = 1, 446 + .flags = CLK_SET_RATE_PARENT, 447 + .ops = &clk_branch2_ops, 448 + }, 449 + }, 450 + }; 451 + 452 + static struct clk_branch disp_cc_mdss_dp_link_clk = { 453 + .halt_reg = 0x2030, 454 + .halt_check = BRANCH_HALT, 455 + .clkr = { 456 + .enable_reg = 0x2030, 457 + .enable_mask = BIT(0), 458 + .hw.init = &(const struct clk_init_data) { 459 + .name = "disp_cc_mdss_dp_link_clk", 460 + .parent_hws = (const struct clk_hw*[]) { 461 + &disp_cc_mdss_dp_link_clk_src.clkr.hw, 462 + }, 463 + .num_parents = 1, 464 + .flags = CLK_SET_RATE_PARENT, 465 + .ops = &clk_branch2_ops, 466 + }, 467 + }, 468 + }; 469 + 470 + static struct clk_branch disp_cc_mdss_dp_link_intf_clk = { 471 + .halt_reg = 0x2034, 472 + .halt_check = BRANCH_HALT, 473 + .clkr = { 474 + .enable_reg = 0x2034, 475 + .enable_mask = BIT(0), 476 + .hw.init = &(const struct clk_init_data) { 477 + .name = "disp_cc_mdss_dp_link_intf_clk", 478 + .parent_hws = (const struct clk_hw*[]) { 479 + &disp_cc_mdss_dp_link_div_clk_src.clkr.hw, 480 + }, 481 + .num_parents = 1, 482 + .flags = CLK_SET_RATE_PARENT, 483 + .ops = &clk_branch2_ops, 484 + }, 485 + }, 486 + }; 487 + 488 + static struct clk_branch disp_cc_mdss_dp_pixel1_clk = { 489 + .halt_reg = 0x2040, 490 + .halt_check = BRANCH_HALT, 491 + .clkr = { 492 + .enable_reg = 0x2040, 493 + .enable_mask = BIT(0), 494 + .hw.init = &(const struct clk_init_data) { 495 + .name = "disp_cc_mdss_dp_pixel1_clk", 496 + .parent_hws = (const struct clk_hw*[]) { 497 + &disp_cc_mdss_dp_pixel1_clk_src.clkr.hw, 498 + }, 499 + .num_parents = 1, 500 + .flags = CLK_SET_RATE_PARENT, 501 + .ops = &clk_branch2_ops, 502 + }, 503 + }, 504 + }; 505 + 506 + static struct clk_branch disp_cc_mdss_dp_pixel_clk = { 507 + .halt_reg = 0x203c, 508 + .halt_check = BRANCH_HALT, 509 + .clkr = { 510 + .enable_reg = 0x203c, 511 + .enable_mask = BIT(0), 512 + .hw.init = &(const struct clk_init_data) { 513 + .name = "disp_cc_mdss_dp_pixel_clk", 514 + .parent_hws = (const struct clk_hw*[]) { 515 + &disp_cc_mdss_dp_pixel_clk_src.clkr.hw, 516 + }, 517 + .num_parents = 1, 518 + .flags = CLK_SET_RATE_PARENT, 519 + .ops = &clk_branch2_ops, 520 + }, 521 + }, 522 + }; 523 + 524 + static struct clk_branch disp_cc_mdss_esc0_clk = { 525 + .halt_reg = 0x202c, 526 + .halt_check = BRANCH_HALT, 527 + .clkr = { 528 + .enable_reg = 0x202c, 529 + .enable_mask = BIT(0), 530 + .hw.init = &(const struct clk_init_data) { 531 + .name = "disp_cc_mdss_esc0_clk", 532 + .parent_hws = (const struct clk_hw*[]) { 533 + &disp_cc_mdss_esc0_clk_src.clkr.hw, 534 + }, 535 + .num_parents = 1, 536 + .flags = CLK_SET_RATE_PARENT, 537 + .ops = &clk_branch2_ops, 538 + }, 539 + }, 540 + }; 541 + 542 + static struct clk_branch disp_cc_mdss_mdp_clk = { 543 + .halt_reg = 0x2008, 544 + .halt_check = BRANCH_HALT, 545 + .clkr = { 546 + .enable_reg = 0x2008, 547 + .enable_mask = BIT(0), 548 + .hw.init = &(const struct clk_init_data) { 549 + .name = "disp_cc_mdss_mdp_clk", 550 + .parent_hws = (const struct clk_hw*[]) { 551 + &disp_cc_mdss_mdp_clk_src.clkr.hw, 552 + }, 553 + .num_parents = 1, 554 + .flags = CLK_SET_RATE_PARENT, 555 + .ops = &clk_branch2_ops, 556 + }, 557 + }, 558 + }; 559 + 560 + static struct clk_branch disp_cc_mdss_mdp_lut_clk = { 561 + .halt_reg = 0x2018, 562 + .halt_check = BRANCH_HALT, 563 + .clkr = { 564 + .enable_reg = 0x2018, 565 + .enable_mask = BIT(0), 566 + .hw.init = &(const struct clk_init_data) { 567 + .name = "disp_cc_mdss_mdp_lut_clk", 568 + .parent_hws = (const struct clk_hw*[]) { 569 + &disp_cc_mdss_mdp_clk_src.clkr.hw, 570 + }, 571 + .num_parents = 1, 572 + .flags = CLK_SET_RATE_PARENT, 573 + .ops = &clk_branch2_ops, 574 + }, 575 + }, 576 + }; 577 + 578 + static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = { 579 + .halt_reg = 0x4004, 580 + .halt_check = BRANCH_HALT_VOTED, 581 + .clkr = { 582 + .enable_reg = 0x4004, 583 + .enable_mask = BIT(0), 584 + .hw.init = &(const struct clk_init_data) { 585 + .name = "disp_cc_mdss_non_gdsc_ahb_clk", 586 + .parent_hws = (const struct clk_hw*[]) { 587 + &disp_cc_mdss_ahb_clk_src.clkr.hw, 588 + }, 589 + .num_parents = 1, 590 + .flags = CLK_SET_RATE_PARENT, 591 + .ops = &clk_branch2_ops, 592 + }, 593 + }, 594 + }; 595 + 596 + static struct clk_branch disp_cc_mdss_pclk0_clk = { 597 + .halt_reg = 0x2004, 598 + .halt_check = BRANCH_HALT, 599 + .clkr = { 600 + .enable_reg = 0x2004, 601 + .enable_mask = BIT(0), 602 + .hw.init = &(const struct clk_init_data) { 603 + .name = "disp_cc_mdss_pclk0_clk", 604 + .parent_hws = (const struct clk_hw*[]) { 605 + &disp_cc_mdss_pclk0_clk_src.clkr.hw, 606 + }, 607 + .num_parents = 1, 608 + .flags = CLK_SET_RATE_PARENT, 609 + .ops = &clk_branch2_ops, 610 + }, 611 + }, 612 + }; 613 + 614 + static struct clk_branch disp_cc_mdss_rot_clk = { 615 + .halt_reg = 0x2010, 616 + .halt_check = BRANCH_HALT, 617 + .clkr = { 618 + .enable_reg = 0x2010, 619 + .enable_mask = BIT(0), 620 + .hw.init = &(const struct clk_init_data) { 621 + .name = "disp_cc_mdss_rot_clk", 622 + .parent_hws = (const struct clk_hw*[]) { 623 + &disp_cc_mdss_rot_clk_src.clkr.hw, 624 + }, 625 + .num_parents = 1, 626 + .flags = CLK_SET_RATE_PARENT, 627 + .ops = &clk_branch2_ops, 628 + }, 629 + }, 630 + }; 631 + 632 + static struct clk_branch disp_cc_mdss_rscc_ahb_clk = { 633 + .halt_reg = 0x400c, 634 + .halt_check = BRANCH_HALT, 635 + .clkr = { 636 + .enable_reg = 0x400c, 637 + .enable_mask = BIT(0), 638 + .hw.init = &(const struct clk_init_data) { 639 + .name = "disp_cc_mdss_rscc_ahb_clk", 640 + .parent_hws = (const struct clk_hw*[]) { 641 + &disp_cc_mdss_ahb_clk_src.clkr.hw, 642 + }, 643 + .num_parents = 1, 644 + .flags = CLK_SET_RATE_PARENT, 645 + .ops = &clk_branch2_ops, 646 + }, 647 + }, 648 + }; 649 + 650 + static struct clk_branch disp_cc_mdss_rscc_vsync_clk = { 651 + .halt_reg = 0x4008, 652 + .halt_check = BRANCH_HALT, 653 + .clkr = { 654 + .enable_reg = 0x4008, 655 + .enable_mask = BIT(0), 656 + .hw.init = &(const struct clk_init_data) { 657 + .name = "disp_cc_mdss_rscc_vsync_clk", 658 + .parent_hws = (const struct clk_hw*[]) { 659 + &disp_cc_mdss_vsync_clk_src.clkr.hw, 660 + }, 661 + .num_parents = 1, 662 + .flags = CLK_SET_RATE_PARENT, 663 + .ops = &clk_branch2_ops, 664 + }, 665 + }, 666 + }; 667 + 668 + static struct clk_branch disp_cc_mdss_vsync_clk = { 669 + .halt_reg = 0x2020, 670 + .halt_check = BRANCH_HALT, 671 + .clkr = { 672 + .enable_reg = 0x2020, 673 + .enable_mask = BIT(0), 674 + .hw.init = &(const struct clk_init_data) { 675 + .name = "disp_cc_mdss_vsync_clk", 676 + .parent_hws = (const struct clk_hw*[]) { 677 + &disp_cc_mdss_vsync_clk_src.clkr.hw, 678 + }, 679 + .num_parents = 1, 680 + .flags = CLK_SET_RATE_PARENT, 681 + .ops = &clk_branch2_ops, 682 + }, 683 + }, 684 + }; 685 + 686 + static struct gdsc mdss_core_gdsc = { 687 + .gdscr = 0x3000, 688 + .en_rest_wait_val = 0x2, 689 + .en_few_wait_val = 0x2, 690 + .clk_dis_wait_val = 0xf, 691 + .pd = { 692 + .name = "mdss_core_gdsc", 693 + }, 694 + .pwrsts = PWRSTS_OFF_ON, 695 + .flags = HW_CTRL | POLL_CFG_GDSCR, 696 + }; 697 + 698 + static struct clk_regmap *disp_cc_qcs615_clocks[] = { 699 + [DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr, 700 + [DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr, 701 + [DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr, 702 + [DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr, 703 + [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC] = &disp_cc_mdss_byte0_div_clk_src.clkr, 704 + [DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr, 705 + [DISP_CC_MDSS_DP_AUX_CLK] = &disp_cc_mdss_dp_aux_clk.clkr, 706 + [DISP_CC_MDSS_DP_AUX_CLK_SRC] = &disp_cc_mdss_dp_aux_clk_src.clkr, 707 + [DISP_CC_MDSS_DP_CRYPTO_CLK] = &disp_cc_mdss_dp_crypto_clk.clkr, 708 + [DISP_CC_MDSS_DP_CRYPTO_CLK_SRC] = &disp_cc_mdss_dp_crypto_clk_src.clkr, 709 + [DISP_CC_MDSS_DP_LINK_CLK] = &disp_cc_mdss_dp_link_clk.clkr, 710 + [DISP_CC_MDSS_DP_LINK_CLK_SRC] = &disp_cc_mdss_dp_link_clk_src.clkr, 711 + [DISP_CC_MDSS_DP_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dp_link_div_clk_src.clkr, 712 + [DISP_CC_MDSS_DP_LINK_INTF_CLK] = &disp_cc_mdss_dp_link_intf_clk.clkr, 713 + [DISP_CC_MDSS_DP_PIXEL1_CLK] = &disp_cc_mdss_dp_pixel1_clk.clkr, 714 + [DISP_CC_MDSS_DP_PIXEL1_CLK_SRC] = &disp_cc_mdss_dp_pixel1_clk_src.clkr, 715 + [DISP_CC_MDSS_DP_PIXEL_CLK] = &disp_cc_mdss_dp_pixel_clk.clkr, 716 + [DISP_CC_MDSS_DP_PIXEL_CLK_SRC] = &disp_cc_mdss_dp_pixel_clk_src.clkr, 717 + [DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr, 718 + [DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr, 719 + [DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr, 720 + [DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr, 721 + [DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr, 722 + [DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr, 723 + [DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr, 724 + [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr, 725 + [DISP_CC_MDSS_ROT_CLK] = &disp_cc_mdss_rot_clk.clkr, 726 + [DISP_CC_MDSS_ROT_CLK_SRC] = &disp_cc_mdss_rot_clk_src.clkr, 727 + [DISP_CC_MDSS_RSCC_AHB_CLK] = &disp_cc_mdss_rscc_ahb_clk.clkr, 728 + [DISP_CC_MDSS_RSCC_VSYNC_CLK] = &disp_cc_mdss_rscc_vsync_clk.clkr, 729 + [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr, 730 + [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr, 731 + [DISP_CC_PLL0] = &disp_cc_pll0.clkr, 732 + }; 733 + 734 + static struct gdsc *disp_cc_qcs615_gdscs[] = { 735 + [MDSS_CORE_GDSC] = &mdss_core_gdsc, 736 + }; 737 + 738 + static struct clk_alpha_pll *disp_cc_qcs615_plls[] = { 739 + &disp_cc_pll0, 740 + }; 741 + 742 + static u32 disp_cc_qcs615_critical_cbcrs[] = { 743 + 0x6054, /* DISP_CC_XO_CLK */ 744 + }; 745 + 746 + static const struct regmap_config disp_cc_qcs615_regmap_config = { 747 + .reg_bits = 32, 748 + .reg_stride = 4, 749 + .val_bits = 32, 750 + .max_register = 0x10000, 751 + .fast_io = true, 752 + }; 753 + 754 + static struct qcom_cc_driver_data disp_cc_qcs615_driver_data = { 755 + .alpha_plls = disp_cc_qcs615_plls, 756 + .num_alpha_plls = ARRAY_SIZE(disp_cc_qcs615_plls), 757 + .clk_cbcrs = disp_cc_qcs615_critical_cbcrs, 758 + .num_clk_cbcrs = ARRAY_SIZE(disp_cc_qcs615_critical_cbcrs), 759 + }; 760 + 761 + static const struct qcom_cc_desc disp_cc_qcs615_desc = { 762 + .config = &disp_cc_qcs615_regmap_config, 763 + .clks = disp_cc_qcs615_clocks, 764 + .num_clks = ARRAY_SIZE(disp_cc_qcs615_clocks), 765 + .gdscs = disp_cc_qcs615_gdscs, 766 + .num_gdscs = ARRAY_SIZE(disp_cc_qcs615_gdscs), 767 + .driver_data = &disp_cc_qcs615_driver_data, 768 + }; 769 + 770 + static const struct of_device_id disp_cc_qcs615_match_table[] = { 771 + { .compatible = "qcom,qcs615-dispcc" }, 772 + { } 773 + }; 774 + MODULE_DEVICE_TABLE(of, disp_cc_qcs615_match_table); 775 + 776 + static int disp_cc_qcs615_probe(struct platform_device *pdev) 777 + { 778 + return qcom_cc_probe(pdev, &disp_cc_qcs615_desc); 779 + } 780 + 781 + static struct platform_driver disp_cc_qcs615_driver = { 782 + .probe = disp_cc_qcs615_probe, 783 + .driver = { 784 + .name = "dispcc-qcs615", 785 + .of_match_table = disp_cc_qcs615_match_table, 786 + }, 787 + }; 788 + 789 + module_platform_driver(disp_cc_qcs615_driver); 790 + 791 + MODULE_DESCRIPTION("QTI DISPCC QCS615 Driver"); 792 + MODULE_LICENSE("GPL");
+5 -5
drivers/clk/qcom/dispcc-sm8750.c
··· 393 393 .name = "disp_cc_mdss_byte0_clk_src", 394 394 .parent_data = disp_cc_parent_data_1, 395 395 .num_parents = ARRAY_SIZE(disp_cc_parent_data_1), 396 - .flags = CLK_SET_RATE_PARENT, 396 + .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 397 397 .ops = &clk_byte2_ops, 398 398 }, 399 399 }; ··· 408 408 .name = "disp_cc_mdss_byte1_clk_src", 409 409 .parent_data = disp_cc_parent_data_1, 410 410 .num_parents = ARRAY_SIZE(disp_cc_parent_data_1), 411 - .flags = CLK_SET_RATE_PARENT, 411 + .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 412 412 .ops = &clk_byte2_ops, 413 413 }, 414 414 }; ··· 712 712 .name = "disp_cc_mdss_pclk0_clk_src", 713 713 .parent_data = disp_cc_parent_data_1, 714 714 .num_parents = ARRAY_SIZE(disp_cc_parent_data_1), 715 - .flags = CLK_SET_RATE_PARENT, 715 + .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 716 716 .ops = &clk_pixel_ops, 717 717 }, 718 718 }; ··· 727 727 .name = "disp_cc_mdss_pclk1_clk_src", 728 728 .parent_data = disp_cc_parent_data_1, 729 729 .num_parents = ARRAY_SIZE(disp_cc_parent_data_1), 730 - .flags = CLK_SET_RATE_PARENT, 730 + .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 731 731 .ops = &clk_pixel_ops, 732 732 }, 733 733 }; ··· 742 742 .name = "disp_cc_mdss_pclk2_clk_src", 743 743 .parent_data = disp_cc_parent_data_1, 744 744 .num_parents = ARRAY_SIZE(disp_cc_parent_data_1), 745 - .flags = CLK_SET_RATE_PARENT, 745 + .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 746 746 .ops = &clk_pixel_ops, 747 747 }, 748 748 };
+8 -6
drivers/clk/qcom/gcc-ipq4019.c
··· 125 125 * It looks up the frequency table and returns the next higher frequency 126 126 * supported in hardware. 127 127 */ 128 - static long clk_cpu_div_round_rate(struct clk_hw *hw, unsigned long rate, 129 - unsigned long *p_rate) 128 + static int clk_cpu_div_determine_rate(struct clk_hw *hw, 129 + struct clk_rate_request *req) 130 130 { 131 131 struct clk_fepll *pll = to_clk_fepll(hw); 132 132 struct clk_hw *p_hw; 133 133 const struct freq_tbl *f; 134 134 135 - f = qcom_find_freq(pll->freq_tbl, rate); 135 + f = qcom_find_freq(pll->freq_tbl, req->rate); 136 136 if (!f) 137 137 return -EINVAL; 138 138 139 139 p_hw = clk_hw_get_parent_by_index(hw, f->src); 140 - *p_rate = clk_hw_get_rate(p_hw); 140 + req->best_parent_rate = clk_hw_get_rate(p_hw); 141 141 142 - return f->freq; 142 + req->rate = f->freq; 143 + 144 + return 0; 143 145 }; 144 146 145 147 /* ··· 207 205 }; 208 206 209 207 static const struct clk_ops clk_regmap_cpu_div_ops = { 210 - .round_rate = clk_cpu_div_round_rate, 208 + .determine_rate = clk_cpu_div_determine_rate, 211 209 .set_rate = clk_cpu_div_set_rate, 212 210 .recalc_rate = clk_cpu_div_recalc_rate, 213 211 };
+2 -2
drivers/clk/qcom/gcc-ipq5018.c
··· 1371 1371 &gcc_xo_clk_src.clkr.hw, 1372 1372 }, 1373 1373 .num_parents = 1, 1374 - .flags = CLK_SET_RATE_PARENT, 1374 + .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 1375 1375 .ops = &clk_branch2_ops, 1376 1376 }, 1377 1377 }, ··· 3660 3660 [GCC_WCSS_AXI_S_ARES] = { 0x59008, 6 }, 3661 3661 [GCC_WCSS_Q6_BCR] = { 0x18004, 0 }, 3662 3662 [GCC_WCSSAON_RESET] = { 0x59010, 0}, 3663 - [GCC_GEPHY_MISC_ARES] = { 0x56004, 0 }, 3663 + [GCC_GEPHY_MISC_ARES] = { 0x56004, .bitmask = GENMASK(3, 0) }, 3664 3664 }; 3665 3665 3666 3666 static const struct of_device_id gcc_ipq5018_match_table[] = {
+3 -3
drivers/clk/qcom/gcc-ipq8074.c
··· 1895 1895 static const struct freq_multi_tbl ftbl_nss_port6_tx_clk_src[] = { 1896 1896 FMS(19200000, P_XO, 1, 0, 0), 1897 1897 FM(25000000, ftbl_nss_port6_tx_clk_src_25), 1898 - FMS(78125000, P_UNIPHY1_RX, 4, 0, 0), 1898 + FMS(78125000, P_UNIPHY2_TX, 4, 0, 0), 1899 1899 FM(125000000, ftbl_nss_port6_tx_clk_src_125), 1900 - FMS(156250000, P_UNIPHY1_RX, 2, 0, 0), 1901 - FMS(312500000, P_UNIPHY1_RX, 1, 0, 0), 1900 + FMS(156250000, P_UNIPHY2_TX, 2, 0, 0), 1901 + FMS(312500000, P_UNIPHY2_TX, 1, 0, 0), 1902 1902 { } 1903 1903 }; 1904 1904
+3225
drivers/clk/qcom/gcc-milos.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 5 + */ 6 + 7 + #include <linux/clk-provider.h> 8 + #include <linux/mod_devicetable.h> 9 + #include <linux/module.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/regmap.h> 12 + 13 + #include <dt-bindings/clock/qcom,milos-gcc.h> 14 + 15 + #include "clk-alpha-pll.h" 16 + #include "clk-branch.h" 17 + #include "clk-rcg.h" 18 + #include "clk-regmap-divider.h" 19 + #include "clk-regmap-mux.h" 20 + #include "gdsc.h" 21 + #include "reset.h" 22 + 23 + /* Need to match the order of clocks in DT binding */ 24 + enum { 25 + DT_BI_TCXO, 26 + DT_SLEEP_CLK, 27 + DT_PCIE_0_PIPE, 28 + DT_PCIE_1_PIPE, 29 + DT_UFS_PHY_RX_SYMBOL_0, 30 + DT_UFS_PHY_RX_SYMBOL_1, 31 + DT_UFS_PHY_TX_SYMBOL_0, 32 + DT_USB3_PHY_WRAPPER_GCC_USB30_PIPE, 33 + }; 34 + 35 + enum { 36 + P_BI_TCXO, 37 + P_GCC_GPLL0_OUT_EVEN, 38 + P_GCC_GPLL0_OUT_MAIN, 39 + P_GCC_GPLL0_OUT_ODD, 40 + P_GCC_GPLL2_OUT_MAIN, 41 + P_GCC_GPLL4_OUT_MAIN, 42 + P_GCC_GPLL6_OUT_MAIN, 43 + P_GCC_GPLL7_OUT_MAIN, 44 + P_GCC_GPLL9_OUT_MAIN, 45 + P_PCIE_0_PIPE_CLK, 46 + P_PCIE_1_PIPE_CLK, 47 + P_SLEEP_CLK, 48 + P_UFS_PHY_RX_SYMBOL_0_CLK, 49 + P_UFS_PHY_RX_SYMBOL_1_CLK, 50 + P_UFS_PHY_TX_SYMBOL_0_CLK, 51 + P_USB3_PHY_WRAPPER_GCC_USB30_PIPE_CLK, 52 + }; 53 + 54 + static struct clk_alpha_pll gcc_gpll0 = { 55 + .offset = 0x0, 56 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 57 + .clkr = { 58 + .enable_reg = 0x52020, 59 + .enable_mask = BIT(0), 60 + .hw.init = &(const struct clk_init_data) { 61 + .name = "gcc_gpll0", 62 + .parent_data = &(const struct clk_parent_data) { 63 + .index = DT_BI_TCXO, 64 + }, 65 + .num_parents = 1, 66 + .ops = &clk_alpha_pll_fixed_lucid_ole_ops, 67 + }, 68 + }, 69 + }; 70 + 71 + static const struct clk_div_table post_div_table_gcc_gpll0_out_even[] = { 72 + { 0x1, 2 }, 73 + { } 74 + }; 75 + 76 + static struct clk_alpha_pll_postdiv gcc_gpll0_out_even = { 77 + .offset = 0x0, 78 + .post_div_shift = 10, 79 + .post_div_table = post_div_table_gcc_gpll0_out_even, 80 + .num_post_div = ARRAY_SIZE(post_div_table_gcc_gpll0_out_even), 81 + .width = 4, 82 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 83 + .clkr.hw.init = &(const struct clk_init_data) { 84 + .name = "gcc_gpll0_out_even", 85 + .parent_hws = (const struct clk_hw*[]) { 86 + &gcc_gpll0.clkr.hw, 87 + }, 88 + .num_parents = 1, 89 + .ops = &clk_alpha_pll_postdiv_lucid_ole_ops, 90 + }, 91 + }; 92 + 93 + static struct clk_alpha_pll gcc_gpll2 = { 94 + .offset = 0x2000, 95 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 96 + .clkr = { 97 + .enable_reg = 0x52020, 98 + .enable_mask = BIT(2), 99 + .hw.init = &(const struct clk_init_data) { 100 + .name = "gcc_gpll2", 101 + .parent_data = &(const struct clk_parent_data) { 102 + .index = DT_BI_TCXO, 103 + }, 104 + .num_parents = 1, 105 + .ops = &clk_alpha_pll_fixed_lucid_ole_ops, 106 + }, 107 + }, 108 + }; 109 + 110 + static struct clk_alpha_pll gcc_gpll4 = { 111 + .offset = 0x4000, 112 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 113 + .clkr = { 114 + .enable_reg = 0x52020, 115 + .enable_mask = BIT(4), 116 + .hw.init = &(const struct clk_init_data) { 117 + .name = "gcc_gpll4", 118 + .parent_data = &(const struct clk_parent_data) { 119 + .index = DT_BI_TCXO, 120 + }, 121 + .num_parents = 1, 122 + .ops = &clk_alpha_pll_fixed_lucid_ole_ops, 123 + }, 124 + }, 125 + }; 126 + 127 + static struct clk_alpha_pll gcc_gpll6 = { 128 + .offset = 0x6000, 129 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 130 + .clkr = { 131 + .enable_reg = 0x52020, 132 + .enable_mask = BIT(6), 133 + .hw.init = &(const struct clk_init_data) { 134 + .name = "gcc_gpll6", 135 + .parent_data = &(const struct clk_parent_data) { 136 + .index = DT_BI_TCXO, 137 + }, 138 + .num_parents = 1, 139 + .ops = &clk_alpha_pll_fixed_lucid_ole_ops, 140 + }, 141 + }, 142 + }; 143 + 144 + static struct clk_alpha_pll gcc_gpll7 = { 145 + .offset = 0x7000, 146 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 147 + .clkr = { 148 + .enable_reg = 0x52020, 149 + .enable_mask = BIT(7), 150 + .hw.init = &(const struct clk_init_data) { 151 + .name = "gcc_gpll7", 152 + .parent_data = &(const struct clk_parent_data) { 153 + .index = DT_BI_TCXO, 154 + }, 155 + .num_parents = 1, 156 + .ops = &clk_alpha_pll_fixed_lucid_ole_ops, 157 + }, 158 + }, 159 + }; 160 + 161 + static struct clk_alpha_pll gcc_gpll9 = { 162 + .offset = 0x9000, 163 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 164 + .clkr = { 165 + .enable_reg = 0x52020, 166 + .enable_mask = BIT(9), 167 + .hw.init = &(const struct clk_init_data) { 168 + .name = "gcc_gpll9", 169 + .parent_data = &(const struct clk_parent_data) { 170 + .index = DT_BI_TCXO, 171 + }, 172 + .num_parents = 1, 173 + .ops = &clk_alpha_pll_fixed_lucid_ole_ops, 174 + }, 175 + }, 176 + }; 177 + 178 + static const struct parent_map gcc_parent_map_0[] = { 179 + { P_BI_TCXO, 0 }, 180 + { P_GCC_GPLL0_OUT_MAIN, 1 }, 181 + { P_GCC_GPLL0_OUT_EVEN, 6 }, 182 + }; 183 + 184 + static const struct clk_parent_data gcc_parent_data_0[] = { 185 + { .index = DT_BI_TCXO }, 186 + { .hw = &gcc_gpll0.clkr.hw }, 187 + { .hw = &gcc_gpll0_out_even.clkr.hw }, 188 + }; 189 + 190 + static const struct parent_map gcc_parent_map_1[] = { 191 + { P_BI_TCXO, 0 }, 192 + { P_GCC_GPLL0_OUT_MAIN, 1 }, 193 + { P_SLEEP_CLK, 5 }, 194 + { P_GCC_GPLL0_OUT_EVEN, 6 }, 195 + }; 196 + 197 + static const struct clk_parent_data gcc_parent_data_1[] = { 198 + { .index = DT_BI_TCXO }, 199 + { .hw = &gcc_gpll0.clkr.hw }, 200 + { .index = DT_SLEEP_CLK }, 201 + { .hw = &gcc_gpll0_out_even.clkr.hw }, 202 + }; 203 + 204 + static const struct parent_map gcc_parent_map_2[] = { 205 + { P_BI_TCXO, 0 }, 206 + { P_GCC_GPLL0_OUT_MAIN, 1 }, 207 + { P_GCC_GPLL4_OUT_MAIN, 5 }, 208 + { P_GCC_GPLL0_OUT_EVEN, 6 }, 209 + }; 210 + 211 + static const struct clk_parent_data gcc_parent_data_2[] = { 212 + { .index = DT_BI_TCXO }, 213 + { .hw = &gcc_gpll0.clkr.hw }, 214 + { .hw = &gcc_gpll4.clkr.hw }, 215 + { .hw = &gcc_gpll0_out_even.clkr.hw }, 216 + }; 217 + 218 + static const struct parent_map gcc_parent_map_3[] = { 219 + { P_BI_TCXO, 0 }, 220 + { P_SLEEP_CLK, 5 }, 221 + }; 222 + 223 + static const struct clk_parent_data gcc_parent_data_3[] = { 224 + { .index = DT_BI_TCXO }, 225 + { .index = DT_SLEEP_CLK }, 226 + }; 227 + 228 + static const struct parent_map gcc_parent_map_4[] = { 229 + { P_BI_TCXO, 0 }, 230 + { P_GCC_GPLL0_OUT_MAIN, 1 }, 231 + { P_GCC_GPLL6_OUT_MAIN, 2 }, 232 + { P_GCC_GPLL7_OUT_MAIN, 3 }, 233 + { P_GCC_GPLL0_OUT_EVEN, 6 }, 234 + }; 235 + 236 + static const struct clk_parent_data gcc_parent_data_4[] = { 237 + { .index = DT_BI_TCXO }, 238 + { .hw = &gcc_gpll0.clkr.hw }, 239 + { .hw = &gcc_gpll6.clkr.hw }, 240 + { .hw = &gcc_gpll7.clkr.hw }, 241 + { .hw = &gcc_gpll0_out_even.clkr.hw }, 242 + }; 243 + 244 + static const struct parent_map gcc_parent_map_5[] = { 245 + { P_BI_TCXO, 0 }, 246 + }; 247 + 248 + static const struct clk_parent_data gcc_parent_data_5[] = { 249 + { .index = DT_BI_TCXO }, 250 + }; 251 + 252 + static const struct parent_map gcc_parent_map_6[] = { 253 + { P_PCIE_0_PIPE_CLK, 0 }, 254 + { P_BI_TCXO, 2 }, 255 + }; 256 + 257 + static const struct clk_parent_data gcc_parent_data_6[] = { 258 + { .index = DT_PCIE_0_PIPE }, 259 + { .index = DT_BI_TCXO }, 260 + }; 261 + 262 + static const struct parent_map gcc_parent_map_7[] = { 263 + { P_PCIE_1_PIPE_CLK, 0 }, 264 + { P_BI_TCXO, 2 }, 265 + }; 266 + 267 + static const struct clk_parent_data gcc_parent_data_7[] = { 268 + { .index = DT_PCIE_1_PIPE }, 269 + { .index = DT_BI_TCXO }, 270 + }; 271 + 272 + static const struct parent_map gcc_parent_map_8[] = { 273 + { P_BI_TCXO, 0 }, 274 + { P_GCC_GPLL0_OUT_MAIN, 1 }, 275 + { P_GCC_GPLL7_OUT_MAIN, 2 }, 276 + { P_GCC_GPLL0_OUT_EVEN, 6 }, 277 + }; 278 + 279 + static const struct clk_parent_data gcc_parent_data_8[] = { 280 + { .index = DT_BI_TCXO }, 281 + { .hw = &gcc_gpll0.clkr.hw }, 282 + { .hw = &gcc_gpll7.clkr.hw }, 283 + { .hw = &gcc_gpll0_out_even.clkr.hw }, 284 + }; 285 + 286 + static const struct parent_map gcc_parent_map_9[] = { 287 + { P_BI_TCXO, 0 }, 288 + { P_GCC_GPLL0_OUT_MAIN, 1 }, 289 + { P_GCC_GPLL6_OUT_MAIN, 2 }, 290 + { P_GCC_GPLL0_OUT_ODD, 3 }, 291 + { P_GCC_GPLL2_OUT_MAIN, 4 }, 292 + { P_GCC_GPLL0_OUT_EVEN, 6 }, 293 + }; 294 + 295 + static const struct clk_parent_data gcc_parent_data_9[] = { 296 + { .index = DT_BI_TCXO }, 297 + { .hw = &gcc_gpll0.clkr.hw }, 298 + { .hw = &gcc_gpll6.clkr.hw }, 299 + { .hw = &gcc_gpll0.clkr.hw }, 300 + { .hw = &gcc_gpll2.clkr.hw }, 301 + { .hw = &gcc_gpll0_out_even.clkr.hw }, 302 + }; 303 + 304 + static const struct parent_map gcc_parent_map_10[] = { 305 + { P_BI_TCXO, 0 }, 306 + { P_GCC_GPLL0_OUT_MAIN, 1 }, 307 + { P_GCC_GPLL6_OUT_MAIN, 2 }, 308 + { P_GCC_GPLL0_OUT_ODD, 3 }, 309 + { P_GCC_GPLL0_OUT_EVEN, 6 }, 310 + }; 311 + 312 + static const struct clk_parent_data gcc_parent_data_10[] = { 313 + { .index = DT_BI_TCXO }, 314 + { .hw = &gcc_gpll0.clkr.hw }, 315 + { .hw = &gcc_gpll6.clkr.hw }, 316 + { .hw = &gcc_gpll0.clkr.hw }, 317 + { .hw = &gcc_gpll0_out_even.clkr.hw }, 318 + }; 319 + 320 + static const struct parent_map gcc_parent_map_11[] = { 321 + { P_BI_TCXO, 0 }, 322 + { P_GCC_GPLL0_OUT_MAIN, 1 }, 323 + { P_GCC_GPLL9_OUT_MAIN, 2 }, 324 + { P_GCC_GPLL4_OUT_MAIN, 5 }, 325 + { P_GCC_GPLL0_OUT_EVEN, 6 }, 326 + }; 327 + 328 + static const struct clk_parent_data gcc_parent_data_11[] = { 329 + { .index = DT_BI_TCXO }, 330 + { .hw = &gcc_gpll0.clkr.hw }, 331 + { .hw = &gcc_gpll9.clkr.hw }, 332 + { .hw = &gcc_gpll4.clkr.hw }, 333 + { .hw = &gcc_gpll0_out_even.clkr.hw }, 334 + }; 335 + 336 + static const struct parent_map gcc_parent_map_12[] = { 337 + { P_UFS_PHY_RX_SYMBOL_0_CLK, 0 }, 338 + { P_BI_TCXO, 2 }, 339 + }; 340 + 341 + static const struct clk_parent_data gcc_parent_data_12[] = { 342 + { .index = DT_UFS_PHY_RX_SYMBOL_0 }, 343 + { .index = DT_BI_TCXO }, 344 + }; 345 + 346 + static const struct parent_map gcc_parent_map_13[] = { 347 + { P_UFS_PHY_RX_SYMBOL_1_CLK, 0 }, 348 + { P_BI_TCXO, 2 }, 349 + }; 350 + 351 + static const struct clk_parent_data gcc_parent_data_13[] = { 352 + { .index = DT_UFS_PHY_RX_SYMBOL_1 }, 353 + { .index = DT_BI_TCXO }, 354 + }; 355 + 356 + static const struct parent_map gcc_parent_map_14[] = { 357 + { P_UFS_PHY_TX_SYMBOL_0_CLK, 0 }, 358 + { P_BI_TCXO, 2 }, 359 + }; 360 + 361 + static const struct clk_parent_data gcc_parent_data_14[] = { 362 + { .index = DT_UFS_PHY_TX_SYMBOL_0 }, 363 + { .index = DT_BI_TCXO }, 364 + }; 365 + 366 + static const struct parent_map gcc_parent_map_15[] = { 367 + { P_USB3_PHY_WRAPPER_GCC_USB30_PIPE_CLK, 0 }, 368 + { P_BI_TCXO, 2 }, 369 + }; 370 + 371 + static const struct clk_parent_data gcc_parent_data_15[] = { 372 + { .index = DT_USB3_PHY_WRAPPER_GCC_USB30_PIPE }, 373 + { .index = DT_BI_TCXO }, 374 + }; 375 + 376 + static struct clk_regmap_mux gcc_pcie_0_pipe_clk_src = { 377 + .reg = 0x6b070, 378 + .shift = 0, 379 + .width = 2, 380 + .parent_map = gcc_parent_map_6, 381 + .clkr = { 382 + .hw.init = &(const struct clk_init_data) { 383 + .name = "gcc_pcie_0_pipe_clk_src", 384 + .parent_data = gcc_parent_data_6, 385 + .num_parents = ARRAY_SIZE(gcc_parent_data_6), 386 + .ops = &clk_regmap_mux_closest_ops, 387 + }, 388 + }, 389 + }; 390 + 391 + static struct clk_regmap_mux gcc_pcie_1_pipe_clk_src = { 392 + .reg = 0x9006c, 393 + .shift = 0, 394 + .width = 2, 395 + .parent_map = gcc_parent_map_7, 396 + .clkr = { 397 + .hw.init = &(const struct clk_init_data) { 398 + .name = "gcc_pcie_1_pipe_clk_src", 399 + .parent_data = gcc_parent_data_7, 400 + .num_parents = ARRAY_SIZE(gcc_parent_data_7), 401 + .ops = &clk_regmap_mux_closest_ops, 402 + }, 403 + }, 404 + }; 405 + 406 + static struct clk_regmap_mux gcc_ufs_phy_rx_symbol_0_clk_src = { 407 + .reg = 0x77064, 408 + .shift = 0, 409 + .width = 2, 410 + .parent_map = gcc_parent_map_12, 411 + .clkr = { 412 + .hw.init = &(const struct clk_init_data) { 413 + .name = "gcc_ufs_phy_rx_symbol_0_clk_src", 414 + .parent_data = gcc_parent_data_12, 415 + .num_parents = ARRAY_SIZE(gcc_parent_data_12), 416 + .ops = &clk_regmap_mux_closest_ops, 417 + }, 418 + }, 419 + }; 420 + 421 + static struct clk_regmap_mux gcc_ufs_phy_rx_symbol_1_clk_src = { 422 + .reg = 0x770e0, 423 + .shift = 0, 424 + .width = 2, 425 + .parent_map = gcc_parent_map_13, 426 + .clkr = { 427 + .hw.init = &(const struct clk_init_data) { 428 + .name = "gcc_ufs_phy_rx_symbol_1_clk_src", 429 + .parent_data = gcc_parent_data_13, 430 + .num_parents = ARRAY_SIZE(gcc_parent_data_13), 431 + .ops = &clk_regmap_mux_closest_ops, 432 + }, 433 + }, 434 + }; 435 + 436 + static struct clk_regmap_mux gcc_ufs_phy_tx_symbol_0_clk_src = { 437 + .reg = 0x77054, 438 + .shift = 0, 439 + .width = 2, 440 + .parent_map = gcc_parent_map_14, 441 + .clkr = { 442 + .hw.init = &(const struct clk_init_data) { 443 + .name = "gcc_ufs_phy_tx_symbol_0_clk_src", 444 + .parent_data = gcc_parent_data_14, 445 + .num_parents = ARRAY_SIZE(gcc_parent_data_14), 446 + .ops = &clk_regmap_mux_closest_ops, 447 + }, 448 + }, 449 + }; 450 + 451 + static struct clk_regmap_mux gcc_usb3_prim_phy_pipe_clk_src = { 452 + .reg = 0x3906c, 453 + .shift = 0, 454 + .width = 2, 455 + .parent_map = gcc_parent_map_15, 456 + .clkr = { 457 + .hw.init = &(const struct clk_init_data) { 458 + .name = "gcc_usb3_prim_phy_pipe_clk_src", 459 + .parent_data = gcc_parent_data_15, 460 + .num_parents = ARRAY_SIZE(gcc_parent_data_15), 461 + .ops = &clk_regmap_mux_closest_ops, 462 + }, 463 + }, 464 + }; 465 + 466 + static const struct freq_tbl ftbl_gcc_gp1_clk_src[] = { 467 + F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0), 468 + F(100000000, P_GCC_GPLL0_OUT_MAIN, 6, 0, 0), 469 + F(200000000, P_GCC_GPLL0_OUT_MAIN, 3, 0, 0), 470 + { } 471 + }; 472 + 473 + static struct clk_rcg2 gcc_gp1_clk_src = { 474 + .cmd_rcgr = 0x64004, 475 + .mnd_width = 16, 476 + .hid_width = 5, 477 + .parent_map = gcc_parent_map_1, 478 + .freq_tbl = ftbl_gcc_gp1_clk_src, 479 + .clkr.hw.init = &(const struct clk_init_data) { 480 + .name = "gcc_gp1_clk_src", 481 + .parent_data = gcc_parent_data_1, 482 + .num_parents = ARRAY_SIZE(gcc_parent_data_1), 483 + .ops = &clk_rcg2_shared_ops, 484 + }, 485 + }; 486 + 487 + static struct clk_rcg2 gcc_gp2_clk_src = { 488 + .cmd_rcgr = 0x65004, 489 + .mnd_width = 16, 490 + .hid_width = 5, 491 + .parent_map = gcc_parent_map_1, 492 + .freq_tbl = ftbl_gcc_gp1_clk_src, 493 + .clkr.hw.init = &(const struct clk_init_data) { 494 + .name = "gcc_gp2_clk_src", 495 + .parent_data = gcc_parent_data_1, 496 + .num_parents = ARRAY_SIZE(gcc_parent_data_1), 497 + .ops = &clk_rcg2_shared_ops, 498 + }, 499 + }; 500 + 501 + static struct clk_rcg2 gcc_gp3_clk_src = { 502 + .cmd_rcgr = 0x66004, 503 + .mnd_width = 16, 504 + .hid_width = 5, 505 + .parent_map = gcc_parent_map_1, 506 + .freq_tbl = ftbl_gcc_gp1_clk_src, 507 + .clkr.hw.init = &(const struct clk_init_data) { 508 + .name = "gcc_gp3_clk_src", 509 + .parent_data = gcc_parent_data_1, 510 + .num_parents = ARRAY_SIZE(gcc_parent_data_1), 511 + .ops = &clk_rcg2_shared_ops, 512 + }, 513 + }; 514 + 515 + static const struct freq_tbl ftbl_gcc_pcie_0_aux_clk_src[] = { 516 + F(19200000, P_BI_TCXO, 1, 0, 0), 517 + { } 518 + }; 519 + 520 + static struct clk_rcg2 gcc_pcie_0_aux_clk_src = { 521 + .cmd_rcgr = 0x6b074, 522 + .mnd_width = 16, 523 + .hid_width = 5, 524 + .parent_map = gcc_parent_map_3, 525 + .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src, 526 + .clkr.hw.init = &(const struct clk_init_data) { 527 + .name = "gcc_pcie_0_aux_clk_src", 528 + .parent_data = gcc_parent_data_3, 529 + .num_parents = ARRAY_SIZE(gcc_parent_data_3), 530 + .ops = &clk_rcg2_shared_ops, 531 + }, 532 + }; 533 + 534 + static const struct freq_tbl ftbl_gcc_pcie_0_phy_rchng_clk_src[] = { 535 + F(19200000, P_BI_TCXO, 1, 0, 0), 536 + F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0), 537 + { } 538 + }; 539 + 540 + static struct clk_rcg2 gcc_pcie_0_phy_rchng_clk_src = { 541 + .cmd_rcgr = 0x6b058, 542 + .mnd_width = 0, 543 + .hid_width = 5, 544 + .parent_map = gcc_parent_map_0, 545 + .freq_tbl = ftbl_gcc_pcie_0_phy_rchng_clk_src, 546 + .clkr.hw.init = &(const struct clk_init_data) { 547 + .name = "gcc_pcie_0_phy_rchng_clk_src", 548 + .parent_data = gcc_parent_data_0, 549 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 550 + .ops = &clk_rcg2_shared_ops, 551 + }, 552 + }; 553 + 554 + static struct clk_rcg2 gcc_pcie_1_aux_clk_src = { 555 + .cmd_rcgr = 0x90070, 556 + .mnd_width = 16, 557 + .hid_width = 5, 558 + .parent_map = gcc_parent_map_3, 559 + .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src, 560 + .clkr.hw.init = &(const struct clk_init_data) { 561 + .name = "gcc_pcie_1_aux_clk_src", 562 + .parent_data = gcc_parent_data_3, 563 + .num_parents = ARRAY_SIZE(gcc_parent_data_3), 564 + .ops = &clk_rcg2_shared_ops, 565 + }, 566 + }; 567 + 568 + static struct clk_rcg2 gcc_pcie_1_phy_rchng_clk_src = { 569 + .cmd_rcgr = 0x90054, 570 + .mnd_width = 0, 571 + .hid_width = 5, 572 + .parent_map = gcc_parent_map_0, 573 + .freq_tbl = ftbl_gcc_pcie_0_phy_rchng_clk_src, 574 + .clkr.hw.init = &(const struct clk_init_data) { 575 + .name = "gcc_pcie_1_phy_rchng_clk_src", 576 + .parent_data = gcc_parent_data_0, 577 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 578 + .ops = &clk_rcg2_shared_ops, 579 + }, 580 + }; 581 + 582 + static const struct freq_tbl ftbl_gcc_pdm2_clk_src[] = { 583 + F(60000000, P_GCC_GPLL0_OUT_MAIN, 10, 0, 0), 584 + { } 585 + }; 586 + 587 + static struct clk_rcg2 gcc_pdm2_clk_src = { 588 + .cmd_rcgr = 0x33010, 589 + .mnd_width = 0, 590 + .hid_width = 5, 591 + .parent_map = gcc_parent_map_0, 592 + .freq_tbl = ftbl_gcc_pdm2_clk_src, 593 + .clkr.hw.init = &(const struct clk_init_data) { 594 + .name = "gcc_pdm2_clk_src", 595 + .parent_data = gcc_parent_data_0, 596 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 597 + .ops = &clk_rcg2_shared_ops, 598 + }, 599 + }; 600 + 601 + static const struct freq_tbl ftbl_gcc_qupv3_wrap0_qspi_ref_clk_src[] = { 602 + F(7372800, P_GCC_GPLL0_OUT_EVEN, 1, 384, 15625), 603 + F(14745600, P_GCC_GPLL0_OUT_EVEN, 1, 768, 15625), 604 + F(19200000, P_BI_TCXO, 1, 0, 0), 605 + F(29491200, P_GCC_GPLL0_OUT_EVEN, 1, 1536, 15625), 606 + F(32000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 75), 607 + F(48000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 25), 608 + F(51200000, P_GCC_GPLL0_OUT_EVEN, 1, 64, 375), 609 + F(64000000, P_GCC_GPLL0_OUT_EVEN, 1, 16, 75), 610 + F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0), 611 + F(80000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 15), 612 + F(96000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 25), 613 + F(100000000, P_GCC_GPLL0_OUT_MAIN, 6, 0, 0), 614 + F(102400000, P_GCC_GPLL0_OUT_EVEN, 1, 128, 375), 615 + F(112000000, P_GCC_GPLL0_OUT_EVEN, 1, 28, 75), 616 + F(117964800, P_GCC_GPLL0_OUT_EVEN, 1, 6144, 15625), 617 + F(120000000, P_GCC_GPLL0_OUT_MAIN, 5, 0, 0), 618 + F(150000000, P_GCC_GPLL0_OUT_EVEN, 2, 0, 0), 619 + F(200000000, P_GCC_GPLL0_OUT_MAIN, 3, 0, 0), 620 + { } 621 + }; 622 + 623 + static struct clk_init_data gcc_qupv3_wrap0_qspi_ref_clk_src_init = { 624 + .name = "gcc_qupv3_wrap0_qspi_ref_clk_src", 625 + .parent_data = gcc_parent_data_0, 626 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 627 + .ops = &clk_rcg2_ops, 628 + }; 629 + 630 + static struct clk_rcg2 gcc_qupv3_wrap0_qspi_ref_clk_src = { 631 + .cmd_rcgr = 0x18768, 632 + .mnd_width = 16, 633 + .hid_width = 5, 634 + .parent_map = gcc_parent_map_0, 635 + .freq_tbl = ftbl_gcc_qupv3_wrap0_qspi_ref_clk_src, 636 + .clkr.hw.init = &gcc_qupv3_wrap0_qspi_ref_clk_src_init, 637 + }; 638 + 639 + static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = { 640 + F(7372800, P_GCC_GPLL0_OUT_EVEN, 1, 384, 15625), 641 + F(14745600, P_GCC_GPLL0_OUT_EVEN, 1, 768, 15625), 642 + F(19200000, P_BI_TCXO, 1, 0, 0), 643 + F(29491200, P_GCC_GPLL0_OUT_EVEN, 1, 1536, 15625), 644 + F(32000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 75), 645 + F(48000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 25), 646 + F(51200000, P_GCC_GPLL0_OUT_EVEN, 1, 64, 375), 647 + F(64000000, P_GCC_GPLL0_OUT_EVEN, 1, 16, 75), 648 + F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0), 649 + F(80000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 15), 650 + F(96000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 25), 651 + F(100000000, P_GCC_GPLL0_OUT_MAIN, 6, 0, 0), 652 + F(102400000, P_GCC_GPLL0_OUT_EVEN, 1, 128, 375), 653 + F(112000000, P_GCC_GPLL0_OUT_EVEN, 1, 28, 75), 654 + F(117964800, P_GCC_GPLL0_OUT_EVEN, 1, 6144, 15625), 655 + F(120000000, P_GCC_GPLL0_OUT_MAIN, 5, 0, 0), 656 + { } 657 + }; 658 + 659 + static struct clk_init_data gcc_qupv3_wrap0_s0_clk_src_init = { 660 + .name = "gcc_qupv3_wrap0_s0_clk_src", 661 + .parent_data = gcc_parent_data_0, 662 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 663 + .ops = &clk_rcg2_ops, 664 + }; 665 + 666 + static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = { 667 + .cmd_rcgr = 0x18010, 668 + .mnd_width = 16, 669 + .hid_width = 5, 670 + .parent_map = gcc_parent_map_0, 671 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src, 672 + .clkr.hw.init = &gcc_qupv3_wrap0_s0_clk_src_init, 673 + }; 674 + 675 + static struct clk_init_data gcc_qupv3_wrap0_s1_clk_src_init = { 676 + .name = "gcc_qupv3_wrap0_s1_clk_src", 677 + .parent_data = gcc_parent_data_0, 678 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 679 + .ops = &clk_rcg2_ops, 680 + }; 681 + 682 + static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = { 683 + .cmd_rcgr = 0x18148, 684 + .mnd_width = 16, 685 + .hid_width = 5, 686 + .parent_map = gcc_parent_map_0, 687 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src, 688 + .clkr.hw.init = &gcc_qupv3_wrap0_s1_clk_src_init, 689 + }; 690 + 691 + static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s3_clk_src[] = { 692 + F(7372800, P_GCC_GPLL0_OUT_EVEN, 1, 384, 15625), 693 + F(14745600, P_GCC_GPLL0_OUT_EVEN, 1, 768, 15625), 694 + F(19200000, P_BI_TCXO, 1, 0, 0), 695 + F(29491200, P_GCC_GPLL0_OUT_EVEN, 1, 1536, 15625), 696 + F(32000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 75), 697 + F(48000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 25), 698 + F(51200000, P_GCC_GPLL0_OUT_EVEN, 1, 64, 375), 699 + F(64000000, P_GCC_GPLL0_OUT_EVEN, 1, 16, 75), 700 + F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0), 701 + F(80000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 15), 702 + F(96000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 25), 703 + F(100000000, P_GCC_GPLL0_OUT_MAIN, 6, 0, 0), 704 + { } 705 + }; 706 + 707 + static struct clk_init_data gcc_qupv3_wrap0_s3_clk_src_init = { 708 + .name = "gcc_qupv3_wrap0_s3_clk_src", 709 + .parent_data = gcc_parent_data_0, 710 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 711 + .ops = &clk_rcg2_ops, 712 + }; 713 + 714 + static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = { 715 + .cmd_rcgr = 0x18290, 716 + .mnd_width = 16, 717 + .hid_width = 5, 718 + .parent_map = gcc_parent_map_0, 719 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src, 720 + .clkr.hw.init = &gcc_qupv3_wrap0_s3_clk_src_init, 721 + }; 722 + 723 + static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s4_clk_src[] = { 724 + F(7372800, P_GCC_GPLL0_OUT_EVEN, 1, 384, 15625), 725 + F(14745600, P_GCC_GPLL0_OUT_EVEN, 1, 768, 15625), 726 + F(19200000, P_BI_TCXO, 1, 0, 0), 727 + F(29491200, P_GCC_GPLL0_OUT_EVEN, 1, 1536, 15625), 728 + F(32000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 75), 729 + F(48000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 25), 730 + F(51200000, P_GCC_GPLL0_OUT_EVEN, 1, 64, 375), 731 + F(64000000, P_GCC_GPLL0_OUT_EVEN, 1, 16, 75), 732 + F(80000000, P_GCC_GPLL0_OUT_EVEN, 1, 4, 15), 733 + F(96000000, P_GCC_GPLL0_OUT_EVEN, 1, 8, 25), 734 + F(128000000, P_GCC_GPLL6_OUT_MAIN, 3, 0, 0), 735 + { } 736 + }; 737 + 738 + static struct clk_init_data gcc_qupv3_wrap0_s4_clk_src_init = { 739 + .name = "gcc_qupv3_wrap0_s4_clk_src", 740 + .parent_data = gcc_parent_data_4, 741 + .num_parents = ARRAY_SIZE(gcc_parent_data_4), 742 + .ops = &clk_rcg2_ops, 743 + }; 744 + 745 + static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = { 746 + .cmd_rcgr = 0x183c8, 747 + .mnd_width = 16, 748 + .hid_width = 5, 749 + .parent_map = gcc_parent_map_4, 750 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s4_clk_src, 751 + .clkr.hw.init = &gcc_qupv3_wrap0_s4_clk_src_init, 752 + }; 753 + 754 + static struct clk_init_data gcc_qupv3_wrap0_s5_clk_src_init = { 755 + .name = "gcc_qupv3_wrap0_s5_clk_src", 756 + .parent_data = gcc_parent_data_0, 757 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 758 + .ops = &clk_rcg2_ops, 759 + }; 760 + 761 + static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = { 762 + .cmd_rcgr = 0x18500, 763 + .mnd_width = 16, 764 + .hid_width = 5, 765 + .parent_map = gcc_parent_map_0, 766 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src, 767 + .clkr.hw.init = &gcc_qupv3_wrap0_s5_clk_src_init, 768 + }; 769 + 770 + static struct clk_init_data gcc_qupv3_wrap0_s6_clk_src_init = { 771 + .name = "gcc_qupv3_wrap0_s6_clk_src", 772 + .parent_data = gcc_parent_data_0, 773 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 774 + .ops = &clk_rcg2_ops, 775 + }; 776 + 777 + static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = { 778 + .cmd_rcgr = 0x18638, 779 + .mnd_width = 16, 780 + .hid_width = 5, 781 + .parent_map = gcc_parent_map_0, 782 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src, 783 + .clkr.hw.init = &gcc_qupv3_wrap0_s6_clk_src_init, 784 + }; 785 + 786 + static struct clk_init_data gcc_qupv3_wrap1_qspi_ref_clk_src_init = { 787 + .name = "gcc_qupv3_wrap1_qspi_ref_clk_src", 788 + .parent_data = gcc_parent_data_0, 789 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 790 + .ops = &clk_rcg2_ops, 791 + }; 792 + 793 + static struct clk_rcg2 gcc_qupv3_wrap1_qspi_ref_clk_src = { 794 + .cmd_rcgr = 0x1e768, 795 + .mnd_width = 16, 796 + .hid_width = 5, 797 + .parent_map = gcc_parent_map_0, 798 + .freq_tbl = ftbl_gcc_qupv3_wrap0_qspi_ref_clk_src, 799 + .clkr.hw.init = &gcc_qupv3_wrap1_qspi_ref_clk_src_init, 800 + }; 801 + 802 + static struct clk_init_data gcc_qupv3_wrap1_s0_clk_src_init = { 803 + .name = "gcc_qupv3_wrap1_s0_clk_src", 804 + .parent_data = gcc_parent_data_0, 805 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 806 + .ops = &clk_rcg2_ops, 807 + }; 808 + 809 + static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = { 810 + .cmd_rcgr = 0x1e010, 811 + .mnd_width = 16, 812 + .hid_width = 5, 813 + .parent_map = gcc_parent_map_0, 814 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src, 815 + .clkr.hw.init = &gcc_qupv3_wrap1_s0_clk_src_init, 816 + }; 817 + 818 + static struct clk_init_data gcc_qupv3_wrap1_s1_clk_src_init = { 819 + .name = "gcc_qupv3_wrap1_s1_clk_src", 820 + .parent_data = gcc_parent_data_0, 821 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 822 + .ops = &clk_rcg2_ops, 823 + }; 824 + 825 + static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = { 826 + .cmd_rcgr = 0x1e148, 827 + .mnd_width = 16, 828 + .hid_width = 5, 829 + .parent_map = gcc_parent_map_0, 830 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src, 831 + .clkr.hw.init = &gcc_qupv3_wrap1_s1_clk_src_init, 832 + }; 833 + 834 + static struct clk_init_data gcc_qupv3_wrap1_s3_clk_src_init = { 835 + .name = "gcc_qupv3_wrap1_s3_clk_src", 836 + .parent_data = gcc_parent_data_0, 837 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 838 + .ops = &clk_rcg2_ops, 839 + }; 840 + 841 + static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = { 842 + .cmd_rcgr = 0x1e290, 843 + .mnd_width = 16, 844 + .hid_width = 5, 845 + .parent_map = gcc_parent_map_0, 846 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src, 847 + .clkr.hw.init = &gcc_qupv3_wrap1_s3_clk_src_init, 848 + }; 849 + 850 + static struct clk_init_data gcc_qupv3_wrap1_s4_clk_src_init = { 851 + .name = "gcc_qupv3_wrap1_s4_clk_src", 852 + .parent_data = gcc_parent_data_4, 853 + .num_parents = ARRAY_SIZE(gcc_parent_data_4), 854 + .ops = &clk_rcg2_ops, 855 + }; 856 + 857 + static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = { 858 + .cmd_rcgr = 0x1e3c8, 859 + .mnd_width = 16, 860 + .hid_width = 5, 861 + .parent_map = gcc_parent_map_4, 862 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s4_clk_src, 863 + .clkr.hw.init = &gcc_qupv3_wrap1_s4_clk_src_init, 864 + }; 865 + 866 + static struct clk_init_data gcc_qupv3_wrap1_s5_clk_src_init = { 867 + .name = "gcc_qupv3_wrap1_s5_clk_src", 868 + .parent_data = gcc_parent_data_0, 869 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 870 + .ops = &clk_rcg2_ops, 871 + }; 872 + 873 + static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = { 874 + .cmd_rcgr = 0x1e500, 875 + .mnd_width = 16, 876 + .hid_width = 5, 877 + .parent_map = gcc_parent_map_0, 878 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src, 879 + .clkr.hw.init = &gcc_qupv3_wrap1_s5_clk_src_init, 880 + }; 881 + 882 + static struct clk_init_data gcc_qupv3_wrap1_s6_clk_src_init = { 883 + .name = "gcc_qupv3_wrap1_s6_clk_src", 884 + .parent_data = gcc_parent_data_8, 885 + .num_parents = ARRAY_SIZE(gcc_parent_data_8), 886 + .ops = &clk_rcg2_ops, 887 + }; 888 + 889 + static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = { 890 + .cmd_rcgr = 0x1e638, 891 + .mnd_width = 16, 892 + .hid_width = 5, 893 + .parent_map = gcc_parent_map_8, 894 + .freq_tbl = ftbl_gcc_qupv3_wrap0_s3_clk_src, 895 + .clkr.hw.init = &gcc_qupv3_wrap1_s6_clk_src_init, 896 + }; 897 + 898 + static const struct freq_tbl ftbl_gcc_sdcc1_apps_clk_src[] = { 899 + F(144000, P_BI_TCXO, 16, 3, 25), 900 + F(400000, P_BI_TCXO, 12, 1, 4), 901 + F(20000000, P_GCC_GPLL0_OUT_EVEN, 5, 1, 3), 902 + F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0), 903 + F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0), 904 + F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0), 905 + F(192000000, P_GCC_GPLL6_OUT_MAIN, 2, 0, 0), 906 + F(384000000, P_GCC_GPLL6_OUT_MAIN, 1, 0, 0), 907 + { } 908 + }; 909 + 910 + static struct clk_rcg2 gcc_sdcc1_apps_clk_src = { 911 + .cmd_rcgr = 0xa3014, 912 + .mnd_width = 8, 913 + .hid_width = 5, 914 + .parent_map = gcc_parent_map_9, 915 + .freq_tbl = ftbl_gcc_sdcc1_apps_clk_src, 916 + .clkr.hw.init = &(const struct clk_init_data) { 917 + .name = "gcc_sdcc1_apps_clk_src", 918 + .parent_data = gcc_parent_data_9, 919 + .num_parents = ARRAY_SIZE(gcc_parent_data_9), 920 + .ops = &clk_rcg2_shared_ops, 921 + }, 922 + }; 923 + 924 + static const struct freq_tbl ftbl_gcc_sdcc1_ice_core_clk_src[] = { 925 + F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0), 926 + F(150000000, P_GCC_GPLL0_OUT_EVEN, 2, 0, 0), 927 + F(300000000, P_GCC_GPLL0_OUT_EVEN, 1, 0, 0), 928 + { } 929 + }; 930 + 931 + static struct clk_rcg2 gcc_sdcc1_ice_core_clk_src = { 932 + .cmd_rcgr = 0xa3038, 933 + .mnd_width = 0, 934 + .hid_width = 5, 935 + .parent_map = gcc_parent_map_10, 936 + .freq_tbl = ftbl_gcc_sdcc1_ice_core_clk_src, 937 + .clkr.hw.init = &(const struct clk_init_data) { 938 + .name = "gcc_sdcc1_ice_core_clk_src", 939 + .parent_data = gcc_parent_data_10, 940 + .num_parents = ARRAY_SIZE(gcc_parent_data_10), 941 + .ops = &clk_rcg2_shared_ops, 942 + }, 943 + }; 944 + 945 + static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = { 946 + F(400000, P_BI_TCXO, 12, 1, 4), 947 + F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0), 948 + F(37500000, P_GCC_GPLL0_OUT_EVEN, 8, 0, 0), 949 + F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0), 950 + F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0), 951 + F(202000000, P_GCC_GPLL9_OUT_MAIN, 4, 0, 0), 952 + { } 953 + }; 954 + 955 + static struct clk_rcg2 gcc_sdcc2_apps_clk_src = { 956 + .cmd_rcgr = 0x14018, 957 + .mnd_width = 8, 958 + .hid_width = 5, 959 + .parent_map = gcc_parent_map_11, 960 + .freq_tbl = ftbl_gcc_sdcc2_apps_clk_src, 961 + .clkr.hw.init = &(const struct clk_init_data) { 962 + .name = "gcc_sdcc2_apps_clk_src", 963 + .parent_data = gcc_parent_data_11, 964 + .num_parents = ARRAY_SIZE(gcc_parent_data_11), 965 + .ops = &clk_rcg2_shared_ops, 966 + }, 967 + }; 968 + 969 + static const struct freq_tbl ftbl_gcc_ufs_phy_axi_clk_src[] = { 970 + F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0), 971 + F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0), 972 + F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0), 973 + F(150000000, P_GCC_GPLL0_OUT_MAIN, 4, 0, 0), 974 + F(300000000, P_GCC_GPLL0_OUT_MAIN, 2, 0, 0), 975 + { } 976 + }; 977 + 978 + static struct clk_rcg2 gcc_ufs_phy_axi_clk_src = { 979 + .cmd_rcgr = 0x77030, 980 + .mnd_width = 8, 981 + .hid_width = 5, 982 + .parent_map = gcc_parent_map_2, 983 + .freq_tbl = ftbl_gcc_ufs_phy_axi_clk_src, 984 + .clkr.hw.init = &(const struct clk_init_data) { 985 + .name = "gcc_ufs_phy_axi_clk_src", 986 + .parent_data = gcc_parent_data_2, 987 + .num_parents = ARRAY_SIZE(gcc_parent_data_2), 988 + .ops = &clk_rcg2_shared_ops, 989 + }, 990 + }; 991 + 992 + static const struct freq_tbl ftbl_gcc_ufs_phy_ice_core_clk_src[] = { 993 + F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0), 994 + F(201500000, P_GCC_GPLL4_OUT_MAIN, 4, 0, 0), 995 + F(403000000, P_GCC_GPLL4_OUT_MAIN, 2, 0, 0), 996 + { } 997 + }; 998 + 999 + static struct clk_rcg2 gcc_ufs_phy_ice_core_clk_src = { 1000 + .cmd_rcgr = 0x77080, 1001 + .mnd_width = 0, 1002 + .hid_width = 5, 1003 + .parent_map = gcc_parent_map_2, 1004 + .freq_tbl = ftbl_gcc_ufs_phy_ice_core_clk_src, 1005 + .clkr.hw.init = &(const struct clk_init_data) { 1006 + .name = "gcc_ufs_phy_ice_core_clk_src", 1007 + .parent_data = gcc_parent_data_2, 1008 + .num_parents = ARRAY_SIZE(gcc_parent_data_2), 1009 + .ops = &clk_rcg2_shared_ops, 1010 + }, 1011 + }; 1012 + 1013 + static const struct freq_tbl ftbl_gcc_ufs_phy_phy_aux_clk_src[] = { 1014 + F(9600000, P_BI_TCXO, 2, 0, 0), 1015 + F(19200000, P_BI_TCXO, 1, 0, 0), 1016 + { } 1017 + }; 1018 + 1019 + static struct clk_rcg2 gcc_ufs_phy_phy_aux_clk_src = { 1020 + .cmd_rcgr = 0x770b4, 1021 + .mnd_width = 0, 1022 + .hid_width = 5, 1023 + .parent_map = gcc_parent_map_5, 1024 + .freq_tbl = ftbl_gcc_ufs_phy_phy_aux_clk_src, 1025 + .clkr.hw.init = &(const struct clk_init_data) { 1026 + .name = "gcc_ufs_phy_phy_aux_clk_src", 1027 + .parent_data = gcc_parent_data_5, 1028 + .num_parents = ARRAY_SIZE(gcc_parent_data_5), 1029 + .ops = &clk_rcg2_shared_ops, 1030 + }, 1031 + }; 1032 + 1033 + static const struct freq_tbl ftbl_gcc_ufs_phy_unipro_core_clk_src[] = { 1034 + F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0), 1035 + F(150000000, P_GCC_GPLL0_OUT_MAIN, 4, 0, 0), 1036 + F(300000000, P_GCC_GPLL0_OUT_MAIN, 2, 0, 0), 1037 + { } 1038 + }; 1039 + 1040 + static struct clk_rcg2 gcc_ufs_phy_unipro_core_clk_src = { 1041 + .cmd_rcgr = 0x77098, 1042 + .mnd_width = 0, 1043 + .hid_width = 5, 1044 + .parent_map = gcc_parent_map_2, 1045 + .freq_tbl = ftbl_gcc_ufs_phy_unipro_core_clk_src, 1046 + .clkr.hw.init = &(const struct clk_init_data) { 1047 + .name = "gcc_ufs_phy_unipro_core_clk_src", 1048 + .parent_data = gcc_parent_data_2, 1049 + .num_parents = ARRAY_SIZE(gcc_parent_data_2), 1050 + .ops = &clk_rcg2_shared_ops, 1051 + }, 1052 + }; 1053 + 1054 + static const struct freq_tbl ftbl_gcc_usb30_prim_master_clk_src[] = { 1055 + F(66666667, P_GCC_GPLL0_OUT_EVEN, 4.5, 0, 0), 1056 + F(133333333, P_GCC_GPLL0_OUT_MAIN, 4.5, 0, 0), 1057 + F(200000000, P_GCC_GPLL0_OUT_MAIN, 3, 0, 0), 1058 + F(240000000, P_GCC_GPLL0_OUT_MAIN, 2.5, 0, 0), 1059 + { } 1060 + }; 1061 + 1062 + static struct clk_rcg2 gcc_usb30_prim_master_clk_src = { 1063 + .cmd_rcgr = 0x3902c, 1064 + .mnd_width = 8, 1065 + .hid_width = 5, 1066 + .parent_map = gcc_parent_map_0, 1067 + .freq_tbl = ftbl_gcc_usb30_prim_master_clk_src, 1068 + .clkr.hw.init = &(const struct clk_init_data) { 1069 + .name = "gcc_usb30_prim_master_clk_src", 1070 + .parent_data = gcc_parent_data_0, 1071 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 1072 + .ops = &clk_rcg2_shared_ops, 1073 + }, 1074 + }; 1075 + 1076 + static struct clk_rcg2 gcc_usb30_prim_mock_utmi_clk_src = { 1077 + .cmd_rcgr = 0x39044, 1078 + .mnd_width = 0, 1079 + .hid_width = 5, 1080 + .parent_map = gcc_parent_map_0, 1081 + .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src, 1082 + .clkr.hw.init = &(const struct clk_init_data) { 1083 + .name = "gcc_usb30_prim_mock_utmi_clk_src", 1084 + .parent_data = gcc_parent_data_0, 1085 + .num_parents = ARRAY_SIZE(gcc_parent_data_0), 1086 + .ops = &clk_rcg2_shared_ops, 1087 + }, 1088 + }; 1089 + 1090 + static struct clk_rcg2 gcc_usb3_prim_phy_aux_clk_src = { 1091 + .cmd_rcgr = 0x39070, 1092 + .mnd_width = 0, 1093 + .hid_width = 5, 1094 + .parent_map = gcc_parent_map_3, 1095 + .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src, 1096 + .clkr.hw.init = &(const struct clk_init_data) { 1097 + .name = "gcc_usb3_prim_phy_aux_clk_src", 1098 + .parent_data = gcc_parent_data_3, 1099 + .num_parents = ARRAY_SIZE(gcc_parent_data_3), 1100 + .ops = &clk_rcg2_shared_ops, 1101 + }, 1102 + }; 1103 + 1104 + static struct clk_regmap_div gcc_pcie_0_pipe_div2_clk_src = { 1105 + .reg = 0x6b094, 1106 + .shift = 0, 1107 + .width = 4, 1108 + .clkr.hw.init = &(const struct clk_init_data) { 1109 + .name = "gcc_pcie_0_pipe_div2_clk_src", 1110 + .parent_hws = (const struct clk_hw*[]) { 1111 + &gcc_pcie_0_pipe_clk_src.clkr.hw, 1112 + }, 1113 + .num_parents = 1, 1114 + .flags = CLK_SET_RATE_PARENT, 1115 + .ops = &clk_regmap_div_ro_ops, 1116 + }, 1117 + }; 1118 + 1119 + static struct clk_regmap_div gcc_pcie_1_pipe_div2_clk_src = { 1120 + .reg = 0x90090, 1121 + .shift = 0, 1122 + .width = 4, 1123 + .clkr.hw.init = &(const struct clk_init_data) { 1124 + .name = "gcc_pcie_1_pipe_div2_clk_src", 1125 + .parent_hws = (const struct clk_hw*[]) { 1126 + &gcc_pcie_1_pipe_clk_src.clkr.hw, 1127 + }, 1128 + .num_parents = 1, 1129 + .flags = CLK_SET_RATE_PARENT, 1130 + .ops = &clk_regmap_div_ro_ops, 1131 + }, 1132 + }; 1133 + 1134 + static struct clk_regmap_div gcc_qupv3_wrap0_s2_clk_src = { 1135 + .reg = 0x18280, 1136 + .shift = 0, 1137 + .width = 4, 1138 + .clkr.hw.init = &(const struct clk_init_data) { 1139 + .name = "gcc_qupv3_wrap0_s2_clk_src", 1140 + .parent_hws = (const struct clk_hw*[]) { 1141 + &gcc_qupv3_wrap0_qspi_ref_clk_src.clkr.hw, 1142 + }, 1143 + .num_parents = 1, 1144 + .flags = CLK_SET_RATE_PARENT, 1145 + .ops = &clk_regmap_div_ro_ops, 1146 + }, 1147 + }; 1148 + 1149 + static struct clk_regmap_div gcc_qupv3_wrap1_s2_clk_src = { 1150 + .reg = 0x1e280, 1151 + .shift = 0, 1152 + .width = 4, 1153 + .clkr.hw.init = &(const struct clk_init_data) { 1154 + .name = "gcc_qupv3_wrap1_s2_clk_src", 1155 + .parent_hws = (const struct clk_hw*[]) { 1156 + &gcc_qupv3_wrap1_qspi_ref_clk_src.clkr.hw, 1157 + }, 1158 + .num_parents = 1, 1159 + .flags = CLK_SET_RATE_PARENT, 1160 + .ops = &clk_regmap_div_ro_ops, 1161 + }, 1162 + }; 1163 + 1164 + static struct clk_regmap_div gcc_usb30_prim_mock_utmi_postdiv_clk_src = { 1165 + .reg = 0x3905c, 1166 + .shift = 0, 1167 + .width = 4, 1168 + .clkr.hw.init = &(const struct clk_init_data) { 1169 + .name = "gcc_usb30_prim_mock_utmi_postdiv_clk_src", 1170 + .parent_hws = (const struct clk_hw*[]) { 1171 + &gcc_usb30_prim_mock_utmi_clk_src.clkr.hw, 1172 + }, 1173 + .num_parents = 1, 1174 + .flags = CLK_SET_RATE_PARENT, 1175 + .ops = &clk_regmap_div_ro_ops, 1176 + }, 1177 + }; 1178 + 1179 + static struct clk_branch gcc_aggre_noc_pcie_axi_clk = { 1180 + .halt_reg = 0x1005c, 1181 + .halt_check = BRANCH_HALT_SKIP, 1182 + .hwcg_reg = 0x1005c, 1183 + .hwcg_bit = 1, 1184 + .clkr = { 1185 + .enable_reg = 0x52000, 1186 + .enable_mask = BIT(12), 1187 + .hw.init = &(const struct clk_init_data) { 1188 + .name = "gcc_aggre_noc_pcie_axi_clk", 1189 + .ops = &clk_branch2_ops, 1190 + }, 1191 + }, 1192 + }; 1193 + 1194 + static struct clk_branch gcc_aggre_ufs_phy_axi_clk = { 1195 + .halt_reg = 0x770e4, 1196 + .halt_check = BRANCH_HALT_VOTED, 1197 + .hwcg_reg = 0x770e4, 1198 + .hwcg_bit = 1, 1199 + .clkr = { 1200 + .enable_reg = 0x770e4, 1201 + .enable_mask = BIT(0), 1202 + .hw.init = &(const struct clk_init_data) { 1203 + .name = "gcc_aggre_ufs_phy_axi_clk", 1204 + .parent_hws = (const struct clk_hw*[]) { 1205 + &gcc_ufs_phy_axi_clk_src.clkr.hw, 1206 + }, 1207 + .num_parents = 1, 1208 + .flags = CLK_SET_RATE_PARENT, 1209 + .ops = &clk_branch2_ops, 1210 + }, 1211 + }, 1212 + }; 1213 + 1214 + static struct clk_branch gcc_aggre_ufs_phy_axi_hw_ctl_clk = { 1215 + .halt_reg = 0x770e4, 1216 + .halt_check = BRANCH_HALT_VOTED, 1217 + .hwcg_reg = 0x770e4, 1218 + .hwcg_bit = 1, 1219 + .clkr = { 1220 + .enable_reg = 0x770e4, 1221 + .enable_mask = BIT(1), 1222 + .hw.init = &(const struct clk_init_data) { 1223 + .name = "gcc_aggre_ufs_phy_axi_hw_ctl_clk", 1224 + .parent_hws = (const struct clk_hw*[]) { 1225 + &gcc_ufs_phy_axi_clk_src.clkr.hw, 1226 + }, 1227 + .num_parents = 1, 1228 + .flags = CLK_SET_RATE_PARENT, 1229 + .ops = &clk_branch2_ops, 1230 + }, 1231 + }, 1232 + }; 1233 + 1234 + static struct clk_branch gcc_aggre_usb3_prim_axi_clk = { 1235 + .halt_reg = 0x39090, 1236 + .halt_check = BRANCH_HALT_VOTED, 1237 + .hwcg_reg = 0x39090, 1238 + .hwcg_bit = 1, 1239 + .clkr = { 1240 + .enable_reg = 0x39090, 1241 + .enable_mask = BIT(0), 1242 + .hw.init = &(const struct clk_init_data) { 1243 + .name = "gcc_aggre_usb3_prim_axi_clk", 1244 + .parent_hws = (const struct clk_hw*[]) { 1245 + &gcc_usb30_prim_master_clk_src.clkr.hw, 1246 + }, 1247 + .num_parents = 1, 1248 + .flags = CLK_SET_RATE_PARENT, 1249 + .ops = &clk_branch2_ops, 1250 + }, 1251 + }, 1252 + }; 1253 + 1254 + static struct clk_branch gcc_boot_rom_ahb_clk = { 1255 + .halt_reg = 0x38004, 1256 + .halt_check = BRANCH_HALT_VOTED, 1257 + .hwcg_reg = 0x38004, 1258 + .hwcg_bit = 1, 1259 + .clkr = { 1260 + .enable_reg = 0x52000, 1261 + .enable_mask = BIT(10), 1262 + .hw.init = &(const struct clk_init_data) { 1263 + .name = "gcc_boot_rom_ahb_clk", 1264 + .ops = &clk_branch2_ops, 1265 + }, 1266 + }, 1267 + }; 1268 + 1269 + static struct clk_branch gcc_camera_hf_axi_clk = { 1270 + .halt_reg = 0x26010, 1271 + .halt_check = BRANCH_HALT_SKIP, 1272 + .hwcg_reg = 0x26010, 1273 + .hwcg_bit = 1, 1274 + .clkr = { 1275 + .enable_reg = 0x26010, 1276 + .enable_mask = BIT(0), 1277 + .hw.init = &(const struct clk_init_data) { 1278 + .name = "gcc_camera_hf_axi_clk", 1279 + .ops = &clk_branch2_ops, 1280 + }, 1281 + }, 1282 + }; 1283 + 1284 + static struct clk_branch gcc_camera_sf_axi_clk = { 1285 + .halt_reg = 0x26014, 1286 + .halt_check = BRANCH_HALT_SKIP, 1287 + .hwcg_reg = 0x26014, 1288 + .hwcg_bit = 1, 1289 + .clkr = { 1290 + .enable_reg = 0x26014, 1291 + .enable_mask = BIT(0), 1292 + .hw.init = &(const struct clk_init_data) { 1293 + .name = "gcc_camera_sf_axi_clk", 1294 + .ops = &clk_branch2_ops, 1295 + }, 1296 + }, 1297 + }; 1298 + 1299 + static struct clk_branch gcc_cfg_noc_pcie_anoc_ahb_clk = { 1300 + .halt_reg = 0x10050, 1301 + .halt_check = BRANCH_HALT_SKIP, 1302 + .hwcg_reg = 0x10050, 1303 + .hwcg_bit = 1, 1304 + .clkr = { 1305 + .enable_reg = 0x52000, 1306 + .enable_mask = BIT(20), 1307 + .hw.init = &(const struct clk_init_data) { 1308 + .name = "gcc_cfg_noc_pcie_anoc_ahb_clk", 1309 + .ops = &clk_branch2_ops, 1310 + }, 1311 + }, 1312 + }; 1313 + 1314 + static struct clk_branch gcc_cfg_noc_usb3_prim_axi_clk = { 1315 + .halt_reg = 0x3908c, 1316 + .halt_check = BRANCH_HALT_VOTED, 1317 + .clkr = { 1318 + .enable_reg = 0x3908c, 1319 + .enable_mask = BIT(0), 1320 + .hw.init = &(const struct clk_init_data) { 1321 + .name = "gcc_cfg_noc_usb3_prim_axi_clk", 1322 + .parent_hws = (const struct clk_hw*[]) { 1323 + &gcc_usb30_prim_master_clk_src.clkr.hw, 1324 + }, 1325 + .num_parents = 1, 1326 + .flags = CLK_SET_RATE_PARENT, 1327 + .ops = &clk_branch2_ops, 1328 + }, 1329 + }, 1330 + }; 1331 + 1332 + static struct clk_branch gcc_cnoc_pcie_sf_axi_clk = { 1333 + .halt_reg = 0x10058, 1334 + .halt_check = BRANCH_HALT_VOTED, 1335 + .hwcg_reg = 0x10058, 1336 + .hwcg_bit = 1, 1337 + .clkr = { 1338 + .enable_reg = 0x52008, 1339 + .enable_mask = BIT(6), 1340 + .hw.init = &(const struct clk_init_data) { 1341 + .name = "gcc_cnoc_pcie_sf_axi_clk", 1342 + .ops = &clk_branch2_ops, 1343 + }, 1344 + }, 1345 + }; 1346 + 1347 + static struct clk_branch gcc_ddrss_gpu_axi_clk = { 1348 + .halt_reg = 0x7115c, 1349 + .halt_check = BRANCH_HALT_SKIP, 1350 + .hwcg_reg = 0x7115c, 1351 + .hwcg_bit = 1, 1352 + .clkr = { 1353 + .enable_reg = 0x7115c, 1354 + .enable_mask = BIT(0), 1355 + .hw.init = &(const struct clk_init_data) { 1356 + .name = "gcc_ddrss_gpu_axi_clk", 1357 + .ops = &clk_branch2_aon_ops, 1358 + }, 1359 + }, 1360 + }; 1361 + 1362 + static struct clk_branch gcc_ddrss_pcie_sf_qtb_clk = { 1363 + .halt_reg = 0x1006c, 1364 + .halt_check = BRANCH_HALT_SKIP, 1365 + .hwcg_reg = 0x1006c, 1366 + .hwcg_bit = 1, 1367 + .clkr = { 1368 + .enable_reg = 0x52000, 1369 + .enable_mask = BIT(19), 1370 + .hw.init = &(const struct clk_init_data) { 1371 + .name = "gcc_ddrss_pcie_sf_qtb_clk", 1372 + .ops = &clk_branch2_ops, 1373 + }, 1374 + }, 1375 + }; 1376 + 1377 + static struct clk_branch gcc_disp_gpll0_div_clk_src = { 1378 + .halt_check = BRANCH_HALT_DELAY, 1379 + .clkr = { 1380 + .enable_reg = 0x52000, 1381 + .enable_mask = BIT(23), 1382 + .hw.init = &(const struct clk_init_data) { 1383 + .name = "gcc_disp_gpll0_div_clk_src", 1384 + .parent_hws = (const struct clk_hw*[]) { 1385 + &gcc_gpll0_out_even.clkr.hw, 1386 + }, 1387 + .num_parents = 1, 1388 + .flags = CLK_SET_RATE_PARENT, 1389 + .ops = &clk_branch2_ops, 1390 + }, 1391 + }, 1392 + }; 1393 + 1394 + static struct clk_branch gcc_disp_hf_axi_clk = { 1395 + .halt_reg = 0x2700c, 1396 + .halt_check = BRANCH_HALT_SKIP, 1397 + .hwcg_reg = 0x2700c, 1398 + .hwcg_bit = 1, 1399 + .clkr = { 1400 + .enable_reg = 0x2700c, 1401 + .enable_mask = BIT(0), 1402 + .hw.init = &(const struct clk_init_data) { 1403 + .name = "gcc_disp_hf_axi_clk", 1404 + .ops = &clk_branch2_ops, 1405 + }, 1406 + }, 1407 + }; 1408 + 1409 + static struct clk_branch gcc_gp1_clk = { 1410 + .halt_reg = 0x64000, 1411 + .halt_check = BRANCH_HALT, 1412 + .clkr = { 1413 + .enable_reg = 0x64000, 1414 + .enable_mask = BIT(0), 1415 + .hw.init = &(const struct clk_init_data) { 1416 + .name = "gcc_gp1_clk", 1417 + .parent_hws = (const struct clk_hw*[]) { 1418 + &gcc_gp1_clk_src.clkr.hw, 1419 + }, 1420 + .num_parents = 1, 1421 + .flags = CLK_SET_RATE_PARENT, 1422 + .ops = &clk_branch2_ops, 1423 + }, 1424 + }, 1425 + }; 1426 + 1427 + static struct clk_branch gcc_gp2_clk = { 1428 + .halt_reg = 0x65000, 1429 + .halt_check = BRANCH_HALT, 1430 + .clkr = { 1431 + .enable_reg = 0x65000, 1432 + .enable_mask = BIT(0), 1433 + .hw.init = &(const struct clk_init_data) { 1434 + .name = "gcc_gp2_clk", 1435 + .parent_hws = (const struct clk_hw*[]) { 1436 + &gcc_gp2_clk_src.clkr.hw, 1437 + }, 1438 + .num_parents = 1, 1439 + .flags = CLK_SET_RATE_PARENT, 1440 + .ops = &clk_branch2_ops, 1441 + }, 1442 + }, 1443 + }; 1444 + 1445 + static struct clk_branch gcc_gp3_clk = { 1446 + .halt_reg = 0x66000, 1447 + .halt_check = BRANCH_HALT, 1448 + .clkr = { 1449 + .enable_reg = 0x66000, 1450 + .enable_mask = BIT(0), 1451 + .hw.init = &(const struct clk_init_data) { 1452 + .name = "gcc_gp3_clk", 1453 + .parent_hws = (const struct clk_hw*[]) { 1454 + &gcc_gp3_clk_src.clkr.hw, 1455 + }, 1456 + .num_parents = 1, 1457 + .flags = CLK_SET_RATE_PARENT, 1458 + .ops = &clk_branch2_ops, 1459 + }, 1460 + }, 1461 + }; 1462 + 1463 + static struct clk_branch gcc_gpu_gpll0_clk_src = { 1464 + .halt_check = BRANCH_HALT_DELAY, 1465 + .clkr = { 1466 + .enable_reg = 0x52000, 1467 + .enable_mask = BIT(15), 1468 + .hw.init = &(const struct clk_init_data) { 1469 + .name = "gcc_gpu_gpll0_clk_src", 1470 + .parent_hws = (const struct clk_hw*[]) { 1471 + &gcc_gpll0.clkr.hw, 1472 + }, 1473 + .num_parents = 1, 1474 + .flags = CLK_SET_RATE_PARENT, 1475 + .ops = &clk_branch2_ops, 1476 + }, 1477 + }, 1478 + }; 1479 + 1480 + static struct clk_branch gcc_gpu_gpll0_div_clk_src = { 1481 + .halt_check = BRANCH_HALT_DELAY, 1482 + .clkr = { 1483 + .enable_reg = 0x52000, 1484 + .enable_mask = BIT(16), 1485 + .hw.init = &(const struct clk_init_data) { 1486 + .name = "gcc_gpu_gpll0_div_clk_src", 1487 + .parent_hws = (const struct clk_hw*[]) { 1488 + &gcc_gpll0_out_even.clkr.hw, 1489 + }, 1490 + .num_parents = 1, 1491 + .flags = CLK_SET_RATE_PARENT, 1492 + .ops = &clk_branch2_ops, 1493 + }, 1494 + }, 1495 + }; 1496 + 1497 + static struct clk_branch gcc_gpu_memnoc_gfx_clk = { 1498 + .halt_reg = 0x71010, 1499 + .halt_check = BRANCH_HALT_VOTED, 1500 + .hwcg_reg = 0x71010, 1501 + .hwcg_bit = 1, 1502 + .clkr = { 1503 + .enable_reg = 0x71010, 1504 + .enable_mask = BIT(0), 1505 + .hw.init = &(const struct clk_init_data) { 1506 + .name = "gcc_gpu_memnoc_gfx_clk", 1507 + .ops = &clk_branch2_ops, 1508 + }, 1509 + }, 1510 + }; 1511 + 1512 + static struct clk_branch gcc_gpu_snoc_dvm_gfx_clk = { 1513 + .halt_reg = 0x71018, 1514 + .halt_check = BRANCH_HALT_DELAY, 1515 + .clkr = { 1516 + .enable_reg = 0x71018, 1517 + .enable_mask = BIT(0), 1518 + .hw.init = &(const struct clk_init_data) { 1519 + .name = "gcc_gpu_snoc_dvm_gfx_clk", 1520 + .ops = &clk_branch2_ops, 1521 + }, 1522 + }, 1523 + }; 1524 + 1525 + static struct clk_branch gcc_pcie_0_aux_clk = { 1526 + .halt_reg = 0x6b03c, 1527 + .halt_check = BRANCH_HALT_VOTED, 1528 + .clkr = { 1529 + .enable_reg = 0x52008, 1530 + .enable_mask = BIT(3), 1531 + .hw.init = &(const struct clk_init_data) { 1532 + .name = "gcc_pcie_0_aux_clk", 1533 + .parent_hws = (const struct clk_hw*[]) { 1534 + &gcc_pcie_0_aux_clk_src.clkr.hw, 1535 + }, 1536 + .num_parents = 1, 1537 + .flags = CLK_SET_RATE_PARENT, 1538 + .ops = &clk_branch2_ops, 1539 + }, 1540 + }, 1541 + }; 1542 + 1543 + static struct clk_branch gcc_pcie_0_cfg_ahb_clk = { 1544 + .halt_reg = 0x6b038, 1545 + .halt_check = BRANCH_HALT_VOTED, 1546 + .hwcg_reg = 0x6b038, 1547 + .hwcg_bit = 1, 1548 + .clkr = { 1549 + .enable_reg = 0x52008, 1550 + .enable_mask = BIT(2), 1551 + .hw.init = &(const struct clk_init_data) { 1552 + .name = "gcc_pcie_0_cfg_ahb_clk", 1553 + .ops = &clk_branch2_ops, 1554 + }, 1555 + }, 1556 + }; 1557 + 1558 + static struct clk_branch gcc_pcie_0_mstr_axi_clk = { 1559 + .halt_reg = 0x6b02c, 1560 + .halt_check = BRANCH_HALT_SKIP, 1561 + .hwcg_reg = 0x6b02c, 1562 + .hwcg_bit = 1, 1563 + .clkr = { 1564 + .enable_reg = 0x52008, 1565 + .enable_mask = BIT(1), 1566 + .hw.init = &(const struct clk_init_data) { 1567 + .name = "gcc_pcie_0_mstr_axi_clk", 1568 + .ops = &clk_branch2_ops, 1569 + }, 1570 + }, 1571 + }; 1572 + 1573 + static struct clk_branch gcc_pcie_0_phy_rchng_clk = { 1574 + .halt_reg = 0x6b054, 1575 + .halt_check = BRANCH_HALT_VOTED, 1576 + .clkr = { 1577 + .enable_reg = 0x52000, 1578 + .enable_mask = BIT(22), 1579 + .hw.init = &(const struct clk_init_data) { 1580 + .name = "gcc_pcie_0_phy_rchng_clk", 1581 + .parent_hws = (const struct clk_hw*[]) { 1582 + &gcc_pcie_0_phy_rchng_clk_src.clkr.hw, 1583 + }, 1584 + .num_parents = 1, 1585 + .flags = CLK_SET_RATE_PARENT, 1586 + .ops = &clk_branch2_ops, 1587 + }, 1588 + }, 1589 + }; 1590 + 1591 + static struct clk_branch gcc_pcie_0_pipe_clk = { 1592 + .halt_reg = 0x6b048, 1593 + .halt_check = BRANCH_HALT_SKIP, 1594 + .clkr = { 1595 + .enable_reg = 0x52008, 1596 + .enable_mask = BIT(4), 1597 + .hw.init = &(const struct clk_init_data) { 1598 + .name = "gcc_pcie_0_pipe_clk", 1599 + .parent_hws = (const struct clk_hw*[]) { 1600 + &gcc_pcie_0_pipe_clk_src.clkr.hw, 1601 + }, 1602 + .num_parents = 1, 1603 + .flags = CLK_SET_RATE_PARENT, 1604 + .ops = &clk_branch2_ops, 1605 + }, 1606 + }, 1607 + }; 1608 + 1609 + static struct clk_branch gcc_pcie_0_pipe_div2_clk = { 1610 + .halt_reg = 0x6b098, 1611 + .halt_check = BRANCH_HALT_SKIP, 1612 + .clkr = { 1613 + .enable_reg = 0x52018, 1614 + .enable_mask = BIT(13), 1615 + .hw.init = &(const struct clk_init_data) { 1616 + .name = "gcc_pcie_0_pipe_div2_clk", 1617 + .parent_hws = (const struct clk_hw*[]) { 1618 + &gcc_pcie_0_pipe_div2_clk_src.clkr.hw, 1619 + }, 1620 + .num_parents = 1, 1621 + .flags = CLK_SET_RATE_PARENT, 1622 + .ops = &clk_branch2_ops, 1623 + }, 1624 + }, 1625 + }; 1626 + 1627 + static struct clk_branch gcc_pcie_0_slv_axi_clk = { 1628 + .halt_reg = 0x6b020, 1629 + .halt_check = BRANCH_HALT_VOTED, 1630 + .hwcg_reg = 0x6b020, 1631 + .hwcg_bit = 1, 1632 + .clkr = { 1633 + .enable_reg = 0x52008, 1634 + .enable_mask = BIT(0), 1635 + .hw.init = &(const struct clk_init_data) { 1636 + .name = "gcc_pcie_0_slv_axi_clk", 1637 + .ops = &clk_branch2_ops, 1638 + }, 1639 + }, 1640 + }; 1641 + 1642 + static struct clk_branch gcc_pcie_0_slv_q2a_axi_clk = { 1643 + .halt_reg = 0x6b01c, 1644 + .halt_check = BRANCH_HALT_VOTED, 1645 + .clkr = { 1646 + .enable_reg = 0x52008, 1647 + .enable_mask = BIT(5), 1648 + .hw.init = &(const struct clk_init_data) { 1649 + .name = "gcc_pcie_0_slv_q2a_axi_clk", 1650 + .ops = &clk_branch2_ops, 1651 + }, 1652 + }, 1653 + }; 1654 + 1655 + static struct clk_branch gcc_pcie_1_aux_clk = { 1656 + .halt_reg = 0x90038, 1657 + .halt_check = BRANCH_HALT_VOTED, 1658 + .clkr = { 1659 + .enable_reg = 0x52000, 1660 + .enable_mask = BIT(29), 1661 + .hw.init = &(const struct clk_init_data) { 1662 + .name = "gcc_pcie_1_aux_clk", 1663 + .parent_hws = (const struct clk_hw*[]) { 1664 + &gcc_pcie_1_aux_clk_src.clkr.hw, 1665 + }, 1666 + .num_parents = 1, 1667 + .flags = CLK_SET_RATE_PARENT, 1668 + .ops = &clk_branch2_ops, 1669 + }, 1670 + }, 1671 + }; 1672 + 1673 + static struct clk_branch gcc_pcie_1_cfg_ahb_clk = { 1674 + .halt_reg = 0x90034, 1675 + .halt_check = BRANCH_HALT_VOTED, 1676 + .hwcg_reg = 0x90034, 1677 + .hwcg_bit = 1, 1678 + .clkr = { 1679 + .enable_reg = 0x52000, 1680 + .enable_mask = BIT(28), 1681 + .hw.init = &(const struct clk_init_data) { 1682 + .name = "gcc_pcie_1_cfg_ahb_clk", 1683 + .ops = &clk_branch2_ops, 1684 + }, 1685 + }, 1686 + }; 1687 + 1688 + static struct clk_branch gcc_pcie_1_mstr_axi_clk = { 1689 + .halt_reg = 0x90028, 1690 + .halt_check = BRANCH_HALT_SKIP, 1691 + .hwcg_reg = 0x90028, 1692 + .hwcg_bit = 1, 1693 + .clkr = { 1694 + .enable_reg = 0x52000, 1695 + .enable_mask = BIT(27), 1696 + .hw.init = &(const struct clk_init_data) { 1697 + .name = "gcc_pcie_1_mstr_axi_clk", 1698 + .ops = &clk_branch2_ops, 1699 + }, 1700 + }, 1701 + }; 1702 + 1703 + static struct clk_branch gcc_pcie_1_phy_rchng_clk = { 1704 + .halt_reg = 0x90050, 1705 + .halt_check = BRANCH_HALT_VOTED, 1706 + .clkr = { 1707 + .enable_reg = 0x52008, 1708 + .enable_mask = BIT(8), 1709 + .hw.init = &(const struct clk_init_data) { 1710 + .name = "gcc_pcie_1_phy_rchng_clk", 1711 + .parent_hws = (const struct clk_hw*[]) { 1712 + &gcc_pcie_1_phy_rchng_clk_src.clkr.hw, 1713 + }, 1714 + .num_parents = 1, 1715 + .flags = CLK_SET_RATE_PARENT, 1716 + .ops = &clk_branch2_ops, 1717 + }, 1718 + }, 1719 + }; 1720 + 1721 + static struct clk_branch gcc_pcie_1_pipe_clk = { 1722 + .halt_reg = 0x90044, 1723 + .halt_check = BRANCH_HALT_SKIP, 1724 + .clkr = { 1725 + .enable_reg = 0x52008, 1726 + .enable_mask = BIT(7), 1727 + .hw.init = &(const struct clk_init_data) { 1728 + .name = "gcc_pcie_1_pipe_clk", 1729 + .parent_hws = (const struct clk_hw*[]) { 1730 + &gcc_pcie_1_pipe_clk_src.clkr.hw, 1731 + }, 1732 + .num_parents = 1, 1733 + .flags = CLK_SET_RATE_PARENT, 1734 + .ops = &clk_branch2_ops, 1735 + }, 1736 + }, 1737 + }; 1738 + 1739 + static struct clk_branch gcc_pcie_1_pipe_div2_clk = { 1740 + .halt_reg = 0x90094, 1741 + .halt_check = BRANCH_HALT_SKIP, 1742 + .clkr = { 1743 + .enable_reg = 0x52018, 1744 + .enable_mask = BIT(15), 1745 + .hw.init = &(const struct clk_init_data) { 1746 + .name = "gcc_pcie_1_pipe_div2_clk", 1747 + .parent_hws = (const struct clk_hw*[]) { 1748 + &gcc_pcie_1_pipe_div2_clk_src.clkr.hw, 1749 + }, 1750 + .num_parents = 1, 1751 + .flags = CLK_SET_RATE_PARENT, 1752 + .ops = &clk_branch2_ops, 1753 + }, 1754 + }, 1755 + }; 1756 + 1757 + static struct clk_branch gcc_pcie_1_slv_axi_clk = { 1758 + .halt_reg = 0x9001c, 1759 + .halt_check = BRANCH_HALT_VOTED, 1760 + .hwcg_reg = 0x9001c, 1761 + .hwcg_bit = 1, 1762 + .clkr = { 1763 + .enable_reg = 0x52000, 1764 + .enable_mask = BIT(26), 1765 + .hw.init = &(const struct clk_init_data) { 1766 + .name = "gcc_pcie_1_slv_axi_clk", 1767 + .ops = &clk_branch2_ops, 1768 + }, 1769 + }, 1770 + }; 1771 + 1772 + static struct clk_branch gcc_pcie_1_slv_q2a_axi_clk = { 1773 + .halt_reg = 0x90018, 1774 + .halt_check = BRANCH_HALT_VOTED, 1775 + .clkr = { 1776 + .enable_reg = 0x52000, 1777 + .enable_mask = BIT(25), 1778 + .hw.init = &(const struct clk_init_data) { 1779 + .name = "gcc_pcie_1_slv_q2a_axi_clk", 1780 + .ops = &clk_branch2_ops, 1781 + }, 1782 + }, 1783 + }; 1784 + 1785 + static struct clk_branch gcc_pcie_rscc_cfg_ahb_clk = { 1786 + .halt_reg = 0x11004, 1787 + .halt_check = BRANCH_HALT_VOTED, 1788 + .hwcg_reg = 0x11004, 1789 + .hwcg_bit = 1, 1790 + .clkr = { 1791 + .enable_reg = 0x52010, 1792 + .enable_mask = BIT(20), 1793 + .hw.init = &(const struct clk_init_data) { 1794 + .name = "gcc_pcie_rscc_cfg_ahb_clk", 1795 + .ops = &clk_branch2_ops, 1796 + }, 1797 + }, 1798 + }; 1799 + 1800 + static struct clk_branch gcc_pcie_rscc_xo_clk = { 1801 + .halt_reg = 0x11008, 1802 + .halt_check = BRANCH_HALT_VOTED, 1803 + .clkr = { 1804 + .enable_reg = 0x52010, 1805 + .enable_mask = BIT(21), 1806 + .hw.init = &(const struct clk_init_data) { 1807 + .name = "gcc_pcie_rscc_xo_clk", 1808 + .ops = &clk_branch2_ops, 1809 + }, 1810 + }, 1811 + }; 1812 + 1813 + static struct clk_branch gcc_pdm2_clk = { 1814 + .halt_reg = 0x3300c, 1815 + .halt_check = BRANCH_HALT, 1816 + .clkr = { 1817 + .enable_reg = 0x3300c, 1818 + .enable_mask = BIT(0), 1819 + .hw.init = &(const struct clk_init_data) { 1820 + .name = "gcc_pdm2_clk", 1821 + .parent_hws = (const struct clk_hw*[]) { 1822 + &gcc_pdm2_clk_src.clkr.hw, 1823 + }, 1824 + .num_parents = 1, 1825 + .flags = CLK_SET_RATE_PARENT, 1826 + .ops = &clk_branch2_ops, 1827 + }, 1828 + }, 1829 + }; 1830 + 1831 + static struct clk_branch gcc_pdm_ahb_clk = { 1832 + .halt_reg = 0x33004, 1833 + .halt_check = BRANCH_HALT_VOTED, 1834 + .hwcg_reg = 0x33004, 1835 + .hwcg_bit = 1, 1836 + .clkr = { 1837 + .enable_reg = 0x33004, 1838 + .enable_mask = BIT(0), 1839 + .hw.init = &(const struct clk_init_data) { 1840 + .name = "gcc_pdm_ahb_clk", 1841 + .ops = &clk_branch2_ops, 1842 + }, 1843 + }, 1844 + }; 1845 + 1846 + static struct clk_branch gcc_pdm_xo4_clk = { 1847 + .halt_reg = 0x33008, 1848 + .halt_check = BRANCH_HALT, 1849 + .clkr = { 1850 + .enable_reg = 0x33008, 1851 + .enable_mask = BIT(0), 1852 + .hw.init = &(const struct clk_init_data) { 1853 + .name = "gcc_pdm_xo4_clk", 1854 + .ops = &clk_branch2_ops, 1855 + }, 1856 + }, 1857 + }; 1858 + 1859 + static struct clk_branch gcc_qmip_camera_nrt_ahb_clk = { 1860 + .halt_reg = 0x26008, 1861 + .halt_check = BRANCH_HALT_VOTED, 1862 + .hwcg_reg = 0x26008, 1863 + .hwcg_bit = 1, 1864 + .clkr = { 1865 + .enable_reg = 0x26008, 1866 + .enable_mask = BIT(0), 1867 + .hw.init = &(const struct clk_init_data) { 1868 + .name = "gcc_qmip_camera_nrt_ahb_clk", 1869 + .ops = &clk_branch2_ops, 1870 + }, 1871 + }, 1872 + }; 1873 + 1874 + static struct clk_branch gcc_qmip_camera_rt_ahb_clk = { 1875 + .halt_reg = 0x2600c, 1876 + .halt_check = BRANCH_HALT_VOTED, 1877 + .hwcg_reg = 0x2600c, 1878 + .hwcg_bit = 1, 1879 + .clkr = { 1880 + .enable_reg = 0x2600c, 1881 + .enable_mask = BIT(0), 1882 + .hw.init = &(const struct clk_init_data) { 1883 + .name = "gcc_qmip_camera_rt_ahb_clk", 1884 + .ops = &clk_branch2_ops, 1885 + }, 1886 + }, 1887 + }; 1888 + 1889 + static struct clk_branch gcc_qmip_disp_ahb_clk = { 1890 + .halt_reg = 0x27008, 1891 + .halt_check = BRANCH_HALT_VOTED, 1892 + .hwcg_reg = 0x27008, 1893 + .hwcg_bit = 1, 1894 + .clkr = { 1895 + .enable_reg = 0x27008, 1896 + .enable_mask = BIT(0), 1897 + .hw.init = &(const struct clk_init_data) { 1898 + .name = "gcc_qmip_disp_ahb_clk", 1899 + .ops = &clk_branch2_ops, 1900 + }, 1901 + }, 1902 + }; 1903 + 1904 + static struct clk_branch gcc_qmip_gpu_ahb_clk = { 1905 + .halt_reg = 0x71008, 1906 + .halt_check = BRANCH_HALT_VOTED, 1907 + .hwcg_reg = 0x71008, 1908 + .hwcg_bit = 1, 1909 + .clkr = { 1910 + .enable_reg = 0x71008, 1911 + .enable_mask = BIT(0), 1912 + .hw.init = &(const struct clk_init_data) { 1913 + .name = "gcc_qmip_gpu_ahb_clk", 1914 + .ops = &clk_branch2_ops, 1915 + }, 1916 + }, 1917 + }; 1918 + 1919 + static struct clk_branch gcc_qmip_pcie_ahb_clk = { 1920 + .halt_reg = 0x6b018, 1921 + .halt_check = BRANCH_HALT_VOTED, 1922 + .hwcg_reg = 0x6b018, 1923 + .hwcg_bit = 1, 1924 + .clkr = { 1925 + .enable_reg = 0x52000, 1926 + .enable_mask = BIT(11), 1927 + .hw.init = &(const struct clk_init_data) { 1928 + .name = "gcc_qmip_pcie_ahb_clk", 1929 + .ops = &clk_branch2_ops, 1930 + }, 1931 + }, 1932 + }; 1933 + 1934 + static struct clk_branch gcc_qmip_video_cv_cpu_ahb_clk = { 1935 + .halt_reg = 0x32014, 1936 + .halt_check = BRANCH_HALT_VOTED, 1937 + .hwcg_reg = 0x32014, 1938 + .hwcg_bit = 1, 1939 + .clkr = { 1940 + .enable_reg = 0x32014, 1941 + .enable_mask = BIT(0), 1942 + .hw.init = &(const struct clk_init_data) { 1943 + .name = "gcc_qmip_video_cv_cpu_ahb_clk", 1944 + .ops = &clk_branch2_ops, 1945 + }, 1946 + }, 1947 + }; 1948 + 1949 + static struct clk_branch gcc_qmip_video_cvp_ahb_clk = { 1950 + .halt_reg = 0x32008, 1951 + .halt_check = BRANCH_HALT_VOTED, 1952 + .hwcg_reg = 0x32008, 1953 + .hwcg_bit = 1, 1954 + .clkr = { 1955 + .enable_reg = 0x32008, 1956 + .enable_mask = BIT(0), 1957 + .hw.init = &(const struct clk_init_data) { 1958 + .name = "gcc_qmip_video_cvp_ahb_clk", 1959 + .ops = &clk_branch2_ops, 1960 + }, 1961 + }, 1962 + }; 1963 + 1964 + static struct clk_branch gcc_qmip_video_v_cpu_ahb_clk = { 1965 + .halt_reg = 0x32010, 1966 + .halt_check = BRANCH_HALT_VOTED, 1967 + .hwcg_reg = 0x32010, 1968 + .hwcg_bit = 1, 1969 + .clkr = { 1970 + .enable_reg = 0x32010, 1971 + .enable_mask = BIT(0), 1972 + .hw.init = &(const struct clk_init_data) { 1973 + .name = "gcc_qmip_video_v_cpu_ahb_clk", 1974 + .ops = &clk_branch2_ops, 1975 + }, 1976 + }, 1977 + }; 1978 + 1979 + static struct clk_branch gcc_qmip_video_vcodec_ahb_clk = { 1980 + .halt_reg = 0x3200c, 1981 + .halt_check = BRANCH_HALT_VOTED, 1982 + .hwcg_reg = 0x3200c, 1983 + .hwcg_bit = 1, 1984 + .clkr = { 1985 + .enable_reg = 0x3200c, 1986 + .enable_mask = BIT(0), 1987 + .hw.init = &(const struct clk_init_data) { 1988 + .name = "gcc_qmip_video_vcodec_ahb_clk", 1989 + .ops = &clk_branch2_ops, 1990 + }, 1991 + }, 1992 + }; 1993 + 1994 + static struct clk_branch gcc_qupv3_wrap0_core_2x_clk = { 1995 + .halt_reg = 0x23018, 1996 + .halt_check = BRANCH_HALT_VOTED, 1997 + .clkr = { 1998 + .enable_reg = 0x52008, 1999 + .enable_mask = BIT(18), 2000 + .hw.init = &(const struct clk_init_data) { 2001 + .name = "gcc_qupv3_wrap0_core_2x_clk", 2002 + .ops = &clk_branch2_ops, 2003 + }, 2004 + }, 2005 + }; 2006 + 2007 + static struct clk_branch gcc_qupv3_wrap0_core_clk = { 2008 + .halt_reg = 0x23008, 2009 + .halt_check = BRANCH_HALT_VOTED, 2010 + .clkr = { 2011 + .enable_reg = 0x52008, 2012 + .enable_mask = BIT(19), 2013 + .hw.init = &(const struct clk_init_data) { 2014 + .name = "gcc_qupv3_wrap0_core_clk", 2015 + .ops = &clk_branch2_ops, 2016 + }, 2017 + }, 2018 + }; 2019 + 2020 + static struct clk_branch gcc_qupv3_wrap0_qspi_ref_clk = { 2021 + .halt_reg = 0x18764, 2022 + .halt_check = BRANCH_HALT_VOTED, 2023 + .clkr = { 2024 + .enable_reg = 0x52010, 2025 + .enable_mask = BIT(29), 2026 + .hw.init = &(const struct clk_init_data) { 2027 + .name = "gcc_qupv3_wrap0_qspi_ref_clk", 2028 + .parent_hws = (const struct clk_hw*[]) { 2029 + &gcc_qupv3_wrap0_qspi_ref_clk_src.clkr.hw, 2030 + }, 2031 + .num_parents = 1, 2032 + .flags = CLK_SET_RATE_PARENT, 2033 + .ops = &clk_branch2_ops, 2034 + }, 2035 + }, 2036 + }; 2037 + 2038 + static struct clk_branch gcc_qupv3_wrap0_s0_clk = { 2039 + .halt_reg = 0x18004, 2040 + .halt_check = BRANCH_HALT_VOTED, 2041 + .clkr = { 2042 + .enable_reg = 0x52008, 2043 + .enable_mask = BIT(22), 2044 + .hw.init = &(const struct clk_init_data) { 2045 + .name = "gcc_qupv3_wrap0_s0_clk", 2046 + .parent_hws = (const struct clk_hw*[]) { 2047 + &gcc_qupv3_wrap0_s0_clk_src.clkr.hw, 2048 + }, 2049 + .num_parents = 1, 2050 + .flags = CLK_SET_RATE_PARENT, 2051 + .ops = &clk_branch2_ops, 2052 + }, 2053 + }, 2054 + }; 2055 + 2056 + static struct clk_branch gcc_qupv3_wrap0_s1_clk = { 2057 + .halt_reg = 0x1813c, 2058 + .halt_check = BRANCH_HALT_VOTED, 2059 + .clkr = { 2060 + .enable_reg = 0x52008, 2061 + .enable_mask = BIT(23), 2062 + .hw.init = &(const struct clk_init_data) { 2063 + .name = "gcc_qupv3_wrap0_s1_clk", 2064 + .parent_hws = (const struct clk_hw*[]) { 2065 + &gcc_qupv3_wrap0_s1_clk_src.clkr.hw, 2066 + }, 2067 + .num_parents = 1, 2068 + .flags = CLK_SET_RATE_PARENT, 2069 + .ops = &clk_branch2_ops, 2070 + }, 2071 + }, 2072 + }; 2073 + 2074 + static struct clk_branch gcc_qupv3_wrap0_s2_clk = { 2075 + .halt_reg = 0x18274, 2076 + .halt_check = BRANCH_HALT_VOTED, 2077 + .clkr = { 2078 + .enable_reg = 0x52008, 2079 + .enable_mask = BIT(24), 2080 + .hw.init = &(const struct clk_init_data) { 2081 + .name = "gcc_qupv3_wrap0_s2_clk", 2082 + .parent_hws = (const struct clk_hw*[]) { 2083 + &gcc_qupv3_wrap0_s2_clk_src.clkr.hw, 2084 + }, 2085 + .num_parents = 1, 2086 + .flags = CLK_SET_RATE_PARENT, 2087 + .ops = &clk_branch2_ops, 2088 + }, 2089 + }, 2090 + }; 2091 + 2092 + static struct clk_branch gcc_qupv3_wrap0_s3_clk = { 2093 + .halt_reg = 0x18284, 2094 + .halt_check = BRANCH_HALT_VOTED, 2095 + .clkr = { 2096 + .enable_reg = 0x52008, 2097 + .enable_mask = BIT(25), 2098 + .hw.init = &(const struct clk_init_data) { 2099 + .name = "gcc_qupv3_wrap0_s3_clk", 2100 + .parent_hws = (const struct clk_hw*[]) { 2101 + &gcc_qupv3_wrap0_s3_clk_src.clkr.hw, 2102 + }, 2103 + .num_parents = 1, 2104 + .flags = CLK_SET_RATE_PARENT, 2105 + .ops = &clk_branch2_ops, 2106 + }, 2107 + }, 2108 + }; 2109 + 2110 + static struct clk_branch gcc_qupv3_wrap0_s4_clk = { 2111 + .halt_reg = 0x183bc, 2112 + .halt_check = BRANCH_HALT_VOTED, 2113 + .clkr = { 2114 + .enable_reg = 0x52008, 2115 + .enable_mask = BIT(26), 2116 + .hw.init = &(const struct clk_init_data) { 2117 + .name = "gcc_qupv3_wrap0_s4_clk", 2118 + .parent_hws = (const struct clk_hw*[]) { 2119 + &gcc_qupv3_wrap0_s4_clk_src.clkr.hw, 2120 + }, 2121 + .num_parents = 1, 2122 + .flags = CLK_SET_RATE_PARENT, 2123 + .ops = &clk_branch2_ops, 2124 + }, 2125 + }, 2126 + }; 2127 + 2128 + static struct clk_branch gcc_qupv3_wrap0_s5_clk = { 2129 + .halt_reg = 0x184f4, 2130 + .halt_check = BRANCH_HALT_VOTED, 2131 + .clkr = { 2132 + .enable_reg = 0x52008, 2133 + .enable_mask = BIT(27), 2134 + .hw.init = &(const struct clk_init_data) { 2135 + .name = "gcc_qupv3_wrap0_s5_clk", 2136 + .parent_hws = (const struct clk_hw*[]) { 2137 + &gcc_qupv3_wrap0_s5_clk_src.clkr.hw, 2138 + }, 2139 + .num_parents = 1, 2140 + .flags = CLK_SET_RATE_PARENT, 2141 + .ops = &clk_branch2_ops, 2142 + }, 2143 + }, 2144 + }; 2145 + 2146 + static struct clk_branch gcc_qupv3_wrap0_s6_clk = { 2147 + .halt_reg = 0x1862c, 2148 + .halt_check = BRANCH_HALT_VOTED, 2149 + .clkr = { 2150 + .enable_reg = 0x52008, 2151 + .enable_mask = BIT(28), 2152 + .hw.init = &(const struct clk_init_data) { 2153 + .name = "gcc_qupv3_wrap0_s6_clk", 2154 + .parent_hws = (const struct clk_hw*[]) { 2155 + &gcc_qupv3_wrap0_s6_clk_src.clkr.hw, 2156 + }, 2157 + .num_parents = 1, 2158 + .flags = CLK_SET_RATE_PARENT, 2159 + .ops = &clk_branch2_ops, 2160 + }, 2161 + }, 2162 + }; 2163 + 2164 + static struct clk_branch gcc_qupv3_wrap1_core_2x_clk = { 2165 + .halt_reg = 0x23168, 2166 + .halt_check = BRANCH_HALT_VOTED, 2167 + .clkr = { 2168 + .enable_reg = 0x52010, 2169 + .enable_mask = BIT(3), 2170 + .hw.init = &(const struct clk_init_data) { 2171 + .name = "gcc_qupv3_wrap1_core_2x_clk", 2172 + .ops = &clk_branch2_ops, 2173 + }, 2174 + }, 2175 + }; 2176 + 2177 + static struct clk_branch gcc_qupv3_wrap1_core_clk = { 2178 + .halt_reg = 0x23158, 2179 + .halt_check = BRANCH_HALT_VOTED, 2180 + .clkr = { 2181 + .enable_reg = 0x52010, 2182 + .enable_mask = BIT(0), 2183 + .hw.init = &(const struct clk_init_data) { 2184 + .name = "gcc_qupv3_wrap1_core_clk", 2185 + .ops = &clk_branch2_ops, 2186 + }, 2187 + }, 2188 + }; 2189 + 2190 + static struct clk_branch gcc_qupv3_wrap1_qspi_ref_clk = { 2191 + .halt_reg = 0x1e764, 2192 + .halt_check = BRANCH_HALT_VOTED, 2193 + .clkr = { 2194 + .enable_reg = 0x52010, 2195 + .enable_mask = BIT(30), 2196 + .hw.init = &(const struct clk_init_data) { 2197 + .name = "gcc_qupv3_wrap1_qspi_ref_clk", 2198 + .parent_hws = (const struct clk_hw*[]) { 2199 + &gcc_qupv3_wrap1_qspi_ref_clk_src.clkr.hw, 2200 + }, 2201 + .num_parents = 1, 2202 + .flags = CLK_SET_RATE_PARENT, 2203 + .ops = &clk_branch2_ops, 2204 + }, 2205 + }, 2206 + }; 2207 + 2208 + static struct clk_branch gcc_qupv3_wrap1_s0_clk = { 2209 + .halt_reg = 0x1e004, 2210 + .halt_check = BRANCH_HALT_VOTED, 2211 + .clkr = { 2212 + .enable_reg = 0x52010, 2213 + .enable_mask = BIT(4), 2214 + .hw.init = &(const struct clk_init_data) { 2215 + .name = "gcc_qupv3_wrap1_s0_clk", 2216 + .parent_hws = (const struct clk_hw*[]) { 2217 + &gcc_qupv3_wrap1_s0_clk_src.clkr.hw, 2218 + }, 2219 + .num_parents = 1, 2220 + .flags = CLK_SET_RATE_PARENT, 2221 + .ops = &clk_branch2_ops, 2222 + }, 2223 + }, 2224 + }; 2225 + 2226 + static struct clk_branch gcc_qupv3_wrap1_s1_clk = { 2227 + .halt_reg = 0x1e13c, 2228 + .halt_check = BRANCH_HALT_VOTED, 2229 + .clkr = { 2230 + .enable_reg = 0x52010, 2231 + .enable_mask = BIT(5), 2232 + .hw.init = &(const struct clk_init_data) { 2233 + .name = "gcc_qupv3_wrap1_s1_clk", 2234 + .parent_hws = (const struct clk_hw*[]) { 2235 + &gcc_qupv3_wrap1_s1_clk_src.clkr.hw, 2236 + }, 2237 + .num_parents = 1, 2238 + .flags = CLK_SET_RATE_PARENT, 2239 + .ops = &clk_branch2_ops, 2240 + }, 2241 + }, 2242 + }; 2243 + 2244 + static struct clk_branch gcc_qupv3_wrap1_s2_clk = { 2245 + .halt_reg = 0x1e274, 2246 + .halt_check = BRANCH_HALT_VOTED, 2247 + .clkr = { 2248 + .enable_reg = 0x52010, 2249 + .enable_mask = BIT(6), 2250 + .hw.init = &(const struct clk_init_data) { 2251 + .name = "gcc_qupv3_wrap1_s2_clk", 2252 + .parent_hws = (const struct clk_hw*[]) { 2253 + &gcc_qupv3_wrap1_s2_clk_src.clkr.hw, 2254 + }, 2255 + .num_parents = 1, 2256 + .flags = CLK_SET_RATE_PARENT, 2257 + .ops = &clk_branch2_ops, 2258 + }, 2259 + }, 2260 + }; 2261 + 2262 + static struct clk_branch gcc_qupv3_wrap1_s3_clk = { 2263 + .halt_reg = 0x1e284, 2264 + .halt_check = BRANCH_HALT_VOTED, 2265 + .clkr = { 2266 + .enable_reg = 0x52010, 2267 + .enable_mask = BIT(7), 2268 + .hw.init = &(const struct clk_init_data) { 2269 + .name = "gcc_qupv3_wrap1_s3_clk", 2270 + .parent_hws = (const struct clk_hw*[]) { 2271 + &gcc_qupv3_wrap1_s3_clk_src.clkr.hw, 2272 + }, 2273 + .num_parents = 1, 2274 + .flags = CLK_SET_RATE_PARENT, 2275 + .ops = &clk_branch2_ops, 2276 + }, 2277 + }, 2278 + }; 2279 + 2280 + static struct clk_branch gcc_qupv3_wrap1_s4_clk = { 2281 + .halt_reg = 0x1e3bc, 2282 + .halt_check = BRANCH_HALT_VOTED, 2283 + .clkr = { 2284 + .enable_reg = 0x52010, 2285 + .enable_mask = BIT(8), 2286 + .hw.init = &(const struct clk_init_data) { 2287 + .name = "gcc_qupv3_wrap1_s4_clk", 2288 + .parent_hws = (const struct clk_hw*[]) { 2289 + &gcc_qupv3_wrap1_s4_clk_src.clkr.hw, 2290 + }, 2291 + .num_parents = 1, 2292 + .flags = CLK_SET_RATE_PARENT, 2293 + .ops = &clk_branch2_ops, 2294 + }, 2295 + }, 2296 + }; 2297 + 2298 + static struct clk_branch gcc_qupv3_wrap1_s5_clk = { 2299 + .halt_reg = 0x1e4f4, 2300 + .halt_check = BRANCH_HALT_VOTED, 2301 + .clkr = { 2302 + .enable_reg = 0x52010, 2303 + .enable_mask = BIT(9), 2304 + .hw.init = &(const struct clk_init_data) { 2305 + .name = "gcc_qupv3_wrap1_s5_clk", 2306 + .parent_hws = (const struct clk_hw*[]) { 2307 + &gcc_qupv3_wrap1_s5_clk_src.clkr.hw, 2308 + }, 2309 + .num_parents = 1, 2310 + .flags = CLK_SET_RATE_PARENT, 2311 + .ops = &clk_branch2_ops, 2312 + }, 2313 + }, 2314 + }; 2315 + 2316 + static struct clk_branch gcc_qupv3_wrap1_s6_clk = { 2317 + .halt_reg = 0x1e62c, 2318 + .halt_check = BRANCH_HALT_VOTED, 2319 + .clkr = { 2320 + .enable_reg = 0x52010, 2321 + .enable_mask = BIT(10), 2322 + .hw.init = &(const struct clk_init_data) { 2323 + .name = "gcc_qupv3_wrap1_s6_clk", 2324 + .parent_hws = (const struct clk_hw*[]) { 2325 + &gcc_qupv3_wrap1_s6_clk_src.clkr.hw, 2326 + }, 2327 + .num_parents = 1, 2328 + .flags = CLK_SET_RATE_PARENT, 2329 + .ops = &clk_branch2_ops, 2330 + }, 2331 + }, 2332 + }; 2333 + 2334 + static struct clk_branch gcc_qupv3_wrap_0_m_ahb_clk = { 2335 + .halt_reg = 0x23000, 2336 + .halt_check = BRANCH_HALT_VOTED, 2337 + .clkr = { 2338 + .enable_reg = 0x52008, 2339 + .enable_mask = BIT(20), 2340 + .hw.init = &(const struct clk_init_data) { 2341 + .name = "gcc_qupv3_wrap_0_m_ahb_clk", 2342 + .ops = &clk_branch2_ops, 2343 + }, 2344 + }, 2345 + }; 2346 + 2347 + static struct clk_branch gcc_qupv3_wrap_0_s_ahb_clk = { 2348 + .halt_reg = 0x23004, 2349 + .halt_check = BRANCH_HALT_VOTED, 2350 + .hwcg_reg = 0x23004, 2351 + .hwcg_bit = 1, 2352 + .clkr = { 2353 + .enable_reg = 0x52008, 2354 + .enable_mask = BIT(21), 2355 + .hw.init = &(const struct clk_init_data) { 2356 + .name = "gcc_qupv3_wrap_0_s_ahb_clk", 2357 + .ops = &clk_branch2_ops, 2358 + }, 2359 + }, 2360 + }; 2361 + 2362 + static struct clk_branch gcc_qupv3_wrap_1_m_ahb_clk = { 2363 + .halt_reg = 0x23150, 2364 + .halt_check = BRANCH_HALT_VOTED, 2365 + .clkr = { 2366 + .enable_reg = 0x52010, 2367 + .enable_mask = BIT(2), 2368 + .hw.init = &(const struct clk_init_data) { 2369 + .name = "gcc_qupv3_wrap_1_m_ahb_clk", 2370 + .ops = &clk_branch2_ops, 2371 + }, 2372 + }, 2373 + }; 2374 + 2375 + static struct clk_branch gcc_qupv3_wrap_1_s_ahb_clk = { 2376 + .halt_reg = 0x23154, 2377 + .halt_check = BRANCH_HALT_VOTED, 2378 + .hwcg_reg = 0x23154, 2379 + .hwcg_bit = 1, 2380 + .clkr = { 2381 + .enable_reg = 0x52010, 2382 + .enable_mask = BIT(1), 2383 + .hw.init = &(const struct clk_init_data) { 2384 + .name = "gcc_qupv3_wrap_1_s_ahb_clk", 2385 + .ops = &clk_branch2_ops, 2386 + }, 2387 + }, 2388 + }; 2389 + 2390 + static struct clk_branch gcc_sdcc1_ahb_clk = { 2391 + .halt_reg = 0xa3004, 2392 + .halt_check = BRANCH_HALT, 2393 + .clkr = { 2394 + .enable_reg = 0xa3004, 2395 + .enable_mask = BIT(0), 2396 + .hw.init = &(const struct clk_init_data) { 2397 + .name = "gcc_sdcc1_ahb_clk", 2398 + .ops = &clk_branch2_ops, 2399 + }, 2400 + }, 2401 + }; 2402 + 2403 + static struct clk_branch gcc_sdcc1_apps_clk = { 2404 + .halt_reg = 0xa3008, 2405 + .halt_check = BRANCH_HALT, 2406 + .clkr = { 2407 + .enable_reg = 0xa3008, 2408 + .enable_mask = BIT(0), 2409 + .hw.init = &(const struct clk_init_data) { 2410 + .name = "gcc_sdcc1_apps_clk", 2411 + .parent_hws = (const struct clk_hw*[]) { 2412 + &gcc_sdcc1_apps_clk_src.clkr.hw, 2413 + }, 2414 + .num_parents = 1, 2415 + .flags = CLK_SET_RATE_PARENT, 2416 + .ops = &clk_branch2_ops, 2417 + }, 2418 + }, 2419 + }; 2420 + 2421 + static struct clk_branch gcc_sdcc1_ice_core_clk = { 2422 + .halt_reg = 0xa302c, 2423 + .halt_check = BRANCH_HALT_VOTED, 2424 + .hwcg_reg = 0xa302c, 2425 + .hwcg_bit = 1, 2426 + .clkr = { 2427 + .enable_reg = 0xa302c, 2428 + .enable_mask = BIT(0), 2429 + .hw.init = &(const struct clk_init_data) { 2430 + .name = "gcc_sdcc1_ice_core_clk", 2431 + .parent_hws = (const struct clk_hw*[]) { 2432 + &gcc_sdcc1_ice_core_clk_src.clkr.hw, 2433 + }, 2434 + .num_parents = 1, 2435 + .flags = CLK_SET_RATE_PARENT, 2436 + .ops = &clk_branch2_ops, 2437 + }, 2438 + }, 2439 + }; 2440 + 2441 + static struct clk_branch gcc_sdcc2_ahb_clk = { 2442 + .halt_reg = 0x14010, 2443 + .halt_check = BRANCH_HALT, 2444 + .clkr = { 2445 + .enable_reg = 0x14010, 2446 + .enable_mask = BIT(0), 2447 + .hw.init = &(const struct clk_init_data) { 2448 + .name = "gcc_sdcc2_ahb_clk", 2449 + .ops = &clk_branch2_ops, 2450 + }, 2451 + }, 2452 + }; 2453 + 2454 + static struct clk_branch gcc_sdcc2_apps_clk = { 2455 + .halt_reg = 0x14004, 2456 + .halt_check = BRANCH_HALT, 2457 + .clkr = { 2458 + .enable_reg = 0x14004, 2459 + .enable_mask = BIT(0), 2460 + .hw.init = &(const struct clk_init_data) { 2461 + .name = "gcc_sdcc2_apps_clk", 2462 + .parent_hws = (const struct clk_hw*[]) { 2463 + &gcc_sdcc2_apps_clk_src.clkr.hw, 2464 + }, 2465 + .num_parents = 1, 2466 + .flags = CLK_SET_RATE_PARENT, 2467 + .ops = &clk_branch2_ops, 2468 + }, 2469 + }, 2470 + }; 2471 + 2472 + static struct clk_branch gcc_ufs_phy_ahb_clk = { 2473 + .halt_reg = 0x77024, 2474 + .halt_check = BRANCH_HALT_VOTED, 2475 + .hwcg_reg = 0x77024, 2476 + .hwcg_bit = 1, 2477 + .clkr = { 2478 + .enable_reg = 0x77024, 2479 + .enable_mask = BIT(0), 2480 + .hw.init = &(const struct clk_init_data) { 2481 + .name = "gcc_ufs_phy_ahb_clk", 2482 + .ops = &clk_branch2_ops, 2483 + }, 2484 + }, 2485 + }; 2486 + 2487 + static struct clk_branch gcc_ufs_phy_axi_clk = { 2488 + .halt_reg = 0x77018, 2489 + .halt_check = BRANCH_HALT_VOTED, 2490 + .hwcg_reg = 0x77018, 2491 + .hwcg_bit = 1, 2492 + .clkr = { 2493 + .enable_reg = 0x77018, 2494 + .enable_mask = BIT(0), 2495 + .hw.init = &(const struct clk_init_data) { 2496 + .name = "gcc_ufs_phy_axi_clk", 2497 + .parent_hws = (const struct clk_hw*[]) { 2498 + &gcc_ufs_phy_axi_clk_src.clkr.hw, 2499 + }, 2500 + .num_parents = 1, 2501 + .flags = CLK_SET_RATE_PARENT, 2502 + .ops = &clk_branch2_ops, 2503 + }, 2504 + }, 2505 + }; 2506 + 2507 + static struct clk_branch gcc_ufs_phy_axi_hw_ctl_clk = { 2508 + .halt_reg = 0x77018, 2509 + .halt_check = BRANCH_HALT_VOTED, 2510 + .hwcg_reg = 0x77018, 2511 + .hwcg_bit = 1, 2512 + .clkr = { 2513 + .enable_reg = 0x77018, 2514 + .enable_mask = BIT(1), 2515 + .hw.init = &(const struct clk_init_data) { 2516 + .name = "gcc_ufs_phy_axi_hw_ctl_clk", 2517 + .parent_hws = (const struct clk_hw*[]) { 2518 + &gcc_ufs_phy_axi_clk_src.clkr.hw, 2519 + }, 2520 + .num_parents = 1, 2521 + .flags = CLK_SET_RATE_PARENT, 2522 + .ops = &clk_branch2_ops, 2523 + }, 2524 + }, 2525 + }; 2526 + 2527 + static struct clk_branch gcc_ufs_phy_ice_core_clk = { 2528 + .halt_reg = 0x77074, 2529 + .halt_check = BRANCH_HALT_VOTED, 2530 + .hwcg_reg = 0x77074, 2531 + .hwcg_bit = 1, 2532 + .clkr = { 2533 + .enable_reg = 0x77074, 2534 + .enable_mask = BIT(0), 2535 + .hw.init = &(const struct clk_init_data) { 2536 + .name = "gcc_ufs_phy_ice_core_clk", 2537 + .parent_hws = (const struct clk_hw*[]) { 2538 + &gcc_ufs_phy_ice_core_clk_src.clkr.hw, 2539 + }, 2540 + .num_parents = 1, 2541 + .flags = CLK_SET_RATE_PARENT, 2542 + .ops = &clk_branch2_ops, 2543 + }, 2544 + }, 2545 + }; 2546 + 2547 + static struct clk_branch gcc_ufs_phy_ice_core_hw_ctl_clk = { 2548 + .halt_reg = 0x77074, 2549 + .halt_check = BRANCH_HALT_VOTED, 2550 + .hwcg_reg = 0x77074, 2551 + .hwcg_bit = 1, 2552 + .clkr = { 2553 + .enable_reg = 0x77074, 2554 + .enable_mask = BIT(1), 2555 + .hw.init = &(const struct clk_init_data) { 2556 + .name = "gcc_ufs_phy_ice_core_hw_ctl_clk", 2557 + .parent_hws = (const struct clk_hw*[]) { 2558 + &gcc_ufs_phy_ice_core_clk_src.clkr.hw, 2559 + }, 2560 + .num_parents = 1, 2561 + .flags = CLK_SET_RATE_PARENT, 2562 + .ops = &clk_branch2_ops, 2563 + }, 2564 + }, 2565 + }; 2566 + 2567 + static struct clk_branch gcc_ufs_phy_phy_aux_clk = { 2568 + .halt_reg = 0x770b0, 2569 + .halt_check = BRANCH_HALT_VOTED, 2570 + .hwcg_reg = 0x770b0, 2571 + .hwcg_bit = 1, 2572 + .clkr = { 2573 + .enable_reg = 0x770b0, 2574 + .enable_mask = BIT(0), 2575 + .hw.init = &(const struct clk_init_data) { 2576 + .name = "gcc_ufs_phy_phy_aux_clk", 2577 + .parent_hws = (const struct clk_hw*[]) { 2578 + &gcc_ufs_phy_phy_aux_clk_src.clkr.hw, 2579 + }, 2580 + .num_parents = 1, 2581 + .flags = CLK_SET_RATE_PARENT, 2582 + .ops = &clk_branch2_ops, 2583 + }, 2584 + }, 2585 + }; 2586 + 2587 + static struct clk_branch gcc_ufs_phy_phy_aux_hw_ctl_clk = { 2588 + .halt_reg = 0x770b0, 2589 + .halt_check = BRANCH_HALT_VOTED, 2590 + .hwcg_reg = 0x770b0, 2591 + .hwcg_bit = 1, 2592 + .clkr = { 2593 + .enable_reg = 0x770b0, 2594 + .enable_mask = BIT(1), 2595 + .hw.init = &(const struct clk_init_data) { 2596 + .name = "gcc_ufs_phy_phy_aux_hw_ctl_clk", 2597 + .parent_hws = (const struct clk_hw*[]) { 2598 + &gcc_ufs_phy_phy_aux_clk_src.clkr.hw, 2599 + }, 2600 + .num_parents = 1, 2601 + .flags = CLK_SET_RATE_PARENT, 2602 + .ops = &clk_branch2_ops, 2603 + }, 2604 + }, 2605 + }; 2606 + 2607 + static struct clk_branch gcc_ufs_phy_rx_symbol_0_clk = { 2608 + .halt_reg = 0x7702c, 2609 + .halt_check = BRANCH_HALT_DELAY, 2610 + .clkr = { 2611 + .enable_reg = 0x7702c, 2612 + .enable_mask = BIT(0), 2613 + .hw.init = &(const struct clk_init_data) { 2614 + .name = "gcc_ufs_phy_rx_symbol_0_clk", 2615 + .parent_hws = (const struct clk_hw*[]) { 2616 + &gcc_ufs_phy_rx_symbol_0_clk_src.clkr.hw, 2617 + }, 2618 + .num_parents = 1, 2619 + .flags = CLK_SET_RATE_PARENT, 2620 + .ops = &clk_branch2_ops, 2621 + }, 2622 + }, 2623 + }; 2624 + 2625 + static struct clk_branch gcc_ufs_phy_rx_symbol_1_clk = { 2626 + .halt_reg = 0x770cc, 2627 + .halt_check = BRANCH_HALT_DELAY, 2628 + .clkr = { 2629 + .enable_reg = 0x770cc, 2630 + .enable_mask = BIT(0), 2631 + .hw.init = &(const struct clk_init_data) { 2632 + .name = "gcc_ufs_phy_rx_symbol_1_clk", 2633 + .parent_hws = (const struct clk_hw*[]) { 2634 + &gcc_ufs_phy_rx_symbol_1_clk_src.clkr.hw, 2635 + }, 2636 + .num_parents = 1, 2637 + .flags = CLK_SET_RATE_PARENT, 2638 + .ops = &clk_branch2_ops, 2639 + }, 2640 + }, 2641 + }; 2642 + 2643 + static struct clk_branch gcc_ufs_phy_tx_symbol_0_clk = { 2644 + .halt_reg = 0x77028, 2645 + .halt_check = BRANCH_HALT_DELAY, 2646 + .clkr = { 2647 + .enable_reg = 0x77028, 2648 + .enable_mask = BIT(0), 2649 + .hw.init = &(const struct clk_init_data) { 2650 + .name = "gcc_ufs_phy_tx_symbol_0_clk", 2651 + .parent_hws = (const struct clk_hw*[]) { 2652 + &gcc_ufs_phy_tx_symbol_0_clk_src.clkr.hw, 2653 + }, 2654 + .num_parents = 1, 2655 + .flags = CLK_SET_RATE_PARENT, 2656 + .ops = &clk_branch2_ops, 2657 + }, 2658 + }, 2659 + }; 2660 + 2661 + static struct clk_branch gcc_ufs_phy_unipro_core_clk = { 2662 + .halt_reg = 0x77068, 2663 + .halt_check = BRANCH_HALT_VOTED, 2664 + .hwcg_reg = 0x77068, 2665 + .hwcg_bit = 1, 2666 + .clkr = { 2667 + .enable_reg = 0x77068, 2668 + .enable_mask = BIT(0), 2669 + .hw.init = &(const struct clk_init_data) { 2670 + .name = "gcc_ufs_phy_unipro_core_clk", 2671 + .parent_hws = (const struct clk_hw*[]) { 2672 + &gcc_ufs_phy_unipro_core_clk_src.clkr.hw, 2673 + }, 2674 + .num_parents = 1, 2675 + .flags = CLK_SET_RATE_PARENT, 2676 + .ops = &clk_branch2_ops, 2677 + }, 2678 + }, 2679 + }; 2680 + 2681 + static struct clk_branch gcc_ufs_phy_unipro_core_hw_ctl_clk = { 2682 + .halt_reg = 0x77068, 2683 + .halt_check = BRANCH_HALT_VOTED, 2684 + .hwcg_reg = 0x77068, 2685 + .hwcg_bit = 1, 2686 + .clkr = { 2687 + .enable_reg = 0x77068, 2688 + .enable_mask = BIT(1), 2689 + .hw.init = &(const struct clk_init_data) { 2690 + .name = "gcc_ufs_phy_unipro_core_hw_ctl_clk", 2691 + .parent_hws = (const struct clk_hw*[]) { 2692 + &gcc_ufs_phy_unipro_core_clk_src.clkr.hw, 2693 + }, 2694 + .num_parents = 1, 2695 + .flags = CLK_SET_RATE_PARENT, 2696 + .ops = &clk_branch2_ops, 2697 + }, 2698 + }, 2699 + }; 2700 + 2701 + static struct clk_branch gcc_usb30_prim_atb_clk = { 2702 + .halt_reg = 0x39088, 2703 + .halt_check = BRANCH_HALT_VOTED, 2704 + .clkr = { 2705 + .enable_reg = 0x39088, 2706 + .enable_mask = BIT(0), 2707 + .hw.init = &(const struct clk_init_data) { 2708 + .name = "gcc_usb30_prim_atb_clk", 2709 + .parent_hws = (const struct clk_hw*[]) { 2710 + &gcc_usb30_prim_master_clk_src.clkr.hw, 2711 + }, 2712 + .num_parents = 1, 2713 + .flags = CLK_SET_RATE_PARENT, 2714 + .ops = &clk_branch2_ops, 2715 + }, 2716 + }, 2717 + }; 2718 + 2719 + static struct clk_branch gcc_usb30_prim_master_clk = { 2720 + .halt_reg = 0x39018, 2721 + .halt_check = BRANCH_HALT, 2722 + .clkr = { 2723 + .enable_reg = 0x39018, 2724 + .enable_mask = BIT(0), 2725 + .hw.init = &(const struct clk_init_data) { 2726 + .name = "gcc_usb30_prim_master_clk", 2727 + .parent_hws = (const struct clk_hw*[]) { 2728 + &gcc_usb30_prim_master_clk_src.clkr.hw, 2729 + }, 2730 + .num_parents = 1, 2731 + .flags = CLK_SET_RATE_PARENT, 2732 + .ops = &clk_branch2_ops, 2733 + }, 2734 + }, 2735 + }; 2736 + 2737 + static struct clk_branch gcc_usb30_prim_mock_utmi_clk = { 2738 + .halt_reg = 0x39028, 2739 + .halt_check = BRANCH_HALT, 2740 + .clkr = { 2741 + .enable_reg = 0x39028, 2742 + .enable_mask = BIT(0), 2743 + .hw.init = &(const struct clk_init_data) { 2744 + .name = "gcc_usb30_prim_mock_utmi_clk", 2745 + .parent_hws = (const struct clk_hw*[]) { 2746 + &gcc_usb30_prim_mock_utmi_postdiv_clk_src.clkr.hw, 2747 + }, 2748 + .num_parents = 1, 2749 + .flags = CLK_SET_RATE_PARENT, 2750 + .ops = &clk_branch2_ops, 2751 + }, 2752 + }, 2753 + }; 2754 + 2755 + static struct clk_branch gcc_usb30_prim_sleep_clk = { 2756 + .halt_reg = 0x39024, 2757 + .halt_check = BRANCH_HALT, 2758 + .clkr = { 2759 + .enable_reg = 0x39024, 2760 + .enable_mask = BIT(0), 2761 + .hw.init = &(const struct clk_init_data) { 2762 + .name = "gcc_usb30_prim_sleep_clk", 2763 + .ops = &clk_branch2_ops, 2764 + }, 2765 + }, 2766 + }; 2767 + 2768 + static struct clk_branch gcc_usb3_prim_phy_aux_clk = { 2769 + .halt_reg = 0x39060, 2770 + .halt_check = BRANCH_HALT, 2771 + .clkr = { 2772 + .enable_reg = 0x39060, 2773 + .enable_mask = BIT(0), 2774 + .hw.init = &(const struct clk_init_data) { 2775 + .name = "gcc_usb3_prim_phy_aux_clk", 2776 + .parent_hws = (const struct clk_hw*[]) { 2777 + &gcc_usb3_prim_phy_aux_clk_src.clkr.hw, 2778 + }, 2779 + .num_parents = 1, 2780 + .flags = CLK_SET_RATE_PARENT, 2781 + .ops = &clk_branch2_ops, 2782 + }, 2783 + }, 2784 + }; 2785 + 2786 + static struct clk_branch gcc_usb3_prim_phy_com_aux_clk = { 2787 + .halt_reg = 0x39064, 2788 + .halt_check = BRANCH_HALT, 2789 + .clkr = { 2790 + .enable_reg = 0x39064, 2791 + .enable_mask = BIT(0), 2792 + .hw.init = &(const struct clk_init_data) { 2793 + .name = "gcc_usb3_prim_phy_com_aux_clk", 2794 + .parent_hws = (const struct clk_hw*[]) { 2795 + &gcc_usb3_prim_phy_aux_clk_src.clkr.hw, 2796 + }, 2797 + .num_parents = 1, 2798 + .flags = CLK_SET_RATE_PARENT, 2799 + .ops = &clk_branch2_ops, 2800 + }, 2801 + }, 2802 + }; 2803 + 2804 + static struct clk_branch gcc_usb3_prim_phy_pipe_clk = { 2805 + .halt_reg = 0x39068, 2806 + .halt_check = BRANCH_HALT_DELAY, 2807 + .hwcg_reg = 0x39068, 2808 + .hwcg_bit = 1, 2809 + .clkr = { 2810 + .enable_reg = 0x39068, 2811 + .enable_mask = BIT(0), 2812 + .hw.init = &(const struct clk_init_data) { 2813 + .name = "gcc_usb3_prim_phy_pipe_clk", 2814 + .parent_hws = (const struct clk_hw*[]) { 2815 + &gcc_usb3_prim_phy_pipe_clk_src.clkr.hw, 2816 + }, 2817 + .num_parents = 1, 2818 + .flags = CLK_SET_RATE_PARENT, 2819 + .ops = &clk_branch2_ops, 2820 + }, 2821 + }, 2822 + }; 2823 + 2824 + static struct clk_branch gcc_video_axi0_clk = { 2825 + .halt_reg = 0x32018, 2826 + .halt_check = BRANCH_HALT_SKIP, 2827 + .hwcg_reg = 0x32018, 2828 + .hwcg_bit = 1, 2829 + .clkr = { 2830 + .enable_reg = 0x32018, 2831 + .enable_mask = BIT(0), 2832 + .hw.init = &(const struct clk_init_data) { 2833 + .name = "gcc_video_axi0_clk", 2834 + .ops = &clk_branch2_ops, 2835 + }, 2836 + }, 2837 + }; 2838 + 2839 + static struct gdsc pcie_0_gdsc = { 2840 + .gdscr = 0x6b004, 2841 + .collapse_ctrl = 0x5214c, 2842 + .collapse_mask = BIT(0), 2843 + .en_rest_wait_val = 0x2, 2844 + .en_few_wait_val = 0x2, 2845 + .clk_dis_wait_val = 0xf, 2846 + .pd = { 2847 + .name = "pcie_0_gdsc", 2848 + }, 2849 + .pwrsts = PWRSTS_OFF_ON, 2850 + .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 2851 + }; 2852 + 2853 + static struct gdsc pcie_0_phy_gdsc = { 2854 + .gdscr = 0x6c000, 2855 + .collapse_ctrl = 0x5214c, 2856 + .collapse_mask = BIT(1), 2857 + .en_rest_wait_val = 0x2, 2858 + .en_few_wait_val = 0x2, 2859 + .clk_dis_wait_val = 0x2, 2860 + .pd = { 2861 + .name = "pcie_0_phy_gdsc", 2862 + }, 2863 + .pwrsts = PWRSTS_OFF_ON, 2864 + .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 2865 + }; 2866 + 2867 + static struct gdsc pcie_1_gdsc = { 2868 + .gdscr = 0x90004, 2869 + .collapse_ctrl = 0x5214c, 2870 + .collapse_mask = BIT(3), 2871 + .en_rest_wait_val = 0x2, 2872 + .en_few_wait_val = 0x2, 2873 + .clk_dis_wait_val = 0xf, 2874 + .pd = { 2875 + .name = "pcie_1_gdsc", 2876 + }, 2877 + .pwrsts = PWRSTS_OFF_ON, 2878 + .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 2879 + }; 2880 + 2881 + static struct gdsc pcie_1_phy_gdsc = { 2882 + .gdscr = 0xa2000, 2883 + .collapse_ctrl = 0x5214c, 2884 + .collapse_mask = BIT(4), 2885 + .en_rest_wait_val = 0x2, 2886 + .en_few_wait_val = 0x2, 2887 + .clk_dis_wait_val = 0x2, 2888 + .pd = { 2889 + .name = "pcie_1_phy_gdsc", 2890 + }, 2891 + .pwrsts = PWRSTS_OFF_ON, 2892 + .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 2893 + }; 2894 + 2895 + static struct gdsc ufs_phy_gdsc = { 2896 + .gdscr = 0x77004, 2897 + .en_rest_wait_val = 0x2, 2898 + .en_few_wait_val = 0x2, 2899 + .clk_dis_wait_val = 0xf, 2900 + .pd = { 2901 + .name = "ufs_phy_gdsc", 2902 + }, 2903 + .pwrsts = PWRSTS_OFF_ON, 2904 + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 2905 + }; 2906 + 2907 + static struct gdsc ufs_mem_phy_gdsc = { 2908 + .gdscr = 0x9e000, 2909 + .en_rest_wait_val = 0x2, 2910 + .en_few_wait_val = 0x2, 2911 + .clk_dis_wait_val = 0x2, 2912 + .pd = { 2913 + .name = "ufs_mem_phy_gdsc", 2914 + }, 2915 + .pwrsts = PWRSTS_OFF_ON, 2916 + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 2917 + }; 2918 + 2919 + static struct gdsc usb30_prim_gdsc = { 2920 + .gdscr = 0x39004, 2921 + .en_rest_wait_val = 0x2, 2922 + .en_few_wait_val = 0x2, 2923 + .clk_dis_wait_val = 0xf, 2924 + .pd = { 2925 + .name = "usb30_prim_gdsc", 2926 + }, 2927 + .pwrsts = PWRSTS_RET_ON, 2928 + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 2929 + }; 2930 + 2931 + static struct gdsc usb3_phy_gdsc = { 2932 + .gdscr = 0x5000c, 2933 + .en_rest_wait_val = 0x2, 2934 + .en_few_wait_val = 0x2, 2935 + .clk_dis_wait_val = 0x2, 2936 + .pd = { 2937 + .name = "usb3_phy_gdsc", 2938 + }, 2939 + .pwrsts = PWRSTS_RET_ON, 2940 + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 2941 + }; 2942 + 2943 + static struct clk_regmap *gcc_milos_clocks[] = { 2944 + [GCC_AGGRE_NOC_PCIE_AXI_CLK] = &gcc_aggre_noc_pcie_axi_clk.clkr, 2945 + [GCC_AGGRE_UFS_PHY_AXI_CLK] = &gcc_aggre_ufs_phy_axi_clk.clkr, 2946 + [GCC_AGGRE_UFS_PHY_AXI_HW_CTL_CLK] = &gcc_aggre_ufs_phy_axi_hw_ctl_clk.clkr, 2947 + [GCC_AGGRE_USB3_PRIM_AXI_CLK] = &gcc_aggre_usb3_prim_axi_clk.clkr, 2948 + [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr, 2949 + [GCC_CAMERA_HF_AXI_CLK] = &gcc_camera_hf_axi_clk.clkr, 2950 + [GCC_CAMERA_SF_AXI_CLK] = &gcc_camera_sf_axi_clk.clkr, 2951 + [GCC_CFG_NOC_PCIE_ANOC_AHB_CLK] = &gcc_cfg_noc_pcie_anoc_ahb_clk.clkr, 2952 + [GCC_CFG_NOC_USB3_PRIM_AXI_CLK] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr, 2953 + [GCC_CNOC_PCIE_SF_AXI_CLK] = &gcc_cnoc_pcie_sf_axi_clk.clkr, 2954 + [GCC_DDRSS_GPU_AXI_CLK] = &gcc_ddrss_gpu_axi_clk.clkr, 2955 + [GCC_DDRSS_PCIE_SF_QTB_CLK] = &gcc_ddrss_pcie_sf_qtb_clk.clkr, 2956 + [GCC_DISP_GPLL0_DIV_CLK_SRC] = &gcc_disp_gpll0_div_clk_src.clkr, 2957 + [GCC_DISP_HF_AXI_CLK] = &gcc_disp_hf_axi_clk.clkr, 2958 + [GCC_GP1_CLK] = &gcc_gp1_clk.clkr, 2959 + [GCC_GP1_CLK_SRC] = &gcc_gp1_clk_src.clkr, 2960 + [GCC_GP2_CLK] = &gcc_gp2_clk.clkr, 2961 + [GCC_GP2_CLK_SRC] = &gcc_gp2_clk_src.clkr, 2962 + [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, 2963 + [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr, 2964 + [GCC_GPLL0] = &gcc_gpll0.clkr, 2965 + [GCC_GPLL0_OUT_EVEN] = &gcc_gpll0_out_even.clkr, 2966 + [GCC_GPLL2] = &gcc_gpll2.clkr, 2967 + [GCC_GPLL4] = &gcc_gpll4.clkr, 2968 + [GCC_GPLL6] = &gcc_gpll6.clkr, 2969 + [GCC_GPLL7] = &gcc_gpll7.clkr, 2970 + [GCC_GPLL9] = &gcc_gpll9.clkr, 2971 + [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr, 2972 + [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr, 2973 + [GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr, 2974 + [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr, 2975 + [GCC_PCIE_0_AUX_CLK] = &gcc_pcie_0_aux_clk.clkr, 2976 + [GCC_PCIE_0_AUX_CLK_SRC] = &gcc_pcie_0_aux_clk_src.clkr, 2977 + [GCC_PCIE_0_CFG_AHB_CLK] = &gcc_pcie_0_cfg_ahb_clk.clkr, 2978 + [GCC_PCIE_0_MSTR_AXI_CLK] = &gcc_pcie_0_mstr_axi_clk.clkr, 2979 + [GCC_PCIE_0_PHY_RCHNG_CLK] = &gcc_pcie_0_phy_rchng_clk.clkr, 2980 + [GCC_PCIE_0_PHY_RCHNG_CLK_SRC] = &gcc_pcie_0_phy_rchng_clk_src.clkr, 2981 + [GCC_PCIE_0_PIPE_CLK] = &gcc_pcie_0_pipe_clk.clkr, 2982 + [GCC_PCIE_0_PIPE_CLK_SRC] = &gcc_pcie_0_pipe_clk_src.clkr, 2983 + [GCC_PCIE_0_PIPE_DIV2_CLK] = &gcc_pcie_0_pipe_div2_clk.clkr, 2984 + [GCC_PCIE_0_PIPE_DIV2_CLK_SRC] = &gcc_pcie_0_pipe_div2_clk_src.clkr, 2985 + [GCC_PCIE_0_SLV_AXI_CLK] = &gcc_pcie_0_slv_axi_clk.clkr, 2986 + [GCC_PCIE_0_SLV_Q2A_AXI_CLK] = &gcc_pcie_0_slv_q2a_axi_clk.clkr, 2987 + [GCC_PCIE_1_AUX_CLK] = &gcc_pcie_1_aux_clk.clkr, 2988 + [GCC_PCIE_1_AUX_CLK_SRC] = &gcc_pcie_1_aux_clk_src.clkr, 2989 + [GCC_PCIE_1_CFG_AHB_CLK] = &gcc_pcie_1_cfg_ahb_clk.clkr, 2990 + [GCC_PCIE_1_MSTR_AXI_CLK] = &gcc_pcie_1_mstr_axi_clk.clkr, 2991 + [GCC_PCIE_1_PHY_RCHNG_CLK] = &gcc_pcie_1_phy_rchng_clk.clkr, 2992 + [GCC_PCIE_1_PHY_RCHNG_CLK_SRC] = &gcc_pcie_1_phy_rchng_clk_src.clkr, 2993 + [GCC_PCIE_1_PIPE_CLK] = &gcc_pcie_1_pipe_clk.clkr, 2994 + [GCC_PCIE_1_PIPE_CLK_SRC] = &gcc_pcie_1_pipe_clk_src.clkr, 2995 + [GCC_PCIE_1_PIPE_DIV2_CLK] = &gcc_pcie_1_pipe_div2_clk.clkr, 2996 + [GCC_PCIE_1_PIPE_DIV2_CLK_SRC] = &gcc_pcie_1_pipe_div2_clk_src.clkr, 2997 + [GCC_PCIE_1_SLV_AXI_CLK] = &gcc_pcie_1_slv_axi_clk.clkr, 2998 + [GCC_PCIE_1_SLV_Q2A_AXI_CLK] = &gcc_pcie_1_slv_q2a_axi_clk.clkr, 2999 + [GCC_PCIE_RSCC_CFG_AHB_CLK] = &gcc_pcie_rscc_cfg_ahb_clk.clkr, 3000 + [GCC_PCIE_RSCC_XO_CLK] = &gcc_pcie_rscc_xo_clk.clkr, 3001 + [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr, 3002 + [GCC_PDM2_CLK_SRC] = &gcc_pdm2_clk_src.clkr, 3003 + [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr, 3004 + [GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr, 3005 + [GCC_QMIP_CAMERA_NRT_AHB_CLK] = &gcc_qmip_camera_nrt_ahb_clk.clkr, 3006 + [GCC_QMIP_CAMERA_RT_AHB_CLK] = &gcc_qmip_camera_rt_ahb_clk.clkr, 3007 + [GCC_QMIP_DISP_AHB_CLK] = &gcc_qmip_disp_ahb_clk.clkr, 3008 + [GCC_QMIP_GPU_AHB_CLK] = &gcc_qmip_gpu_ahb_clk.clkr, 3009 + [GCC_QMIP_PCIE_AHB_CLK] = &gcc_qmip_pcie_ahb_clk.clkr, 3010 + [GCC_QMIP_VIDEO_CV_CPU_AHB_CLK] = &gcc_qmip_video_cv_cpu_ahb_clk.clkr, 3011 + [GCC_QMIP_VIDEO_CVP_AHB_CLK] = &gcc_qmip_video_cvp_ahb_clk.clkr, 3012 + [GCC_QMIP_VIDEO_V_CPU_AHB_CLK] = &gcc_qmip_video_v_cpu_ahb_clk.clkr, 3013 + [GCC_QMIP_VIDEO_VCODEC_AHB_CLK] = &gcc_qmip_video_vcodec_ahb_clk.clkr, 3014 + [GCC_QUPV3_WRAP0_CORE_2X_CLK] = &gcc_qupv3_wrap0_core_2x_clk.clkr, 3015 + [GCC_QUPV3_WRAP0_CORE_CLK] = &gcc_qupv3_wrap0_core_clk.clkr, 3016 + [GCC_QUPV3_WRAP0_QSPI_REF_CLK] = &gcc_qupv3_wrap0_qspi_ref_clk.clkr, 3017 + [GCC_QUPV3_WRAP0_QSPI_REF_CLK_SRC] = &gcc_qupv3_wrap0_qspi_ref_clk_src.clkr, 3018 + [GCC_QUPV3_WRAP0_S0_CLK] = &gcc_qupv3_wrap0_s0_clk.clkr, 3019 + [GCC_QUPV3_WRAP0_S0_CLK_SRC] = &gcc_qupv3_wrap0_s0_clk_src.clkr, 3020 + [GCC_QUPV3_WRAP0_S1_CLK] = &gcc_qupv3_wrap0_s1_clk.clkr, 3021 + [GCC_QUPV3_WRAP0_S1_CLK_SRC] = &gcc_qupv3_wrap0_s1_clk_src.clkr, 3022 + [GCC_QUPV3_WRAP0_S2_CLK] = &gcc_qupv3_wrap0_s2_clk.clkr, 3023 + [GCC_QUPV3_WRAP0_S2_CLK_SRC] = &gcc_qupv3_wrap0_s2_clk_src.clkr, 3024 + [GCC_QUPV3_WRAP0_S3_CLK] = &gcc_qupv3_wrap0_s3_clk.clkr, 3025 + [GCC_QUPV3_WRAP0_S3_CLK_SRC] = &gcc_qupv3_wrap0_s3_clk_src.clkr, 3026 + [GCC_QUPV3_WRAP0_S4_CLK] = &gcc_qupv3_wrap0_s4_clk.clkr, 3027 + [GCC_QUPV3_WRAP0_S4_CLK_SRC] = &gcc_qupv3_wrap0_s4_clk_src.clkr, 3028 + [GCC_QUPV3_WRAP0_S5_CLK] = &gcc_qupv3_wrap0_s5_clk.clkr, 3029 + [GCC_QUPV3_WRAP0_S5_CLK_SRC] = &gcc_qupv3_wrap0_s5_clk_src.clkr, 3030 + [GCC_QUPV3_WRAP0_S6_CLK] = &gcc_qupv3_wrap0_s6_clk.clkr, 3031 + [GCC_QUPV3_WRAP0_S6_CLK_SRC] = &gcc_qupv3_wrap0_s6_clk_src.clkr, 3032 + [GCC_QUPV3_WRAP1_CORE_2X_CLK] = &gcc_qupv3_wrap1_core_2x_clk.clkr, 3033 + [GCC_QUPV3_WRAP1_CORE_CLK] = &gcc_qupv3_wrap1_core_clk.clkr, 3034 + [GCC_QUPV3_WRAP1_QSPI_REF_CLK] = &gcc_qupv3_wrap1_qspi_ref_clk.clkr, 3035 + [GCC_QUPV3_WRAP1_QSPI_REF_CLK_SRC] = &gcc_qupv3_wrap1_qspi_ref_clk_src.clkr, 3036 + [GCC_QUPV3_WRAP1_S0_CLK] = &gcc_qupv3_wrap1_s0_clk.clkr, 3037 + [GCC_QUPV3_WRAP1_S0_CLK_SRC] = &gcc_qupv3_wrap1_s0_clk_src.clkr, 3038 + [GCC_QUPV3_WRAP1_S1_CLK] = &gcc_qupv3_wrap1_s1_clk.clkr, 3039 + [GCC_QUPV3_WRAP1_S1_CLK_SRC] = &gcc_qupv3_wrap1_s1_clk_src.clkr, 3040 + [GCC_QUPV3_WRAP1_S2_CLK] = &gcc_qupv3_wrap1_s2_clk.clkr, 3041 + [GCC_QUPV3_WRAP1_S2_CLK_SRC] = &gcc_qupv3_wrap1_s2_clk_src.clkr, 3042 + [GCC_QUPV3_WRAP1_S3_CLK] = &gcc_qupv3_wrap1_s3_clk.clkr, 3043 + [GCC_QUPV3_WRAP1_S3_CLK_SRC] = &gcc_qupv3_wrap1_s3_clk_src.clkr, 3044 + [GCC_QUPV3_WRAP1_S4_CLK] = &gcc_qupv3_wrap1_s4_clk.clkr, 3045 + [GCC_QUPV3_WRAP1_S4_CLK_SRC] = &gcc_qupv3_wrap1_s4_clk_src.clkr, 3046 + [GCC_QUPV3_WRAP1_S5_CLK] = &gcc_qupv3_wrap1_s5_clk.clkr, 3047 + [GCC_QUPV3_WRAP1_S5_CLK_SRC] = &gcc_qupv3_wrap1_s5_clk_src.clkr, 3048 + [GCC_QUPV3_WRAP1_S6_CLK] = &gcc_qupv3_wrap1_s6_clk.clkr, 3049 + [GCC_QUPV3_WRAP1_S6_CLK_SRC] = &gcc_qupv3_wrap1_s6_clk_src.clkr, 3050 + [GCC_QUPV3_WRAP_0_M_AHB_CLK] = &gcc_qupv3_wrap_0_m_ahb_clk.clkr, 3051 + [GCC_QUPV3_WRAP_0_S_AHB_CLK] = &gcc_qupv3_wrap_0_s_ahb_clk.clkr, 3052 + [GCC_QUPV3_WRAP_1_M_AHB_CLK] = &gcc_qupv3_wrap_1_m_ahb_clk.clkr, 3053 + [GCC_QUPV3_WRAP_1_S_AHB_CLK] = &gcc_qupv3_wrap_1_s_ahb_clk.clkr, 3054 + [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr, 3055 + [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr, 3056 + [GCC_SDCC1_APPS_CLK_SRC] = &gcc_sdcc1_apps_clk_src.clkr, 3057 + [GCC_SDCC1_ICE_CORE_CLK] = &gcc_sdcc1_ice_core_clk.clkr, 3058 + [GCC_SDCC1_ICE_CORE_CLK_SRC] = &gcc_sdcc1_ice_core_clk_src.clkr, 3059 + [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr, 3060 + [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr, 3061 + [GCC_SDCC2_APPS_CLK_SRC] = &gcc_sdcc2_apps_clk_src.clkr, 3062 + [GCC_UFS_PHY_AHB_CLK] = &gcc_ufs_phy_ahb_clk.clkr, 3063 + [GCC_UFS_PHY_AXI_CLK] = &gcc_ufs_phy_axi_clk.clkr, 3064 + [GCC_UFS_PHY_AXI_CLK_SRC] = &gcc_ufs_phy_axi_clk_src.clkr, 3065 + [GCC_UFS_PHY_AXI_HW_CTL_CLK] = &gcc_ufs_phy_axi_hw_ctl_clk.clkr, 3066 + [GCC_UFS_PHY_ICE_CORE_CLK] = &gcc_ufs_phy_ice_core_clk.clkr, 3067 + [GCC_UFS_PHY_ICE_CORE_CLK_SRC] = &gcc_ufs_phy_ice_core_clk_src.clkr, 3068 + [GCC_UFS_PHY_ICE_CORE_HW_CTL_CLK] = &gcc_ufs_phy_ice_core_hw_ctl_clk.clkr, 3069 + [GCC_UFS_PHY_PHY_AUX_CLK] = &gcc_ufs_phy_phy_aux_clk.clkr, 3070 + [GCC_UFS_PHY_PHY_AUX_CLK_SRC] = &gcc_ufs_phy_phy_aux_clk_src.clkr, 3071 + [GCC_UFS_PHY_PHY_AUX_HW_CTL_CLK] = &gcc_ufs_phy_phy_aux_hw_ctl_clk.clkr, 3072 + [GCC_UFS_PHY_RX_SYMBOL_0_CLK] = &gcc_ufs_phy_rx_symbol_0_clk.clkr, 3073 + [GCC_UFS_PHY_RX_SYMBOL_0_CLK_SRC] = &gcc_ufs_phy_rx_symbol_0_clk_src.clkr, 3074 + [GCC_UFS_PHY_RX_SYMBOL_1_CLK] = &gcc_ufs_phy_rx_symbol_1_clk.clkr, 3075 + [GCC_UFS_PHY_RX_SYMBOL_1_CLK_SRC] = &gcc_ufs_phy_rx_symbol_1_clk_src.clkr, 3076 + [GCC_UFS_PHY_TX_SYMBOL_0_CLK] = &gcc_ufs_phy_tx_symbol_0_clk.clkr, 3077 + [GCC_UFS_PHY_TX_SYMBOL_0_CLK_SRC] = &gcc_ufs_phy_tx_symbol_0_clk_src.clkr, 3078 + [GCC_UFS_PHY_UNIPRO_CORE_CLK] = &gcc_ufs_phy_unipro_core_clk.clkr, 3079 + [GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC] = &gcc_ufs_phy_unipro_core_clk_src.clkr, 3080 + [GCC_UFS_PHY_UNIPRO_CORE_HW_CTL_CLK] = &gcc_ufs_phy_unipro_core_hw_ctl_clk.clkr, 3081 + [GCC_USB30_PRIM_ATB_CLK] = &gcc_usb30_prim_atb_clk.clkr, 3082 + [GCC_USB30_PRIM_MASTER_CLK] = &gcc_usb30_prim_master_clk.clkr, 3083 + [GCC_USB30_PRIM_MASTER_CLK_SRC] = &gcc_usb30_prim_master_clk_src.clkr, 3084 + [GCC_USB30_PRIM_MOCK_UTMI_CLK] = &gcc_usb30_prim_mock_utmi_clk.clkr, 3085 + [GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC] = &gcc_usb30_prim_mock_utmi_clk_src.clkr, 3086 + [GCC_USB30_PRIM_MOCK_UTMI_POSTDIV_CLK_SRC] = &gcc_usb30_prim_mock_utmi_postdiv_clk_src.clkr, 3087 + [GCC_USB30_PRIM_SLEEP_CLK] = &gcc_usb30_prim_sleep_clk.clkr, 3088 + [GCC_USB3_PRIM_PHY_AUX_CLK] = &gcc_usb3_prim_phy_aux_clk.clkr, 3089 + [GCC_USB3_PRIM_PHY_AUX_CLK_SRC] = &gcc_usb3_prim_phy_aux_clk_src.clkr, 3090 + [GCC_USB3_PRIM_PHY_COM_AUX_CLK] = &gcc_usb3_prim_phy_com_aux_clk.clkr, 3091 + [GCC_USB3_PRIM_PHY_PIPE_CLK] = &gcc_usb3_prim_phy_pipe_clk.clkr, 3092 + [GCC_USB3_PRIM_PHY_PIPE_CLK_SRC] = &gcc_usb3_prim_phy_pipe_clk_src.clkr, 3093 + [GCC_VIDEO_AXI0_CLK] = &gcc_video_axi0_clk.clkr, 3094 + }; 3095 + 3096 + static const struct qcom_reset_map gcc_milos_resets[] = { 3097 + [GCC_CAMERA_BCR] = { 0x26000 }, 3098 + [GCC_DISPLAY_BCR] = { 0x27000 }, 3099 + [GCC_GPU_BCR] = { 0x71000 }, 3100 + [GCC_PCIE_0_BCR] = { 0x6b000 }, 3101 + [GCC_PCIE_0_LINK_DOWN_BCR] = { 0x6c014 }, 3102 + [GCC_PCIE_0_NOCSR_COM_PHY_BCR] = { 0x6c020 }, 3103 + [GCC_PCIE_0_PHY_BCR] = { 0x6c01c }, 3104 + [GCC_PCIE_0_PHY_NOCSR_COM_PHY_BCR] = { 0x6c028 }, 3105 + [GCC_PCIE_1_BCR] = { 0x90000 }, 3106 + [GCC_PCIE_1_LINK_DOWN_BCR] = { 0x8e014 }, 3107 + [GCC_PCIE_1_NOCSR_COM_PHY_BCR] = { 0x8e020 }, 3108 + [GCC_PCIE_1_PHY_BCR] = { 0x8e01c }, 3109 + [GCC_PCIE_1_PHY_NOCSR_COM_PHY_BCR] = { 0x8e024 }, 3110 + [GCC_PCIE_RSCC_BCR] = { 0x11000 }, 3111 + [GCC_PDM_BCR] = { 0x33000 }, 3112 + [GCC_QUPV3_WRAPPER_0_BCR] = { 0x18000 }, 3113 + [GCC_QUPV3_WRAPPER_1_BCR] = { 0x1e000 }, 3114 + [GCC_QUSB2PHY_PRIM_BCR] = { 0x12000 }, 3115 + [GCC_QUSB2PHY_SEC_BCR] = { 0x12004 }, 3116 + [GCC_SDCC1_BCR] = { 0xa3000 }, 3117 + [GCC_SDCC2_BCR] = { 0x14000 }, 3118 + [GCC_UFS_PHY_BCR] = { 0x77000 }, 3119 + [GCC_USB30_PRIM_BCR] = { 0x39000 }, 3120 + [GCC_USB3_DP_PHY_PRIM_BCR] = { 0x50008 }, 3121 + [GCC_USB3_PHY_PRIM_BCR] = { 0x50000 }, 3122 + [GCC_USB3PHY_PHY_PRIM_BCR] = { 0x50004 }, 3123 + [GCC_VIDEO_AXI0_CLK_ARES] = { 0x32018, 2 }, 3124 + [GCC_VIDEO_BCR] = { 0x32000 }, 3125 + }; 3126 + 3127 + static const struct clk_rcg_dfs_data gcc_milos_dfs_clocks[] = { 3128 + DEFINE_RCG_DFS(gcc_qupv3_wrap0_qspi_ref_clk_src), 3129 + DEFINE_RCG_DFS(gcc_qupv3_wrap0_s0_clk_src), 3130 + DEFINE_RCG_DFS(gcc_qupv3_wrap0_s1_clk_src), 3131 + DEFINE_RCG_DFS(gcc_qupv3_wrap0_s3_clk_src), 3132 + DEFINE_RCG_DFS(gcc_qupv3_wrap0_s4_clk_src), 3133 + DEFINE_RCG_DFS(gcc_qupv3_wrap0_s5_clk_src), 3134 + DEFINE_RCG_DFS(gcc_qupv3_wrap0_s6_clk_src), 3135 + DEFINE_RCG_DFS(gcc_qupv3_wrap1_qspi_ref_clk_src), 3136 + DEFINE_RCG_DFS(gcc_qupv3_wrap1_s0_clk_src), 3137 + DEFINE_RCG_DFS(gcc_qupv3_wrap1_s1_clk_src), 3138 + DEFINE_RCG_DFS(gcc_qupv3_wrap1_s3_clk_src), 3139 + DEFINE_RCG_DFS(gcc_qupv3_wrap1_s4_clk_src), 3140 + DEFINE_RCG_DFS(gcc_qupv3_wrap1_s5_clk_src), 3141 + DEFINE_RCG_DFS(gcc_qupv3_wrap1_s6_clk_src), 3142 + }; 3143 + 3144 + static struct gdsc *gcc_milos_gdscs[] = { 3145 + [PCIE_0_GDSC] = &pcie_0_gdsc, 3146 + [PCIE_0_PHY_GDSC] = &pcie_0_phy_gdsc, 3147 + [PCIE_1_GDSC] = &pcie_1_gdsc, 3148 + [PCIE_1_PHY_GDSC] = &pcie_1_phy_gdsc, 3149 + [UFS_PHY_GDSC] = &ufs_phy_gdsc, 3150 + [UFS_MEM_PHY_GDSC] = &ufs_mem_phy_gdsc, 3151 + [USB30_PRIM_GDSC] = &usb30_prim_gdsc, 3152 + [USB3_PHY_GDSC] = &usb3_phy_gdsc, 3153 + }; 3154 + 3155 + static u32 gcc_milos_critical_cbcrs[] = { 3156 + 0x26004, /* GCC_CAMERA_AHB_CLK */ 3157 + 0x26018, /* GCC_CAMERA_HF_XO_CLK */ 3158 + 0x2601c, /* GCC_CAMERA_SF_XO_CLK */ 3159 + 0x27004, /* GCC_DISP_AHB_CLK */ 3160 + 0x27018, /* GCC_DISP_XO_CLK */ 3161 + 0x71004, /* GCC_GPU_CFG_AHB_CLK */ 3162 + 0x32004, /* GCC_VIDEO_AHB_CLK */ 3163 + 0x32024, /* GCC_VIDEO_XO_CLK */ 3164 + }; 3165 + 3166 + static const struct regmap_config gcc_milos_regmap_config = { 3167 + .reg_bits = 32, 3168 + .reg_stride = 4, 3169 + .val_bits = 32, 3170 + .max_register = 0x1f41f0, 3171 + .fast_io = true, 3172 + }; 3173 + 3174 + static struct qcom_cc_driver_data gcc_milos_driver_data = { 3175 + .clk_cbcrs = gcc_milos_critical_cbcrs, 3176 + .num_clk_cbcrs = ARRAY_SIZE(gcc_milos_critical_cbcrs), 3177 + .dfs_rcgs = gcc_milos_dfs_clocks, 3178 + .num_dfs_rcgs = ARRAY_SIZE(gcc_milos_dfs_clocks), 3179 + }; 3180 + 3181 + static const struct qcom_cc_desc gcc_milos_desc = { 3182 + .config = &gcc_milos_regmap_config, 3183 + .clks = gcc_milos_clocks, 3184 + .num_clks = ARRAY_SIZE(gcc_milos_clocks), 3185 + .resets = gcc_milos_resets, 3186 + .num_resets = ARRAY_SIZE(gcc_milos_resets), 3187 + .gdscs = gcc_milos_gdscs, 3188 + .num_gdscs = ARRAY_SIZE(gcc_milos_gdscs), 3189 + .use_rpm = true, 3190 + .driver_data = &gcc_milos_driver_data, 3191 + }; 3192 + 3193 + static const struct of_device_id gcc_milos_match_table[] = { 3194 + { .compatible = "qcom,milos-gcc" }, 3195 + { } 3196 + }; 3197 + MODULE_DEVICE_TABLE(of, gcc_milos_match_table); 3198 + 3199 + static int gcc_milos_probe(struct platform_device *pdev) 3200 + { 3201 + return qcom_cc_probe(pdev, &gcc_milos_desc); 3202 + } 3203 + 3204 + static struct platform_driver gcc_milos_driver = { 3205 + .probe = gcc_milos_probe, 3206 + .driver = { 3207 + .name = "gcc-milos", 3208 + .of_match_table = gcc_milos_match_table, 3209 + }, 3210 + }; 3211 + 3212 + static int __init gcc_milos_init(void) 3213 + { 3214 + return platform_driver_register(&gcc_milos_driver); 3215 + } 3216 + subsys_initcall(gcc_milos_init); 3217 + 3218 + static void __exit gcc_milos_exit(void) 3219 + { 3220 + platform_driver_unregister(&gcc_milos_driver); 3221 + } 3222 + module_exit(gcc_milos_exit); 3223 + 3224 + MODULE_DESCRIPTION("QTI GCC Milos Driver"); 3225 + MODULE_LICENSE("GPL");
+1
drivers/clk/qcom/gcc-qcm2290.c
··· 2720 2720 .pd = { 2721 2721 .name = "gcc_vcodec0", 2722 2722 }, 2723 + .flags = HW_CTRL_TRIGGER, 2723 2724 .pwrsts = PWRSTS_OFF_ON, 2724 2725 }; 2725 2726
+2
drivers/clk/qcom/gcc-x1e80100.c
··· 6674 6674 [GCC_USB_1_PHY_BCR] = { 0x2a020 }, 6675 6675 [GCC_USB_2_PHY_BCR] = { 0xa3020 }, 6676 6676 [GCC_VIDEO_BCR] = { 0x32000 }, 6677 + [GCC_VIDEO_AXI0_CLK_ARES] = { .reg = 0x32018, .bit = 2, .udelay = 1000 }, 6678 + [GCC_VIDEO_AXI1_CLK_ARES] = { .reg = 0x32024, .bit = 2, .udelay = 1000 }, 6677 6679 }; 6678 6680 6679 6681 static const struct clk_rcg_dfs_data gcc_dfs_clocks[] = {
+562
drivers/clk/qcom/gpucc-milos.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 5 + */ 6 + 7 + #include <linux/clk-provider.h> 8 + #include <linux/mod_devicetable.h> 9 + #include <linux/module.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/regmap.h> 12 + 13 + #include <dt-bindings/clock/qcom,milos-gpucc.h> 14 + 15 + #include "clk-alpha-pll.h" 16 + #include "clk-branch.h" 17 + #include "clk-pll.h" 18 + #include "clk-rcg.h" 19 + #include "clk-regmap.h" 20 + #include "clk-regmap-divider.h" 21 + #include "clk-regmap-mux.h" 22 + #include "common.h" 23 + #include "gdsc.h" 24 + #include "reset.h" 25 + 26 + /* Need to match the order of clocks in DT binding */ 27 + enum { 28 + DT_BI_TCXO, 29 + DT_GPLL0_OUT_MAIN, 30 + DT_GPLL0_OUT_MAIN_DIV, 31 + }; 32 + 33 + enum { 34 + P_BI_TCXO, 35 + P_GPLL0_OUT_MAIN, 36 + P_GPLL0_OUT_MAIN_DIV, 37 + P_GPU_CC_PLL0_OUT_EVEN, 38 + P_GPU_CC_PLL0_OUT_MAIN, 39 + P_GPU_CC_PLL0_OUT_ODD, 40 + }; 41 + 42 + static const struct pll_vco lucid_ole_vco[] = { 43 + { 249600000, 2300000000, 0 }, 44 + }; 45 + 46 + /* 700.0 MHz Configuration */ 47 + static const struct alpha_pll_config gpu_cc_pll0_config = { 48 + .l = 0x24, 49 + .alpha = 0x7555, 50 + .config_ctl_val = 0x20485699, 51 + .config_ctl_hi_val = 0x00182261, 52 + .config_ctl_hi1_val = 0x82aa299c, 53 + .test_ctl_val = 0x00000000, 54 + .test_ctl_hi_val = 0x00000003, 55 + .test_ctl_hi1_val = 0x00009000, 56 + .test_ctl_hi2_val = 0x00000034, 57 + .user_ctl_val = 0x00000400, 58 + .user_ctl_hi_val = 0x00000005, 59 + }; 60 + 61 + static struct clk_alpha_pll gpu_cc_pll0 = { 62 + .offset = 0x0, 63 + .config = &gpu_cc_pll0_config, 64 + .vco_table = lucid_ole_vco, 65 + .num_vco = ARRAY_SIZE(lucid_ole_vco), 66 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 67 + .clkr = { 68 + .hw.init = &(const struct clk_init_data) { 69 + .name = "gpu_cc_pll0", 70 + .parent_data = &(const struct clk_parent_data) { 71 + .index = DT_BI_TCXO, 72 + }, 73 + .num_parents = 1, 74 + .ops = &clk_alpha_pll_lucid_evo_ops, 75 + }, 76 + }, 77 + }; 78 + 79 + static const struct clk_div_table post_div_table_gpu_cc_pll0_out_even[] = { 80 + { 0x1, 2 }, 81 + { } 82 + }; 83 + 84 + static struct clk_alpha_pll_postdiv gpu_cc_pll0_out_even = { 85 + .offset = 0x0, 86 + .post_div_shift = 10, 87 + .post_div_table = post_div_table_gpu_cc_pll0_out_even, 88 + .num_post_div = ARRAY_SIZE(post_div_table_gpu_cc_pll0_out_even), 89 + .width = 4, 90 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 91 + .clkr.hw.init = &(const struct clk_init_data) { 92 + .name = "gpu_cc_pll0_out_even", 93 + .parent_hws = (const struct clk_hw*[]) { 94 + &gpu_cc_pll0.clkr.hw, 95 + }, 96 + .num_parents = 1, 97 + .flags = CLK_SET_RATE_PARENT, 98 + .ops = &clk_alpha_pll_postdiv_lucid_ole_ops, 99 + }, 100 + }; 101 + 102 + static const struct parent_map gpu_cc_parent_map_0[] = { 103 + { P_BI_TCXO, 0 }, 104 + { P_GPLL0_OUT_MAIN, 5 }, 105 + { P_GPLL0_OUT_MAIN_DIV, 6 }, 106 + }; 107 + 108 + static const struct clk_parent_data gpu_cc_parent_data_0[] = { 109 + { .index = DT_BI_TCXO }, 110 + { .index = DT_GPLL0_OUT_MAIN }, 111 + { .index = DT_GPLL0_OUT_MAIN_DIV }, 112 + }; 113 + 114 + static const struct parent_map gpu_cc_parent_map_1[] = { 115 + { P_BI_TCXO, 0 }, 116 + { P_GPU_CC_PLL0_OUT_MAIN, 1 }, 117 + { P_GPU_CC_PLL0_OUT_EVEN, 2 }, 118 + { P_GPU_CC_PLL0_OUT_ODD, 3 }, 119 + { P_GPLL0_OUT_MAIN, 5 }, 120 + { P_GPLL0_OUT_MAIN_DIV, 6 }, 121 + }; 122 + 123 + static const struct clk_parent_data gpu_cc_parent_data_1[] = { 124 + { .index = DT_BI_TCXO }, 125 + { .hw = &gpu_cc_pll0.clkr.hw }, 126 + { .hw = &gpu_cc_pll0_out_even.clkr.hw }, 127 + { .hw = &gpu_cc_pll0.clkr.hw }, 128 + { .index = DT_GPLL0_OUT_MAIN }, 129 + { .index = DT_GPLL0_OUT_MAIN_DIV }, 130 + }; 131 + 132 + static const struct freq_tbl ftbl_gpu_cc_ff_clk_src[] = { 133 + F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0), 134 + { } 135 + }; 136 + 137 + static struct clk_rcg2 gpu_cc_ff_clk_src = { 138 + .cmd_rcgr = 0x9474, 139 + .mnd_width = 0, 140 + .hid_width = 5, 141 + .parent_map = gpu_cc_parent_map_0, 142 + .freq_tbl = ftbl_gpu_cc_ff_clk_src, 143 + .clkr.hw.init = &(const struct clk_init_data) { 144 + .name = "gpu_cc_ff_clk_src", 145 + .parent_data = gpu_cc_parent_data_0, 146 + .num_parents = ARRAY_SIZE(gpu_cc_parent_data_0), 147 + .flags = CLK_SET_RATE_PARENT, 148 + .ops = &clk_rcg2_shared_ops, 149 + }, 150 + }; 151 + 152 + static const struct freq_tbl ftbl_gpu_cc_gmu_clk_src[] = { 153 + F(19200000, P_BI_TCXO, 1, 0, 0), 154 + F(350000000, P_GPU_CC_PLL0_OUT_EVEN, 1, 0, 0), 155 + F(650000000, P_GPU_CC_PLL0_OUT_EVEN, 1, 0, 0), 156 + F(687500000, P_GPU_CC_PLL0_OUT_EVEN, 1, 0, 0), 157 + { } 158 + }; 159 + 160 + static struct clk_rcg2 gpu_cc_gmu_clk_src = { 161 + .cmd_rcgr = 0x9318, 162 + .mnd_width = 0, 163 + .hid_width = 5, 164 + .parent_map = gpu_cc_parent_map_1, 165 + .freq_tbl = ftbl_gpu_cc_gmu_clk_src, 166 + .clkr.hw.init = &(const struct clk_init_data) { 167 + .name = "gpu_cc_gmu_clk_src", 168 + .parent_data = gpu_cc_parent_data_1, 169 + .num_parents = ARRAY_SIZE(gpu_cc_parent_data_1), 170 + .flags = CLK_SET_RATE_PARENT, 171 + .ops = &clk_rcg2_shared_ops, 172 + }, 173 + }; 174 + 175 + static const struct freq_tbl ftbl_gpu_cc_hub_clk_src[] = { 176 + F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0), 177 + F(300000000, P_GPLL0_OUT_MAIN, 2, 0, 0), 178 + F(400000000, P_GPLL0_OUT_MAIN, 1.5, 0, 0), 179 + { } 180 + }; 181 + 182 + static struct clk_rcg2 gpu_cc_hub_clk_src = { 183 + .cmd_rcgr = 0x93ec, 184 + .mnd_width = 0, 185 + .hid_width = 5, 186 + .parent_map = gpu_cc_parent_map_1, 187 + .freq_tbl = ftbl_gpu_cc_hub_clk_src, 188 + .clkr.hw.init = &(const struct clk_init_data) { 189 + .name = "gpu_cc_hub_clk_src", 190 + .parent_data = gpu_cc_parent_data_1, 191 + .num_parents = ARRAY_SIZE(gpu_cc_parent_data_1), 192 + .flags = CLK_SET_RATE_PARENT, 193 + .ops = &clk_rcg2_shared_ops, 194 + }, 195 + }; 196 + 197 + static struct clk_regmap_div gpu_cc_hub_div_clk_src = { 198 + .reg = 0x942c, 199 + .shift = 0, 200 + .width = 4, 201 + .clkr.hw.init = &(const struct clk_init_data) { 202 + .name = "gpu_cc_hub_div_clk_src", 203 + .parent_hws = (const struct clk_hw*[]) { 204 + &gpu_cc_hub_clk_src.clkr.hw, 205 + }, 206 + .num_parents = 1, 207 + .flags = CLK_SET_RATE_PARENT, 208 + .ops = &clk_regmap_div_ro_ops, 209 + }, 210 + }; 211 + 212 + static struct clk_branch gpu_cc_ahb_clk = { 213 + .halt_reg = 0x90bc, 214 + .halt_check = BRANCH_HALT_DELAY, 215 + .clkr = { 216 + .enable_reg = 0x90bc, 217 + .enable_mask = BIT(0), 218 + .hw.init = &(const struct clk_init_data) { 219 + .name = "gpu_cc_ahb_clk", 220 + .parent_hws = (const struct clk_hw*[]) { 221 + &gpu_cc_hub_div_clk_src.clkr.hw, 222 + }, 223 + .num_parents = 1, 224 + .flags = CLK_SET_RATE_PARENT, 225 + .ops = &clk_branch2_ops, 226 + }, 227 + }, 228 + }; 229 + 230 + static struct clk_branch gpu_cc_cx_accu_shift_clk = { 231 + .halt_reg = 0x910c, 232 + .halt_check = BRANCH_HALT_VOTED, 233 + .clkr = { 234 + .enable_reg = 0x910c, 235 + .enable_mask = BIT(0), 236 + .hw.init = &(const struct clk_init_data) { 237 + .name = "gpu_cc_cx_accu_shift_clk", 238 + .ops = &clk_branch2_ops, 239 + }, 240 + }, 241 + }; 242 + 243 + static struct clk_branch gpu_cc_cx_ff_clk = { 244 + .halt_reg = 0x90ec, 245 + .halt_check = BRANCH_HALT, 246 + .clkr = { 247 + .enable_reg = 0x90ec, 248 + .enable_mask = BIT(0), 249 + .hw.init = &(const struct clk_init_data) { 250 + .name = "gpu_cc_cx_ff_clk", 251 + .parent_hws = (const struct clk_hw*[]) { 252 + &gpu_cc_ff_clk_src.clkr.hw, 253 + }, 254 + .num_parents = 1, 255 + .flags = CLK_SET_RATE_PARENT, 256 + .ops = &clk_branch2_ops, 257 + }, 258 + }, 259 + }; 260 + 261 + static struct clk_branch gpu_cc_cx_gmu_clk = { 262 + .halt_reg = 0x90d4, 263 + .halt_check = BRANCH_HALT_VOTED, 264 + .clkr = { 265 + .enable_reg = 0x90d4, 266 + .enable_mask = BIT(0), 267 + .hw.init = &(const struct clk_init_data) { 268 + .name = "gpu_cc_cx_gmu_clk", 269 + .parent_hws = (const struct clk_hw*[]) { 270 + &gpu_cc_gmu_clk_src.clkr.hw, 271 + }, 272 + .num_parents = 1, 273 + .flags = CLK_SET_RATE_PARENT, 274 + .ops = &clk_branch2_aon_ops, 275 + }, 276 + }, 277 + }; 278 + 279 + static struct clk_branch gpu_cc_cxo_clk = { 280 + .halt_reg = 0x90e4, 281 + .halt_check = BRANCH_HALT, 282 + .clkr = { 283 + .enable_reg = 0x90e4, 284 + .enable_mask = BIT(0), 285 + .hw.init = &(const struct clk_init_data) { 286 + .name = "gpu_cc_cxo_clk", 287 + .ops = &clk_branch2_ops, 288 + }, 289 + }, 290 + }; 291 + 292 + static struct clk_branch gpu_cc_dpm_clk = { 293 + .halt_reg = 0x9110, 294 + .halt_check = BRANCH_HALT, 295 + .clkr = { 296 + .enable_reg = 0x9110, 297 + .enable_mask = BIT(0), 298 + .hw.init = &(const struct clk_init_data) { 299 + .name = "gpu_cc_dpm_clk", 300 + .ops = &clk_branch2_ops, 301 + }, 302 + }, 303 + }; 304 + 305 + static struct clk_branch gpu_cc_freq_measure_clk = { 306 + .halt_reg = 0x900c, 307 + .halt_check = BRANCH_HALT, 308 + .clkr = { 309 + .enable_reg = 0x900c, 310 + .enable_mask = BIT(0), 311 + .hw.init = &(const struct clk_init_data) { 312 + .name = "gpu_cc_freq_measure_clk", 313 + .ops = &clk_branch2_ops, 314 + }, 315 + }, 316 + }; 317 + 318 + static struct clk_branch gpu_cc_gx_accu_shift_clk = { 319 + .halt_reg = 0x9070, 320 + .halt_check = BRANCH_HALT_VOTED, 321 + .clkr = { 322 + .enable_reg = 0x9070, 323 + .enable_mask = BIT(0), 324 + .hw.init = &(const struct clk_init_data) { 325 + .name = "gpu_cc_gx_accu_shift_clk", 326 + .ops = &clk_branch2_ops, 327 + }, 328 + }, 329 + }; 330 + 331 + static struct clk_branch gpu_cc_gx_acd_ahb_ff_clk = { 332 + .halt_reg = 0x9068, 333 + .halt_check = BRANCH_HALT, 334 + .clkr = { 335 + .enable_reg = 0x9068, 336 + .enable_mask = BIT(0), 337 + .hw.init = &(const struct clk_init_data) { 338 + .name = "gpu_cc_gx_acd_ahb_ff_clk", 339 + .parent_hws = (const struct clk_hw*[]) { 340 + &gpu_cc_ff_clk_src.clkr.hw, 341 + }, 342 + .num_parents = 1, 343 + .flags = CLK_SET_RATE_PARENT, 344 + .ops = &clk_branch2_ops, 345 + }, 346 + }, 347 + }; 348 + 349 + static struct clk_branch gpu_cc_gx_gmu_clk = { 350 + .halt_reg = 0x9060, 351 + .halt_check = BRANCH_HALT, 352 + .clkr = { 353 + .enable_reg = 0x9060, 354 + .enable_mask = BIT(0), 355 + .hw.init = &(const struct clk_init_data) { 356 + .name = "gpu_cc_gx_gmu_clk", 357 + .parent_hws = (const struct clk_hw*[]) { 358 + &gpu_cc_gmu_clk_src.clkr.hw, 359 + }, 360 + .num_parents = 1, 361 + .flags = CLK_SET_RATE_PARENT, 362 + .ops = &clk_branch2_ops, 363 + }, 364 + }, 365 + }; 366 + 367 + static struct clk_branch gpu_cc_gx_rcg_ahb_ff_clk = { 368 + .halt_reg = 0x906c, 369 + .halt_check = BRANCH_HALT_VOTED, 370 + .clkr = { 371 + .enable_reg = 0x906c, 372 + .enable_mask = BIT(0), 373 + .hw.init = &(const struct clk_init_data) { 374 + .name = "gpu_cc_gx_rcg_ahb_ff_clk", 375 + .parent_hws = (const struct clk_hw*[]) { 376 + &gpu_cc_ff_clk_src.clkr.hw, 377 + }, 378 + .num_parents = 1, 379 + .flags = CLK_SET_RATE_PARENT, 380 + .ops = &clk_branch2_ops, 381 + }, 382 + }, 383 + }; 384 + 385 + static struct clk_branch gpu_cc_hlos1_vote_gpu_smmu_clk = { 386 + .halt_reg = 0x7000, 387 + .halt_check = BRANCH_HALT_VOTED, 388 + .clkr = { 389 + .enable_reg = 0x7000, 390 + .enable_mask = BIT(0), 391 + .hw.init = &(const struct clk_init_data) { 392 + .name = "gpu_cc_hlos1_vote_gpu_smmu_clk", 393 + .ops = &clk_branch2_ops, 394 + }, 395 + }, 396 + }; 397 + 398 + static struct clk_branch gpu_cc_hub_aon_clk = { 399 + .halt_reg = 0x93e8, 400 + .halt_check = BRANCH_HALT_VOTED, 401 + .clkr = { 402 + .enable_reg = 0x93e8, 403 + .enable_mask = BIT(0), 404 + .hw.init = &(const struct clk_init_data) { 405 + .name = "gpu_cc_hub_aon_clk", 406 + .parent_hws = (const struct clk_hw*[]) { 407 + &gpu_cc_hub_clk_src.clkr.hw, 408 + }, 409 + .num_parents = 1, 410 + .flags = CLK_SET_RATE_PARENT, 411 + .ops = &clk_branch2_aon_ops, 412 + }, 413 + }, 414 + }; 415 + 416 + static struct clk_branch gpu_cc_hub_cx_int_clk = { 417 + .halt_reg = 0x90e8, 418 + .halt_check = BRANCH_HALT_VOTED, 419 + .clkr = { 420 + .enable_reg = 0x90e8, 421 + .enable_mask = BIT(0), 422 + .hw.init = &(const struct clk_init_data) { 423 + .name = "gpu_cc_hub_cx_int_clk", 424 + .parent_hws = (const struct clk_hw*[]) { 425 + &gpu_cc_hub_clk_src.clkr.hw, 426 + }, 427 + .num_parents = 1, 428 + .flags = CLK_SET_RATE_PARENT, 429 + .ops = &clk_branch2_aon_ops, 430 + }, 431 + }, 432 + }; 433 + 434 + static struct clk_branch gpu_cc_memnoc_gfx_clk = { 435 + .halt_reg = 0x90f4, 436 + .halt_check = BRANCH_HALT_VOTED, 437 + .clkr = { 438 + .enable_reg = 0x90f4, 439 + .enable_mask = BIT(0), 440 + .hw.init = &(const struct clk_init_data) { 441 + .name = "gpu_cc_memnoc_gfx_clk", 442 + .ops = &clk_branch2_ops, 443 + }, 444 + }, 445 + }; 446 + 447 + static struct gdsc gpu_cc_cx_gdsc = { 448 + .gdscr = 0x9080, 449 + .gds_hw_ctrl = 0x9094, 450 + .en_rest_wait_val = 0x2, 451 + .en_few_wait_val = 0x2, 452 + .clk_dis_wait_val = 0x8, 453 + .pd = { 454 + .name = "gpu_cc_cx_gdsc", 455 + }, 456 + .pwrsts = PWRSTS_OFF_ON, 457 + .flags = RETAIN_FF_ENABLE | VOTABLE, 458 + }; 459 + 460 + static struct clk_regmap *gpu_cc_milos_clocks[] = { 461 + [GPU_CC_AHB_CLK] = &gpu_cc_ahb_clk.clkr, 462 + [GPU_CC_CX_ACCU_SHIFT_CLK] = &gpu_cc_cx_accu_shift_clk.clkr, 463 + [GPU_CC_CX_FF_CLK] = &gpu_cc_cx_ff_clk.clkr, 464 + [GPU_CC_CX_GMU_CLK] = &gpu_cc_cx_gmu_clk.clkr, 465 + [GPU_CC_CXO_CLK] = &gpu_cc_cxo_clk.clkr, 466 + [GPU_CC_DPM_CLK] = &gpu_cc_dpm_clk.clkr, 467 + [GPU_CC_FF_CLK_SRC] = &gpu_cc_ff_clk_src.clkr, 468 + [GPU_CC_FREQ_MEASURE_CLK] = &gpu_cc_freq_measure_clk.clkr, 469 + [GPU_CC_GMU_CLK_SRC] = &gpu_cc_gmu_clk_src.clkr, 470 + [GPU_CC_GX_ACCU_SHIFT_CLK] = &gpu_cc_gx_accu_shift_clk.clkr, 471 + [GPU_CC_GX_ACD_AHB_FF_CLK] = &gpu_cc_gx_acd_ahb_ff_clk.clkr, 472 + [GPU_CC_GX_GMU_CLK] = &gpu_cc_gx_gmu_clk.clkr, 473 + [GPU_CC_GX_RCG_AHB_FF_CLK] = &gpu_cc_gx_rcg_ahb_ff_clk.clkr, 474 + [GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK] = &gpu_cc_hlos1_vote_gpu_smmu_clk.clkr, 475 + [GPU_CC_HUB_AON_CLK] = &gpu_cc_hub_aon_clk.clkr, 476 + [GPU_CC_HUB_CLK_SRC] = &gpu_cc_hub_clk_src.clkr, 477 + [GPU_CC_HUB_CX_INT_CLK] = &gpu_cc_hub_cx_int_clk.clkr, 478 + [GPU_CC_HUB_DIV_CLK_SRC] = &gpu_cc_hub_div_clk_src.clkr, 479 + [GPU_CC_MEMNOC_GFX_CLK] = &gpu_cc_memnoc_gfx_clk.clkr, 480 + [GPU_CC_PLL0] = &gpu_cc_pll0.clkr, 481 + [GPU_CC_PLL0_OUT_EVEN] = &gpu_cc_pll0_out_even.clkr, 482 + }; 483 + 484 + static struct gdsc *gpu_cc_milos_gdscs[] = { 485 + [GPU_CC_CX_GDSC] = &gpu_cc_cx_gdsc, 486 + }; 487 + 488 + static const struct qcom_reset_map gpu_cc_milos_resets[] = { 489 + [GPU_CC_CB_BCR] = { 0x93a0 }, 490 + [GPU_CC_CX_BCR] = { 0x907c }, 491 + [GPU_CC_FAST_HUB_BCR] = { 0x93e4 }, 492 + [GPU_CC_FF_BCR] = { 0x9470 }, 493 + [GPU_CC_GMU_BCR] = { 0x9314 }, 494 + [GPU_CC_GX_BCR] = { 0x905c }, 495 + [GPU_CC_RBCPR_BCR] = { 0x91e0 }, 496 + [GPU_CC_XO_BCR] = { 0x9000 }, 497 + }; 498 + 499 + static struct clk_alpha_pll *gpu_cc_milos_plls[] = { 500 + &gpu_cc_pll0, 501 + }; 502 + 503 + static u32 gpu_cc_milos_critical_cbcrs[] = { 504 + 0x93a4, /* GPU_CC_CB_CLK */ 505 + 0x9008, /* GPU_CC_CXO_AON_CLK */ 506 + 0x9010, /* GPU_CC_DEMET_CLK */ 507 + 0x9064, /* GPU_CC_GX_AHB_FF_CLK */ 508 + 0x93a8, /* GPU_CC_RSCC_HUB_AON_CLK */ 509 + 0x9004, /* GPU_CC_RSCC_XO_AON_CLK */ 510 + 0x90cc, /* GPU_CC_SLEEP_CLK */ 511 + }; 512 + 513 + static const struct regmap_config gpu_cc_milos_regmap_config = { 514 + .reg_bits = 32, 515 + .reg_stride = 4, 516 + .val_bits = 32, 517 + .max_register = 0x95e8, 518 + .fast_io = true, 519 + }; 520 + 521 + static struct qcom_cc_driver_data gpu_cc_milos_driver_data = { 522 + .alpha_plls = gpu_cc_milos_plls, 523 + .num_alpha_plls = ARRAY_SIZE(gpu_cc_milos_plls), 524 + .clk_cbcrs = gpu_cc_milos_critical_cbcrs, 525 + .num_clk_cbcrs = ARRAY_SIZE(gpu_cc_milos_critical_cbcrs), 526 + }; 527 + 528 + static const struct qcom_cc_desc gpu_cc_milos_desc = { 529 + .config = &gpu_cc_milos_regmap_config, 530 + .clks = gpu_cc_milos_clocks, 531 + .num_clks = ARRAY_SIZE(gpu_cc_milos_clocks), 532 + .resets = gpu_cc_milos_resets, 533 + .num_resets = ARRAY_SIZE(gpu_cc_milos_resets), 534 + .gdscs = gpu_cc_milos_gdscs, 535 + .num_gdscs = ARRAY_SIZE(gpu_cc_milos_gdscs), 536 + .use_rpm = true, 537 + .driver_data = &gpu_cc_milos_driver_data, 538 + }; 539 + 540 + static const struct of_device_id gpu_cc_milos_match_table[] = { 541 + { .compatible = "qcom,milos-gpucc" }, 542 + { } 543 + }; 544 + MODULE_DEVICE_TABLE(of, gpu_cc_milos_match_table); 545 + 546 + static int gpu_cc_milos_probe(struct platform_device *pdev) 547 + { 548 + return qcom_cc_probe(pdev, &gpu_cc_milos_desc); 549 + } 550 + 551 + static struct platform_driver gpu_cc_milos_driver = { 552 + .probe = gpu_cc_milos_probe, 553 + .driver = { 554 + .name = "gpu_cc-milos", 555 + .of_match_table = gpu_cc_milos_match_table, 556 + }, 557 + }; 558 + 559 + module_platform_driver(gpu_cc_milos_driver); 560 + 561 + MODULE_DESCRIPTION("QTI GPU_CC Milos Driver"); 562 + MODULE_LICENSE("GPL");
+531
drivers/clk/qcom/gpucc-qcs615.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #include <linux/clk-provider.h> 7 + #include <linux/module.h> 8 + #include <linux/mod_devicetable.h> 9 + #include <linux/of.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/regmap.h> 12 + 13 + #include <dt-bindings/clock/qcom,qcs615-gpucc.h> 14 + 15 + #include "clk-alpha-pll.h" 16 + #include "clk-branch.h" 17 + #include "clk-pll.h" 18 + #include "clk-rcg.h" 19 + #include "clk-regmap.h" 20 + #include "clk-regmap-divider.h" 21 + #include "clk-regmap-mux.h" 22 + #include "common.h" 23 + #include "gdsc.h" 24 + #include "reset.h" 25 + 26 + enum { 27 + DT_BI_TCXO, 28 + DT_GPLL0_OUT_MAIN, 29 + DT_GPLL0_OUT_MAIN_DIV, 30 + }; 31 + 32 + enum { 33 + P_BI_TCXO, 34 + P_GPLL0_OUT_MAIN, 35 + P_GPLL0_OUT_MAIN_DIV, 36 + P_GPU_CC_PLL0_2X_CLK, 37 + P_CRC_DIV_PLL0_OUT_AUX2, 38 + P_GPU_CC_PLL0_OUT_MAIN, 39 + P_GPU_CC_PLL1_OUT_AUX, 40 + P_CRC_DIV_PLL1_OUT_AUX2, 41 + P_GPU_CC_PLL1_OUT_MAIN, 42 + }; 43 + 44 + static const struct pll_vco gpu_cc_pll0_vco[] = { 45 + { 1000000000, 2100000000, 0 }, 46 + }; 47 + 48 + static struct pll_vco gpu_cc_pll1_vco[] = { 49 + { 500000000, 1000000000, 2 }, 50 + }; 51 + 52 + /* 1020MHz configuration VCO - 0 */ 53 + static struct alpha_pll_config gpu_cc_pll0_config = { 54 + .l = 0x35, 55 + .config_ctl_val = 0x4001055b, 56 + .test_ctl_hi_val = 0x1, 57 + .test_ctl_hi_mask = 0x1, 58 + .alpha_hi = 0x20, 59 + .alpha = 0x00, 60 + .alpha_en_mask = BIT(24), 61 + .vco_val = 0x0, 62 + .vco_mask = GENMASK(21, 20), 63 + .aux2_output_mask = BIT(2), 64 + }; 65 + 66 + static struct clk_alpha_pll gpu_cc_pll0 = { 67 + .offset = 0x0, 68 + .config = &gpu_cc_pll0_config, 69 + .vco_table = gpu_cc_pll0_vco, 70 + .num_vco = ARRAY_SIZE(gpu_cc_pll0_vco), 71 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 72 + .clkr = { 73 + .hw.init = &(const struct clk_init_data) { 74 + .name = "gpu_cc_pll0", 75 + .parent_data = &(const struct clk_parent_data) { 76 + .index = DT_BI_TCXO, 77 + }, 78 + .num_parents = 1, 79 + .ops = &clk_alpha_pll_slew_ops, 80 + }, 81 + }, 82 + }; 83 + 84 + /* 930MHz configuration VCO - 2 */ 85 + static struct alpha_pll_config gpu_cc_pll1_config = { 86 + .l = 0x30, 87 + .config_ctl_val = 0x4001055b, 88 + .test_ctl_hi_val = 0x1, 89 + .test_ctl_hi_mask = 0x1, 90 + .alpha_hi = 0x70, 91 + .alpha = 0x00, 92 + .alpha_en_mask = BIT(24), 93 + .vco_val = BIT(21), 94 + .vco_mask = GENMASK(21, 20), 95 + .aux2_output_mask = BIT(2), 96 + }; 97 + 98 + static struct clk_alpha_pll gpu_cc_pll1 = { 99 + .offset = 0x100, 100 + .config = &gpu_cc_pll1_config, 101 + .vco_table = gpu_cc_pll1_vco, 102 + .num_vco = ARRAY_SIZE(gpu_cc_pll1_vco), 103 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 104 + .clkr = { 105 + .hw.init = &(const struct clk_init_data) { 106 + .name = "gpu_cc_pll1", 107 + .parent_data = &(const struct clk_parent_data) { 108 + .index = DT_BI_TCXO, 109 + }, 110 + .num_parents = 1, 111 + .ops = &clk_alpha_pll_slew_ops, 112 + }, 113 + } 114 + }; 115 + 116 + /* Clock Ramp Controller */ 117 + static struct clk_fixed_factor crc_div_pll0 = { 118 + .mult = 1, 119 + .div = 2, 120 + .hw.init = &(struct clk_init_data){ 121 + .name = "crc_div_pll0", 122 + .parent_data = &(const struct clk_parent_data){ 123 + .hw = &gpu_cc_pll0.clkr.hw, 124 + }, 125 + .num_parents = 1, 126 + .flags = CLK_SET_RATE_PARENT, 127 + .ops = &clk_fixed_factor_ops, 128 + }, 129 + }; 130 + 131 + /* Clock Ramp Controller */ 132 + static struct clk_fixed_factor crc_div_pll1 = { 133 + .mult = 1, 134 + .div = 2, 135 + .hw.init = &(struct clk_init_data){ 136 + .name = "crc_div_pll1", 137 + .parent_data = &(const struct clk_parent_data){ 138 + .hw = &gpu_cc_pll1.clkr.hw, 139 + }, 140 + .num_parents = 1, 141 + .flags = CLK_SET_RATE_PARENT, 142 + .ops = &clk_fixed_factor_ops, 143 + }, 144 + }; 145 + 146 + static const struct parent_map gpu_cc_parent_map_0[] = { 147 + { P_BI_TCXO, 0 }, 148 + { P_GPU_CC_PLL0_OUT_MAIN, 1 }, 149 + { P_GPU_CC_PLL1_OUT_MAIN, 3 }, 150 + { P_GPLL0_OUT_MAIN, 5 }, 151 + { P_GPLL0_OUT_MAIN_DIV, 6 }, 152 + }; 153 + 154 + static const struct clk_parent_data gpu_cc_parent_data_0[] = { 155 + { .index = DT_BI_TCXO }, 156 + { .hw = &gpu_cc_pll0.clkr.hw }, 157 + { .hw = &gpu_cc_pll1.clkr.hw }, 158 + { .index = DT_GPLL0_OUT_MAIN }, 159 + { .index = DT_GPLL0_OUT_MAIN_DIV }, 160 + }; 161 + 162 + static const struct parent_map gpu_cc_parent_map_1[] = { 163 + { P_BI_TCXO, 0 }, 164 + { P_GPU_CC_PLL0_2X_CLK, 1 }, 165 + { P_CRC_DIV_PLL0_OUT_AUX2, 2 }, 166 + { P_GPU_CC_PLL1_OUT_AUX, 3 }, 167 + { P_CRC_DIV_PLL1_OUT_AUX2, 4 }, 168 + { P_GPLL0_OUT_MAIN, 5 }, 169 + }; 170 + 171 + static const struct clk_parent_data gpu_cc_parent_data_1[] = { 172 + { .index = DT_BI_TCXO }, 173 + { .hw = &gpu_cc_pll0.clkr.hw }, 174 + { .hw = &crc_div_pll0.hw }, 175 + { .hw = &gpu_cc_pll1.clkr.hw }, 176 + { .hw = &crc_div_pll1.hw }, 177 + { .index = DT_GPLL0_OUT_MAIN }, 178 + }; 179 + 180 + static const struct freq_tbl ftbl_gpu_cc_gmu_clk_src[] = { 181 + F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0), 182 + { } 183 + }; 184 + 185 + static struct clk_rcg2 gpu_cc_gmu_clk_src = { 186 + .cmd_rcgr = 0x1120, 187 + .mnd_width = 0, 188 + .hid_width = 5, 189 + .parent_map = gpu_cc_parent_map_0, 190 + .freq_tbl = ftbl_gpu_cc_gmu_clk_src, 191 + .clkr.hw.init = &(const struct clk_init_data) { 192 + .name = "gpu_cc_gmu_clk_src", 193 + .parent_data = gpu_cc_parent_data_0, 194 + .num_parents = ARRAY_SIZE(gpu_cc_parent_data_0), 195 + .ops = &clk_rcg2_shared_ops, 196 + }, 197 + }; 198 + 199 + static const struct freq_tbl ftbl_gpu_cc_gx_gfx3d_clk_src[] = { 200 + F(290000000, P_CRC_DIV_PLL1_OUT_AUX2, 1, 0, 0), 201 + F(350000000, P_CRC_DIV_PLL1_OUT_AUX2, 1, 0, 0), 202 + F(435000000, P_CRC_DIV_PLL1_OUT_AUX2, 1, 0, 0), 203 + F(500000000, P_CRC_DIV_PLL0_OUT_AUX2, 1, 0, 0), 204 + F(550000000, P_CRC_DIV_PLL0_OUT_AUX2, 1, 0, 0), 205 + F(650000000, P_CRC_DIV_PLL0_OUT_AUX2, 1, 0, 0), 206 + F(700000000, P_CRC_DIV_PLL0_OUT_AUX2, 1, 0, 0), 207 + F(745000000, P_CRC_DIV_PLL0_OUT_AUX2, 1, 0, 0), 208 + F(845000000, P_CRC_DIV_PLL0_OUT_AUX2, 1, 0, 0), 209 + F(895000000, P_CRC_DIV_PLL0_OUT_AUX2, 1, 0, 0), 210 + { } 211 + }; 212 + 213 + static struct clk_rcg2 gpu_cc_gx_gfx3d_clk_src = { 214 + .cmd_rcgr = 0x101c, 215 + .mnd_width = 0, 216 + .hid_width = 5, 217 + .parent_map = gpu_cc_parent_map_1, 218 + .freq_tbl = ftbl_gpu_cc_gx_gfx3d_clk_src, 219 + .clkr.hw.init = &(const struct clk_init_data) { 220 + .name = "gpu_cc_gx_gfx3d_clk_src", 221 + .parent_data = gpu_cc_parent_data_1, 222 + .num_parents = ARRAY_SIZE(gpu_cc_parent_data_1), 223 + .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 224 + .ops = &clk_rcg2_shared_ops, 225 + }, 226 + }; 227 + 228 + static struct clk_branch gpu_cc_crc_ahb_clk = { 229 + .halt_reg = 0x107c, 230 + .halt_check = BRANCH_HALT_VOTED, 231 + .clkr = { 232 + .enable_reg = 0x107c, 233 + .enable_mask = BIT(0), 234 + .hw.init = &(const struct clk_init_data) { 235 + .name = "gpu_cc_crc_ahb_clk", 236 + .ops = &clk_branch2_ops, 237 + }, 238 + }, 239 + }; 240 + 241 + static struct clk_branch gpu_cc_cx_gfx3d_clk = { 242 + .halt_reg = 0x10a4, 243 + .halt_check = BRANCH_HALT_DELAY, 244 + .clkr = { 245 + .enable_reg = 0x10a4, 246 + .enable_mask = BIT(0), 247 + .hw.init = &(const struct clk_init_data) { 248 + .name = "gpu_cc_cx_gfx3d_clk", 249 + .parent_hws = (const struct clk_hw*[]) { 250 + &gpu_cc_gx_gfx3d_clk_src.clkr.hw, 251 + }, 252 + .num_parents = 1, 253 + .flags = CLK_SET_RATE_PARENT, 254 + .ops = &clk_branch2_ops, 255 + }, 256 + }, 257 + }; 258 + 259 + static struct clk_branch gpu_cc_cx_gfx3d_slv_clk = { 260 + .halt_reg = 0x10a8, 261 + .halt_check = BRANCH_HALT_DELAY, 262 + .clkr = { 263 + .enable_reg = 0x10a8, 264 + .enable_mask = BIT(0), 265 + .hw.init = &(const struct clk_init_data) { 266 + .name = "gpu_cc_cx_gfx3d_slv_clk", 267 + .parent_hws = (const struct clk_hw*[]) { 268 + &gpu_cc_gx_gfx3d_clk_src.clkr.hw, 269 + }, 270 + .num_parents = 1, 271 + .flags = CLK_SET_RATE_PARENT, 272 + .ops = &clk_branch2_ops, 273 + }, 274 + }, 275 + }; 276 + 277 + static struct clk_branch gpu_cc_cx_gmu_clk = { 278 + .halt_reg = 0x1098, 279 + .halt_check = BRANCH_HALT, 280 + .clkr = { 281 + .enable_reg = 0x1098, 282 + .enable_mask = BIT(0), 283 + .hw.init = &(const struct clk_init_data) { 284 + .name = "gpu_cc_cx_gmu_clk", 285 + .parent_hws = (const struct clk_hw*[]) { 286 + &gpu_cc_gmu_clk_src.clkr.hw, 287 + }, 288 + .num_parents = 1, 289 + .flags = CLK_SET_RATE_PARENT, 290 + .ops = &clk_branch2_ops, 291 + }, 292 + }, 293 + }; 294 + 295 + static struct clk_branch gpu_cc_cx_snoc_dvm_clk = { 296 + .halt_reg = 0x108c, 297 + .halt_check = BRANCH_HALT_VOTED, 298 + .clkr = { 299 + .enable_reg = 0x108c, 300 + .enable_mask = BIT(0), 301 + .hw.init = &(const struct clk_init_data) { 302 + .name = "gpu_cc_cx_snoc_dvm_clk", 303 + .ops = &clk_branch2_ops, 304 + }, 305 + }, 306 + }; 307 + 308 + static struct clk_branch gpu_cc_cxo_aon_clk = { 309 + .halt_reg = 0x1004, 310 + .halt_check = BRANCH_HALT_VOTED, 311 + .clkr = { 312 + .enable_reg = 0x1004, 313 + .enable_mask = BIT(0), 314 + .hw.init = &(struct clk_init_data){ 315 + .name = "gpu_cc_cxo_aon_clk", 316 + .ops = &clk_branch2_ops, 317 + }, 318 + }, 319 + }; 320 + 321 + static struct clk_branch gpu_cc_cxo_clk = { 322 + .halt_reg = 0x109c, 323 + .halt_check = BRANCH_HALT, 324 + .clkr = { 325 + .enable_reg = 0x109c, 326 + .enable_mask = BIT(0), 327 + .hw.init = &(const struct clk_init_data) { 328 + .name = "gpu_cc_cxo_clk", 329 + .ops = &clk_branch2_ops, 330 + }, 331 + }, 332 + }; 333 + 334 + static struct clk_branch gpu_cc_gx_gfx3d_clk = { 335 + .halt_reg = 0x1054, 336 + .halt_check = BRANCH_HALT_SKIP, 337 + .clkr = { 338 + .enable_reg = 0x1054, 339 + .enable_mask = BIT(0), 340 + .hw.init = &(const struct clk_init_data) { 341 + .name = "gpu_cc_gx_gfx3d_clk", 342 + .parent_hws = (const struct clk_hw*[]) { 343 + &gpu_cc_gx_gfx3d_clk_src.clkr.hw, 344 + }, 345 + .num_parents = 1, 346 + .flags = CLK_SET_RATE_PARENT, 347 + .ops = &clk_branch2_ops, 348 + }, 349 + }, 350 + }; 351 + 352 + static struct clk_branch gpu_cc_gx_gmu_clk = { 353 + .halt_reg = 0x1064, 354 + .halt_check = BRANCH_HALT, 355 + .clkr = { 356 + .enable_reg = 0x1064, 357 + .enable_mask = BIT(0), 358 + .hw.init = &(const struct clk_init_data) { 359 + .name = "gpu_cc_gx_gmu_clk", 360 + .parent_hws = (const struct clk_hw*[]) { 361 + &gpu_cc_gmu_clk_src.clkr.hw, 362 + }, 363 + .num_parents = 1, 364 + .flags = CLK_SET_RATE_PARENT, 365 + .ops = &clk_branch2_ops, 366 + }, 367 + }, 368 + }; 369 + 370 + static struct clk_branch gpu_cc_hlos1_vote_gpu_smmu_clk = { 371 + .halt_reg = 0x5000, 372 + .halt_check = BRANCH_VOTED, 373 + .clkr = { 374 + .enable_reg = 0x5000, 375 + .enable_mask = BIT(0), 376 + .hw.init = &(const struct clk_init_data) { 377 + .name = "gpu_cc_hlos1_vote_gpu_smmu_clk", 378 + .ops = &clk_branch2_ops, 379 + }, 380 + }, 381 + }; 382 + 383 + static struct clk_branch gpu_cc_sleep_clk = { 384 + .halt_reg = 0x1090, 385 + .halt_check = BRANCH_HALT_VOTED, 386 + .clkr = { 387 + .enable_reg = 0x1090, 388 + .enable_mask = BIT(0), 389 + .hw.init = &(const struct clk_init_data) { 390 + .name = "gpu_cc_sleep_clk", 391 + .ops = &clk_branch2_ops, 392 + }, 393 + }, 394 + }; 395 + 396 + static struct clk_hw *gpu_cc_qcs615_hws[] = { 397 + [CRC_DIV_PLL0] = &crc_div_pll0.hw, 398 + [CRC_DIV_PLL1] = &crc_div_pll1.hw, 399 + }; 400 + 401 + static struct gdsc cx_gdsc = { 402 + .gdscr = 0x106c, 403 + .gds_hw_ctrl = 0x1540, 404 + .en_rest_wait_val = 0x2, 405 + .en_few_wait_val = 0x2, 406 + .clk_dis_wait_val = 0x8, 407 + .pd = { 408 + .name = "cx_gdsc", 409 + }, 410 + .pwrsts = PWRSTS_OFF_ON, 411 + .flags = POLL_CFG_GDSCR, 412 + }; 413 + 414 + static struct gdsc gx_gdsc = { 415 + .gdscr = 0x100c, 416 + .en_rest_wait_val = 0x2, 417 + .en_few_wait_val = 0x2, 418 + .clk_dis_wait_val = 0x2, 419 + .pd = { 420 + .name = "gx_gdsc", 421 + }, 422 + .pwrsts = PWRSTS_OFF_ON, 423 + .flags = POLL_CFG_GDSCR, 424 + }; 425 + 426 + static struct clk_regmap *gpu_cc_qcs615_clocks[] = { 427 + [GPU_CC_CRC_AHB_CLK] = &gpu_cc_crc_ahb_clk.clkr, 428 + [GPU_CC_CX_GFX3D_CLK] = &gpu_cc_cx_gfx3d_clk.clkr, 429 + [GPU_CC_CX_GFX3D_SLV_CLK] = &gpu_cc_cx_gfx3d_slv_clk.clkr, 430 + [GPU_CC_CX_GMU_CLK] = &gpu_cc_cx_gmu_clk.clkr, 431 + [GPU_CC_CX_SNOC_DVM_CLK] = &gpu_cc_cx_snoc_dvm_clk.clkr, 432 + [GPU_CC_CXO_AON_CLK] = &gpu_cc_cxo_aon_clk.clkr, 433 + [GPU_CC_CXO_CLK] = &gpu_cc_cxo_clk.clkr, 434 + [GPU_CC_GMU_CLK_SRC] = &gpu_cc_gmu_clk_src.clkr, 435 + [GPU_CC_GX_GFX3D_CLK] = &gpu_cc_gx_gfx3d_clk.clkr, 436 + [GPU_CC_GX_GFX3D_CLK_SRC] = &gpu_cc_gx_gfx3d_clk_src.clkr, 437 + [GPU_CC_GX_GMU_CLK] = &gpu_cc_gx_gmu_clk.clkr, 438 + [GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK] = &gpu_cc_hlos1_vote_gpu_smmu_clk.clkr, 439 + [GPU_CC_PLL0] = &gpu_cc_pll0.clkr, 440 + [GPU_CC_PLL1] = &gpu_cc_pll1.clkr, 441 + [GPU_CC_SLEEP_CLK] = &gpu_cc_sleep_clk.clkr, 442 + }; 443 + 444 + static struct gdsc *gpu_cc_qcs615_gdscs[] = { 445 + [CX_GDSC] = &cx_gdsc, 446 + [GX_GDSC] = &gx_gdsc, 447 + }; 448 + 449 + static const struct qcom_reset_map gpu_cc_qcs615_resets[] = { 450 + [GPU_CC_CX_BCR] = { 0x1068 }, 451 + [GPU_CC_GFX3D_AON_BCR] = { 0x10a0 }, 452 + [GPU_CC_GMU_BCR] = { 0x111c }, 453 + [GPU_CC_GX_BCR] = { 0x1008 }, 454 + [GPU_CC_XO_BCR] = { 0x1000 }, 455 + }; 456 + 457 + static struct clk_alpha_pll *gpu_cc_qcs615_plls[] = { 458 + &gpu_cc_pll0, 459 + &gpu_cc_pll1, 460 + }; 461 + 462 + static u32 gpu_cc_qcs615_critical_cbcrs[] = { 463 + 0x1078, /* GPU_CC_AHB_CLK */ 464 + }; 465 + 466 + static const struct regmap_config gpu_cc_qcs615_regmap_config = { 467 + .reg_bits = 32, 468 + .reg_stride = 4, 469 + .val_bits = 32, 470 + .max_register = 0x7008, 471 + .fast_io = true, 472 + }; 473 + 474 + static void clk_qcs615_regs_crc_configure(struct device *dev, struct regmap *regmap) 475 + { 476 + /* Recommended WAKEUP/SLEEP settings for the gpu_cc_cx_gmu_clk */ 477 + regmap_update_bits(regmap, gpu_cc_cx_gmu_clk.clkr.enable_reg, 0xff0, 0xff0); 478 + 479 + /* 480 + * After POR, Clock Ramp Controller(CRC) will be in bypass mode. 481 + * Software needs to do the following operation to enable the CRC 482 + * for GFX3D clock and divide the input clock by div by 2. 483 + */ 484 + regmap_update_bits(regmap, 0x1028, 0x00015011, 0x00015011); 485 + regmap_update_bits(regmap, 0x1024, 0x00800000, 0x00800000); 486 + } 487 + 488 + static struct qcom_cc_driver_data gpu_cc_qcs615_driver_data = { 489 + .alpha_plls = gpu_cc_qcs615_plls, 490 + .num_alpha_plls = ARRAY_SIZE(gpu_cc_qcs615_plls), 491 + .clk_cbcrs = gpu_cc_qcs615_critical_cbcrs, 492 + .num_clk_cbcrs = ARRAY_SIZE(gpu_cc_qcs615_critical_cbcrs), 493 + .clk_regs_configure = clk_qcs615_regs_crc_configure, 494 + }; 495 + 496 + static const struct qcom_cc_desc gpu_cc_qcs615_desc = { 497 + .config = &gpu_cc_qcs615_regmap_config, 498 + .clks = gpu_cc_qcs615_clocks, 499 + .num_clks = ARRAY_SIZE(gpu_cc_qcs615_clocks), 500 + .clk_hws = gpu_cc_qcs615_hws, 501 + .num_clk_hws = ARRAY_SIZE(gpu_cc_qcs615_hws), 502 + .resets = gpu_cc_qcs615_resets, 503 + .num_resets = ARRAY_SIZE(gpu_cc_qcs615_resets), 504 + .gdscs = gpu_cc_qcs615_gdscs, 505 + .num_gdscs = ARRAY_SIZE(gpu_cc_qcs615_gdscs), 506 + .driver_data = &gpu_cc_qcs615_driver_data, 507 + }; 508 + 509 + static const struct of_device_id gpu_cc_qcs615_match_table[] = { 510 + { .compatible = "qcom,qcs615-gpucc" }, 511 + { } 512 + }; 513 + MODULE_DEVICE_TABLE(of, gpu_cc_qcs615_match_table); 514 + 515 + static int gpu_cc_qcs615_probe(struct platform_device *pdev) 516 + { 517 + return qcom_cc_probe(pdev, &gpu_cc_qcs615_desc); 518 + } 519 + 520 + static struct platform_driver gpu_cc_qcs615_driver = { 521 + .probe = gpu_cc_qcs615_probe, 522 + .driver = { 523 + .name = "gpucc-qcs615", 524 + .of_match_table = gpu_cc_qcs615_match_table, 525 + }, 526 + }; 527 + 528 + module_platform_driver(gpu_cc_qcs615_driver); 529 + 530 + MODULE_DESCRIPTION("QTI GPUCC QCS615 Driver"); 531 + MODULE_LICENSE("GPL");
+42 -8
drivers/clk/qcom/ipq-cmn-pll.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 - * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. 3 + * Copyright (c) 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved. 4 4 */ 5 5 6 6 /* ··· 15 15 * and one clock with 353 MHZ to PPE. The other fixed rate output clocks 16 16 * are supplied to GCC (24 MHZ as XO and 32 KHZ as sleep clock), and to PCS 17 17 * with 31.25 MHZ. 18 + * 19 + * On the IPQ5424 SoC, there is an output clock from CMN PLL to PPE at 375 MHZ, 20 + * and an output clock to NSS (network subsystem) at 300 MHZ. The other output 21 + * clocks from CMN PLL on IPQ5424 are the same as IPQ9574. 18 22 * 19 23 * +---------+ 20 24 * | GCC | ··· 50 46 #include <linux/regmap.h> 51 47 52 48 #include <dt-bindings/clock/qcom,ipq-cmn-pll.h> 49 + #include <dt-bindings/clock/qcom,ipq5018-cmn-pll.h> 50 + #include <dt-bindings/clock/qcom,ipq5424-cmn-pll.h> 53 51 54 52 #define CMN_PLL_REFCLK_SRC_SELECTION 0x28 55 53 #define CMN_PLL_REFCLK_SRC_DIV GENMASK(9, 8) ··· 111 105 .fast_io = true, 112 106 }; 113 107 108 + static const struct cmn_pll_fixed_output_clk ipq5018_output_clks[] = { 109 + CLK_PLL_OUTPUT(IPQ5018_XO_24MHZ_CLK, "xo-24mhz", 24000000UL), 110 + CLK_PLL_OUTPUT(IPQ5018_SLEEP_32KHZ_CLK, "sleep-32khz", 32000UL), 111 + CLK_PLL_OUTPUT(IPQ5018_ETH_50MHZ_CLK, "eth-50mhz", 50000000UL), 112 + { /* Sentinel */ } 113 + }; 114 + 115 + static const struct cmn_pll_fixed_output_clk ipq5424_output_clks[] = { 116 + CLK_PLL_OUTPUT(IPQ5424_XO_24MHZ_CLK, "xo-24mhz", 24000000UL), 117 + CLK_PLL_OUTPUT(IPQ5424_SLEEP_32KHZ_CLK, "sleep-32khz", 32000UL), 118 + CLK_PLL_OUTPUT(IPQ5424_PCS_31P25MHZ_CLK, "pcs-31p25mhz", 31250000UL), 119 + CLK_PLL_OUTPUT(IPQ5424_NSS_300MHZ_CLK, "nss-300mhz", 300000000UL), 120 + CLK_PLL_OUTPUT(IPQ5424_PPE_375MHZ_CLK, "ppe-375mhz", 375000000UL), 121 + CLK_PLL_OUTPUT(IPQ5424_ETH0_50MHZ_CLK, "eth0-50mhz", 50000000UL), 122 + CLK_PLL_OUTPUT(IPQ5424_ETH1_50MHZ_CLK, "eth1-50mhz", 50000000UL), 123 + CLK_PLL_OUTPUT(IPQ5424_ETH2_50MHZ_CLK, "eth2-50mhz", 50000000UL), 124 + CLK_PLL_OUTPUT(IPQ5424_ETH_25MHZ_CLK, "eth-25mhz", 25000000UL), 125 + { /* Sentinel */ } 126 + }; 127 + 114 128 static const struct cmn_pll_fixed_output_clk ipq9574_output_clks[] = { 115 129 CLK_PLL_OUTPUT(XO_24MHZ_CLK, "xo-24mhz", 24000000UL), 116 130 CLK_PLL_OUTPUT(SLEEP_32KHZ_CLK, "sleep-32khz", 32000UL), ··· 141 115 CLK_PLL_OUTPUT(ETH1_50MHZ_CLK, "eth1-50mhz", 50000000UL), 142 116 CLK_PLL_OUTPUT(ETH2_50MHZ_CLK, "eth2-50mhz", 50000000UL), 143 117 CLK_PLL_OUTPUT(ETH_25MHZ_CLK, "eth-25mhz", 25000000UL), 118 + { /* Sentinel */ } 144 119 }; 145 120 146 121 /* ··· 324 297 325 298 static int ipq_cmn_pll_register_clks(struct platform_device *pdev) 326 299 { 327 - const struct cmn_pll_fixed_output_clk *fixed_clk; 300 + const struct cmn_pll_fixed_output_clk *p, *fixed_clk; 328 301 struct clk_hw_onecell_data *hw_data; 329 302 struct device *dev = &pdev->dev; 330 303 struct clk_hw *cmn_pll_hw; ··· 332 305 struct clk_hw *hw; 333 306 int ret, i; 334 307 335 - fixed_clk = ipq9574_output_clks; 336 - num_clks = ARRAY_SIZE(ipq9574_output_clks); 308 + fixed_clk = device_get_match_data(dev); 309 + if (!fixed_clk) 310 + return -EINVAL; 311 + 312 + num_clks = 0; 313 + for (p = fixed_clk; p->name; p++) 314 + num_clks++; 337 315 338 316 hw_data = devm_kzalloc(dev, struct_size(hw_data, hws, num_clks + 1), 339 317 GFP_KERNEL); ··· 407 375 */ 408 376 ret = pm_clk_add(dev, "ahb"); 409 377 if (ret) 410 - return dev_err_probe(dev, ret, "Fail to add AHB clock\n"); 378 + return dev_err_probe(dev, ret, "Failed to add AHB clock\n"); 411 379 412 380 ret = pm_clk_add(dev, "sys"); 413 381 if (ret) 414 - return dev_err_probe(dev, ret, "Fail to add SYS clock\n"); 382 + return dev_err_probe(dev, ret, "Failed to add SYS clock\n"); 415 383 416 384 ret = pm_runtime_resume_and_get(dev); 417 385 if (ret) ··· 422 390 pm_runtime_put(dev); 423 391 if (ret) 424 392 return dev_err_probe(dev, ret, 425 - "Fail to register CMN PLL clocks\n"); 393 + "Failed to register CMN PLL clocks\n"); 426 394 427 395 return 0; 428 396 } ··· 447 415 }; 448 416 449 417 static const struct of_device_id ipq_cmn_pll_clk_ids[] = { 450 - { .compatible = "qcom,ipq9574-cmn-pll", }, 418 + { .compatible = "qcom,ipq5018-cmn-pll", .data = &ipq5018_output_clks }, 419 + { .compatible = "qcom,ipq5424-cmn-pll", .data = &ipq5424_output_clks }, 420 + { .compatible = "qcom,ipq9574-cmn-pll", .data = &ipq9574_output_clks }, 451 421 { } 452 422 }; 453 423 MODULE_DEVICE_TABLE(of, ipq_cmn_pll_clk_ids);
+8
drivers/clk/qcom/tcsrcc-sm8650.c
··· 148 148 }; 149 149 150 150 static const struct of_device_id tcsr_cc_sm8650_match_table[] = { 151 + { .compatible = "qcom,milos-tcsr" }, 151 152 { .compatible = "qcom,sm8650-tcsr" }, 152 153 { } 153 154 }; ··· 156 155 157 156 static int tcsr_cc_sm8650_probe(struct platform_device *pdev) 158 157 { 158 + if (of_device_is_compatible(pdev->dev.of_node, "qcom,milos-tcsr")) { 159 + tcsr_ufs_clkref_en.halt_reg = 0x31118; 160 + tcsr_ufs_clkref_en.clkr.enable_reg = 0x31118; 161 + tcsr_cc_sm8650_clocks[TCSR_USB2_CLKREF_EN] = NULL; 162 + tcsr_cc_sm8650_clocks[TCSR_USB3_CLKREF_EN] = NULL; 163 + } 164 + 159 165 return qcom_cc_probe(pdev, &tcsr_cc_sm8650_desc); 160 166 } 161 167
+403
drivers/clk/qcom/videocc-milos.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 5 + */ 6 + 7 + #include <linux/clk-provider.h> 8 + #include <linux/mod_devicetable.h> 9 + #include <linux/module.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/regmap.h> 12 + 13 + #include <dt-bindings/clock/qcom,milos-videocc.h> 14 + 15 + #include "clk-alpha-pll.h" 16 + #include "clk-branch.h" 17 + #include "clk-rcg.h" 18 + #include "clk-regmap.h" 19 + #include "clk-regmap-divider.h" 20 + #include "common.h" 21 + #include "gdsc.h" 22 + #include "reset.h" 23 + 24 + /* Need to match the order of clocks in DT binding */ 25 + enum { 26 + DT_BI_TCXO, 27 + DT_BI_TCXO_AO, 28 + DT_SLEEP_CLK, 29 + DT_IFACE, 30 + }; 31 + 32 + enum { 33 + P_BI_TCXO, 34 + P_SLEEP_CLK, 35 + P_VIDEO_CC_PLL0_OUT_MAIN, 36 + }; 37 + 38 + static const struct pll_vco lucid_ole_vco[] = { 39 + { 249600000, 2300000000, 0 }, 40 + }; 41 + 42 + /* 604.8 MHz Configuration */ 43 + static const struct alpha_pll_config video_cc_pll0_config = { 44 + .l = 0x1f, 45 + .alpha = 0x8000, 46 + .config_ctl_val = 0x20485699, 47 + .config_ctl_hi_val = 0x00182261, 48 + .config_ctl_hi1_val = 0x82aa299c, 49 + .test_ctl_val = 0x00000000, 50 + .test_ctl_hi_val = 0x00000003, 51 + .test_ctl_hi1_val = 0x00009000, 52 + .test_ctl_hi2_val = 0x00000034, 53 + .user_ctl_val = 0x00000000, 54 + .user_ctl_hi_val = 0x00000005, 55 + }; 56 + 57 + static struct clk_alpha_pll video_cc_pll0 = { 58 + .offset = 0x0, 59 + .config = &video_cc_pll0_config, 60 + .vco_table = lucid_ole_vco, 61 + .num_vco = ARRAY_SIZE(lucid_ole_vco), 62 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], 63 + .clkr = { 64 + .hw.init = &(const struct clk_init_data) { 65 + .name = "video_cc_pll0", 66 + .parent_data = &(const struct clk_parent_data) { 67 + .index = DT_BI_TCXO, 68 + }, 69 + .num_parents = 1, 70 + .ops = &clk_alpha_pll_lucid_evo_ops, 71 + }, 72 + }, 73 + }; 74 + 75 + static const struct parent_map video_cc_parent_map_0[] = { 76 + { P_BI_TCXO, 0 }, 77 + }; 78 + 79 + static const struct clk_parent_data video_cc_parent_data_0[] = { 80 + { .index = DT_BI_TCXO }, 81 + }; 82 + 83 + static const struct clk_parent_data video_cc_parent_data_0_ao[] = { 84 + { .index = DT_BI_TCXO_AO }, 85 + }; 86 + 87 + static const struct parent_map video_cc_parent_map_1[] = { 88 + { P_BI_TCXO, 0 }, 89 + { P_VIDEO_CC_PLL0_OUT_MAIN, 1 }, 90 + }; 91 + 92 + static const struct clk_parent_data video_cc_parent_data_1[] = { 93 + { .index = DT_BI_TCXO }, 94 + { .hw = &video_cc_pll0.clkr.hw }, 95 + }; 96 + 97 + static const struct parent_map video_cc_parent_map_2[] = { 98 + { P_SLEEP_CLK, 0 }, 99 + }; 100 + 101 + static const struct clk_parent_data video_cc_parent_data_2_ao[] = { 102 + { .index = DT_SLEEP_CLK }, 103 + }; 104 + 105 + static const struct freq_tbl ftbl_video_cc_ahb_clk_src[] = { 106 + F(19200000, P_BI_TCXO, 1, 0, 0), 107 + { } 108 + }; 109 + 110 + static struct clk_rcg2 video_cc_ahb_clk_src = { 111 + .cmd_rcgr = 0x8030, 112 + .mnd_width = 0, 113 + .hid_width = 5, 114 + .parent_map = video_cc_parent_map_0, 115 + .freq_tbl = ftbl_video_cc_ahb_clk_src, 116 + .clkr.hw.init = &(const struct clk_init_data) { 117 + .name = "video_cc_ahb_clk_src", 118 + .parent_data = video_cc_parent_data_0_ao, 119 + .num_parents = ARRAY_SIZE(video_cc_parent_data_0_ao), 120 + .flags = CLK_SET_RATE_PARENT, 121 + .ops = &clk_rcg2_shared_ops, 122 + }, 123 + }; 124 + 125 + static const struct freq_tbl ftbl_video_cc_mvs0_clk_src[] = { 126 + F(604800000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 127 + F(720000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 128 + F(1014000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 129 + F(1098000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 130 + F(1332000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 131 + F(1656000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 132 + { } 133 + }; 134 + 135 + static struct clk_rcg2 video_cc_mvs0_clk_src = { 136 + .cmd_rcgr = 0x8000, 137 + .mnd_width = 0, 138 + .hid_width = 5, 139 + .parent_map = video_cc_parent_map_1, 140 + .freq_tbl = ftbl_video_cc_mvs0_clk_src, 141 + .clkr.hw.init = &(const struct clk_init_data) { 142 + .name = "video_cc_mvs0_clk_src", 143 + .parent_data = video_cc_parent_data_1, 144 + .num_parents = ARRAY_SIZE(video_cc_parent_data_1), 145 + .flags = CLK_SET_RATE_PARENT, 146 + .ops = &clk_rcg2_shared_ops, 147 + }, 148 + }; 149 + 150 + static const struct freq_tbl ftbl_video_cc_sleep_clk_src[] = { 151 + F(32000, P_SLEEP_CLK, 1, 0, 0), 152 + { } 153 + }; 154 + 155 + static struct clk_rcg2 video_cc_sleep_clk_src = { 156 + .cmd_rcgr = 0x8128, 157 + .mnd_width = 0, 158 + .hid_width = 5, 159 + .parent_map = video_cc_parent_map_2, 160 + .freq_tbl = ftbl_video_cc_sleep_clk_src, 161 + .clkr.hw.init = &(const struct clk_init_data) { 162 + .name = "video_cc_sleep_clk_src", 163 + .parent_data = video_cc_parent_data_2_ao, 164 + .num_parents = ARRAY_SIZE(video_cc_parent_data_2_ao), 165 + .flags = CLK_SET_RATE_PARENT, 166 + .ops = &clk_rcg2_ops, 167 + }, 168 + }; 169 + 170 + static struct clk_rcg2 video_cc_xo_clk_src = { 171 + .cmd_rcgr = 0x810c, 172 + .mnd_width = 0, 173 + .hid_width = 5, 174 + .parent_map = video_cc_parent_map_0, 175 + .freq_tbl = ftbl_video_cc_ahb_clk_src, 176 + .clkr.hw.init = &(const struct clk_init_data) { 177 + .name = "video_cc_xo_clk_src", 178 + .parent_data = video_cc_parent_data_0, 179 + .num_parents = ARRAY_SIZE(video_cc_parent_data_0), 180 + .flags = CLK_SET_RATE_PARENT, 181 + .ops = &clk_rcg2_ops, 182 + }, 183 + }; 184 + 185 + static struct clk_regmap_div video_cc_mvs0_div_clk_src = { 186 + .reg = 0x80c4, 187 + .shift = 0, 188 + .width = 4, 189 + .clkr.hw.init = &(const struct clk_init_data) { 190 + .name = "video_cc_mvs0_div_clk_src", 191 + .parent_hws = (const struct clk_hw*[]) { 192 + &video_cc_mvs0_clk_src.clkr.hw, 193 + }, 194 + .num_parents = 1, 195 + .flags = CLK_SET_RATE_PARENT, 196 + .ops = &clk_regmap_div_ro_ops, 197 + }, 198 + }; 199 + 200 + static struct clk_regmap_div video_cc_mvs0c_div2_div_clk_src = { 201 + .reg = 0x8070, 202 + .shift = 0, 203 + .width = 4, 204 + .clkr.hw.init = &(const struct clk_init_data) { 205 + .name = "video_cc_mvs0c_div2_div_clk_src", 206 + .parent_hws = (const struct clk_hw*[]) { 207 + &video_cc_mvs0_clk_src.clkr.hw, 208 + }, 209 + .num_parents = 1, 210 + .flags = CLK_SET_RATE_PARENT, 211 + .ops = &clk_regmap_div_ro_ops, 212 + }, 213 + }; 214 + 215 + static struct clk_branch video_cc_mvs0_clk = { 216 + .halt_reg = 0x80b8, 217 + .halt_check = BRANCH_HALT_VOTED, 218 + .hwcg_reg = 0x80b8, 219 + .hwcg_bit = 1, 220 + .clkr = { 221 + .enable_reg = 0x80b8, 222 + .enable_mask = BIT(0), 223 + .hw.init = &(const struct clk_init_data) { 224 + .name = "video_cc_mvs0_clk", 225 + .parent_hws = (const struct clk_hw*[]) { 226 + &video_cc_mvs0_div_clk_src.clkr.hw, 227 + }, 228 + .num_parents = 1, 229 + .flags = CLK_SET_RATE_PARENT, 230 + .ops = &clk_branch2_ops, 231 + }, 232 + }, 233 + }; 234 + 235 + static struct clk_branch video_cc_mvs0_shift_clk = { 236 + .halt_reg = 0x8144, 237 + .halt_check = BRANCH_HALT_VOTED, 238 + .hwcg_reg = 0x8144, 239 + .hwcg_bit = 1, 240 + .clkr = { 241 + .enable_reg = 0x8144, 242 + .enable_mask = BIT(0), 243 + .hw.init = &(const struct clk_init_data) { 244 + .name = "video_cc_mvs0_shift_clk", 245 + .parent_hws = (const struct clk_hw*[]) { 246 + &video_cc_xo_clk_src.clkr.hw, 247 + }, 248 + .num_parents = 1, 249 + .flags = CLK_SET_RATE_PARENT, 250 + .ops = &clk_branch2_ops, 251 + }, 252 + }, 253 + }; 254 + 255 + static struct clk_branch video_cc_mvs0c_clk = { 256 + .halt_reg = 0x8064, 257 + .halt_check = BRANCH_HALT, 258 + .clkr = { 259 + .enable_reg = 0x8064, 260 + .enable_mask = BIT(0), 261 + .hw.init = &(const struct clk_init_data) { 262 + .name = "video_cc_mvs0c_clk", 263 + .parent_hws = (const struct clk_hw*[]) { 264 + &video_cc_mvs0c_div2_div_clk_src.clkr.hw, 265 + }, 266 + .num_parents = 1, 267 + .flags = CLK_SET_RATE_PARENT, 268 + .ops = &clk_branch2_ops, 269 + }, 270 + }, 271 + }; 272 + 273 + static struct clk_branch video_cc_mvs0c_shift_clk = { 274 + .halt_reg = 0x8148, 275 + .halt_check = BRANCH_HALT_VOTED, 276 + .hwcg_reg = 0x8148, 277 + .hwcg_bit = 1, 278 + .clkr = { 279 + .enable_reg = 0x8148, 280 + .enable_mask = BIT(0), 281 + .hw.init = &(const struct clk_init_data) { 282 + .name = "video_cc_mvs0c_shift_clk", 283 + .parent_hws = (const struct clk_hw*[]) { 284 + &video_cc_xo_clk_src.clkr.hw, 285 + }, 286 + .num_parents = 1, 287 + .flags = CLK_SET_RATE_PARENT, 288 + .ops = &clk_branch2_ops, 289 + }, 290 + }, 291 + }; 292 + 293 + static struct gdsc video_cc_mvs0c_gdsc = { 294 + .gdscr = 0x804c, 295 + .en_rest_wait_val = 0x2, 296 + .en_few_wait_val = 0x2, 297 + .clk_dis_wait_val = 0x6, 298 + .pd = { 299 + .name = "video_cc_mvs0c_gdsc", 300 + }, 301 + .pwrsts = PWRSTS_OFF_ON, 302 + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, 303 + }; 304 + 305 + static struct gdsc video_cc_mvs0_gdsc = { 306 + .gdscr = 0x80a4, 307 + .en_rest_wait_val = 0x2, 308 + .en_few_wait_val = 0x2, 309 + .clk_dis_wait_val = 0x6, 310 + .pd = { 311 + .name = "video_cc_mvs0_gdsc", 312 + }, 313 + .pwrsts = PWRSTS_OFF_ON, 314 + .parent = &video_cc_mvs0c_gdsc.pd, 315 + .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | HW_CTRL_TRIGGER, 316 + }; 317 + 318 + static struct clk_regmap *video_cc_milos_clocks[] = { 319 + [VIDEO_CC_AHB_CLK_SRC] = &video_cc_ahb_clk_src.clkr, 320 + [VIDEO_CC_MVS0_CLK] = &video_cc_mvs0_clk.clkr, 321 + [VIDEO_CC_MVS0_CLK_SRC] = &video_cc_mvs0_clk_src.clkr, 322 + [VIDEO_CC_MVS0_DIV_CLK_SRC] = &video_cc_mvs0_div_clk_src.clkr, 323 + [VIDEO_CC_MVS0_SHIFT_CLK] = &video_cc_mvs0_shift_clk.clkr, 324 + [VIDEO_CC_MVS0C_CLK] = &video_cc_mvs0c_clk.clkr, 325 + [VIDEO_CC_MVS0C_DIV2_DIV_CLK_SRC] = &video_cc_mvs0c_div2_div_clk_src.clkr, 326 + [VIDEO_CC_MVS0C_SHIFT_CLK] = &video_cc_mvs0c_shift_clk.clkr, 327 + [VIDEO_CC_PLL0] = &video_cc_pll0.clkr, 328 + [VIDEO_CC_SLEEP_CLK_SRC] = &video_cc_sleep_clk_src.clkr, 329 + [VIDEO_CC_XO_CLK_SRC] = &video_cc_xo_clk_src.clkr, 330 + }; 331 + 332 + static struct gdsc *video_cc_milos_gdscs[] = { 333 + [VIDEO_CC_MVS0C_GDSC] = &video_cc_mvs0c_gdsc, 334 + [VIDEO_CC_MVS0_GDSC] = &video_cc_mvs0_gdsc, 335 + }; 336 + 337 + static const struct qcom_reset_map video_cc_milos_resets[] = { 338 + [VIDEO_CC_INTERFACE_BCR] = { 0x80f0 }, 339 + [VIDEO_CC_MVS0_BCR] = { 0x80a0 }, 340 + [VIDEO_CC_MVS0C_CLK_ARES] = { 0x8064, 2 }, 341 + [VIDEO_CC_MVS0C_BCR] = { 0x8048 }, 342 + }; 343 + 344 + static struct clk_alpha_pll *video_cc_milos_plls[] = { 345 + &video_cc_pll0, 346 + }; 347 + 348 + static u32 video_cc_milos_critical_cbcrs[] = { 349 + 0x80f4, /* VIDEO_CC_AHB_CLK */ 350 + 0x8140, /* VIDEO_CC_SLEEP_CLK */ 351 + 0x8124, /* VIDEO_CC_XO_CLK */ 352 + }; 353 + 354 + static const struct regmap_config video_cc_milos_regmap_config = { 355 + .reg_bits = 32, 356 + .reg_stride = 4, 357 + .val_bits = 32, 358 + .max_register = 0x9f50, 359 + .fast_io = true, 360 + }; 361 + 362 + static struct qcom_cc_driver_data video_cc_milos_driver_data = { 363 + .alpha_plls = video_cc_milos_plls, 364 + .num_alpha_plls = ARRAY_SIZE(video_cc_milos_plls), 365 + .clk_cbcrs = video_cc_milos_critical_cbcrs, 366 + .num_clk_cbcrs = ARRAY_SIZE(video_cc_milos_critical_cbcrs), 367 + }; 368 + 369 + static struct qcom_cc_desc video_cc_milos_desc = { 370 + .config = &video_cc_milos_regmap_config, 371 + .clks = video_cc_milos_clocks, 372 + .num_clks = ARRAY_SIZE(video_cc_milos_clocks), 373 + .resets = video_cc_milos_resets, 374 + .num_resets = ARRAY_SIZE(video_cc_milos_resets), 375 + .gdscs = video_cc_milos_gdscs, 376 + .num_gdscs = ARRAY_SIZE(video_cc_milos_gdscs), 377 + .use_rpm = true, 378 + .driver_data = &video_cc_milos_driver_data, 379 + }; 380 + 381 + static const struct of_device_id video_cc_milos_match_table[] = { 382 + { .compatible = "qcom,milos-videocc" }, 383 + { } 384 + }; 385 + MODULE_DEVICE_TABLE(of, video_cc_milos_match_table); 386 + 387 + static int video_cc_milos_probe(struct platform_device *pdev) 388 + { 389 + return qcom_cc_probe(pdev, &video_cc_milos_desc); 390 + } 391 + 392 + static struct platform_driver video_cc_milos_driver = { 393 + .probe = video_cc_milos_probe, 394 + .driver = { 395 + .name = "video_cc-milos", 396 + .of_match_table = video_cc_milos_match_table, 397 + }, 398 + }; 399 + 400 + module_platform_driver(video_cc_milos_driver); 401 + 402 + MODULE_DESCRIPTION("QTI VIDEO_CC Milos Driver"); 403 + MODULE_LICENSE("GPL");
+338
drivers/clk/qcom/videocc-qcs615.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #include <linux/clk-provider.h> 7 + #include <linux/module.h> 8 + #include <linux/mod_devicetable.h> 9 + #include <linux/of.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/regmap.h> 12 + 13 + #include <dt-bindings/clock/qcom,qcs615-videocc.h> 14 + 15 + #include "clk-alpha-pll.h" 16 + #include "clk-branch.h" 17 + #include "clk-pll.h" 18 + #include "clk-rcg.h" 19 + #include "clk-regmap.h" 20 + #include "clk-regmap-divider.h" 21 + #include "clk-regmap-mux.h" 22 + #include "common.h" 23 + #include "gdsc.h" 24 + #include "reset.h" 25 + 26 + enum { 27 + DT_BI_TCXO, 28 + DT_SLEEP_CLK, 29 + }; 30 + 31 + enum { 32 + P_BI_TCXO, 33 + P_SLEEP_CLK, 34 + P_VIDEO_PLL0_OUT_AUX, 35 + P_VIDEO_PLL0_OUT_AUX2, 36 + P_VIDEO_PLL0_OUT_MAIN, 37 + }; 38 + 39 + static const struct pll_vco video_cc_pll0_vco[] = { 40 + { 500000000, 1000000000, 2 }, 41 + }; 42 + 43 + /* 600MHz configuration VCO - 2 */ 44 + static struct alpha_pll_config video_pll0_config = { 45 + .l = 0x1f, 46 + .alpha_hi = 0x40, 47 + .alpha = 0x00, 48 + .alpha_en_mask = BIT(24), 49 + .vco_val = BIT(21), 50 + .vco_mask = GENMASK(21, 20), 51 + .main_output_mask = BIT(0), 52 + .config_ctl_val = 0x4001055b, 53 + .test_ctl_hi_val = 0x1, 54 + .test_ctl_hi_mask = 0x1, 55 + }; 56 + 57 + static struct clk_alpha_pll video_pll0 = { 58 + .offset = 0x42c, 59 + .config = &video_pll0_config, 60 + .vco_table = video_cc_pll0_vco, 61 + .num_vco = ARRAY_SIZE(video_cc_pll0_vco), 62 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 63 + .clkr = { 64 + .hw.init = &(const struct clk_init_data) { 65 + .name = "video_pll0", 66 + .parent_data = &(const struct clk_parent_data) { 67 + .index = DT_BI_TCXO, 68 + }, 69 + .num_parents = 1, 70 + .ops = &clk_alpha_pll_slew_ops, 71 + }, 72 + }, 73 + }; 74 + 75 + static const struct parent_map video_cc_parent_map_0[] = { 76 + { P_SLEEP_CLK, 0 }, 77 + }; 78 + 79 + static const struct clk_parent_data video_cc_parent_data_0_ao[] = { 80 + { .index = DT_SLEEP_CLK }, 81 + }; 82 + 83 + static const struct parent_map video_cc_parent_map_1[] = { 84 + { P_BI_TCXO, 0 }, 85 + { P_VIDEO_PLL0_OUT_MAIN, 1 }, 86 + { P_VIDEO_PLL0_OUT_AUX, 2 }, 87 + { P_VIDEO_PLL0_OUT_AUX2, 3 }, 88 + }; 89 + 90 + static const struct clk_parent_data video_cc_parent_data_1[] = { 91 + { .index = DT_BI_TCXO }, 92 + { .hw = &video_pll0.clkr.hw }, 93 + { .hw = &video_pll0.clkr.hw }, 94 + { .hw = &video_pll0.clkr.hw }, 95 + }; 96 + 97 + static const struct freq_tbl ftbl_video_cc_sleep_clk_src[] = { 98 + F(32000, P_SLEEP_CLK, 1, 0, 0), 99 + { } 100 + }; 101 + 102 + static struct clk_rcg2 video_cc_sleep_clk_src = { 103 + .cmd_rcgr = 0xaf8, 104 + .mnd_width = 0, 105 + .hid_width = 5, 106 + .parent_map = video_cc_parent_map_0, 107 + .freq_tbl = ftbl_video_cc_sleep_clk_src, 108 + .clkr.hw.init = &(const struct clk_init_data) { 109 + .name = "video_cc_sleep_clk_src", 110 + .parent_data = video_cc_parent_data_0_ao, 111 + .num_parents = ARRAY_SIZE(video_cc_parent_data_0_ao), 112 + .ops = &clk_rcg2_ops, 113 + }, 114 + }; 115 + 116 + static const struct freq_tbl ftbl_video_cc_venus_clk_src[] = { 117 + F(19200000, P_BI_TCXO, 1, 0, 0), 118 + F(133333333, P_VIDEO_PLL0_OUT_MAIN, 4.5, 0, 0), 119 + F(240000000, P_VIDEO_PLL0_OUT_MAIN, 2.5, 0, 0), 120 + F(300000000, P_VIDEO_PLL0_OUT_MAIN, 2, 0, 0), 121 + F(380000000, P_VIDEO_PLL0_OUT_MAIN, 2, 0, 0), 122 + F(410000000, P_VIDEO_PLL0_OUT_MAIN, 2, 0, 0), 123 + F(460000000, P_VIDEO_PLL0_OUT_MAIN, 2, 0, 0), 124 + { } 125 + }; 126 + 127 + static struct clk_rcg2 video_cc_venus_clk_src = { 128 + .cmd_rcgr = 0x7f0, 129 + .mnd_width = 0, 130 + .hid_width = 5, 131 + .parent_map = video_cc_parent_map_1, 132 + .freq_tbl = ftbl_video_cc_venus_clk_src, 133 + .clkr.hw.init = &(const struct clk_init_data) { 134 + .name = "video_cc_venus_clk_src", 135 + .parent_data = video_cc_parent_data_1, 136 + .num_parents = ARRAY_SIZE(video_cc_parent_data_1), 137 + .flags = CLK_SET_RATE_PARENT, 138 + .ops = &clk_rcg2_shared_ops, 139 + }, 140 + }; 141 + 142 + static struct clk_branch video_cc_sleep_clk = { 143 + .halt_reg = 0xb18, 144 + .halt_check = BRANCH_HALT, 145 + .clkr = { 146 + .enable_reg = 0xb18, 147 + .enable_mask = BIT(0), 148 + .hw.init = &(struct clk_init_data){ 149 + .name = "video_cc_sleep_clk", 150 + .parent_data = &(const struct clk_parent_data){ 151 + .hw = &video_cc_sleep_clk_src.clkr.hw, 152 + }, 153 + .num_parents = 1, 154 + .flags = CLK_SET_RATE_PARENT, 155 + .ops = &clk_branch2_ops, 156 + }, 157 + }, 158 + }; 159 + 160 + static struct clk_branch video_cc_vcodec0_axi_clk = { 161 + .halt_reg = 0x8f0, 162 + .halt_check = BRANCH_HALT, 163 + .clkr = { 164 + .enable_reg = 0x8f0, 165 + .enable_mask = BIT(0), 166 + .hw.init = &(const struct clk_init_data) { 167 + .name = "video_cc_vcodec0_axi_clk", 168 + .ops = &clk_branch2_ops, 169 + }, 170 + }, 171 + }; 172 + 173 + static struct clk_branch video_cc_vcodec0_core_clk = { 174 + .halt_reg = 0x890, 175 + .halt_check = BRANCH_HALT_VOTED, 176 + .clkr = { 177 + .enable_reg = 0x890, 178 + .enable_mask = BIT(0), 179 + .hw.init = &(const struct clk_init_data) { 180 + .name = "video_cc_vcodec0_core_clk", 181 + .parent_hws = (const struct clk_hw*[]) { 182 + &video_cc_venus_clk_src.clkr.hw, 183 + }, 184 + .num_parents = 1, 185 + .flags = CLK_SET_RATE_PARENT, 186 + .ops = &clk_branch2_ops, 187 + }, 188 + }, 189 + }; 190 + 191 + static struct clk_branch video_cc_venus_ahb_clk = { 192 + .halt_reg = 0x9b0, 193 + .halt_check = BRANCH_HALT, 194 + .clkr = { 195 + .enable_reg = 0x9b0, 196 + .enable_mask = BIT(0), 197 + .hw.init = &(const struct clk_init_data) { 198 + .name = "video_cc_venus_ahb_clk", 199 + .ops = &clk_branch2_ops, 200 + }, 201 + }, 202 + }; 203 + 204 + static struct clk_branch video_cc_venus_ctl_axi_clk = { 205 + .halt_reg = 0x8d0, 206 + .halt_check = BRANCH_HALT, 207 + .clkr = { 208 + .enable_reg = 0x8d0, 209 + .enable_mask = BIT(0), 210 + .hw.init = &(const struct clk_init_data) { 211 + .name = "video_cc_venus_ctl_axi_clk", 212 + .ops = &clk_branch2_ops, 213 + }, 214 + }, 215 + }; 216 + 217 + static struct clk_branch video_cc_venus_ctl_core_clk = { 218 + .halt_reg = 0x850, 219 + .halt_check = BRANCH_HALT, 220 + .clkr = { 221 + .enable_reg = 0x850, 222 + .enable_mask = BIT(0), 223 + .hw.init = &(const struct clk_init_data) { 224 + .name = "video_cc_venus_ctl_core_clk", 225 + .parent_hws = (const struct clk_hw*[]) { 226 + &video_cc_venus_clk_src.clkr.hw, 227 + }, 228 + .num_parents = 1, 229 + .flags = CLK_SET_RATE_PARENT, 230 + .ops = &clk_branch2_ops, 231 + }, 232 + }, 233 + }; 234 + 235 + static struct gdsc vcodec0_gdsc = { 236 + .gdscr = 0x874, 237 + .en_rest_wait_val = 0x2, 238 + .en_few_wait_val = 0x2, 239 + .clk_dis_wait_val = 0x6, 240 + .pd = { 241 + .name = "vcodec0_gdsc", 242 + }, 243 + .pwrsts = PWRSTS_OFF_ON, 244 + .flags = HW_CTRL_TRIGGER | POLL_CFG_GDSCR, 245 + }; 246 + 247 + static struct gdsc venus_gdsc = { 248 + .gdscr = 0x814, 249 + .en_rest_wait_val = 0x2, 250 + .en_few_wait_val = 0x2, 251 + .clk_dis_wait_val = 0x6, 252 + .pd = { 253 + .name = "venus_gdsc", 254 + }, 255 + .pwrsts = PWRSTS_OFF_ON, 256 + .flags = POLL_CFG_GDSCR, 257 + }; 258 + 259 + static struct clk_regmap *video_cc_qcs615_clocks[] = { 260 + [VIDEO_CC_SLEEP_CLK] = &video_cc_sleep_clk.clkr, 261 + [VIDEO_CC_SLEEP_CLK_SRC] = &video_cc_sleep_clk_src.clkr, 262 + [VIDEO_CC_VCODEC0_AXI_CLK] = &video_cc_vcodec0_axi_clk.clkr, 263 + [VIDEO_CC_VCODEC0_CORE_CLK] = &video_cc_vcodec0_core_clk.clkr, 264 + [VIDEO_CC_VENUS_AHB_CLK] = &video_cc_venus_ahb_clk.clkr, 265 + [VIDEO_CC_VENUS_CLK_SRC] = &video_cc_venus_clk_src.clkr, 266 + [VIDEO_CC_VENUS_CTL_AXI_CLK] = &video_cc_venus_ctl_axi_clk.clkr, 267 + [VIDEO_CC_VENUS_CTL_CORE_CLK] = &video_cc_venus_ctl_core_clk.clkr, 268 + [VIDEO_PLL0] = &video_pll0.clkr, 269 + }; 270 + 271 + static struct gdsc *video_cc_qcs615_gdscs[] = { 272 + [VCODEC0_GDSC] = &vcodec0_gdsc, 273 + [VENUS_GDSC] = &venus_gdsc, 274 + }; 275 + 276 + static const struct qcom_reset_map video_cc_qcs615_resets[] = { 277 + [VIDEO_CC_INTERFACE_BCR] = { 0x8b0 }, 278 + [VIDEO_CC_VCODEC0_BCR] = { 0x870 }, 279 + [VIDEO_CC_VENUS_BCR] = { 0x810 }, 280 + }; 281 + 282 + static struct clk_alpha_pll *video_cc_qcs615_plls[] = { 283 + &video_pll0, 284 + }; 285 + 286 + static u32 video_cc_qcs615_critical_cbcrs[] = { 287 + 0xab8, /* VIDEO_CC_XO_CLK */ 288 + }; 289 + 290 + static const struct regmap_config video_cc_qcs615_regmap_config = { 291 + .reg_bits = 32, 292 + .reg_stride = 4, 293 + .val_bits = 32, 294 + .max_register = 0xb94, 295 + .fast_io = true, 296 + }; 297 + 298 + static struct qcom_cc_driver_data video_cc_qcs615_driver_data = { 299 + .alpha_plls = video_cc_qcs615_plls, 300 + .num_alpha_plls = ARRAY_SIZE(video_cc_qcs615_plls), 301 + .clk_cbcrs = video_cc_qcs615_critical_cbcrs, 302 + .num_clk_cbcrs = ARRAY_SIZE(video_cc_qcs615_critical_cbcrs), 303 + }; 304 + 305 + static const struct qcom_cc_desc video_cc_qcs615_desc = { 306 + .config = &video_cc_qcs615_regmap_config, 307 + .clks = video_cc_qcs615_clocks, 308 + .num_clks = ARRAY_SIZE(video_cc_qcs615_clocks), 309 + .resets = video_cc_qcs615_resets, 310 + .num_resets = ARRAY_SIZE(video_cc_qcs615_resets), 311 + .gdscs = video_cc_qcs615_gdscs, 312 + .num_gdscs = ARRAY_SIZE(video_cc_qcs615_gdscs), 313 + .driver_data = &video_cc_qcs615_driver_data, 314 + }; 315 + 316 + static const struct of_device_id video_cc_qcs615_match_table[] = { 317 + { .compatible = "qcom,qcs615-videocc" }, 318 + { } 319 + }; 320 + MODULE_DEVICE_TABLE(of, video_cc_qcs615_match_table); 321 + 322 + static int video_cc_qcs615_probe(struct platform_device *pdev) 323 + { 324 + return qcom_cc_probe(pdev, &video_cc_qcs615_desc); 325 + } 326 + 327 + static struct platform_driver video_cc_qcs615_driver = { 328 + .probe = video_cc_qcs615_probe, 329 + .driver = { 330 + .name = "videocc-qcs615", 331 + .of_match_table = video_cc_qcs615_match_table, 332 + }, 333 + }; 334 + 335 + module_platform_driver(video_cc_qcs615_driver); 336 + 337 + MODULE_DESCRIPTION("QTI VIDEOCC QCS615 Driver"); 338 + MODULE_LICENSE("GPL");
+1 -1
drivers/clk/qcom/videocc-sc7180.c
··· 166 166 .pd = { 167 167 .name = "vcodec0_gdsc", 168 168 }, 169 - .flags = HW_CTRL, 169 + .flags = HW_CTRL_TRIGGER, 170 170 .pwrsts = PWRSTS_OFF_ON, 171 171 }; 172 172
+2 -2
drivers/clk/qcom/videocc-sdm845.c
··· 260 260 }, 261 261 .cxcs = (unsigned int []){ 0x890, 0x930 }, 262 262 .cxc_count = 2, 263 - .flags = HW_CTRL | POLL_CFG_GDSCR, 263 + .flags = HW_CTRL_TRIGGER | POLL_CFG_GDSCR, 264 264 .pwrsts = PWRSTS_OFF_ON, 265 265 }; 266 266 ··· 271 271 }, 272 272 .cxcs = (unsigned int []){ 0x8d0, 0x950 }, 273 273 .cxc_count = 2, 274 - .flags = HW_CTRL | POLL_CFG_GDSCR, 274 + .flags = HW_CTRL_TRIGGER | POLL_CFG_GDSCR, 275 275 .pwrsts = PWRSTS_OFF_ON, 276 276 }; 277 277
+355
drivers/clk/qcom/videocc-sm6350.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (c) 2021, The Linux Foundation. All rights reserved. 4 + * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org> 5 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 6 + */ 7 + 8 + #include <linux/clk-provider.h> 9 + #include <linux/module.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/regmap.h> 12 + 13 + #include <dt-bindings/clock/qcom,sm6350-videocc.h> 14 + 15 + #include "clk-alpha-pll.h" 16 + #include "clk-branch.h" 17 + #include "clk-rcg.h" 18 + #include "clk-regmap.h" 19 + #include "common.h" 20 + #include "gdsc.h" 21 + 22 + enum { 23 + DT_IFACE, 24 + DT_BI_TCXO, 25 + DT_SLEEP_CLK, 26 + }; 27 + 28 + enum { 29 + P_BI_TCXO, 30 + P_CHIP_SLEEP_CLK, 31 + P_VIDEO_PLL0_OUT_EVEN, 32 + }; 33 + 34 + static const struct pll_vco fabia_vco[] = { 35 + { 125000000, 1000000000, 1 }, 36 + }; 37 + 38 + /* 600 MHz */ 39 + static const struct alpha_pll_config video_pll0_config = { 40 + .l = 0x1f, 41 + .alpha = 0x4000, 42 + .config_ctl_val = 0x20485699, 43 + .config_ctl_hi_val = 0x00002067, 44 + .test_ctl_val = 0x40000000, 45 + .test_ctl_hi_val = 0x00000002, 46 + .user_ctl_val = 0x00000101, 47 + .user_ctl_hi_val = 0x00004005, 48 + }; 49 + 50 + static struct clk_alpha_pll video_pll0 = { 51 + .offset = 0x0, 52 + .vco_table = fabia_vco, 53 + .num_vco = ARRAY_SIZE(fabia_vco), 54 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA], 55 + .clkr = { 56 + .hw.init = &(const struct clk_init_data) { 57 + .name = "video_pll0", 58 + .parent_data = &(const struct clk_parent_data) { 59 + .index = DT_BI_TCXO, 60 + }, 61 + .num_parents = 1, 62 + .ops = &clk_alpha_pll_fabia_ops, 63 + }, 64 + }, 65 + }; 66 + 67 + static const struct clk_div_table post_div_table_video_pll0_out_even[] = { 68 + { 0x1, 2 }, 69 + { } 70 + }; 71 + 72 + static struct clk_alpha_pll_postdiv video_pll0_out_even = { 73 + .offset = 0x0, 74 + .post_div_shift = 8, 75 + .post_div_table = post_div_table_video_pll0_out_even, 76 + .num_post_div = ARRAY_SIZE(post_div_table_video_pll0_out_even), 77 + .width = 4, 78 + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA], 79 + .clkr.hw.init = &(const struct clk_init_data) { 80 + .name = "video_pll0_out_even", 81 + .parent_hws = (const struct clk_hw*[]) { 82 + &video_pll0.clkr.hw, 83 + }, 84 + .num_parents = 1, 85 + .flags = CLK_SET_RATE_PARENT, 86 + .ops = &clk_alpha_pll_postdiv_fabia_ops, 87 + }, 88 + }; 89 + 90 + static const struct parent_map video_cc_parent_map_0[] = { 91 + { P_BI_TCXO, 0 }, 92 + { P_VIDEO_PLL0_OUT_EVEN, 3 }, 93 + }; 94 + 95 + static const struct clk_parent_data video_cc_parent_data_0[] = { 96 + { .index = DT_BI_TCXO }, 97 + { .hw = &video_pll0_out_even.clkr.hw }, 98 + }; 99 + 100 + static const struct parent_map video_cc_parent_map_1[] = { 101 + { P_CHIP_SLEEP_CLK, 0 }, 102 + }; 103 + 104 + static const struct clk_parent_data video_cc_parent_data_1[] = { 105 + { .index = DT_SLEEP_CLK }, 106 + }; 107 + 108 + static const struct freq_tbl ftbl_video_cc_iris_clk_src[] = { 109 + F(133250000, P_VIDEO_PLL0_OUT_EVEN, 2, 0, 0), 110 + F(240000000, P_VIDEO_PLL0_OUT_EVEN, 1.5, 0, 0), 111 + F(300000000, P_VIDEO_PLL0_OUT_EVEN, 1, 0, 0), 112 + F(380000000, P_VIDEO_PLL0_OUT_EVEN, 1, 0, 0), 113 + F(460000000, P_VIDEO_PLL0_OUT_EVEN, 1, 0, 0), 114 + { } 115 + }; 116 + 117 + static struct clk_rcg2 video_cc_iris_clk_src = { 118 + .cmd_rcgr = 0x1000, 119 + .mnd_width = 0, 120 + .hid_width = 5, 121 + .parent_map = video_cc_parent_map_0, 122 + .freq_tbl = ftbl_video_cc_iris_clk_src, 123 + .clkr.hw.init = &(const struct clk_init_data) { 124 + .name = "video_cc_iris_clk_src", 125 + .parent_data = video_cc_parent_data_0, 126 + .num_parents = ARRAY_SIZE(video_cc_parent_data_0), 127 + .flags = CLK_SET_RATE_PARENT, 128 + .ops = &clk_rcg2_shared_ops, 129 + }, 130 + }; 131 + 132 + static const struct freq_tbl ftbl_video_cc_sleep_clk_src[] = { 133 + F(32764, P_CHIP_SLEEP_CLK, 1, 0, 0), 134 + { } 135 + }; 136 + 137 + static struct clk_rcg2 video_cc_sleep_clk_src = { 138 + .cmd_rcgr = 0x701c, 139 + .mnd_width = 0, 140 + .hid_width = 5, 141 + .parent_map = video_cc_parent_map_1, 142 + .freq_tbl = ftbl_video_cc_sleep_clk_src, 143 + .clkr.hw.init = &(const struct clk_init_data) { 144 + .name = "video_cc_sleep_clk_src", 145 + .parent_data = video_cc_parent_data_1, 146 + .num_parents = ARRAY_SIZE(video_cc_parent_data_1), 147 + .ops = &clk_rcg2_ops, 148 + }, 149 + }; 150 + 151 + static struct clk_branch video_cc_iris_ahb_clk = { 152 + .halt_reg = 0x5004, 153 + .halt_check = BRANCH_VOTED, 154 + .clkr = { 155 + .enable_reg = 0x5004, 156 + .enable_mask = BIT(0), 157 + .hw.init = &(const struct clk_init_data) { 158 + .name = "video_cc_iris_ahb_clk", 159 + .parent_hws = (const struct clk_hw*[]) { 160 + &video_cc_iris_clk_src.clkr.hw, 161 + }, 162 + .num_parents = 1, 163 + .flags = CLK_SET_RATE_PARENT, 164 + .ops = &clk_branch2_ops, 165 + }, 166 + }, 167 + }; 168 + 169 + static struct clk_branch video_cc_mvs0_axi_clk = { 170 + .halt_reg = 0x800c, 171 + .halt_check = BRANCH_HALT, 172 + .clkr = { 173 + .enable_reg = 0x800c, 174 + .enable_mask = BIT(0), 175 + .hw.init = &(const struct clk_init_data) { 176 + .name = "video_cc_mvs0_axi_clk", 177 + .ops = &clk_branch2_ops, 178 + }, 179 + }, 180 + }; 181 + 182 + static struct clk_branch video_cc_mvs0_core_clk = { 183 + .halt_reg = 0x3010, 184 + .halt_check = BRANCH_VOTED, 185 + .hwcg_reg = 0x3010, 186 + .hwcg_bit = 1, 187 + .clkr = { 188 + .enable_reg = 0x3010, 189 + .enable_mask = BIT(0), 190 + .hw.init = &(const struct clk_init_data) { 191 + .name = "video_cc_mvs0_core_clk", 192 + .parent_hws = (const struct clk_hw*[]) { 193 + &video_cc_iris_clk_src.clkr.hw, 194 + }, 195 + .num_parents = 1, 196 + .flags = CLK_SET_RATE_PARENT, 197 + .ops = &clk_branch2_ops, 198 + }, 199 + }, 200 + }; 201 + 202 + static struct clk_branch video_cc_mvsc_core_clk = { 203 + .halt_reg = 0x2014, 204 + .halt_check = BRANCH_HALT, 205 + .clkr = { 206 + .enable_reg = 0x2014, 207 + .enable_mask = BIT(0), 208 + .hw.init = &(const struct clk_init_data) { 209 + .name = "video_cc_mvsc_core_clk", 210 + .parent_hws = (const struct clk_hw*[]) { 211 + &video_cc_iris_clk_src.clkr.hw, 212 + }, 213 + .num_parents = 1, 214 + .flags = CLK_SET_RATE_PARENT, 215 + .ops = &clk_branch2_ops, 216 + }, 217 + }, 218 + }; 219 + 220 + static struct clk_branch video_cc_mvsc_ctl_axi_clk = { 221 + .halt_reg = 0x8004, 222 + .halt_check = BRANCH_HALT, 223 + .clkr = { 224 + .enable_reg = 0x8004, 225 + .enable_mask = BIT(0), 226 + .hw.init = &(const struct clk_init_data) { 227 + .name = "video_cc_mvsc_ctl_axi_clk", 228 + .ops = &clk_branch2_ops, 229 + }, 230 + }, 231 + }; 232 + 233 + static struct clk_branch video_cc_sleep_clk = { 234 + .halt_reg = 0x7034, 235 + .halt_check = BRANCH_HALT, 236 + .clkr = { 237 + .enable_reg = 0x7034, 238 + .enable_mask = BIT(0), 239 + .hw.init = &(const struct clk_init_data) { 240 + .name = "video_cc_sleep_clk", 241 + .parent_hws = (const struct clk_hw*[]) { 242 + &video_cc_sleep_clk_src.clkr.hw, 243 + }, 244 + .num_parents = 1, 245 + .flags = CLK_SET_RATE_PARENT, 246 + .ops = &clk_branch2_ops, 247 + }, 248 + }, 249 + }; 250 + 251 + static struct clk_branch video_cc_venus_ahb_clk = { 252 + .halt_reg = 0x801c, 253 + .halt_check = BRANCH_HALT, 254 + .clkr = { 255 + .enable_reg = 0x801c, 256 + .enable_mask = BIT(0), 257 + .hw.init = &(const struct clk_init_data) { 258 + .name = "video_cc_venus_ahb_clk", 259 + .ops = &clk_branch2_ops, 260 + }, 261 + }, 262 + }; 263 + 264 + static struct gdsc mvsc_gdsc = { 265 + .gdscr = 0x2004, 266 + .en_rest_wait_val = 0x2, 267 + .en_few_wait_val = 0x2, 268 + .clk_dis_wait_val = 0x6, 269 + .pd = { 270 + .name = "mvsc_gdsc", 271 + }, 272 + .pwrsts = PWRSTS_OFF_ON, 273 + }; 274 + 275 + static struct gdsc mvs0_gdsc = { 276 + .gdscr = 0x3004, 277 + .en_rest_wait_val = 0x2, 278 + .en_few_wait_val = 0x2, 279 + .clk_dis_wait_val = 0x6, 280 + .pd = { 281 + .name = "mvs0_gdsc", 282 + }, 283 + .pwrsts = PWRSTS_OFF_ON, 284 + .flags = HW_CTRL_TRIGGER, 285 + }; 286 + 287 + static struct gdsc *video_cc_sm6350_gdscs[] = { 288 + [MVSC_GDSC] = &mvsc_gdsc, 289 + [MVS0_GDSC] = &mvs0_gdsc, 290 + }; 291 + 292 + static struct clk_regmap *video_cc_sm6350_clocks[] = { 293 + [VIDEO_CC_IRIS_AHB_CLK] = &video_cc_iris_ahb_clk.clkr, 294 + [VIDEO_CC_IRIS_CLK_SRC] = &video_cc_iris_clk_src.clkr, 295 + [VIDEO_CC_MVS0_AXI_CLK] = &video_cc_mvs0_axi_clk.clkr, 296 + [VIDEO_CC_MVS0_CORE_CLK] = &video_cc_mvs0_core_clk.clkr, 297 + [VIDEO_CC_MVSC_CORE_CLK] = &video_cc_mvsc_core_clk.clkr, 298 + [VIDEO_CC_MVSC_CTL_AXI_CLK] = &video_cc_mvsc_ctl_axi_clk.clkr, 299 + [VIDEO_CC_SLEEP_CLK] = &video_cc_sleep_clk.clkr, 300 + [VIDEO_CC_SLEEP_CLK_SRC] = &video_cc_sleep_clk_src.clkr, 301 + [VIDEO_CC_VENUS_AHB_CLK] = &video_cc_venus_ahb_clk.clkr, 302 + [VIDEO_PLL0] = &video_pll0.clkr, 303 + [VIDEO_PLL0_OUT_EVEN] = &video_pll0_out_even.clkr, 304 + }; 305 + 306 + static const struct regmap_config video_cc_sm6350_regmap_config = { 307 + .reg_bits = 32, 308 + .reg_stride = 4, 309 + .val_bits = 32, 310 + .max_register = 0xb000, 311 + .fast_io = true, 312 + }; 313 + 314 + static const struct qcom_cc_desc video_cc_sm6350_desc = { 315 + .config = &video_cc_sm6350_regmap_config, 316 + .clks = video_cc_sm6350_clocks, 317 + .num_clks = ARRAY_SIZE(video_cc_sm6350_clocks), 318 + .gdscs = video_cc_sm6350_gdscs, 319 + .num_gdscs = ARRAY_SIZE(video_cc_sm6350_gdscs), 320 + }; 321 + 322 + static const struct of_device_id video_cc_sm6350_match_table[] = { 323 + { .compatible = "qcom,sm6350-videocc" }, 324 + { } 325 + }; 326 + MODULE_DEVICE_TABLE(of, video_cc_sm6350_match_table); 327 + 328 + static int video_cc_sm6350_probe(struct platform_device *pdev) 329 + { 330 + struct regmap *regmap; 331 + 332 + regmap = qcom_cc_map(pdev, &video_cc_sm6350_desc); 333 + if (IS_ERR(regmap)) 334 + return PTR_ERR(regmap); 335 + 336 + clk_fabia_pll_configure(&video_pll0, regmap, &video_pll0_config); 337 + 338 + /* Keep some clocks always-on */ 339 + qcom_branch_set_clk_en(regmap, 0x7018); /* VIDEO_CC_XO_CLK */ 340 + 341 + return qcom_cc_really_probe(&pdev->dev, &video_cc_sm6350_desc, regmap); 342 + } 343 + 344 + static struct platform_driver video_cc_sm6350_driver = { 345 + .probe = video_cc_sm6350_probe, 346 + .driver = { 347 + .name = "video_cc-sm6350", 348 + .of_match_table = video_cc_sm6350_match_table, 349 + }, 350 + }; 351 + 352 + module_platform_driver(video_cc_sm6350_driver); 353 + 354 + MODULE_DESCRIPTION("QTI VIDEO_CC SM6350 Driver"); 355 + MODULE_LICENSE("GPL");
+2 -2
drivers/clk/qcom/videocc-sm7150.c
··· 271 271 }, 272 272 .cxcs = (unsigned int []){ 0x890, 0x9ec }, 273 273 .cxc_count = 2, 274 - .flags = HW_CTRL | POLL_CFG_GDSCR, 274 + .flags = HW_CTRL_TRIGGER | POLL_CFG_GDSCR, 275 275 .pwrsts = PWRSTS_OFF_ON, 276 276 }; 277 277 ··· 282 282 }, 283 283 .cxcs = (unsigned int []){ 0x8d0, 0xa0c }, 284 284 .cxc_count = 2, 285 - .flags = HW_CTRL | POLL_CFG_GDSCR, 285 + .flags = HW_CTRL_TRIGGER | POLL_CFG_GDSCR, 286 286 .pwrsts = PWRSTS_OFF_ON, 287 287 }; 288 288
+2 -2
drivers/clk/qcom/videocc-sm8150.c
··· 179 179 .pd = { 180 180 .name = "vcodec0_gdsc", 181 181 }, 182 - .flags = HW_CTRL, 182 + .flags = HW_CTRL_TRIGGER, 183 183 .pwrsts = PWRSTS_OFF_ON, 184 184 }; 185 185 ··· 188 188 .pd = { 189 189 .name = "vcodec1_gdsc", 190 190 }, 191 - .flags = HW_CTRL, 191 + .flags = HW_CTRL_TRIGGER, 192 192 .pwrsts = PWRSTS_OFF_ON, 193 193 }; 194 194 static struct clk_regmap *video_cc_sm8150_clocks[] = {
+27 -35
drivers/clk/qcom/videocc-sm8450.c
··· 7 7 #include <linux/mod_devicetable.h> 8 8 #include <linux/module.h> 9 9 #include <linux/platform_device.h> 10 - #include <linux/pm_runtime.h> 11 10 #include <linux/regmap.h> 12 11 13 12 #include <dt-bindings/clock/qcom,sm8450-videocc.h> ··· 62 63 63 64 static struct clk_alpha_pll video_cc_pll0 = { 64 65 .offset = 0x0, 66 + .config = &video_cc_pll0_config, 65 67 .vco_table = lucid_evo_vco, 66 68 .num_vco = ARRAY_SIZE(lucid_evo_vco), 67 69 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO], ··· 106 106 107 107 static struct clk_alpha_pll video_cc_pll1 = { 108 108 .offset = 0x1000, 109 + .config = &video_cc_pll1_config, 109 110 .vco_table = lucid_evo_vco, 110 111 .num_vco = ARRAY_SIZE(lucid_evo_vco), 111 112 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO], ··· 348 347 }, 349 348 .pwrsts = PWRSTS_OFF_ON, 350 349 .parent = &video_cc_mvs0c_gdsc.pd, 351 - .flags = RETAIN_FF_ENABLE | HW_CTRL, 350 + .flags = HW_CTRL_TRIGGER | RETAIN_FF_ENABLE, 352 351 }; 353 352 354 353 static struct gdsc video_cc_mvs1c_gdsc = { ··· 373 372 }, 374 373 .pwrsts = PWRSTS_OFF_ON, 375 374 .parent = &video_cc_mvs1c_gdsc.pd, 376 - .flags = RETAIN_FF_ENABLE | HW_CTRL, 375 + .flags = HW_CTRL_TRIGGER | RETAIN_FF_ENABLE, 377 376 }; 378 377 379 378 static struct clk_regmap *video_cc_sm8450_clocks[] = { ··· 408 407 [VIDEO_CC_MVS1C_CLK_ARES] = { .reg = 0x808c, .bit = 2, .udelay = 1000 }, 409 408 }; 410 409 410 + static struct clk_alpha_pll *video_cc_sm8450_plls[] = { 411 + &video_cc_pll0, 412 + &video_cc_pll1, 413 + }; 414 + 415 + static u32 video_cc_sm8450_critical_cbcrs[] = { 416 + 0x80e4, /* VIDEO_CC_AHB_CLK */ 417 + 0x8114, /* VIDEO_CC_XO_CLK */ 418 + 0x8130, /* VIDEO_CC_SLEEP_CLK */ 419 + }; 420 + 411 421 static const struct regmap_config video_cc_sm8450_regmap_config = { 412 422 .reg_bits = 32, 413 423 .reg_stride = 4, 414 424 .val_bits = 32, 415 425 .max_register = 0x9f4c, 416 426 .fast_io = true, 427 + }; 428 + 429 + static struct qcom_cc_driver_data video_cc_sm8450_driver_data = { 430 + .alpha_plls = video_cc_sm8450_plls, 431 + .num_alpha_plls = ARRAY_SIZE(video_cc_sm8450_plls), 432 + .clk_cbcrs = video_cc_sm8450_critical_cbcrs, 433 + .num_clk_cbcrs = ARRAY_SIZE(video_cc_sm8450_critical_cbcrs), 417 434 }; 418 435 419 436 static const struct qcom_cc_desc video_cc_sm8450_desc = { ··· 442 423 .num_resets = ARRAY_SIZE(video_cc_sm8450_resets), 443 424 .gdscs = video_cc_sm8450_gdscs, 444 425 .num_gdscs = ARRAY_SIZE(video_cc_sm8450_gdscs), 426 + .use_rpm = true, 427 + .driver_data = &video_cc_sm8450_driver_data, 445 428 }; 446 429 447 430 static const struct of_device_id video_cc_sm8450_match_table[] = { ··· 455 434 456 435 static int video_cc_sm8450_probe(struct platform_device *pdev) 457 436 { 458 - struct regmap *regmap; 459 - int ret; 460 - 461 - ret = devm_pm_runtime_enable(&pdev->dev); 462 - if (ret) 463 - return ret; 464 - 465 - ret = pm_runtime_resume_and_get(&pdev->dev); 466 - if (ret) 467 - return ret; 468 - 469 - regmap = qcom_cc_map(pdev, &video_cc_sm8450_desc); 470 - if (IS_ERR(regmap)) { 471 - pm_runtime_put(&pdev->dev); 472 - return PTR_ERR(regmap); 473 - } 474 - 475 437 if (of_device_is_compatible(pdev->dev.of_node, "qcom,sm8475-videocc")) { 476 438 /* Update VideoCC PLL0 */ 477 439 video_cc_pll0.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE]; ··· 462 458 /* Update VideoCC PLL1 */ 463 459 video_cc_pll1.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE]; 464 460 465 - clk_lucid_ole_pll_configure(&video_cc_pll0, regmap, &sm8475_video_cc_pll0_config); 466 - clk_lucid_ole_pll_configure(&video_cc_pll1, regmap, &sm8475_video_cc_pll1_config); 467 - } else { 468 - clk_lucid_evo_pll_configure(&video_cc_pll0, regmap, &video_cc_pll0_config); 469 - clk_lucid_evo_pll_configure(&video_cc_pll1, regmap, &video_cc_pll1_config); 461 + video_cc_pll0.config = &sm8475_video_cc_pll0_config; 462 + video_cc_pll1.config = &sm8475_video_cc_pll1_config; 470 463 } 471 464 472 - /* Keep some clocks always-on */ 473 - qcom_branch_set_clk_en(regmap, 0x80e4); /* VIDEO_CC_AHB_CLK */ 474 - qcom_branch_set_clk_en(regmap, 0x8130); /* VIDEO_CC_SLEEP_CLK */ 475 - qcom_branch_set_clk_en(regmap, 0x8114); /* VIDEO_CC_XO_CLK */ 476 - 477 - ret = qcom_cc_really_probe(&pdev->dev, &video_cc_sm8450_desc, regmap); 478 - 479 - pm_runtime_put(&pdev->dev); 480 - 481 - return ret; 465 + return qcom_cc_probe(pdev, &video_cc_sm8450_desc); 482 466 } 483 467 484 468 static struct platform_driver video_cc_sm8450_driver = {
+60 -31
drivers/clk/qcom/videocc-sm8550.c
··· 7 7 #include <linux/mod_devicetable.h> 8 8 #include <linux/module.h> 9 9 #include <linux/platform_device.h> 10 - #include <linux/pm_runtime.h> 11 10 #include <linux/regmap.h> 12 11 13 12 #include <dt-bindings/clock/qcom,sm8650-videocc.h> ··· 50 51 51 52 static struct clk_alpha_pll video_cc_pll0 = { 52 53 .offset = 0x0, 54 + .config = &video_cc_pll0_config, 53 55 .vco_table = lucid_ole_vco, 54 56 .num_vco = ARRAY_SIZE(lucid_ole_vco), 55 57 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 82 82 83 83 static struct clk_alpha_pll video_cc_pll1 = { 84 84 .offset = 0x1000, 85 + .config = &video_cc_pll1_config, 85 86 .vco_table = lucid_ole_vco, 86 87 .num_vco = ARRAY_SIZE(lucid_ole_vco), 87 88 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE], ··· 145 144 { } 146 145 }; 147 146 147 + static const struct freq_tbl ftbl_video_cc_mvs0_clk_src_x1e80100[] = { 148 + F(576000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 149 + F(720000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 150 + F(1014000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 151 + F(1098000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 152 + F(1332000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 153 + F(1443000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0), 154 + { } 155 + }; 156 + 148 157 static struct clk_rcg2 video_cc_mvs0_clk_src = { 149 158 .cmd_rcgr = 0x8000, 150 159 .mnd_width = 0, ··· 181 170 static const struct freq_tbl ftbl_video_cc_mvs1_clk_src_sm8650[] = { 182 171 F(840000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0), 183 172 F(1110000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0), 173 + F(1350000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0), 174 + F(1500000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0), 175 + F(1650000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0), 176 + { } 177 + }; 178 + 179 + static const struct freq_tbl ftbl_video_cc_mvs1_clk_src_x1e80100[] = { 180 + F(840000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0), 181 + F(1050000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0), 184 182 F(1350000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0), 185 183 F(1500000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0), 186 184 F(1650000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0), ··· 531 511 [VIDEO_CC_XO_CLK_ARES] = { .reg = 0x8124, .bit = 2, .udelay = 100 }, 532 512 }; 533 513 514 + static struct clk_alpha_pll *video_cc_sm8550_plls[] = { 515 + &video_cc_pll0, 516 + &video_cc_pll1, 517 + }; 518 + 519 + static u32 video_cc_sm8550_critical_cbcrs[] = { 520 + 0x80f4, /* VIDEO_CC_AHB_CLK */ 521 + 0x8124, /* VIDEO_CC_XO_CLK */ 522 + 0x8140, /* VIDEO_CC_SLEEP_CLK */ 523 + }; 524 + 525 + static u32 video_cc_sm8650_critical_cbcrs[] = { 526 + 0x80f4, /* VIDEO_CC_AHB_CLK */ 527 + 0x8124, /* VIDEO_CC_XO_CLK */ 528 + 0x8150, /* VIDEO_CC_SLEEP_CLK */ 529 + }; 530 + 534 531 static const struct regmap_config video_cc_sm8550_regmap_config = { 535 532 .reg_bits = 32, 536 533 .reg_stride = 4, 537 534 .val_bits = 32, 538 535 .max_register = 0x9f4c, 539 536 .fast_io = true, 537 + }; 538 + 539 + static struct qcom_cc_driver_data video_cc_sm8550_driver_data = { 540 + .alpha_plls = video_cc_sm8550_plls, 541 + .num_alpha_plls = ARRAY_SIZE(video_cc_sm8550_plls), 542 + .clk_cbcrs = video_cc_sm8550_critical_cbcrs, 543 + .num_clk_cbcrs = ARRAY_SIZE(video_cc_sm8550_critical_cbcrs), 540 544 }; 541 545 542 546 static const struct qcom_cc_desc video_cc_sm8550_desc = { ··· 571 527 .num_resets = ARRAY_SIZE(video_cc_sm8550_resets), 572 528 .gdscs = video_cc_sm8550_gdscs, 573 529 .num_gdscs = ARRAY_SIZE(video_cc_sm8550_gdscs), 530 + .use_rpm = true, 531 + .driver_data = &video_cc_sm8550_driver_data, 574 532 }; 575 533 576 534 static const struct of_device_id video_cc_sm8550_match_table[] = { 577 535 { .compatible = "qcom,sm8550-videocc" }, 578 536 { .compatible = "qcom,sm8650-videocc" }, 537 + { .compatible = "qcom,x1e80100-videocc" }, 579 538 { } 580 539 }; 581 540 MODULE_DEVICE_TABLE(of, video_cc_sm8550_match_table); 582 541 583 542 static int video_cc_sm8550_probe(struct platform_device *pdev) 584 543 { 585 - struct regmap *regmap; 586 - int ret; 587 - u32 sleep_clk_offset = 0x8140; 588 - 589 - ret = devm_pm_runtime_enable(&pdev->dev); 590 - if (ret) 591 - return ret; 592 - 593 - ret = pm_runtime_resume_and_get(&pdev->dev); 594 - if (ret) 595 - return ret; 596 - 597 - regmap = qcom_cc_map(pdev, &video_cc_sm8550_desc); 598 - if (IS_ERR(regmap)) { 599 - pm_runtime_put(&pdev->dev); 600 - return PTR_ERR(regmap); 544 + if (of_device_is_compatible(pdev->dev.of_node, "qcom,x1e80100-videocc")) { 545 + video_cc_pll0_config.l = 0x1e; 546 + video_cc_pll0_config.alpha = 0x0000; 547 + video_cc_pll1_config.l = 0x2b; 548 + video_cc_pll1_config.alpha = 0xc000; 549 + video_cc_mvs0_clk_src.freq_tbl = ftbl_video_cc_mvs0_clk_src_x1e80100; 550 + video_cc_mvs1_clk_src.freq_tbl = ftbl_video_cc_mvs1_clk_src_x1e80100; 601 551 } 602 552 603 553 if (of_device_is_compatible(pdev->dev.of_node, "qcom,sm8650-videocc")) { 604 - sleep_clk_offset = 0x8150; 605 554 video_cc_pll0_config.l = 0x1e; 606 555 video_cc_pll0_config.alpha = 0xa000; 607 556 video_cc_pll1_config.l = 0x2b; ··· 606 569 video_cc_sm8550_clocks[VIDEO_CC_MVS1_SHIFT_CLK] = &video_cc_mvs1_shift_clk.clkr; 607 570 video_cc_sm8550_clocks[VIDEO_CC_MVS1C_SHIFT_CLK] = &video_cc_mvs1c_shift_clk.clkr; 608 571 video_cc_sm8550_clocks[VIDEO_CC_XO_CLK_SRC] = &video_cc_xo_clk_src.clkr; 572 + 573 + video_cc_sm8550_driver_data.clk_cbcrs = video_cc_sm8650_critical_cbcrs; 574 + video_cc_sm8550_driver_data.num_clk_cbcrs = 575 + ARRAY_SIZE(video_cc_sm8650_critical_cbcrs); 609 576 } 610 577 611 - clk_lucid_ole_pll_configure(&video_cc_pll0, regmap, &video_cc_pll0_config); 612 - clk_lucid_ole_pll_configure(&video_cc_pll1, regmap, &video_cc_pll1_config); 613 - 614 - /* Keep some clocks always-on */ 615 - qcom_branch_set_clk_en(regmap, 0x80f4); /* VIDEO_CC_AHB_CLK */ 616 - qcom_branch_set_clk_en(regmap, sleep_clk_offset); /* VIDEO_CC_SLEEP_CLK */ 617 - qcom_branch_set_clk_en(regmap, 0x8124); /* VIDEO_CC_XO_CLK */ 618 - 619 - ret = qcom_cc_really_probe(&pdev->dev, &video_cc_sm8550_desc, regmap); 620 - 621 - pm_runtime_put(&pdev->dev); 622 - 623 - return ret; 578 + return qcom_cc_probe(pdev, &video_cc_sm8550_desc); 624 579 } 625 580 626 581 static struct platform_driver video_cc_sm8550_driver = {
+1
drivers/clk/rockchip/clk-rk3568.c
··· 79 79 RK3036_PLL_RATE(200000000, 1, 100, 3, 4, 1, 0), 80 80 RK3036_PLL_RATE(148500000, 1, 99, 4, 4, 1, 0), 81 81 RK3036_PLL_RATE(135000000, 2, 45, 4, 1, 1, 0), 82 + RK3036_PLL_RATE(132000000, 1, 66, 6, 2, 1, 0), 82 83 RK3036_PLL_RATE(128000000, 1, 16, 3, 1, 1, 0), 83 84 RK3036_PLL_RATE(126400000, 1, 79, 5, 3, 1, 0), 84 85 RK3036_PLL_RATE(119000000, 3, 119, 4, 2, 1, 0),
+47 -60
drivers/clk/thead/clk-th1520-ap.c
··· 42 42 }; 43 43 44 44 struct ccu_mux { 45 - struct ccu_internal mux; 46 - struct ccu_common common; 45 + int clkid; 46 + u32 reg; 47 + struct clk_mux mux; 47 48 }; 48 49 49 50 struct ccu_gate { ··· 76 75 .flags = _flags, \ 77 76 } 78 77 78 + #define TH_CCU_MUX(_name, _parents, _shift, _width) \ 79 + { \ 80 + .mask = GENMASK(_width - 1, 0), \ 81 + .shift = _shift, \ 82 + .hw.init = CLK_HW_INIT_PARENTS_DATA( \ 83 + _name, \ 84 + _parents, \ 85 + &clk_mux_ops, \ 86 + 0), \ 87 + } 88 + 79 89 #define CCU_GATE(_clkid, _struct, _name, _parent, _reg, _gate, _flags) \ 80 90 struct ccu_gate _struct = { \ 81 91 .enable = _gate, \ ··· 104 92 static inline struct ccu_common *hw_to_ccu_common(struct clk_hw *hw) 105 93 { 106 94 return container_of(hw, struct ccu_common, hw); 107 - } 108 - 109 - static inline struct ccu_mux *hw_to_ccu_mux(struct clk_hw *hw) 110 - { 111 - struct ccu_common *common = hw_to_ccu_common(hw); 112 - 113 - return container_of(common, struct ccu_mux, common); 114 95 } 115 96 116 97 static inline struct ccu_pll *hw_to_ccu_pll(struct clk_hw *hw) ··· 420 415 }; 421 416 422 417 static struct ccu_mux c910_i0_clk = { 423 - .mux = TH_CCU_ARG(1, 1), 424 - .common = { 425 - .clkid = CLK_C910_I0, 426 - .cfg0 = 0x100, 427 - .hw.init = CLK_HW_INIT_PARENTS_DATA("c910-i0", 428 - c910_i0_parents, 429 - &clk_mux_ops, 430 - 0), 431 - } 418 + .clkid = CLK_C910_I0, 419 + .reg = 0x100, 420 + .mux = TH_CCU_MUX("c910-i0", c910_i0_parents, 1, 1), 432 421 }; 433 422 434 423 static const struct clk_parent_data c910_parents[] = { 435 - { .hw = &c910_i0_clk.common.hw }, 424 + { .hw = &c910_i0_clk.mux.hw }, 436 425 { .hw = &cpu_pll1_clk.common.hw } 437 426 }; 438 427 439 428 static struct ccu_mux c910_clk = { 440 - .mux = TH_CCU_ARG(0, 1), 441 - .common = { 442 - .clkid = CLK_C910, 443 - .cfg0 = 0x100, 444 - .hw.init = CLK_HW_INIT_PARENTS_DATA("c910", 445 - c910_parents, 446 - &clk_mux_ops, 447 - 0), 448 - } 429 + .clkid = CLK_C910, 430 + .reg = 0x100, 431 + .mux = TH_CCU_MUX("c910", c910_parents, 0, 1), 449 432 }; 450 433 451 434 static const struct clk_parent_data ahb2_cpusys_parents[] = { ··· 575 582 { .hw = &peri2sys_apb_pclk.common.hw } 576 583 }; 577 584 578 - static CLK_FIXED_FACTOR_FW_NAME(osc12m_clk, "osc_12m", "osc_24m", 2, 1, 0); 585 + static struct clk_fixed_factor osc12m_clk = { 586 + .div = 2, 587 + .mult = 1, 588 + .hw.init = CLK_HW_INIT_PARENTS_DATA("osc_12m", 589 + osc_24m_clk, 590 + &clk_fixed_factor_ops, 591 + 0), 592 + }; 579 593 580 594 static const char * const out_parents[] = { "osc_24m", "osc_12m" }; 581 595 ··· 792 792 0x134, BIT(8), 0); 793 793 static CCU_GATE(CLK_X2X_CPUSYS, x2x_cpusys_clk, "x2x-cpusys", axi4_cpusys2_aclk_pd, 794 794 0x134, BIT(7), 0); 795 - static CCU_GATE(CLK_CPU2AON_X2H, cpu2aon_x2h_clk, "cpu2aon-x2h", axi_aclk_pd, 0x138, BIT(8), 0); 795 + static CCU_GATE(CLK_CPU2AON_X2H, cpu2aon_x2h_clk, "cpu2aon-x2h", axi_aclk_pd, 796 + 0x138, BIT(8), CLK_IGNORE_UNUSED); 796 797 static CCU_GATE(CLK_CPU2PERI_X2H, cpu2peri_x2h_clk, "cpu2peri-x2h", axi4_cpusys2_aclk_pd, 797 798 0x140, BIT(9), CLK_IGNORE_UNUSED); 798 799 static CCU_GATE(CLK_PERISYS_APB1_HCLK, perisys_apb1_hclk, "perisys-apb1-hclk", perisys_ahb_hclk_pd, 799 - 0x150, BIT(9), 0); 800 + 0x150, BIT(9), CLK_IGNORE_UNUSED); 800 801 static CCU_GATE(CLK_PERISYS_APB2_HCLK, perisys_apb2_hclk, "perisys-apb2-hclk", perisys_ahb_hclk_pd, 801 802 0x150, BIT(10), CLK_IGNORE_UNUSED); 802 803 static CCU_GATE(CLK_PERISYS_APB3_HCLK, perisys_apb3_hclk, "perisys-apb3-hclk", perisys_ahb_hclk_pd, ··· 918 917 }; 919 918 920 919 static struct ccu_mux uart_sclk = { 921 - .mux = TH_CCU_ARG(0, 1), 922 - .common = { 923 - .clkid = CLK_UART_SCLK, 924 - .cfg0 = 0x210, 925 - .hw.init = CLK_HW_INIT_PARENTS_DATA("uart-sclk", 926 - uart_sclk_parents, 927 - &clk_mux_ops, 928 - 0), 929 - } 920 + .clkid = CLK_UART_SCLK, 921 + .reg = 0x210, 922 + .mux = TH_CCU_MUX("uart-sclk", uart_sclk_parents, 0, 1), 930 923 }; 931 924 932 925 static struct ccu_common *th1520_pll_clks[] = { ··· 957 962 &dpu1_clk.common, 958 963 }; 959 964 960 - static struct ccu_common *th1520_mux_clks[] = { 961 - &c910_i0_clk.common, 962 - &c910_clk.common, 963 - &uart_sclk.common, 965 + static struct ccu_mux *th1520_mux_clks[] = { 966 + &c910_i0_clk, 967 + &c910_clk, 968 + &uart_sclk, 964 969 }; 965 970 966 971 static struct ccu_common *th1520_gate_clks[] = { ··· 1062 1067 struct th1520_plat_data { 1063 1068 struct ccu_common **th1520_pll_clks; 1064 1069 struct ccu_common **th1520_div_clks; 1065 - struct ccu_common **th1520_mux_clks; 1070 + struct ccu_mux **th1520_mux_clks; 1066 1071 struct ccu_common **th1520_gate_clks; 1067 1072 1068 1073 int nr_clks; ··· 1149 1154 } 1150 1155 1151 1156 for (i = 0; i < plat_data->nr_mux_clks; i++) { 1152 - struct ccu_mux *cm = hw_to_ccu_mux(&plat_data->th1520_mux_clks[i]->hw); 1153 - const struct clk_init_data *init = cm->common.hw.init; 1157 + struct ccu_mux *cm = plat_data->th1520_mux_clks[i]; 1154 1158 1155 - plat_data->th1520_mux_clks[i]->map = map; 1156 - hw = devm_clk_hw_register_mux_parent_data_table(dev, 1157 - init->name, 1158 - init->parent_data, 1159 - init->num_parents, 1160 - 0, 1161 - base + cm->common.cfg0, 1162 - cm->mux.shift, 1163 - cm->mux.width, 1164 - 0, NULL, NULL); 1165 - if (IS_ERR(hw)) 1166 - return PTR_ERR(hw); 1159 + cm->mux.reg = base + cm->reg; 1167 1160 1168 - priv->hws[cm->common.clkid] = hw; 1161 + ret = devm_clk_hw_register(dev, &cm->mux.hw); 1162 + if (ret) 1163 + return ret; 1164 + 1165 + priv->hws[cm->clkid] = &cm->mux.hw; 1169 1166 } 1170 1167 1171 1168 for (i = 0; i < plat_data->nr_gate_clks; i++) {
+13
include/dt-bindings/clock/nxp,imx94-clock.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright 2025 NXP 4 + */ 5 + 6 + #ifndef __DT_BINDINGS_CLOCK_IMX94_H 7 + #define __DT_BINDINGS_CLOCK_IMX94_H 8 + 9 + #define IMX94_CLK_DISPMIX_CLK_SEL 0 10 + 11 + #define IMX94_CLK_DISPMIX_LVDS_CLK_GATE 0 12 + 13 + #endif /* __DT_BINDINGS_CLOCK_IMX94_H */
+10
include/dt-bindings/clock/qcom,gcc-sc8180x.h
··· 249 249 #define GCC_UFS_MEM_CLKREF_EN 239 250 250 #define GCC_UFS_CARD_CLKREF_EN 240 251 251 #define GPLL9 241 252 + #define GCC_CAMERA_AHB_CLK 242 253 + #define GCC_CAMERA_XO_CLK 243 254 + #define GCC_CPUSS_DVM_BUS_CLK 244 255 + #define GCC_CPUSS_GNOC_CLK 245 256 + #define GCC_DISP_AHB_CLK 246 257 + #define GCC_DISP_XO_CLK 247 258 + #define GCC_GPU_CFG_AHB_CLK 248 259 + #define GCC_NPU_CFG_AHB_CLK 249 260 + #define GCC_VIDEO_AHB_CLK 250 261 + #define GCC_VIDEO_XO_CLK 251 252 262 253 263 #define GCC_EMAC_BCR 0 254 264 #define GCC_GPU_BCR 1
+16
include/dt-bindings/clock/qcom,ipq5018-cmn-pll.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_CLK_QCOM_IPQ5018_CMN_PLL_H 7 + #define _DT_BINDINGS_CLK_QCOM_IPQ5018_CMN_PLL_H 8 + 9 + /* CMN PLL core clock. */ 10 + #define IPQ5018_CMN_PLL_CLK 0 11 + 12 + /* The output clocks from CMN PLL of IPQ5018. */ 13 + #define IPQ5018_XO_24MHZ_CLK 1 14 + #define IPQ5018_SLEEP_32KHZ_CLK 2 15 + #define IPQ5018_ETH_50MHZ_CLK 3 16 + #endif
+22
include/dt-bindings/clock/qcom,ipq5424-cmn-pll.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_CLK_QCOM_IPQ5424_CMN_PLL_H 7 + #define _DT_BINDINGS_CLK_QCOM_IPQ5424_CMN_PLL_H 8 + 9 + /* CMN PLL core clock. */ 10 + #define IPQ5424_CMN_PLL_CLK 0 11 + 12 + /* The output clocks from CMN PLL of IPQ5424. */ 13 + #define IPQ5424_XO_24MHZ_CLK 1 14 + #define IPQ5424_SLEEP_32KHZ_CLK 2 15 + #define IPQ5424_PCS_31P25MHZ_CLK 3 16 + #define IPQ5424_NSS_300MHZ_CLK 4 17 + #define IPQ5424_PPE_375MHZ_CLK 5 18 + #define IPQ5424_ETH0_50MHZ_CLK 6 19 + #define IPQ5424_ETH1_50MHZ_CLK 7 20 + #define IPQ5424_ETH2_50MHZ_CLK 8 21 + #define IPQ5424_ETH_25MHZ_CLK 9 22 + #endif
+131
include/dt-bindings/clock/qcom,milos-camcc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 5 + */ 6 + 7 + #ifndef _DT_BINDINGS_CLK_QCOM_CAM_CC_MILOS_H 8 + #define _DT_BINDINGS_CLK_QCOM_CAM_CC_MILOS_H 9 + 10 + /* CAM_CC clocks */ 11 + #define CAM_CC_PLL0 0 12 + #define CAM_CC_PLL0_OUT_EVEN 1 13 + #define CAM_CC_PLL0_OUT_ODD 2 14 + #define CAM_CC_PLL1 3 15 + #define CAM_CC_PLL1_OUT_EVEN 4 16 + #define CAM_CC_PLL2 5 17 + #define CAM_CC_PLL2_OUT_EVEN 6 18 + #define CAM_CC_PLL3 7 19 + #define CAM_CC_PLL3_OUT_EVEN 8 20 + #define CAM_CC_PLL4 9 21 + #define CAM_CC_PLL4_OUT_EVEN 10 22 + #define CAM_CC_PLL5 11 23 + #define CAM_CC_PLL5_OUT_EVEN 12 24 + #define CAM_CC_PLL6 13 25 + #define CAM_CC_PLL6_OUT_EVEN 14 26 + #define CAM_CC_BPS_AHB_CLK 15 27 + #define CAM_CC_BPS_AREG_CLK 16 28 + #define CAM_CC_BPS_CLK 17 29 + #define CAM_CC_BPS_CLK_SRC 18 30 + #define CAM_CC_CAMNOC_ATB_CLK 19 31 + #define CAM_CC_CAMNOC_AXI_CLK_SRC 20 32 + #define CAM_CC_CAMNOC_AXI_HF_CLK 21 33 + #define CAM_CC_CAMNOC_AXI_SF_CLK 22 34 + #define CAM_CC_CAMNOC_NRT_AXI_CLK 23 35 + #define CAM_CC_CAMNOC_RT_AXI_CLK 24 36 + #define CAM_CC_CCI_0_CLK 25 37 + #define CAM_CC_CCI_0_CLK_SRC 26 38 + #define CAM_CC_CCI_1_CLK 27 39 + #define CAM_CC_CCI_1_CLK_SRC 28 40 + #define CAM_CC_CORE_AHB_CLK 29 41 + #define CAM_CC_CPAS_AHB_CLK 30 42 + #define CAM_CC_CPHY_RX_CLK_SRC 31 43 + #define CAM_CC_CRE_AHB_CLK 32 44 + #define CAM_CC_CRE_CLK 33 45 + #define CAM_CC_CRE_CLK_SRC 34 46 + #define CAM_CC_CSI0PHYTIMER_CLK 35 47 + #define CAM_CC_CSI0PHYTIMER_CLK_SRC 36 48 + #define CAM_CC_CSI1PHYTIMER_CLK 37 49 + #define CAM_CC_CSI1PHYTIMER_CLK_SRC 38 50 + #define CAM_CC_CSI2PHYTIMER_CLK 39 51 + #define CAM_CC_CSI2PHYTIMER_CLK_SRC 40 52 + #define CAM_CC_CSI3PHYTIMER_CLK 41 53 + #define CAM_CC_CSI3PHYTIMER_CLK_SRC 42 54 + #define CAM_CC_CSIPHY0_CLK 43 55 + #define CAM_CC_CSIPHY1_CLK 44 56 + #define CAM_CC_CSIPHY2_CLK 45 57 + #define CAM_CC_CSIPHY3_CLK 46 58 + #define CAM_CC_FAST_AHB_CLK_SRC 47 59 + #define CAM_CC_GDSC_CLK 48 60 + #define CAM_CC_ICP_ATB_CLK 49 61 + #define CAM_CC_ICP_CLK 50 62 + #define CAM_CC_ICP_CLK_SRC 51 63 + #define CAM_CC_ICP_CTI_CLK 52 64 + #define CAM_CC_ICP_TS_CLK 53 65 + #define CAM_CC_MCLK0_CLK 54 66 + #define CAM_CC_MCLK0_CLK_SRC 55 67 + #define CAM_CC_MCLK1_CLK 56 68 + #define CAM_CC_MCLK1_CLK_SRC 57 69 + #define CAM_CC_MCLK2_CLK 58 70 + #define CAM_CC_MCLK2_CLK_SRC 59 71 + #define CAM_CC_MCLK3_CLK 60 72 + #define CAM_CC_MCLK3_CLK_SRC 61 73 + #define CAM_CC_MCLK4_CLK 62 74 + #define CAM_CC_MCLK4_CLK_SRC 63 75 + #define CAM_CC_OPE_0_AHB_CLK 64 76 + #define CAM_CC_OPE_0_AREG_CLK 65 77 + #define CAM_CC_OPE_0_CLK 66 78 + #define CAM_CC_OPE_0_CLK_SRC 67 79 + #define CAM_CC_SLEEP_CLK 68 80 + #define CAM_CC_SLEEP_CLK_SRC 69 81 + #define CAM_CC_SLOW_AHB_CLK_SRC 70 82 + #define CAM_CC_SOC_AHB_CLK 71 83 + #define CAM_CC_SYS_TMR_CLK 72 84 + #define CAM_CC_TFE_0_AHB_CLK 73 85 + #define CAM_CC_TFE_0_CLK 74 86 + #define CAM_CC_TFE_0_CLK_SRC 75 87 + #define CAM_CC_TFE_0_CPHY_RX_CLK 76 88 + #define CAM_CC_TFE_0_CSID_CLK 77 89 + #define CAM_CC_TFE_0_CSID_CLK_SRC 78 90 + #define CAM_CC_TFE_1_AHB_CLK 79 91 + #define CAM_CC_TFE_1_CLK 80 92 + #define CAM_CC_TFE_1_CLK_SRC 81 93 + #define CAM_CC_TFE_1_CPHY_RX_CLK 82 94 + #define CAM_CC_TFE_1_CSID_CLK 83 95 + #define CAM_CC_TFE_1_CSID_CLK_SRC 84 96 + #define CAM_CC_TFE_2_AHB_CLK 85 97 + #define CAM_CC_TFE_2_CLK 86 98 + #define CAM_CC_TFE_2_CLK_SRC 87 99 + #define CAM_CC_TFE_2_CPHY_RX_CLK 88 100 + #define CAM_CC_TFE_2_CSID_CLK 89 101 + #define CAM_CC_TFE_2_CSID_CLK_SRC 90 102 + #define CAM_CC_TOP_SHIFT_CLK 91 103 + #define CAM_CC_XO_CLK_SRC 92 104 + 105 + /* CAM_CC resets */ 106 + #define CAM_CC_BPS_BCR 0 107 + #define CAM_CC_CAMNOC_BCR 1 108 + #define CAM_CC_CAMSS_TOP_BCR 2 109 + #define CAM_CC_CCI_0_BCR 3 110 + #define CAM_CC_CCI_1_BCR 4 111 + #define CAM_CC_CPAS_BCR 5 112 + #define CAM_CC_CRE_BCR 6 113 + #define CAM_CC_CSI0PHY_BCR 7 114 + #define CAM_CC_CSI1PHY_BCR 8 115 + #define CAM_CC_CSI2PHY_BCR 9 116 + #define CAM_CC_CSI3PHY_BCR 10 117 + #define CAM_CC_ICP_BCR 11 118 + #define CAM_CC_MCLK0_BCR 12 119 + #define CAM_CC_MCLK1_BCR 13 120 + #define CAM_CC_MCLK2_BCR 14 121 + #define CAM_CC_MCLK3_BCR 15 122 + #define CAM_CC_MCLK4_BCR 16 123 + #define CAM_CC_OPE_0_BCR 17 124 + #define CAM_CC_TFE_0_BCR 18 125 + #define CAM_CC_TFE_1_BCR 19 126 + #define CAM_CC_TFE_2_BCR 20 127 + 128 + /* CAM_CC power domains */ 129 + #define CAM_CC_CAMSS_TOP_GDSC 0 130 + 131 + #endif
+61
include/dt-bindings/clock/qcom,milos-dispcc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 5 + */ 6 + 7 + #ifndef _DT_BINDINGS_CLK_QCOM_DISP_CC_MILOS_H 8 + #define _DT_BINDINGS_CLK_QCOM_DISP_CC_MILOS_H 9 + 10 + /* DISP_CC clocks */ 11 + #define DISP_CC_PLL0 0 12 + #define DISP_CC_MDSS_ACCU_CLK 1 13 + #define DISP_CC_MDSS_AHB1_CLK 2 14 + #define DISP_CC_MDSS_AHB_CLK 3 15 + #define DISP_CC_MDSS_AHB_CLK_SRC 4 16 + #define DISP_CC_MDSS_BYTE0_CLK 5 17 + #define DISP_CC_MDSS_BYTE0_CLK_SRC 6 18 + #define DISP_CC_MDSS_BYTE0_DIV_CLK_SRC 7 19 + #define DISP_CC_MDSS_BYTE0_INTF_CLK 8 20 + #define DISP_CC_MDSS_DPTX0_AUX_CLK 9 21 + #define DISP_CC_MDSS_DPTX0_AUX_CLK_SRC 10 22 + #define DISP_CC_MDSS_DPTX0_CRYPTO_CLK 11 23 + #define DISP_CC_MDSS_DPTX0_LINK_CLK 12 24 + #define DISP_CC_MDSS_DPTX0_LINK_CLK_SRC 13 25 + #define DISP_CC_MDSS_DPTX0_LINK_DIV_CLK_SRC 14 26 + #define DISP_CC_MDSS_DPTX0_LINK_INTF_CLK 15 27 + #define DISP_CC_MDSS_DPTX0_PIXEL0_CLK 16 28 + #define DISP_CC_MDSS_DPTX0_PIXEL0_CLK_SRC 17 29 + #define DISP_CC_MDSS_DPTX0_PIXEL1_CLK 18 30 + #define DISP_CC_MDSS_DPTX0_PIXEL1_CLK_SRC 19 31 + #define DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK 20 32 + #define DISP_CC_MDSS_ESC0_CLK 21 33 + #define DISP_CC_MDSS_ESC0_CLK_SRC 22 34 + #define DISP_CC_MDSS_MDP1_CLK 23 35 + #define DISP_CC_MDSS_MDP_CLK 24 36 + #define DISP_CC_MDSS_MDP_CLK_SRC 25 37 + #define DISP_CC_MDSS_MDP_LUT1_CLK 26 38 + #define DISP_CC_MDSS_MDP_LUT_CLK 27 39 + #define DISP_CC_MDSS_NON_GDSC_AHB_CLK 28 40 + #define DISP_CC_MDSS_PCLK0_CLK 29 41 + #define DISP_CC_MDSS_PCLK0_CLK_SRC 30 42 + #define DISP_CC_MDSS_RSCC_AHB_CLK 31 43 + #define DISP_CC_MDSS_RSCC_VSYNC_CLK 32 44 + #define DISP_CC_MDSS_VSYNC1_CLK 33 45 + #define DISP_CC_MDSS_VSYNC_CLK 34 46 + #define DISP_CC_MDSS_VSYNC_CLK_SRC 35 47 + #define DISP_CC_SLEEP_CLK 36 48 + #define DISP_CC_SLEEP_CLK_SRC 37 49 + #define DISP_CC_XO_CLK 38 50 + #define DISP_CC_XO_CLK_SRC 39 51 + 52 + /* DISP_CC resets */ 53 + #define DISP_CC_MDSS_CORE_BCR 0 54 + #define DISP_CC_MDSS_CORE_INT2_BCR 1 55 + #define DISP_CC_MDSS_RSCC_BCR 2 56 + 57 + /* DISP_CC power domains */ 58 + #define DISP_CC_MDSS_CORE_GDSC 0 59 + #define DISP_CC_MDSS_CORE_INT2_GDSC 1 60 + 61 + #endif
+210
include/dt-bindings/clock/qcom,milos-gcc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 5 + */ 6 + 7 + #ifndef _DT_BINDINGS_CLK_QCOM_GCC_MILOS_H 8 + #define _DT_BINDINGS_CLK_QCOM_GCC_MILOS_H 9 + 10 + /* GCC clocks */ 11 + #define GCC_GPLL0 0 12 + #define GCC_GPLL0_OUT_EVEN 1 13 + #define GCC_GPLL2 2 14 + #define GCC_GPLL4 3 15 + #define GCC_GPLL6 4 16 + #define GCC_GPLL7 5 17 + #define GCC_GPLL9 6 18 + #define GCC_AGGRE_NOC_PCIE_AXI_CLK 7 19 + #define GCC_AGGRE_UFS_PHY_AXI_CLK 8 20 + #define GCC_AGGRE_UFS_PHY_AXI_HW_CTL_CLK 9 21 + #define GCC_AGGRE_USB3_PRIM_AXI_CLK 10 22 + #define GCC_BOOT_ROM_AHB_CLK 11 23 + #define GCC_CAMERA_AHB_CLK 12 24 + #define GCC_CAMERA_HF_AXI_CLK 13 25 + #define GCC_CAMERA_HF_XO_CLK 14 26 + #define GCC_CAMERA_SF_AXI_CLK 15 27 + #define GCC_CAMERA_SF_XO_CLK 16 28 + #define GCC_CFG_NOC_PCIE_ANOC_AHB_CLK 17 29 + #define GCC_CFG_NOC_USB3_PRIM_AXI_CLK 18 30 + #define GCC_CNOC_PCIE_SF_AXI_CLK 19 31 + #define GCC_DDRSS_GPU_AXI_CLK 20 32 + #define GCC_DDRSS_PCIE_SF_QTB_CLK 21 33 + #define GCC_DISP_AHB_CLK 22 34 + #define GCC_DISP_GPLL0_DIV_CLK_SRC 23 35 + #define GCC_DISP_HF_AXI_CLK 24 36 + #define GCC_DISP_XO_CLK 25 37 + #define GCC_GP1_CLK 26 38 + #define GCC_GP1_CLK_SRC 27 39 + #define GCC_GP2_CLK 28 40 + #define GCC_GP2_CLK_SRC 29 41 + #define GCC_GP3_CLK 30 42 + #define GCC_GP3_CLK_SRC 31 43 + #define GCC_GPU_CFG_AHB_CLK 32 44 + #define GCC_GPU_GPLL0_CLK_SRC 33 45 + #define GCC_GPU_GPLL0_DIV_CLK_SRC 34 46 + #define GCC_GPU_MEMNOC_GFX_CLK 35 47 + #define GCC_GPU_SNOC_DVM_GFX_CLK 36 48 + #define GCC_PCIE_0_AUX_CLK 37 49 + #define GCC_PCIE_0_AUX_CLK_SRC 38 50 + #define GCC_PCIE_0_CFG_AHB_CLK 39 51 + #define GCC_PCIE_0_MSTR_AXI_CLK 40 52 + #define GCC_PCIE_0_PHY_RCHNG_CLK 41 53 + #define GCC_PCIE_0_PHY_RCHNG_CLK_SRC 42 54 + #define GCC_PCIE_0_PIPE_CLK 43 55 + #define GCC_PCIE_0_PIPE_CLK_SRC 44 56 + #define GCC_PCIE_0_PIPE_DIV2_CLK 45 57 + #define GCC_PCIE_0_PIPE_DIV2_CLK_SRC 46 58 + #define GCC_PCIE_0_SLV_AXI_CLK 47 59 + #define GCC_PCIE_0_SLV_Q2A_AXI_CLK 48 60 + #define GCC_PCIE_1_AUX_CLK 49 61 + #define GCC_PCIE_1_AUX_CLK_SRC 50 62 + #define GCC_PCIE_1_CFG_AHB_CLK 51 63 + #define GCC_PCIE_1_MSTR_AXI_CLK 52 64 + #define GCC_PCIE_1_PHY_RCHNG_CLK 53 65 + #define GCC_PCIE_1_PHY_RCHNG_CLK_SRC 54 66 + #define GCC_PCIE_1_PIPE_CLK 55 67 + #define GCC_PCIE_1_PIPE_CLK_SRC 56 68 + #define GCC_PCIE_1_PIPE_DIV2_CLK 57 69 + #define GCC_PCIE_1_PIPE_DIV2_CLK_SRC 58 70 + #define GCC_PCIE_1_SLV_AXI_CLK 59 71 + #define GCC_PCIE_1_SLV_Q2A_AXI_CLK 60 72 + #define GCC_PCIE_RSCC_CFG_AHB_CLK 61 73 + #define GCC_PCIE_RSCC_XO_CLK 62 74 + #define GCC_PDM2_CLK 63 75 + #define GCC_PDM2_CLK_SRC 64 76 + #define GCC_PDM_AHB_CLK 65 77 + #define GCC_PDM_XO4_CLK 66 78 + #define GCC_QMIP_CAMERA_NRT_AHB_CLK 67 79 + #define GCC_QMIP_CAMERA_RT_AHB_CLK 68 80 + #define GCC_QMIP_DISP_AHB_CLK 69 81 + #define GCC_QMIP_GPU_AHB_CLK 70 82 + #define GCC_QMIP_PCIE_AHB_CLK 71 83 + #define GCC_QMIP_VIDEO_CV_CPU_AHB_CLK 72 84 + #define GCC_QMIP_VIDEO_CVP_AHB_CLK 73 85 + #define GCC_QMIP_VIDEO_V_CPU_AHB_CLK 74 86 + #define GCC_QMIP_VIDEO_VCODEC_AHB_CLK 75 87 + #define GCC_QUPV3_WRAP0_CORE_2X_CLK 76 88 + #define GCC_QUPV3_WRAP0_CORE_CLK 77 89 + #define GCC_QUPV3_WRAP0_QSPI_REF_CLK 78 90 + #define GCC_QUPV3_WRAP0_QSPI_REF_CLK_SRC 79 91 + #define GCC_QUPV3_WRAP0_S0_CLK 80 92 + #define GCC_QUPV3_WRAP0_S0_CLK_SRC 81 93 + #define GCC_QUPV3_WRAP0_S1_CLK 82 94 + #define GCC_QUPV3_WRAP0_S1_CLK_SRC 83 95 + #define GCC_QUPV3_WRAP0_S2_CLK 84 96 + #define GCC_QUPV3_WRAP0_S2_CLK_SRC 85 97 + #define GCC_QUPV3_WRAP0_S3_CLK 86 98 + #define GCC_QUPV3_WRAP0_S3_CLK_SRC 87 99 + #define GCC_QUPV3_WRAP0_S4_CLK 88 100 + #define GCC_QUPV3_WRAP0_S4_CLK_SRC 89 101 + #define GCC_QUPV3_WRAP0_S5_CLK 90 102 + #define GCC_QUPV3_WRAP0_S5_CLK_SRC 91 103 + #define GCC_QUPV3_WRAP0_S6_CLK 92 104 + #define GCC_QUPV3_WRAP0_S6_CLK_SRC 93 105 + #define GCC_QUPV3_WRAP1_CORE_2X_CLK 94 106 + #define GCC_QUPV3_WRAP1_CORE_CLK 95 107 + #define GCC_QUPV3_WRAP1_QSPI_REF_CLK 96 108 + #define GCC_QUPV3_WRAP1_QSPI_REF_CLK_SRC 97 109 + #define GCC_QUPV3_WRAP1_S0_CLK 98 110 + #define GCC_QUPV3_WRAP1_S0_CLK_SRC 99 111 + #define GCC_QUPV3_WRAP1_S1_CLK 100 112 + #define GCC_QUPV3_WRAP1_S1_CLK_SRC 101 113 + #define GCC_QUPV3_WRAP1_S2_CLK 102 114 + #define GCC_QUPV3_WRAP1_S2_CLK_SRC 103 115 + #define GCC_QUPV3_WRAP1_S3_CLK 104 116 + #define GCC_QUPV3_WRAP1_S3_CLK_SRC 105 117 + #define GCC_QUPV3_WRAP1_S4_CLK 106 118 + #define GCC_QUPV3_WRAP1_S4_CLK_SRC 107 119 + #define GCC_QUPV3_WRAP1_S5_CLK 108 120 + #define GCC_QUPV3_WRAP1_S5_CLK_SRC 109 121 + #define GCC_QUPV3_WRAP1_S6_CLK 110 122 + #define GCC_QUPV3_WRAP1_S6_CLK_SRC 111 123 + #define GCC_QUPV3_WRAP_0_M_AHB_CLK 112 124 + #define GCC_QUPV3_WRAP_0_S_AHB_CLK 113 125 + #define GCC_QUPV3_WRAP_1_M_AHB_CLK 114 126 + #define GCC_QUPV3_WRAP_1_S_AHB_CLK 115 127 + #define GCC_SDCC1_AHB_CLK 116 128 + #define GCC_SDCC1_APPS_CLK 117 129 + #define GCC_SDCC1_APPS_CLK_SRC 118 130 + #define GCC_SDCC1_ICE_CORE_CLK 119 131 + #define GCC_SDCC1_ICE_CORE_CLK_SRC 120 132 + #define GCC_SDCC2_AHB_CLK 121 133 + #define GCC_SDCC2_APPS_CLK 122 134 + #define GCC_SDCC2_APPS_CLK_SRC 123 135 + #define GCC_UFS_PHY_AHB_CLK 124 136 + #define GCC_UFS_PHY_AXI_CLK 125 137 + #define GCC_UFS_PHY_AXI_CLK_SRC 126 138 + #define GCC_UFS_PHY_AXI_HW_CTL_CLK 127 139 + #define GCC_UFS_PHY_ICE_CORE_CLK 128 140 + #define GCC_UFS_PHY_ICE_CORE_CLK_SRC 129 141 + #define GCC_UFS_PHY_ICE_CORE_HW_CTL_CLK 130 142 + #define GCC_UFS_PHY_PHY_AUX_CLK 131 143 + #define GCC_UFS_PHY_PHY_AUX_CLK_SRC 132 144 + #define GCC_UFS_PHY_PHY_AUX_HW_CTL_CLK 133 145 + #define GCC_UFS_PHY_RX_SYMBOL_0_CLK 134 146 + #define GCC_UFS_PHY_RX_SYMBOL_0_CLK_SRC 135 147 + #define GCC_UFS_PHY_RX_SYMBOL_1_CLK 136 148 + #define GCC_UFS_PHY_RX_SYMBOL_1_CLK_SRC 137 149 + #define GCC_UFS_PHY_TX_SYMBOL_0_CLK 138 150 + #define GCC_UFS_PHY_TX_SYMBOL_0_CLK_SRC 139 151 + #define GCC_UFS_PHY_UNIPRO_CORE_CLK 140 152 + #define GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC 141 153 + #define GCC_UFS_PHY_UNIPRO_CORE_HW_CTL_CLK 142 154 + #define GCC_USB30_PRIM_ATB_CLK 143 155 + #define GCC_USB30_PRIM_MASTER_CLK 144 156 + #define GCC_USB30_PRIM_MASTER_CLK_SRC 145 157 + #define GCC_USB30_PRIM_MOCK_UTMI_CLK 146 158 + #define GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC 147 159 + #define GCC_USB30_PRIM_MOCK_UTMI_POSTDIV_CLK_SRC 148 160 + #define GCC_USB30_PRIM_SLEEP_CLK 149 161 + #define GCC_USB3_PRIM_PHY_AUX_CLK 150 162 + #define GCC_USB3_PRIM_PHY_AUX_CLK_SRC 151 163 + #define GCC_USB3_PRIM_PHY_COM_AUX_CLK 152 164 + #define GCC_USB3_PRIM_PHY_PIPE_CLK 153 165 + #define GCC_USB3_PRIM_PHY_PIPE_CLK_SRC 154 166 + #define GCC_VIDEO_AHB_CLK 155 167 + #define GCC_VIDEO_AXI0_CLK 156 168 + #define GCC_VIDEO_XO_CLK 157 169 + 170 + /* GCC resets */ 171 + #define GCC_CAMERA_BCR 0 172 + #define GCC_DISPLAY_BCR 1 173 + #define GCC_GPU_BCR 2 174 + #define GCC_PCIE_0_BCR 3 175 + #define GCC_PCIE_0_LINK_DOWN_BCR 4 176 + #define GCC_PCIE_0_NOCSR_COM_PHY_BCR 5 177 + #define GCC_PCIE_0_PHY_BCR 6 178 + #define GCC_PCIE_0_PHY_NOCSR_COM_PHY_BCR 7 179 + #define GCC_PCIE_1_BCR 8 180 + #define GCC_PCIE_1_LINK_DOWN_BCR 9 181 + #define GCC_PCIE_1_NOCSR_COM_PHY_BCR 10 182 + #define GCC_PCIE_1_PHY_BCR 11 183 + #define GCC_PCIE_1_PHY_NOCSR_COM_PHY_BCR 12 184 + #define GCC_PCIE_RSCC_BCR 13 185 + #define GCC_PDM_BCR 14 186 + #define GCC_QUPV3_WRAPPER_0_BCR 15 187 + #define GCC_QUPV3_WRAPPER_1_BCR 16 188 + #define GCC_QUSB2PHY_PRIM_BCR 17 189 + #define GCC_QUSB2PHY_SEC_BCR 18 190 + #define GCC_SDCC1_BCR 19 191 + #define GCC_SDCC2_BCR 20 192 + #define GCC_UFS_PHY_BCR 21 193 + #define GCC_USB30_PRIM_BCR 22 194 + #define GCC_USB3_DP_PHY_PRIM_BCR 23 195 + #define GCC_USB3_PHY_PRIM_BCR 24 196 + #define GCC_USB3PHY_PHY_PRIM_BCR 25 197 + #define GCC_VIDEO_AXI0_CLK_ARES 26 198 + #define GCC_VIDEO_BCR 27 199 + 200 + /* GCC power domains */ 201 + #define PCIE_0_GDSC 0 202 + #define PCIE_0_PHY_GDSC 1 203 + #define PCIE_1_GDSC 2 204 + #define PCIE_1_PHY_GDSC 3 205 + #define UFS_PHY_GDSC 4 206 + #define UFS_MEM_PHY_GDSC 5 207 + #define USB30_PRIM_GDSC 6 208 + #define USB3_PHY_GDSC 7 209 + 210 + #endif
+56
include/dt-bindings/clock/qcom,milos-gpucc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 5 + */ 6 + 7 + #ifndef _DT_BINDINGS_CLK_QCOM_GPU_CC_MILOS_H 8 + #define _DT_BINDINGS_CLK_QCOM_GPU_CC_MILOS_H 9 + 10 + /* GPU_CC clocks */ 11 + #define GPU_CC_PLL0 0 12 + #define GPU_CC_PLL0_OUT_EVEN 1 13 + #define GPU_CC_AHB_CLK 2 14 + #define GPU_CC_CB_CLK 3 15 + #define GPU_CC_CX_ACCU_SHIFT_CLK 4 16 + #define GPU_CC_CX_FF_CLK 5 17 + #define GPU_CC_CX_GMU_CLK 6 18 + #define GPU_CC_CXO_AON_CLK 7 19 + #define GPU_CC_CXO_CLK 8 20 + #define GPU_CC_DEMET_CLK 9 21 + #define GPU_CC_DEMET_DIV_CLK_SRC 10 22 + #define GPU_CC_DPM_CLK 11 23 + #define GPU_CC_FF_CLK_SRC 12 24 + #define GPU_CC_FREQ_MEASURE_CLK 13 25 + #define GPU_CC_GMU_CLK_SRC 14 26 + #define GPU_CC_GX_ACCU_SHIFT_CLK 15 27 + #define GPU_CC_GX_ACD_AHB_FF_CLK 16 28 + #define GPU_CC_GX_AHB_FF_CLK 17 29 + #define GPU_CC_GX_GMU_CLK 18 30 + #define GPU_CC_GX_RCG_AHB_FF_CLK 19 31 + #define GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK 20 32 + #define GPU_CC_HUB_AON_CLK 21 33 + #define GPU_CC_HUB_CLK_SRC 22 34 + #define GPU_CC_HUB_CX_INT_CLK 23 35 + #define GPU_CC_HUB_DIV_CLK_SRC 24 36 + #define GPU_CC_MEMNOC_GFX_CLK 25 37 + #define GPU_CC_RSCC_HUB_AON_CLK 26 38 + #define GPU_CC_RSCC_XO_AON_CLK 27 39 + #define GPU_CC_SLEEP_CLK 28 40 + #define GPU_CC_XO_CLK_SRC 29 41 + #define GPU_CC_XO_DIV_CLK_SRC 30 42 + 43 + /* GPU_CC resets */ 44 + #define GPU_CC_CB_BCR 0 45 + #define GPU_CC_CX_BCR 1 46 + #define GPU_CC_FAST_HUB_BCR 2 47 + #define GPU_CC_FF_BCR 3 48 + #define GPU_CC_GMU_BCR 4 49 + #define GPU_CC_GX_BCR 5 50 + #define GPU_CC_RBCPR_BCR 6 51 + #define GPU_CC_XO_BCR 7 52 + 53 + /* GPU_CC power domains */ 54 + #define GPU_CC_CX_GDSC 0 55 + 56 + #endif
+36
include/dt-bindings/clock/qcom,milos-videocc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. 4 + * Copyright (c) 2025, Luca Weiss <luca.weiss@fairphone.com> 5 + */ 6 + 7 + #ifndef _DT_BINDINGS_CLK_QCOM_VIDEO_CC_MILOS_H 8 + #define _DT_BINDINGS_CLK_QCOM_VIDEO_CC_MILOS_H 9 + 10 + /* VIDEO_CC clocks */ 11 + #define VIDEO_CC_PLL0 0 12 + #define VIDEO_CC_AHB_CLK 1 13 + #define VIDEO_CC_AHB_CLK_SRC 2 14 + #define VIDEO_CC_MVS0_CLK 3 15 + #define VIDEO_CC_MVS0_CLK_SRC 4 16 + #define VIDEO_CC_MVS0_DIV_CLK_SRC 5 17 + #define VIDEO_CC_MVS0_SHIFT_CLK 6 18 + #define VIDEO_CC_MVS0C_CLK 7 19 + #define VIDEO_CC_MVS0C_DIV2_DIV_CLK_SRC 8 20 + #define VIDEO_CC_MVS0C_SHIFT_CLK 9 21 + #define VIDEO_CC_SLEEP_CLK 10 22 + #define VIDEO_CC_SLEEP_CLK_SRC 11 23 + #define VIDEO_CC_XO_CLK 12 24 + #define VIDEO_CC_XO_CLK_SRC 13 25 + 26 + /* VIDEO_CC resets */ 27 + #define VIDEO_CC_INTERFACE_BCR 0 28 + #define VIDEO_CC_MVS0_BCR 1 29 + #define VIDEO_CC_MVS0C_CLK_ARES 2 30 + #define VIDEO_CC_MVS0C_BCR 3 31 + 32 + /* VIDEO_CC power domains */ 33 + #define VIDEO_CC_MVS0_GDSC 0 34 + #define VIDEO_CC_MVS0C_GDSC 1 35 + 36 + #endif
+110
include/dt-bindings/clock/qcom,qcs615-camcc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_CLK_QCOM_CAM_CC_QCS615_H 7 + #define _DT_BINDINGS_CLK_QCOM_CAM_CC_QCS615_H 8 + 9 + /* CAM_CC clocks */ 10 + #define CAM_CC_BPS_AHB_CLK 0 11 + #define CAM_CC_BPS_AREG_CLK 1 12 + #define CAM_CC_BPS_AXI_CLK 2 13 + #define CAM_CC_BPS_CLK 3 14 + #define CAM_CC_BPS_CLK_SRC 4 15 + #define CAM_CC_CAMNOC_ATB_CLK 5 16 + #define CAM_CC_CAMNOC_AXI_CLK 6 17 + #define CAM_CC_CCI_CLK 7 18 + #define CAM_CC_CCI_CLK_SRC 8 19 + #define CAM_CC_CORE_AHB_CLK 9 20 + #define CAM_CC_CPAS_AHB_CLK 10 21 + #define CAM_CC_CPHY_RX_CLK_SRC 11 22 + #define CAM_CC_CSI0PHYTIMER_CLK 12 23 + #define CAM_CC_CSI0PHYTIMER_CLK_SRC 13 24 + #define CAM_CC_CSI1PHYTIMER_CLK 14 25 + #define CAM_CC_CSI1PHYTIMER_CLK_SRC 15 26 + #define CAM_CC_CSI2PHYTIMER_CLK 16 27 + #define CAM_CC_CSI2PHYTIMER_CLK_SRC 17 28 + #define CAM_CC_CSIPHY0_CLK 18 29 + #define CAM_CC_CSIPHY1_CLK 19 30 + #define CAM_CC_CSIPHY2_CLK 20 31 + #define CAM_CC_FAST_AHB_CLK_SRC 21 32 + #define CAM_CC_ICP_ATB_CLK 22 33 + #define CAM_CC_ICP_CLK 23 34 + #define CAM_CC_ICP_CLK_SRC 24 35 + #define CAM_CC_ICP_CTI_CLK 25 36 + #define CAM_CC_ICP_TS_CLK 26 37 + #define CAM_CC_IFE_0_AXI_CLK 27 38 + #define CAM_CC_IFE_0_CLK 28 39 + #define CAM_CC_IFE_0_CLK_SRC 29 40 + #define CAM_CC_IFE_0_CPHY_RX_CLK 30 41 + #define CAM_CC_IFE_0_CSID_CLK 31 42 + #define CAM_CC_IFE_0_CSID_CLK_SRC 32 43 + #define CAM_CC_IFE_0_DSP_CLK 33 44 + #define CAM_CC_IFE_1_AXI_CLK 34 45 + #define CAM_CC_IFE_1_CLK 35 46 + #define CAM_CC_IFE_1_CLK_SRC 36 47 + #define CAM_CC_IFE_1_CPHY_RX_CLK 37 48 + #define CAM_CC_IFE_1_CSID_CLK 38 49 + #define CAM_CC_IFE_1_CSID_CLK_SRC 39 50 + #define CAM_CC_IFE_1_DSP_CLK 40 51 + #define CAM_CC_IFE_LITE_CLK 41 52 + #define CAM_CC_IFE_LITE_CLK_SRC 42 53 + #define CAM_CC_IFE_LITE_CPHY_RX_CLK 43 54 + #define CAM_CC_IFE_LITE_CSID_CLK 44 55 + #define CAM_CC_IFE_LITE_CSID_CLK_SRC 45 56 + #define CAM_CC_IPE_0_AHB_CLK 46 57 + #define CAM_CC_IPE_0_AREG_CLK 47 58 + #define CAM_CC_IPE_0_AXI_CLK 48 59 + #define CAM_CC_IPE_0_CLK 49 60 + #define CAM_CC_IPE_0_CLK_SRC 50 61 + #define CAM_CC_JPEG_CLK 51 62 + #define CAM_CC_JPEG_CLK_SRC 52 63 + #define CAM_CC_LRME_CLK 53 64 + #define CAM_CC_LRME_CLK_SRC 54 65 + #define CAM_CC_MCLK0_CLK 55 66 + #define CAM_CC_MCLK0_CLK_SRC 56 67 + #define CAM_CC_MCLK1_CLK 57 68 + #define CAM_CC_MCLK1_CLK_SRC 58 69 + #define CAM_CC_MCLK2_CLK 59 70 + #define CAM_CC_MCLK2_CLK_SRC 60 71 + #define CAM_CC_MCLK3_CLK 61 72 + #define CAM_CC_MCLK3_CLK_SRC 62 73 + #define CAM_CC_PLL0 63 74 + #define CAM_CC_PLL1 64 75 + #define CAM_CC_PLL2 65 76 + #define CAM_CC_PLL2_OUT_AUX2 66 77 + #define CAM_CC_PLL3 67 78 + #define CAM_CC_SLOW_AHB_CLK_SRC 68 79 + #define CAM_CC_SOC_AHB_CLK 69 80 + #define CAM_CC_SYS_TMR_CLK 70 81 + 82 + /* CAM_CC power domains */ 83 + #define BPS_GDSC 0 84 + #define IFE_0_GDSC 1 85 + #define IFE_1_GDSC 2 86 + #define IPE_0_GDSC 3 87 + #define TITAN_TOP_GDSC 4 88 + 89 + /* CAM_CC resets */ 90 + #define CAM_CC_BPS_BCR 0 91 + #define CAM_CC_CAMNOC_BCR 1 92 + #define CAM_CC_CCI_BCR 2 93 + #define CAM_CC_CPAS_BCR 3 94 + #define CAM_CC_CSI0PHY_BCR 4 95 + #define CAM_CC_CSI1PHY_BCR 5 96 + #define CAM_CC_CSI2PHY_BCR 6 97 + #define CAM_CC_ICP_BCR 7 98 + #define CAM_CC_IFE_0_BCR 8 99 + #define CAM_CC_IFE_1_BCR 9 100 + #define CAM_CC_IFE_LITE_BCR 10 101 + #define CAM_CC_IPE_0_BCR 11 102 + #define CAM_CC_JPEG_BCR 12 103 + #define CAM_CC_LRME_BCR 13 104 + #define CAM_CC_MCLK0_BCR 14 105 + #define CAM_CC_MCLK1_BCR 15 106 + #define CAM_CC_MCLK2_BCR 16 107 + #define CAM_CC_MCLK3_BCR 17 108 + #define CAM_CC_TITAN_TOP_BCR 18 109 + 110 + #endif
+52
include/dt-bindings/clock/qcom,qcs615-dispcc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_CLK_QCOM_DISP_CC_QCS615_H 7 + #define _DT_BINDINGS_CLK_QCOM_DISP_CC_QCS615_H 8 + 9 + /* DISP_CC clocks */ 10 + #define DISP_CC_MDSS_AHB_CLK 0 11 + #define DISP_CC_MDSS_AHB_CLK_SRC 1 12 + #define DISP_CC_MDSS_BYTE0_CLK 2 13 + #define DISP_CC_MDSS_BYTE0_CLK_SRC 3 14 + #define DISP_CC_MDSS_BYTE0_DIV_CLK_SRC 4 15 + #define DISP_CC_MDSS_BYTE0_INTF_CLK 5 16 + #define DISP_CC_MDSS_DP_AUX_CLK 6 17 + #define DISP_CC_MDSS_DP_AUX_CLK_SRC 7 18 + #define DISP_CC_MDSS_DP_CRYPTO_CLK 8 19 + #define DISP_CC_MDSS_DP_CRYPTO_CLK_SRC 9 20 + #define DISP_CC_MDSS_DP_LINK_CLK 10 21 + #define DISP_CC_MDSS_DP_LINK_CLK_SRC 11 22 + #define DISP_CC_MDSS_DP_LINK_DIV_CLK_SRC 12 23 + #define DISP_CC_MDSS_DP_LINK_INTF_CLK 13 24 + #define DISP_CC_MDSS_DP_PIXEL1_CLK 14 25 + #define DISP_CC_MDSS_DP_PIXEL1_CLK_SRC 15 26 + #define DISP_CC_MDSS_DP_PIXEL_CLK 16 27 + #define DISP_CC_MDSS_DP_PIXEL_CLK_SRC 17 28 + #define DISP_CC_MDSS_ESC0_CLK 18 29 + #define DISP_CC_MDSS_ESC0_CLK_SRC 19 30 + #define DISP_CC_MDSS_MDP_CLK 20 31 + #define DISP_CC_MDSS_MDP_CLK_SRC 21 32 + #define DISP_CC_MDSS_MDP_LUT_CLK 22 33 + #define DISP_CC_MDSS_NON_GDSC_AHB_CLK 23 34 + #define DISP_CC_MDSS_PCLK0_CLK 24 35 + #define DISP_CC_MDSS_PCLK0_CLK_SRC 25 36 + #define DISP_CC_MDSS_ROT_CLK 26 37 + #define DISP_CC_MDSS_ROT_CLK_SRC 27 38 + #define DISP_CC_MDSS_RSCC_AHB_CLK 28 39 + #define DISP_CC_MDSS_RSCC_VSYNC_CLK 29 40 + #define DISP_CC_MDSS_VSYNC_CLK 30 41 + #define DISP_CC_MDSS_VSYNC_CLK_SRC 31 42 + #define DISP_CC_PLL0 32 43 + #define DISP_CC_XO_CLK 33 44 + 45 + /* DISP_CC power domains */ 46 + #define MDSS_CORE_GDSC 0 47 + 48 + /* DISP_CC resets */ 49 + #define DISP_CC_MDSS_CORE_BCR 0 50 + #define DISP_CC_MDSS_RSCC_BCR 1 51 + 52 + #endif
+39
include/dt-bindings/clock/qcom,qcs615-gpucc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_CLK_QCOM_GPU_CC_QCS615_H 7 + #define _DT_BINDINGS_CLK_QCOM_GPU_CC_QCS615_H 8 + 9 + /* GPU_CC clocks */ 10 + #define CRC_DIV_PLL0 0 11 + #define CRC_DIV_PLL1 1 12 + #define GPU_CC_PLL0 2 13 + #define GPU_CC_PLL1 3 14 + #define GPU_CC_CRC_AHB_CLK 4 15 + #define GPU_CC_CX_GFX3D_CLK 5 16 + #define GPU_CC_CX_GFX3D_SLV_CLK 6 17 + #define GPU_CC_CX_GMU_CLK 7 18 + #define GPU_CC_CX_SNOC_DVM_CLK 8 19 + #define GPU_CC_CXO_AON_CLK 9 20 + #define GPU_CC_CXO_CLK 10 21 + #define GPU_CC_GMU_CLK_SRC 11 22 + #define GPU_CC_GX_GFX3D_CLK 12 23 + #define GPU_CC_GX_GFX3D_CLK_SRC 13 24 + #define GPU_CC_GX_GMU_CLK 14 25 + #define GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK 15 26 + #define GPU_CC_SLEEP_CLK 16 27 + 28 + /* GPU_CC power domains */ 29 + #define CX_GDSC 0 30 + #define GX_GDSC 1 31 + 32 + /* GPU_CC resets */ 33 + #define GPU_CC_CX_BCR 0 34 + #define GPU_CC_GFX3D_AON_BCR 1 35 + #define GPU_CC_GMU_BCR 2 36 + #define GPU_CC_GX_BCR 3 37 + #define GPU_CC_XO_BCR 4 38 + 39 + #endif
+30
include/dt-bindings/clock/qcom,qcs615-videocc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_CLK_QCOM_VIDEO_CC_QCS615_H 7 + #define _DT_BINDINGS_CLK_QCOM_VIDEO_CC_QCS615_H 8 + 9 + /* VIDEO_CC clocks */ 10 + #define VIDEO_CC_SLEEP_CLK 0 11 + #define VIDEO_CC_SLEEP_CLK_SRC 1 12 + #define VIDEO_CC_VCODEC0_AXI_CLK 2 13 + #define VIDEO_CC_VCODEC0_CORE_CLK 3 14 + #define VIDEO_CC_VENUS_AHB_CLK 4 15 + #define VIDEO_CC_VENUS_CLK_SRC 5 16 + #define VIDEO_CC_VENUS_CTL_AXI_CLK 6 17 + #define VIDEO_CC_VENUS_CTL_CORE_CLK 7 18 + #define VIDEO_CC_XO_CLK 8 19 + #define VIDEO_PLL0 9 20 + 21 + /* VIDEO_CC power domains */ 22 + #define VCODEC0_GDSC 0 23 + #define VENUS_GDSC 1 24 + 25 + /* VIDEO_CC resets */ 26 + #define VIDEO_CC_INTERFACE_BCR 0 27 + #define VIDEO_CC_VCODEC0_BCR 1 28 + #define VIDEO_CC_VENUS_BCR 2 29 + 30 + #endif
+181
include/dt-bindings/clock/qcom,sc8180x-camcc.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_CLK_QCOM_CAM_CC_SC8180X_H 7 + #define _DT_BINDINGS_CLK_QCOM_CAM_CC_SC8180X_H 8 + 9 + /* CAM_CC clocks */ 10 + #define CAM_CC_BPS_AHB_CLK 0 11 + #define CAM_CC_BPS_AREG_CLK 1 12 + #define CAM_CC_BPS_AXI_CLK 2 13 + #define CAM_CC_BPS_CLK 3 14 + #define CAM_CC_BPS_CLK_SRC 4 15 + #define CAM_CC_CAMNOC_AXI_CLK 5 16 + #define CAM_CC_CAMNOC_AXI_CLK_SRC 6 17 + #define CAM_CC_CAMNOC_DCD_XO_CLK 7 18 + #define CAM_CC_CCI_0_CLK 8 19 + #define CAM_CC_CCI_0_CLK_SRC 9 20 + #define CAM_CC_CCI_1_CLK 10 21 + #define CAM_CC_CCI_1_CLK_SRC 11 22 + #define CAM_CC_CCI_2_CLK 12 23 + #define CAM_CC_CCI_2_CLK_SRC 13 24 + #define CAM_CC_CCI_3_CLK 14 25 + #define CAM_CC_CCI_3_CLK_SRC 15 26 + #define CAM_CC_CORE_AHB_CLK 16 27 + #define CAM_CC_CPAS_AHB_CLK 17 28 + #define CAM_CC_CPHY_RX_CLK_SRC 18 29 + #define CAM_CC_CSI0PHYTIMER_CLK 19 30 + #define CAM_CC_CSI0PHYTIMER_CLK_SRC 20 31 + #define CAM_CC_CSI1PHYTIMER_CLK 21 32 + #define CAM_CC_CSI1PHYTIMER_CLK_SRC 22 33 + #define CAM_CC_CSI2PHYTIMER_CLK 23 34 + #define CAM_CC_CSI2PHYTIMER_CLK_SRC 24 35 + #define CAM_CC_CSI3PHYTIMER_CLK 25 36 + #define CAM_CC_CSI3PHYTIMER_CLK_SRC 26 37 + #define CAM_CC_CSIPHY0_CLK 27 38 + #define CAM_CC_CSIPHY1_CLK 28 39 + #define CAM_CC_CSIPHY2_CLK 29 40 + #define CAM_CC_CSIPHY3_CLK 30 41 + #define CAM_CC_FAST_AHB_CLK_SRC 31 42 + #define CAM_CC_FD_CORE_CLK 32 43 + #define CAM_CC_FD_CORE_CLK_SRC 33 44 + #define CAM_CC_FD_CORE_UAR_CLK 34 45 + #define CAM_CC_ICP_AHB_CLK 35 46 + #define CAM_CC_ICP_CLK 36 47 + #define CAM_CC_ICP_CLK_SRC 37 48 + #define CAM_CC_IFE_0_AXI_CLK 38 49 + #define CAM_CC_IFE_0_CLK 39 50 + #define CAM_CC_IFE_0_CLK_SRC 40 51 + #define CAM_CC_IFE_0_CPHY_RX_CLK 41 52 + #define CAM_CC_IFE_0_CSID_CLK 42 53 + #define CAM_CC_IFE_0_CSID_CLK_SRC 43 54 + #define CAM_CC_IFE_0_DSP_CLK 44 55 + #define CAM_CC_IFE_1_AXI_CLK 45 56 + #define CAM_CC_IFE_1_CLK 46 57 + #define CAM_CC_IFE_1_CLK_SRC 47 58 + #define CAM_CC_IFE_1_CPHY_RX_CLK 48 59 + #define CAM_CC_IFE_1_CSID_CLK 49 60 + #define CAM_CC_IFE_1_CSID_CLK_SRC 50 61 + #define CAM_CC_IFE_1_DSP_CLK 51 62 + #define CAM_CC_IFE_2_AXI_CLK 52 63 + #define CAM_CC_IFE_2_CLK 53 64 + #define CAM_CC_IFE_2_CLK_SRC 54 65 + #define CAM_CC_IFE_2_CPHY_RX_CLK 55 66 + #define CAM_CC_IFE_2_CSID_CLK 56 67 + #define CAM_CC_IFE_2_CSID_CLK_SRC 57 68 + #define CAM_CC_IFE_2_DSP_CLK 58 69 + #define CAM_CC_IFE_3_AXI_CLK 59 70 + #define CAM_CC_IFE_3_CLK 60 71 + #define CAM_CC_IFE_3_CLK_SRC 61 72 + #define CAM_CC_IFE_3_CPHY_RX_CLK 62 73 + #define CAM_CC_IFE_3_CSID_CLK 63 74 + #define CAM_CC_IFE_3_CSID_CLK_SRC 64 75 + #define CAM_CC_IFE_3_DSP_CLK 65 76 + #define CAM_CC_IFE_LITE_0_CLK 66 77 + #define CAM_CC_IFE_LITE_0_CLK_SRC 67 78 + #define CAM_CC_IFE_LITE_0_CPHY_RX_CLK 68 79 + #define CAM_CC_IFE_LITE_0_CSID_CLK 69 80 + #define CAM_CC_IFE_LITE_0_CSID_CLK_SRC 70 81 + #define CAM_CC_IFE_LITE_1_CLK 71 82 + #define CAM_CC_IFE_LITE_1_CLK_SRC 72 83 + #define CAM_CC_IFE_LITE_1_CPHY_RX_CLK 73 84 + #define CAM_CC_IFE_LITE_1_CSID_CLK 74 85 + #define CAM_CC_IFE_LITE_1_CSID_CLK_SRC 75 86 + #define CAM_CC_IFE_LITE_2_CLK 76 87 + #define CAM_CC_IFE_LITE_2_CLK_SRC 77 88 + #define CAM_CC_IFE_LITE_2_CPHY_RX_CLK 78 89 + #define CAM_CC_IFE_LITE_2_CSID_CLK 79 90 + #define CAM_CC_IFE_LITE_2_CSID_CLK_SRC 80 91 + #define CAM_CC_IFE_LITE_3_CLK 81 92 + #define CAM_CC_IFE_LITE_3_CLK_SRC 82 93 + #define CAM_CC_IFE_LITE_3_CPHY_RX_CLK 83 94 + #define CAM_CC_IFE_LITE_3_CSID_CLK 84 95 + #define CAM_CC_IFE_LITE_3_CSID_CLK_SRC 85 96 + #define CAM_CC_IPE_0_AHB_CLK 86 97 + #define CAM_CC_IPE_0_AREG_CLK 87 98 + #define CAM_CC_IPE_0_AXI_CLK 88 99 + #define CAM_CC_IPE_0_CLK 89 100 + #define CAM_CC_IPE_0_CLK_SRC 90 101 + #define CAM_CC_IPE_1_AHB_CLK 91 102 + #define CAM_CC_IPE_1_AREG_CLK 92 103 + #define CAM_CC_IPE_1_AXI_CLK 93 104 + #define CAM_CC_IPE_1_CLK 94 105 + #define CAM_CC_JPEG_CLK 95 106 + #define CAM_CC_JPEG_CLK_SRC 96 107 + #define CAM_CC_LRME_CLK 97 108 + #define CAM_CC_LRME_CLK_SRC 98 109 + #define CAM_CC_MCLK0_CLK 99 110 + #define CAM_CC_MCLK0_CLK_SRC 100 111 + #define CAM_CC_MCLK1_CLK 101 112 + #define CAM_CC_MCLK1_CLK_SRC 102 113 + #define CAM_CC_MCLK2_CLK 103 114 + #define CAM_CC_MCLK2_CLK_SRC 104 115 + #define CAM_CC_MCLK3_CLK 105 116 + #define CAM_CC_MCLK3_CLK_SRC 106 117 + #define CAM_CC_MCLK4_CLK 107 118 + #define CAM_CC_MCLK4_CLK_SRC 108 119 + #define CAM_CC_MCLK5_CLK 109 120 + #define CAM_CC_MCLK5_CLK_SRC 110 121 + #define CAM_CC_MCLK6_CLK 111 122 + #define CAM_CC_MCLK6_CLK_SRC 112 123 + #define CAM_CC_MCLK7_CLK 113 124 + #define CAM_CC_MCLK7_CLK_SRC 114 125 + #define CAM_CC_PLL0 115 126 + #define CAM_CC_PLL0_OUT_EVEN 116 127 + #define CAM_CC_PLL0_OUT_ODD 117 128 + #define CAM_CC_PLL1 118 129 + #define CAM_CC_PLL2 119 130 + #define CAM_CC_PLL2_OUT_MAIN 120 131 + #define CAM_CC_PLL3 121 132 + #define CAM_CC_PLL4 122 133 + #define CAM_CC_PLL5 123 134 + #define CAM_CC_PLL6 124 135 + #define CAM_CC_SLOW_AHB_CLK_SRC 125 136 + #define CAM_CC_XO_CLK_SRC 126 137 + 138 + 139 + /* CAM_CC power domains */ 140 + #define BPS_GDSC 0 141 + #define IFE_0_GDSC 1 142 + #define IFE_1_GDSC 2 143 + #define IFE_2_GDSC 3 144 + #define IFE_3_GDSC 4 145 + #define IPE_0_GDSC 5 146 + #define IPE_1_GDSC 6 147 + #define TITAN_TOP_GDSC 7 148 + 149 + /* CAM_CC resets */ 150 + #define CAM_CC_BPS_BCR 0 151 + #define CAM_CC_CAMNOC_BCR 1 152 + #define CAM_CC_CCI_BCR 2 153 + #define CAM_CC_CPAS_BCR 3 154 + #define CAM_CC_CSI0PHY_BCR 4 155 + #define CAM_CC_CSI1PHY_BCR 5 156 + #define CAM_CC_CSI2PHY_BCR 6 157 + #define CAM_CC_CSI3PHY_BCR 7 158 + #define CAM_CC_FD_BCR 8 159 + #define CAM_CC_ICP_BCR 9 160 + #define CAM_CC_IFE_0_BCR 10 161 + #define CAM_CC_IFE_1_BCR 11 162 + #define CAM_CC_IFE_2_BCR 12 163 + #define CAM_CC_IFE_3_BCR 13 164 + #define CAM_CC_IFE_LITE_0_BCR 14 165 + #define CAM_CC_IFE_LITE_1_BCR 15 166 + #define CAM_CC_IFE_LITE_2_BCR 16 167 + #define CAM_CC_IFE_LITE_3_BCR 17 168 + #define CAM_CC_IPE_0_BCR 18 169 + #define CAM_CC_IPE_1_BCR 19 170 + #define CAM_CC_JPEG_BCR 20 171 + #define CAM_CC_LRME_BCR 21 172 + #define CAM_CC_MCLK0_BCR 22 173 + #define CAM_CC_MCLK1_BCR 23 174 + #define CAM_CC_MCLK2_BCR 24 175 + #define CAM_CC_MCLK3_BCR 25 176 + #define CAM_CC_MCLK4_BCR 26 177 + #define CAM_CC_MCLK5_BCR 27 178 + #define CAM_CC_MCLK6_BCR 28 179 + #define CAM_CC_MCLK7_BCR 29 180 + 181 + #endif
+2
include/dt-bindings/clock/qcom,x1e80100-gcc.h
··· 482 482 #define GCC_USB_1_PHY_BCR 85 483 483 #define GCC_USB_2_PHY_BCR 86 484 484 #define GCC_VIDEO_BCR 87 485 + #define GCC_VIDEO_AXI0_CLK_ARES 88 486 + #define GCC_VIDEO_AXI1_CLK_ARES 89 485 487 #endif