Merge branches 'clk-microchip', 'clk-xilinx', 'clk-allwinner', 'clk-imx' and 'clk-qcom' into clk-next

* clk-microchip:
  clk: at91: sama7d65: add sama7d65 pmc driver
  dt-bindings: clock: Add SAMA7D65 PMC compatible string
  dt-bindings: clocks: atmel,at91sam9x5-sckc: add sama7d65
  clk: at91: sckc: Use SCKC_{TD, MD}_SLCK IDs for clk32k clocks
  dt-bindings: clk: at91: Add clock IDs for the slow clock controller

* clk-xilinx:
  clk: clocking-wizard: calculate dividers fractional parts
  dt-bindings: clock: xilinx: Add reset GPIO for VCU
  dt-bindings: clock: xilinx: Convert VCU bindings to dtschema

* clk-allwinner:
  clk: sunxi-ng: h616: Reparent CPU clock during frequency changes
  clk: sunxi-ng: a64: stop force-selecting PLL-MIPI as TCON0 parent
  clk: sunxi-ng: a64: drop redundant CLK_PLL_VIDEO0_2X and CLK_PLL_MIPI
  dt-bindings: clock: sunxi: Export PLL_VIDEO_2X and PLL_MIPI

* clk-imx:
  clk: imx: Apply some clks only for i.MX93
  arm64: dts: imx93: Use IMX93_CLK_SPDIF_IPG as SPDIF IPG clock
  clk: imx93: Add IMX93_CLK_SPDIF_IPG clock
  dt-bindings: clock: imx93: Add SPDIF IPG clk
  clk: imx: pll14xx: Add 208 MHz and 416 MHz entries for PLL1416x
  clk: imx8mp: Fix clkout1/2 support

* clk-qcom: (63 commits)
  clk: qcom: Select CLK_X1E80100_GCC in config CLK_X1P42100_GPUCC
  dt-bindings: clock: move qcom,x1e80100-camcc to its own file
  clk: qcom: smd-rpm: Add clocks for MSM8940
  dt-bindings: clock: qcom,rpmcc: Add MSM8940 compatible
  clk: qcom: smd-rpm: Add clocks for MSM8937
  dt-bindings: clock: qcom,rpmcc: Add MSM8937 compatible
  clk: qcom: ipq5424: Use icc-clk for enabling NoC related clocks
  dt-bindings: interconnect: Add Qualcomm IPQ5424 support
  clk: qcom: Add SM6115 LPASSCC
  dt-bindings: clock: Add Qualcomm SM6115 LPASS clock controller
  clk: qcom: gcc-sdm845: Do not use shared clk_ops for QUPs
  clk: qcom: gcc-sdm845: Add general purpose clock ops
  clk: qcom: clk-rcg2: split __clk_rcg2_configure function
  clk: qcom: clk-rcg2: document calc_rate function
  clk: qcom: gcc-x1e80100: Do not turn off usb_2 controller GDSC
  clk: qcom: ipq5424: add gcc_xo_clk
  dt-bindings: clock: qcom: gcc-ipq5424: add gcc_xo_clk macro
  dt-bindings: clock: qcom: gcc-ipq5424: remove apss_dbg clock macro
  clk: qcom: ipq5424: remove apss_dbg clock
  dt-bindings: clock: qcom,sdm845-camcc: add sdm670 compatible
  ...
This commit is contained in:
Stephen Boyd 2025-01-21 11:22:19 -08:00
78 changed files with 12841 additions and 267 deletions

View File

@ -43,6 +43,7 @@ properties:
- atmel,sama5d4-pmc - atmel,sama5d4-pmc
- microchip,sam9x60-pmc - microchip,sam9x60-pmc
- microchip,sam9x7-pmc - microchip,sam9x7-pmc
- microchip,sama7d65-pmc
- microchip,sama7g5-pmc - microchip,sama7g5-pmc
- const: syscon - const: syscon
@ -90,6 +91,7 @@ allOf:
enum: enum:
- microchip,sam9x60-pmc - microchip,sam9x60-pmc
- microchip,sam9x7-pmc - microchip,sam9x7-pmc
- microchip,sama7d65-pmc
- microchip,sama7g5-pmc - microchip,sama7g5-pmc
then: then:
properties: properties:

View File

@ -20,6 +20,7 @@ properties:
- items: - items:
- enum: - enum:
- microchip,sam9x7-sckc - microchip,sam9x7-sckc
- microchip,sama7d65-sckc
- microchip,sama7g5-sckc - microchip,sama7g5-sckc
- const: microchip,sam9x60-sckc - const: microchip,sam9x60-sckc

View File

@ -0,0 +1,77 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/qcom,ipq9574-cmn-pll.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm CMN PLL Clock Controller on IPQ SoC
maintainers:
- Bjorn Andersson <andersson@kernel.org>
- Luo Jie <quic_luoj@quicinc.com>
description:
The CMN (or common) PLL clock controller expects a reference
input clock. This reference clock is from the on-board Wi-Fi.
The CMN PLL supplies a number of fixed rate output clocks to
the devices providing networking functions and to GCC. These
networking hardware include PPE (packet process engine), PCS
and the externally connected switch or PHY devices. The CMN
PLL block also outputs fixed rate clocks to GCC. The PLL's
primary function is to enable fixed rate output clocks for
networking hardware functions used with the IPQ SoC.
properties:
compatible:
enum:
- qcom,ipq9574-cmn-pll
reg:
maxItems: 1
clocks:
items:
- description: The reference clock. The supported clock rates include
25000000, 31250000, 40000000, 48000000, 50000000 and 96000000 HZ.
- description: The AHB clock
- description: The SYS clock
description:
The reference clock is the source clock of CMN PLL, which is from the
Wi-Fi. The AHB and SYS clocks must be enabled to access CMN PLL
clock registers.
clock-names:
items:
- const: ref
- const: ahb
- const: sys
"#clock-cells":
const: 1
required:
- compatible
- reg
- clocks
- clock-names
- "#clock-cells"
additionalProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,ipq-cmn-pll.h>
#include <dt-bindings/clock/qcom,ipq9574-gcc.h>
cmn_pll: clock-controller@9b000 {
compatible = "qcom,ipq9574-cmn-pll";
reg = <0x0009b000 0x800>;
clocks = <&cmn_pll_ref_clk>,
<&gcc GCC_CMN_12GPLL_AHB_CLK>,
<&gcc GCC_CMN_12GPLL_SYS_CLK>;
clock-names = "ref", "ahb", "sys";
#clock-cells = <1>;
assigned-clocks = <&cmn_pll CMN_PLL_CLK>;
assigned-clock-rates-u64 = /bits/ 64 <12000000000>;
};
...

View File

@ -78,6 +78,7 @@ allOf:
then: then:
properties: properties:
clocks: clocks:
minItems: 8
items: items:
- description: Board PXO source - description: Board PXO source
- description: PLL 3 clock - description: PLL 3 clock
@ -87,8 +88,10 @@ allOf:
- description: DSI phy instance 2 dsi clock - description: DSI phy instance 2 dsi clock
- description: DSI phy instance 2 byte clock - description: DSI phy instance 2 byte clock
- description: HDMI phy PLL clock - description: HDMI phy PLL clock
- description: LVDS PLL clock
clock-names: clock-names:
minItems: 8
items: items:
- const: pxo - const: pxo
- const: pll3 - const: pll3
@ -98,6 +101,7 @@ allOf:
- const: dsi2pll - const: dsi2pll
- const: dsi2pllbyte - const: dsi2pllbyte
- const: hdmipll - const: hdmipll
- const: lvdspll
- if: - if:
properties: properties:

View File

@ -0,0 +1,59 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/qcom,qcs615-gcc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Global Clock & Reset Controller on QCS615
maintainers:
- Taniya Das <quic_tdas@quicinc.com>
description: |
Qualcomm global clock control module provides the clocks, resets and power
domains on QCS615.
See also: include/dt-bindings/clock/qcom,qcs615-gcc.h
properties:
compatible:
const: qcom,qcs615-gcc
clocks:
items:
- description: Board XO source
- description: Board active XO source
- description: Sleep clock source
clock-names:
items:
- const: bi_tcxo
- const: bi_tcxo_ao
- const: sleep_clk
required:
- compatible
- clocks
- clock-names
- '#power-domain-cells'
allOf:
- $ref: qcom,gcc.yaml#
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,rpmh.h>
clock-controller@100000 {
compatible = "qcom,qcs615-gcc";
reg = <0x00100000 0x1f0000>;
clocks = <&rpmhcc RPMH_CXO_CLK>,
<&rpmhcc RPMH_CXO_CLK_A>,
<&sleep_clk>;
clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk";
#clock-cells = <1>;
#reset-cells = <1>;
#power-domain-cells = <1>;
};
...

View File

@ -33,6 +33,8 @@ properties:
- qcom,rpmcc-msm8916 - qcom,rpmcc-msm8916
- qcom,rpmcc-msm8917 - qcom,rpmcc-msm8917
- qcom,rpmcc-msm8936 - qcom,rpmcc-msm8936
- qcom,rpmcc-msm8937
- qcom,rpmcc-msm8940
- qcom,rpmcc-msm8953 - qcom,rpmcc-msm8953
- qcom,rpmcc-msm8974 - qcom,rpmcc-msm8974
- qcom,rpmcc-msm8976 - qcom,rpmcc-msm8976
@ -110,6 +112,8 @@ allOf:
- qcom,rpmcc-msm8916 - qcom,rpmcc-msm8916
- qcom,rpmcc-msm8917 - qcom,rpmcc-msm8917
- qcom,rpmcc-msm8936 - qcom,rpmcc-msm8936
- qcom,rpmcc-msm8937
- qcom,rpmcc-msm8940
- qcom,rpmcc-msm8953 - qcom,rpmcc-msm8953
- qcom,rpmcc-msm8974 - qcom,rpmcc-msm8974
- qcom,rpmcc-msm8976 - qcom,rpmcc-msm8976

View File

@ -17,6 +17,7 @@ description: |
properties: properties:
compatible: compatible:
enum: enum:
- qcom,qcs615-rpmh-clk
- qcom,qdu1000-rpmh-clk - qcom,qdu1000-rpmh-clk
- qcom,sa8775p-rpmh-clk - qcom,sa8775p-rpmh-clk
- qcom,sar2130p-rpmh-clk - qcom,sar2130p-rpmh-clk
@ -37,6 +38,7 @@ properties:
- qcom,sm8450-rpmh-clk - qcom,sm8450-rpmh-clk
- qcom,sm8550-rpmh-clk - qcom,sm8550-rpmh-clk
- qcom,sm8650-rpmh-clk - qcom,sm8650-rpmh-clk
- qcom,sm8750-rpmh-clk
- qcom,x1e80100-rpmh-clk - qcom,x1e80100-rpmh-clk
clocks: clocks:

View File

@ -18,12 +18,6 @@ description: |
include/dt-bindings/clock/qcom,lpassaudiocc-sc7280.h include/dt-bindings/clock/qcom,lpassaudiocc-sc7280.h
properties: properties:
clocks: true
clock-names: true
reg: true
compatible: compatible:
enum: enum:
- qcom,sc7280-lpassaoncc - qcom,sc7280-lpassaoncc
@ -31,12 +25,24 @@ properties:
- qcom,sc7280-lpasscorecc - qcom,sc7280-lpasscorecc
- qcom,sc7280-lpasshm - qcom,sc7280-lpasshm
power-domains: reg:
maxItems: 1 minItems: 1
maxItems: 2
clocks:
minItems: 1
maxItems: 3
clock-names:
minItems: 1
maxItems: 3
'#clock-cells': '#clock-cells':
const: 1 const: 1
power-domains:
maxItems: 1
'#power-domain-cells': '#power-domain-cells':
const: 1 const: 1
@ -57,8 +63,6 @@ required:
- '#clock-cells' - '#clock-cells'
- '#power-domain-cells' - '#power-domain-cells'
additionalProperties: false
allOf: allOf:
- if: - if:
properties: properties:
@ -125,6 +129,9 @@ allOf:
reg: reg:
maxItems: 1 maxItems: 1
additionalProperties: false
examples: examples:
- | - |
#include <dt-bindings/clock/qcom,rpmh.h> #include <dt-bindings/clock/qcom,rpmh.h>

View File

@ -20,7 +20,11 @@ allOf:
properties: properties:
compatible: compatible:
const: qcom,sdm845-camcc oneOf:
- items:
- const: qcom,sdm670-camcc
- const: qcom,sdm845-camcc
- const: qcom,sdm845-camcc
clocks: clocks:
items: items:

View File

@ -0,0 +1,46 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/qcom,sm6115-lpasscc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm LPASS Core & Audio Clock Controller on SM6115
maintainers:
- Konrad Dybcio <konradybcio@kernel.org>
- Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
description: |
Qualcomm LPASS core and audio clock controllers provide audio-related resets
on SM6115 and its derivatives.
See also::
include/dt-bindings/clock/qcom,sm6115-lpasscc.h
properties:
compatible:
enum:
- qcom,sm6115-lpassaudiocc
- qcom,sm6115-lpasscc
reg:
maxItems: 1
'#reset-cells':
const: 1
required:
- compatible
- reg
- '#reset-cells'
additionalProperties: false
examples:
- |
lpass_audiocc: clock-controller@a6a9000 {
compatible = "qcom,sm6115-lpassaudiocc";
reg = <0x0a6a9000 0x1000>;
#reset-cells = <1>;
};
...

View File

@ -19,7 +19,6 @@ description: |
include/dt-bindings/clock/qcom,sm8450-camcc.h include/dt-bindings/clock/qcom,sm8450-camcc.h
include/dt-bindings/clock/qcom,sm8550-camcc.h include/dt-bindings/clock/qcom,sm8550-camcc.h
include/dt-bindings/clock/qcom,sm8650-camcc.h include/dt-bindings/clock/qcom,sm8650-camcc.h
include/dt-bindings/clock/qcom,x1e80100-camcc.h
properties: properties:
compatible: compatible:
@ -29,7 +28,6 @@ properties:
- qcom,sm8475-camcc - qcom,sm8475-camcc
- qcom,sm8550-camcc - qcom,sm8550-camcc
- qcom,sm8650-camcc - qcom,sm8650-camcc
- qcom,x1e80100-camcc
clocks: clocks:
items: items:

View File

@ -32,6 +32,7 @@ properties:
- qcom,sm8550-gpucc - qcom,sm8550-gpucc
- qcom,sm8650-gpucc - qcom,sm8650-gpucc
- qcom,x1e80100-gpucc - qcom,x1e80100-gpucc
- qcom,x1p42100-gpucc
clocks: clocks:
items: items:

View File

@ -12,11 +12,12 @@ maintainers:
description: | description: |
Qualcomm display clock control module provides the clocks, resets and power Qualcomm display clock control module provides the clocks, resets and power
domains on SM8550. domains on SM8550, SM8650, SM8750 and few other platforms.
See also: See also:
- include/dt-bindings/clock/qcom,sm8550-dispcc.h - include/dt-bindings/clock/qcom,sm8550-dispcc.h
- include/dt-bindings/clock/qcom,sm8650-dispcc.h - include/dt-bindings/clock/qcom,sm8650-dispcc.h
- include/dt-bindings/clock/qcom,sm8750-dispcc.h
- include/dt-bindings/clock/qcom,x1e80100-dispcc.h - include/dt-bindings/clock/qcom,x1e80100-dispcc.h
properties: properties:
@ -25,6 +26,7 @@ properties:
- qcom,sar2130p-dispcc - qcom,sar2130p-dispcc
- qcom,sm8550-dispcc - qcom,sm8550-dispcc
- qcom,sm8650-dispcc - qcom,sm8650-dispcc
- qcom,sm8750-dispcc
- qcom,x1e80100-dispcc - qcom,x1e80100-dispcc
clocks: clocks:

View File

@ -16,6 +16,7 @@ description: |
See also: See also:
- include/dt-bindings/clock/qcom,sm8550-tcsr.h - include/dt-bindings/clock/qcom,sm8550-tcsr.h
- include/dt-bindings/clock/qcom,sm8650-tcsr.h - include/dt-bindings/clock/qcom,sm8650-tcsr.h
- include/dt-bindings/clock/qcom,sm8750-tcsr.h
properties: properties:
compatible: compatible:
@ -24,6 +25,7 @@ properties:
- qcom,sar2130p-tcsr - qcom,sar2130p-tcsr
- qcom,sm8550-tcsr - qcom,sm8550-tcsr
- qcom,sm8650-tcsr - qcom,sm8650-tcsr
- qcom,sm8750-tcsr
- qcom,x1e80100-tcsr - qcom,x1e80100-tcsr
- const: syscon - const: syscon

View File

@ -0,0 +1,62 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/qcom,sm8750-gcc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Global Clock & Reset Controller on SM8750
maintainers:
- Taniya Das <quic_tdas@quicinc.com>
description: |
Qualcomm global clock control module provides the clocks, resets and power
domains on SM8750
See also: include/dt-bindings/clock/qcom,sm8750-gcc.h
properties:
compatible:
const: qcom,sm8750-gcc
clocks:
items:
- description: Board XO source
- description: Board Always On XO source
- description: Sleep clock source
- description: PCIE 0 Pipe clock source
- description: UFS Phy Rx symbol 0 clock source
- description: UFS Phy Rx symbol 1 clock source
- description: UFS Phy Tx symbol 0 clock source
- description: USB3 Phy wrapper pipe clock source
required:
- compatible
- clocks
- '#power-domain-cells'
allOf:
- $ref: qcom,gcc.yaml#
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,rpmh.h>
clock-controller@100000 {
compatible = "qcom,sm8750-gcc";
reg = <0x00100000 0x001f4200>;
clocks = <&rpmhcc RPMH_CXO_CLK>,
<&rpmhcc RPMH_CXO_CLK_A>,
<&sleep_clk>,
<&pcie0_phy>,
<&ufs_mem_phy 0>,
<&ufs_mem_phy 1>,
<&ufs_mem_phy 2>,
<&usb_1_qmpphy>;
#clock-cells = <1>;
#reset-cells = <1>;
#power-domain-cells = <1>;
};
...

View File

@ -0,0 +1,74 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/qcom,x1e80100-camcc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Camera Clock & Reset Controller on x1e80100
maintainers:
- Bryan O'Donoghue <bryan.odonoghue@linaro.org>
description: |
Qualcomm camera clock control module provides the clocks, resets and power
domains on x1e80100.
See also:
include/dt-bindings/clock/qcom,x1e80100-camcc.h
allOf:
- $ref: qcom,gcc.yaml#
properties:
compatible:
enum:
- qcom,x1e80100-camcc
reg:
maxItems: 1
clocks:
items:
- description: Camera AHB clock from GCC
- description: Board XO source
- description: Board active XO source
- description: Sleep clock source
power-domains:
items:
- description: A phandle to the MXC power-domain
- description: A phandle to the MMCX power-domain
required-opps:
maxItems: 1
description:
A phandle to an OPP node describing MMCX performance points.
required:
- compatible
- clocks
- power-domains
- required-opps
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,x1e80100-gcc.h>
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/power/qcom,rpmhpd.h>
clock-controller@ade0000 {
compatible = "qcom,x1e80100-camcc";
reg = <0xade0000 0x20000>;
clocks = <&gcc GCC_CAMERA_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>,
<&rpmhcc RPMH_CXO_CLK_A>,
<&sleep_clk>;
power-domains = <&rpmhpd RPMHPD_MXC>,
<&rpmhpd RPMHPD_MMCX>;
required-opps = <&rpmhpd_opp_low_svs>;
#clock-cells = <1>;
#reset-cells = <1>;
#power-domain-cells = <1>;
};
...

View File

@ -17,7 +17,11 @@ description: |
properties: properties:
compatible: compatible:
const: qcom,x1e80100-gcc oneOf:
- items:
- const: qcom,x1p42100-gcc
- const: qcom,x1e80100-gcc
- const: qcom,x1e80100-gcc
clocks: clocks:
items: items:

View File

@ -0,0 +1,59 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/xlnx,vcu.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: LogicoreIP designed compatible with Xilinx ZYNQ family.
maintainers:
- Rohit Visavalia <rohit.visavalia@amd.com>
description:
LogicoreIP design to provide the isolation between processing system
and programmable logic. Also provides the list of register set to configure
the frequency.
properties:
compatible:
items:
- enum:
- xlnx,vcu
- xlnx,vcu-logicoreip-1.0
reg:
maxItems: 1
clocks:
items:
- description: pll ref clocksource
- description: aclk
clock-names:
items:
- const: pll_ref
- const: aclk
reset-gpios:
maxItems: 1
required:
- reg
- clocks
- clock-names
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
fpga {
#address-cells = <2>;
#size-cells = <2>;
xlnx_vcu: vcu@a0040000 {
compatible = "xlnx,vcu-logicoreip-1.0";
reg = <0x0 0xa0040000 0x0 0x1000>;
reset-gpios = <&gpio 78 GPIO_ACTIVE_HIGH>;
clocks = <&si570_1>, <&clkc 71>;
clock-names = "pll_ref", "aclk";
};
};

View File

@ -1,26 +0,0 @@
LogicoreIP designed compatible with Xilinx ZYNQ family.
-------------------------------------------------------
General concept
---------------
LogicoreIP design to provide the isolation between processing system
and programmable logic. Also provides the list of register set to configure
the frequency.
Required properties:
- compatible: shall be one of:
"xlnx,vcu"
"xlnx,vcu-logicoreip-1.0"
- reg : The base offset and size of the VCU_PL_SLCR register space.
- clocks: phandle for aclk and pll_ref clocksource
- clock-names: The identification string, "aclk", is always required for
the axi clock. "pll_ref" is required for pll.
Example:
xlnx_vcu: vcu@a0040000 {
compatible = "xlnx,vcu-logicoreip-1.0";
reg = <0x0 0xa0040000 0x0 0x1000>;
clocks = <&si570_1>, <&clkc 71>;
clock-names = "pll_ref", "aclk";
};

View File

@ -925,7 +925,7 @@
reg-names = "ram", "regs", "rxfifo", "txfifo"; reg-names = "ram", "regs", "rxfifo", "txfifo";
interrupts = <GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH>, interrupts = <GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH>; <GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX93_CLK_BUS_WAKEUP>, clocks = <&clk IMX93_CLK_SPDIF_IPG>,
<&clk IMX93_CLK_SPDIF_GATE>, <&clk IMX93_CLK_SPDIF_GATE>,
<&clk IMX93_CLK_DUMMY>, <&clk IMX93_CLK_DUMMY>,
<&clk IMX93_CLK_AUD_XCVR_GATE>; <&clk IMX93_CLK_AUD_XCVR_GATE>;

View File

@ -24,4 +24,5 @@ obj-$(CONFIG_SOC_SAM9X7) += sam9x7.o
obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o dt-compat.o obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o dt-compat.o
obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o dt-compat.o obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o dt-compat.o
obj-$(CONFIG_SOC_SAMA5D2) += sama5d2.o dt-compat.o obj-$(CONFIG_SOC_SAMA5D2) += sama5d2.o dt-compat.o
obj-$(CONFIG_SOC_SAMA7D65) += sama7d65.o
obj-$(CONFIG_SOC_SAMA7G5) += sama7g5.o obj-$(CONFIG_SOC_SAMA7G5) += sama7g5.o

View File

@ -20,7 +20,7 @@
#define PMC_MCR_CSS_SHIFT (16) #define PMC_MCR_CSS_SHIFT (16)
#define MASTER_MAX_ID 4 #define MASTER_MAX_ID 9
#define to_clk_master(hw) container_of(hw, struct clk_master, hw) #define to_clk_master(hw) container_of(hw, struct clk_master, hw)

View File

@ -23,7 +23,7 @@
#define UPLL_DIV 2 #define UPLL_DIV 2
#define PLL_MUL_MAX (FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, UINT_MAX) + 1) #define PLL_MUL_MAX (FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, UINT_MAX) + 1)
#define PLL_MAX_ID 7 #define PLL_MAX_ID 9
struct sam9x60_pll_core { struct sam9x60_pll_core {
struct regmap *regmap; struct regmap *regmap;

View File

@ -151,6 +151,7 @@ static struct syscore_ops pmc_syscore_ops = {
static const struct of_device_id pmc_dt_ids[] = { static const struct of_device_id pmc_dt_ids[] = {
{ .compatible = "atmel,sama5d2-pmc" }, { .compatible = "atmel,sama5d2-pmc" },
{ .compatible = "microchip,sama7g5-pmc", }, { .compatible = "microchip,sama7g5-pmc", },
{ .compatible = "microchip,sama7d65-pmc", },
{ /* sentinel */ } { /* sentinel */ }
}; };

1375
drivers/clk/at91/sama7d65.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,8 @@
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/io.h> #include <linux/io.h>
#include <dt-bindings/clock/at91.h>
#define SLOW_CLOCK_FREQ 32768 #define SLOW_CLOCK_FREQ 32768
#define SLOWCK_SW_CYCLES 5 #define SLOWCK_SW_CYCLES 5
#define SLOWCK_SW_TIME_USEC ((SLOWCK_SW_CYCLES * USEC_PER_SEC) / \ #define SLOWCK_SW_TIME_USEC ((SLOWCK_SW_CYCLES * USEC_PER_SEC) / \
@ -470,7 +472,7 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np)
{ {
void __iomem *regbase = of_iomap(np, 0); void __iomem *regbase = of_iomap(np, 0);
struct clk_hw_onecell_data *clk_data; struct clk_hw_onecell_data *clk_data;
struct clk_hw *slow_rc, *slow_osc; struct clk_hw *slow_rc, *slow_osc, *hw;
const char *xtal_name; const char *xtal_name;
const struct clk_hw *parent_hws[2]; const struct clk_hw *parent_hws[2];
static struct clk_parent_data parent_data = { static struct clk_parent_data parent_data = {
@ -506,19 +508,19 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np)
/* MD_SLCK and TD_SLCK. */ /* MD_SLCK and TD_SLCK. */
clk_data->num = 2; clk_data->num = 2;
clk_data->hws[0] = clk_hw_register_fixed_rate_parent_hw(NULL, "md_slck", hw = clk_hw_register_fixed_rate_parent_hw(NULL, "md_slck", slow_rc,
slow_rc, 0, 32768);
0, 32768); if (IS_ERR(hw))
if (IS_ERR(clk_data->hws[0]))
goto clk_data_free; goto clk_data_free;
clk_data->hws[SCKC_MD_SLCK] = hw;
parent_hws[0] = slow_rc; parent_hws[0] = slow_rc;
parent_hws[1] = slow_osc; parent_hws[1] = slow_osc;
clk_data->hws[1] = at91_clk_register_sam9x5_slow(regbase, "td_slck", hw = at91_clk_register_sam9x5_slow(regbase, "td_slck", parent_hws,
parent_hws, 2, 2, &at91sam9x60_bits);
&at91sam9x60_bits); if (IS_ERR(hw))
if (IS_ERR(clk_data->hws[1]))
goto unregister_md_slck; goto unregister_md_slck;
clk_data->hws[SCKC_TD_SLCK] = hw;
ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data); ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data);
if (WARN_ON(ret)) if (WARN_ON(ret))
@ -527,9 +529,9 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np)
return; return;
unregister_td_slck: unregister_td_slck:
at91_clk_unregister_sam9x5_slow(clk_data->hws[1]); at91_clk_unregister_sam9x5_slow(clk_data->hws[SCKC_TD_SLCK]);
unregister_md_slck: unregister_md_slck:
clk_hw_unregister(clk_data->hws[0]); clk_hw_unregister(clk_data->hws[SCKC_MD_SLCK]);
clk_data_free: clk_data_free:
kfree(clk_data); kfree(clk_data);
unregister_slow_osc: unregister_slow_osc:

View File

@ -399,8 +399,9 @@ static const char * const imx8mp_dram_core_sels[] = {"dram_pll_out", "dram_alt_r
static const char * const imx8mp_clkout_sels[] = {"audio_pll1_out", "audio_pll2_out", "video_pll1_out", static const char * const imx8mp_clkout_sels[] = {"audio_pll1_out", "audio_pll2_out", "video_pll1_out",
"dummy", "dummy", "gpu_pll_out", "vpu_pll_out", "dummy", "dummy", "gpu_pll_out", "vpu_pll_out",
"arm_pll_out", "sys_pll1", "sys_pll2", "sys_pll3", "arm_pll_out", "sys_pll1_out", "sys_pll2_out",
"dummy", "dummy", "osc_24m", "dummy", "osc_32k"}; "sys_pll3_out", "dummy", "dummy", "osc_24m",
"dummy", "osc_32k"};
static struct clk_hw **hws; static struct clk_hw **hws;
static struct clk_hw_onecell_data *clk_hw_data; static struct clk_hw_onecell_data *clk_hw_data;

View File

@ -15,7 +15,7 @@
#include "clk.h" #include "clk.h"
#define IMX93_CLK_END 207 #define IMX93_CLK_END 208
#define PLAT_IMX93 BIT(0) #define PLAT_IMX93 BIT(0)
#define PLAT_IMX91 BIT(1) #define PLAT_IMX91 BIT(1)
@ -38,6 +38,7 @@ static u32 share_count_sai2;
static u32 share_count_sai3; static u32 share_count_sai3;
static u32 share_count_mub; static u32 share_count_mub;
static u32 share_count_pdm; static u32 share_count_pdm;
static u32 share_count_spdif;
static const char * const a55_core_sels[] = {"a55_alt", "arm_pll"}; static const char * const a55_core_sels[] = {"a55_alt", "arm_pll"};
static const char *parent_names[MAX_SEL][4] = { static const char *parent_names[MAX_SEL][4] = {
@ -70,8 +71,8 @@ static const struct imx93_clk_root {
{ IMX93_CLK_WAKEUP_AXI, "wakeup_axi_root", 0x0380, FAST_SEL, CLK_IS_CRITICAL }, { IMX93_CLK_WAKEUP_AXI, "wakeup_axi_root", 0x0380, FAST_SEL, CLK_IS_CRITICAL },
{ IMX93_CLK_SWO_TRACE, "swo_trace_root", 0x0400, LOW_SPEED_IO_SEL, }, { IMX93_CLK_SWO_TRACE, "swo_trace_root", 0x0400, LOW_SPEED_IO_SEL, },
{ IMX93_CLK_M33_SYSTICK, "m33_systick_root", 0x0480, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, }, { IMX93_CLK_M33_SYSTICK, "m33_systick_root", 0x0480, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, },
{ IMX93_CLK_FLEXIO1, "flexio1_root", 0x0500, LOW_SPEED_IO_SEL, }, { IMX93_CLK_FLEXIO1, "flexio1_root", 0x0500, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, },
{ IMX93_CLK_FLEXIO2, "flexio2_root", 0x0580, LOW_SPEED_IO_SEL, }, { IMX93_CLK_FLEXIO2, "flexio2_root", 0x0580, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, },
{ IMX93_CLK_LPTMR1, "lptmr1_root", 0x0700, LOW_SPEED_IO_SEL, }, { IMX93_CLK_LPTMR1, "lptmr1_root", 0x0700, LOW_SPEED_IO_SEL, },
{ IMX93_CLK_LPTMR2, "lptmr2_root", 0x0780, LOW_SPEED_IO_SEL, }, { IMX93_CLK_LPTMR2, "lptmr2_root", 0x0780, LOW_SPEED_IO_SEL, },
{ IMX93_CLK_TPM2, "tpm2_root", 0x0880, TPM_SEL, }, { IMX93_CLK_TPM2, "tpm2_root", 0x0880, TPM_SEL, },
@ -177,10 +178,10 @@ static const struct imx93_clk_ccgr {
{ IMX93_CLK_WDOG5_GATE, "wdog5", "osc_24m", 0x8400, }, { IMX93_CLK_WDOG5_GATE, "wdog5", "osc_24m", 0x8400, },
{ IMX93_CLK_SEMA1_GATE, "sema1", "bus_aon_root", 0x8440, }, { IMX93_CLK_SEMA1_GATE, "sema1", "bus_aon_root", 0x8440, },
{ IMX93_CLK_SEMA2_GATE, "sema2", "bus_wakeup_root", 0x8480, }, { IMX93_CLK_SEMA2_GATE, "sema2", "bus_wakeup_root", 0x8480, },
{ IMX93_CLK_MU1_A_GATE, "mu1_a", "bus_aon_root", 0x84c0, CLK_IGNORE_UNUSED }, { IMX93_CLK_MU1_A_GATE, "mu1_a", "bus_aon_root", 0x84c0, CLK_IGNORE_UNUSED, NULL, PLAT_IMX93 },
{ IMX93_CLK_MU2_A_GATE, "mu2_a", "bus_wakeup_root", 0x84c0, CLK_IGNORE_UNUSED }, { IMX93_CLK_MU2_A_GATE, "mu2_a", "bus_wakeup_root", 0x84c0, CLK_IGNORE_UNUSED, NULL, PLAT_IMX93 },
{ IMX93_CLK_MU1_B_GATE, "mu1_b", "bus_aon_root", 0x8500, 0, &share_count_mub }, { IMX93_CLK_MU1_B_GATE, "mu1_b", "bus_aon_root", 0x8500, 0, &share_count_mub, PLAT_IMX93 },
{ IMX93_CLK_MU2_B_GATE, "mu2_b", "bus_wakeup_root", 0x8500, 0, &share_count_mub }, { IMX93_CLK_MU2_B_GATE, "mu2_b", "bus_wakeup_root", 0x8500, 0, &share_count_mub, PLAT_IMX93 },
{ IMX93_CLK_EDMA1_GATE, "edma1", "m33_root", 0x8540, }, { IMX93_CLK_EDMA1_GATE, "edma1", "m33_root", 0x8540, },
{ IMX93_CLK_EDMA2_GATE, "edma2", "wakeup_axi_root", 0x8580, }, { IMX93_CLK_EDMA2_GATE, "edma2", "wakeup_axi_root", 0x8580, },
{ IMX93_CLK_FLEXSPI1_GATE, "flexspi1", "flexspi1_root", 0x8640, }, { IMX93_CLK_FLEXSPI1_GATE, "flexspi1", "flexspi1_root", 0x8640, },
@ -188,8 +189,8 @@ static const struct imx93_clk_ccgr {
{ IMX93_CLK_GPIO2_GATE, "gpio2", "bus_wakeup_root", 0x88c0, }, { IMX93_CLK_GPIO2_GATE, "gpio2", "bus_wakeup_root", 0x88c0, },
{ IMX93_CLK_GPIO3_GATE, "gpio3", "bus_wakeup_root", 0x8900, }, { IMX93_CLK_GPIO3_GATE, "gpio3", "bus_wakeup_root", 0x8900, },
{ IMX93_CLK_GPIO4_GATE, "gpio4", "bus_wakeup_root", 0x8940, }, { IMX93_CLK_GPIO4_GATE, "gpio4", "bus_wakeup_root", 0x8940, },
{ IMX93_CLK_FLEXIO1_GATE, "flexio1", "flexio1_root", 0x8980, }, { IMX93_CLK_FLEXIO1_GATE, "flexio1", "flexio1_root", 0x8980, 0, NULL, PLAT_IMX93},
{ IMX93_CLK_FLEXIO2_GATE, "flexio2", "flexio2_root", 0x89c0, }, { IMX93_CLK_FLEXIO2_GATE, "flexio2", "flexio2_root", 0x89c0, 0, NULL, PLAT_IMX93},
{ IMX93_CLK_LPIT1_GATE, "lpit1", "bus_aon_root", 0x8a00, }, { IMX93_CLK_LPIT1_GATE, "lpit1", "bus_aon_root", 0x8a00, },
{ IMX93_CLK_LPIT2_GATE, "lpit2", "bus_wakeup_root", 0x8a40, }, { IMX93_CLK_LPIT2_GATE, "lpit2", "bus_wakeup_root", 0x8a40, },
{ IMX93_CLK_LPTMR1_GATE, "lptmr1", "lptmr1_root", 0x8a80, }, { IMX93_CLK_LPTMR1_GATE, "lptmr1", "lptmr1_root", 0x8a80, },
@ -238,10 +239,10 @@ static const struct imx93_clk_ccgr {
{ IMX93_CLK_SAI3_GATE, "sai3", "sai3_root", 0x94c0, 0, &share_count_sai3}, { IMX93_CLK_SAI3_GATE, "sai3", "sai3_root", 0x94c0, 0, &share_count_sai3},
{ IMX93_CLK_SAI3_IPG, "sai3_ipg_clk", "bus_wakeup_root", 0x94c0, 0, &share_count_sai3}, { IMX93_CLK_SAI3_IPG, "sai3_ipg_clk", "bus_wakeup_root", 0x94c0, 0, &share_count_sai3},
{ IMX93_CLK_MIPI_CSI_GATE, "mipi_csi", "media_apb_root", 0x9580, }, { IMX93_CLK_MIPI_CSI_GATE, "mipi_csi", "media_apb_root", 0x9580, },
{ IMX93_CLK_MIPI_DSI_GATE, "mipi_dsi", "media_apb_root", 0x95c0, }, { IMX93_CLK_MIPI_DSI_GATE, "mipi_dsi", "media_apb_root", 0x95c0, 0, NULL, PLAT_IMX93 },
{ IMX93_CLK_LVDS_GATE, "lvds", "media_ldb_root", 0x9600, }, { IMX93_CLK_LVDS_GATE, "lvds", "media_ldb_root", 0x9600, 0, NULL, PLAT_IMX93 },
{ IMX93_CLK_LCDIF_GATE, "lcdif", "media_apb_root", 0x9640, }, { IMX93_CLK_LCDIF_GATE, "lcdif", "media_apb_root", 0x9640, },
{ IMX93_CLK_PXP_GATE, "pxp", "media_apb_root", 0x9680, }, { IMX93_CLK_PXP_GATE, "pxp", "media_apb_root", 0x9680, 0, NULL, PLAT_IMX93 },
{ IMX93_CLK_ISI_GATE, "isi", "media_apb_root", 0x96c0, }, { IMX93_CLK_ISI_GATE, "isi", "media_apb_root", 0x96c0, },
{ IMX93_CLK_NIC_MEDIA_GATE, "nic_media", "media_axi_root", 0x9700, }, { IMX93_CLK_NIC_MEDIA_GATE, "nic_media", "media_axi_root", 0x9700, },
{ IMX93_CLK_USB_CONTROLLER_GATE, "usb_controller", "hsio_root", 0x9a00, }, { IMX93_CLK_USB_CONTROLLER_GATE, "usb_controller", "hsio_root", 0x9a00, },
@ -252,12 +253,13 @@ static const struct imx93_clk_ccgr {
{ IMX93_CLK_MQS1_GATE, "mqs1", "sai1_root", 0x9b00, }, { IMX93_CLK_MQS1_GATE, "mqs1", "sai1_root", 0x9b00, },
{ IMX93_CLK_MQS2_GATE, "mqs2", "sai3_root", 0x9b40, }, { IMX93_CLK_MQS2_GATE, "mqs2", "sai3_root", 0x9b40, },
{ IMX93_CLK_AUD_XCVR_GATE, "aud_xcvr", "audio_xcvr_root", 0x9b80, }, { IMX93_CLK_AUD_XCVR_GATE, "aud_xcvr", "audio_xcvr_root", 0x9b80, },
{ IMX93_CLK_SPDIF_GATE, "spdif", "spdif_root", 0x9c00, }, { IMX93_CLK_SPDIF_IPG, "spdif_ipg_clk", "bus_wakeup_root", 0x9c00, 0, &share_count_spdif},
{ IMX93_CLK_SPDIF_GATE, "spdif", "spdif_root", 0x9c00, 0, &share_count_spdif},
{ IMX93_CLK_HSIO_32K_GATE, "hsio_32k", "osc_32k", 0x9dc0, }, { IMX93_CLK_HSIO_32K_GATE, "hsio_32k", "osc_32k", 0x9dc0, },
{ IMX93_CLK_ENET1_GATE, "enet1", "wakeup_axi_root", 0x9e00, 0, NULL, PLAT_IMX93, }, { IMX93_CLK_ENET1_GATE, "enet1", "wakeup_axi_root", 0x9e00, 0, NULL, PLAT_IMX93, },
{ IMX93_CLK_ENET_QOS_GATE, "enet_qos", "wakeup_axi_root", 0x9e40, 0, NULL, PLAT_IMX93, }, { IMX93_CLK_ENET_QOS_GATE, "enet_qos", "wakeup_axi_root", 0x9e40, 0, NULL, PLAT_IMX93, },
{ IMX91_CLK_ENET2_REGULAR_GATE, "enet2_regular", "wakeup_axi_root", 0x9e00, 0, NULL, PLAT_IMX91, }, { IMX91_CLK_ENET2_REGULAR_GATE, "enet2_regular", "wakeup_axi_root", 0x9e00, 0, NULL, PLAT_IMX91, },
{ IMX91_CLK_ENET1_QOS_TSN_GATE, "enet1_qos_tsn", "wakeup_axi_root", 0x9e40, 0, NULL, PLAT_IMX91, }, { IMX91_CLK_ENET1_QOS_TSN_GATE, "enet1_qos_tsn", "wakeup_axi_root", 0x9e40, 0, NULL, PLAT_IMX91, },
/* Critical because clk accessed during CPU idle */ /* Critical because clk accessed during CPU idle */
{ IMX93_CLK_SYS_CNT_GATE, "sys_cnt", "osc_24m", 0x9e80, CLK_IS_CRITICAL}, { IMX93_CLK_SYS_CNT_GATE, "sys_cnt", "osc_24m", 0x9e80, CLK_IS_CRITICAL},
{ IMX93_CLK_TSTMR1_GATE, "tstmr1", "bus_aon_root", 0x9ec0, }, { IMX93_CLK_TSTMR1_GATE, "tstmr1", "bus_aon_root", 0x9ec0, },

View File

@ -56,7 +56,9 @@ static const struct imx_pll14xx_rate_table imx_pll1416x_tbl[] = {
PLL_1416X_RATE(700000000U, 350, 3, 2), PLL_1416X_RATE(700000000U, 350, 3, 2),
PLL_1416X_RATE(640000000U, 320, 3, 2), PLL_1416X_RATE(640000000U, 320, 3, 2),
PLL_1416X_RATE(600000000U, 300, 3, 2), PLL_1416X_RATE(600000000U, 300, 3, 2),
PLL_1416X_RATE(416000000U, 208, 3, 2),
PLL_1416X_RATE(320000000U, 160, 3, 2), PLL_1416X_RATE(320000000U, 160, 3, 2),
PLL_1416X_RATE(208000000U, 208, 3, 3),
}; };
static const struct imx_pll14xx_rate_table imx_pll1443x_tbl[] = { static const struct imx_pll14xx_rate_table imx_pll1443x_tbl[] = {

View File

@ -64,6 +64,15 @@ config CLK_X1E80100_TCSRCC
Support for the TCSR clock controller on X1E80100 devices. Support for the TCSR clock controller on X1E80100 devices.
Say Y if you want to use peripheral devices such as SD/UFS. Say Y if you want to use peripheral devices such as SD/UFS.
config CLK_X1P42100_GPUCC
tristate "X1P42100 Graphics Clock Controller"
depends on ARM64 || COMPILE_TEST
select CLK_X1E80100_GCC
help
Support for the graphics clock controller on X1P42100 devices.
Say Y if you want to support graphics controller devices and
functionality such as 3D graphics.
config CLK_QCM2290_GPUCC config CLK_QCM2290_GPUCC
tristate "QCM2290 Graphics Clock Controller" tristate "QCM2290 Graphics Clock Controller"
depends on ARM64 || COMPILE_TEST depends on ARM64 || COMPILE_TEST
@ -190,6 +199,15 @@ config IPQ_APSS_6018
Say Y if you want to support CPU frequency scaling on Say Y if you want to support CPU frequency scaling on
ipq based devices. ipq based devices.
config IPQ_CMN_PLL
tristate "IPQ CMN PLL Clock Controller"
help
Support for CMN PLL clock controller on IPQ platform. The
CMN PLL consumes the AHB/SYS clocks from GCC and supplies
the output clocks to the networking hardware and GCC blocks.
Say Y or M if you want to support CMN PLL clock on the IPQ
based devices.
config IPQ_GCC_4019 config IPQ_GCC_4019
tristate "IPQ4019 Global Clock Controller" tristate "IPQ4019 Global Clock Controller"
help help
@ -495,6 +513,15 @@ config QCS_GCC_8300
Say Y if you want to use peripheral devices such as UART, Say Y if you want to use peripheral devices such as UART,
SPI, I2C, USB, SD/UFS, PCIe etc. SPI, I2C, USB, SD/UFS, PCIe etc.
config QCS_GCC_615
tristate "QCS615 Global Clock Controller"
depends on ARM64 || COMPILE_TEST
select QCOM_GDSC
help
Support for the global clock controller on QCS615 devices.
Say Y if you want to use multimedia devices or peripheral
devices such as UART, SPI, I2C, USB, SD/eMMC, PCIe etc.
config SC_CAMCC_7180 config SC_CAMCC_7180
tristate "SC7180 Camera Clock Controller" tristate "SC7180 Camera Clock Controller"
depends on ARM64 || COMPILE_TEST depends on ARM64 || COMPILE_TEST
@ -1022,6 +1049,17 @@ config SM_DISPCC_8550
Say Y if you want to support display devices and functionality such as Say Y if you want to support display devices and functionality such as
splash screen. splash screen.
config SM_DISPCC_8750
tristate "SM8750 Display Clock Controller"
depends on ARM64 || COMPILE_TEST
depends on SM_GCC_8750
select QCOM_GDSC
help
Support for the display clock controller on Qualcomm Technologies, Inc
SM8750 devices.
Say Y if you want to support display devices and functionality such as
splash screen.
config SM_GCC_4450 config SM_GCC_4450
tristate "SM4450 Global Clock Controller" tristate "SM4450 Global Clock Controller"
depends on ARM64 || COMPILE_TEST depends on ARM64 || COMPILE_TEST
@ -1079,6 +1117,7 @@ config SM_GCC_7150
config SM_GCC_8150 config SM_GCC_8150
tristate "SM8150 Global Clock Controller" tristate "SM8150 Global Clock Controller"
depends on ARM64 || COMPILE_TEST depends on ARM64 || COMPILE_TEST
select QCOM_GDSC
help help
Support for the global clock controller on SM8150 devices. Support for the global clock controller on SM8150 devices.
Say Y if you want to use peripheral devices such as UART, Say Y if you want to use peripheral devices such as UART,
@ -1130,6 +1169,15 @@ config SM_GCC_8650
Say Y if you want to use peripheral devices such as UART, Say Y if you want to use peripheral devices such as UART,
SPI, I2C, USB, SD/UFS, PCIe etc. SPI, I2C, USB, SD/UFS, PCIe etc.
config SM_GCC_8750
tristate "SM8750 Global Clock Controller"
depends on ARM64 || COMPILE_TEST
select QCOM_GDSC
help
Support for the global clock controller on SM8750 devices.
Say Y if you want to use peripheral devices such as UART,
SPI, I2C, USB, SD/UFS, PCIe etc.
config SM_GPUCC_4450 config SM_GPUCC_4450
tristate "SM4450 Graphics Clock Controller" tristate "SM4450 Graphics Clock Controller"
depends on ARM64 || COMPILE_TEST depends on ARM64 || COMPILE_TEST
@ -1230,6 +1278,15 @@ config SM_GPUCC_8650
Say Y if you want to support graphics controller devices and Say Y if you want to support graphics controller devices and
functionality such as 3D graphics. functionality such as 3D graphics.
config SM_LPASSCC_6115
tristate "SM6115 Low Power Audio Subsystem (LPASS) Clock Controller"
depends on ARM64 || COMPILE_TEST
select SM_GCC_6115
help
Support for the LPASS clock controller on SM6115 devices.
Say Y if you want to toggle LPASS-adjacent resets within
this clock controller to reset the LPASS subsystem.
config SM_TCSRCC_8550 config SM_TCSRCC_8550
tristate "SM8550 TCSR Clock Controller" tristate "SM8550 TCSR Clock Controller"
depends on ARM64 || COMPILE_TEST depends on ARM64 || COMPILE_TEST
@ -1246,6 +1303,14 @@ config SM_TCSRCC_8650
Support for the TCSR clock controller on SM8650 devices. Support for the TCSR clock controller on SM8650 devices.
Say Y if you want to use peripheral devices such as SD/UFS. Say Y if you want to use peripheral devices such as SD/UFS.
config SM_TCSRCC_8750
tristate "SM8750 TCSR Clock Controller"
depends on ARM64 || COMPILE_TEST
select QCOM_GDSC
help
Support for the TCSR clock controller on SM8750 devices.
Say Y if you want to use peripheral devices such as UFS/USB/PCIe.
config SA_VIDEOCC_8775P config SA_VIDEOCC_8775P
tristate "SA8775P Video Clock Controller" tristate "SA8775P Video Clock Controller"
depends on ARM64 || COMPILE_TEST depends on ARM64 || COMPILE_TEST

View File

@ -26,9 +26,11 @@ obj-$(CONFIG_CLK_X1E80100_DISPCC) += dispcc-x1e80100.o
obj-$(CONFIG_CLK_X1E80100_GCC) += gcc-x1e80100.o obj-$(CONFIG_CLK_X1E80100_GCC) += gcc-x1e80100.o
obj-$(CONFIG_CLK_X1E80100_GPUCC) += gpucc-x1e80100.o obj-$(CONFIG_CLK_X1E80100_GPUCC) += gpucc-x1e80100.o
obj-$(CONFIG_CLK_X1E80100_TCSRCC) += tcsrcc-x1e80100.o obj-$(CONFIG_CLK_X1E80100_TCSRCC) += tcsrcc-x1e80100.o
obj-$(CONFIG_CLK_X1P42100_GPUCC) += gpucc-x1p42100.o
obj-$(CONFIG_CLK_QCM2290_GPUCC) += gpucc-qcm2290.o obj-$(CONFIG_CLK_QCM2290_GPUCC) += gpucc-qcm2290.o
obj-$(CONFIG_IPQ_APSS_PLL) += apss-ipq-pll.o obj-$(CONFIG_IPQ_APSS_PLL) += apss-ipq-pll.o
obj-$(CONFIG_IPQ_APSS_6018) += apss-ipq6018.o obj-$(CONFIG_IPQ_APSS_6018) += apss-ipq6018.o
obj-$(CONFIG_IPQ_CMN_PLL) += ipq-cmn-pll.o
obj-$(CONFIG_IPQ_GCC_4019) += gcc-ipq4019.o obj-$(CONFIG_IPQ_GCC_4019) += gcc-ipq4019.o
obj-$(CONFIG_IPQ_GCC_5018) += gcc-ipq5018.o obj-$(CONFIG_IPQ_GCC_5018) += gcc-ipq5018.o
obj-$(CONFIG_IPQ_GCC_5332) += gcc-ipq5332.o obj-$(CONFIG_IPQ_GCC_5332) += gcc-ipq5332.o
@ -71,6 +73,7 @@ obj-$(CONFIG_QCOM_CLK_SMD_RPM) += clk-smd-rpm.o
obj-$(CONFIG_QCM_GCC_2290) += gcc-qcm2290.o obj-$(CONFIG_QCM_GCC_2290) += gcc-qcm2290.o
obj-$(CONFIG_QCM_DISPCC_2290) += dispcc-qcm2290.o obj-$(CONFIG_QCM_DISPCC_2290) += dispcc-qcm2290.o
obj-$(CONFIG_QCS_GCC_404) += gcc-qcs404.o obj-$(CONFIG_QCS_GCC_404) += gcc-qcs404.o
obj-$(CONFIG_QCS_GCC_615) += gcc-qcs615.o
obj-$(CONFIG_QCS_GCC_8300) += gcc-qcs8300.o obj-$(CONFIG_QCS_GCC_8300) += gcc-qcs8300.o
obj-$(CONFIG_QCS_Q6SSTOP_404) += q6sstop-qcs404.o obj-$(CONFIG_QCS_Q6SSTOP_404) += q6sstop-qcs404.o
obj-$(CONFIG_QCS_TURING_404) += turingcc-qcs404.o obj-$(CONFIG_QCS_TURING_404) += turingcc-qcs404.o
@ -131,6 +134,7 @@ obj-$(CONFIG_SM_DISPCC_7150) += dispcc-sm7150.o
obj-$(CONFIG_SM_DISPCC_8250) += dispcc-sm8250.o obj-$(CONFIG_SM_DISPCC_8250) += dispcc-sm8250.o
obj-$(CONFIG_SM_DISPCC_8450) += dispcc-sm8450.o obj-$(CONFIG_SM_DISPCC_8450) += dispcc-sm8450.o
obj-$(CONFIG_SM_DISPCC_8550) += dispcc-sm8550.o obj-$(CONFIG_SM_DISPCC_8550) += dispcc-sm8550.o
obj-$(CONFIG_SM_DISPCC_8750) += dispcc-sm8750.o
obj-$(CONFIG_SM_GCC_4450) += gcc-sm4450.o obj-$(CONFIG_SM_GCC_4450) += gcc-sm4450.o
obj-$(CONFIG_SM_GCC_6115) += gcc-sm6115.o obj-$(CONFIG_SM_GCC_6115) += gcc-sm6115.o
obj-$(CONFIG_SM_GCC_6125) += gcc-sm6125.o obj-$(CONFIG_SM_GCC_6125) += gcc-sm6125.o
@ -143,6 +147,7 @@ obj-$(CONFIG_SM_GCC_8350) += gcc-sm8350.o
obj-$(CONFIG_SM_GCC_8450) += gcc-sm8450.o obj-$(CONFIG_SM_GCC_8450) += gcc-sm8450.o
obj-$(CONFIG_SM_GCC_8550) += gcc-sm8550.o obj-$(CONFIG_SM_GCC_8550) += gcc-sm8550.o
obj-$(CONFIG_SM_GCC_8650) += gcc-sm8650.o obj-$(CONFIG_SM_GCC_8650) += gcc-sm8650.o
obj-$(CONFIG_SM_GCC_8750) += gcc-sm8750.o
obj-$(CONFIG_SM_GPUCC_4450) += gpucc-sm4450.o obj-$(CONFIG_SM_GPUCC_4450) += gpucc-sm4450.o
obj-$(CONFIG_SM_GPUCC_6115) += gpucc-sm6115.o obj-$(CONFIG_SM_GPUCC_6115) += gpucc-sm6115.o
obj-$(CONFIG_SM_GPUCC_6125) += gpucc-sm6125.o obj-$(CONFIG_SM_GPUCC_6125) += gpucc-sm6125.o
@ -154,8 +159,10 @@ obj-$(CONFIG_SM_GPUCC_8350) += gpucc-sm8350.o
obj-$(CONFIG_SM_GPUCC_8450) += gpucc-sm8450.o obj-$(CONFIG_SM_GPUCC_8450) += gpucc-sm8450.o
obj-$(CONFIG_SM_GPUCC_8550) += gpucc-sm8550.o obj-$(CONFIG_SM_GPUCC_8550) += gpucc-sm8550.o
obj-$(CONFIG_SM_GPUCC_8650) += gpucc-sm8650.o obj-$(CONFIG_SM_GPUCC_8650) += gpucc-sm8650.o
obj-$(CONFIG_SM_LPASSCC_6115) += lpasscc-sm6115.o
obj-$(CONFIG_SM_TCSRCC_8550) += tcsrcc-sm8550.o obj-$(CONFIG_SM_TCSRCC_8550) += tcsrcc-sm8550.o
obj-$(CONFIG_SM_TCSRCC_8650) += tcsrcc-sm8650.o obj-$(CONFIG_SM_TCSRCC_8650) += tcsrcc-sm8650.o
obj-$(CONFIG_SM_TCSRCC_8750) += tcsrcc-sm8750.o
obj-$(CONFIG_SM_VIDEOCC_7150) += videocc-sm7150.o obj-$(CONFIG_SM_VIDEOCC_7150) += videocc-sm7150.o
obj-$(CONFIG_SM_VIDEOCC_8150) += videocc-sm8150.o obj-$(CONFIG_SM_VIDEOCC_8150) += videocc-sm8150.o
obj-$(CONFIG_SM_VIDEOCC_8250) += videocc-sm8250.o obj-$(CONFIG_SM_VIDEOCC_8250) += videocc-sm8250.o

View File

@ -73,20 +73,19 @@ static const struct alpha_pll_config ipq5018_pll_config = {
.main_output_mask = BIT(0), .main_output_mask = BIT(0),
.aux_output_mask = BIT(1), .aux_output_mask = BIT(1),
.early_output_mask = BIT(3), .early_output_mask = BIT(3),
.alpha_en_mask = BIT(24),
.status_val = 0x3, .status_val = 0x3,
.status_mask = GENMASK(10, 8), .status_mask = GENMASK(10, 8),
.lock_det = BIT(2), .lock_det = BIT(2),
.test_ctl_hi_val = 0x00400003, .test_ctl_hi_val = 0x00400003,
}; };
/* 1.080 GHz configuration */
static const struct alpha_pll_config ipq5332_pll_config = { static const struct alpha_pll_config ipq5332_pll_config = {
.l = 0x2d, .l = 0x2d,
.config_ctl_val = 0x4001075b, .config_ctl_val = 0x4001075b,
.main_output_mask = BIT(0), .main_output_mask = BIT(0),
.aux_output_mask = BIT(1), .aux_output_mask = BIT(1),
.early_output_mask = BIT(3), .early_output_mask = BIT(3),
.alpha_en_mask = BIT(24),
.status_val = 0x3, .status_val = 0x3,
.status_mask = GENMASK(10, 8), .status_mask = GENMASK(10, 8),
.lock_det = BIT(2), .lock_det = BIT(2),

View File

@ -2212,6 +2212,8 @@ static struct clk_branch cam_cc_sfe_0_fast_ahb_clk = {
}, },
}; };
static struct gdsc cam_cc_titan_top_gdsc;
static struct gdsc cam_cc_bps_gdsc = { static struct gdsc cam_cc_bps_gdsc = {
.gdscr = 0x10004, .gdscr = 0x10004,
.en_rest_wait_val = 0x2, .en_rest_wait_val = 0x2,
@ -2221,6 +2223,7 @@ static struct gdsc cam_cc_bps_gdsc = {
.name = "cam_cc_bps_gdsc", .name = "cam_cc_bps_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_OFF_ON,
.parent = &cam_cc_titan_top_gdsc.pd,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
}; };
@ -2233,6 +2236,7 @@ static struct gdsc cam_cc_ife_0_gdsc = {
.name = "cam_cc_ife_0_gdsc", .name = "cam_cc_ife_0_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_OFF_ON,
.parent = &cam_cc_titan_top_gdsc.pd,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
}; };
@ -2245,6 +2249,7 @@ static struct gdsc cam_cc_ife_1_gdsc = {
.name = "cam_cc_ife_1_gdsc", .name = "cam_cc_ife_1_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_OFF_ON,
.parent = &cam_cc_titan_top_gdsc.pd,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
}; };
@ -2257,6 +2262,7 @@ static struct gdsc cam_cc_ipe_0_gdsc = {
.name = "cam_cc_ipe_0_gdsc", .name = "cam_cc_ipe_0_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_OFF_ON,
.parent = &cam_cc_titan_top_gdsc.pd,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
}; };
@ -2269,6 +2275,7 @@ static struct gdsc cam_cc_sfe_0_gdsc = {
.name = "cam_cc_sfe_0_gdsc", .name = "cam_cc_sfe_0_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_OFF_ON,
.parent = &cam_cc_titan_top_gdsc.pd,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
}; };

View File

@ -58,6 +58,7 @@
#define PLL_TEST_CTL_U(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U]) #define PLL_TEST_CTL_U(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U])
#define PLL_TEST_CTL_U1(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U1]) #define PLL_TEST_CTL_U1(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U1])
#define PLL_TEST_CTL_U2(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U2]) #define PLL_TEST_CTL_U2(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U2])
#define PLL_TEST_CTL_U3(p) ((p)->offset + (p)->regs[PLL_OFF_TEST_CTL_U3])
#define PLL_STATUS(p) ((p)->offset + (p)->regs[PLL_OFF_STATUS]) #define PLL_STATUS(p) ((p)->offset + (p)->regs[PLL_OFF_STATUS])
#define PLL_OPMODE(p) ((p)->offset + (p)->regs[PLL_OFF_OPMODE]) #define PLL_OPMODE(p) ((p)->offset + (p)->regs[PLL_OFF_OPMODE])
#define PLL_FRAC(p) ((p)->offset + (p)->regs[PLL_OFF_FRAC]) #define PLL_FRAC(p) ((p)->offset + (p)->regs[PLL_OFF_FRAC])
@ -197,6 +198,37 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = {
[PLL_OFF_TEST_CTL_U1] = 0x34, [PLL_OFF_TEST_CTL_U1] = 0x34,
[PLL_OFF_TEST_CTL_U2] = 0x38, [PLL_OFF_TEST_CTL_U2] = 0x38,
}, },
[CLK_ALPHA_PLL_TYPE_PONGO_ELU] = {
[PLL_OFF_OPMODE] = 0x04,
[PLL_OFF_STATE] = 0x08,
[PLL_OFF_STATUS] = 0x0c,
[PLL_OFF_L_VAL] = 0x10,
[PLL_OFF_USER_CTL] = 0x14,
[PLL_OFF_USER_CTL_U] = 0x18,
[PLL_OFF_CONFIG_CTL] = 0x1c,
[PLL_OFF_CONFIG_CTL_U] = 0x20,
[PLL_OFF_CONFIG_CTL_U1] = 0x24,
[PLL_OFF_CONFIG_CTL_U2] = 0x28,
[PLL_OFF_TEST_CTL] = 0x2c,
[PLL_OFF_TEST_CTL_U] = 0x30,
[PLL_OFF_TEST_CTL_U1] = 0x34,
[PLL_OFF_TEST_CTL_U2] = 0x38,
[PLL_OFF_TEST_CTL_U3] = 0x3c,
},
[CLK_ALPHA_PLL_TYPE_TAYCAN_ELU] = {
[PLL_OFF_OPMODE] = 0x04,
[PLL_OFF_STATE] = 0x08,
[PLL_OFF_STATUS] = 0x0c,
[PLL_OFF_L_VAL] = 0x10,
[PLL_OFF_ALPHA_VAL] = 0x14,
[PLL_OFF_USER_CTL] = 0x18,
[PLL_OFF_USER_CTL_U] = 0x1c,
[PLL_OFF_CONFIG_CTL] = 0x20,
[PLL_OFF_CONFIG_CTL_U] = 0x24,
[PLL_OFF_CONFIG_CTL_U1] = 0x28,
[PLL_OFF_TEST_CTL] = 0x2c,
[PLL_OFF_TEST_CTL_U] = 0x30,
},
[CLK_ALPHA_PLL_TYPE_RIVIAN_EVO] = { [CLK_ALPHA_PLL_TYPE_RIVIAN_EVO] = {
[PLL_OFF_OPMODE] = 0x04, [PLL_OFF_OPMODE] = 0x04,
[PLL_OFF_STATUS] = 0x0c, [PLL_OFF_STATUS] = 0x0c,
@ -323,6 +355,12 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);
#define LUCID_EVO_PLL_CAL_L_VAL_SHIFT 16 #define LUCID_EVO_PLL_CAL_L_VAL_SHIFT 16
#define LUCID_OLE_PLL_RINGOSC_CAL_L_VAL_SHIFT 24 #define LUCID_OLE_PLL_RINGOSC_CAL_L_VAL_SHIFT 24
/* PONGO ELU PLL specific setting and offsets */
#define PONGO_PLL_OUT_MASK GENMASK(1, 0)
#define PONGO_PLL_L_VAL_MASK GENMASK(11, 0)
#define PONGO_XO_PRESENT BIT(10)
#define PONGO_CLOCK_SELECT BIT(12)
/* ZONDA PLL specific */ /* ZONDA PLL specific */
#define ZONDA_PLL_OUT_MASK 0xf #define ZONDA_PLL_OUT_MASK 0xf
#define ZONDA_STAY_IN_CFA BIT(16) #define ZONDA_STAY_IN_CFA BIT(16)
@ -352,7 +390,8 @@ static int wait_for_pll(struct clk_alpha_pll *pll, u32 mask, bool inverse,
if (ret) if (ret)
return ret; return ret;
for (count = 200; count > 0; count--) { /* Pongo PLLs using a 32KHz reference can take upwards of 1500us to lock. */
for (count = 1500; count > 0; count--) {
ret = regmap_read(pll->clkr.regmap, PLL_MODE(pll), &val); ret = regmap_read(pll->clkr.regmap, PLL_MODE(pll), &val);
if (ret) if (ret)
return ret; return ret;
@ -432,6 +471,8 @@ void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
mask |= config->pre_div_mask; mask |= config->pre_div_mask;
mask |= config->post_div_mask; mask |= config->post_div_mask;
mask |= config->vco_mask; mask |= config->vco_mask;
mask |= config->alpha_en_mask;
mask |= config->alpha_mode_mask;
regmap_update_bits(regmap, PLL_USER_CTL(pll), mask, val); regmap_update_bits(regmap, PLL_USER_CTL(pll), mask, val);
@ -2494,6 +2535,144 @@ const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops = {
}; };
EXPORT_SYMBOL_GPL(clk_alpha_pll_reset_lucid_evo_ops); EXPORT_SYMBOL_GPL(clk_alpha_pll_reset_lucid_evo_ops);
static int alpha_pll_pongo_elu_prepare(struct clk_hw *hw)
{
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
struct regmap *regmap = pll->clkr.regmap;
int ret;
/* Enable PLL intially to one-time calibrate against XO. */
regmap_write(regmap, PLL_OPMODE(pll), PLL_RUN);
regmap_update_bits(regmap, PLL_MODE(pll), PLL_RESET_N, PLL_RESET_N);
regmap_update_bits(regmap, PLL_MODE(pll), PONGO_XO_PRESENT, PONGO_XO_PRESENT);
/* Set regmap for wait_for_pll() */
pll->clkr.regmap = regmap;
ret = wait_for_pll_enable_lock(pll);
if (ret) {
/* Reverse calibration - disable PLL output */
regmap_update_bits(regmap, PLL_MODE(pll), PLL_OUTCTRL, 0);
return ret;
}
/* Disable PLL after one-time calibration. */
regmap_write(regmap, PLL_OPMODE(pll), PLL_STANDBY);
/* Select internally generated clock. */
regmap_update_bits(regmap, PLL_MODE(pll), PONGO_CLOCK_SELECT,
PONGO_CLOCK_SELECT);
return 0;
}
static int alpha_pll_pongo_elu_enable(struct clk_hw *hw)
{
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
struct regmap *regmap = pll->clkr.regmap;
int ret;
/* Check if PLL is already enabled */
if (trion_pll_is_enabled(pll, regmap))
return 0;
ret = regmap_update_bits(regmap, PLL_MODE(pll), PLL_RESET_N, PLL_RESET_N);
if (ret)
return ret;
/* Set operation mode to RUN */
regmap_write(regmap, PLL_OPMODE(pll), PLL_RUN);
ret = wait_for_pll_enable_lock(pll);
if (ret)
return ret;
/* Enable the global PLL outputs */
ret = regmap_update_bits(regmap, PLL_MODE(pll), PLL_OUTCTRL, PLL_OUTCTRL);
if (ret)
return ret;
/* Ensure that the write above goes through before returning. */
mb();
return ret;
}
static void alpha_pll_pongo_elu_disable(struct clk_hw *hw)
{
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
struct regmap *regmap = pll->clkr.regmap;
int ret;
/* Disable the global PLL output */
ret = regmap_update_bits(regmap, PLL_MODE(pll), PLL_OUTCTRL, 0);
if (ret)
return;
/* Place the PLL mode in STANDBY */
regmap_write(regmap, PLL_OPMODE(pll), PLL_STANDBY);
}
static unsigned long alpha_pll_pongo_elu_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
struct regmap *regmap = pll->clkr.regmap;
u32 l;
if (regmap_read(regmap, PLL_L_VAL(pll), &l))
return 0;
l &= PONGO_PLL_L_VAL_MASK;
return alpha_pll_calc_rate(parent_rate, l, 0, pll_alpha_width(pll));
}
const struct clk_ops clk_alpha_pll_pongo_elu_ops = {
.prepare = alpha_pll_pongo_elu_prepare,
.enable = alpha_pll_pongo_elu_enable,
.disable = alpha_pll_pongo_elu_disable,
.recalc_rate = alpha_pll_pongo_elu_recalc_rate,
};
EXPORT_SYMBOL_GPL(clk_alpha_pll_pongo_elu_ops);
void clk_pongo_elu_pll_configure(struct clk_alpha_pll *pll,
struct regmap *regmap,
const struct alpha_pll_config *config)
{
u32 val;
regmap_update_bits(regmap, PLL_USER_CTL(pll), PONGO_PLL_OUT_MASK,
PONGO_PLL_OUT_MASK);
if (trion_pll_is_enabled(pll, regmap))
return;
if (regmap_read(regmap, PLL_L_VAL(pll), &val))
return;
val &= PONGO_PLL_L_VAL_MASK;
if (val)
return;
clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l);
clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);
clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL(pll), config->config_ctl_val);
clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U(pll), config->config_ctl_hi_val);
clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U1(pll), config->config_ctl_hi1_val);
clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U2(pll), config->config_ctl_hi2_val);
clk_alpha_pll_write_config(regmap, PLL_USER_CTL(pll),
config->user_ctl_val | PONGO_PLL_OUT_MASK);
clk_alpha_pll_write_config(regmap, PLL_USER_CTL_U(pll), config->user_ctl_hi_val);
clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), config->test_ctl_val);
clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), config->test_ctl_hi_val);
clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll), config->test_ctl_hi1_val);
clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U2(pll), config->test_ctl_hi2_val);
clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U3(pll), config->test_ctl_hi3_val);
/* Disable PLL output */
regmap_update_bits(regmap, PLL_MODE(pll), PLL_OUTCTRL, 0);
}
EXPORT_SYMBOL_GPL(clk_pongo_elu_pll_configure);
void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
const struct alpha_pll_config *config) const struct alpha_pll_config *config)
{ {

View File

@ -27,6 +27,8 @@ enum {
CLK_ALPHA_PLL_TYPE_ZONDA_OLE, CLK_ALPHA_PLL_TYPE_ZONDA_OLE,
CLK_ALPHA_PLL_TYPE_LUCID_EVO, CLK_ALPHA_PLL_TYPE_LUCID_EVO,
CLK_ALPHA_PLL_TYPE_LUCID_OLE, CLK_ALPHA_PLL_TYPE_LUCID_OLE,
CLK_ALPHA_PLL_TYPE_PONGO_ELU,
CLK_ALPHA_PLL_TYPE_TAYCAN_ELU,
CLK_ALPHA_PLL_TYPE_RIVIAN_EVO, CLK_ALPHA_PLL_TYPE_RIVIAN_EVO,
CLK_ALPHA_PLL_TYPE_DEFAULT_EVO, CLK_ALPHA_PLL_TYPE_DEFAULT_EVO,
CLK_ALPHA_PLL_TYPE_BRAMMO_EVO, CLK_ALPHA_PLL_TYPE_BRAMMO_EVO,
@ -52,6 +54,7 @@ enum {
PLL_OFF_TEST_CTL_U, PLL_OFF_TEST_CTL_U,
PLL_OFF_TEST_CTL_U1, PLL_OFF_TEST_CTL_U1,
PLL_OFF_TEST_CTL_U2, PLL_OFF_TEST_CTL_U2,
PLL_OFF_TEST_CTL_U3,
PLL_OFF_STATE, PLL_OFF_STATE,
PLL_OFF_STATUS, PLL_OFF_STATUS,
PLL_OFF_OPMODE, PLL_OFF_OPMODE,
@ -137,6 +140,7 @@ struct alpha_pll_config {
u32 test_ctl_hi_mask; u32 test_ctl_hi_mask;
u32 test_ctl_hi1_val; u32 test_ctl_hi1_val;
u32 test_ctl_hi2_val; u32 test_ctl_hi2_val;
u32 test_ctl_hi3_val;
u32 main_output_mask; u32 main_output_mask;
u32 aux_output_mask; u32 aux_output_mask;
u32 aux2_output_mask; u32 aux2_output_mask;
@ -185,13 +189,17 @@ extern const struct clk_ops clk_alpha_pll_zonda_ops;
#define clk_alpha_pll_zonda_ole_ops clk_alpha_pll_zonda_ops #define clk_alpha_pll_zonda_ole_ops clk_alpha_pll_zonda_ops
extern const struct clk_ops clk_alpha_pll_lucid_evo_ops; extern const struct clk_ops clk_alpha_pll_lucid_evo_ops;
#define clk_alpha_pll_taycan_elu_ops clk_alpha_pll_lucid_evo_ops
extern const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops; extern const struct clk_ops clk_alpha_pll_reset_lucid_evo_ops;
#define clk_alpha_pll_reset_lucid_ole_ops clk_alpha_pll_reset_lucid_evo_ops #define clk_alpha_pll_reset_lucid_ole_ops clk_alpha_pll_reset_lucid_evo_ops
extern const struct clk_ops clk_alpha_pll_fixed_lucid_evo_ops; extern const struct clk_ops clk_alpha_pll_fixed_lucid_evo_ops;
#define clk_alpha_pll_fixed_lucid_ole_ops clk_alpha_pll_fixed_lucid_evo_ops #define clk_alpha_pll_fixed_lucid_ole_ops clk_alpha_pll_fixed_lucid_evo_ops
#define clk_alpha_pll_fixed_taycan_elu_ops clk_alpha_pll_fixed_lucid_evo_ops
extern const struct clk_ops clk_alpha_pll_postdiv_lucid_evo_ops; extern const struct clk_ops clk_alpha_pll_postdiv_lucid_evo_ops;
#define clk_alpha_pll_postdiv_lucid_ole_ops clk_alpha_pll_postdiv_lucid_evo_ops #define clk_alpha_pll_postdiv_lucid_ole_ops clk_alpha_pll_postdiv_lucid_evo_ops
#define clk_alpha_pll_postdiv_taycan_elu_ops clk_alpha_pll_postdiv_lucid_evo_ops
extern const struct clk_ops clk_alpha_pll_pongo_elu_ops;
extern const struct clk_ops clk_alpha_pll_rivian_evo_ops; extern const struct clk_ops clk_alpha_pll_rivian_evo_ops;
#define clk_alpha_pll_postdiv_rivian_evo_ops clk_alpha_pll_postdiv_fabia_ops #define clk_alpha_pll_postdiv_rivian_evo_ops clk_alpha_pll_postdiv_fabia_ops
@ -218,6 +226,11 @@ void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma
const struct alpha_pll_config *config); const struct alpha_pll_config *config);
void clk_lucid_ole_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, void clk_lucid_ole_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
const struct alpha_pll_config *config); const struct alpha_pll_config *config);
void clk_pongo_elu_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
const struct alpha_pll_config *config);
#define clk_taycan_elu_pll_configure(pll, regmap, config) \
clk_lucid_evo_pll_configure(pll, regmap, config)
void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
const struct alpha_pll_config *config); const struct alpha_pll_config *config);
void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,

View File

@ -597,6 +597,7 @@ struct frac_entry {
}; };
static const struct frac_entry pixel_table[] = { static const struct frac_entry pixel_table[] = {
{ 1, 1 },
{ 1, 2 }, { 1, 2 },
{ 1, 3 }, { 1, 3 },
{ 3, 16 }, { 3, 16 },

View File

@ -189,6 +189,7 @@ struct clk_rcg2_gfx3d {
container_of(to_clk_rcg2(_hw), struct clk_rcg2_gfx3d, rcg) container_of(to_clk_rcg2(_hw), struct clk_rcg2_gfx3d, rcg)
extern const struct clk_ops clk_rcg2_ops; extern const struct clk_ops clk_rcg2_ops;
extern const struct clk_ops clk_rcg2_gp_ops;
extern const struct clk_ops clk_rcg2_floor_ops; extern const struct clk_ops clk_rcg2_floor_ops;
extern const struct clk_ops clk_rcg2_fm_ops; extern const struct clk_ops clk_rcg2_fm_ops;
extern const struct clk_ops clk_rcg2_mux_closest_ops; extern const struct clk_ops clk_rcg2_mux_closest_ops;

View File

@ -8,11 +8,13 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/bug.h> #include <linux/bug.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/clk.h>
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/rational.h> #include <linux/rational.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/math64.h> #include <linux/math64.h>
#include <linux/gcd.h>
#include <linux/minmax.h> #include <linux/minmax.h>
#include <linux/slab.h> #include <linux/slab.h>
@ -32,6 +34,7 @@
#define CFG_REG 0x4 #define CFG_REG 0x4
#define CFG_SRC_DIV_SHIFT 0 #define CFG_SRC_DIV_SHIFT 0
#define CFG_SRC_DIV_LENGTH 8
#define CFG_SRC_SEL_SHIFT 8 #define CFG_SRC_SEL_SHIFT 8
#define CFG_SRC_SEL_MASK (0x7 << CFG_SRC_SEL_SHIFT) #define CFG_SRC_SEL_MASK (0x7 << CFG_SRC_SEL_SHIFT)
#define CFG_MODE_SHIFT 12 #define CFG_MODE_SHIFT 12
@ -148,12 +151,32 @@ static int clk_rcg2_set_parent(struct clk_hw *hw, u8 index)
return update_config(rcg); return update_config(rcg);
} }
/* /**
* Calculate m/n:d rate * convert_to_reg_val() - Convert divisor values to hardware values.
*
* @f: Frequency table with pure m/n/pre_div parameters.
*/
static void convert_to_reg_val(struct freq_tbl *f)
{
f->pre_div *= 2;
f->pre_div -= 1;
}
/**
* calc_rate() - Calculate rate based on m/n:d values
*
* @rate: Parent rate.
* @m: Multiplier.
* @n: Divisor.
* @mode: Use zero to ignore m/n calculation.
* @hid_div: Pre divisor register value. Pre divisor value
* relates to hid_div as pre_div = (hid_div + 1) / 2.
*
* Return calculated rate according to formula:
* *
* parent_rate m * parent_rate m
* rate = ----------- x --- * rate = ----------- x ---
* hid_div n * pre_div n
*/ */
static unsigned long static unsigned long
calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div) calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div)
@ -393,16 +416,110 @@ static int clk_rcg2_fm_determine_rate(struct clk_hw *hw,
return _freq_tbl_fm_determine_rate(hw, rcg->freq_multi_tbl, req); return _freq_tbl_fm_determine_rate(hw, rcg->freq_multi_tbl, req);
} }
static int __clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f, /**
u32 *_cfg) * clk_rcg2_split_div() - Split multiplier that doesn't fit in n neither in pre_div.
*
* @multiplier: Multiplier to split between n and pre_div.
* @pre_div: Pointer to pre divisor value.
* @n: Pointer to n divisor value.
* @pre_div_max: Pre divisor maximum value.
*/
static inline void clk_rcg2_split_div(int multiplier, unsigned int *pre_div,
u16 *n, unsigned int pre_div_max)
{
*n = mult_frac(multiplier * *n, *pre_div, pre_div_max);
*pre_div = pre_div_max;
}
static void clk_rcg2_calc_mnd(u64 parent_rate, u64 rate, struct freq_tbl *f,
unsigned int mnd_max, unsigned int pre_div_max)
{
int i = 2;
unsigned int pre_div = 1;
unsigned long rates_gcd, scaled_parent_rate;
u16 m, n = 1, n_candidate = 1, n_max;
rates_gcd = gcd(parent_rate, rate);
m = div64_u64(rate, rates_gcd);
scaled_parent_rate = div64_u64(parent_rate, rates_gcd);
while (scaled_parent_rate > (mnd_max + m) * pre_div_max) {
// we're exceeding divisor's range, trying lower scale.
if (m > 1) {
m--;
scaled_parent_rate = mult_frac(scaled_parent_rate, m, (m + 1));
} else {
// cannot lower scale, just set max divisor values.
f->n = mnd_max + m;
f->pre_div = pre_div_max;
f->m = m;
return;
}
}
n_max = m + mnd_max;
while (scaled_parent_rate > 1) {
while (scaled_parent_rate % i == 0) {
n_candidate *= i;
if (n_candidate < n_max)
n = n_candidate;
else if (pre_div * i < pre_div_max)
pre_div *= i;
else
clk_rcg2_split_div(i, &pre_div, &n, pre_div_max);
scaled_parent_rate /= i;
}
i++;
}
f->m = m;
f->n = n;
f->pre_div = pre_div > 1 ? pre_div : 0;
}
static int clk_rcg2_determine_gp_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
struct freq_tbl f_tbl = {}, *f = &f_tbl;
int mnd_max = BIT(rcg->mnd_width) - 1;
int hid_max = BIT(rcg->hid_width) - 1;
struct clk_hw *parent;
u64 parent_rate;
parent = clk_hw_get_parent(hw);
parent_rate = clk_get_rate(parent->clk);
if (!parent_rate)
return -EINVAL;
clk_rcg2_calc_mnd(parent_rate, req->rate, f, mnd_max, hid_max / 2);
convert_to_reg_val(f);
req->rate = calc_rate(parent_rate, f->m, f->n, f->n, f->pre_div);
return 0;
}
static int __clk_rcg2_configure_parent(struct clk_rcg2 *rcg, u8 src, u32 *_cfg)
{ {
u32 cfg, mask, d_val, not2d_val, n_minus_m;
struct clk_hw *hw = &rcg->clkr.hw; struct clk_hw *hw = &rcg->clkr.hw;
int ret, index = qcom_find_src_index(hw, rcg->parent_map, f->src); int index = qcom_find_src_index(hw, rcg->parent_map, src);
if (index < 0) if (index < 0)
return index; return index;
*_cfg &= ~CFG_SRC_SEL_MASK;
*_cfg |= rcg->parent_map[index].cfg << CFG_SRC_SEL_SHIFT;
return 0;
}
static int __clk_rcg2_configure_mnd(struct clk_rcg2 *rcg, const struct freq_tbl *f,
u32 *_cfg)
{
u32 cfg, mask, d_val, not2d_val, n_minus_m;
int ret;
if (rcg->mnd_width && f->n) { if (rcg->mnd_width && f->n) {
mask = BIT(rcg->mnd_width) - 1; mask = BIT(rcg->mnd_width) - 1;
ret = regmap_update_bits(rcg->clkr.regmap, ret = regmap_update_bits(rcg->clkr.regmap,
@ -431,9 +548,8 @@ static int __clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f,
} }
mask = BIT(rcg->hid_width) - 1; mask = BIT(rcg->hid_width) - 1;
mask |= CFG_SRC_SEL_MASK | CFG_MODE_MASK | CFG_HW_CLK_CTRL_MASK; mask |= CFG_MODE_MASK | CFG_HW_CLK_CTRL_MASK;
cfg = f->pre_div << CFG_SRC_DIV_SHIFT; cfg = f->pre_div << CFG_SRC_DIV_SHIFT;
cfg |= rcg->parent_map[index].cfg << CFG_SRC_SEL_SHIFT;
if (rcg->mnd_width && f->n && (f->m != f->n)) if (rcg->mnd_width && f->n && (f->m != f->n))
cfg |= CFG_MODE_DUAL_EDGE; cfg |= CFG_MODE_DUAL_EDGE;
if (rcg->hw_clk_ctrl) if (rcg->hw_clk_ctrl)
@ -445,6 +561,22 @@ static int __clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f,
return 0; return 0;
} }
static int __clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f,
u32 *_cfg)
{
int ret;
ret = __clk_rcg2_configure_parent(rcg, f->src, _cfg);
if (ret)
return ret;
ret = __clk_rcg2_configure_mnd(rcg, f, _cfg);
if (ret)
return ret;
return 0;
}
static int clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f) static int clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f)
{ {
u32 cfg; u32 cfg;
@ -465,6 +597,26 @@ static int clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f)
return update_config(rcg); return update_config(rcg);
} }
static int clk_rcg2_configure_gp(struct clk_rcg2 *rcg, const struct freq_tbl *f)
{
u32 cfg;
int ret;
ret = regmap_read(rcg->clkr.regmap, RCG_CFG_OFFSET(rcg), &cfg);
if (ret)
return ret;
ret = __clk_rcg2_configure_mnd(rcg, f, &cfg);
if (ret)
return ret;
ret = regmap_write(rcg->clkr.regmap, RCG_CFG_OFFSET(rcg), cfg);
if (ret)
return ret;
return update_config(rcg);
}
static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate, static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate,
enum freq_policy policy) enum freq_policy policy)
{ {
@ -518,6 +670,22 @@ static int clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate,
return __clk_rcg2_set_rate(hw, rate, CEIL); return __clk_rcg2_set_rate(hw, rate, CEIL);
} }
static int clk_rcg2_set_gp_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
int mnd_max = BIT(rcg->mnd_width) - 1;
int hid_max = BIT(rcg->hid_width) - 1;
struct freq_tbl f_tbl = {}, *f = &f_tbl;
int ret;
clk_rcg2_calc_mnd(parent_rate, rate, f, mnd_max, hid_max / 2);
convert_to_reg_val(f);
ret = clk_rcg2_configure_gp(rcg, f);
return ret;
}
static int clk_rcg2_set_floor_rate(struct clk_hw *hw, unsigned long rate, static int clk_rcg2_set_floor_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) unsigned long parent_rate)
{ {
@ -645,6 +813,18 @@ const struct clk_ops clk_rcg2_ops = {
}; };
EXPORT_SYMBOL_GPL(clk_rcg2_ops); EXPORT_SYMBOL_GPL(clk_rcg2_ops);
const struct clk_ops clk_rcg2_gp_ops = {
.is_enabled = clk_rcg2_is_enabled,
.get_parent = clk_rcg2_get_parent,
.set_parent = clk_rcg2_set_parent,
.recalc_rate = clk_rcg2_recalc_rate,
.determine_rate = clk_rcg2_determine_gp_rate,
.set_rate = clk_rcg2_set_gp_rate,
.get_duty_cycle = clk_rcg2_get_duty_cycle,
.set_duty_cycle = clk_rcg2_set_duty_cycle,
};
EXPORT_SYMBOL_GPL(clk_rcg2_gp_ops);
const struct clk_ops clk_rcg2_floor_ops = { const struct clk_ops clk_rcg2_floor_ops = {
.is_enabled = clk_rcg2_is_enabled, .is_enabled = clk_rcg2_is_enabled,
.get_parent = clk_rcg2_get_parent, .get_parent = clk_rcg2_get_parent,

View File

@ -4,6 +4,7 @@
* Copyright (c) 2014, The Linux Foundation. All rights reserved. * Copyright (c) 2014, The Linux Foundation. All rights reserved.
*/ */
#include <linux/cleanup.h>
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/export.h> #include <linux/export.h>
@ -224,10 +225,10 @@ static void clk_rpm_unprepare(struct clk_hw *hw)
unsigned long active_rate, sleep_rate; unsigned long active_rate, sleep_rate;
int ret; int ret;
mutex_lock(&rpm_clk_lock); guard(mutex)(&rpm_clk_lock);
if (!r->rate) if (!r->rate)
goto out; return;
/* Take peer clock's rate into account only if it's enabled. */ /* Take peer clock's rate into account only if it's enabled. */
if (peer->enabled) if (peer->enabled)
@ -237,17 +238,14 @@ static void clk_rpm_unprepare(struct clk_hw *hw)
active_rate = r->branch ? !!peer_rate : peer_rate; active_rate = r->branch ? !!peer_rate : peer_rate;
ret = clk_rpm_set_rate_active(r, active_rate); ret = clk_rpm_set_rate_active(r, active_rate);
if (ret) if (ret)
goto out; return;
sleep_rate = r->branch ? !!peer_sleep_rate : peer_sleep_rate; sleep_rate = r->branch ? !!peer_sleep_rate : peer_sleep_rate;
ret = clk_rpm_set_rate_sleep(r, sleep_rate); ret = clk_rpm_set_rate_sleep(r, sleep_rate);
if (ret) if (ret)
goto out; return;
r->enabled = false; r->enabled = false;
out:
mutex_unlock(&rpm_clk_lock);
} }
static int clk_rpm_xo_prepare(struct clk_hw *hw) static int clk_rpm_xo_prepare(struct clk_hw *hw)
@ -324,12 +322,12 @@ static int clk_rpm_set_rate(struct clk_hw *hw,
unsigned long active_rate, sleep_rate; unsigned long active_rate, sleep_rate;
unsigned long this_rate = 0, this_sleep_rate = 0; unsigned long this_rate = 0, this_sleep_rate = 0;
unsigned long peer_rate = 0, peer_sleep_rate = 0; unsigned long peer_rate = 0, peer_sleep_rate = 0;
int ret = 0; int ret;
mutex_lock(&rpm_clk_lock); guard(mutex)(&rpm_clk_lock);
if (!r->enabled) if (!r->enabled)
goto out; return 0;
to_active_sleep(r, rate, &this_rate, &this_sleep_rate); to_active_sleep(r, rate, &this_rate, &this_sleep_rate);
@ -341,19 +339,16 @@ static int clk_rpm_set_rate(struct clk_hw *hw,
active_rate = max(this_rate, peer_rate); active_rate = max(this_rate, peer_rate);
ret = clk_rpm_set_rate_active(r, active_rate); ret = clk_rpm_set_rate_active(r, active_rate);
if (ret) if (ret)
goto out; return ret;
sleep_rate = max(this_sleep_rate, peer_sleep_rate); sleep_rate = max(this_sleep_rate, peer_sleep_rate);
ret = clk_rpm_set_rate_sleep(r, sleep_rate); ret = clk_rpm_set_rate_sleep(r, sleep_rate);
if (ret) if (ret)
goto out; return ret;
r->rate = rate; r->rate = rate;
out: return 0;
mutex_unlock(&rpm_clk_lock);
return ret;
} }
static long clk_rpm_round_rate(struct clk_hw *hw, unsigned long rate, static long clk_rpm_round_rate(struct clk_hw *hw, unsigned long rate,

View File

@ -330,7 +330,7 @@ static unsigned long clk_rpmh_bcm_recalc_rate(struct clk_hw *hw,
{ {
struct clk_rpmh *c = to_clk_rpmh(hw); struct clk_rpmh *c = to_clk_rpmh(hw);
return c->aggr_state * c->unit; return (unsigned long)c->aggr_state * c->unit;
} }
static const struct clk_ops clk_rpmh_bcm_ops = { static const struct clk_ops clk_rpmh_bcm_ops = {
@ -369,6 +369,8 @@ DEFINE_CLK_RPMH_VRM(rf_clk2, _d, "rfclkd2", 1);
DEFINE_CLK_RPMH_VRM(rf_clk3, _d, "rfclkd3", 1); DEFINE_CLK_RPMH_VRM(rf_clk3, _d, "rfclkd3", 1);
DEFINE_CLK_RPMH_VRM(rf_clk4, _d, "rfclkd4", 1); DEFINE_CLK_RPMH_VRM(rf_clk4, _d, "rfclkd4", 1);
DEFINE_CLK_RPMH_VRM(rf_clk3, _a2, "rfclka3", 2);
DEFINE_CLK_RPMH_VRM(clk1, _a1, "clka1", 1); DEFINE_CLK_RPMH_VRM(clk1, _a1, "clka1", 1);
DEFINE_CLK_RPMH_VRM(clk2, _a1, "clka2", 1); DEFINE_CLK_RPMH_VRM(clk2, _a1, "clka2", 1);
DEFINE_CLK_RPMH_VRM(clk3, _a1, "clka3", 1); DEFINE_CLK_RPMH_VRM(clk3, _a1, "clka3", 1);
@ -808,6 +810,45 @@ static const struct clk_rpmh_desc clk_rpmh_x1e80100 = {
.num_clks = ARRAY_SIZE(x1e80100_rpmh_clocks), .num_clks = ARRAY_SIZE(x1e80100_rpmh_clocks),
}; };
static struct clk_hw *qcs615_rpmh_clocks[] = {
[RPMH_CXO_CLK] = &clk_rpmh_bi_tcxo_div2.hw,
[RPMH_CXO_CLK_A] = &clk_rpmh_bi_tcxo_div2_ao.hw,
[RPMH_LN_BB_CLK2] = &clk_rpmh_ln_bb_clk2_a2.hw,
[RPMH_LN_BB_CLK2_A] = &clk_rpmh_ln_bb_clk2_a2_ao.hw,
[RPMH_LN_BB_CLK3] = &clk_rpmh_ln_bb_clk3_a2.hw,
[RPMH_LN_BB_CLK3_A] = &clk_rpmh_ln_bb_clk3_a2_ao.hw,
[RPMH_RF_CLK1] = &clk_rpmh_rf_clk1_a.hw,
[RPMH_RF_CLK1_A] = &clk_rpmh_rf_clk1_a_ao.hw,
[RPMH_RF_CLK2] = &clk_rpmh_rf_clk2_a.hw,
[RPMH_RF_CLK2_A] = &clk_rpmh_rf_clk2_a_ao.hw,
};
static const struct clk_rpmh_desc clk_rpmh_qcs615 = {
.clks = qcs615_rpmh_clocks,
.num_clks = ARRAY_SIZE(qcs615_rpmh_clocks),
};
static struct clk_hw *sm8750_rpmh_clocks[] = {
[RPMH_CXO_CLK] = &clk_rpmh_bi_tcxo_div2.hw,
[RPMH_CXO_CLK_A] = &clk_rpmh_bi_tcxo_div2_ao.hw,
[RPMH_LN_BB_CLK1] = &clk_rpmh_clk6_a2.hw,
[RPMH_LN_BB_CLK1_A] = &clk_rpmh_clk6_a2_ao.hw,
[RPMH_LN_BB_CLK3] = &clk_rpmh_clk8_a2.hw,
[RPMH_LN_BB_CLK3_A] = &clk_rpmh_clk8_a2_ao.hw,
[RPMH_RF_CLK1] = &clk_rpmh_rf_clk1_a.hw,
[RPMH_RF_CLK1_A] = &clk_rpmh_rf_clk1_a_ao.hw,
[RPMH_RF_CLK2] = &clk_rpmh_rf_clk2_a.hw,
[RPMH_RF_CLK2_A] = &clk_rpmh_rf_clk2_a_ao.hw,
[RPMH_RF_CLK3] = &clk_rpmh_rf_clk3_a2.hw,
[RPMH_RF_CLK3_A] = &clk_rpmh_rf_clk3_a2_ao.hw,
[RPMH_IPA_CLK] = &clk_rpmh_ipa.hw,
};
static const struct clk_rpmh_desc clk_rpmh_sm8750 = {
.clks = sm8750_rpmh_clocks,
.num_clks = ARRAY_SIZE(sm8750_rpmh_clocks),
};
static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec, static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
void *data) void *data)
{ {
@ -891,10 +932,12 @@ static int clk_rpmh_probe(struct platform_device *pdev)
} }
static const struct of_device_id clk_rpmh_match_table[] = { static const struct of_device_id clk_rpmh_match_table[] = {
{ .compatible = "qcom,qcs615-rpmh-clk", .data = &clk_rpmh_qcs615},
{ .compatible = "qcom,qdu1000-rpmh-clk", .data = &clk_rpmh_qdu1000}, { .compatible = "qcom,qdu1000-rpmh-clk", .data = &clk_rpmh_qdu1000},
{ .compatible = "qcom,sa8775p-rpmh-clk", .data = &clk_rpmh_sa8775p}, { .compatible = "qcom,sa8775p-rpmh-clk", .data = &clk_rpmh_sa8775p},
{ .compatible = "qcom,sar2130p-rpmh-clk", .data = &clk_rpmh_sar2130p}, { .compatible = "qcom,sar2130p-rpmh-clk", .data = &clk_rpmh_sar2130p},
{ .compatible = "qcom,sc7180-rpmh-clk", .data = &clk_rpmh_sc7180}, { .compatible = "qcom,sc7180-rpmh-clk", .data = &clk_rpmh_sc7180},
{ .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280},
{ .compatible = "qcom,sc8180x-rpmh-clk", .data = &clk_rpmh_sc8180x}, { .compatible = "qcom,sc8180x-rpmh-clk", .data = &clk_rpmh_sc8180x},
{ .compatible = "qcom,sc8280xp-rpmh-clk", .data = &clk_rpmh_sc8280xp}, { .compatible = "qcom,sc8280xp-rpmh-clk", .data = &clk_rpmh_sc8280xp},
{ .compatible = "qcom,sdm845-rpmh-clk", .data = &clk_rpmh_sdm845}, { .compatible = "qcom,sdm845-rpmh-clk", .data = &clk_rpmh_sdm845},
@ -910,7 +953,7 @@ static const struct of_device_id clk_rpmh_match_table[] = {
{ .compatible = "qcom,sm8450-rpmh-clk", .data = &clk_rpmh_sm8450}, { .compatible = "qcom,sm8450-rpmh-clk", .data = &clk_rpmh_sm8450},
{ .compatible = "qcom,sm8550-rpmh-clk", .data = &clk_rpmh_sm8550}, { .compatible = "qcom,sm8550-rpmh-clk", .data = &clk_rpmh_sm8550},
{ .compatible = "qcom,sm8650-rpmh-clk", .data = &clk_rpmh_sm8650}, { .compatible = "qcom,sm8650-rpmh-clk", .data = &clk_rpmh_sm8650},
{ .compatible = "qcom,sc7280-rpmh-clk", .data = &clk_rpmh_sc7280}, { .compatible = "qcom,sm8750-rpmh-clk", .data = &clk_rpmh_sm8750},
{ .compatible = "qcom,x1e80100-rpmh-clk", .data = &clk_rpmh_x1e80100}, { .compatible = "qcom,x1e80100-rpmh-clk", .data = &clk_rpmh_x1e80100},
{ } { }
}; };

View File

@ -4,6 +4,7 @@
* Copyright (c) 2014, The Linux Foundation. All rights reserved. * Copyright (c) 2014, The Linux Foundation. All rights reserved.
*/ */
#include <linux/cleanup.h>
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/export.h> #include <linux/export.h>
@ -309,10 +310,10 @@ static void clk_smd_rpm_unprepare(struct clk_hw *hw)
unsigned long active_rate, sleep_rate; unsigned long active_rate, sleep_rate;
int ret; int ret;
mutex_lock(&rpm_smd_clk_lock); guard(mutex)(&rpm_smd_clk_lock);
if (!r->rate) if (!r->rate)
goto out; return;
/* Take peer clock's rate into account only if it's enabled. */ /* Take peer clock's rate into account only if it's enabled. */
if (peer->enabled) if (peer->enabled)
@ -322,17 +323,14 @@ static void clk_smd_rpm_unprepare(struct clk_hw *hw)
active_rate = r->branch ? !!peer_rate : peer_rate; active_rate = r->branch ? !!peer_rate : peer_rate;
ret = clk_smd_rpm_set_rate_active(r, active_rate); ret = clk_smd_rpm_set_rate_active(r, active_rate);
if (ret) if (ret)
goto out; return;
sleep_rate = r->branch ? !!peer_sleep_rate : peer_sleep_rate; sleep_rate = r->branch ? !!peer_sleep_rate : peer_sleep_rate;
ret = clk_smd_rpm_set_rate_sleep(r, sleep_rate); ret = clk_smd_rpm_set_rate_sleep(r, sleep_rate);
if (ret) if (ret)
goto out; return;
r->enabled = false; r->enabled = false;
out:
mutex_unlock(&rpm_smd_clk_lock);
} }
static int clk_smd_rpm_set_rate(struct clk_hw *hw, unsigned long rate, static int clk_smd_rpm_set_rate(struct clk_hw *hw, unsigned long rate,
@ -345,10 +343,10 @@ static int clk_smd_rpm_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long peer_rate = 0, peer_sleep_rate = 0; unsigned long peer_rate = 0, peer_sleep_rate = 0;
int ret = 0; int ret = 0;
mutex_lock(&rpm_smd_clk_lock); guard(mutex)(&rpm_smd_clk_lock);
if (!r->enabled) if (!r->enabled)
goto out; return 0;
to_active_sleep(r, rate, &this_rate, &this_sleep_rate); to_active_sleep(r, rate, &this_rate, &this_sleep_rate);
@ -360,19 +358,16 @@ static int clk_smd_rpm_set_rate(struct clk_hw *hw, unsigned long rate,
active_rate = max(this_rate, peer_rate); active_rate = max(this_rate, peer_rate);
ret = clk_smd_rpm_set_rate_active(r, active_rate); ret = clk_smd_rpm_set_rate_active(r, active_rate);
if (ret) if (ret)
goto out; return ret;
sleep_rate = max(this_sleep_rate, peer_sleep_rate); sleep_rate = max(this_sleep_rate, peer_sleep_rate);
ret = clk_smd_rpm_set_rate_sleep(r, sleep_rate); ret = clk_smd_rpm_set_rate_sleep(r, sleep_rate);
if (ret) if (ret)
goto out; return ret;
r->rate = rate; r->rate = rate;
out: return 0;
mutex_unlock(&rpm_smd_clk_lock);
return ret;
} }
static long clk_smd_rpm_round_rate(struct clk_hw *hw, unsigned long rate, static long clk_smd_rpm_round_rate(struct clk_hw *hw, unsigned long rate,
@ -700,6 +695,60 @@ static const struct rpm_smd_clk_desc rpm_clk_msm8936 = {
.num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks), .num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks),
}; };
static struct clk_smd_rpm *msm8937_clks[] = {
[RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo,
[RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a,
[RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk,
[RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk,
[RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1,
[RPM_SMD_BB_CLK1_A] = &clk_smd_rpm_bb_clk1_a,
[RPM_SMD_BB_CLK2] = &clk_smd_rpm_bb_clk2,
[RPM_SMD_BB_CLK2_A] = &clk_smd_rpm_bb_clk2_a,
[RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2,
[RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a,
[RPM_SMD_DIV_CLK2] = &clk_smd_rpm_div_clk2,
[RPM_SMD_DIV_A_CLK2] = &clk_smd_rpm_div_clk2_a,
[RPM_SMD_BB_CLK1_PIN] = &clk_smd_rpm_bb_clk1_pin,
[RPM_SMD_BB_CLK1_A_PIN] = &clk_smd_rpm_bb_clk1_a_pin,
[RPM_SMD_BB_CLK2_PIN] = &clk_smd_rpm_bb_clk2_pin,
[RPM_SMD_BB_CLK2_A_PIN] = &clk_smd_rpm_bb_clk2_a_pin,
};
static const struct rpm_smd_clk_desc rpm_clk_msm8937 = {
.clks = msm8937_clks,
.num_clks = ARRAY_SIZE(msm8937_clks),
.icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks,
.num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks),
};
static struct clk_smd_rpm *msm8940_clks[] = {
[RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo,
[RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a,
[RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk,
[RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk,
[RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk,
[RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk,
[RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1,
[RPM_SMD_BB_CLK1_A] = &clk_smd_rpm_bb_clk1_a,
[RPM_SMD_BB_CLK2] = &clk_smd_rpm_bb_clk2,
[RPM_SMD_BB_CLK2_A] = &clk_smd_rpm_bb_clk2_a,
[RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2,
[RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a,
[RPM_SMD_DIV_CLK2] = &clk_smd_rpm_div_clk2,
[RPM_SMD_DIV_A_CLK2] = &clk_smd_rpm_div_clk2_a,
[RPM_SMD_BB_CLK1_PIN] = &clk_smd_rpm_bb_clk1_pin,
[RPM_SMD_BB_CLK1_A_PIN] = &clk_smd_rpm_bb_clk1_a_pin,
[RPM_SMD_BB_CLK2_PIN] = &clk_smd_rpm_bb_clk2_pin,
[RPM_SMD_BB_CLK2_A_PIN] = &clk_smd_rpm_bb_clk2_a_pin,
};
static const struct rpm_smd_clk_desc rpm_clk_msm8940 = {
.clks = msm8940_clks,
.num_clks = ARRAY_SIZE(msm8940_clks),
.icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks,
.num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks),
};
static struct clk_smd_rpm *msm8974_clks[] = { static struct clk_smd_rpm *msm8974_clks[] = {
[RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo,
[RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a,
@ -1216,6 +1265,8 @@ static const struct of_device_id rpm_smd_clk_match_table[] = {
{ .compatible = "qcom,rpmcc-msm8916", .data = &rpm_clk_msm8916 }, { .compatible = "qcom,rpmcc-msm8916", .data = &rpm_clk_msm8916 },
{ .compatible = "qcom,rpmcc-msm8917", .data = &rpm_clk_msm8917 }, { .compatible = "qcom,rpmcc-msm8917", .data = &rpm_clk_msm8917 },
{ .compatible = "qcom,rpmcc-msm8936", .data = &rpm_clk_msm8936 }, { .compatible = "qcom,rpmcc-msm8936", .data = &rpm_clk_msm8936 },
{ .compatible = "qcom,rpmcc-msm8937", .data = &rpm_clk_msm8937 },
{ .compatible = "qcom,rpmcc-msm8940", .data = &rpm_clk_msm8940 },
{ .compatible = "qcom,rpmcc-msm8953", .data = &rpm_clk_msm8953 }, { .compatible = "qcom,rpmcc-msm8953", .data = &rpm_clk_msm8953 },
{ .compatible = "qcom,rpmcc-msm8974", .data = &rpm_clk_msm8974 }, { .compatible = "qcom,rpmcc-msm8974", .data = &rpm_clk_msm8974 },
{ .compatible = "qcom,rpmcc-msm8976", .data = &rpm_clk_msm8976 }, { .compatible = "qcom,rpmcc-msm8976", .data = &rpm_clk_msm8976 },

View File

@ -3,6 +3,7 @@
*/ */
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/cleanup.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/delay.h> #include <linux/delay.h>
@ -140,30 +141,26 @@ static int clk_spmi_pmic_div_set_rate(struct clk_hw *hw, unsigned long rate,
{ {
struct clkdiv *clkdiv = to_clkdiv(hw); struct clkdiv *clkdiv = to_clkdiv(hw);
unsigned int div_factor = div_to_div_factor(parent_rate / rate); unsigned int div_factor = div_to_div_factor(parent_rate / rate);
unsigned long flags;
bool enabled; bool enabled;
int ret; int ret;
spin_lock_irqsave(&clkdiv->lock, flags); guard(spinlock_irqsave)(&clkdiv->lock);
enabled = is_spmi_pmic_clkdiv_enabled(clkdiv); enabled = is_spmi_pmic_clkdiv_enabled(clkdiv);
if (enabled) { if (enabled) {
ret = spmi_pmic_clkdiv_set_enable_state(clkdiv, false); ret = spmi_pmic_clkdiv_set_enable_state(clkdiv, false);
if (ret) if (ret)
goto unlock; return ret;
} }
ret = regmap_update_bits(clkdiv->regmap, clkdiv->base + REG_DIV_CTL1, ret = regmap_update_bits(clkdiv->regmap, clkdiv->base + REG_DIV_CTL1,
DIV_CTL1_DIV_FACTOR_MASK, div_factor); DIV_CTL1_DIV_FACTOR_MASK, div_factor);
if (ret) if (ret)
goto unlock; return ret;
if (enabled) if (enabled)
ret = __spmi_pmic_clkdiv_set_enable_state(clkdiv, true, ret = __spmi_pmic_clkdiv_set_enable_state(clkdiv, true,
div_factor); div_factor);
unlock:
spin_unlock_irqrestore(&clkdiv->lock, flags);
return ret; return ret;
} }

View File

@ -40,8 +40,6 @@ static const struct pll_vco spark_vco[] = {
/* 768MHz configuration */ /* 768MHz configuration */
static const struct alpha_pll_config disp_cc_pll0_config = { static const struct alpha_pll_config disp_cc_pll0_config = {
.l = 0x28, .l = 0x28,
.alpha = 0x0,
.alpha_en_mask = BIT(24),
.vco_val = 0x2 << 20, .vco_val = 0x2 << 20,
.vco_mask = GENMASK(21, 20), .vco_mask = GENMASK(21, 20),
.main_output_mask = BIT(0), .main_output_mask = BIT(0),

View File

@ -48,8 +48,6 @@ static const struct pll_vco spark_vco[] = {
/* 768MHz configuration */ /* 768MHz configuration */
static const struct alpha_pll_config disp_cc_pll0_config = { static const struct alpha_pll_config disp_cc_pll0_config = {
.l = 0x28, .l = 0x28,
.alpha = 0x0,
.alpha_en_mask = BIT(24),
.vco_val = 0x2 << 20, .vco_val = 0x2 << 20,
.vco_mask = GENMASK(21, 20), .vco_mask = GENMASK(21, 20),
.main_output_mask = BIT(0), .main_output_mask = BIT(0),

View File

@ -187,13 +187,12 @@ static struct clk_rcg2 disp_cc_mdss_dp_aux_clk_src = {
.cmd_rcgr = 0x1144, .cmd_rcgr = 0x1144,
.mnd_width = 0, .mnd_width = 0,
.hid_width = 5, .hid_width = 5,
.parent_map = disp_cc_parent_map_6,
.freq_tbl = ftbl_disp_cc_mdss_dp_aux_clk_src, .freq_tbl = ftbl_disp_cc_mdss_dp_aux_clk_src,
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "disp_cc_mdss_dp_aux_clk_src", .name = "disp_cc_mdss_dp_aux_clk_src",
.parent_data = &(const struct clk_parent_data){ .parent_data = disp_cc_parent_data_6,
.fw_name = "bi_tcxo", .num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
},
.num_parents = 1,
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@
*/ */
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/interconnect-provider.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
@ -12,6 +13,7 @@
#include <linux/regmap.h> #include <linux/regmap.h>
#include <dt-bindings/clock/qcom,ipq5424-gcc.h> #include <dt-bindings/clock/qcom,ipq5424-gcc.h>
#include <dt-bindings/interconnect/qcom,ipq5424.h>
#include <dt-bindings/reset/qcom,ipq5424-gcc.h> #include <dt-bindings/reset/qcom,ipq5424-gcc.h>
#include "clk-alpha-pll.h" #include "clk-alpha-pll.h"
@ -325,6 +327,24 @@ static struct clk_rcg2 gcc_xo_clk_src = {
}, },
}; };
static struct clk_branch gcc_xo_clk = {
.halt_reg = 0x34018,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x34018,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_xo_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_xo_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_fixed_factor gcc_xo_div4_clk_src = { static struct clk_fixed_factor gcc_xo_div4_clk_src = {
.mult = 1, .mult = 1,
.div = 4, .div = 4,
@ -1097,24 +1117,6 @@ static struct clk_branch gcc_adss_pwm_clk = {
}, },
}; };
static struct clk_branch gcc_apss_dbg_clk = {
.halt_reg = 0x2402c,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x2402c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_apss_dbg_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_dap_sync_clk_src.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_cnoc_pcie0_1lane_s_clk = { static struct clk_branch gcc_cnoc_pcie0_1lane_s_clk = {
.halt_reg = 0x31088, .halt_reg = 0x31088,
.halt_check = BRANCH_HALT, .halt_check = BRANCH_HALT,
@ -2785,7 +2787,6 @@ static struct clk_branch gcc_pcie3_rchng_clk = {
static struct clk_regmap *gcc_ipq5424_clocks[] = { static struct clk_regmap *gcc_ipq5424_clocks[] = {
[GCC_ADSS_PWM_CLK] = &gcc_adss_pwm_clk.clkr, [GCC_ADSS_PWM_CLK] = &gcc_adss_pwm_clk.clkr,
[GCC_ADSS_PWM_CLK_SRC] = &gcc_adss_pwm_clk_src.clkr, [GCC_ADSS_PWM_CLK_SRC] = &gcc_adss_pwm_clk_src.clkr,
[GCC_APSS_DBG_CLK] = &gcc_apss_dbg_clk.clkr,
[GCC_CNOC_PCIE0_1LANE_S_CLK] = &gcc_cnoc_pcie0_1lane_s_clk.clkr, [GCC_CNOC_PCIE0_1LANE_S_CLK] = &gcc_cnoc_pcie0_1lane_s_clk.clkr,
[GCC_CNOC_PCIE1_1LANE_S_CLK] = &gcc_cnoc_pcie1_1lane_s_clk.clkr, [GCC_CNOC_PCIE1_1LANE_S_CLK] = &gcc_cnoc_pcie1_1lane_s_clk.clkr,
[GCC_CNOC_PCIE2_2LANE_S_CLK] = &gcc_cnoc_pcie2_2lane_s_clk.clkr, [GCC_CNOC_PCIE2_2LANE_S_CLK] = &gcc_cnoc_pcie2_2lane_s_clk.clkr,
@ -2920,6 +2921,7 @@ static struct clk_regmap *gcc_ipq5424_clocks[] = {
[GCC_QPIC_CLK_SRC] = &gcc_qpic_clk_src.clkr, [GCC_QPIC_CLK_SRC] = &gcc_qpic_clk_src.clkr,
[GCC_QPIC_AHB_CLK] = &gcc_qpic_ahb_clk.clkr, [GCC_QPIC_AHB_CLK] = &gcc_qpic_ahb_clk.clkr,
[GCC_XO_CLK_SRC] = &gcc_xo_clk_src.clkr, [GCC_XO_CLK_SRC] = &gcc_xo_clk_src.clkr,
[GCC_XO_CLK] = &gcc_xo_clk.clkr,
[GCC_QDSS_DAP_CLK] = &gcc_qdss_dap_clk.clkr, [GCC_QDSS_DAP_CLK] = &gcc_qdss_dap_clk.clkr,
[GCC_QDSS_AT_CLK] = &gcc_qdss_at_clk.clkr, [GCC_QDSS_AT_CLK] = &gcc_qdss_at_clk.clkr,
[GPLL0] = &gpll0.clkr, [GPLL0] = &gpll0.clkr,
@ -3230,6 +3232,20 @@ static const struct qcom_reset_map gcc_ipq5424_resets[] = {
[GCC_QUSB2_1_PHY_BCR] = { 0x3C030, 0 }, [GCC_QUSB2_1_PHY_BCR] = { 0x3C030, 0 },
}; };
#define IPQ_APPS_ID 5424 /* some unique value */
static const struct qcom_icc_hws_data icc_ipq5424_hws[] = {
{ MASTER_ANOC_PCIE0, SLAVE_ANOC_PCIE0, GCC_ANOC_PCIE0_1LANE_M_CLK },
{ MASTER_CNOC_PCIE0, SLAVE_CNOC_PCIE0, GCC_CNOC_PCIE0_1LANE_S_CLK },
{ MASTER_ANOC_PCIE1, SLAVE_ANOC_PCIE1, GCC_ANOC_PCIE1_1LANE_M_CLK },
{ MASTER_CNOC_PCIE1, SLAVE_CNOC_PCIE1, GCC_CNOC_PCIE1_1LANE_S_CLK },
{ MASTER_ANOC_PCIE2, SLAVE_ANOC_PCIE2, GCC_ANOC_PCIE2_2LANE_M_CLK },
{ MASTER_CNOC_PCIE2, SLAVE_CNOC_PCIE2, GCC_CNOC_PCIE2_2LANE_S_CLK },
{ MASTER_ANOC_PCIE3, SLAVE_ANOC_PCIE3, GCC_ANOC_PCIE3_2LANE_M_CLK },
{ MASTER_CNOC_PCIE3, SLAVE_CNOC_PCIE3, GCC_CNOC_PCIE3_2LANE_S_CLK },
{ MASTER_CNOC_USB, SLAVE_CNOC_USB, GCC_CNOC_USB_CLK },
};
static const struct of_device_id gcc_ipq5424_match_table[] = { static const struct of_device_id gcc_ipq5424_match_table[] = {
{ .compatible = "qcom,ipq5424-gcc" }, { .compatible = "qcom,ipq5424-gcc" },
{ } { }
@ -3260,6 +3276,8 @@ static const struct qcom_cc_desc gcc_ipq5424_desc = {
.num_resets = ARRAY_SIZE(gcc_ipq5424_resets), .num_resets = ARRAY_SIZE(gcc_ipq5424_resets),
.clk_hws = gcc_ipq5424_hws, .clk_hws = gcc_ipq5424_hws,
.num_clk_hws = ARRAY_SIZE(gcc_ipq5424_hws), .num_clk_hws = ARRAY_SIZE(gcc_ipq5424_hws),
.icc_hws = icc_ipq5424_hws,
.num_icc_hws = ARRAY_SIZE(icc_ipq5424_hws),
}; };
static int gcc_ipq5424_probe(struct platform_device *pdev) static int gcc_ipq5424_probe(struct platform_device *pdev)
@ -3272,6 +3290,7 @@ static struct platform_driver gcc_ipq5424_driver = {
.driver = { .driver = {
.name = "qcom,gcc-ipq5424", .name = "qcom,gcc-ipq5424",
.of_match_table = gcc_ipq5424_match_table, .of_match_table = gcc_ipq5424_match_table,
.sync_state = icc_sync_state,
}, },
}; };

View File

@ -4194,10 +4194,9 @@ static const struct alpha_pll_config ubi32_pll_config = {
.test_ctl_hi_val = 0x4000, .test_ctl_hi_val = 0x4000,
}; };
/* 1200 MHz configuration */
static const struct alpha_pll_config nss_crypto_pll_config = { static const struct alpha_pll_config nss_crypto_pll_config = {
.l = 0x32, .l = 0x32,
.alpha = 0x0,
.alpha_hi = 0x0,
.config_ctl_val = 0x4001055b, .config_ctl_val = 0x4001055b,
.main_output_mask = BIT(0), .main_output_mask = BIT(0),
.pre_div_val = 0x0, .pre_div_val = 0x0,
@ -4206,7 +4205,6 @@ static const struct alpha_pll_config nss_crypto_pll_config = {
.post_div_mask = GENMASK(11, 8), .post_div_mask = GENMASK(11, 8),
.vco_mask = GENMASK(21, 20), .vco_mask = GENMASK(21, 20),
.vco_val = 0x0, .vco_val = 0x0,
.alpha_en_mask = BIT(24),
}; };
static struct clk_hw *gcc_ipq6018_hws[] = { static struct clk_hw *gcc_ipq6018_hws[] = {

View File

@ -535,7 +535,7 @@ static struct clk_rcg2 blsp1_uart5_apps_clk_src = {
}; };
static struct clk_rcg2 blsp1_uart6_apps_clk_src = { static struct clk_rcg2 blsp1_uart6_apps_clk_src = {
.cmd_rcgr = 0x6044, .cmd_rcgr = 0x7044,
.mnd_width = 16, .mnd_width = 16,
.hid_width = 5, .hid_width = 5,
.parent_map = gcc_xo_gpll0_map, .parent_map = gcc_xo_gpll0_map,

File diff suppressed because it is too large Load Diff

View File

@ -284,11 +284,6 @@ static struct clk_rcg2 gcc_sdm670_cpuss_rbcpr_clk_src = {
}; };
static const struct freq_tbl ftbl_gcc_gp1_clk_src[] = { static const struct freq_tbl ftbl_gcc_gp1_clk_src[] = {
F(19200000, P_BI_TCXO, 1, 0, 0),
F(25000000, P_GPLL0_OUT_EVEN, 12, 0, 0),
F(50000000, P_GPLL0_OUT_EVEN, 6, 0, 0),
F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
{ } { }
}; };
@ -302,7 +297,7 @@ static struct clk_rcg2 gcc_gp1_clk_src = {
.name = "gcc_gp1_clk_src", .name = "gcc_gp1_clk_src",
.parent_data = gcc_parent_data_1, .parent_data = gcc_parent_data_1,
.num_parents = ARRAY_SIZE(gcc_parent_data_1), .num_parents = ARRAY_SIZE(gcc_parent_data_1),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_gp_ops,
}, },
}; };
@ -316,7 +311,7 @@ static struct clk_rcg2 gcc_gp2_clk_src = {
.name = "gcc_gp2_clk_src", .name = "gcc_gp2_clk_src",
.parent_data = gcc_parent_data_1, .parent_data = gcc_parent_data_1,
.num_parents = ARRAY_SIZE(gcc_parent_data_1), .num_parents = ARRAY_SIZE(gcc_parent_data_1),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_gp_ops,
}, },
}; };
@ -330,7 +325,7 @@ static struct clk_rcg2 gcc_gp3_clk_src = {
.name = "gcc_gp3_clk_src", .name = "gcc_gp3_clk_src",
.parent_data = gcc_parent_data_1, .parent_data = gcc_parent_data_1,
.num_parents = ARRAY_SIZE(gcc_parent_data_1), .num_parents = ARRAY_SIZE(gcc_parent_data_1),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_gp_ops,
}, },
}; };
@ -454,7 +449,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s0_clk_src_init = {
.name = "gcc_qupv3_wrap0_s0_clk_src", .name = "gcc_qupv3_wrap0_s0_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = {
@ -470,7 +465,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s1_clk_src_init = {
.name = "gcc_qupv3_wrap0_s1_clk_src", .name = "gcc_qupv3_wrap0_s1_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = {
@ -486,7 +481,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s2_clk_src_init = {
.name = "gcc_qupv3_wrap0_s2_clk_src", .name = "gcc_qupv3_wrap0_s2_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = {
@ -502,7 +497,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s3_clk_src_init = {
.name = "gcc_qupv3_wrap0_s3_clk_src", .name = "gcc_qupv3_wrap0_s3_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = {
@ -518,7 +513,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s4_clk_src_init = {
.name = "gcc_qupv3_wrap0_s4_clk_src", .name = "gcc_qupv3_wrap0_s4_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = {
@ -534,7 +529,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s5_clk_src_init = {
.name = "gcc_qupv3_wrap0_s5_clk_src", .name = "gcc_qupv3_wrap0_s5_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = {
@ -550,7 +545,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s6_clk_src_init = {
.name = "gcc_qupv3_wrap0_s6_clk_src", .name = "gcc_qupv3_wrap0_s6_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = {
@ -566,7 +561,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s7_clk_src_init = {
.name = "gcc_qupv3_wrap0_s7_clk_src", .name = "gcc_qupv3_wrap0_s7_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap0_s7_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap0_s7_clk_src = {
@ -582,7 +577,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s0_clk_src_init = {
.name = "gcc_qupv3_wrap1_s0_clk_src", .name = "gcc_qupv3_wrap1_s0_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = {
@ -598,7 +593,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s1_clk_src_init = {
.name = "gcc_qupv3_wrap1_s1_clk_src", .name = "gcc_qupv3_wrap1_s1_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = {
@ -614,7 +609,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s2_clk_src_init = {
.name = "gcc_qupv3_wrap1_s2_clk_src", .name = "gcc_qupv3_wrap1_s2_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = {
@ -630,7 +625,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s3_clk_src_init = {
.name = "gcc_qupv3_wrap1_s3_clk_src", .name = "gcc_qupv3_wrap1_s3_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = {
@ -646,7 +641,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s4_clk_src_init = {
.name = "gcc_qupv3_wrap1_s4_clk_src", .name = "gcc_qupv3_wrap1_s4_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = {
@ -662,7 +657,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s5_clk_src_init = {
.name = "gcc_qupv3_wrap1_s5_clk_src", .name = "gcc_qupv3_wrap1_s5_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = {
@ -678,7 +673,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s6_clk_src_init = {
.name = "gcc_qupv3_wrap1_s6_clk_src", .name = "gcc_qupv3_wrap1_s6_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = {
@ -694,7 +689,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s7_clk_src_init = {
.name = "gcc_qupv3_wrap1_s7_clk_src", .name = "gcc_qupv3_wrap1_s7_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_shared_ops, .ops = &clk_rcg2_ops,
}; };
static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = { static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = {

View File

@ -182,6 +182,14 @@ static const struct clk_parent_data gcc_parent_data_2_ao[] = {
{ .hw = &gpll0_out_odd.clkr.hw }, { .hw = &gpll0_out_odd.clkr.hw },
}; };
static const struct parent_map gcc_parent_map_3[] = {
{ P_BI_TCXO, 0 },
};
static const struct clk_parent_data gcc_parent_data_3[] = {
{ .fw_name = "bi_tcxo" },
};
static const struct parent_map gcc_parent_map_4[] = { static const struct parent_map gcc_parent_map_4[] = {
{ P_BI_TCXO, 0 }, { P_BI_TCXO, 0 },
{ P_GPLL0_OUT_MAIN, 1 }, { P_GPLL0_OUT_MAIN, 1 },
@ -701,13 +709,12 @@ static struct clk_rcg2 gcc_ufs_phy_phy_aux_clk_src = {
.cmd_rcgr = 0x3a0b0, .cmd_rcgr = 0x3a0b0,
.mnd_width = 0, .mnd_width = 0,
.hid_width = 5, .hid_width = 5,
.parent_map = gcc_parent_map_3,
.freq_tbl = ftbl_gcc_ufs_phy_phy_aux_clk_src, .freq_tbl = ftbl_gcc_ufs_phy_phy_aux_clk_src,
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_ufs_phy_phy_aux_clk_src", .name = "gcc_ufs_phy_phy_aux_clk_src",
.parent_data = &(const struct clk_parent_data){ .parent_data = gcc_parent_data_3,
.fw_name = "bi_tcxo", .num_parents = ARRAY_SIZE(gcc_parent_data_3),
},
.num_parents = 1,
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
@ -764,13 +771,12 @@ static struct clk_rcg2 gcc_usb30_prim_mock_utmi_clk_src = {
.cmd_rcgr = 0x1a034, .cmd_rcgr = 0x1a034,
.mnd_width = 0, .mnd_width = 0,
.hid_width = 5, .hid_width = 5,
.parent_map = gcc_parent_map_3,
.freq_tbl = ftbl_gcc_usb30_prim_mock_utmi_clk_src, .freq_tbl = ftbl_gcc_usb30_prim_mock_utmi_clk_src,
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_usb30_prim_mock_utmi_clk_src", .name = "gcc_usb30_prim_mock_utmi_clk_src",
.parent_data = &(const struct clk_parent_data){ .parent_data = gcc_parent_data_3,
.fw_name = "bi_tcxo", .num_parents = ARRAY_SIZE(gcc_parent_data_3),
},
.num_parents = 1,
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };

View File

@ -3003,7 +3003,7 @@ static struct gdsc pcie_0_gdsc = {
.pd = { .pd = {
.name = "pcie_0_gdsc", .name = "pcie_0_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_RET_ON,
.flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
}; };
@ -3014,7 +3014,7 @@ static struct gdsc pcie_0_phy_gdsc = {
.pd = { .pd = {
.name = "pcie_0_phy_gdsc", .name = "pcie_0_phy_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_RET_ON,
.flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
}; };
@ -3025,7 +3025,7 @@ static struct gdsc pcie_1_gdsc = {
.pd = { .pd = {
.name = "pcie_1_gdsc", .name = "pcie_1_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_RET_ON,
.flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
}; };
@ -3036,7 +3036,7 @@ static struct gdsc pcie_1_phy_gdsc = {
.pd = { .pd = {
.name = "pcie_1_phy_gdsc", .name = "pcie_1_phy_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_RET_ON,
.flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE, .flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
}; };

View File

@ -3437,7 +3437,7 @@ static struct gdsc pcie_0_gdsc = {
.pd = { .pd = {
.name = "pcie_0_gdsc", .name = "pcie_0_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_RET_ON,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | VOTABLE, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | VOTABLE,
}; };
@ -3448,7 +3448,7 @@ static struct gdsc pcie_0_phy_gdsc = {
.pd = { .pd = {
.name = "pcie_0_phy_gdsc", .name = "pcie_0_phy_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_RET_ON,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | VOTABLE, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | VOTABLE,
}; };
@ -3459,7 +3459,7 @@ static struct gdsc pcie_1_gdsc = {
.pd = { .pd = {
.name = "pcie_1_gdsc", .name = "pcie_1_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_RET_ON,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | VOTABLE, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | VOTABLE,
}; };
@ -3470,7 +3470,7 @@ static struct gdsc pcie_1_phy_gdsc = {
.pd = { .pd = {
.name = "pcie_1_phy_gdsc", .name = "pcie_1_phy_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_RET_ON,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | VOTABLE, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE | VOTABLE,
}; };

File diff suppressed because it is too large Load Diff

View File

@ -6083,7 +6083,7 @@ static struct gdsc gcc_usb20_prim_gdsc = {
.pd = { .pd = {
.name = "gcc_usb20_prim_gdsc", .name = "gcc_usb20_prim_gdsc",
}, },
.pwrsts = PWRSTS_OFF_ON, .pwrsts = PWRSTS_RET_ON,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE, .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
}; };

View File

@ -0,0 +1,587 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/clk-provider.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <dt-bindings/clock/qcom,x1e80100-gpucc.h>
#include "clk-alpha-pll.h"
#include "clk-branch.h"
#include "clk-pll.h"
#include "clk-rcg.h"
#include "clk-regmap.h"
#include "clk-regmap-divider.h"
#include "clk-regmap-mux.h"
#include "common.h"
#include "gdsc.h"
#include "reset.h"
enum {
DT_BI_TCXO,
DT_GPLL0_OUT_MAIN,
DT_GPLL0_OUT_MAIN_DIV,
};
enum {
P_BI_TCXO,
P_GPLL0_OUT_MAIN,
P_GPLL0_OUT_MAIN_DIV,
P_GPU_CC_PLL0_OUT_MAIN,
P_GPU_CC_PLL1_OUT_MAIN,
};
static const struct pll_vco lucid_ole_vco[] = {
{ 249600000, 2300000000, 0 },
};
/* 560.0 MHz Configuration */
static const struct alpha_pll_config gpu_cc_pll0_config = {
.l = 0x1d,
.alpha = 0x2aaa,
.config_ctl_val = 0x20485699,
.config_ctl_hi_val = 0x00182261,
.config_ctl_hi1_val = 0x82aa299c,
.test_ctl_val = 0x00000000,
.test_ctl_hi_val = 0x00000003,
.test_ctl_hi1_val = 0x00009000,
.test_ctl_hi2_val = 0x00000034,
.user_ctl_val = 0x00000000,
.user_ctl_hi_val = 0x00000005,
};
static struct clk_alpha_pll gpu_cc_pll0 = {
.offset = 0x0,
.vco_table = lucid_ole_vco,
.num_vco = ARRAY_SIZE(lucid_ole_vco),
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
.clkr = {
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_pll0",
.parent_data = &(const struct clk_parent_data) {
.index = DT_BI_TCXO,
},
.num_parents = 1,
.ops = &clk_alpha_pll_lucid_evo_ops,
},
},
};
/* 440.0 MHz Configuration */
static const struct alpha_pll_config gpu_cc_pll1_config = {
.l = 0x16,
.alpha = 0xeaaa,
.config_ctl_val = 0x20485699,
.config_ctl_hi_val = 0x00182261,
.config_ctl_hi1_val = 0x82aa299c,
.test_ctl_val = 0x00000000,
.test_ctl_hi_val = 0x00000003,
.test_ctl_hi1_val = 0x00009000,
.test_ctl_hi2_val = 0x00000034,
.user_ctl_val = 0x00000000,
.user_ctl_hi_val = 0x00000005,
};
static struct clk_alpha_pll gpu_cc_pll1 = {
.offset = 0x1000,
.vco_table = lucid_ole_vco,
.num_vco = ARRAY_SIZE(lucid_ole_vco),
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
.clkr = {
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_pll1",
.parent_data = &(const struct clk_parent_data) {
.index = DT_BI_TCXO,
},
.num_parents = 1,
.ops = &clk_alpha_pll_lucid_evo_ops,
},
},
};
static const struct parent_map gpu_cc_parent_map_0[] = {
{ P_BI_TCXO, 0 },
{ P_GPLL0_OUT_MAIN, 5 },
{ P_GPLL0_OUT_MAIN_DIV, 6 },
};
static const struct clk_parent_data gpu_cc_parent_data_0[] = {
{ .index = DT_BI_TCXO },
{ .index = DT_GPLL0_OUT_MAIN },
{ .index = DT_GPLL0_OUT_MAIN_DIV },
};
static const struct parent_map gpu_cc_parent_map_1[] = {
{ P_BI_TCXO, 0 },
{ P_GPU_CC_PLL0_OUT_MAIN, 1 },
{ P_GPU_CC_PLL1_OUT_MAIN, 3 },
{ P_GPLL0_OUT_MAIN, 5 },
{ P_GPLL0_OUT_MAIN_DIV, 6 },
};
static const struct clk_parent_data gpu_cc_parent_data_1[] = {
{ .index = DT_BI_TCXO },
{ .hw = &gpu_cc_pll0.clkr.hw },
{ .hw = &gpu_cc_pll1.clkr.hw },
{ .index = DT_GPLL0_OUT_MAIN },
{ .index = DT_GPLL0_OUT_MAIN_DIV },
};
static const struct parent_map gpu_cc_parent_map_2[] = {
{ P_BI_TCXO, 0 },
{ P_GPU_CC_PLL1_OUT_MAIN, 3 },
{ P_GPLL0_OUT_MAIN, 5 },
{ P_GPLL0_OUT_MAIN_DIV, 6 },
};
static const struct clk_parent_data gpu_cc_parent_data_2[] = {
{ .index = DT_BI_TCXO },
{ .hw = &gpu_cc_pll1.clkr.hw },
{ .index = DT_GPLL0_OUT_MAIN },
{ .index = DT_GPLL0_OUT_MAIN_DIV },
};
static const struct freq_tbl ftbl_gpu_cc_ff_clk_src[] = {
F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
{ }
};
static struct clk_rcg2 gpu_cc_ff_clk_src = {
.cmd_rcgr = 0x9474,
.mnd_width = 0,
.hid_width = 5,
.parent_map = gpu_cc_parent_map_0,
.freq_tbl = ftbl_gpu_cc_ff_clk_src,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_ff_clk_src",
.parent_data = gpu_cc_parent_data_0,
.num_parents = ARRAY_SIZE(gpu_cc_parent_data_0),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_shared_ops,
},
};
static const struct freq_tbl ftbl_gpu_cc_gmu_clk_src[] = {
F(19200000, P_BI_TCXO, 1, 0, 0),
F(220000000, P_GPU_CC_PLL1_OUT_MAIN, 2, 0, 0),
F(550000000, P_GPU_CC_PLL1_OUT_MAIN, 2, 0, 0),
{ }
};
static struct clk_rcg2 gpu_cc_gmu_clk_src = {
.cmd_rcgr = 0x9318,
.mnd_width = 0,
.hid_width = 5,
.parent_map = gpu_cc_parent_map_1,
.freq_tbl = ftbl_gpu_cc_gmu_clk_src,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_gmu_clk_src",
.parent_data = gpu_cc_parent_data_1,
.num_parents = ARRAY_SIZE(gpu_cc_parent_data_1),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_shared_ops,
},
};
static struct clk_rcg2 gpu_cc_hub_clk_src = {
.cmd_rcgr = 0x93ec,
.mnd_width = 0,
.hid_width = 5,
.parent_map = gpu_cc_parent_map_2,
.freq_tbl = ftbl_gpu_cc_ff_clk_src,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_hub_clk_src",
.parent_data = gpu_cc_parent_data_2,
.num_parents = ARRAY_SIZE(gpu_cc_parent_data_2),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_shared_ops,
},
};
static struct clk_branch gpu_cc_ahb_clk = {
.halt_reg = 0x911c,
.halt_check = BRANCH_HALT_DELAY,
.clkr = {
.enable_reg = 0x911c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_ahb_clk",
.parent_hws = (const struct clk_hw*[]) {
&gpu_cc_hub_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_crc_ahb_clk = {
.halt_reg = 0x9120,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x9120,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_crc_ahb_clk",
.parent_hws = (const struct clk_hw*[]) {
&gpu_cc_hub_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_cx_accu_shift_clk = {
.halt_reg = 0x9480,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x9480,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_cx_accu_shift_clk",
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_cx_ff_clk = {
.halt_reg = 0x914c,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x914c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_cx_ff_clk",
.parent_hws = (const struct clk_hw*[]) {
&gpu_cc_ff_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_cx_gmu_clk = {
.halt_reg = 0x913c,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x913c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_cx_gmu_clk",
.parent_hws = (const struct clk_hw*[]) {
&gpu_cc_gmu_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_aon_ops,
},
},
};
static struct clk_branch gpu_cc_cxo_clk = {
.halt_reg = 0x9144,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x9144,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_cxo_clk",
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_freq_measure_clk = {
.halt_reg = 0x9008,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x9008,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_freq_measure_clk",
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_gx_accu_shift_clk = {
.halt_reg = 0x947c,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x947c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_gx_accu_shift_clk",
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_gx_gmu_clk = {
.halt_reg = 0x90bc,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x90bc,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_gx_gmu_clk",
.parent_hws = (const struct clk_hw*[]) {
&gpu_cc_gmu_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_gx_vsense_clk = {
.halt_reg = 0x90b0,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x90b0,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_gx_vsense_clk",
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_hub_aon_clk = {
.halt_reg = 0x93e8,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x93e8,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_hub_aon_clk",
.parent_hws = (const struct clk_hw*[]) {
&gpu_cc_hub_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_aon_ops,
},
},
};
static struct clk_branch gpu_cc_hub_cx_int_clk = {
.halt_reg = 0x9148,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x9148,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_hub_cx_int_clk",
.parent_hws = (const struct clk_hw*[]) {
&gpu_cc_hub_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_aon_ops,
},
},
};
static struct clk_branch gpu_cc_memnoc_gfx_clk = {
.halt_reg = 0x9150,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x9150,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_memnoc_gfx_clk",
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_mnd1x_0_gfx3d_clk = {
.halt_reg = 0x9288,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x9288,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_mnd1x_0_gfx3d_clk",
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_mnd1x_1_gfx3d_clk = {
.halt_reg = 0x928c,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x928c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_mnd1x_1_gfx3d_clk",
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gpu_cc_sleep_clk = {
.halt_reg = 0x9134,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x9134,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_sleep_clk",
.ops = &clk_branch2_ops,
},
},
};
static struct gdsc gpu_cc_cx_gdsc = {
.gdscr = 0x9108,
.gds_hw_ctrl = 0x953c,
.en_rest_wait_val = 0x2,
.en_few_wait_val = 0x2,
.clk_dis_wait_val = 0xf,
.pd = {
.name = "gpu_cc_cx_gdsc",
},
.pwrsts = PWRSTS_OFF_ON,
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
};
static struct gdsc gpu_cc_gx_gdsc = {
.gdscr = 0x905c,
.en_rest_wait_val = 0x2,
.en_few_wait_val = 0x2,
.clk_dis_wait_val = 0xf,
.pd = {
.name = "gpu_cc_gx_gdsc",
.power_on = gdsc_gx_do_nothing_enable,
},
.pwrsts = PWRSTS_OFF_ON,
.flags = CLAMP_IO | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
};
static struct clk_regmap *gpu_cc_x1p42100_clocks[] = {
[GPU_CC_AHB_CLK] = &gpu_cc_ahb_clk.clkr,
[GPU_CC_CRC_AHB_CLK] = &gpu_cc_crc_ahb_clk.clkr,
[GPU_CC_CX_ACCU_SHIFT_CLK] = &gpu_cc_cx_accu_shift_clk.clkr,
[GPU_CC_CX_FF_CLK] = &gpu_cc_cx_ff_clk.clkr,
[GPU_CC_CX_GMU_CLK] = &gpu_cc_cx_gmu_clk.clkr,
[GPU_CC_CXO_CLK] = &gpu_cc_cxo_clk.clkr,
[GPU_CC_FF_CLK_SRC] = &gpu_cc_ff_clk_src.clkr,
[GPU_CC_FREQ_MEASURE_CLK] = &gpu_cc_freq_measure_clk.clkr,
[GPU_CC_GMU_CLK_SRC] = &gpu_cc_gmu_clk_src.clkr,
[GPU_CC_GX_ACCU_SHIFT_CLK] = &gpu_cc_gx_accu_shift_clk.clkr,
[GPU_CC_GX_GMU_CLK] = &gpu_cc_gx_gmu_clk.clkr,
[GPU_CC_GX_VSENSE_CLK] = &gpu_cc_gx_vsense_clk.clkr,
[GPU_CC_HUB_AON_CLK] = &gpu_cc_hub_aon_clk.clkr,
[GPU_CC_HUB_CLK_SRC] = &gpu_cc_hub_clk_src.clkr,
[GPU_CC_HUB_CX_INT_CLK] = &gpu_cc_hub_cx_int_clk.clkr,
[GPU_CC_MEMNOC_GFX_CLK] = &gpu_cc_memnoc_gfx_clk.clkr,
[GPU_CC_MND1X_0_GFX3D_CLK] = &gpu_cc_mnd1x_0_gfx3d_clk.clkr,
[GPU_CC_MND1X_1_GFX3D_CLK] = &gpu_cc_mnd1x_1_gfx3d_clk.clkr,
[GPU_CC_PLL0] = &gpu_cc_pll0.clkr,
[GPU_CC_PLL1] = &gpu_cc_pll1.clkr,
[GPU_CC_SLEEP_CLK] = &gpu_cc_sleep_clk.clkr,
};
static struct gdsc *gpu_cc_x1p42100_gdscs[] = {
[GPU_CX_GDSC] = &gpu_cc_cx_gdsc,
[GPU_GX_GDSC] = &gpu_cc_gx_gdsc,
};
static const struct qcom_reset_map gpu_cc_x1p42100_resets[] = {
[GPU_CC_ACD_BCR] = { 0x9358 },
[GPU_CC_CB_BCR] = { 0x93a0 },
[GPU_CC_CX_BCR] = { 0x9104 },
[GPU_CC_FAST_HUB_BCR] = { 0x93e4 },
[GPU_CC_FF_BCR] = { 0x9470 },
[GPU_CC_GFX3D_AON_BCR] = { 0x9198 },
[GPU_CC_GMU_BCR] = { 0x9314 },
[GPU_CC_GX_BCR] = { 0x9058 },
[GPU_CC_XO_BCR] = { 0x9000 },
};
static const struct regmap_config gpu_cc_x1p42100_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.max_register = 0x9988,
.fast_io = true,
};
static struct qcom_cc_desc gpu_cc_x1p42100_desc = {
.config = &gpu_cc_x1p42100_regmap_config,
.clks = gpu_cc_x1p42100_clocks,
.num_clks = ARRAY_SIZE(gpu_cc_x1p42100_clocks),
.resets = gpu_cc_x1p42100_resets,
.num_resets = ARRAY_SIZE(gpu_cc_x1p42100_resets),
.gdscs = gpu_cc_x1p42100_gdscs,
.num_gdscs = ARRAY_SIZE(gpu_cc_x1p42100_gdscs),
};
static const struct of_device_id gpu_cc_x1p42100_match_table[] = {
{ .compatible = "qcom,x1p42100-gpucc" },
{ }
};
MODULE_DEVICE_TABLE(of, gpu_cc_x1p42100_match_table);
static int gpu_cc_x1p42100_probe(struct platform_device *pdev)
{
struct regmap *regmap;
int ret;
ret = devm_pm_runtime_enable(&pdev->dev);
if (ret)
return ret;
ret = pm_runtime_resume_and_get(&pdev->dev);
if (ret)
return ret;
regmap = qcom_cc_map(pdev, &gpu_cc_x1p42100_desc);
if (IS_ERR(regmap)) {
pm_runtime_put(&pdev->dev);
return PTR_ERR(regmap);
}
clk_lucid_ole_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config);
clk_lucid_ole_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config);
/* Keep some clocks always enabled */
qcom_branch_set_clk_en(regmap, 0x93a4); /* GPU_CC_CB_CLK */
qcom_branch_set_clk_en(regmap, 0x9004); /* GPU_CC_CXO_AON_CLK */
qcom_branch_set_clk_en(regmap, 0x900c); /* GPU_CC_DEMET_CLK */
ret = qcom_cc_really_probe(&pdev->dev, &gpu_cc_x1p42100_desc, regmap);
pm_runtime_put(&pdev->dev);
return ret;
}
static struct platform_driver gpu_cc_x1p42100_driver = {
.probe = gpu_cc_x1p42100_probe,
.driver = {
.name = "gpucc-x1p42100",
.of_match_table = gpu_cc_x1p42100_match_table,
},
};
module_platform_driver(gpu_cc_x1p42100_driver);
MODULE_DESCRIPTION("QTI GPUCC X1P42100 Driver");
MODULE_LICENSE("GPL");

View File

@ -0,0 +1,435 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
/*
* CMN PLL block expects the reference clock from on-board Wi-Fi block,
* and supplies fixed rate clocks as output to the networking hardware
* blocks and to GCC. The networking related blocks include PPE (packet
* process engine), the externally connected PHY or switch devices, and
* the PCS.
*
* On the IPQ9574 SoC, there are three clocks with 50 MHZ and one clock
* with 25 MHZ which are output from the CMN PLL to Ethernet PHY (or switch),
* and one clock with 353 MHZ to PPE. The other fixed rate output clocks
* are supplied to GCC (24 MHZ as XO and 32 KHZ as sleep clock), and to PCS
* with 31.25 MHZ.
*
* +---------+
* | GCC |
* +--+---+--+
* AHB CLK| |SYS CLK
* V V
* +-------+---+------+
* | +-------------> eth0-50mhz
* REF CLK | IPQ9574 |
* -------->+ +-------------> eth1-50mhz
* | CMN PLL block |
* | +-------------> eth2-50mhz
* | |
* +----+----+----+---+-------------> eth-25mhz
* | | |
* V V V
* GCC PCS NSS/PPE
*/
#include <linux/bitfield.h>
#include <linux/clk-provider.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_clock.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <dt-bindings/clock/qcom,ipq-cmn-pll.h>
#define CMN_PLL_REFCLK_SRC_SELECTION 0x28
#define CMN_PLL_REFCLK_SRC_DIV GENMASK(9, 8)
#define CMN_PLL_LOCKED 0x64
#define CMN_PLL_CLKS_LOCKED BIT(8)
#define CMN_PLL_POWER_ON_AND_RESET 0x780
#define CMN_ANA_EN_SW_RSTN BIT(6)
#define CMN_PLL_REFCLK_CONFIG 0x784
#define CMN_PLL_REFCLK_EXTERNAL BIT(9)
#define CMN_PLL_REFCLK_DIV GENMASK(8, 4)
#define CMN_PLL_REFCLK_INDEX GENMASK(3, 0)
#define CMN_PLL_CTRL 0x78c
#define CMN_PLL_CTRL_LOCK_DETECT_EN BIT(15)
#define CMN_PLL_DIVIDER_CTRL 0x794
#define CMN_PLL_DIVIDER_CTRL_FACTOR GENMASK(9, 0)
/**
* struct cmn_pll_fixed_output_clk - CMN PLL output clocks information
* @id: Clock specifier to be supplied
* @name: Clock name to be registered
* @rate: Clock rate
*/
struct cmn_pll_fixed_output_clk {
unsigned int id;
const char *name;
unsigned long rate;
};
/**
* struct clk_cmn_pll - CMN PLL hardware specific data
* @regmap: hardware regmap.
* @hw: handle between common and hardware-specific interfaces
*/
struct clk_cmn_pll {
struct regmap *regmap;
struct clk_hw hw;
};
#define CLK_PLL_OUTPUT(_id, _name, _rate) { \
.id = _id, \
.name = _name, \
.rate = _rate, \
}
#define to_clk_cmn_pll(_hw) container_of(_hw, struct clk_cmn_pll, hw)
static const struct regmap_config ipq_cmn_pll_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.max_register = 0x7fc,
.fast_io = true,
};
static const struct cmn_pll_fixed_output_clk ipq9574_output_clks[] = {
CLK_PLL_OUTPUT(XO_24MHZ_CLK, "xo-24mhz", 24000000UL),
CLK_PLL_OUTPUT(SLEEP_32KHZ_CLK, "sleep-32khz", 32000UL),
CLK_PLL_OUTPUT(PCS_31P25MHZ_CLK, "pcs-31p25mhz", 31250000UL),
CLK_PLL_OUTPUT(NSS_1200MHZ_CLK, "nss-1200mhz", 1200000000UL),
CLK_PLL_OUTPUT(PPE_353MHZ_CLK, "ppe-353mhz", 353000000UL),
CLK_PLL_OUTPUT(ETH0_50MHZ_CLK, "eth0-50mhz", 50000000UL),
CLK_PLL_OUTPUT(ETH1_50MHZ_CLK, "eth1-50mhz", 50000000UL),
CLK_PLL_OUTPUT(ETH2_50MHZ_CLK, "eth2-50mhz", 50000000UL),
CLK_PLL_OUTPUT(ETH_25MHZ_CLK, "eth-25mhz", 25000000UL),
};
/*
* CMN PLL has the single parent clock, which supports the several
* possible parent clock rates, each parent clock rate is reflected
* by the specific reference index value in the hardware.
*/
static int ipq_cmn_pll_find_freq_index(unsigned long parent_rate)
{
int index = -EINVAL;
switch (parent_rate) {
case 25000000:
index = 3;
break;
case 31250000:
index = 4;
break;
case 40000000:
index = 6;
break;
case 48000000:
case 96000000:
/*
* Parent clock rate 48 MHZ and 96 MHZ take the same value
* of reference clock index. 96 MHZ needs the source clock
* divider to be programmed as 2.
*/
index = 7;
break;
case 50000000:
index = 8;
break;
default:
break;
}
return index;
}
static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
struct clk_cmn_pll *cmn_pll = to_clk_cmn_pll(hw);
u32 val, factor;
/*
* The value of CMN_PLL_DIVIDER_CTRL_FACTOR is automatically adjusted
* by HW according to the parent clock rate.
*/
regmap_read(cmn_pll->regmap, CMN_PLL_DIVIDER_CTRL, &val);
factor = FIELD_GET(CMN_PLL_DIVIDER_CTRL_FACTOR, val);
return parent_rate * 2 * factor;
}
static int clk_cmn_pll_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
int ret;
/* Validate the rate of the single parent clock. */
ret = ipq_cmn_pll_find_freq_index(req->best_parent_rate);
return ret < 0 ? ret : 0;
}
/*
* This function is used to initialize the CMN PLL to enable the fixed
* rate output clocks. It is expected to be configured once.
*/
static int clk_cmn_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
struct clk_cmn_pll *cmn_pll = to_clk_cmn_pll(hw);
int ret, index;
u32 val;
/*
* Configure the reference input clock selection as per the given
* parent clock. The output clock rates are always of fixed value.
*/
index = ipq_cmn_pll_find_freq_index(parent_rate);
if (index < 0)
return index;
ret = regmap_update_bits(cmn_pll->regmap, CMN_PLL_REFCLK_CONFIG,
CMN_PLL_REFCLK_INDEX,
FIELD_PREP(CMN_PLL_REFCLK_INDEX, index));
if (ret)
return ret;
/*
* Update the source clock rate selection and source clock
* divider as 2 when the parent clock rate is 96 MHZ.
*/
if (parent_rate == 96000000) {
ret = regmap_update_bits(cmn_pll->regmap, CMN_PLL_REFCLK_CONFIG,
CMN_PLL_REFCLK_DIV,
FIELD_PREP(CMN_PLL_REFCLK_DIV, 2));
if (ret)
return ret;
ret = regmap_update_bits(cmn_pll->regmap, CMN_PLL_REFCLK_SRC_SELECTION,
CMN_PLL_REFCLK_SRC_DIV,
FIELD_PREP(CMN_PLL_REFCLK_SRC_DIV, 0));
if (ret)
return ret;
}
/* Enable PLL locked detect. */
ret = regmap_set_bits(cmn_pll->regmap, CMN_PLL_CTRL,
CMN_PLL_CTRL_LOCK_DETECT_EN);
if (ret)
return ret;
/*
* Reset the CMN PLL block to ensure the updated configurations
* take effect.
*/
ret = regmap_clear_bits(cmn_pll->regmap, CMN_PLL_POWER_ON_AND_RESET,
CMN_ANA_EN_SW_RSTN);
if (ret)
return ret;
usleep_range(1000, 1200);
ret = regmap_set_bits(cmn_pll->regmap, CMN_PLL_POWER_ON_AND_RESET,
CMN_ANA_EN_SW_RSTN);
if (ret)
return ret;
/* Stability check of CMN PLL output clocks. */
return regmap_read_poll_timeout(cmn_pll->regmap, CMN_PLL_LOCKED, val,
(val & CMN_PLL_CLKS_LOCKED),
100, 100 * USEC_PER_MSEC);
}
static const struct clk_ops clk_cmn_pll_ops = {
.recalc_rate = clk_cmn_pll_recalc_rate,
.determine_rate = clk_cmn_pll_determine_rate,
.set_rate = clk_cmn_pll_set_rate,
};
static struct clk_hw *ipq_cmn_pll_clk_hw_register(struct platform_device *pdev)
{
struct clk_parent_data pdata = { .index = 0 };
struct device *dev = &pdev->dev;
struct clk_init_data init = {};
struct clk_cmn_pll *cmn_pll;
struct regmap *regmap;
void __iomem *base;
int ret;
base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base))
return ERR_CAST(base);
regmap = devm_regmap_init_mmio(dev, base, &ipq_cmn_pll_regmap_config);
if (IS_ERR(regmap))
return ERR_CAST(regmap);
cmn_pll = devm_kzalloc(dev, sizeof(*cmn_pll), GFP_KERNEL);
if (!cmn_pll)
return ERR_PTR(-ENOMEM);
init.name = "cmn_pll";
init.parent_data = &pdata;
init.num_parents = 1;
init.ops = &clk_cmn_pll_ops;
cmn_pll->hw.init = &init;
cmn_pll->regmap = regmap;
ret = devm_clk_hw_register(dev, &cmn_pll->hw);
if (ret)
return ERR_PTR(ret);
return &cmn_pll->hw;
}
static int ipq_cmn_pll_register_clks(struct platform_device *pdev)
{
const struct cmn_pll_fixed_output_clk *fixed_clk;
struct clk_hw_onecell_data *hw_data;
struct device *dev = &pdev->dev;
struct clk_hw *cmn_pll_hw;
unsigned int num_clks;
struct clk_hw *hw;
int ret, i;
fixed_clk = ipq9574_output_clks;
num_clks = ARRAY_SIZE(ipq9574_output_clks);
hw_data = devm_kzalloc(dev, struct_size(hw_data, hws, num_clks + 1),
GFP_KERNEL);
if (!hw_data)
return -ENOMEM;
/*
* Register the CMN PLL clock, which is the parent clock of
* the fixed rate output clocks.
*/
cmn_pll_hw = ipq_cmn_pll_clk_hw_register(pdev);
if (IS_ERR(cmn_pll_hw))
return PTR_ERR(cmn_pll_hw);
/* Register the fixed rate output clocks. */
for (i = 0; i < num_clks; i++) {
hw = clk_hw_register_fixed_rate_parent_hw(dev, fixed_clk[i].name,
cmn_pll_hw, 0,
fixed_clk[i].rate);
if (IS_ERR(hw)) {
ret = PTR_ERR(hw);
goto unregister_fixed_clk;
}
hw_data->hws[fixed_clk[i].id] = hw;
}
/*
* Provide the CMN PLL clock. The clock rate of CMN PLL
* is configured to 12 GHZ by DT property assigned-clock-rates-u64.
*/
hw_data->hws[CMN_PLL_CLK] = cmn_pll_hw;
hw_data->num = num_clks + 1;
ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, hw_data);
if (ret)
goto unregister_fixed_clk;
platform_set_drvdata(pdev, hw_data);
return 0;
unregister_fixed_clk:
while (i > 0)
clk_hw_unregister(hw_data->hws[fixed_clk[--i].id]);
return ret;
}
static int ipq_cmn_pll_clk_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
int ret;
ret = devm_pm_runtime_enable(dev);
if (ret)
return ret;
ret = devm_pm_clk_create(dev);
if (ret)
return ret;
/*
* To access the CMN PLL registers, the GCC AHB & SYS clocks
* of CMN PLL block need to be enabled.
*/
ret = pm_clk_add(dev, "ahb");
if (ret)
return dev_err_probe(dev, ret, "Fail to add AHB clock\n");
ret = pm_clk_add(dev, "sys");
if (ret)
return dev_err_probe(dev, ret, "Fail to add SYS clock\n");
ret = pm_runtime_resume_and_get(dev);
if (ret)
return ret;
/* Register CMN PLL clock and fixed rate output clocks. */
ret = ipq_cmn_pll_register_clks(pdev);
pm_runtime_put(dev);
if (ret)
return dev_err_probe(dev, ret,
"Fail to register CMN PLL clocks\n");
return 0;
}
static void ipq_cmn_pll_clk_remove(struct platform_device *pdev)
{
struct clk_hw_onecell_data *hw_data = platform_get_drvdata(pdev);
int i;
/*
* The clock with index CMN_PLL_CLK is unregistered by
* device management.
*/
for (i = 0; i < hw_data->num; i++) {
if (i != CMN_PLL_CLK)
clk_hw_unregister(hw_data->hws[i]);
}
}
static const struct dev_pm_ops ipq_cmn_pll_pm_ops = {
SET_RUNTIME_PM_OPS(pm_clk_suspend, pm_clk_resume, NULL)
};
static const struct of_device_id ipq_cmn_pll_clk_ids[] = {
{ .compatible = "qcom,ipq9574-cmn-pll", },
{ }
};
MODULE_DEVICE_TABLE(of, ipq_cmn_pll_clk_ids);
static struct platform_driver ipq_cmn_pll_clk_driver = {
.probe = ipq_cmn_pll_clk_probe,
.remove = ipq_cmn_pll_clk_remove,
.driver = {
.name = "ipq_cmn_pll",
.of_match_table = ipq_cmn_pll_clk_ids,
.pm = &ipq_cmn_pll_pm_ops,
},
};
module_platform_driver(ipq_cmn_pll_clk_driver);
MODULE_DESCRIPTION("Qualcomm Technologies, Inc. IPQ CMN PLL Driver");
MODULE_LICENSE("GPL");

View File

@ -0,0 +1,85 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022, 2023 Linaro Limited
*/
#include <linux/clk-provider.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <dt-bindings/clock/qcom,sm6115-lpasscc.h>
#include "common.h"
#include "reset.h"
static const struct qcom_reset_map lpass_audiocc_sm6115_resets[] = {
[LPASS_AUDIO_SWR_RX_CGCR] = { .reg = 0x98, .bit = 1, .udelay = 500 },
};
static struct regmap_config lpass_audiocc_sm6115_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.name = "lpass-audio-csr",
.max_register = 0x1000,
};
static const struct qcom_cc_desc lpass_audiocc_sm6115_reset_desc = {
.config = &lpass_audiocc_sm6115_regmap_config,
.resets = lpass_audiocc_sm6115_resets,
.num_resets = ARRAY_SIZE(lpass_audiocc_sm6115_resets),
};
static const struct qcom_reset_map lpasscc_sm6115_resets[] = {
[LPASS_SWR_TX_CONFIG_CGCR] = { .reg = 0x100, .bit = 1, .udelay = 500 },
};
static struct regmap_config lpasscc_sm6115_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.name = "lpass-tcsr",
.max_register = 0x1000,
};
static const struct qcom_cc_desc lpasscc_sm6115_reset_desc = {
.config = &lpasscc_sm6115_regmap_config,
.resets = lpasscc_sm6115_resets,
.num_resets = ARRAY_SIZE(lpasscc_sm6115_resets),
};
static const struct of_device_id lpasscc_sm6115_match_table[] = {
{
.compatible = "qcom,sm6115-lpassaudiocc",
.data = &lpass_audiocc_sm6115_reset_desc,
}, {
.compatible = "qcom,sm6115-lpasscc",
.data = &lpasscc_sm6115_reset_desc,
},
{ },
};
MODULE_DEVICE_TABLE(of, lpasscc_sm6115_match_table);
static int lpasscc_sm6115_probe(struct platform_device *pdev)
{
const struct qcom_cc_desc *desc = of_device_get_match_data(&pdev->dev);
return qcom_cc_probe_by_index(pdev, 0, desc);
}
static struct platform_driver lpasscc_sm6115_driver = {
.probe = lpasscc_sm6115_probe,
.driver = {
.name = "lpasscc-sm6115",
.of_match_table = lpasscc_sm6115_match_table,
},
};
module_platform_driver(lpasscc_sm6115_driver);
MODULE_DESCRIPTION("QTI LPASSCC SM6115 Driver");
MODULE_LICENSE("GPL");

View File

@ -37,6 +37,7 @@ enum {
P_DSI2_PLL_DSICLK, P_DSI2_PLL_DSICLK,
P_DSI1_PLL_BYTECLK, P_DSI1_PLL_BYTECLK,
P_DSI2_PLL_BYTECLK, P_DSI2_PLL_BYTECLK,
P_LVDS_PLL,
}; };
#define F_MN(f, s, _m, _n) { .freq = f, .src = s, .m = _m, .n = _n } #define F_MN(f, s, _m, _n) { .freq = f, .src = s, .m = _m, .n = _n }
@ -143,6 +144,20 @@ static const struct clk_parent_data mmcc_pxo_dsi2_dsi1[] = {
{ .fw_name = "dsi1pll", .name = "dsi1pll" }, { .fw_name = "dsi1pll", .name = "dsi1pll" },
}; };
static const struct parent_map mmcc_pxo_dsi2_dsi1_lvds_map[] = {
{ P_PXO, 0 },
{ P_DSI2_PLL_DSICLK, 1 },
{ P_LVDS_PLL, 2 },
{ P_DSI1_PLL_DSICLK, 3 },
};
static const struct clk_parent_data mmcc_pxo_dsi2_dsi1_lvds[] = {
{ .fw_name = "pxo", .name = "pxo_board" },
{ .fw_name = "dsi2pll", .name = "dsi2pll" },
{ .fw_name = "lvdspll", .name = "mpd4_lvds_pll" },
{ .fw_name = "dsi1pll", .name = "dsi1pll" },
};
static const struct parent_map mmcc_pxo_dsi1_dsi2_byte_map[] = { static const struct parent_map mmcc_pxo_dsi1_dsi2_byte_map[] = {
{ P_PXO, 0 }, { P_PXO, 0 },
{ P_DSI1_PLL_BYTECLK, 1 }, { P_DSI1_PLL_BYTECLK, 1 },
@ -2439,26 +2454,42 @@ static struct clk_rcg dsi2_pixel_src = {
}, },
.s = { .s = {
.src_sel_shift = 0, .src_sel_shift = 0,
.parent_map = mmcc_pxo_dsi2_dsi1_map, .parent_map = mmcc_pxo_dsi2_dsi1_lvds_map,
}, },
.clkr = { .clkr = {
.enable_reg = 0x0094, .enable_reg = 0x0094,
.enable_mask = BIT(2), .enable_mask = BIT(2),
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "dsi2_pixel_src", .name = "dsi2_pixel_src",
.parent_data = mmcc_pxo_dsi2_dsi1, .parent_data = mmcc_pxo_dsi2_dsi1_lvds,
.num_parents = ARRAY_SIZE(mmcc_pxo_dsi2_dsi1), .num_parents = ARRAY_SIZE(mmcc_pxo_dsi2_dsi1_lvds),
.ops = &clk_rcg_pixel_ops, .ops = &clk_rcg_pixel_ops,
}, },
}, },
}; };
static struct clk_branch dsi2_pixel_lvds_src = {
.clkr = {
.enable_reg = 0x0094,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "dsi2_pixel_lvds_src",
.parent_hws = (const struct clk_hw*[]){
&dsi2_pixel_src.clkr.hw
},
.num_parents = 1,
.ops = &clk_branch_simple_ops,
.flags = CLK_SET_RATE_PARENT,
},
},
};
static struct clk_branch dsi2_pixel_clk = { static struct clk_branch dsi2_pixel_clk = {
.halt_reg = 0x01d0, .halt_reg = 0x01d0,
.halt_bit = 19, .halt_bit = 19,
.clkr = { .clkr = {
.enable_reg = 0x0094, .enable_reg = 0x0094,
.enable_mask = BIT(0), .enable_mask = 0,
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "mdp_pclk2_clk", .name = "mdp_pclk2_clk",
.parent_hws = (const struct clk_hw*[]){ .parent_hws = (const struct clk_hw*[]){
@ -2471,6 +2502,24 @@ static struct clk_branch dsi2_pixel_clk = {
}, },
}; };
static struct clk_branch lvds_clk = {
.halt_reg = 0x024c,
.halt_bit = 6,
.clkr = {
.enable_reg = 0x0264,
.enable_mask = BIT(1),
.hw.init = &(struct clk_init_data){
.name = "mdp_lvds_clk",
.parent_hws = (const struct clk_hw*[]){
&dsi2_pixel_lvds_src.clkr.hw
},
.num_parents = 1,
.ops = &clk_branch_ops,
.flags = CLK_SET_RATE_PARENT,
},
},
};
static struct clk_branch gfx2d0_ahb_clk = { static struct clk_branch gfx2d0_ahb_clk = {
.hwcg_reg = 0x0038, .hwcg_reg = 0x0038,
.hwcg_bit = 28, .hwcg_bit = 28,
@ -2799,6 +2848,8 @@ static struct clk_regmap *mmcc_msm8960_clks[] = {
[CSIPHY1_TIMER_CLK] = &csiphy1_timer_clk.clkr, [CSIPHY1_TIMER_CLK] = &csiphy1_timer_clk.clkr,
[CSIPHY0_TIMER_CLK] = &csiphy0_timer_clk.clkr, [CSIPHY0_TIMER_CLK] = &csiphy0_timer_clk.clkr,
[PLL2] = &pll2.clkr, [PLL2] = &pll2.clkr,
[DSI2_PIXEL_LVDS_SRC] = &dsi2_pixel_lvds_src.clkr,
[LVDS_CLK] = &lvds_clk.clkr,
}; };
static const struct qcom_reset_map mmcc_msm8960_resets[] = { static const struct qcom_reset_map mmcc_msm8960_resets[] = {
@ -2983,6 +3034,8 @@ static struct clk_regmap *mmcc_apq8064_clks[] = {
[VCAP_CLK] = &vcap_clk.clkr, [VCAP_CLK] = &vcap_clk.clkr,
[VCAP_NPL_CLK] = &vcap_npl_clk.clkr, [VCAP_NPL_CLK] = &vcap_npl_clk.clkr,
[PLL15] = &pll15.clkr, [PLL15] = &pll15.clkr,
[DSI2_PIXEL_LVDS_SRC] = &dsi2_pixel_lvds_src.clkr,
[LVDS_CLK] = &lvds_clk.clkr,
}; };
static const struct qcom_reset_map mmcc_apq8064_resets[] = { static const struct qcom_reset_map mmcc_apq8064_resets[] = {

View File

@ -0,0 +1,141 @@
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/*
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <dt-bindings/clock/qcom,sm8750-tcsr.h>
#include "clk-branch.h"
#include "clk-regmap.h"
#include "clk-regmap-divider.h"
#include "clk-regmap-mux.h"
#include "common.h"
enum {
DT_BI_TCXO_PAD,
};
static struct clk_branch tcsr_pcie_0_clkref_en = {
.halt_reg = 0x0,
.halt_check = BRANCH_HALT_DELAY,
.clkr = {
.enable_reg = 0x0,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "tcsr_pcie_0_clkref_en",
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch tcsr_ufs_clkref_en = {
.halt_reg = 0x1000,
.halt_check = BRANCH_HALT_DELAY,
.clkr = {
.enable_reg = 0x1000,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "tcsr_ufs_clkref_en",
.parent_data = &(const struct clk_parent_data){
.index = DT_BI_TCXO_PAD,
},
.num_parents = 1,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch tcsr_usb2_clkref_en = {
.halt_reg = 0x2000,
.halt_check = BRANCH_HALT_DELAY,
.clkr = {
.enable_reg = 0x2000,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "tcsr_usb2_clkref_en",
.parent_data = &(const struct clk_parent_data){
.index = DT_BI_TCXO_PAD,
},
.num_parents = 1,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch tcsr_usb3_clkref_en = {
.halt_reg = 0x3000,
.halt_check = BRANCH_HALT_DELAY,
.clkr = {
.enable_reg = 0x3000,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "tcsr_usb3_clkref_en",
.parent_data = &(const struct clk_parent_data){
.index = DT_BI_TCXO_PAD,
},
.num_parents = 1,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_regmap *tcsr_cc_sm8750_clocks[] = {
[TCSR_PCIE_0_CLKREF_EN] = &tcsr_pcie_0_clkref_en.clkr,
[TCSR_UFS_CLKREF_EN] = &tcsr_ufs_clkref_en.clkr,
[TCSR_USB2_CLKREF_EN] = &tcsr_usb2_clkref_en.clkr,
[TCSR_USB3_CLKREF_EN] = &tcsr_usb3_clkref_en.clkr,
};
static const struct regmap_config tcsr_cc_sm8750_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.max_register = 0x3000,
.fast_io = true,
};
static const struct qcom_cc_desc tcsr_cc_sm8750_desc = {
.config = &tcsr_cc_sm8750_regmap_config,
.clks = tcsr_cc_sm8750_clocks,
.num_clks = ARRAY_SIZE(tcsr_cc_sm8750_clocks),
};
static const struct of_device_id tcsr_cc_sm8750_match_table[] = {
{ .compatible = "qcom,sm8750-tcsr" },
{ }
};
MODULE_DEVICE_TABLE(of, tcsr_cc_sm8750_match_table);
static int tcsr_cc_sm8750_probe(struct platform_device *pdev)
{
return qcom_cc_probe(pdev, &tcsr_cc_sm8750_desc);
}
static struct platform_driver tcsr_cc_sm8750_driver = {
.probe = tcsr_cc_sm8750_probe,
.driver = {
.name = "tcsr_cc-sm8750",
.of_match_table = tcsr_cc_sm8750_match_table,
},
};
static int __init tcsr_cc_sm8750_init(void)
{
return platform_driver_register(&tcsr_cc_sm8750_driver);
}
subsys_initcall(tcsr_cc_sm8750_init);
static void __exit tcsr_cc_sm8750_exit(void)
{
platform_driver_unregister(&tcsr_cc_sm8750_driver);
}
module_exit(tcsr_cc_sm8750_exit);
MODULE_DESCRIPTION("QTI TCSR_CC SM8750 Driver");
MODULE_LICENSE("GPL");

View File

@ -535,11 +535,11 @@ static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents,
CLK_SET_RATE_PARENT); CLK_SET_RATE_PARENT);
/* /*
* DSI output seems to work only when PLL_MIPI selected. Set it and prevent * Experiments showed that RGB output requires pll-video0-2x, while DSI
* the mux from reparenting. * requires pll-mipi. It will not work with incorrect clock, the screen will
* be blank.
* sun50i-a64.dtsi assigns pll-mipi as TCON0 parent by default
*/ */
#define SUN50I_A64_TCON0_CLK_REG 0x118
static const char * const tcon0_parents[] = { "pll-mipi", "pll-video0-2x" }; static const char * const tcon0_parents[] = { "pll-mipi", "pll-video0-2x" };
static const u8 tcon0_table[] = { 0, 2, }; static const u8 tcon0_table[] = { 0, 2, };
static SUNXI_CCU_MUX_TABLE_WITH_GATE_CLOSEST(tcon0_clk, "tcon0", tcon0_parents, static SUNXI_CCU_MUX_TABLE_WITH_GATE_CLOSEST(tcon0_clk, "tcon0", tcon0_parents,
@ -959,11 +959,6 @@ static int sun50i_a64_ccu_probe(struct platform_device *pdev)
writel(0x515, reg + SUN50I_A64_PLL_MIPI_REG); writel(0x515, reg + SUN50I_A64_PLL_MIPI_REG);
/* Set PLL MIPI as parent for TCON0 */
val = readl(reg + SUN50I_A64_TCON0_CLK_REG);
val &= ~GENMASK(26, 24);
writel(val | (0 << 24), reg + SUN50I_A64_TCON0_CLK_REG);
ret = devm_sunxi_ccu_probe(&pdev->dev, reg, &sun50i_a64_ccu_desc); ret = devm_sunxi_ccu_probe(&pdev->dev, reg, &sun50i_a64_ccu_desc);
if (ret) if (ret)
return ret; return ret;

View File

@ -21,7 +21,6 @@
/* PLL_VIDEO0 exported for HDMI PHY */ /* PLL_VIDEO0 exported for HDMI PHY */
#define CLK_PLL_VIDEO0_2X 8
#define CLK_PLL_VE 9 #define CLK_PLL_VE 9
#define CLK_PLL_DDR0 10 #define CLK_PLL_DDR0 10
@ -32,7 +31,6 @@
#define CLK_PLL_PERIPH1_2X 14 #define CLK_PLL_PERIPH1_2X 14
#define CLK_PLL_VIDEO1 15 #define CLK_PLL_VIDEO1 15
#define CLK_PLL_GPU 16 #define CLK_PLL_GPU 16
#define CLK_PLL_MIPI 17
#define CLK_PLL_HSIC 18 #define CLK_PLL_HSIC 18
#define CLK_PLL_DE 19 #define CLK_PLL_DE 19
#define CLK_PLL_DDR1 20 #define CLK_PLL_DDR1 20

View File

@ -1107,11 +1107,24 @@ static const u32 usb2_clk_regs[] = {
SUN50I_H616_USB3_CLK_REG, SUN50I_H616_USB3_CLK_REG,
}; };
static struct ccu_mux_nb sun50i_h616_cpu_nb = {
.common = &cpux_clk.common,
.cm = &cpux_clk.mux,
.delay_us = 1, /* manual doesn't really say */
.bypass_index = 4, /* PLL_PERI0@600MHz, as recommended by manual */
};
static struct ccu_pll_nb sun50i_h616_pll_cpu_nb = {
.common = &pll_cpux_clk.common,
.enable = BIT(29), /* LOCK_ENABLE */
.lock = BIT(28),
};
static int sun50i_h616_ccu_probe(struct platform_device *pdev) static int sun50i_h616_ccu_probe(struct platform_device *pdev)
{ {
void __iomem *reg; void __iomem *reg;
u32 val; u32 val;
int i; int ret, i;
reg = devm_platform_ioremap_resource(pdev, 0); reg = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(reg)) if (IS_ERR(reg))
@ -1166,7 +1179,18 @@ static int sun50i_h616_ccu_probe(struct platform_device *pdev)
val |= BIT(24); val |= BIT(24);
writel(val, reg + SUN50I_H616_HDMI_CEC_CLK_REG); writel(val, reg + SUN50I_H616_HDMI_CEC_CLK_REG);
return devm_sunxi_ccu_probe(&pdev->dev, reg, &sun50i_h616_ccu_desc); ret = devm_sunxi_ccu_probe(&pdev->dev, reg, &sun50i_h616_ccu_desc);
if (ret)
return ret;
/* Reparent CPU during CPU PLL rate changes */
ccu_mux_notifier_register(pll_cpux_clk.common.hw.clk,
&sun50i_h616_cpu_nb);
/* Re-lock the CPU PLL after any rate changes */
ccu_pll_notifier_register(&sun50i_h616_pll_cpu_nb);
return 0;
} }
static const struct of_device_id sun50i_h616_ccu_ids[] = { static const struct of_device_id sun50i_h616_ccu_ids[] = {

View File

@ -52,6 +52,8 @@
#define WZRD_CLKFBOUT_MULT_SHIFT 8 #define WZRD_CLKFBOUT_MULT_SHIFT 8
#define WZRD_CLKFBOUT_MULT_MASK (0xff << WZRD_CLKFBOUT_MULT_SHIFT) #define WZRD_CLKFBOUT_MULT_MASK (0xff << WZRD_CLKFBOUT_MULT_SHIFT)
#define WZRD_CLKFBOUT_MULT_FRAC_MASK GENMASK(25, 16)
#define WZRD_CLKFBOUT_O_MASK GENMASK(7, 0)
#define WZRD_CLKFBOUT_L_SHIFT 0 #define WZRD_CLKFBOUT_L_SHIFT 0
#define WZRD_CLKFBOUT_H_SHIFT 8 #define WZRD_CLKFBOUT_H_SHIFT 8
#define WZRD_CLKFBOUT_L_MASK GENMASK(7, 0) #define WZRD_CLKFBOUT_L_MASK GENMASK(7, 0)
@ -87,14 +89,14 @@
#define DIV_O 0x01 #define DIV_O 0x01
#define DIV_ALL 0x03 #define DIV_ALL 0x03
#define WZRD_M_MIN 2 #define WZRD_M_MIN 2ULL
#define WZRD_M_MAX 128 #define WZRD_M_MAX 128ULL
#define WZRD_D_MIN 1 #define WZRD_D_MIN 1ULL
#define WZRD_D_MAX 106 #define WZRD_D_MAX 106ULL
#define WZRD_VCO_MIN 800000000 #define WZRD_VCO_MIN 800000000ULL
#define WZRD_VCO_MAX 1600000000 #define WZRD_VCO_MAX 1600000000ULL
#define WZRD_O_MIN 1 #define WZRD_O_MIN 2ULL
#define WZRD_O_MAX 128 #define WZRD_O_MAX 128ULL
#define VER_WZRD_M_MIN 4 #define VER_WZRD_M_MIN 4
#define VER_WZRD_M_MAX 432 #define VER_WZRD_M_MAX 432
#define VER_WZRD_D_MIN 1 #define VER_WZRD_D_MIN 1
@ -153,8 +155,10 @@ struct clk_wzrd {
* @flags: clk_wzrd divider flags * @flags: clk_wzrd divider flags
* @table: array of value/divider pairs, last entry should have div = 0 * @table: array of value/divider pairs, last entry should have div = 0
* @m: value of the multiplier * @m: value of the multiplier
* @m_frac: fractional value of the multiplier
* @d: value of the common divider * @d: value of the common divider
* @o: value of the leaf divider * @o: value of the leaf divider
* @o_frac: value of the fractional leaf divider
* @lock: register lock * @lock: register lock
*/ */
struct clk_wzrd_divider { struct clk_wzrd_divider {
@ -166,8 +170,10 @@ struct clk_wzrd_divider {
u8 flags; u8 flags;
const struct clk_div_table *table; const struct clk_div_table *table;
u32 m; u32 m;
u32 m_frac;
u32 d; u32 d;
u32 o; u32 o;
u32 o_frac;
spinlock_t *lock; /* divider lock */ spinlock_t *lock; /* divider lock */
}; };
@ -372,38 +378,40 @@ static int clk_wzrd_get_divisors(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) unsigned long parent_rate)
{ {
struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw); struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
u64 vco_freq, freq, diff, vcomin, vcomax; u64 vco_freq, freq, diff, vcomin, vcomax, best_diff = -1ULL;
u32 m, d, o; u64 m, d, o;
u32 mmin, mmax, dmin, dmax, omin, omax; u64 mmin, mmax, dmin, dmax, omin, omax, mdmin, mdmax;
mmin = WZRD_M_MIN; mmin = WZRD_M_MIN << 3;
mmax = WZRD_M_MAX; mmax = WZRD_M_MAX << 3;
dmin = WZRD_D_MIN; dmin = WZRD_D_MIN;
dmax = WZRD_D_MAX; dmax = WZRD_D_MAX;
omin = WZRD_O_MIN; omin = WZRD_O_MIN << 3;
omax = WZRD_O_MAX; omax = WZRD_O_MAX << 3;
vcomin = WZRD_VCO_MIN; vcomin = WZRD_VCO_MIN << 3;
vcomax = WZRD_VCO_MAX; vcomax = WZRD_VCO_MAX << 3;
for (m = mmin; m <= mmax; m++) { for (m = mmin; m <= mmax; m++) {
for (d = dmin; d <= dmax; d++) { mdmin = max(dmin, div64_u64(parent_rate * m + vcomax / 2, vcomax));
vco_freq = DIV_ROUND_CLOSEST((parent_rate * m), d); mdmax = min(dmax, div64_u64(parent_rate * m + vcomin / 2, vcomin));
if (vco_freq >= vcomin && vco_freq <= vcomax) { for (d = mdmin; d <= mdmax; d++) {
for (o = omin; o <= omax; o++) { vco_freq = DIV_ROUND_CLOSEST_ULL((parent_rate * m), d);
freq = DIV_ROUND_CLOSEST_ULL(vco_freq, o); o = DIV_ROUND_CLOSEST_ULL(vco_freq, rate);
diff = abs(freq - rate); if (o < omin || o > omax)
continue;
if (diff < WZRD_MIN_ERR) { freq = DIV_ROUND_CLOSEST_ULL(vco_freq, o);
divider->m = m; diff = freq - rate;
divider->d = d; if (diff < best_diff) {
divider->o = o; best_diff = diff;
return 0; divider->m = m >> 3;
} divider->m_frac = (m - (divider->m << 3)) * 125;
} divider->d = d;
divider->o = o >> 3;
divider->o_frac = (o - (divider->o << 3)) * 125;
} }
} }
} }
return -EBUSY; return best_diff < WZRD_MIN_ERR ? 0 : -EBUSY;
} }
static int clk_wzrd_reconfig(struct clk_wzrd_divider *divider, void __iomem *div_addr) static int clk_wzrd_reconfig(struct clk_wzrd_divider *divider, void __iomem *div_addr)
@ -496,33 +504,22 @@ static int clk_wzrd_dynamic_all_nolock(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) unsigned long parent_rate)
{ {
struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw); struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
unsigned long vco_freq, rate_div, clockout0_div;
void __iomem *div_addr; void __iomem *div_addr;
u32 reg, pre, f; u32 reg;
int err; int err;
err = clk_wzrd_get_divisors(hw, rate, parent_rate); err = clk_wzrd_get_divisors(hw, rate, parent_rate);
if (err) if (err)
return err; return err;
vco_freq = DIV_ROUND_CLOSEST(parent_rate * divider->m, divider->d); reg = FIELD_PREP(WZRD_CLKOUT_DIVIDE_MASK, divider->o) |
rate_div = DIV_ROUND_CLOSEST_ULL((vco_freq * WZRD_FRAC_POINTS), rate); FIELD_PREP(WZRD_CLKOUT0_FRAC_MASK, divider->o_frac);
clockout0_div = div_u64(rate_div, WZRD_FRAC_POINTS);
pre = DIV_ROUND_CLOSEST_ULL(vco_freq * WZRD_FRAC_POINTS, rate);
f = (pre - (clockout0_div * WZRD_FRAC_POINTS));
f &= WZRD_CLKOUT_FRAC_MASK;
reg = FIELD_PREP(WZRD_CLKOUT_DIVIDE_MASK, clockout0_div) |
FIELD_PREP(WZRD_CLKOUT0_FRAC_MASK, f);
writel(reg, divider->base + WZRD_CLK_CFG_REG(0, 2)); writel(reg, divider->base + WZRD_CLK_CFG_REG(0, 2));
/* Set divisor and clear phase offset */
reg = FIELD_PREP(WZRD_CLKFBOUT_MULT_MASK, divider->m) | reg = FIELD_PREP(WZRD_CLKFBOUT_MULT_MASK, divider->m) |
FIELD_PREP(WZRD_CLKFBOUT_MULT_FRAC_MASK, divider->m_frac) |
FIELD_PREP(WZRD_DIVCLK_DIVIDE_MASK, divider->d); FIELD_PREP(WZRD_DIVCLK_DIVIDE_MASK, divider->d);
writel(reg, divider->base + WZRD_CLK_CFG_REG(0, 0)); writel(reg, divider->base + WZRD_CLK_CFG_REG(0, 0));
writel(divider->o, divider->base + WZRD_CLK_CFG_REG(0, 2));
writel(0, divider->base + WZRD_CLK_CFG_REG(0, 3)); writel(0, divider->base + WZRD_CLK_CFG_REG(0, 3));
div_addr = divider->base + WZRD_DR_INIT_REG_OFFSET; div_addr = divider->base + WZRD_DR_INIT_REG_OFFSET;
return clk_wzrd_reconfig(divider, div_addr); return clk_wzrd_reconfig(divider, div_addr);
@ -564,18 +561,19 @@ static unsigned long clk_wzrd_recalc_rate_all(struct clk_hw *hw,
unsigned long parent_rate) unsigned long parent_rate)
{ {
struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw); struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
u32 m, d, o, div, reg, f; u32 m, d, o, reg, f, mf;
u64 mul;
reg = readl(divider->base + WZRD_CLK_CFG_REG(0, 0)); reg = readl(divider->base + WZRD_CLK_CFG_REG(0, 0));
d = FIELD_GET(WZRD_DIVCLK_DIVIDE_MASK, reg); d = FIELD_GET(WZRD_DIVCLK_DIVIDE_MASK, reg);
m = FIELD_GET(WZRD_CLKFBOUT_MULT_MASK, reg); m = FIELD_GET(WZRD_CLKFBOUT_MULT_MASK, reg);
mf = FIELD_GET(WZRD_CLKFBOUT_MULT_FRAC_MASK, reg);
reg = readl(divider->base + WZRD_CLK_CFG_REG(0, 2)); reg = readl(divider->base + WZRD_CLK_CFG_REG(0, 2));
o = FIELD_GET(WZRD_DIVCLK_DIVIDE_MASK, reg); o = FIELD_GET(WZRD_DIVCLK_DIVIDE_MASK, reg);
f = FIELD_GET(WZRD_CLKOUT0_FRAC_MASK, reg); f = FIELD_GET(WZRD_CLKOUT0_FRAC_MASK, reg);
div = DIV_ROUND_CLOSEST(d * (WZRD_FRAC_POINTS * o + f), WZRD_FRAC_POINTS); mul = m * 1000 + mf;
return divider_recalc_rate(hw, parent_rate * m, div, divider->table, return DIV_ROUND_CLOSEST_ULL(parent_rate * mul, d * (o * 1000 + f));
divider->flags, divider->width);
} }
static unsigned long clk_wzrd_recalc_rate_all_ver(struct clk_hw *hw, static unsigned long clk_wzrd_recalc_rate_all_ver(struct clk_hw *hw,
@ -646,6 +644,25 @@ static unsigned long clk_wzrd_recalc_rate_all_ver(struct clk_hw *hw,
static long clk_wzrd_round_rate_all(struct clk_hw *hw, unsigned long rate, static long clk_wzrd_round_rate_all(struct clk_hw *hw, unsigned long rate,
unsigned long *prate) unsigned long *prate)
{
struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
u32 m, d, o;
int err;
err = clk_wzrd_get_divisors(hw, rate, *prate);
if (err)
return err;
m = divider->m;
d = divider->d;
o = divider->o;
rate = div_u64(*prate * (m * 1000 + divider->m_frac), d * (o * 1000 + divider->o_frac));
return rate;
}
static long clk_wzrd_ver_round_rate_all(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
{ {
struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw); struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw);
unsigned long int_freq; unsigned long int_freq;
@ -678,7 +695,7 @@ static const struct clk_ops clk_wzrd_ver_divider_ops = {
}; };
static const struct clk_ops clk_wzrd_ver_div_all_ops = { static const struct clk_ops clk_wzrd_ver_div_all_ops = {
.round_rate = clk_wzrd_round_rate_all, .round_rate = clk_wzrd_ver_round_rate_all,
.set_rate = clk_wzrd_dynamic_all_ver, .set_rate = clk_wzrd_dynamic_all_ver,
.recalc_rate = clk_wzrd_recalc_rate_all_ver, .recalc_rate = clk_wzrd_recalc_rate_all_ver,
}; };

View File

@ -42,6 +42,10 @@
#define PMC_PLLADIV2 (PMC_MAIN + 11) #define PMC_PLLADIV2 (PMC_MAIN + 11)
#define PMC_LVDSPLL (PMC_MAIN + 12) #define PMC_LVDSPLL (PMC_MAIN + 12)
/* SAMA7D65 */
#define PMC_MCK3 (PMC_MAIN + 13)
#define PMC_MCK5 (PMC_MAIN + 14)
#ifndef AT91_PMC_MOSCS #ifndef AT91_PMC_MOSCS
#define AT91_PMC_MOSCS 0 /* MOSCS Flag */ #define AT91_PMC_MOSCS 0 /* MOSCS Flag */
#define AT91_PMC_LOCKA 1 /* PLLA Lock */ #define AT91_PMC_LOCKA 1 /* PLLA Lock */
@ -55,4 +59,8 @@
#define AT91_PMC_GCKRDY 24 /* Generated Clocks */ #define AT91_PMC_GCKRDY 24 /* Generated Clocks */
#endif #endif
/* Slow clock. */
#define SCKC_MD_SLCK 0
#define SCKC_TD_SLCK 1
#endif #endif

View File

@ -209,5 +209,6 @@
#define IMX91_CLK_ENET2_REGULAR 204 #define IMX91_CLK_ENET2_REGULAR 204
#define IMX91_CLK_ENET2_REGULAR_GATE 205 #define IMX91_CLK_ENET2_REGULAR_GATE 205
#define IMX91_CLK_ENET1_QOS_TSN_GATE 206 #define IMX91_CLK_ENET1_QOS_TSN_GATE 206
#define IMX93_CLK_SPDIF_IPG 207
#endif #endif

View File

@ -0,0 +1,22 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _DT_BINDINGS_CLK_QCOM_IPQ_CMN_PLL_H
#define _DT_BINDINGS_CLK_QCOM_IPQ_CMN_PLL_H
/* CMN PLL core clock. */
#define CMN_PLL_CLK 0
/* The output clocks from CMN PLL of IPQ9574. */
#define XO_24MHZ_CLK 1
#define SLEEP_32KHZ_CLK 2
#define PCS_31P25MHZ_CLK 3
#define NSS_1200MHZ_CLK 4
#define PPE_353MHZ_CLK 5
#define ETH0_50MHZ_CLK 6
#define ETH1_50MHZ_CLK 7
#define ETH2_50MHZ_CLK 8
#define ETH_25MHZ_CLK 9
#endif

View File

@ -12,7 +12,6 @@
#define GPLL2 2 #define GPLL2 2
#define GPLL2_OUT_MAIN 3 #define GPLL2_OUT_MAIN 3
#define GCC_SLEEP_CLK_SRC 4 #define GCC_SLEEP_CLK_SRC 4
#define GCC_APSS_DBG_CLK 5
#define GCC_USB0_EUD_AT_CLK 6 #define GCC_USB0_EUD_AT_CLK 6
#define GCC_PCIE0_AXI_M_CLK_SRC 7 #define GCC_PCIE0_AXI_M_CLK_SRC 7
#define GCC_PCIE0_AXI_M_CLK 8 #define GCC_PCIE0_AXI_M_CLK 8
@ -152,5 +151,6 @@
#define GCC_PCIE3_RCHNG_CLK_SRC 142 #define GCC_PCIE3_RCHNG_CLK_SRC 142
#define GCC_PCIE3_RCHNG_CLK 143 #define GCC_PCIE3_RCHNG_CLK 143
#define GCC_IM_SLEEP_CLK 144 #define GCC_IM_SLEEP_CLK 144
#define GCC_XO_CLK 145
#endif #endif

View File

@ -133,5 +133,7 @@
#define VCAP_CLK 124 #define VCAP_CLK 124
#define VCAP_NPL_CLK 125 #define VCAP_NPL_CLK 125
#define PLL15 126 #define PLL15 126
#define DSI2_PIXEL_LVDS_SRC 127
#define LVDS_CLK 128
#endif #endif

View File

@ -0,0 +1,211 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _DT_BINDINGS_CLK_QCOM_GCC_QCS615_H
#define _DT_BINDINGS_CLK_QCOM_GCC_QCS615_H
/* GCC clocks */
#define GPLL0_OUT_AUX2_DIV 0
#define GPLL3_OUT_AUX2_DIV 1
#define GPLL0 2
#define GPLL3 3
#define GPLL4 4
#define GPLL6 5
#define GPLL6_OUT_MAIN 6
#define GPLL7 7
#define GPLL8 8
#define GPLL8_OUT_MAIN 9
#define GCC_AGGRE_UFS_PHY_AXI_CLK 10
#define GCC_AGGRE_USB2_SEC_AXI_CLK 11
#define GCC_AGGRE_USB3_PRIM_AXI_CLK 12
#define GCC_AHB2PHY_EAST_CLK 13
#define GCC_AHB2PHY_WEST_CLK 14
#define GCC_BOOT_ROM_AHB_CLK 15
#define GCC_CAMERA_AHB_CLK 16
#define GCC_CAMERA_HF_AXI_CLK 17
#define GCC_CAMERA_XO_CLK 18
#define GCC_CE1_AHB_CLK 19
#define GCC_CE1_AXI_CLK 20
#define GCC_CE1_CLK 21
#define GCC_CFG_NOC_USB2_SEC_AXI_CLK 22
#define GCC_CFG_NOC_USB3_PRIM_AXI_CLK 23
#define GCC_CPUSS_AHB_CLK 24
#define GCC_CPUSS_AHB_CLK_SRC 25
#define GCC_CPUSS_GNOC_CLK 26
#define GCC_DDRSS_GPU_AXI_CLK 27
#define GCC_DISP_AHB_CLK 28
#define GCC_DISP_GPLL0_DIV_CLK_SRC 29
#define GCC_DISP_HF_AXI_CLK 30
#define GCC_DISP_XO_CLK 31
#define GCC_EMAC_AXI_CLK 32
#define GCC_EMAC_PTP_CLK 33
#define GCC_EMAC_PTP_CLK_SRC 34
#define GCC_EMAC_RGMII_CLK 35
#define GCC_EMAC_RGMII_CLK_SRC 36
#define GCC_EMAC_SLV_AHB_CLK 37
#define GCC_GP1_CLK 38
#define GCC_GP1_CLK_SRC 39
#define GCC_GP2_CLK 40
#define GCC_GP2_CLK_SRC 41
#define GCC_GP3_CLK 42
#define GCC_GP3_CLK_SRC 43
#define GCC_GPU_CFG_AHB_CLK 44
#define GCC_GPU_GPLL0_CLK_SRC 45
#define GCC_GPU_GPLL0_DIV_CLK_SRC 46
#define GCC_GPU_IREF_CLK 47
#define GCC_GPU_MEMNOC_GFX_CLK 48
#define GCC_GPU_SNOC_DVM_GFX_CLK 49
#define GCC_PCIE0_PHY_REFGEN_CLK 50
#define GCC_PCIE_0_AUX_CLK 51
#define GCC_PCIE_0_AUX_CLK_SRC 52
#define GCC_PCIE_0_CFG_AHB_CLK 53
#define GCC_PCIE_0_CLKREF_CLK 54
#define GCC_PCIE_0_MSTR_AXI_CLK 55
#define GCC_PCIE_0_PIPE_CLK 56
#define GCC_PCIE_0_SLV_AXI_CLK 57
#define GCC_PCIE_0_SLV_Q2A_AXI_CLK 58
#define GCC_PCIE_PHY_AUX_CLK 59
#define GCC_PCIE_PHY_REFGEN_CLK_SRC 60
#define GCC_PDM2_CLK 61
#define GCC_PDM2_CLK_SRC 62
#define GCC_PDM_AHB_CLK 63
#define GCC_PDM_XO4_CLK 64
#define GCC_PRNG_AHB_CLK 65
#define GCC_QMIP_CAMERA_NRT_AHB_CLK 66
#define GCC_QMIP_DISP_AHB_CLK 67
#define GCC_QMIP_PCIE_AHB_CLK 68
#define GCC_QMIP_VIDEO_VCODEC_AHB_CLK 69
#define GCC_QSPI_CNOC_PERIPH_AHB_CLK 70
#define GCC_QSPI_CORE_CLK 71
#define GCC_QSPI_CORE_CLK_SRC 72
#define GCC_QUPV3_WRAP0_CORE_2X_CLK 73
#define GCC_QUPV3_WRAP0_CORE_CLK 74
#define GCC_QUPV3_WRAP0_S0_CLK 75
#define GCC_QUPV3_WRAP0_S0_CLK_SRC 76
#define GCC_QUPV3_WRAP0_S1_CLK 77
#define GCC_QUPV3_WRAP0_S1_CLK_SRC 78
#define GCC_QUPV3_WRAP0_S2_CLK 79
#define GCC_QUPV3_WRAP0_S2_CLK_SRC 80
#define GCC_QUPV3_WRAP0_S3_CLK 81
#define GCC_QUPV3_WRAP0_S3_CLK_SRC 82
#define GCC_QUPV3_WRAP0_S4_CLK 83
#define GCC_QUPV3_WRAP0_S4_CLK_SRC 84
#define GCC_QUPV3_WRAP0_S5_CLK 85
#define GCC_QUPV3_WRAP0_S5_CLK_SRC 86
#define GCC_QUPV3_WRAP1_CORE_2X_CLK 87
#define GCC_QUPV3_WRAP1_CORE_CLK 88
#define GCC_QUPV3_WRAP1_S0_CLK 89
#define GCC_QUPV3_WRAP1_S0_CLK_SRC 90
#define GCC_QUPV3_WRAP1_S1_CLK 91
#define GCC_QUPV3_WRAP1_S1_CLK_SRC 92
#define GCC_QUPV3_WRAP1_S2_CLK 93
#define GCC_QUPV3_WRAP1_S2_CLK_SRC 94
#define GCC_QUPV3_WRAP1_S3_CLK 95
#define GCC_QUPV3_WRAP1_S3_CLK_SRC 96
#define GCC_QUPV3_WRAP1_S4_CLK 97
#define GCC_QUPV3_WRAP1_S4_CLK_SRC 98
#define GCC_QUPV3_WRAP1_S5_CLK 99
#define GCC_QUPV3_WRAP1_S5_CLK_SRC 100
#define GCC_QUPV3_WRAP_0_M_AHB_CLK 101
#define GCC_QUPV3_WRAP_0_S_AHB_CLK 102
#define GCC_QUPV3_WRAP_1_M_AHB_CLK 103
#define GCC_QUPV3_WRAP_1_S_AHB_CLK 104
#define GCC_RX1_USB2_CLKREF_CLK 105
#define GCC_RX3_USB2_CLKREF_CLK 106
#define GCC_SDCC1_AHB_CLK 107
#define GCC_SDCC1_APPS_CLK 108
#define GCC_SDCC1_APPS_CLK_SRC 109
#define GCC_SDCC1_ICE_CORE_CLK 110
#define GCC_SDCC1_ICE_CORE_CLK_SRC 111
#define GCC_SDCC2_AHB_CLK 112
#define GCC_SDCC2_APPS_CLK 113
#define GCC_SDCC2_APPS_CLK_SRC 114
#define GCC_SDR_CORE_CLK 115
#define GCC_SDR_CSR_HCLK 116
#define GCC_SDR_PRI_MI2S_CLK 117
#define GCC_SDR_SEC_MI2S_CLK 118
#define GCC_SDR_WR0_MEM_CLK 119
#define GCC_SDR_WR1_MEM_CLK 120
#define GCC_SDR_WR2_MEM_CLK 121
#define GCC_SYS_NOC_CPUSS_AHB_CLK 122
#define GCC_UFS_CARD_CLKREF_CLK 123
#define GCC_UFS_MEM_CLKREF_CLK 124
#define GCC_UFS_PHY_AHB_CLK 125
#define GCC_UFS_PHY_AXI_CLK 126
#define GCC_UFS_PHY_AXI_CLK_SRC 127
#define GCC_UFS_PHY_ICE_CORE_CLK 128
#define GCC_UFS_PHY_ICE_CORE_CLK_SRC 129
#define GCC_UFS_PHY_PHY_AUX_CLK 130
#define GCC_UFS_PHY_PHY_AUX_CLK_SRC 131
#define GCC_UFS_PHY_RX_SYMBOL_0_CLK 132
#define GCC_UFS_PHY_TX_SYMBOL_0_CLK 133
#define GCC_UFS_PHY_UNIPRO_CORE_CLK 134
#define GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC 135
#define GCC_USB20_SEC_MASTER_CLK 136
#define GCC_USB20_SEC_MASTER_CLK_SRC 137
#define GCC_USB20_SEC_MOCK_UTMI_CLK 138
#define GCC_USB20_SEC_MOCK_UTMI_CLK_SRC 139
#define GCC_USB20_SEC_SLEEP_CLK 140
#define GCC_USB2_PRIM_CLKREF_CLK 141
#define GCC_USB2_SEC_CLKREF_CLK 142
#define GCC_USB2_SEC_PHY_AUX_CLK 143
#define GCC_USB2_SEC_PHY_AUX_CLK_SRC 144
#define GCC_USB2_SEC_PHY_COM_AUX_CLK 145
#define GCC_USB2_SEC_PHY_PIPE_CLK 146
#define GCC_USB30_PRIM_MASTER_CLK 147
#define GCC_USB30_PRIM_MASTER_CLK_SRC 148
#define GCC_USB30_PRIM_MOCK_UTMI_CLK 149
#define GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC 150
#define GCC_USB30_PRIM_SLEEP_CLK 151
#define GCC_USB3_PRIM_CLKREF_CLK 152
#define GCC_USB3_PRIM_PHY_AUX_CLK 153
#define GCC_USB3_PRIM_PHY_AUX_CLK_SRC 154
#define GCC_USB3_PRIM_PHY_COM_AUX_CLK 155
#define GCC_USB3_PRIM_PHY_PIPE_CLK 156
#define GCC_USB3_SEC_CLKREF_CLK 157
#define GCC_VIDEO_AHB_CLK 158
#define GCC_VIDEO_AXI0_CLK 159
#define GCC_VIDEO_XO_CLK 160
#define GCC_VSENSOR_CLK_SRC 161
#define GCC_AGGRE_UFS_PHY_AXI_HW_CTL_CLK 162
#define GCC_UFS_PHY_AXI_HW_CTL_CLK 163
#define GCC_UFS_PHY_ICE_CORE_HW_CTL_CLK 164
#define GCC_UFS_PHY_PHY_AUX_HW_CTL_CLK 165
#define GCC_UFS_PHY_UNIPRO_CORE_HW_CTL_CLK 166
/* GCC Resets */
#define GCC_EMAC_BCR 0
#define GCC_QUSB2PHY_PRIM_BCR 1
#define GCC_QUSB2PHY_SEC_BCR 2
#define GCC_USB30_PRIM_BCR 3
#define GCC_USB2_PHY_SEC_BCR 4
#define GCC_USB3_DP_PHY_SEC_BCR 5
#define GCC_USB3PHY_PHY_SEC_BCR 6
#define GCC_PCIE_0_BCR 7
#define GCC_PCIE_0_PHY_BCR 8
#define GCC_PCIE_PHY_BCR 9
#define GCC_PCIE_PHY_COM_BCR 10
#define GCC_UFS_PHY_BCR 11
#define GCC_USB20_SEC_BCR 12
#define GCC_USB3_PHY_PRIM_SP0_BCR 13
#define GCC_USB3PHY_PHY_PRIM_SP0_BCR 14
#define GCC_SDCC1_BCR 15
#define GCC_SDCC2_BCR 16
/* GCC power domains */
#define EMAC_GDSC 0
#define PCIE_0_GDSC 1
#define UFS_PHY_GDSC 2
#define USB20_SEC_GDSC 3
#define USB30_PRIM_GDSC 4
#define HLOS1_VOTE_AGGRE_NOC_MMU_AUDIO_TBU_GDSC 5
#define HLOS1_VOTE_AGGRE_NOC_MMU_TBU1_GDSC 6
#define HLOS1_VOTE_AGGRE_NOC_MMU_TBU2_GDSC 7
#define HLOS1_VOTE_AGGRE_NOC_MMU_PCIE_TBU_GDSC 8
#define HLOS1_VOTE_MMNOC_MMU_TBU_HF0_GDSC 9
#define HLOS1_VOTE_MMNOC_MMU_TBU_SF_GDSC 10
#define HLOS1_VOTE_MMNOC_MMU_TBU_HF1_GDSC 11
#endif

View File

@ -0,0 +1,15 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* Copyright (c) 2023, Linaro Ltd.
*/
#ifndef _DT_BINDINGS_CLK_QCOM_LPASSCC_SM6115_H
#define _DT_BINDINGS_CLK_QCOM_LPASSCC_SM6115_H
/* LPASS CC */
#define LPASS_SWR_TX_CONFIG_CGCR 0
/* LPASS_AUDIO CC */
#define LPASS_AUDIO_SWR_RX_CGCR 0
#endif

View File

@ -0,0 +1,112 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* Copyright (c) 2022, The Linux Foundation. All rights reserved.
* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2024, Linaro Ltd.
*/
#ifndef _DT_BINDINGS_CLK_QCOM_SM8750_DISP_CC_H
#define _DT_BINDINGS_CLK_QCOM_SM8750_DISP_CC_H
/* DISP_CC clocks */
#define DISP_CC_ESYNC0_CLK 0
#define DISP_CC_ESYNC0_CLK_SRC 1
#define DISP_CC_ESYNC1_CLK 2
#define DISP_CC_ESYNC1_CLK_SRC 3
#define DISP_CC_MDSS_ACCU_SHIFT_CLK 4
#define DISP_CC_MDSS_AHB1_CLK 5
#define DISP_CC_MDSS_AHB_CLK 6
#define DISP_CC_MDSS_AHB_CLK_SRC 7
#define DISP_CC_MDSS_BYTE0_CLK 8
#define DISP_CC_MDSS_BYTE0_CLK_SRC 9
#define DISP_CC_MDSS_BYTE0_DIV_CLK_SRC 10
#define DISP_CC_MDSS_BYTE0_INTF_CLK 11
#define DISP_CC_MDSS_BYTE1_CLK 12
#define DISP_CC_MDSS_BYTE1_CLK_SRC 13
#define DISP_CC_MDSS_BYTE1_DIV_CLK_SRC 14
#define DISP_CC_MDSS_BYTE1_INTF_CLK 15
#define DISP_CC_MDSS_DPTX0_AUX_CLK 16
#define DISP_CC_MDSS_DPTX0_AUX_CLK_SRC 17
#define DISP_CC_MDSS_DPTX0_CRYPTO_CLK 18
#define DISP_CC_MDSS_DPTX0_LINK_CLK 19
#define DISP_CC_MDSS_DPTX0_LINK_CLK_SRC 20
#define DISP_CC_MDSS_DPTX0_LINK_DIV_CLK_SRC 21
#define DISP_CC_MDSS_DPTX0_LINK_INTF_CLK 22
#define DISP_CC_MDSS_DPTX0_PIXEL0_CLK 23
#define DISP_CC_MDSS_DPTX0_PIXEL0_CLK_SRC 24
#define DISP_CC_MDSS_DPTX0_PIXEL1_CLK 25
#define DISP_CC_MDSS_DPTX0_PIXEL1_CLK_SRC 26
#define DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK 27
#define DISP_CC_MDSS_DPTX1_AUX_CLK 28
#define DISP_CC_MDSS_DPTX1_AUX_CLK_SRC 29
#define DISP_CC_MDSS_DPTX1_CRYPTO_CLK 30
#define DISP_CC_MDSS_DPTX1_LINK_CLK 31
#define DISP_CC_MDSS_DPTX1_LINK_CLK_SRC 32
#define DISP_CC_MDSS_DPTX1_LINK_DIV_CLK_SRC 33
#define DISP_CC_MDSS_DPTX1_LINK_INTF_CLK 34
#define DISP_CC_MDSS_DPTX1_PIXEL0_CLK 35
#define DISP_CC_MDSS_DPTX1_PIXEL0_CLK_SRC 36
#define DISP_CC_MDSS_DPTX1_PIXEL1_CLK 37
#define DISP_CC_MDSS_DPTX1_PIXEL1_CLK_SRC 38
#define DISP_CC_MDSS_DPTX1_USB_ROUTER_LINK_INTF_CLK 39
#define DISP_CC_MDSS_DPTX2_AUX_CLK 40
#define DISP_CC_MDSS_DPTX2_AUX_CLK_SRC 41
#define DISP_CC_MDSS_DPTX2_CRYPTO_CLK 42
#define DISP_CC_MDSS_DPTX2_LINK_CLK 43
#define DISP_CC_MDSS_DPTX2_LINK_CLK_SRC 44
#define DISP_CC_MDSS_DPTX2_LINK_DIV_CLK_SRC 45
#define DISP_CC_MDSS_DPTX2_LINK_INTF_CLK 46
#define DISP_CC_MDSS_DPTX2_PIXEL0_CLK 47
#define DISP_CC_MDSS_DPTX2_PIXEL0_CLK_SRC 48
#define DISP_CC_MDSS_DPTX2_PIXEL1_CLK 49
#define DISP_CC_MDSS_DPTX2_PIXEL1_CLK_SRC 50
#define DISP_CC_MDSS_DPTX3_AUX_CLK 51
#define DISP_CC_MDSS_DPTX3_AUX_CLK_SRC 52
#define DISP_CC_MDSS_DPTX3_CRYPTO_CLK 53
#define DISP_CC_MDSS_DPTX3_LINK_CLK 54
#define DISP_CC_MDSS_DPTX3_LINK_CLK_SRC 55
#define DISP_CC_MDSS_DPTX3_LINK_DIV_CLK_SRC 56
#define DISP_CC_MDSS_DPTX3_LINK_INTF_CLK 57
#define DISP_CC_MDSS_DPTX3_PIXEL0_CLK 58
#define DISP_CC_MDSS_DPTX3_PIXEL0_CLK_SRC 59
#define DISP_CC_MDSS_ESC0_CLK 60
#define DISP_CC_MDSS_ESC0_CLK_SRC 61
#define DISP_CC_MDSS_ESC1_CLK 62
#define DISP_CC_MDSS_ESC1_CLK_SRC 63
#define DISP_CC_MDSS_MDP1_CLK 64
#define DISP_CC_MDSS_MDP_CLK 65
#define DISP_CC_MDSS_MDP_CLK_SRC 66
#define DISP_CC_MDSS_MDP_LUT1_CLK 67
#define DISP_CC_MDSS_MDP_LUT_CLK 68
#define DISP_CC_MDSS_NON_GDSC_AHB_CLK 69
#define DISP_CC_MDSS_PCLK0_CLK 70
#define DISP_CC_MDSS_PCLK0_CLK_SRC 71
#define DISP_CC_MDSS_PCLK1_CLK 72
#define DISP_CC_MDSS_PCLK1_CLK_SRC 73
#define DISP_CC_MDSS_PCLK2_CLK 74
#define DISP_CC_MDSS_PCLK2_CLK_SRC 75
#define DISP_CC_MDSS_RSCC_AHB_CLK 76
#define DISP_CC_MDSS_RSCC_VSYNC_CLK 77
#define DISP_CC_MDSS_VSYNC1_CLK 78
#define DISP_CC_MDSS_VSYNC_CLK 79
#define DISP_CC_MDSS_VSYNC_CLK_SRC 80
#define DISP_CC_OSC_CLK 81
#define DISP_CC_OSC_CLK_SRC 82
#define DISP_CC_PLL0 83
#define DISP_CC_PLL1 84
#define DISP_CC_PLL2 85
#define DISP_CC_SLEEP_CLK 86
#define DISP_CC_SLEEP_CLK_SRC 87
#define DISP_CC_XO_CLK 88
#define DISP_CC_XO_CLK_SRC 89
/* DISP_CC resets */
#define DISP_CC_MDSS_CORE_BCR 0
#define DISP_CC_MDSS_CORE_INT2_BCR 1
#define DISP_CC_MDSS_RSCC_BCR 2
/* DISP_CC GDSCR */
#define MDSS_GDSC 0
#define MDSS_INT2_GDSC 1
#endif

View File

@ -0,0 +1,226 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _DT_BINDINGS_CLK_QCOM_GCC_SM8750_H
#define _DT_BINDINGS_CLK_QCOM_GCC_SM8750_H
/* GCC clocks */
#define GCC_AGGRE_NOC_PCIE_AXI_CLK 0
#define GCC_AGGRE_UFS_PHY_AXI_CLK 1
#define GCC_AGGRE_UFS_PHY_AXI_HW_CTL_CLK 2
#define GCC_AGGRE_USB3_PRIM_AXI_CLK 3
#define GCC_BOOT_ROM_AHB_CLK 4
#define GCC_CAM_BIST_MCLK_AHB_CLK 5
#define GCC_CAMERA_AHB_CLK 6
#define GCC_CAMERA_HF_AXI_CLK 7
#define GCC_CAMERA_SF_AXI_CLK 8
#define GCC_CAMERA_XO_CLK 9
#define GCC_CFG_NOC_PCIE_ANOC_AHB_CLK 10
#define GCC_CFG_NOC_USB3_PRIM_AXI_CLK 11
#define GCC_CNOC_PCIE_SF_AXI_CLK 12
#define GCC_DDRSS_GPU_AXI_CLK 13
#define GCC_DDRSS_PCIE_SF_QTB_CLK 14
#define GCC_DISP_AHB_CLK 15
#define GCC_DISP_HF_AXI_CLK 16
#define GCC_EVA_AHB_CLK 17
#define GCC_EVA_AXI0_CLK 18
#define GCC_EVA_AXI0C_CLK 19
#define GCC_EVA_XO_CLK 20
#define GCC_GP1_CLK 21
#define GCC_GP1_CLK_SRC 22
#define GCC_GP2_CLK 23
#define GCC_GP2_CLK_SRC 24
#define GCC_GP3_CLK 25
#define GCC_GP3_CLK_SRC 26
#define GCC_GPLL0 27
#define GCC_GPLL0_OUT_EVEN 28
#define GCC_GPLL1 29
#define GCC_GPLL4 30
#define GCC_GPLL7 31
#define GCC_GPLL9 32
#define GCC_GPU_CFG_AHB_CLK 33
#define GCC_GPU_GEMNOC_GFX_CLK 34
#define GCC_GPU_GPLL0_CLK_SRC 35
#define GCC_GPU_GPLL0_DIV_CLK_SRC 36
#define GCC_PCIE_0_AUX_CLK 37
#define GCC_PCIE_0_AUX_CLK_SRC 38
#define GCC_PCIE_0_CFG_AHB_CLK 39
#define GCC_PCIE_0_MSTR_AXI_CLK 40
#define GCC_PCIE_0_PHY_RCHNG_CLK 41
#define GCC_PCIE_0_PHY_RCHNG_CLK_SRC 42
#define GCC_PCIE_0_PIPE_CLK 43
#define GCC_PCIE_0_PIPE_CLK_SRC 44
#define GCC_PCIE_0_SLV_AXI_CLK 45
#define GCC_PCIE_0_SLV_Q2A_AXI_CLK 46
#define GCC_PCIE_RSCC_CFG_AHB_CLK 47
#define GCC_PCIE_RSCC_XO_CLK 48
#define GCC_PDM2_CLK 49
#define GCC_PDM2_CLK_SRC 50
#define GCC_PDM_AHB_CLK 51
#define GCC_PDM_XO4_CLK 52
#define GCC_QMIP_CAMERA_CMD_AHB_CLK 53
#define GCC_QMIP_CAMERA_NRT_AHB_CLK 54
#define GCC_QMIP_CAMERA_RT_AHB_CLK 55
#define GCC_QMIP_GPU_AHB_CLK 56
#define GCC_QMIP_PCIE_AHB_CLK 57
#define GCC_QMIP_VIDEO_CV_CPU_AHB_CLK 58
#define GCC_QMIP_VIDEO_CVP_AHB_CLK 59
#define GCC_QMIP_VIDEO_V_CPU_AHB_CLK 60
#define GCC_QMIP_VIDEO_VCODEC_AHB_CLK 61
#define GCC_QUPV3_I2C_CORE_CLK 62
#define GCC_QUPV3_I2C_S0_CLK 63
#define GCC_QUPV3_I2C_S0_CLK_SRC 64
#define GCC_QUPV3_I2C_S1_CLK 65
#define GCC_QUPV3_I2C_S1_CLK_SRC 66
#define GCC_QUPV3_I2C_S2_CLK 67
#define GCC_QUPV3_I2C_S2_CLK_SRC 68
#define GCC_QUPV3_I2C_S3_CLK 69
#define GCC_QUPV3_I2C_S3_CLK_SRC 70
#define GCC_QUPV3_I2C_S4_CLK 71
#define GCC_QUPV3_I2C_S4_CLK_SRC 72
#define GCC_QUPV3_I2C_S5_CLK 73
#define GCC_QUPV3_I2C_S5_CLK_SRC 74
#define GCC_QUPV3_I2C_S6_CLK 75
#define GCC_QUPV3_I2C_S6_CLK_SRC 76
#define GCC_QUPV3_I2C_S7_CLK 77
#define GCC_QUPV3_I2C_S7_CLK_SRC 78
#define GCC_QUPV3_I2C_S8_CLK 79
#define GCC_QUPV3_I2C_S8_CLK_SRC 80
#define GCC_QUPV3_I2C_S9_CLK 81
#define GCC_QUPV3_I2C_S9_CLK_SRC 82
#define GCC_QUPV3_I2C_S_AHB_CLK 83
#define GCC_QUPV3_WRAP1_CORE_2X_CLK 84
#define GCC_QUPV3_WRAP1_CORE_CLK 85
#define GCC_QUPV3_WRAP1_QSPI_REF_CLK 86
#define GCC_QUPV3_WRAP1_QSPI_REF_CLK_SRC 87
#define GCC_QUPV3_WRAP1_S0_CLK 88
#define GCC_QUPV3_WRAP1_S0_CLK_SRC 89
#define GCC_QUPV3_WRAP1_S1_CLK 90
#define GCC_QUPV3_WRAP1_S1_CLK_SRC 91
#define GCC_QUPV3_WRAP1_S2_CLK 92
#define GCC_QUPV3_WRAP1_S2_CLK_SRC 93
#define GCC_QUPV3_WRAP1_S3_CLK 94
#define GCC_QUPV3_WRAP1_S3_CLK_SRC 95
#define GCC_QUPV3_WRAP1_S4_CLK 96
#define GCC_QUPV3_WRAP1_S4_CLK_SRC 97
#define GCC_QUPV3_WRAP1_S5_CLK 98
#define GCC_QUPV3_WRAP1_S5_CLK_SRC 99
#define GCC_QUPV3_WRAP1_S6_CLK 100
#define GCC_QUPV3_WRAP1_S6_CLK_SRC 101
#define GCC_QUPV3_WRAP1_S7_CLK 102
#define GCC_QUPV3_WRAP1_S7_CLK_SRC 103
#define GCC_QUPV3_WRAP2_CORE_2X_CLK 104
#define GCC_QUPV3_WRAP2_CORE_CLK 105
#define GCC_QUPV3_WRAP2_IBI_CTRL_0_CLK_SRC 106
#define GCC_QUPV3_WRAP2_IBI_CTRL_2_CLK 107
#define GCC_QUPV3_WRAP2_IBI_CTRL_3_CLK 108
#define GCC_QUPV3_WRAP2_S0_CLK 109
#define GCC_QUPV3_WRAP2_S0_CLK_SRC 110
#define GCC_QUPV3_WRAP2_S1_CLK 111
#define GCC_QUPV3_WRAP2_S1_CLK_SRC 112
#define GCC_QUPV3_WRAP2_S2_CLK 113
#define GCC_QUPV3_WRAP2_S2_CLK_SRC 114
#define GCC_QUPV3_WRAP2_S3_CLK 115
#define GCC_QUPV3_WRAP2_S3_CLK_SRC 116
#define GCC_QUPV3_WRAP2_S4_CLK 117
#define GCC_QUPV3_WRAP2_S4_CLK_SRC 118
#define GCC_QUPV3_WRAP2_S5_CLK 119
#define GCC_QUPV3_WRAP2_S5_CLK_SRC 120
#define GCC_QUPV3_WRAP2_S6_CLK 121
#define GCC_QUPV3_WRAP2_S6_CLK_SRC 122
#define GCC_QUPV3_WRAP2_S7_CLK 123
#define GCC_QUPV3_WRAP2_S7_CLK_SRC 124
#define GCC_QUPV3_WRAP_1_M_AHB_CLK 125
#define GCC_QUPV3_WRAP_1_S_AHB_CLK 126
#define GCC_QUPV3_WRAP_2_IBI_2_AHB_CLK 127
#define GCC_QUPV3_WRAP_2_IBI_3_AHB_CLK 128
#define GCC_QUPV3_WRAP_2_M_AHB_CLK 129
#define GCC_QUPV3_WRAP_2_S_AHB_CLK 130
#define GCC_SDCC2_AHB_CLK 131
#define GCC_SDCC2_APPS_CLK 132
#define GCC_SDCC2_APPS_CLK_SRC 133
#define GCC_SDCC4_AHB_CLK 134
#define GCC_SDCC4_APPS_CLK 135
#define GCC_SDCC4_APPS_CLK_SRC 136
#define GCC_UFS_PHY_AHB_CLK 137
#define GCC_UFS_PHY_AXI_CLK 138
#define GCC_UFS_PHY_AXI_CLK_SRC 139
#define GCC_UFS_PHY_AXI_HW_CTL_CLK 140
#define GCC_UFS_PHY_ICE_CORE_CLK 141
#define GCC_UFS_PHY_ICE_CORE_CLK_SRC 142
#define GCC_UFS_PHY_ICE_CORE_HW_CTL_CLK 143
#define GCC_UFS_PHY_PHY_AUX_CLK 144
#define GCC_UFS_PHY_PHY_AUX_CLK_SRC 145
#define GCC_UFS_PHY_PHY_AUX_HW_CTL_CLK 146
#define GCC_UFS_PHY_RX_SYMBOL_0_CLK 147
#define GCC_UFS_PHY_RX_SYMBOL_0_CLK_SRC 148
#define GCC_UFS_PHY_RX_SYMBOL_1_CLK 149
#define GCC_UFS_PHY_RX_SYMBOL_1_CLK_SRC 150
#define GCC_UFS_PHY_TX_SYMBOL_0_CLK 151
#define GCC_UFS_PHY_TX_SYMBOL_0_CLK_SRC 152
#define GCC_UFS_PHY_UNIPRO_CORE_CLK 153
#define GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC 154
#define GCC_UFS_PHY_UNIPRO_CORE_HW_CTL_CLK 155
#define GCC_USB30_PRIM_MASTER_CLK 156
#define GCC_USB30_PRIM_MASTER_CLK_SRC 157
#define GCC_USB30_PRIM_MOCK_UTMI_CLK 158
#define GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC 159
#define GCC_USB30_PRIM_MOCK_UTMI_POSTDIV_CLK_SRC 160
#define GCC_USB30_PRIM_SLEEP_CLK 161
#define GCC_USB3_PRIM_PHY_AUX_CLK 162
#define GCC_USB3_PRIM_PHY_AUX_CLK_SRC 163
#define GCC_USB3_PRIM_PHY_COM_AUX_CLK 164
#define GCC_USB3_PRIM_PHY_PIPE_CLK 165
#define GCC_USB3_PRIM_PHY_PIPE_CLK_SRC 166
#define GCC_VIDEO_AHB_CLK 167
#define GCC_VIDEO_AXI0_CLK 168
#define GCC_VIDEO_AXI1_CLK 169
#define GCC_VIDEO_XO_CLK 170
/* GCC power domains */
#define GCC_PCIE_0_GDSC 0
#define GCC_PCIE_0_PHY_GDSC 1
#define GCC_UFS_MEM_PHY_GDSC 2
#define GCC_UFS_PHY_GDSC 3
#define GCC_USB30_PRIM_GDSC 4
#define GCC_USB3_PHY_GDSC 5
/* GCC resets */
#define GCC_CAMERA_BCR 0
#define GCC_DISPLAY_BCR 1
#define GCC_EVA_BCR 2
#define GCC_GPU_BCR 3
#define GCC_PCIE_0_BCR 4
#define GCC_PCIE_0_LINK_DOWN_BCR 5
#define GCC_PCIE_0_NOCSR_COM_PHY_BCR 6
#define GCC_PCIE_0_PHY_BCR 7
#define GCC_PCIE_0_PHY_NOCSR_COM_PHY_BCR 8
#define GCC_PCIE_PHY_BCR 9
#define GCC_PCIE_PHY_CFG_AHB_BCR 10
#define GCC_PCIE_PHY_COM_BCR 11
#define GCC_PCIE_RSCC_BCR 12
#define GCC_PDM_BCR 13
#define GCC_QUPV3_WRAPPER_1_BCR 14
#define GCC_QUPV3_WRAPPER_2_BCR 15
#define GCC_QUPV3_WRAPPER_I2C_BCR 16
#define GCC_QUSB2PHY_PRIM_BCR 17
#define GCC_QUSB2PHY_SEC_BCR 18
#define GCC_SDCC2_BCR 19
#define GCC_SDCC4_BCR 20
#define GCC_UFS_PHY_BCR 21
#define GCC_USB30_PRIM_BCR 22
#define GCC_USB3_DP_PHY_PRIM_BCR 23
#define GCC_USB3_DP_PHY_SEC_BCR 24
#define GCC_USB3_PHY_PRIM_BCR 25
#define GCC_USB3_PHY_SEC_BCR 26
#define GCC_USB3PHY_PHY_PRIM_BCR 27
#define GCC_USB3PHY_PHY_SEC_BCR 28
#define GCC_VIDEO_AXI0_CLK_ARES 29
#define GCC_VIDEO_AXI1_CLK_ARES 30
#define GCC_VIDEO_BCR 31
#define GCC_EVA_AXI0_CLK_ARES 32
#define GCC_EVA_AXI0C_CLK_ARES 33
#endif

View File

@ -0,0 +1,15 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _DT_BINDINGS_CLK_QCOM_TCSR_CC_SM8750_H
#define _DT_BINDINGS_CLK_QCOM_TCSR_CC_SM8750_H
/* TCSR_CC clocks */
#define TCSR_PCIE_0_CLKREF_EN 0
#define TCSR_UFS_CLKREF_EN 1
#define TCSR_USB2_CLKREF_EN 2
#define TCSR_USB3_CLKREF_EN 3
#endif

View File

@ -33,9 +33,22 @@
#define GPU_CC_SLEEP_CLK 23 #define GPU_CC_SLEEP_CLK 23
#define GPU_CC_XO_CLK_SRC 24 #define GPU_CC_XO_CLK_SRC 24
#define GPU_CC_XO_DIV_CLK_SRC 25 #define GPU_CC_XO_DIV_CLK_SRC 25
#define GPU_CC_CX_ACCU_SHIFT_CLK 26
#define GPU_CC_GX_ACCU_SHIFT_CLK 27
/* GDSCs */ /* GDSCs */
#define GPU_CX_GDSC 0 #define GPU_CX_GDSC 0
#define GPU_GX_GDSC 1 #define GPU_GX_GDSC 1
/* GPU_CC resets */
#define GPU_CC_ACD_BCR 0
#define GPU_CC_CB_BCR 1
#define GPU_CC_CX_BCR 2
#define GPU_CC_FAST_HUB_BCR 3
#define GPU_CC_FF_BCR 4
#define GPU_CC_GFX3D_AON_BCR 5
#define GPU_CC_GMU_BCR 6
#define GPU_CC_GX_BCR 7
#define GPU_CC_XO_BCR 8
#endif #endif

View File

@ -44,7 +44,9 @@
#define _DT_BINDINGS_CLK_SUN50I_A64_H_ #define _DT_BINDINGS_CLK_SUN50I_A64_H_
#define CLK_PLL_VIDEO0 7 #define CLK_PLL_VIDEO0 7
#define CLK_PLL_VIDEO0_2X 8
#define CLK_PLL_PERIPH0 11 #define CLK_PLL_PERIPH0 11
#define CLK_PLL_MIPI 17
#define CLK_CPUX 21 #define CLK_CPUX 21
#define CLK_BUS_MIPI_DSI 28 #define CLK_BUS_MIPI_DSI 28

View File

@ -0,0 +1,24 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
#ifndef INTERCONNECT_QCOM_IPQ5424_H
#define INTERCONNECT_QCOM_IPQ5424_H
#define MASTER_ANOC_PCIE0 0
#define SLAVE_ANOC_PCIE0 1
#define MASTER_CNOC_PCIE0 2
#define SLAVE_CNOC_PCIE0 3
#define MASTER_ANOC_PCIE1 4
#define SLAVE_ANOC_PCIE1 5
#define MASTER_CNOC_PCIE1 6
#define SLAVE_CNOC_PCIE1 7
#define MASTER_ANOC_PCIE2 8
#define SLAVE_ANOC_PCIE2 9
#define MASTER_CNOC_PCIE2 10
#define SLAVE_CNOC_PCIE2 11
#define MASTER_ANOC_PCIE3 12
#define SLAVE_ANOC_PCIE3 13
#define MASTER_CNOC_PCIE3 14
#define SLAVE_CNOC_PCIE3 15
#define MASTER_CNOC_USB 16
#define SLAVE_CNOC_USB 17
#endif /* INTERCONNECT_QCOM_IPQ5424_H */