Merge branches 'clk-marvell', 'clk-adi', 'clk-qcom' and 'clk-devm' into clk-next

- Add devm_clk_bulk_get_all_enabled() to return number of clks acquired
 - Marvell PXA1908 SoC clks

* clk-marvell:
  clk: mmp: Add Marvell PXA1908 MPMU driver
  clk: mmp: Add Marvell PXA1908 APMU driver
  clk: mmp: Add Marvell PXA1908 APBCP driver
  clk: mmp: Add Marvell PXA1908 APBC driver
  dt-bindings: clock: Add Marvell PXA1908 clock bindings
  clk: mmp: Switch to use struct u32_fract instead of custom one

* clk-adi:
  clk: clk-axi-clkgen: make sure to enable the AXI bus clock
  dt-bindings: clock: axi-clkgen: include AXI clk

* clk-qcom: (43 commits)
  clk: qcom: remove unused data from gcc-ipq5424.c
  clk: qcom: Add support for Global Clock Controller on QCS8300
  dt-bindings: clock: qcom: Add GCC clocks for QCS8300
  clk: qcom: add Global Clock controller (GCC) driver for IPQ5424 SoC
  clk: qcom: clk-alpha-pll: Add NSS HUAYRA ALPHA PLL support for ipq9574
  dt-bindings: clock: Add Qualcomm IPQ5424 GCC binding
  clk: qcom: add SAR2130P GPU Clock Controller support
  clk: qcom: dispcc-sm8550: enable support for SAR2130P
  clk: qcom: tcsrcc-sm8550: add SAR2130P support
  clk: qcom: add support for GCC on SAR2130P
  clk: qcom: rpmh: add support for SAR2130P
  clk: qcom: rcg2: add clk_rcg2_shared_floor_ops
  dt-bindings: clk: qcom,sm8450-gpucc: add SAR2130P compatibles
  dt-bindings: clock: qcom,sm8550-dispcc: Add SAR2130P compatible
  dt-bindings: clock: qcom,sm8550-tcsr: Add SAR2130P compatible
  dt-bindings: clock: qcom: document SAR2130P Global Clock Controller
  dt-bindings: clock: qcom,rpmhcc: Add SAR2130P compatible
  clk: qcom: Make GCC_6125 depend on QCOM_GDSC
  dt-bindings: clock: qcom: gcc-ipq9574: remove q6 bring up clock macros
  dt-bindings: clock: qcom: gcc-ipq5332: remove q6 bring up clock macros
  ...

* clk-devm:
  clk: Provide devm_clk_bulk_get_all_enabled() helper
This commit is contained in:
Stephen Boyd 2024-11-18 20:01:35 -08:00
69 changed files with 18265 additions and 876 deletions

View File

@ -26,9 +26,21 @@ properties:
description:
Specifies the reference clock(s) from which the output frequency is
derived. This must either reference one clock if only the first clock
input is connected or two if both clock inputs are connected.
minItems: 1
maxItems: 2
input is connected or two if both clock inputs are connected. The last
clock is the AXI bus clock that needs to be enabled so we can access the
core registers.
minItems: 2
maxItems: 3
clock-names:
oneOf:
- items:
- const: clkin1
- const: s_axi_aclk
- items:
- const: clkin1
- const: clkin2
- const: s_axi_aclk
'#clock-cells':
const: 0
@ -40,6 +52,7 @@ required:
- compatible
- reg
- clocks
- clock-names
- '#clock-cells'
additionalProperties: false
@ -50,5 +63,6 @@ examples:
compatible = "adi,axi-clkgen-2.00.a";
#clock-cells = <0>;
reg = <0xff000000 0x1000>;
clocks = <&osc 1>;
clocks = <&osc 1>, <&clkc 15>;
clock-names = "clkin1", "s_axi_aclk";
};

View File

@ -0,0 +1,48 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/marvell,pxa1908.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Marvell PXA1908 Clock Controllers
maintainers:
- Duje Mihanović <duje.mihanovic@skole.hr>
description: |
The PXA1908 clock subsystem generates and supplies clock to various
controllers within the PXA1908 SoC. The PXA1908 contains numerous clock
controller blocks, with the ones currently supported being APBC, APBCP, MPMU
and APMU roughly corresponding to internal buses.
All these clock identifiers could be found in <include/dt-bindings/marvell,pxa1908.h>.
properties:
compatible:
enum:
- marvell,pxa1908-apbc
- marvell,pxa1908-apbcp
- marvell,pxa1908-mpmu
- marvell,pxa1908-apmu
reg:
maxItems: 1
'#clock-cells':
const: 1
required:
- compatible
- reg
- '#clock-cells'
additionalProperties: false
examples:
# APMU block:
- |
clock-controller@d4282800 {
compatible = "marvell,pxa1908-apmu";
reg = <0xd4282800 0x400>;
#clock-cells = <1>;
};

View File

@ -17,7 +17,9 @@ description: |
properties:
compatible:
const: qcom,gcc-sm8450
enum:
- qcom,gcc-sm8450
- qcom,sm8475-gcc
clocks:
items:

View File

@ -4,31 +4,35 @@
$id: http://devicetree.org/schemas/clock/qcom,ipq5332-gcc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Global Clock & Reset Controller on IPQ5332
title: Qualcomm Global Clock & Reset Controller on IPQ5332 and IPQ5424
maintainers:
- Bjorn Andersson <andersson@kernel.org>
description: |
Qualcomm global clock control module provides the clocks, resets and power
domains on IPQ5332.
domains on IPQ5332 and IPQ5424.
See also:: include/dt-bindings/clock/qcom,gcc-ipq5332.h
allOf:
- $ref: qcom,gcc.yaml#
See also:
include/dt-bindings/clock/qcom,gcc-ipq5332.h
include/dt-bindings/clock/qcom,gcc-ipq5424.h
properties:
compatible:
const: qcom,ipq5332-gcc
enum:
- qcom,ipq5332-gcc
- qcom,ipq5424-gcc
clocks:
minItems: 5
items:
- description: Board XO clock source
- description: Sleep clock source
- description: PCIE 2lane PHY pipe clock source
- description: PCIE 2lane x1 PHY pipe clock source (For second lane)
- description: USB PCIE wrapper pipe clock source
- description: PCIE 2-lane PHY2 pipe clock source
- description: PCIE 2-lane PHY3 pipe clock source
'#power-domain-cells': false
'#interconnect-cells':
@ -38,6 +42,29 @@ required:
- compatible
- clocks
allOf:
- $ref: qcom,gcc.yaml#
- if:
properties:
compatible:
contains:
const: qcom,ipq5332-gcc
then:
properties:
clocks:
maxItems: 5
- if:
properties:
compatible:
contains:
const: qcom,ipq5424-gcc
then:
properties:
clocks:
minItems: 7
maxItems: 7
unevaluatedProperties: false
examples:

View File

@ -0,0 +1,66 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/qcom,qcs8300-gcc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Technologies, Inc. Global Clock & Reset Controller on QCS8300
maintainers:
- Taniya Das <quic_tdas@quicinc.com>
- Imran Shaik <quic_imrashai@quicinc.com>
description: |
Qualcomm Technologies, Inc. Global clock control module provides the clocks, resets and
power domains on QCS8300
See also: include/dt-bindings/clock/qcom,qcs8300-gcc.h
properties:
compatible:
const: qcom,qcs8300-gcc
clocks:
items:
- description: Board XO source
- description: Sleep clock source
- description: PCIE 0 Pipe clock source
- description: PCIE 1 Pipe clock source
- description: PCIE Phy Auxiliary clock source
- description: First EMAC controller reference clock
- 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,qcs8300-gcc";
reg = <0x00100000 0xc7018>;
clocks = <&rpmhcc RPMH_CXO_CLK>,
<&sleep_clk>,
<&pcie_0_pipe_clk>,
<&pcie_1_pipe_clk>,
<&pcie_phy_aux_clk>,
<&rxc0_ref_clk>,
<&ufs_phy_rx_symbol_0_clk>,
<&ufs_phy_rx_symbol_1_clk>,
<&ufs_phy_tx_symbol_0_clk>,
<&usb3_phy_wrapper_gcc_usb30_prim_pipe_clk>;
#clock-cells = <1>;
#reset-cells = <1>;
#power-domain-cells = <1>;
};
...

View File

@ -19,6 +19,7 @@ properties:
enum:
- qcom,qdu1000-rpmh-clk
- qcom,sa8775p-rpmh-clk
- qcom,sar2130p-rpmh-clk
- qcom,sc7180-rpmh-clk
- qcom,sc7280-rpmh-clk
- qcom,sc8180x-rpmh-clk

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,sa8775p-camcc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Camera Clock & Reset Controller on SA8775P
maintainers:
- Taniya Das <quic_tdas@quicinc.com>
description: |
Qualcomm camera clock control module provides the clocks, resets and power
domains on SA8775p.
See also: include/dt-bindings/clock/qcom,sa8775p-camcc.h
properties:
compatible:
enum:
- qcom,sa8775p-camcc
clocks:
items:
- description: Camera AHB clock from GCC
- description: Board XO source
- description: Board active XO source
- description: Sleep clock source
power-domains:
maxItems: 1
description: MMCX power domain
required:
- compatible
- clocks
- power-domains
- '#power-domain-cells'
allOf:
- $ref: qcom,gcc.yaml#
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/clock/qcom,sa8775p-gcc.h>
clock-controller@ade0000 {
compatible = "qcom,sa8775p-camcc";
reg = <0x0ade0000 0x20000>;
clocks = <&gcc GCC_CAMERA_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>,
<&rpmhcc RPMH_CXO_CLK_A>,
<&sleep_clk>;
power-domains = <&rpmhpd SA8775P_MMCX>;
#clock-cells = <1>;
#reset-cells = <1>;
#power-domain-cells = <1>;
};
...

View File

@ -0,0 +1,79 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/qcom,sa8775p-dispcc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Display Clock & Reset Controller on SA8775P
maintainers:
- Taniya Das <quic_tdas@quicinc.com>
description: |
Qualcomm display clock control module provides the clocks, resets and power
domains on SA8775P.
See also: include/dt-bindings/clock/qcom,sa8775p-dispcc.h
properties:
compatible:
enum:
- qcom,sa8775p-dispcc0
- qcom,sa8775p-dispcc1
clocks:
items:
- description: GCC AHB clock source
- description: Board XO source
- description: Board XO_AO source
- description: Sleep clock source
- description: Link clock from DP0 PHY
- description: VCO DIV clock from DP0 PHY
- description: Link clock from DP1 PHY
- description: VCO DIV clock from DP1 PHY
- description: Byte clock from DSI0 PHY
- description: Pixel clock from DSI0 PHY
- description: Byte clock from DSI1 PHY
- description: Pixel clock from DSI1 PHY
power-domains:
maxItems: 1
description: MMCX power domain
required:
- compatible
- clocks
- power-domains
- '#power-domain-cells'
allOf:
- $ref: qcom,gcc.yaml#
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/clock/qcom,sa8775p-gcc.h>
clock-controller@af00000 {
compatible = "qcom,sa8775p-dispcc0";
reg = <0x0af00000 0x20000>;
clocks = <&gcc GCC_DISP_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>,
<&rpmhcc RPMH_CXO_CLK_A>,
<&sleep_clk>,
<&dp_phy0 0>,
<&dp_phy0 1>,
<&dp_phy1 2>,
<&dp_phy1 3>,
<&dsi_phy0 0>,
<&dsi_phy0 1>,
<&dsi_phy1 2>,
<&dsi_phy1 3>;
power-domains = <&rpmhpd SA8775P_MMCX>;
#clock-cells = <1>;
#reset-cells = <1>;
#power-domain-cells = <1>;
};
...

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,sa8775p-videocc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Video Clock & Reset Controller on SA8775P
maintainers:
- Taniya Das <quic_tdas@quicinc.com>
description: |
Qualcomm video clock control module provides the clocks, resets and power
domains on SA8775P.
See also: include/dt-bindings/clock/qcom,sa8775p-videocc.h
properties:
compatible:
enum:
- qcom,sa8775p-videocc
clocks:
items:
- description: Video AHB clock from GCC
- description: Board XO source
- description: Board active XO source
- description: Sleep Clock source
power-domains:
maxItems: 1
description: MMCX power domain
required:
- compatible
- clocks
- power-domains
- '#power-domain-cells'
allOf:
- $ref: qcom,gcc.yaml#
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/clock/qcom,sa8775p-gcc.h>
videocc: clock-controller@abf0000 {
compatible = "qcom,sa8775p-videocc";
reg = <0x0abf0000 0x10000>;
clocks = <&gcc GCC_VIDEO_AHB_CLK>,
<&rpmhcc RPMH_CXO_CLK>,
<&rpmhcc RPMH_CXO_CLK_A>,
<&sleep_clk>;
power-domains = <&rpmhpd SA8775P_MMCX>;
#clock-cells = <1>;
#reset-cells = <1>;
#power-domain-cells = <1>;
};
...

View File

@ -0,0 +1,65 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/qcom,sar2130p-gcc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Global Clock & Reset Controller on sar2130p
maintainers:
- Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
description: |
Qualcomm global clock control module provides the clocks, resets and
power domains on sar2130p.
See also: include/dt-bindings/clock/qcom,sar2130p-gcc.h
properties:
compatible:
const: qcom,sar2130p-gcc
clocks:
items:
- description: XO reference clock
- description: Sleep clock
- description: PCIe 0 pipe clock
- description: PCIe 1 pipe clock
- description: Primary USB3 PHY wrapper pipe clock
protected-clocks:
maxItems: 240
power-domains:
maxItems: 1
required:
- compatible
- clocks
- '#power-domain-cells'
allOf:
- $ref: qcom,gcc.yaml#
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/power/qcom,rpmhpd.h>
gcc: clock-controller@100000 {
compatible = "qcom,sar2130p-gcc";
reg = <0x100000 0x1f4200>;
clocks = <&rpmhcc RPMH_CXO_CLK>,
<&sleep_clk>,
<&pcie_0_pipe_clk>,
<&pcie_1_pipe_clk>,
<&usb_0_ssphy>;
power-domains = <&rpmhpd RPMHPD_CX>;
#clock-cells = <1>;
#reset-cells = <1>;
#power-domain-cells = <1>;
};
...

View File

@ -26,6 +26,7 @@ properties:
enum:
- qcom,sc8280xp-camcc
- qcom,sm8450-camcc
- qcom,sm8475-camcc
- qcom,sm8550-camcc
- qcom,sm8650-camcc
- qcom,x1e80100-camcc

View File

@ -19,6 +19,7 @@ properties:
compatible:
enum:
- qcom,sm8450-dispcc
- qcom,sm8475-dispcc
clocks:
minItems: 3

View File

@ -14,6 +14,7 @@ description: |
domains on Qualcomm SoCs.
See also::
include/dt-bindings/clock/qcom,sar2130p-gpucc.h
include/dt-bindings/clock/qcom,sm4450-gpucc.h
include/dt-bindings/clock/qcom,sm8450-gpucc.h
include/dt-bindings/clock/qcom,sm8550-gpucc.h
@ -24,8 +25,10 @@ description: |
properties:
compatible:
enum:
- qcom,sar2130p-gpucc
- qcom,sm4450-gpucc
- qcom,sm8450-gpucc
- qcom,sm8475-gpucc
- qcom,sm8550-gpucc
- qcom,sm8650-gpucc
- qcom,x1e80100-gpucc

View File

@ -22,6 +22,7 @@ properties:
compatible:
enum:
- qcom,sm8450-videocc
- qcom,sm8475-videocc
- qcom,sm8550-videocc
- qcom,sm8650-videocc

View File

@ -22,6 +22,7 @@ description: |
properties:
compatible:
enum:
- qcom,sar2130p-dispcc
- qcom,sm8550-dispcc
- qcom,sm8650-dispcc
- qcom,x1e80100-dispcc

View File

@ -21,6 +21,7 @@ properties:
compatible:
items:
- enum:
- qcom,sar2130p-tcsr
- qcom,sm8550-tcsr
- qcom,sm8650-tcsr
- qcom,x1e80100-tcsr

View File

@ -7,6 +7,7 @@
*/
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/slab.h>
#include <linux/io.h>
@ -512,6 +513,7 @@ static int axi_clkgen_probe(struct platform_device *pdev)
struct clk_init_data init;
const char *parent_names[2];
const char *clk_name;
struct clk *axi_clk;
unsigned int i;
int ret;
@ -528,8 +530,24 @@ static int axi_clkgen_probe(struct platform_device *pdev)
return PTR_ERR(axi_clkgen->base);
init.num_parents = of_clk_get_parent_count(pdev->dev.of_node);
if (init.num_parents < 1 || init.num_parents > 2)
return -EINVAL;
axi_clk = devm_clk_get_enabled(&pdev->dev, "s_axi_aclk");
if (!IS_ERR(axi_clk)) {
if (init.num_parents < 2 || init.num_parents > 3)
return -EINVAL;
init.num_parents -= 1;
} else {
/*
* Legacy... So that old DTs which do not have clock-names still
* work. In this case we don't explicitly enable the AXI bus
* clock.
*/
if (PTR_ERR(axi_clk) != -ENOENT)
return PTR_ERR(axi_clk);
if (init.num_parents < 1 || init.num_parents > 2)
return -EINVAL;
}
for (i = 0; i < init.num_parents; i++) {
parent_names[i] = of_clk_get_parent_name(pdev->dev.of_node, i);

View File

@ -218,8 +218,8 @@ static void devm_clk_bulk_release_all_enable(struct device *dev, void *res)
clk_bulk_put_all(devres->num_clks, devres->clks);
}
int __must_check devm_clk_bulk_get_all_enable(struct device *dev,
struct clk_bulk_data **clks)
int __must_check devm_clk_bulk_get_all_enabled(struct device *dev,
struct clk_bulk_data **clks)
{
struct clk_bulk_devres *devres;
int ret;
@ -244,11 +244,12 @@ int __must_check devm_clk_bulk_get_all_enable(struct device *dev,
} else {
clk_bulk_put_all(devres->num_clks, devres->clks);
devres_free(devres);
return ret;
}
return ret;
return devres->num_clks;
}
EXPORT_SYMBOL_GPL(devm_clk_bulk_get_all_enable);
EXPORT_SYMBOL_GPL(devm_clk_bulk_get_all_enabled);
static int devm_clk_match(struct device *dev, void *res, void *data)
{

View File

@ -11,4 +11,4 @@ obj-$(CONFIG_MACH_MMP_DT) += clk-of-pxa168.o clk-of-pxa910.o
obj-$(CONFIG_COMMON_CLK_MMP2) += clk-of-mmp2.o clk-pll.o pwr-island.o
obj-$(CONFIG_COMMON_CLK_MMP2_AUDIO) += clk-audio.o
obj-y += clk-of-pxa1928.o
obj-$(CONFIG_ARCH_MMP) += clk-of-pxa1928.o clk-pxa1908-apbc.o clk-pxa1908-apbcp.o clk-pxa1908-apmu.o clk-pxa1908-mpmu.o

View File

@ -26,14 +26,15 @@ static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate,
{
struct mmp_clk_factor *factor = to_clk_factor(hw);
u64 rate = 0, prev_rate;
struct u32_fract *d;
int i;
for (i = 0; i < factor->ftbl_cnt; i++) {
prev_rate = rate;
rate = *prate;
rate *= factor->ftbl[i].den;
do_div(rate, factor->ftbl[i].num * factor->masks->factor);
d = &factor->ftbl[i];
prev_rate = rate;
rate = (u64)(*prate) * d->denominator;
do_div(rate, d->numerator * factor->masks->factor);
if (rate > drate)
break;
}
@ -52,23 +53,22 @@ static unsigned long clk_factor_recalc_rate(struct clk_hw *hw,
{
struct mmp_clk_factor *factor = to_clk_factor(hw);
struct mmp_clk_factor_masks *masks = factor->masks;
unsigned int val, num, den;
struct u32_fract d;
unsigned int val;
u64 rate;
val = readl_relaxed(factor->base);
/* calculate numerator */
num = (val >> masks->num_shift) & masks->num_mask;
d.numerator = (val >> masks->num_shift) & masks->num_mask;
/* calculate denominator */
den = (val >> masks->den_shift) & masks->den_mask;
if (!den)
d.denominator = (val >> masks->den_shift) & masks->den_mask;
if (!d.denominator)
return 0;
rate = parent_rate;
rate *= den;
do_div(rate, num * factor->masks->factor);
rate = (u64)parent_rate * d.denominator;
do_div(rate, d.numerator * factor->masks->factor);
return rate;
}
@ -82,18 +82,18 @@ static int clk_factor_set_rate(struct clk_hw *hw, unsigned long drate,
int i;
unsigned long val;
unsigned long flags = 0;
struct u32_fract *d;
u64 rate = 0;
for (i = 0; i < factor->ftbl_cnt; i++) {
rate = prate;
rate *= factor->ftbl[i].den;
do_div(rate, factor->ftbl[i].num * factor->masks->factor);
d = &factor->ftbl[i];
rate = (u64)prate * d->denominator;
do_div(rate, d->numerator * factor->masks->factor);
if (rate > drate)
break;
}
if (i > 0)
i--;
d = i ? &factor->ftbl[i - 1] : &factor->ftbl[0];
if (factor->lock)
spin_lock_irqsave(factor->lock, flags);
@ -101,10 +101,10 @@ static int clk_factor_set_rate(struct clk_hw *hw, unsigned long drate,
val = readl_relaxed(factor->base);
val &= ~(masks->num_mask << masks->num_shift);
val |= (factor->ftbl[i].num & masks->num_mask) << masks->num_shift;
val |= (d->numerator & masks->num_mask) << masks->num_shift;
val &= ~(masks->den_mask << masks->den_shift);
val |= (factor->ftbl[i].den & masks->den_mask) << masks->den_shift;
val |= (d->denominator & masks->den_mask) << masks->den_shift;
writel_relaxed(val, factor->base);
@ -118,7 +118,8 @@ static int clk_factor_init(struct clk_hw *hw)
{
struct mmp_clk_factor *factor = to_clk_factor(hw);
struct mmp_clk_factor_masks *masks = factor->masks;
u32 val, num, den;
struct u32_fract d;
u32 val;
int i;
unsigned long flags = 0;
@ -128,23 +129,22 @@ static int clk_factor_init(struct clk_hw *hw)
val = readl(factor->base);
/* calculate numerator */
num = (val >> masks->num_shift) & masks->num_mask;
d.numerator = (val >> masks->num_shift) & masks->num_mask;
/* calculate denominator */
den = (val >> masks->den_shift) & masks->den_mask;
d.denominator = (val >> masks->den_shift) & masks->den_mask;
for (i = 0; i < factor->ftbl_cnt; i++)
if (den == factor->ftbl[i].den && num == factor->ftbl[i].num)
if (d.denominator == factor->ftbl[i].denominator &&
d.numerator == factor->ftbl[i].numerator)
break;
if (i >= factor->ftbl_cnt) {
val &= ~(masks->num_mask << masks->num_shift);
val |= (factor->ftbl[0].num & masks->num_mask) <<
masks->num_shift;
val |= (factor->ftbl[0].numerator & masks->num_mask) << masks->num_shift;
val &= ~(masks->den_mask << masks->den_shift);
val |= (factor->ftbl[0].den & masks->den_mask) <<
masks->den_shift;
val |= (factor->ftbl[0].denominator & masks->den_mask) << masks->den_shift;
}
if (!(val & masks->enable_mask) || i >= factor->ftbl_cnt) {
@ -168,8 +168,7 @@ static const struct clk_ops clk_factor_ops = {
struct clk *mmp_clk_register_factor(const char *name, const char *parent_name,
unsigned long flags, void __iomem *base,
struct mmp_clk_factor_masks *masks,
struct mmp_clk_factor_tbl *ftbl,
unsigned int ftbl_cnt, spinlock_t *lock)
struct u32_fract *ftbl, unsigned int ftbl_cnt, spinlock_t *lock)
{
struct mmp_clk_factor *factor;
struct clk_init_data init;

View File

@ -143,9 +143,9 @@ static struct mmp_clk_factor_masks uart_factor_masks = {
.den_shift = 0,
};
static struct mmp_clk_factor_tbl uart_factor_tbl[] = {
{.num = 8125, .den = 1536}, /*14.745MHZ */
{.num = 3521, .den = 689}, /*19.23MHZ */
static struct u32_fract uart_factor_tbl[] = {
{ .numerator = 8125, .denominator = 1536 }, /* 14.745MHZ */
{ .numerator = 3521, .denominator = 689 }, /* 19.23MHZ */
};
static struct mmp_clk_factor_masks i2s_factor_masks = {
@ -157,16 +157,16 @@ static struct mmp_clk_factor_masks i2s_factor_masks = {
.enable_mask = 0xd0000000,
};
static struct mmp_clk_factor_tbl i2s_factor_tbl[] = {
{.num = 24868, .den = 511}, /* 2.0480 MHz */
{.num = 28003, .den = 793}, /* 2.8224 MHz */
{.num = 24941, .den = 1025}, /* 4.0960 MHz */
{.num = 28003, .den = 1586}, /* 5.6448 MHz */
{.num = 31158, .den = 2561}, /* 8.1920 MHz */
{.num = 16288, .den = 1845}, /* 11.2896 MHz */
{.num = 20772, .den = 2561}, /* 12.2880 MHz */
{.num = 8144, .den = 1845}, /* 22.5792 MHz */
{.num = 10386, .den = 2561}, /* 24.5760 MHz */
static struct u32_fract i2s_factor_tbl[] = {
{ .numerator = 24868, .denominator = 511 }, /* 2.0480 MHz */
{ .numerator = 28003, .denominator = 793 }, /* 2.8224 MHz */
{ .numerator = 24941, .denominator = 1025 }, /* 4.0960 MHz */
{ .numerator = 28003, .denominator = 1586 }, /* 5.6448 MHz */
{ .numerator = 31158, .denominator = 2561 }, /* 8.1920 MHz */
{ .numerator = 16288, .denominator = 1845 }, /* 11.2896 MHz */
{ .numerator = 20772, .denominator = 2561 }, /* 12.2880 MHz */
{ .numerator = 8144, .denominator = 1845 }, /* 22.5792 MHz */
{ .numerator = 10386, .denominator = 2561 }, /* 24.5760 MHz */
};
static DEFINE_SPINLOCK(acgr_lock);

View File

@ -106,8 +106,8 @@ static struct mmp_clk_factor_masks uart_factor_masks = {
.den_shift = 0,
};
static struct mmp_clk_factor_tbl uart_factor_tbl[] = {
{.num = 8125, .den = 1536}, /*14.745MHZ */
static struct u32_fract uart_factor_tbl[] = {
{ .numerator = 8125, .denominator = 1536 }, /* 14.745MHZ */
};
static void pxa168_pll_init(struct pxa168_clk_unit *pxa_unit)

View File

@ -61,9 +61,9 @@ static struct mmp_clk_factor_masks uart_factor_masks = {
.den_shift = 0,
};
static struct mmp_clk_factor_tbl uart_factor_tbl[] = {
{.num = 832, .den = 234}, /*58.5MHZ */
{.num = 1, .den = 1}, /*26MHZ */
static struct u32_fract uart_factor_tbl[] = {
{ .numerator = 832, .denominator = 234 }, /* 58.5MHZ */
{ .numerator = 1, .denominator = 1 }, /* 26MHZ */
};
static void pxa1928_pll_init(struct pxa1928_clk_unit *pxa_unit)

View File

@ -86,8 +86,8 @@ static struct mmp_clk_factor_masks uart_factor_masks = {
.den_shift = 0,
};
static struct mmp_clk_factor_tbl uart_factor_tbl[] = {
{.num = 8125, .den = 1536}, /*14.745MHZ */
static struct u32_fract uart_factor_tbl[] = {
{ .numerator = 8125, .denominator = 1536 }, /* 14.745MHZ */
};
static void pxa910_pll_init(struct pxa910_clk_unit *pxa_unit)

View File

@ -0,0 +1,130 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <dt-bindings/clock/marvell,pxa1908.h>
#include "clk.h"
#define APBC_UART0 0x0
#define APBC_UART1 0x4
#define APBC_GPIO 0x8
#define APBC_PWM0 0xc
#define APBC_PWM1 0x10
#define APBC_PWM2 0x14
#define APBC_PWM3 0x18
#define APBC_SSP0 0x1c
#define APBC_SSP1 0x20
#define APBC_IPC_RST 0x24
#define APBC_RTC 0x28
#define APBC_TWSI0 0x2c
#define APBC_KPC 0x30
#define APBC_SWJTAG 0x40
#define APBC_SSP2 0x4c
#define APBC_TWSI1 0x60
#define APBC_THERMAL 0x6c
#define APBC_TWSI3 0x70
#define APBC_NR_CLKS 19
struct pxa1908_clk_unit {
struct mmp_clk_unit unit;
void __iomem *base;
};
static DEFINE_SPINLOCK(pwm0_lock);
static DEFINE_SPINLOCK(pwm2_lock);
static DEFINE_SPINLOCK(uart0_lock);
static DEFINE_SPINLOCK(uart1_lock);
static const char * const uart_parent_names[] = {"pll1_117", "uart_pll"};
static const char * const ssp_parent_names[] = {"pll1_d16", "pll1_d48", "pll1_d24", "pll1_d12"};
static struct mmp_param_gate_clk apbc_gate_clks[] = {
{PXA1908_CLK_TWSI0, "twsi0_clk", "pll1_32", CLK_SET_RATE_PARENT, APBC_TWSI0, 0x7, 3, 0, 0, NULL},
{PXA1908_CLK_TWSI1, "twsi1_clk", "pll1_32", CLK_SET_RATE_PARENT, APBC_TWSI1, 0x7, 3, 0, 0, NULL},
{PXA1908_CLK_TWSI3, "twsi3_clk", "pll1_32", CLK_SET_RATE_PARENT, APBC_TWSI3, 0x7, 3, 0, 0, NULL},
{PXA1908_CLK_GPIO, "gpio_clk", "vctcxo", CLK_SET_RATE_PARENT, APBC_GPIO, 0x7, 3, 0, 0, NULL},
{PXA1908_CLK_KPC, "kpc_clk", "clk32", CLK_SET_RATE_PARENT, APBC_KPC, 0x7, 3, 0, MMP_CLK_GATE_NEED_DELAY, NULL},
{PXA1908_CLK_RTC, "rtc_clk", "clk32", CLK_SET_RATE_PARENT, APBC_RTC, 0x87, 0x83, 0, MMP_CLK_GATE_NEED_DELAY, NULL},
{PXA1908_CLK_PWM0, "pwm0_clk", "pwm01_apb_share", CLK_SET_RATE_PARENT, APBC_PWM0, 0x2, 2, 0, 0, &pwm0_lock},
{PXA1908_CLK_PWM1, "pwm1_clk", "pwm01_apb_share", CLK_SET_RATE_PARENT, APBC_PWM1, 0x6, 2, 0, 0, NULL},
{PXA1908_CLK_PWM2, "pwm2_clk", "pwm23_apb_share", CLK_SET_RATE_PARENT, APBC_PWM2, 0x2, 2, 0, 0, NULL},
{PXA1908_CLK_PWM3, "pwm3_clk", "pwm23_apb_share", CLK_SET_RATE_PARENT, APBC_PWM3, 0x6, 2, 0, 0, NULL},
{PXA1908_CLK_UART0, "uart0_clk", "uart0_mux", CLK_SET_RATE_PARENT, APBC_UART0, 0x7, 3, 0, 0, &uart0_lock},
{PXA1908_CLK_UART1, "uart1_clk", "uart1_mux", CLK_SET_RATE_PARENT, APBC_UART1, 0x7, 3, 0, 0, &uart1_lock},
{PXA1908_CLK_THERMAL, "thermal_clk", NULL, 0, APBC_THERMAL, 0x7, 3, 0, 0, NULL},
{PXA1908_CLK_IPC_RST, "ipc_clk", NULL, 0, APBC_IPC_RST, 0x7, 3, 0, 0, NULL},
{PXA1908_CLK_SSP0, "ssp0_clk", "ssp0_mux", 0, APBC_SSP0, 0x7, 3, 0, 0, NULL},
{PXA1908_CLK_SSP2, "ssp2_clk", "ssp2_mux", 0, APBC_SSP2, 0x7, 3, 0, 0, NULL},
};
static struct mmp_param_mux_clk apbc_mux_clks[] = {
{0, "uart0_mux", uart_parent_names, ARRAY_SIZE(uart_parent_names), CLK_SET_RATE_PARENT, APBC_UART0, 4, 3, 0, &uart0_lock},
{0, "uart1_mux", uart_parent_names, ARRAY_SIZE(uart_parent_names), CLK_SET_RATE_PARENT, APBC_UART1, 4, 3, 0, &uart1_lock},
{0, "ssp0_mux", ssp_parent_names, ARRAY_SIZE(ssp_parent_names), 0, APBC_SSP0, 4, 3, 0, NULL},
{0, "ssp2_mux", ssp_parent_names, ARRAY_SIZE(ssp_parent_names), 0, APBC_SSP2, 4, 3, 0, NULL},
};
static void pxa1908_apb_periph_clk_init(struct pxa1908_clk_unit *pxa_unit)
{
struct mmp_clk_unit *unit = &pxa_unit->unit;
struct clk *clk;
mmp_clk_register_gate(NULL, "pwm01_apb_share", "pll1_d48",
CLK_SET_RATE_PARENT,
pxa_unit->base + APBC_PWM0,
0x5, 1, 0, 0, &pwm0_lock);
mmp_clk_register_gate(NULL, "pwm23_apb_share", "pll1_d48",
CLK_SET_RATE_PARENT,
pxa_unit->base + APBC_PWM2,
0x5, 1, 0, 0, &pwm2_lock);
clk = mmp_clk_register_apbc("swjtag", NULL,
pxa_unit->base + APBC_SWJTAG, 10, 0, NULL);
mmp_clk_add(unit, PXA1908_CLK_SWJTAG, clk);
mmp_register_mux_clks(unit, apbc_mux_clks, pxa_unit->base,
ARRAY_SIZE(apbc_mux_clks));
mmp_register_gate_clks(unit, apbc_gate_clks, pxa_unit->base,
ARRAY_SIZE(apbc_gate_clks));
}
static int pxa1908_apbc_probe(struct platform_device *pdev)
{
struct pxa1908_clk_unit *pxa_unit;
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
if (IS_ERR(pxa_unit))
return PTR_ERR(pxa_unit);
pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pxa_unit->base))
return PTR_ERR(pxa_unit->base);
mmp_clk_init(pdev->dev.of_node, &pxa_unit->unit, APBC_NR_CLKS);
pxa1908_apb_periph_clk_init(pxa_unit);
return 0;
}
static const struct of_device_id pxa1908_apbc_match_table[] = {
{ .compatible = "marvell,pxa1908-apbc" },
{ }
};
MODULE_DEVICE_TABLE(of, pxa1908_apbc_match_table);
static struct platform_driver pxa1908_apbc_driver = {
.probe = pxa1908_apbc_probe,
.driver = {
.name = "pxa1908-apbc",
.of_match_table = pxa1908_apbc_match_table
}
};
module_platform_driver(pxa1908_apbc_driver);
MODULE_AUTHOR("Duje Mihanović <duje.mihanovic@skole.hr>");
MODULE_DESCRIPTION("Marvell PXA1908 APBC Clock Driver");
MODULE_LICENSE("GPL");

View File

@ -0,0 +1,82 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <dt-bindings/clock/marvell,pxa1908.h>
#include "clk.h"
#define APBCP_UART2 0x1c
#define APBCP_TWSI2 0x28
#define APBCP_AICER 0x38
#define APBCP_NR_CLKS 4
struct pxa1908_clk_unit {
struct mmp_clk_unit unit;
void __iomem *base;
};
static DEFINE_SPINLOCK(uart2_lock);
static const char * const uart_parent_names[] = {"pll1_117", "uart_pll"};
static struct mmp_param_gate_clk apbcp_gate_clks[] = {
{PXA1908_CLK_UART2, "uart2_clk", "uart2_mux", CLK_SET_RATE_PARENT, APBCP_UART2, 0x7, 0x3, 0x0, 0, &uart2_lock},
{PXA1908_CLK_TWSI2, "twsi2_clk", "pll1_32", CLK_SET_RATE_PARENT, APBCP_TWSI2, 0x7, 0x3, 0x0, 0, NULL},
{PXA1908_CLK_AICER, "ripc_clk", NULL, 0, APBCP_AICER, 0x7, 0x2, 0x0, 0, NULL},
};
static struct mmp_param_mux_clk apbcp_mux_clks[] = {
{0, "uart2_mux", uart_parent_names, ARRAY_SIZE(uart_parent_names), CLK_SET_RATE_PARENT, APBCP_UART2, 4, 3, 0, &uart2_lock},
};
static void pxa1908_apb_p_periph_clk_init(struct pxa1908_clk_unit *pxa_unit)
{
struct mmp_clk_unit *unit = &pxa_unit->unit;
mmp_register_mux_clks(unit, apbcp_mux_clks, pxa_unit->base,
ARRAY_SIZE(apbcp_mux_clks));
mmp_register_gate_clks(unit, apbcp_gate_clks, pxa_unit->base,
ARRAY_SIZE(apbcp_gate_clks));
}
static int pxa1908_apbcp_probe(struct platform_device *pdev)
{
struct pxa1908_clk_unit *pxa_unit;
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
if (IS_ERR(pxa_unit))
return PTR_ERR(pxa_unit);
pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pxa_unit->base))
return PTR_ERR(pxa_unit->base);
mmp_clk_init(pdev->dev.of_node, &pxa_unit->unit, APBCP_NR_CLKS);
pxa1908_apb_p_periph_clk_init(pxa_unit);
return 0;
}
static const struct of_device_id pxa1908_apbcp_match_table[] = {
{ .compatible = "marvell,pxa1908-apbcp" },
{ }
};
MODULE_DEVICE_TABLE(of, pxa1908_apbcp_match_table);
static struct platform_driver pxa1908_apbcp_driver = {
.probe = pxa1908_apbcp_probe,
.driver = {
.name = "pxa1908-apbcp",
.of_match_table = pxa1908_apbcp_match_table
}
};
module_platform_driver(pxa1908_apbcp_driver);
MODULE_AUTHOR("Duje Mihanović <duje.mihanovic@skole.hr>");
MODULE_DESCRIPTION("Marvell PXA1908 APBCP Clock Driver");
MODULE_LICENSE("GPL");

View File

@ -0,0 +1,121 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <dt-bindings/clock/marvell,pxa1908.h>
#include "clk.h"
#define APMU_CLK_GATE_CTRL 0x40
#define APMU_CCIC1 0x24
#define APMU_ISP 0x38
#define APMU_DSI1 0x44
#define APMU_DISP1 0x4c
#define APMU_CCIC0 0x50
#define APMU_SDH0 0x54
#define APMU_SDH1 0x58
#define APMU_USB 0x5c
#define APMU_NF 0x60
#define APMU_VPU 0xa4
#define APMU_GC 0xcc
#define APMU_SDH2 0xe0
#define APMU_GC2D 0xf4
#define APMU_TRACE 0x108
#define APMU_DVC_DFC_DEBUG 0x140
#define APMU_NR_CLKS 17
struct pxa1908_clk_unit {
struct mmp_clk_unit unit;
void __iomem *base;
};
static DEFINE_SPINLOCK(pll1_lock);
static struct mmp_param_general_gate_clk pll1_gate_clks[] = {
{PXA1908_CLK_PLL1_D2_GATE, "pll1_d2_gate", "pll1_d2", 0, APMU_CLK_GATE_CTRL, 29, 0, &pll1_lock},
{PXA1908_CLK_PLL1_416_GATE, "pll1_416_gate", "pll1_416", 0, APMU_CLK_GATE_CTRL, 27, 0, &pll1_lock},
{PXA1908_CLK_PLL1_624_GATE, "pll1_624_gate", "pll1_624", 0, APMU_CLK_GATE_CTRL, 26, 0, &pll1_lock},
{PXA1908_CLK_PLL1_832_GATE, "pll1_832_gate", "pll1_832", 0, APMU_CLK_GATE_CTRL, 30, 0, &pll1_lock},
{PXA1908_CLK_PLL1_1248_GATE, "pll1_1248_gate", "pll1_1248", 0, APMU_CLK_GATE_CTRL, 28, 0, &pll1_lock},
};
static DEFINE_SPINLOCK(sdh0_lock);
static DEFINE_SPINLOCK(sdh1_lock);
static DEFINE_SPINLOCK(sdh2_lock);
static const char * const sdh_parent_names[] = {"pll1_416", "pll1_624"};
static struct mmp_clk_mix_config sdh_mix_config = {
.reg_info = DEFINE_MIX_REG_INFO(3, 8, 2, 6, 11),
};
static struct mmp_param_gate_clk apmu_gate_clks[] = {
{PXA1908_CLK_USB, "usb_clk", NULL, 0, APMU_USB, 0x9, 0x9, 0x1, 0, NULL},
{PXA1908_CLK_SDH0, "sdh0_clk", "sdh0_mix_clk", CLK_SET_RATE_PARENT | CLK_SET_RATE_UNGATE, APMU_SDH0, 0x12, 0x12, 0x0, 0, &sdh0_lock},
{PXA1908_CLK_SDH1, "sdh1_clk", "sdh1_mix_clk", CLK_SET_RATE_PARENT | CLK_SET_RATE_UNGATE, APMU_SDH1, 0x12, 0x12, 0x0, 0, &sdh1_lock},
{PXA1908_CLK_SDH2, "sdh2_clk", "sdh2_mix_clk", CLK_SET_RATE_PARENT | CLK_SET_RATE_UNGATE, APMU_SDH2, 0x12, 0x12, 0x0, 0, &sdh2_lock}
};
static void pxa1908_axi_periph_clk_init(struct pxa1908_clk_unit *pxa_unit)
{
struct mmp_clk_unit *unit = &pxa_unit->unit;
mmp_register_general_gate_clks(unit, pll1_gate_clks,
pxa_unit->base, ARRAY_SIZE(pll1_gate_clks));
sdh_mix_config.reg_info.reg_clk_ctrl = pxa_unit->base + APMU_SDH0;
mmp_clk_register_mix(NULL, "sdh0_mix_clk", sdh_parent_names,
ARRAY_SIZE(sdh_parent_names), CLK_SET_RATE_PARENT,
&sdh_mix_config, &sdh0_lock);
sdh_mix_config.reg_info.reg_clk_ctrl = pxa_unit->base + APMU_SDH1;
mmp_clk_register_mix(NULL, "sdh1_mix_clk", sdh_parent_names,
ARRAY_SIZE(sdh_parent_names), CLK_SET_RATE_PARENT,
&sdh_mix_config, &sdh1_lock);
sdh_mix_config.reg_info.reg_clk_ctrl = pxa_unit->base + APMU_SDH2;
mmp_clk_register_mix(NULL, "sdh2_mix_clk", sdh_parent_names,
ARRAY_SIZE(sdh_parent_names), CLK_SET_RATE_PARENT,
&sdh_mix_config, &sdh2_lock);
mmp_register_gate_clks(unit, apmu_gate_clks, pxa_unit->base,
ARRAY_SIZE(apmu_gate_clks));
}
static int pxa1908_apmu_probe(struct platform_device *pdev)
{
struct pxa1908_clk_unit *pxa_unit;
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
if (IS_ERR(pxa_unit))
return PTR_ERR(pxa_unit);
pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pxa_unit->base))
return PTR_ERR(pxa_unit->base);
mmp_clk_init(pdev->dev.of_node, &pxa_unit->unit, APMU_NR_CLKS);
pxa1908_axi_periph_clk_init(pxa_unit);
return 0;
}
static const struct of_device_id pxa1908_apmu_match_table[] = {
{ .compatible = "marvell,pxa1908-apmu" },
{ }
};
MODULE_DEVICE_TABLE(of, pxa1908_apmu_match_table);
static struct platform_driver pxa1908_apmu_driver = {
.probe = pxa1908_apmu_probe,
.driver = {
.name = "pxa1908-apmu",
.of_match_table = pxa1908_apmu_match_table
}
};
module_platform_driver(pxa1908_apmu_driver);
MODULE_AUTHOR("Duje Mihanović <duje.mihanovic@skole.hr>");
MODULE_DESCRIPTION("Marvell PXA1908 APMU Clock Driver");
MODULE_LICENSE("GPL");

View File

@ -0,0 +1,112 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/bits.h>
#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/units.h>
#include <dt-bindings/clock/marvell,pxa1908.h>
#include "clk.h"
#define MPMU_UART_PLL 0x14
#define MPMU_NR_CLKS 39
struct pxa1908_clk_unit {
struct mmp_clk_unit unit;
void __iomem *base;
};
static struct mmp_param_fixed_rate_clk fixed_rate_clks[] = {
{PXA1908_CLK_CLK32, "clk32", NULL, 0, 32768},
{PXA1908_CLK_VCTCXO, "vctcxo", NULL, 0, 26 * HZ_PER_MHZ},
{PXA1908_CLK_PLL1_624, "pll1_624", NULL, 0, 624 * HZ_PER_MHZ},
{PXA1908_CLK_PLL1_416, "pll1_416", NULL, 0, 416 * HZ_PER_MHZ},
{PXA1908_CLK_PLL1_499, "pll1_499", NULL, 0, 499 * HZ_PER_MHZ},
{PXA1908_CLK_PLL1_832, "pll1_832", NULL, 0, 832 * HZ_PER_MHZ},
{PXA1908_CLK_PLL1_1248, "pll1_1248", NULL, 0, 1248 * HZ_PER_MHZ},
};
static struct mmp_param_fixed_factor_clk fixed_factor_clks[] = {
{PXA1908_CLK_PLL1_D2, "pll1_d2", "pll1_624", 1, 2, 0},
{PXA1908_CLK_PLL1_D4, "pll1_d4", "pll1_d2", 1, 2, 0},
{PXA1908_CLK_PLL1_D6, "pll1_d6", "pll1_d2", 1, 3, 0},
{PXA1908_CLK_PLL1_D8, "pll1_d8", "pll1_d4", 1, 2, 0},
{PXA1908_CLK_PLL1_D12, "pll1_d12", "pll1_d6", 1, 2, 0},
{PXA1908_CLK_PLL1_D13, "pll1_d13", "pll1_624", 1, 13, 0},
{PXA1908_CLK_PLL1_D16, "pll1_d16", "pll1_d8", 1, 2, 0},
{PXA1908_CLK_PLL1_D24, "pll1_d24", "pll1_d12", 1, 2, 0},
{PXA1908_CLK_PLL1_D48, "pll1_d48", "pll1_d24", 1, 2, 0},
{PXA1908_CLK_PLL1_D96, "pll1_d96", "pll1_d48", 1, 2, 0},
{PXA1908_CLK_PLL1_32, "pll1_32", "pll1_d13", 2, 3, 0},
{PXA1908_CLK_PLL1_208, "pll1_208", "pll1_d2", 2, 3, 0},
{PXA1908_CLK_PLL1_117, "pll1_117", "pll1_624", 3, 16, 0},
};
static struct u32_fract uart_factor_tbl[] = {
{.numerator = 8125, .denominator = 1536}, /* 14.745MHz */
};
static struct mmp_clk_factor_masks uart_factor_masks = {
.factor = 2,
.num_mask = GENMASK(12, 0),
.den_mask = GENMASK(12, 0),
.num_shift = 16,
.den_shift = 0,
};
static void pxa1908_pll_init(struct pxa1908_clk_unit *pxa_unit)
{
struct mmp_clk_unit *unit = &pxa_unit->unit;
mmp_register_fixed_rate_clks(unit, fixed_rate_clks,
ARRAY_SIZE(fixed_rate_clks));
mmp_register_fixed_factor_clks(unit, fixed_factor_clks,
ARRAY_SIZE(fixed_factor_clks));
mmp_clk_register_factor("uart_pll", "pll1_d4",
CLK_SET_RATE_PARENT,
pxa_unit->base + MPMU_UART_PLL,
&uart_factor_masks, uart_factor_tbl,
ARRAY_SIZE(uart_factor_tbl), NULL);
}
static int pxa1908_mpmu_probe(struct platform_device *pdev)
{
struct pxa1908_clk_unit *pxa_unit;
pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
if (IS_ERR(pxa_unit))
return PTR_ERR(pxa_unit);
pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pxa_unit->base))
return PTR_ERR(pxa_unit->base);
mmp_clk_init(pdev->dev.of_node, &pxa_unit->unit, MPMU_NR_CLKS);
pxa1908_pll_init(pxa_unit);
return 0;
}
static const struct of_device_id pxa1908_mpmu_match_table[] = {
{ .compatible = "marvell,pxa1908-mpmu" },
{ }
};
MODULE_DEVICE_TABLE(of, pxa1908_mpmu_match_table);
static struct platform_driver pxa1908_mpmu_driver = {
.probe = pxa1908_mpmu_probe,
.driver = {
.name = "pxa1908-mpmu",
.of_match_table = pxa1908_mpmu_match_table
}
};
module_platform_driver(pxa1908_mpmu_driver);
MODULE_AUTHOR("Duje Mihanović <duje.mihanovic@skole.hr>");
MODULE_DESCRIPTION("Marvell PXA1908 MPMU Clock Driver");
MODULE_LICENSE("GPL");

View File

@ -3,6 +3,7 @@
#define __MACH_MMP_CLK_H
#include <linux/clk-provider.h>
#include <linux/math.h>
#include <linux/pm_domain.h>
#include <linux/clkdev.h>
@ -20,16 +21,11 @@ struct mmp_clk_factor_masks {
unsigned int enable_mask;
};
struct mmp_clk_factor_tbl {
unsigned int num;
unsigned int den;
};
struct mmp_clk_factor {
struct clk_hw hw;
void __iomem *base;
struct mmp_clk_factor_masks *masks;
struct mmp_clk_factor_tbl *ftbl;
struct u32_fract *ftbl;
unsigned int ftbl_cnt;
spinlock_t *lock;
};
@ -37,7 +33,7 @@ struct mmp_clk_factor {
extern struct clk *mmp_clk_register_factor(const char *name,
const char *parent_name, unsigned long flags,
void __iomem *base, struct mmp_clk_factor_masks *masks,
struct mmp_clk_factor_tbl *ftbl, unsigned int ftbl_cnt,
struct u32_fract *ftbl, unsigned int ftbl_cnt,
spinlock_t *lock);
/* Clock type "mix" */

View File

@ -213,6 +213,14 @@ config IPQ_GCC_5332
Say Y if you want to use peripheral devices such as UART, SPI,
i2c, USB, SD/eMMC, etc.
config IPQ_GCC_5424
tristate "IPQ5424 Global Clock Controller"
depends on ARM64 || COMPILE_TEST
help
Support for the global clock controller on ipq5424 devices.
Say Y if you want to use peripheral devices such as UART, SPI,
i2c, USB, SD/eMMC, etc.
config IPQ_GCC_6018
tristate "IPQ6018 Global Clock Controller"
help
@ -467,6 +475,26 @@ config QCS_GCC_404
Say Y if you want to use multimedia devices or peripheral
devices such as UART, SPI, I2C, USB, SD/eMMC, PCIe etc.
config SA_CAMCC_8775P
tristate "SA8775P Camera Clock Controller"
depends on ARM64 || COMPILE_TEST
select SA_GCC_8775P
help
Support for the camera clock controller on Qualcomm Technologies, Inc
SA8775P devices.
Say Y if you want to support camera devices and functionality such as
capturing pictures.
config QCS_GCC_8300
tristate "QCS8300 Global Clock Controller"
depends on ARM64 || COMPILE_TEST
select QCOM_GDSC
help
Support for the global clock controller on Qualcomm Technologies, Inc
QCS8300 devices.
Say Y if you want to use peripheral devices such as UART,
SPI, I2C, USB, SD/UFS, PCIe etc.
config SC_CAMCC_7180
tristate "SC7180 Camera Clock Controller"
depends on ARM64 || COMPILE_TEST
@ -497,6 +525,16 @@ config SC_CAMCC_8280XP
Say Y if you want to support camera devices and functionality such as
capturing pictures.
config SA_DISPCC_8775P
tristate "SA8775P Display Clock Controller"
depends on ARM64 || COMPILE_TEST
select SA_GCC_8775P
help
Support for the two display clock controllers on Qualcomm
Technologies, Inc. SA8775P devices.
Say Y if you want to support display devices and functionality such as
splash screen.
config SC_DISPCC_7180
tristate "SC7180 Display Clock Controller"
depends on ARM64 || COMPILE_TEST
@ -545,6 +583,24 @@ config SA_GPUCC_8775P
Say Y if you want to support graphics controller devices and
functionality such as 3D graphics.
config SAR_GCC_2130P
tristate "SAR2130P Global Clock Controller"
select QCOM_GDSC
depends on COMMON_CLK_QCOM
help
Support for the global clock controller on SAR2130P devices.
Say Y if you want to use peripheral devices such as UART, SPI,
I2C, USB, SDCC, etc.
config SAR_GPUCC_2130P
tristate "SAR2130P Graphics clock controller"
select QCOM_GDSC
select SAR_GCC_2130P
help
Support for the graphics clock controller on SAR2130P devices.
Say Y if you want to support graphics controller devices and
functionality such as 3D graphics.
config SC_GCC_7180
tristate "SC7180 Global Clock Controller"
select QCOM_GDSC
@ -857,7 +913,7 @@ config SM_CAMCC_8450
depends on ARM64 || COMPILE_TEST
select SM_GCC_8450
help
Support for the camera clock controller on SM8450 devices.
Support for the camera clock controller on SM8450 or SM8475 devices.
Say Y if you want to support camera devices and camera functionality.
config SM_CAMCC_8550
@ -952,17 +1008,17 @@ config SM_DISPCC_8450
depends on SM_GCC_8450
help
Support for the display clock controller on Qualcomm Technologies, Inc
SM8450 devices.
SM8450 or SM8475 devices.
Say Y if you want to support display devices and functionality such as
splash screen.
config SM_DISPCC_8550
tristate "SM8550 Display Clock Controller"
depends on ARM64 || COMPILE_TEST
depends on SM_GCC_8550 || SM_GCC_8650
depends on SM_GCC_8550 || SM_GCC_8650 || SAR_GCC_2130P
help
Support for the display clock controller on Qualcomm Technologies, Inc
SM8550 or SM8650 devices.
SAR2130P, SM8550 or SM8650 devices.
Say Y if you want to support display devices and functionality such as
splash screen.
@ -987,6 +1043,7 @@ config SM_GCC_6115
config SM_GCC_6125
tristate "SM6125 Global Clock Controller"
depends on ARM64 || COMPILE_TEST
select QCOM_GDSC
help
Support for the global clock controller on SM6125 devices.
Say Y if you want to use peripheral devices such as UART,
@ -1050,7 +1107,8 @@ config SM_GCC_8450
depends on ARM64 || COMPILE_TEST
select QCOM_GDSC
help
Support for the global clock controller on SM8450 devices.
Support for the global clock controller on SM8450 or SM8475
devices.
Say Y if you want to use peripheral devices such as UART,
SPI, I2C, USB, SD/UFS, PCIe etc.
@ -1149,7 +1207,8 @@ config SM_GPUCC_8450
depends on ARM64 || COMPILE_TEST
select SM_GCC_8450
help
Support for the graphics clock controller on SM8450 devices.
Support for the graphics clock controller on SM8450 or SM8475
devices.
Say Y if you want to support graphics controller devices and
functionality such as 3D graphics.
@ -1187,6 +1246,17 @@ config SM_TCSRCC_8650
Support for the TCSR clock controller on SM8650 devices.
Say Y if you want to use peripheral devices such as SD/UFS.
config SA_VIDEOCC_8775P
tristate "SA8775P Video Clock Controller"
depends on ARM64 || COMPILE_TEST
select SA_GCC_8775P
select QCOM_GDSC
help
Support for the video clock controller on Qualcomm Technologies, Inc.
SA8775P devices.
Say Y if you want to support video devices and functionality such as
video encode/decode.
config SM_VIDEOCC_7150
tristate "SM7150 Video Clock Controller"
depends on ARM64 || COMPILE_TEST
@ -1230,11 +1300,11 @@ config SM_VIDEOCC_8350
config SM_VIDEOCC_8550
tristate "SM8550 Video Clock Controller"
depends on ARM64 || COMPILE_TEST
select SM_GCC_8550
depends on SM_GCC_8550 || SM_GCC_8650
select QCOM_GDSC
help
Support for the video clock controller on Qualcomm Technologies, Inc.
SM8550 devices.
SM8550 or SM8650 devices.
Say Y if you want to support video devices and functionality such as
video encode/decode.
@ -1283,7 +1353,7 @@ config SM_VIDEOCC_8450
select QCOM_GDSC
help
Support for the video clock controller on Qualcomm Technologies, Inc.
SM8450 devices.
SM8450 or SM8475 devices.
Say Y if you want to support video devices and functionality such as
video encode/decode.
endif

View File

@ -32,6 +32,7 @@ obj-$(CONFIG_IPQ_APSS_6018) += apss-ipq6018.o
obj-$(CONFIG_IPQ_GCC_4019) += gcc-ipq4019.o
obj-$(CONFIG_IPQ_GCC_5018) += gcc-ipq5018.o
obj-$(CONFIG_IPQ_GCC_5332) += gcc-ipq5332.o
obj-$(CONFIG_IPQ_GCC_5424) += gcc-ipq5424.o
obj-$(CONFIG_IPQ_GCC_6018) += gcc-ipq6018.o
obj-$(CONFIG_IPQ_GCC_806X) += gcc-ipq806x.o
obj-$(CONFIG_IPQ_GCC_8074) += gcc-ipq8074.o
@ -70,6 +71,7 @@ obj-$(CONFIG_QCOM_CLK_SMD_RPM) += clk-smd-rpm.o
obj-$(CONFIG_QCM_GCC_2290) += gcc-qcm2290.o
obj-$(CONFIG_QCM_DISPCC_2290) += dispcc-qcm2290.o
obj-$(CONFIG_QCS_GCC_404) += gcc-qcs404.o
obj-$(CONFIG_QCS_GCC_8300) += gcc-qcs8300.o
obj-$(CONFIG_QCS_Q6SSTOP_404) += q6sstop-qcs404.o
obj-$(CONFIG_QCS_TURING_404) += turingcc-qcs404.o
obj-$(CONFIG_QDU_ECPRICC_1000) += ecpricc-qdu1000.o
@ -80,8 +82,13 @@ obj-$(CONFIG_SC_CAMCC_8280XP) += camcc-sc8280xp.o
obj-$(CONFIG_SC_DISPCC_7180) += dispcc-sc7180.o
obj-$(CONFIG_SC_DISPCC_7280) += dispcc-sc7280.o
obj-$(CONFIG_SC_DISPCC_8280XP) += dispcc-sc8280xp.o
obj-$(CONFIG_SA_CAMCC_8775P) += camcc-sa8775p.o
obj-$(CONFIG_SA_DISPCC_8775P) += dispcc0-sa8775p.o dispcc1-sa8775p.o
obj-$(CONFIG_SA_GCC_8775P) += gcc-sa8775p.o
obj-$(CONFIG_SA_GPUCC_8775P) += gpucc-sa8775p.o
obj-$(CONFIG_SA_VIDEOCC_8775P) += videocc-sa8775p.o
obj-$(CONFIG_SAR_GCC_2130P) += gcc-sar2130p.o
obj-$(CONFIG_SAR_GPUCC_2130P) += gpucc-sar2130p.o
obj-$(CONFIG_SC_GCC_7180) += gcc-sc7180.o
obj-$(CONFIG_SC_GCC_7280) += gcc-sc7280.o
obj-$(CONFIG_SC_GCC_8180X) += gcc-sc8180x.o

File diff suppressed because it is too large Load Diff

View File

@ -54,6 +54,10 @@ static const struct pll_vco rivian_evo_vco[] = {
{ 864000000, 1056000000, 0 },
};
static const struct pll_vco rivian_ole_vco[] = {
{ 864000000, 1075000000, 0 },
};
static const struct clk_parent_data pll_parent_data_tcxo = { .index = DT_BI_TCXO };
static const struct alpha_pll_config cam_cc_pll0_config = {
@ -66,6 +70,20 @@ static const struct alpha_pll_config cam_cc_pll0_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_cam_cc_pll0_config = {
.l = 0x3e,
.alpha = 0x8000,
.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 = 0x00008400,
.user_ctl_hi_val = 0x00000005,
};
static struct clk_alpha_pll cam_cc_pll0 = {
.offset = 0x0,
.vco_table = lucid_evo_vco,
@ -86,6 +104,16 @@ static const struct clk_div_table post_div_table_cam_cc_pll0_out_even[] = {
{ }
};
static struct clk_init_data sm8475_cam_cc_pll0_out_even_init = {
.name = "cam_cc_pll0_out_even",
.parent_hws = (const struct clk_hw*[]) {
&cam_cc_pll0.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
};
static struct clk_alpha_pll_postdiv cam_cc_pll0_out_even = {
.offset = 0x0,
.post_div_shift = 10,
@ -109,6 +137,16 @@ static const struct clk_div_table post_div_table_cam_cc_pll0_out_odd[] = {
{ }
};
static struct clk_init_data sm8475_cam_cc_pll0_out_odd_init = {
.name = "cam_cc_pll0_out_odd",
.parent_hws = (const struct clk_hw*[]) {
&cam_cc_pll0.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
};
static struct clk_alpha_pll_postdiv cam_cc_pll0_out_odd = {
.offset = 0x0,
.post_div_shift = 14,
@ -137,6 +175,20 @@ static const struct alpha_pll_config cam_cc_pll1_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_cam_cc_pll1_config = {
.l = 0x25,
.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 = 0x00000400,
.user_ctl_hi_val = 0x00000005,
};
static struct clk_alpha_pll cam_cc_pll1 = {
.offset = 0x1000,
.vco_table = lucid_evo_vco,
@ -157,6 +209,16 @@ static const struct clk_div_table post_div_table_cam_cc_pll1_out_even[] = {
{ }
};
static struct clk_init_data sm8475_cam_cc_pll1_out_even_init = {
.name = "cam_cc_pll1_out_even",
.parent_hws = (const struct clk_hw*[]) {
&cam_cc_pll1.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
};
static struct clk_alpha_pll_postdiv cam_cc_pll1_out_even = {
.offset = 0x1000,
.post_div_shift = 10,
@ -183,6 +245,16 @@ static const struct alpha_pll_config cam_cc_pll2_config = {
.config_ctl_hi1_val = 0x00000217,
};
static const struct alpha_pll_config sm8475_cam_cc_pll2_config = {
.l = 0x32,
.alpha = 0x0,
.config_ctl_val = 0x10000030,
.config_ctl_hi_val = 0x80890263,
.config_ctl_hi1_val = 0x00000217,
.user_ctl_val = 0x00000001,
.user_ctl_hi_val = 0x00000000,
};
static struct clk_alpha_pll cam_cc_pll2 = {
.offset = 0x2000,
.vco_table = rivian_evo_vco,
@ -208,6 +280,20 @@ static const struct alpha_pll_config cam_cc_pll3_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_cam_cc_pll3_config = {
.l = 0x2d,
.alpha = 0x0,
.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 = 0x00000400,
.user_ctl_hi_val = 0x00000005,
};
static struct clk_alpha_pll cam_cc_pll3 = {
.offset = 0x3000,
.vco_table = lucid_evo_vco,
@ -228,6 +314,16 @@ static const struct clk_div_table post_div_table_cam_cc_pll3_out_even[] = {
{ }
};
static struct clk_init_data sm8475_cam_cc_pll3_out_even_init = {
.name = "cam_cc_pll3_out_even",
.parent_hws = (const struct clk_hw*[]) {
&cam_cc_pll3.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
};
static struct clk_alpha_pll_postdiv cam_cc_pll3_out_even = {
.offset = 0x3000,
.post_div_shift = 10,
@ -256,6 +352,20 @@ static const struct alpha_pll_config cam_cc_pll4_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_cam_cc_pll4_config = {
.l = 0x2d,
.alpha = 0x0,
.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 = 0x00000400,
.user_ctl_hi_val = 0x00000005,
};
static struct clk_alpha_pll cam_cc_pll4 = {
.offset = 0x4000,
.vco_table = lucid_evo_vco,
@ -276,6 +386,16 @@ static const struct clk_div_table post_div_table_cam_cc_pll4_out_even[] = {
{ }
};
static struct clk_init_data sm8475_cam_cc_pll4_out_even_init = {
.name = "cam_cc_pll4_out_even",
.parent_hws = (const struct clk_hw*[]) {
&cam_cc_pll4.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
};
static struct clk_alpha_pll_postdiv cam_cc_pll4_out_even = {
.offset = 0x4000,
.post_div_shift = 10,
@ -304,6 +424,20 @@ static const struct alpha_pll_config cam_cc_pll5_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_cam_cc_pll5_config = {
.l = 0x2d,
.alpha = 0x0,
.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 = 0x00000400,
.user_ctl_hi_val = 0x00000005,
};
static struct clk_alpha_pll cam_cc_pll5 = {
.offset = 0x5000,
.vco_table = lucid_evo_vco,
@ -324,6 +458,16 @@ static const struct clk_div_table post_div_table_cam_cc_pll5_out_even[] = {
{ }
};
static struct clk_init_data sm8475_cam_cc_pll5_out_even_init = {
.name = "cam_cc_pll5_out_even",
.parent_hws = (const struct clk_hw*[]) {
&cam_cc_pll5.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
};
static struct clk_alpha_pll_postdiv cam_cc_pll5_out_even = {
.offset = 0x5000,
.post_div_shift = 10,
@ -352,6 +496,20 @@ static const struct alpha_pll_config cam_cc_pll6_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_cam_cc_pll6_config = {
.l = 0x2d,
.alpha = 0x0,
.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 = 0x00000400,
.user_ctl_hi_val = 0x00000005,
};
static struct clk_alpha_pll cam_cc_pll6 = {
.offset = 0x6000,
.vco_table = lucid_evo_vco,
@ -372,6 +530,16 @@ static const struct clk_div_table post_div_table_cam_cc_pll6_out_even[] = {
{ }
};
static struct clk_init_data sm8475_cam_cc_pll6_out_even_init = {
.name = "cam_cc_pll6_out_even",
.parent_hws = (const struct clk_hw*[]) {
&cam_cc_pll6.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
};
static struct clk_alpha_pll_postdiv cam_cc_pll6_out_even = {
.offset = 0x6000,
.post_div_shift = 10,
@ -400,6 +568,20 @@ static const struct alpha_pll_config cam_cc_pll7_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_cam_cc_pll7_config = {
.l = 0x2d,
.alpha = 0x0,
.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 = 0x00000400,
.user_ctl_hi_val = 0x00000005,
};
static struct clk_alpha_pll cam_cc_pll7 = {
.offset = 0x7000,
.vco_table = lucid_evo_vco,
@ -420,6 +602,16 @@ static const struct clk_div_table post_div_table_cam_cc_pll7_out_even[] = {
{ }
};
static struct clk_init_data sm8475_cam_cc_pll7_out_even_init = {
.name = "cam_cc_pll7_out_even",
.parent_hws = (const struct clk_hw*[]) {
&cam_cc_pll7.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
};
static struct clk_alpha_pll_postdiv cam_cc_pll7_out_even = {
.offset = 0x7000,
.post_div_shift = 10,
@ -448,6 +640,20 @@ static const struct alpha_pll_config cam_cc_pll8_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_cam_cc_pll8_config = {
.l = 0x32,
.alpha = 0x0,
.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 = 0x00000400,
.user_ctl_hi_val = 0x00000005,
};
static struct clk_alpha_pll cam_cc_pll8 = {
.offset = 0x8000,
.vco_table = lucid_evo_vco,
@ -468,6 +674,16 @@ static const struct clk_div_table post_div_table_cam_cc_pll8_out_even[] = {
{ }
};
static struct clk_init_data sm8475_cam_cc_pll8_out_even_init = {
.name = "cam_cc_pll8_out_even",
.parent_hws = (const struct clk_hw*[]) {
&cam_cc_pll8.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
};
static struct clk_alpha_pll_postdiv cam_cc_pll8_out_even = {
.offset = 0x8000,
.post_div_shift = 10,
@ -2817,6 +3033,7 @@ static const struct qcom_cc_desc cam_cc_sm8450_desc = {
static const struct of_device_id cam_cc_sm8450_match_table[] = {
{ .compatible = "qcom,sm8450-camcc" },
{ .compatible = "qcom,sm8475-camcc" },
{ }
};
MODULE_DEVICE_TABLE(of, cam_cc_sm8450_match_table);
@ -2829,15 +3046,72 @@ static int cam_cc_sm8450_probe(struct platform_device *pdev)
if (IS_ERR(regmap))
return PTR_ERR(regmap);
clk_lucid_evo_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config);
clk_lucid_evo_pll_configure(&cam_cc_pll1, regmap, &cam_cc_pll1_config);
clk_rivian_evo_pll_configure(&cam_cc_pll2, regmap, &cam_cc_pll2_config);
clk_lucid_evo_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config);
clk_lucid_evo_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config);
clk_lucid_evo_pll_configure(&cam_cc_pll5, regmap, &cam_cc_pll5_config);
clk_lucid_evo_pll_configure(&cam_cc_pll6, regmap, &cam_cc_pll6_config);
clk_lucid_evo_pll_configure(&cam_cc_pll7, regmap, &cam_cc_pll7_config);
clk_lucid_evo_pll_configure(&cam_cc_pll8, regmap, &cam_cc_pll8_config);
if (of_device_is_compatible(pdev->dev.of_node, "qcom,sm8475-camcc")) {
/* Update CAMCC PLL0 */
cam_cc_pll0.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll0_out_even.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll0_out_even.clkr.hw.init = &sm8475_cam_cc_pll0_out_even_init;
cam_cc_pll0_out_odd.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll0_out_odd.clkr.hw.init = &sm8475_cam_cc_pll0_out_odd_init;
/* Update CAMCC PLL1 */
cam_cc_pll1.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll1_out_even.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll1_out_even.clkr.hw.init = &sm8475_cam_cc_pll1_out_even_init;
/* Update CAMCC PLL2 */
cam_cc_pll2.vco_table = rivian_ole_vco;
/* Update CAMCC PLL3 */
cam_cc_pll3.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll3_out_even.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll3_out_even.clkr.hw.init = &sm8475_cam_cc_pll3_out_even_init;
/* Update CAMCC PLL4 */
cam_cc_pll4.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll4_out_even.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll4_out_even.clkr.hw.init = &sm8475_cam_cc_pll4_out_even_init;
/* Update CAMCC PLL5 */
cam_cc_pll5.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll5_out_even.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll5_out_even.clkr.hw.init = &sm8475_cam_cc_pll5_out_even_init;
/* Update CAMCC PLL6 */
cam_cc_pll6.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll6_out_even.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll6_out_even.clkr.hw.init = &sm8475_cam_cc_pll6_out_even_init;
/* Update CAMCC PLL7 */
cam_cc_pll7.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll7_out_even.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll7_out_even.clkr.hw.init = &sm8475_cam_cc_pll7_out_even_init;
/* Update CAMCC PLL8 */
cam_cc_pll8.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll8_out_even.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
cam_cc_pll8_out_even.clkr.hw.init = &sm8475_cam_cc_pll8_out_even_init;
clk_lucid_ole_pll_configure(&cam_cc_pll0, regmap, &sm8475_cam_cc_pll0_config);
clk_lucid_ole_pll_configure(&cam_cc_pll1, regmap, &sm8475_cam_cc_pll1_config);
clk_rivian_evo_pll_configure(&cam_cc_pll2, regmap, &sm8475_cam_cc_pll2_config);
clk_lucid_ole_pll_configure(&cam_cc_pll3, regmap, &sm8475_cam_cc_pll3_config);
clk_lucid_ole_pll_configure(&cam_cc_pll4, regmap, &sm8475_cam_cc_pll4_config);
clk_lucid_ole_pll_configure(&cam_cc_pll5, regmap, &sm8475_cam_cc_pll5_config);
clk_lucid_ole_pll_configure(&cam_cc_pll6, regmap, &sm8475_cam_cc_pll6_config);
clk_lucid_ole_pll_configure(&cam_cc_pll7, regmap, &sm8475_cam_cc_pll7_config);
clk_lucid_ole_pll_configure(&cam_cc_pll8, regmap, &sm8475_cam_cc_pll8_config);
} else {
clk_lucid_evo_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config);
clk_lucid_evo_pll_configure(&cam_cc_pll1, regmap, &cam_cc_pll1_config);
clk_rivian_evo_pll_configure(&cam_cc_pll2, regmap, &cam_cc_pll2_config);
clk_lucid_evo_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config);
clk_lucid_evo_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config);
clk_lucid_evo_pll_configure(&cam_cc_pll5, regmap, &cam_cc_pll5_config);
clk_lucid_evo_pll_configure(&cam_cc_pll6, regmap, &cam_cc_pll6_config);
clk_lucid_evo_pll_configure(&cam_cc_pll7, regmap, &cam_cc_pll7_config);
clk_lucid_evo_pll_configure(&cam_cc_pll8, regmap, &cam_cc_pll8_config);
}
return qcom_cc_really_probe(&pdev->dev, &cam_cc_sm8450_desc, regmap);
}
@ -2852,5 +3126,5 @@ static struct platform_driver cam_cc_sm8450_driver = {
module_platform_driver(cam_cc_sm8450_driver);
MODULE_DESCRIPTION("QCOM CAMCC SM8450 Driver");
MODULE_DESCRIPTION("QCOM CAMCC SM8450 / SM8475 Driver");
MODULE_LICENSE("GPL");

View File

@ -267,6 +267,17 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = {
[PLL_OFF_OPMODE] = 0x30,
[PLL_OFF_STATUS] = 0x3c,
},
[CLK_ALPHA_PLL_TYPE_NSS_HUAYRA] = {
[PLL_OFF_L_VAL] = 0x04,
[PLL_OFF_ALPHA_VAL] = 0x08,
[PLL_OFF_TEST_CTL] = 0x0c,
[PLL_OFF_TEST_CTL_U] = 0x10,
[PLL_OFF_USER_CTL] = 0x14,
[PLL_OFF_CONFIG_CTL] = 0x18,
[PLL_OFF_CONFIG_CTL_U] = 0x1c,
[PLL_OFF_STATUS] = 0x20,
},
};
EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);
@ -1903,9 +1914,8 @@ static int alpha_pll_lucid_5lpe_enable(struct clk_hw *hw)
}
/* Check if PLL is already enabled, return if enabled */
ret = trion_pll_is_enabled(pll, pll->clkr.regmap);
if (ret < 0)
return ret;
if (trion_pll_is_enabled(pll, pll->clkr.regmap))
return 0;
ret = regmap_update_bits(pll->clkr.regmap, PLL_MODE(pll), PLL_RESET_N, PLL_RESET_N);
if (ret)
@ -2318,13 +2328,8 @@ static int alpha_pll_lucid_evo_enable(struct clk_hw *hw)
}
/* Check if PLL is already enabled */
ret = trion_pll_is_enabled(pll, regmap);
if (ret < 0) {
return ret;
} else if (ret) {
pr_warn("%s PLL is already enabled\n", clk_hw_get_name(&pll->clkr.hw));
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)

View File

@ -32,6 +32,7 @@ enum {
CLK_ALPHA_PLL_TYPE_BRAMMO_EVO,
CLK_ALPHA_PLL_TYPE_STROMER,
CLK_ALPHA_PLL_TYPE_STROMER_PLUS,
CLK_ALPHA_PLL_TYPE_NSS_HUAYRA,
CLK_ALPHA_PLL_TYPE_MAX,
};

View File

@ -198,6 +198,7 @@ extern const struct clk_ops clk_byte2_ops;
extern const struct clk_ops clk_pixel_ops;
extern const struct clk_ops clk_gfx3d_ops;
extern const struct clk_ops clk_rcg2_shared_ops;
extern const struct clk_ops clk_rcg2_shared_floor_ops;
extern const struct clk_ops clk_rcg2_shared_no_init_park_ops;
extern const struct clk_ops clk_dp_ops;

View File

@ -1186,15 +1186,23 @@ clk_rcg2_shared_force_enable_clear(struct clk_hw *hw, const struct freq_tbl *f)
return clk_rcg2_clear_force_enable(hw);
}
static int clk_rcg2_shared_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
static int __clk_rcg2_shared_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate,
enum freq_policy policy)
{
struct clk_rcg2 *rcg = to_clk_rcg2(hw);
const struct freq_tbl *f;
f = qcom_find_freq(rcg->freq_tbl, rate);
if (!f)
switch (policy) {
case FLOOR:
f = qcom_find_freq_floor(rcg->freq_tbl, rate);
break;
case CEIL:
f = qcom_find_freq(rcg->freq_tbl, rate);
break;
default:
return -EINVAL;
}
/*
* In case clock is disabled, update the M, N and D registers, cache
@ -1207,10 +1215,28 @@ static int clk_rcg2_shared_set_rate(struct clk_hw *hw, unsigned long rate,
return clk_rcg2_shared_force_enable_clear(hw, f);
}
static int clk_rcg2_shared_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
return __clk_rcg2_shared_set_rate(hw, rate, parent_rate, CEIL);
}
static int clk_rcg2_shared_set_rate_and_parent(struct clk_hw *hw,
unsigned long rate, unsigned long parent_rate, u8 index)
{
return clk_rcg2_shared_set_rate(hw, rate, parent_rate);
return __clk_rcg2_shared_set_rate(hw, rate, parent_rate, CEIL);
}
static int clk_rcg2_shared_set_floor_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
return __clk_rcg2_shared_set_rate(hw, rate, parent_rate, FLOOR);
}
static int clk_rcg2_shared_set_floor_rate_and_parent(struct clk_hw *hw,
unsigned long rate, unsigned long parent_rate, u8 index)
{
return __clk_rcg2_shared_set_rate(hw, rate, parent_rate, FLOOR);
}
static int clk_rcg2_shared_enable(struct clk_hw *hw)
@ -1348,6 +1374,18 @@ const struct clk_ops clk_rcg2_shared_ops = {
};
EXPORT_SYMBOL_GPL(clk_rcg2_shared_ops);
const struct clk_ops clk_rcg2_shared_floor_ops = {
.enable = clk_rcg2_shared_enable,
.disable = clk_rcg2_shared_disable,
.get_parent = clk_rcg2_shared_get_parent,
.set_parent = clk_rcg2_shared_set_parent,
.recalc_rate = clk_rcg2_shared_recalc_rate,
.determine_rate = clk_rcg2_determine_floor_rate,
.set_rate = clk_rcg2_shared_set_floor_rate,
.set_rate_and_parent = clk_rcg2_shared_set_floor_rate_and_parent,
};
EXPORT_SYMBOL_GPL(clk_rcg2_shared_floor_ops);
static int clk_rcg2_shared_no_init_park(struct clk_hw *hw)
{
struct clk_rcg2 *rcg = to_clk_rcg2(hw);

View File

@ -389,6 +389,18 @@ DEFINE_CLK_RPMH_BCM(ipa, "IP0");
DEFINE_CLK_RPMH_BCM(pka, "PKA0");
DEFINE_CLK_RPMH_BCM(qpic_clk, "QP0");
static struct clk_hw *sar2130p_rpmh_clocks[] = {
[RPMH_CXO_CLK] = &clk_rpmh_bi_tcxo_div1.hw,
[RPMH_CXO_CLK_A] = &clk_rpmh_bi_tcxo_div1_ao.hw,
[RPMH_RF_CLK1] = &clk_rpmh_rf_clk1_a.hw,
[RPMH_RF_CLK1_A] = &clk_rpmh_rf_clk1_a_ao.hw,
};
static const struct clk_rpmh_desc clk_rpmh_sar2130p = {
.clks = sar2130p_rpmh_clocks,
.num_clks = ARRAY_SIZE(sar2130p_rpmh_clocks),
};
static struct clk_hw *sdm845_rpmh_clocks[] = {
[RPMH_CXO_CLK] = &clk_rpmh_bi_tcxo_div2.hw,
[RPMH_CXO_CLK_A] = &clk_rpmh_bi_tcxo_div2_ao.hw,
@ -880,6 +892,7 @@ static int clk_rpmh_probe(struct platform_device *pdev)
static const struct of_device_id clk_rpmh_match_table[] = {
{ .compatible = "qcom,qdu1000-rpmh-clk", .data = &clk_rpmh_qdu1000},
{ .compatible = "qcom,sa8775p-rpmh-clk", .data = &clk_rpmh_sa8775p},
{ .compatible = "qcom,sar2130p-rpmh-clk", .data = &clk_rpmh_sar2130p},
{ .compatible = "qcom,sc7180-rpmh-clk", .data = &clk_rpmh_sc7180},
{ .compatible = "qcom,sc8180x-rpmh-clk", .data = &clk_rpmh_sc8180x},
{ .compatible = "qcom,sc8280xp-rpmh-clk", .data = &clk_rpmh_sc8280xp},

View File

@ -35,7 +35,7 @@ struct qcom_cc_desc {
size_t num_gdscs;
struct clk_hw **clk_hws;
size_t num_clk_hws;
struct qcom_icc_hws_data *icc_hws;
const struct qcom_icc_hws_data *icc_hws;
size_t num_icc_hws;
unsigned int icc_first_node_id;
};

View File

@ -85,6 +85,29 @@ static const struct alpha_pll_config disp_cc_pll0_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_disp_cc_pll0_config = {
.l = 0xd,
.alpha = 0x6492,
.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_init_data sm8475_disp_cc_pll0_init = {
.name = "disp_cc_pll0",
.parent_data = &(const struct clk_parent_data) {
.index = DT_BI_TCXO,
},
.num_parents = 1,
.ops = &clk_alpha_pll_reset_lucid_ole_ops,
};
static struct clk_alpha_pll disp_cc_pll0 = {
.offset = 0x0,
.vco_table = lucid_evo_vco,
@ -112,6 +135,29 @@ static const struct alpha_pll_config disp_cc_pll1_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_disp_cc_pll1_config = {
.l = 0x1f,
.alpha = 0x4000,
.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_init_data sm8475_disp_cc_pll1_init = {
.name = "disp_cc_pll1",
.parent_data = &(const struct clk_parent_data) {
.index = DT_BI_TCXO,
},
.num_parents = 1,
.ops = &clk_alpha_pll_reset_lucid_ole_ops,
};
static struct clk_alpha_pll disp_cc_pll1 = {
.offset = 0x1000,
.vco_table = lucid_evo_vco,
@ -1746,6 +1792,7 @@ static struct qcom_cc_desc disp_cc_sm8450_desc = {
static const struct of_device_id disp_cc_sm8450_match_table[] = {
{ .compatible = "qcom,sm8450-dispcc" },
{ .compatible = "qcom,sm8475-dispcc" },
{ }
};
MODULE_DEVICE_TABLE(of, disp_cc_sm8450_match_table);
@ -1769,8 +1816,21 @@ static int disp_cc_sm8450_probe(struct platform_device *pdev)
goto err_put_rpm;
}
clk_lucid_evo_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
clk_lucid_evo_pll_configure(&disp_cc_pll1, regmap, &disp_cc_pll1_config);
if (of_device_is_compatible(pdev->dev.of_node, "qcom,sm8475-dispcc")) {
/* Update DISPCC PLL0 */
disp_cc_pll0.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
disp_cc_pll0.clkr.hw.init = &sm8475_disp_cc_pll0_init;
/* Update DISPCC PLL1 */
disp_cc_pll1.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
disp_cc_pll1.clkr.hw.init = &sm8475_disp_cc_pll1_init;
clk_lucid_ole_pll_configure(&disp_cc_pll0, regmap, &sm8475_disp_cc_pll0_config);
clk_lucid_ole_pll_configure(&disp_cc_pll1, regmap, &sm8475_disp_cc_pll1_config);
} else {
clk_lucid_evo_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
clk_lucid_evo_pll_configure(&disp_cc_pll1, regmap, &disp_cc_pll1_config);
}
/* Enable clock gating for MDP clocks */
regmap_update_bits(regmap, DISP_CC_MISC_CMD, 0x10, 0x10);
@ -1802,5 +1862,5 @@ static struct platform_driver disp_cc_sm8450_driver = {
module_platform_driver(disp_cc_sm8450_driver);
MODULE_DESCRIPTION("QTI DISPCC SM8450 Driver");
MODULE_DESCRIPTION("QTI DISPCC SM8450 / SM8475 Driver");
MODULE_LICENSE("GPL");

View File

@ -75,7 +75,7 @@ static struct pll_vco lucid_ole_vco[] = {
{ 249600000, 2000000000, 0 },
};
static const struct alpha_pll_config disp_cc_pll0_config = {
static struct alpha_pll_config disp_cc_pll0_config = {
.l = 0xd,
.alpha = 0x6492,
.config_ctl_val = 0x20485699,
@ -106,7 +106,7 @@ static struct clk_alpha_pll disp_cc_pll0 = {
},
};
static const struct alpha_pll_config disp_cc_pll1_config = {
static struct alpha_pll_config disp_cc_pll1_config = {
.l = 0x1f,
.alpha = 0x4000,
.config_ctl_val = 0x20485699,
@ -594,6 +594,13 @@ static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
{ }
};
static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src_sar2130p[] = {
F(200000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
F(325000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
F(514000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
{ }
};
static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src_sm8650[] = {
F(19200000, P_BI_TCXO, 1, 0, 0),
F(85714286, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
@ -1750,6 +1757,7 @@ static struct qcom_cc_desc disp_cc_sm8550_desc = {
};
static const struct of_device_id disp_cc_sm8550_match_table[] = {
{ .compatible = "qcom,sar2130p-dispcc" },
{ .compatible = "qcom,sm8550-dispcc" },
{ .compatible = "qcom,sm8650-dispcc" },
{ }
@ -1780,6 +1788,12 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev)
disp_cc_mdss_mdp_clk_src.freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src_sm8650;
disp_cc_mdss_dptx1_usb_router_link_intf_clk.clkr.hw.init->parent_hws[0] =
&disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw;
} else if (of_device_is_compatible(pdev->dev.of_node, "qcom,sar2130p-dispcc")) {
disp_cc_pll0_config.l = 0x1f;
disp_cc_pll0_config.alpha = 0x4000;
disp_cc_pll0_config.user_ctl_val = 0x1;
disp_cc_pll1_config.user_ctl_val = 0x1;
disp_cc_mdss_mdp_clk_src.freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src_sar2130p;
}
clk_lucid_ole_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2185,150 +2185,6 @@ static struct clk_branch gcc_prng_ahb_clk = {
},
};
static struct clk_branch gcc_q6_ahb_clk = {
.halt_reg = 0x25014,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x25014,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6_ahb_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_wcss_ahb_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_q6_ahb_s_clk = {
.halt_reg = 0x25018,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x25018,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6_ahb_s_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_wcss_ahb_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_q6_axim_clk = {
.halt_reg = 0x2500c,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x2500c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6_axim_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_q6_axim_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_q6_axis_clk = {
.halt_reg = 0x25010,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x25010,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6_axis_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_system_noc_bfdcd_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_q6_tsctr_1to2_clk = {
.halt_reg = 0x25020,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x25020,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6_tsctr_1to2_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_tsctr_div2_clk_src.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_q6ss_atbm_clk = {
.halt_reg = 0x2501c,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x2501c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6ss_atbm_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_at_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_q6ss_pclkdbg_clk = {
.halt_reg = 0x25024,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x25024,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6ss_pclkdbg_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_dap_div_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_q6ss_trig_clk = {
.halt_reg = 0x250a0,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x250a0,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6ss_trig_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_dap_div_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_qdss_at_clk = {
.halt_reg = 0x2d038,
.halt_check = BRANCH_HALT_VOTED,
@ -2756,24 +2612,6 @@ static struct clk_branch gcc_sys_noc_at_clk = {
},
};
static struct clk_branch gcc_sys_noc_wcss_ahb_clk = {
.halt_reg = 0x2e030,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x2e030,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_sys_noc_wcss_ahb_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_wcss_ahb_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_uniphy0_ahb_clk = {
.halt_reg = 0x16010,
.halt_check = BRANCH_HALT,
@ -2989,204 +2827,6 @@ static struct clk_branch gcc_usb0_sleep_clk = {
},
};
static struct clk_branch gcc_wcss_axim_clk = {
.halt_reg = 0x2505c,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x2505c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_axim_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_system_noc_bfdcd_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_axis_clk = {
.halt_reg = 0x25060,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x25060,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_axis_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_system_noc_bfdcd_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_dbg_ifc_apb_bdg_clk = {
.halt_reg = 0x25048,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x25048,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_dbg_ifc_apb_bdg_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_dap_div_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_dbg_ifc_apb_clk = {
.halt_reg = 0x25038,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x25038,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_dbg_ifc_apb_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_dap_div_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_dbg_ifc_atb_bdg_clk = {
.halt_reg = 0x2504c,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x2504c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_dbg_ifc_atb_bdg_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_at_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_dbg_ifc_atb_clk = {
.halt_reg = 0x2503c,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x2503c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_dbg_ifc_atb_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_at_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_dbg_ifc_nts_bdg_clk = {
.halt_reg = 0x25050,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x25050,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_dbg_ifc_nts_bdg_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_tsctr_div2_clk_src.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_dbg_ifc_nts_clk = {
.halt_reg = 0x25040,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x25040,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_dbg_ifc_nts_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_qdss_tsctr_div2_clk_src.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_ecahb_clk = {
.halt_reg = 0x25058,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x25058,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_ecahb_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_wcss_ahb_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_mst_async_bdg_clk = {
.halt_reg = 0x2e0b0,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x2e0b0,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_mst_async_bdg_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_system_noc_bfdcd_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_slv_async_bdg_clk = {
.halt_reg = 0x2e0b4,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x2e0b4,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_slv_async_bdg_clk",
.parent_hws = (const struct clk_hw*[]) {
&gcc_system_noc_bfdcd_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_xo_clk = {
.halt_reg = 0x34018,
.halt_check = BRANCH_HALT,
@ -3362,15 +3002,7 @@ static struct clk_regmap *gcc_ipq5332_clocks[] = {
[GCC_PCNOC_BFDCD_CLK_SRC] = &gcc_pcnoc_bfdcd_clk_src.clkr,
[GCC_PCNOC_LPASS_CLK] = &gcc_pcnoc_lpass_clk.clkr,
[GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
[GCC_Q6_AHB_CLK] = &gcc_q6_ahb_clk.clkr,
[GCC_Q6_AHB_S_CLK] = &gcc_q6_ahb_s_clk.clkr,
[GCC_Q6_AXIM_CLK] = &gcc_q6_axim_clk.clkr,
[GCC_Q6_AXIM_CLK_SRC] = &gcc_q6_axim_clk_src.clkr,
[GCC_Q6_AXIS_CLK] = &gcc_q6_axis_clk.clkr,
[GCC_Q6_TSCTR_1TO2_CLK] = &gcc_q6_tsctr_1to2_clk.clkr,
[GCC_Q6SS_ATBM_CLK] = &gcc_q6ss_atbm_clk.clkr,
[GCC_Q6SS_PCLKDBG_CLK] = &gcc_q6ss_pclkdbg_clk.clkr,
[GCC_Q6SS_TRIG_CLK] = &gcc_q6ss_trig_clk.clkr,
[GCC_QDSS_AT_CLK] = &gcc_qdss_at_clk.clkr,
[GCC_QDSS_AT_CLK_SRC] = &gcc_qdss_at_clk_src.clkr,
[GCC_QDSS_CFG_AHB_CLK] = &gcc_qdss_cfg_ahb_clk.clkr,
@ -3400,7 +3032,6 @@ static struct clk_regmap *gcc_ipq5332_clocks[] = {
[GCC_SNOC_PCIE3_2LANE_S_CLK] = &gcc_snoc_pcie3_2lane_s_clk.clkr,
[GCC_SNOC_USB_CLK] = &gcc_snoc_usb_clk.clkr,
[GCC_SYS_NOC_AT_CLK] = &gcc_sys_noc_at_clk.clkr,
[GCC_SYS_NOC_WCSS_AHB_CLK] = &gcc_sys_noc_wcss_ahb_clk.clkr,
[GCC_SYSTEM_NOC_BFDCD_CLK_SRC] = &gcc_system_noc_bfdcd_clk_src.clkr,
[GCC_UNIPHY0_AHB_CLK] = &gcc_uniphy0_ahb_clk.clkr,
[GCC_UNIPHY0_SYS_CLK] = &gcc_uniphy0_sys_clk.clkr,
@ -3421,17 +3052,6 @@ static struct clk_regmap *gcc_ipq5332_clocks[] = {
[GCC_USB0_PIPE_CLK] = &gcc_usb0_pipe_clk.clkr,
[GCC_USB0_SLEEP_CLK] = &gcc_usb0_sleep_clk.clkr,
[GCC_WCSS_AHB_CLK_SRC] = &gcc_wcss_ahb_clk_src.clkr,
[GCC_WCSS_AXIM_CLK] = &gcc_wcss_axim_clk.clkr,
[GCC_WCSS_AXIS_CLK] = &gcc_wcss_axis_clk.clkr,
[GCC_WCSS_DBG_IFC_APB_BDG_CLK] = &gcc_wcss_dbg_ifc_apb_bdg_clk.clkr,
[GCC_WCSS_DBG_IFC_APB_CLK] = &gcc_wcss_dbg_ifc_apb_clk.clkr,
[GCC_WCSS_DBG_IFC_ATB_BDG_CLK] = &gcc_wcss_dbg_ifc_atb_bdg_clk.clkr,
[GCC_WCSS_DBG_IFC_ATB_CLK] = &gcc_wcss_dbg_ifc_atb_clk.clkr,
[GCC_WCSS_DBG_IFC_NTS_BDG_CLK] = &gcc_wcss_dbg_ifc_nts_bdg_clk.clkr,
[GCC_WCSS_DBG_IFC_NTS_CLK] = &gcc_wcss_dbg_ifc_nts_clk.clkr,
[GCC_WCSS_ECAHB_CLK] = &gcc_wcss_ecahb_clk.clkr,
[GCC_WCSS_MST_ASYNC_BDG_CLK] = &gcc_wcss_mst_async_bdg_clk.clkr,
[GCC_WCSS_SLV_ASYNC_BDG_CLK] = &gcc_wcss_slv_async_bdg_clk.clkr,
[GCC_XO_CLK] = &gcc_xo_clk.clkr,
[GCC_XO_CLK_SRC] = &gcc_xo_clk_src.clkr,
[GCC_XO_DIV4_CLK] = &gcc_xo_div4_clk.clkr,
@ -3622,7 +3242,7 @@ static const struct qcom_reset_map gcc_ipq5332_resets[] = {
#define IPQ_APPS_ID 5332 /* some unique value */
static struct qcom_icc_hws_data icc_ipq5332_hws[] = {
static const struct qcom_icc_hws_data icc_ipq5332_hws[] = {
{ MASTER_SNOC_PCIE3_1_M, SLAVE_SNOC_PCIE3_1_M, GCC_SNOC_PCIE3_1LANE_M_CLK },
{ MASTER_ANOC_PCIE3_1_S, SLAVE_ANOC_PCIE3_1_S, GCC_SNOC_PCIE3_1LANE_S_CLK },
{ MASTER_SNOC_PCIE3_2_M, SLAVE_SNOC_PCIE3_2_M, GCC_SNOC_PCIE3_2LANE_M_CLK },

File diff suppressed because it is too large Load Diff

View File

@ -2645,24 +2645,6 @@ static struct clk_rcg2 system_noc_bfdcd_clk_src = {
},
};
static struct clk_branch gcc_q6ss_boot_clk = {
.halt_reg = 0x25080,
.halt_check = BRANCH_HALT_SKIP,
.clkr = {
.enable_reg = 0x25080,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6ss_boot_clk",
.parent_hws = (const struct clk_hw *[]) {
&system_noc_bfdcd_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_nssnoc_snoc_clk = {
.halt_reg = 0x17028,
.clkr = {
@ -2733,91 +2715,6 @@ static struct clk_rcg2 wcss_ahb_clk_src = {
},
};
static struct clk_branch gcc_q6_ahb_clk = {
.halt_reg = 0x25014,
.clkr = {
.enable_reg = 0x25014,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6_ahb_clk",
.parent_hws = (const struct clk_hw *[]) {
&wcss_ahb_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_q6_ahb_s_clk = {
.halt_reg = 0x25018,
.clkr = {
.enable_reg = 0x25018,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6_ahb_s_clk",
.parent_hws = (const struct clk_hw *[]) {
&wcss_ahb_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_ecahb_clk = {
.halt_reg = 0x25058,
.clkr = {
.enable_reg = 0x25058,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_ecahb_clk",
.parent_hws = (const struct clk_hw *[]) {
&wcss_ahb_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_acmt_clk = {
.halt_reg = 0x2505c,
.clkr = {
.enable_reg = 0x2505c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_acmt_clk",
.parent_hws = (const struct clk_hw *[]) {
&wcss_ahb_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_sys_noc_wcss_ahb_clk = {
.halt_reg = 0x2e030,
.clkr = {
.enable_reg = 0x2e030,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_sys_noc_wcss_ahb_clk",
.parent_hws = (const struct clk_hw *[]) {
&wcss_ahb_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static const struct freq_tbl ftbl_wcss_axi_m_clk_src[] = {
F(24000000, P_XO, 1, 0, 0),
F(133333333, P_GPLL0, 6, 0, 0),
@ -2838,23 +2735,6 @@ static struct clk_rcg2 wcss_axi_m_clk_src = {
},
};
static struct clk_branch gcc_anoc_wcss_axi_m_clk = {
.halt_reg = 0x2e0a8,
.clkr = {
.enable_reg = 0x2e0a8,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_anoc_wcss_axi_m_clk",
.parent_hws = (const struct clk_hw *[]) {
&wcss_axi_m_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static const struct freq_tbl ftbl_qdss_at_clk_src[] = {
F(240000000, P_GPLL4, 5, 0, 0),
{ }
@ -2873,40 +2753,6 @@ static struct clk_rcg2 qdss_at_clk_src = {
},
};
static struct clk_branch gcc_q6ss_atbm_clk = {
.halt_reg = 0x2501c,
.clkr = {
.enable_reg = 0x2501c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6ss_atbm_clk",
.parent_hws = (const struct clk_hw *[]) {
&qdss_at_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_dbg_ifc_atb_clk = {
.halt_reg = 0x2503c,
.clkr = {
.enable_reg = 0x2503c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_dbg_ifc_atb_clk",
.parent_hws = (const struct clk_hw *[]) {
&qdss_at_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_nssnoc_atb_clk = {
.halt_reg = 0x17014,
.clkr = {
@ -3143,40 +2989,6 @@ static struct clk_fixed_factor qdss_tsctr_div2_clk_src = {
},
};
static struct clk_branch gcc_q6_tsctr_1to2_clk = {
.halt_reg = 0x25020,
.clkr = {
.enable_reg = 0x25020,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6_tsctr_1to2_clk",
.parent_hws = (const struct clk_hw *[]) {
&qdss_tsctr_div2_clk_src.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_dbg_ifc_nts_clk = {
.halt_reg = 0x25040,
.clkr = {
.enable_reg = 0x25040,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_dbg_ifc_nts_clk",
.parent_hws = (const struct clk_hw *[]) {
&qdss_tsctr_div2_clk_src.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_qdss_tsctr_div2_clk = {
.halt_reg = 0x2d044,
.clkr = {
@ -3351,74 +3163,6 @@ static struct clk_branch gcc_qdss_tsctr_div16_clk = {
},
};
static struct clk_branch gcc_q6ss_pclkdbg_clk = {
.halt_reg = 0x25024,
.clkr = {
.enable_reg = 0x25024,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6ss_pclkdbg_clk",
.parent_hws = (const struct clk_hw *[]) {
&qdss_dap_sync_clk_src.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_q6ss_trig_clk = {
.halt_reg = 0x25068,
.clkr = {
.enable_reg = 0x25068,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6ss_trig_clk",
.parent_hws = (const struct clk_hw *[]) {
&qdss_dap_sync_clk_src.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_dbg_ifc_apb_clk = {
.halt_reg = 0x25038,
.clkr = {
.enable_reg = 0x25038,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_dbg_ifc_apb_clk",
.parent_hws = (const struct clk_hw *[]) {
&qdss_dap_sync_clk_src.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_dbg_ifc_dapbus_clk = {
.halt_reg = 0x25044,
.clkr = {
.enable_reg = 0x25044,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_dbg_ifc_dapbus_clk",
.parent_hws = (const struct clk_hw *[]) {
&qdss_dap_sync_clk_src.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_qdss_dap_clk = {
.halt_reg = 0x2d058,
.clkr = {
@ -3540,58 +3284,6 @@ static struct clk_rcg2 q6_axi_clk_src = {
},
};
static struct clk_branch gcc_q6_axim_clk = {
.halt_reg = 0x2500c,
.clkr = {
.enable_reg = 0x2500c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_q6_axim_clk",
.parent_hws = (const struct clk_hw *[]) {
&q6_axi_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_wcss_q6_tbu_clk = {
.halt_reg = 0x12050,
.halt_check = BRANCH_HALT_DELAY,
.clkr = {
.enable_reg = 0xb00c,
.enable_mask = BIT(6),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_wcss_q6_tbu_clk",
.parent_hws = (const struct clk_hw *[]) {
&q6_axi_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch gcc_mem_noc_q6_axi_clk = {
.halt_reg = 0x19010,
.clkr = {
.enable_reg = 0x19010,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gcc_mem_noc_q6_axi_clk",
.parent_hws = (const struct clk_hw *[]) {
&q6_axi_clk_src.clkr.hw
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static const struct freq_tbl ftbl_q6_axim2_clk_src[] = {
F(342857143, P_GPLL4, 3.5, 0, 0),
{ }
@ -4141,16 +3833,8 @@ static struct clk_regmap *gcc_ipq9574_clks[] = {
[GCC_NSSNOC_SNOC_1_CLK] = &gcc_nssnoc_snoc_1_clk.clkr,
[GCC_QDSS_ETR_USB_CLK] = &gcc_qdss_etr_usb_clk.clkr,
[WCSS_AHB_CLK_SRC] = &wcss_ahb_clk_src.clkr,
[GCC_Q6_AHB_CLK] = &gcc_q6_ahb_clk.clkr,
[GCC_Q6_AHB_S_CLK] = &gcc_q6_ahb_s_clk.clkr,
[GCC_WCSS_ECAHB_CLK] = &gcc_wcss_ecahb_clk.clkr,
[GCC_WCSS_ACMT_CLK] = &gcc_wcss_acmt_clk.clkr,
[GCC_SYS_NOC_WCSS_AHB_CLK] = &gcc_sys_noc_wcss_ahb_clk.clkr,
[WCSS_AXI_M_CLK_SRC] = &wcss_axi_m_clk_src.clkr,
[GCC_ANOC_WCSS_AXI_M_CLK] = &gcc_anoc_wcss_axi_m_clk.clkr,
[QDSS_AT_CLK_SRC] = &qdss_at_clk_src.clkr,
[GCC_Q6SS_ATBM_CLK] = &gcc_q6ss_atbm_clk.clkr,
[GCC_WCSS_DBG_IFC_ATB_CLK] = &gcc_wcss_dbg_ifc_atb_clk.clkr,
[GCC_NSSNOC_ATB_CLK] = &gcc_nssnoc_atb_clk.clkr,
[GCC_QDSS_AT_CLK] = &gcc_qdss_at_clk.clkr,
[GCC_SYS_NOC_AT_CLK] = &gcc_sys_noc_at_clk.clkr,
@ -4163,27 +3847,18 @@ static struct clk_regmap *gcc_ipq9574_clks[] = {
[QDSS_TRACECLKIN_CLK_SRC] = &qdss_traceclkin_clk_src.clkr,
[GCC_QDSS_TRACECLKIN_CLK] = &gcc_qdss_traceclkin_clk.clkr,
[QDSS_TSCTR_CLK_SRC] = &qdss_tsctr_clk_src.clkr,
[GCC_Q6_TSCTR_1TO2_CLK] = &gcc_q6_tsctr_1to2_clk.clkr,
[GCC_WCSS_DBG_IFC_NTS_CLK] = &gcc_wcss_dbg_ifc_nts_clk.clkr,
[GCC_QDSS_TSCTR_DIV2_CLK] = &gcc_qdss_tsctr_div2_clk.clkr,
[GCC_QDSS_TS_CLK] = &gcc_qdss_ts_clk.clkr,
[GCC_QDSS_TSCTR_DIV4_CLK] = &gcc_qdss_tsctr_div4_clk.clkr,
[GCC_NSS_TS_CLK] = &gcc_nss_ts_clk.clkr,
[GCC_QDSS_TSCTR_DIV8_CLK] = &gcc_qdss_tsctr_div8_clk.clkr,
[GCC_QDSS_TSCTR_DIV16_CLK] = &gcc_qdss_tsctr_div16_clk.clkr,
[GCC_Q6SS_PCLKDBG_CLK] = &gcc_q6ss_pclkdbg_clk.clkr,
[GCC_Q6SS_TRIG_CLK] = &gcc_q6ss_trig_clk.clkr,
[GCC_WCSS_DBG_IFC_APB_CLK] = &gcc_wcss_dbg_ifc_apb_clk.clkr,
[GCC_WCSS_DBG_IFC_DAPBUS_CLK] = &gcc_wcss_dbg_ifc_dapbus_clk.clkr,
[GCC_QDSS_DAP_CLK] = &gcc_qdss_dap_clk.clkr,
[GCC_QDSS_APB2JTAG_CLK] = &gcc_qdss_apb2jtag_clk.clkr,
[GCC_QDSS_TSCTR_DIV3_CLK] = &gcc_qdss_tsctr_div3_clk.clkr,
[QPIC_IO_MACRO_CLK_SRC] = &qpic_io_macro_clk_src.clkr,
[GCC_QPIC_IO_MACRO_CLK] = &gcc_qpic_io_macro_clk.clkr,
[Q6_AXI_CLK_SRC] = &q6_axi_clk_src.clkr,
[GCC_Q6_AXIM_CLK] = &gcc_q6_axim_clk.clkr,
[GCC_WCSS_Q6_TBU_CLK] = &gcc_wcss_q6_tbu_clk.clkr,
[GCC_MEM_NOC_Q6_AXI_CLK] = &gcc_mem_noc_q6_axi_clk.clkr,
[Q6_AXIM2_CLK_SRC] = &q6_axim2_clk_src.clkr,
[NSSNOC_MEMNOC_BFDCD_CLK_SRC] = &nssnoc_memnoc_bfdcd_clk_src.clkr,
[GCC_NSSNOC_MEMNOC_CLK] = &gcc_nssnoc_memnoc_clk.clkr,
@ -4207,7 +3882,6 @@ static struct clk_regmap *gcc_ipq9574_clks[] = {
[GCC_UNIPHY1_SYS_CLK] = &gcc_uniphy1_sys_clk.clkr,
[GCC_UNIPHY2_SYS_CLK] = &gcc_uniphy2_sys_clk.clkr,
[GCC_CMN_12GPLL_SYS_CLK] = &gcc_cmn_12gpll_sys_clk.clkr,
[GCC_Q6SS_BOOT_CLK] = &gcc_q6ss_boot_clk.clkr,
[UNIPHY_SYS_CLK_SRC] = &uniphy_sys_clk_src.clkr,
[NSS_TS_CLK_SRC] = &nss_ts_clk_src.clkr,
[GCC_ANOC_PCIE0_1LANE_M_CLK] = &gcc_anoc_pcie0_1lane_m_clk.clkr,
@ -4384,7 +4058,7 @@ static const struct qcom_reset_map gcc_ipq9574_resets[] = {
#define IPQ_APPS_ID 9574 /* some unique value */
static struct qcom_icc_hws_data icc_ipq9574_hws[] = {
static const struct qcom_icc_hws_data icc_ipq9574_hws[] = {
{ MASTER_ANOC_PCIE0, SLAVE_ANOC_PCIE0, GCC_ANOC_PCIE0_1LANE_M_CLK },
{ MASTER_SNOC_PCIE0, SLAVE_SNOC_PCIE0, GCC_SNOC_PCIE0_1LANE_S_CLK },
{ MASTER_ANOC_PCIE1, SLAVE_ANOC_PCIE1, GCC_ANOC_PCIE1_1LANE_M_CLK },

View File

@ -131,6 +131,7 @@ static struct clk_alpha_pll gpll1_out_main = {
/* 930MHz configuration */
static const struct alpha_pll_config gpll3_config = {
.l = 48,
.alpha_hi = 0x70,
.alpha = 0x0,
.alpha_en_mask = BIT(24),
.post_div_mask = 0xf << 8,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,8 @@ enum {
P_BI_TCXO,
P_GCC_GPLL0_OUT_EVEN,
P_GCC_GPLL0_OUT_MAIN,
P_SM8475_GCC_GPLL2_OUT_EVEN,
P_SM8475_GCC_GPLL3_OUT_EVEN,
P_GCC_GPLL4_OUT_MAIN,
P_GCC_GPLL9_OUT_MAIN,
P_PCIE_1_PHY_AUX_CLK,
@ -36,6 +38,15 @@ enum {
P_USB3_PHY_WRAPPER_GCC_USB30_PIPE_CLK,
};
static struct clk_init_data sm8475_gcc_gpll0_init = {
.name = "gcc_gpll0",
.parent_data = &(const struct clk_parent_data){
.fw_name = "bi_tcxo",
},
.num_parents = 1,
.ops = &clk_alpha_pll_fixed_lucid_ole_ops,
};
static struct clk_alpha_pll gcc_gpll0 = {
.offset = 0x0,
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO],
@ -53,6 +64,15 @@ static struct clk_alpha_pll gcc_gpll0 = {
},
};
static struct clk_init_data sm8475_gcc_gpll0_out_even_init = {
.name = "gcc_gpll0_out_even",
.parent_hws = (const struct clk_hw*[]) {
&gcc_gpll0.clkr.hw,
},
.num_parents = 1,
.ops = &clk_alpha_pll_postdiv_lucid_ole_ops,
};
static const struct clk_div_table post_div_table_gcc_gpll0_out_even[] = {
{ 0x1, 2 },
{ }
@ -75,6 +95,49 @@ static struct clk_alpha_pll_postdiv gcc_gpll0_out_even = {
},
};
static struct clk_alpha_pll sm8475_gcc_gpll2 = {
.offset = 0x2000,
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
.clkr = {
.enable_reg = 0x62018,
.enable_mask = BIT(2),
.hw.init = &(struct clk_init_data){
.name = "gcc_gpll2",
.parent_data = &(const struct clk_parent_data){
.fw_name = "bi_tcxo",
},
.num_parents = 1,
.ops = &clk_alpha_pll_fixed_lucid_ole_ops,
},
},
};
static struct clk_alpha_pll sm8475_gcc_gpll3 = {
.offset = 0x3000,
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
.clkr = {
.enable_reg = 0x62018,
.enable_mask = BIT(3),
.hw.init = &(struct clk_init_data){
.name = "gcc_gpll3",
.parent_data = &(const struct clk_parent_data){
.fw_name = "bi_tcxo",
},
.num_parents = 1,
.ops = &clk_alpha_pll_fixed_lucid_ole_ops,
},
},
};
static struct clk_init_data sm8475_gcc_gpll4_init = {
.name = "gcc_gpll4",
.parent_data = &(const struct clk_parent_data){
.fw_name = "bi_tcxo",
},
.num_parents = 1,
.ops = &clk_alpha_pll_fixed_lucid_ole_ops,
};
static struct clk_alpha_pll gcc_gpll4 = {
.offset = 0x4000,
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO],
@ -92,6 +155,15 @@ static struct clk_alpha_pll gcc_gpll4 = {
},
};
static struct clk_init_data sm8475_gcc_gpll9_init = {
.name = "gcc_gpll9",
.parent_data = &(const struct clk_parent_data){
.fw_name = "bi_tcxo",
},
.num_parents = 1,
.ops = &clk_alpha_pll_fixed_lucid_ole_ops,
};
static struct clk_alpha_pll gcc_gpll9 = {
.offset = 0x9000,
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO],
@ -153,6 +225,22 @@ static const struct clk_parent_data gcc_parent_data_3[] = {
{ .fw_name = "bi_tcxo" },
};
static const struct parent_map sm8475_gcc_parent_map_3[] = {
{ P_BI_TCXO, 0 },
{ P_GCC_GPLL0_OUT_MAIN, 1 },
{ P_SM8475_GCC_GPLL2_OUT_EVEN, 2 },
{ P_SM8475_GCC_GPLL3_OUT_EVEN, 3 },
{ P_GCC_GPLL0_OUT_EVEN, 6 },
};
static const struct clk_parent_data sm8475_gcc_parent_data_3[] = {
{ .fw_name = "bi_tcxo" },
{ .hw = &gcc_gpll0.clkr.hw },
{ .hw = &sm8475_gcc_gpll2.clkr.hw },
{ .hw = &sm8475_gcc_gpll3.clkr.hw },
{ .hw = &gcc_gpll0_out_even.clkr.hw },
};
static const struct parent_map gcc_parent_map_5[] = {
{ P_PCIE_1_PHY_AUX_CLK, 0 },
{ P_BI_TCXO, 2 },
@ -915,6 +1003,16 @@ static struct clk_rcg2 gcc_qupv3_wrap2_s6_clk_src = {
.clkr.hw.init = &gcc_qupv3_wrap2_s6_clk_src_init,
};
static const struct freq_tbl sm8475_ftbl_gcc_sdcc2_apps_clk_src[] = {
F(400000, P_BI_TCXO, 12, 1, 4),
F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0),
F(37000000, P_GCC_GPLL9_OUT_MAIN, 16, 0, 0),
F(50000000, P_GCC_GPLL0_OUT_EVEN, 6, 0, 0),
F(100000000, P_GCC_GPLL0_OUT_EVEN, 3, 0, 0),
F(148000000, P_GCC_GPLL9_OUT_MAIN, 4, 0, 0),
{ }
};
static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = {
F(400000, P_BI_TCXO, 12, 1, 4),
F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0),
@ -963,6 +1061,25 @@ static struct clk_rcg2 gcc_sdcc4_apps_clk_src = {
},
};
static const struct freq_tbl sm8475_ftbl_gcc_ufs_phy_axi_clk_src[] = {
F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0),
F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0),
F(150000000, P_GCC_GPLL0_OUT_MAIN, 4, 0, 0),
F(300000000, P_GCC_GPLL0_OUT_MAIN, 2, 0, 0),
F(600000000, P_GCC_GPLL0_OUT_MAIN, 1, 0, 0),
F(806400000, P_SM8475_GCC_GPLL2_OUT_EVEN, 1, 0, 0),
F(850000000, P_SM8475_GCC_GPLL2_OUT_EVEN, 1, 0, 0),
{ }
};
static struct clk_init_data sm8475_gcc_ufs_phy_axi_clk_src_init = {
.name = "gcc_ufs_phy_axi_clk_src",
.parent_data = sm8475_gcc_parent_data_3,
.num_parents = ARRAY_SIZE(sm8475_gcc_parent_map_3),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_ops,
};
static const struct freq_tbl ftbl_gcc_ufs_phy_axi_clk_src[] = {
F(25000000, P_GCC_GPLL0_OUT_EVEN, 12, 0, 0),
F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0),
@ -987,6 +1104,24 @@ static struct clk_rcg2 gcc_ufs_phy_axi_clk_src = {
},
};
static const struct freq_tbl sm8475_ftbl_gcc_ufs_phy_ice_core_clk_src[] = {
F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0),
F(150000000, P_GCC_GPLL0_OUT_MAIN, 4, 0, 0),
F(300000000, P_GCC_GPLL0_OUT_MAIN, 2, 0, 0),
F(600000000, P_GCC_GPLL0_OUT_MAIN, 1, 0, 0),
F(806400000, P_SM8475_GCC_GPLL2_OUT_EVEN, 1, 0, 0),
F(850000000, P_SM8475_GCC_GPLL2_OUT_EVEN, 1, 0, 0),
{ }
};
static struct clk_init_data sm8475_gcc_ufs_phy_ice_core_clk_src_init = {
.name = "gcc_ufs_phy_ice_core_clk_src",
.parent_data = sm8475_gcc_parent_data_3,
.num_parents = ARRAY_SIZE(sm8475_gcc_parent_map_3),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_ops,
};
static const struct freq_tbl ftbl_gcc_ufs_phy_ice_core_clk_src[] = {
F(75000000, P_GCC_GPLL0_OUT_EVEN, 4, 0, 0),
F(150000000, P_GCC_GPLL0_OUT_MAIN, 4, 0, 0),
@ -1032,6 +1167,14 @@ static struct clk_rcg2 gcc_ufs_phy_phy_aux_clk_src = {
},
};
static struct clk_init_data sm8475_gcc_ufs_phy_unipro_core_clk_src_init = {
.name = "gcc_ufs_phy_unipro_core_clk_src",
.parent_data = sm8475_gcc_parent_data_3,
.num_parents = ARRAY_SIZE(sm8475_gcc_parent_map_3),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_ops,
};
static struct clk_rcg2 gcc_ufs_phy_unipro_core_clk_src = {
.cmd_rcgr = 0x8708c,
.mnd_width = 0,
@ -3166,6 +3309,8 @@ static struct clk_regmap *gcc_sm8450_clocks[] = {
[GCC_USB3_PRIM_PHY_PIPE_CLK_SRC] = &gcc_usb3_prim_phy_pipe_clk_src.clkr,
[GCC_VIDEO_AXI0_CLK] = &gcc_video_axi0_clk.clkr,
[GCC_VIDEO_AXI1_CLK] = &gcc_video_axi1_clk.clkr,
[SM8475_GCC_GPLL2] = NULL,
[SM8475_GCC_GPLL3] = NULL,
};
static const struct qcom_reset_map gcc_sm8450_resets[] = {
@ -3259,6 +3404,7 @@ static const struct qcom_cc_desc gcc_sm8450_desc = {
static const struct of_device_id gcc_sm8450_match_table[] = {
{ .compatible = "qcom,gcc-sm8450" },
{ .compatible = "qcom,sm8475-gcc" },
{ }
};
MODULE_DEVICE_TABLE(of, gcc_sm8450_match_table);
@ -3277,6 +3423,39 @@ static int gcc_sm8450_probe(struct platform_device *pdev)
if (ret)
return ret;
if (of_device_is_compatible(pdev->dev.of_node, "qcom,sm8475-gcc")) {
/* Update GCC PLL0 */
gcc_gpll0.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
gcc_gpll0.clkr.hw.init = &sm8475_gcc_gpll0_init;
gcc_gpll0_out_even.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
gcc_gpll0_out_even.clkr.hw.init = &sm8475_gcc_gpll0_out_even_init;
/* Update GCC PLL4 */
gcc_gpll4.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
gcc_gpll4.clkr.hw.init = &sm8475_gcc_gpll4_init;
/* Update GCC PLL9 */
gcc_gpll9.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
gcc_gpll9.clkr.hw.init = &sm8475_gcc_gpll9_init;
gcc_sdcc2_apps_clk_src.freq_tbl = sm8475_ftbl_gcc_sdcc2_apps_clk_src;
gcc_ufs_phy_axi_clk_src.parent_map = sm8475_gcc_parent_map_3;
gcc_ufs_phy_axi_clk_src.freq_tbl = sm8475_ftbl_gcc_ufs_phy_axi_clk_src;
gcc_ufs_phy_axi_clk_src.clkr.hw.init = &sm8475_gcc_ufs_phy_axi_clk_src_init;
gcc_ufs_phy_ice_core_clk_src.parent_map = sm8475_gcc_parent_map_3;
gcc_ufs_phy_ice_core_clk_src.freq_tbl = sm8475_ftbl_gcc_ufs_phy_ice_core_clk_src;
gcc_ufs_phy_ice_core_clk_src.clkr.hw.init = &sm8475_gcc_ufs_phy_ice_core_clk_src_init;
gcc_ufs_phy_unipro_core_clk_src.parent_map = sm8475_gcc_parent_map_3;
gcc_ufs_phy_unipro_core_clk_src.freq_tbl = sm8475_ftbl_gcc_ufs_phy_ice_core_clk_src;
gcc_ufs_phy_unipro_core_clk_src.clkr.hw.init = &sm8475_gcc_ufs_phy_unipro_core_clk_src_init;
gcc_sm8450_desc.clks[SM8475_GCC_GPLL2] = &sm8475_gcc_gpll2.clkr;
gcc_sm8450_desc.clks[SM8475_GCC_GPLL3] = &sm8475_gcc_gpll3.clkr;
}
/* FORCE_MEM_CORE_ON for ufs phy ice core clocks */
regmap_update_bits(regmap, gcc_ufs_phy_ice_core_clk.halt_reg, BIT(14), BIT(14));
@ -3312,5 +3491,5 @@ static void __exit gcc_sm8450_exit(void)
}
module_exit(gcc_sm8450_exit);
MODULE_DESCRIPTION("QTI GCC SM8450 Driver");
MODULE_DESCRIPTION("QTI GCC SM8450 / SM8475 Driver");
MODULE_LICENSE("GPL v2");

View File

@ -0,0 +1,502 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2024, Linaro Limited
*/
#include <linux/clk-provider.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <dt-bindings/clock/qcom,sar2130p-gpucc.h>
#include <dt-bindings/reset/qcom,sar2130p-gpucc.h>
#include "clk-alpha-pll.h"
#include "clk-branch.h"
#include "clk-rcg.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, 2000000000, 0 },
};
/* 470MHz Configuration */
static const struct alpha_pll_config gpu_cc_pll0_config = {
.l = 0x18,
.alpha = 0x7aaa,
.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,
},
},
};
/* 440MHz 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),
.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),
.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_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_aon_clk = {
.halt_reg = 0x9004,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x9004,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_cxo_aon_clk",
.ops = &clk_branch2_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_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_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_hlos1_vote_gpu_smmu_clk = {
.halt_reg = 0x7000,
.halt_check = BRANCH_HALT_VOTED,
.clkr = {
.enable_reg = 0x7000,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "gpu_cc_hlos1_vote_gpu_smmu_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_cx_gdsc = {
.gdscr = 0x9108,
.gds_hw_ctrl = 0x953c,
.clk_dis_wait_val = 8,
.pd = {
.name = "gpu_cx_gdsc",
},
.pwrsts = PWRSTS_OFF_ON,
.flags = VOTABLE | RETAIN_FF_ENABLE,
};
static struct gdsc gpu_gx_gdsc = {
.gdscr = 0x905c,
.clamp_io_ctrl = 0x9504,
.resets = (unsigned int []){ GPUCC_GPU_CC_GX_BCR,
GPUCC_GPU_CC_ACD_BCR,
GPUCC_GPU_CC_GX_ACD_IROOT_BCR },
.reset_count = 3,
.pd = {
.name = "gpu_gx_gdsc",
.power_on = gdsc_gx_do_nothing_enable,
},
.pwrsts = PWRSTS_OFF_ON,
.flags = CLAMP_IO | AON_RESET | SW_RESET,
};
static struct clk_regmap *gpu_cc_sar2130p_clocks[] = {
[GPU_CC_AHB_CLK] = &gpu_cc_ahb_clk.clkr,
[GPU_CC_CRC_AHB_CLK] = &gpu_cc_crc_ahb_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_AON_CLK] = &gpu_cc_cxo_aon_clk.clkr,
[GPU_CC_CXO_CLK] = &gpu_cc_cxo_clk.clkr,
[GPU_CC_FF_CLK_SRC] = &gpu_cc_ff_clk_src.clkr,
[GPU_CC_GMU_CLK_SRC] = &gpu_cc_gmu_clk_src.clkr,
[GPU_CC_GX_GMU_CLK] = &gpu_cc_gx_gmu_clk.clkr,
[GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK] = &gpu_cc_hlos1_vote_gpu_smmu_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_PLL0] = &gpu_cc_pll0.clkr,
[GPU_CC_PLL1] = &gpu_cc_pll1.clkr,
[GPU_CC_SLEEP_CLK] = &gpu_cc_sleep_clk.clkr,
};
static const struct qcom_reset_map gpu_cc_sar2130p_resets[] = {
[GPUCC_GPU_CC_ACD_BCR] = { 0x9358 },
[GPUCC_GPU_CC_GX_ACD_IROOT_BCR] = { 0x958c },
[GPUCC_GPU_CC_GX_BCR] = { 0x9058 },
};
static struct gdsc *gpu_cc_sar2130p_gdscs[] = {
[GPU_CX_GDSC] = &gpu_cx_gdsc,
[GPU_GX_GDSC] = &gpu_gx_gdsc,
};
static const struct regmap_config gpu_cc_sar2130p_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.max_register = 0xa000,
.fast_io = true,
};
static const struct qcom_cc_desc gpu_cc_sar2130p_desc = {
.config = &gpu_cc_sar2130p_regmap_config,
.clks = gpu_cc_sar2130p_clocks,
.num_clks = ARRAY_SIZE(gpu_cc_sar2130p_clocks),
.resets = gpu_cc_sar2130p_resets,
.num_resets = ARRAY_SIZE(gpu_cc_sar2130p_resets),
.gdscs = gpu_cc_sar2130p_gdscs,
.num_gdscs = ARRAY_SIZE(gpu_cc_sar2130p_gdscs),
};
static const struct of_device_id gpu_cc_sar2130p_match_table[] = {
{ .compatible = "qcom,sar2130p-gpucc" },
{ }
};
MODULE_DEVICE_TABLE(of, gpu_cc_sar2130p_match_table);
static int gpu_cc_sar2130p_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct regmap *regmap;
regmap = qcom_cc_map(pdev, &gpu_cc_sar2130p_desc);
if (IS_ERR(regmap))
return dev_err_probe(dev, PTR_ERR(regmap), "Couldn't map GPU_CC\n");
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-on */
qcom_branch_set_clk_en(regmap, 0x900c); /* GPU_CC_DEMET_CLK */
return qcom_cc_really_probe(dev, &gpu_cc_sar2130p_desc, regmap);
}
static struct platform_driver gpu_cc_sar2130p_driver = {
.probe = gpu_cc_sar2130p_probe,
.driver = {
.name = "gpu_cc-sar2130p",
.of_match_table = gpu_cc_sar2130p_match_table,
},
};
module_platform_driver(gpu_cc_sar2130p_driver);
MODULE_DESCRIPTION("QTI GPU_CC SAR2130P Driver");
MODULE_LICENSE("GPL");

View File

@ -40,7 +40,7 @@ static const struct pll_vco lucid_evo_vco[] = {
{ 249600000, 2000000000, 0 },
};
static struct alpha_pll_config gpu_cc_pll0_config = {
static const struct alpha_pll_config gpu_cc_pll0_config = {
.l = 0x1d,
.alpha = 0xb000,
.config_ctl_val = 0x20485699,
@ -50,6 +50,20 @@ static struct alpha_pll_config gpu_cc_pll0_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_gpu_cc_pll0_config = {
.l = 0x1d,
.alpha = 0xb000,
.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_evo_vco,
@ -67,7 +81,7 @@ static struct clk_alpha_pll gpu_cc_pll0 = {
},
};
static struct alpha_pll_config gpu_cc_pll1_config = {
static const struct alpha_pll_config gpu_cc_pll1_config = {
.l = 0x34,
.alpha = 0x1555,
.config_ctl_val = 0x20485699,
@ -77,6 +91,20 @@ static struct alpha_pll_config gpu_cc_pll1_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_gpu_cc_pll1_config = {
.l = 0x34,
.alpha = 0x1555,
.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_evo_vco,
@ -736,6 +764,7 @@ static const struct qcom_cc_desc gpu_cc_sm8450_desc = {
static const struct of_device_id gpu_cc_sm8450_match_table[] = {
{ .compatible = "qcom,sm8450-gpucc" },
{ .compatible = "qcom,sm8475-gpucc" },
{ }
};
MODULE_DEVICE_TABLE(of, gpu_cc_sm8450_match_table);
@ -748,8 +777,19 @@ static int gpu_cc_sm8450_probe(struct platform_device *pdev)
if (IS_ERR(regmap))
return PTR_ERR(regmap);
clk_lucid_evo_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config);
clk_lucid_evo_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config);
if (of_device_is_compatible(pdev->dev.of_node, "qcom,sm8475-gpucc")) {
/* Update GPUCC PLL0 */
gpu_cc_pll0.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
/* Update GPUCC PLL1 */
gpu_cc_pll1.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
clk_lucid_ole_pll_configure(&gpu_cc_pll0, regmap, &sm8475_gpu_cc_pll0_config);
clk_lucid_ole_pll_configure(&gpu_cc_pll1, regmap, &sm8475_gpu_cc_pll1_config);
} else {
clk_lucid_evo_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config);
clk_lucid_evo_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config);
}
return qcom_cc_really_probe(&pdev->dev, &gpu_cc_sm8450_desc, regmap);
}
@ -763,5 +803,5 @@ static struct platform_driver gpu_cc_sm8450_driver = {
};
module_platform_driver(gpu_cc_sm8450_driver);
MODULE_DESCRIPTION("QTI GPU_CC SM8450 Driver");
MODULE_DESCRIPTION("QTI GPU_CC SM8450 / SM8475 Driver");
MODULE_LICENSE("GPL");

View File

@ -129,6 +129,13 @@ static struct clk_branch tcsr_usb3_clkref_en = {
},
};
static struct clk_regmap *tcsr_cc_sar2130p_clocks[] = {
[TCSR_PCIE_0_CLKREF_EN] = &tcsr_pcie_0_clkref_en.clkr,
[TCSR_PCIE_1_CLKREF_EN] = &tcsr_pcie_1_clkref_en.clkr,
[TCSR_USB2_CLKREF_EN] = &tcsr_usb2_clkref_en.clkr,
[TCSR_USB3_CLKREF_EN] = &tcsr_usb3_clkref_en.clkr,
};
static struct clk_regmap *tcsr_cc_sm8550_clocks[] = {
[TCSR_PCIE_0_CLKREF_EN] = &tcsr_pcie_0_clkref_en.clkr,
[TCSR_PCIE_1_CLKREF_EN] = &tcsr_pcie_1_clkref_en.clkr,
@ -146,6 +153,12 @@ static const struct regmap_config tcsr_cc_sm8550_regmap_config = {
.fast_io = true,
};
static const struct qcom_cc_desc tcsr_cc_sar2130p_desc = {
.config = &tcsr_cc_sm8550_regmap_config,
.clks = tcsr_cc_sar2130p_clocks,
.num_clks = ARRAY_SIZE(tcsr_cc_sar2130p_clocks),
};
static const struct qcom_cc_desc tcsr_cc_sm8550_desc = {
.config = &tcsr_cc_sm8550_regmap_config,
.clks = tcsr_cc_sm8550_clocks,
@ -153,7 +166,8 @@ static const struct qcom_cc_desc tcsr_cc_sm8550_desc = {
};
static const struct of_device_id tcsr_cc_sm8550_match_table[] = {
{ .compatible = "qcom,sm8550-tcsr" },
{ .compatible = "qcom,sar2130p-tcsr", .data = &tcsr_cc_sar2130p_desc },
{ .compatible = "qcom,sm8550-tcsr", .data = &tcsr_cc_sm8550_desc },
{ }
};
MODULE_DEVICE_TABLE(of, tcsr_cc_sm8550_match_table);
@ -162,7 +176,7 @@ static int tcsr_cc_sm8550_probe(struct platform_device *pdev)
{
struct regmap *regmap;
regmap = qcom_cc_map(pdev, &tcsr_cc_sm8550_desc);
regmap = qcom_cc_map(pdev, of_device_get_match_data(&pdev->dev));
if (IS_ERR(regmap))
return PTR_ERR(regmap);

View File

@ -0,0 +1,576 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <dt-bindings/clock/qcom,sa8775p-videocc.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_IFACE,
DT_BI_TCXO,
DT_BI_TCXO_AO,
DT_SLEEP_CLK,
};
enum {
P_BI_TCXO,
P_BI_TCXO_AO,
P_SLEEP_CLK,
P_VIDEO_PLL0_OUT_MAIN,
P_VIDEO_PLL1_OUT_MAIN,
};
static const struct pll_vco lucid_evo_vco[] = {
{ 249600000, 2020000000, 0 },
};
static const struct alpha_pll_config video_pll0_config = {
.l = 0x39,
.alpha = 0x3000,
.config_ctl_val = 0x20485699,
.config_ctl_hi_val = 0x00182261,
.config_ctl_hi1_val = 0x32aa299c,
.user_ctl_val = 0x00000000,
.user_ctl_hi_val = 0x00400805,
};
static struct clk_alpha_pll video_pll0 = {
.offset = 0x0,
.vco_table = lucid_evo_vco,
.num_vco = ARRAY_SIZE(lucid_evo_vco),
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO],
.clkr = {
.hw.init = &(const struct clk_init_data) {
.name = "video_pll0",
.parent_data = &(const struct clk_parent_data) {
.index = DT_BI_TCXO,
},
.num_parents = 1,
.ops = &clk_alpha_pll_lucid_evo_ops,
},
},
};
static const struct alpha_pll_config video_pll1_config = {
.l = 0x39,
.alpha = 0x3000,
.config_ctl_val = 0x20485699,
.config_ctl_hi_val = 0x00182261,
.config_ctl_hi1_val = 0x32aa299c,
.user_ctl_val = 0x00000000,
.user_ctl_hi_val = 0x00400805,
};
static struct clk_alpha_pll video_pll1 = {
.offset = 0x1000,
.vco_table = lucid_evo_vco,
.num_vco = ARRAY_SIZE(lucid_evo_vco),
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO],
.clkr = {
.hw.init = &(const struct clk_init_data) {
.name = "video_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 video_cc_parent_map_0_ao[] = {
{ P_BI_TCXO_AO, 0 },
};
static const struct clk_parent_data video_cc_parent_data_0_ao[] = {
{ .index = DT_BI_TCXO_AO },
};
static const struct parent_map video_cc_parent_map_1[] = {
{ P_BI_TCXO, 0 },
{ P_VIDEO_PLL0_OUT_MAIN, 1 },
};
static const struct clk_parent_data video_cc_parent_data_1[] = {
{ .index = DT_BI_TCXO },
{ .hw = &video_pll0.clkr.hw },
};
static const struct parent_map video_cc_parent_map_2[] = {
{ P_BI_TCXO, 0 },
{ P_VIDEO_PLL1_OUT_MAIN, 1 },
};
static const struct clk_parent_data video_cc_parent_data_2[] = {
{ .index = DT_BI_TCXO },
{ .hw = &video_pll1.clkr.hw },
};
static const struct parent_map video_cc_parent_map_3[] = {
{ P_SLEEP_CLK, 0 },
};
static const struct clk_parent_data video_cc_parent_data_3[] = {
{ .index = DT_SLEEP_CLK },
};
static const struct freq_tbl ftbl_video_cc_ahb_clk_src[] = {
F(19200000, P_BI_TCXO_AO, 1, 0, 0),
{ }
};
static struct clk_rcg2 video_cc_ahb_clk_src = {
.cmd_rcgr = 0x8030,
.mnd_width = 0,
.hid_width = 5,
.parent_map = video_cc_parent_map_0_ao,
.freq_tbl = ftbl_video_cc_ahb_clk_src,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "video_cc_ahb_clk_src",
.parent_data = video_cc_parent_data_0_ao,
.num_parents = ARRAY_SIZE(video_cc_parent_data_0_ao),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_shared_ops,
},
};
static const struct freq_tbl ftbl_video_cc_mvs0_clk_src[] = {
F(1098000000, P_VIDEO_PLL0_OUT_MAIN, 1, 0, 0),
F(1332000000, P_VIDEO_PLL0_OUT_MAIN, 1, 0, 0),
F(1599000000, P_VIDEO_PLL0_OUT_MAIN, 1, 0, 0),
F(1680000000, P_VIDEO_PLL0_OUT_MAIN, 1, 0, 0),
{ }
};
static struct clk_rcg2 video_cc_mvs0_clk_src = {
.cmd_rcgr = 0x8000,
.mnd_width = 0,
.hid_width = 5,
.parent_map = video_cc_parent_map_1,
.freq_tbl = ftbl_video_cc_mvs0_clk_src,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "video_cc_mvs0_clk_src",
.parent_data = video_cc_parent_data_1,
.num_parents = ARRAY_SIZE(video_cc_parent_data_1),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_shared_ops,
},
};
static const struct freq_tbl ftbl_video_cc_mvs1_clk_src[] = {
F(1098000000, P_VIDEO_PLL1_OUT_MAIN, 1, 0, 0),
F(1332000000, P_VIDEO_PLL1_OUT_MAIN, 1, 0, 0),
F(1600000000, P_VIDEO_PLL1_OUT_MAIN, 1, 0, 0),
F(1800000000, P_VIDEO_PLL1_OUT_MAIN, 1, 0, 0),
{ }
};
static struct clk_rcg2 video_cc_mvs1_clk_src = {
.cmd_rcgr = 0x8018,
.mnd_width = 0,
.hid_width = 5,
.parent_map = video_cc_parent_map_2,
.freq_tbl = ftbl_video_cc_mvs1_clk_src,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "video_cc_mvs1_clk_src",
.parent_data = video_cc_parent_data_2,
.num_parents = ARRAY_SIZE(video_cc_parent_data_2),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_shared_ops,
},
};
static const struct freq_tbl ftbl_video_cc_sleep_clk_src[] = {
F(32000, P_SLEEP_CLK, 1, 0, 0),
{ }
};
static struct clk_rcg2 video_cc_sleep_clk_src = {
.cmd_rcgr = 0x812c,
.mnd_width = 0,
.hid_width = 5,
.parent_map = video_cc_parent_map_3,
.freq_tbl = ftbl_video_cc_sleep_clk_src,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "video_cc_sleep_clk_src",
.parent_data = video_cc_parent_data_3,
.num_parents = ARRAY_SIZE(video_cc_parent_data_3),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_shared_ops,
},
};
static struct clk_rcg2 video_cc_xo_clk_src = {
.cmd_rcgr = 0x8110,
.mnd_width = 0,
.hid_width = 5,
.parent_map = video_cc_parent_map_0_ao,
.freq_tbl = ftbl_video_cc_ahb_clk_src,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "video_cc_xo_clk_src",
.parent_data = video_cc_parent_data_0_ao,
.num_parents = ARRAY_SIZE(video_cc_parent_data_0_ao),
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_rcg2_shared_ops,
},
};
static struct clk_regmap_div video_cc_mvs0_div_clk_src = {
.reg = 0x80b8,
.shift = 0,
.width = 4,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "video_cc_mvs0_div_clk_src",
.parent_hws = (const struct clk_hw*[]) {
&video_cc_mvs0_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_regmap_div_ro_ops,
},
};
static struct clk_regmap_div video_cc_mvs0c_div2_div_clk_src = {
.reg = 0x806c,
.shift = 0,
.width = 4,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "video_cc_mvs0c_div2_div_clk_src",
.parent_hws = (const struct clk_hw*[]) {
&video_cc_mvs0_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_regmap_div_ro_ops,
},
};
static struct clk_regmap_div video_cc_mvs1_div_clk_src = {
.reg = 0x80dc,
.shift = 0,
.width = 4,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "video_cc_mvs1_div_clk_src",
.parent_hws = (const struct clk_hw*[]) {
&video_cc_mvs1_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_regmap_div_ro_ops,
},
};
static struct clk_regmap_div video_cc_mvs1c_div2_div_clk_src = {
.reg = 0x8094,
.shift = 0,
.width = 4,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "video_cc_mvs1c_div2_div_clk_src",
.parent_hws = (const struct clk_hw*[]) {
&video_cc_mvs1_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_regmap_div_ro_ops,
},
};
static struct clk_regmap_div video_cc_sm_div_clk_src = {
.reg = 0x8108,
.shift = 0,
.width = 4,
.clkr.hw.init = &(const struct clk_init_data) {
.name = "video_cc_sm_div_clk_src",
.ops = &clk_regmap_div_ro_ops,
},
};
static struct clk_branch video_cc_mvs0_clk = {
.halt_reg = 0x80b0,
.halt_check = BRANCH_HALT_VOTED,
.hwcg_reg = 0x80b0,
.hwcg_bit = 1,
.clkr = {
.enable_reg = 0x80b0,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "video_cc_mvs0_clk",
.parent_hws = (const struct clk_hw*[]) {
&video_cc_mvs0_div_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_cc_mvs0c_clk = {
.halt_reg = 0x8064,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x8064,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "video_cc_mvs0c_clk",
.parent_hws = (const struct clk_hw*[]) {
&video_cc_mvs0c_div2_div_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_cc_mvs1_clk = {
.halt_reg = 0x80d4,
.halt_check = BRANCH_HALT_VOTED,
.hwcg_reg = 0x80d4,
.hwcg_bit = 1,
.clkr = {
.enable_reg = 0x80d4,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "video_cc_mvs1_clk",
.parent_hws = (const struct clk_hw*[]) {
&video_cc_mvs1_div_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_cc_mvs1c_clk = {
.halt_reg = 0x808c,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x808c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "video_cc_mvs1c_clk",
.parent_hws = (const struct clk_hw*[]) {
&video_cc_mvs1c_div2_div_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_cc_pll_lock_monitor_clk = {
.halt_reg = 0x9000,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0x9000,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "video_cc_pll_lock_monitor_clk",
.parent_hws = (const struct clk_hw*[]) {
&video_cc_xo_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct clk_branch video_cc_sm_obs_clk = {
.halt_reg = 0x810c,
.halt_check = BRANCH_HALT_SKIP,
.clkr = {
.enable_reg = 0x810c,
.enable_mask = BIT(0),
.hw.init = &(const struct clk_init_data) {
.name = "video_cc_sm_obs_clk",
.parent_hws = (const struct clk_hw*[]) {
&video_cc_sm_div_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
static struct gdsc video_cc_mvs0c_gdsc = {
.gdscr = 0x804c,
.en_rest_wait_val = 0x2,
.en_few_wait_val = 0x2,
.clk_dis_wait_val = 0x6,
.pd = {
.name = "video_cc_mvs0c_gdsc",
},
.pwrsts = PWRSTS_OFF_ON,
.flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR,
};
static struct gdsc video_cc_mvs0_gdsc = {
.gdscr = 0x809c,
.en_rest_wait_val = 0x2,
.en_few_wait_val = 0x2,
.clk_dis_wait_val = 0x6,
.pd = {
.name = "video_cc_mvs0_gdsc",
},
.pwrsts = PWRSTS_OFF_ON,
.parent = &video_cc_mvs0c_gdsc.pd,
.flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR | HW_CTRL_TRIGGER,
};
static struct gdsc video_cc_mvs1c_gdsc = {
.gdscr = 0x8074,
.en_rest_wait_val = 0x2,
.en_few_wait_val = 0x2,
.clk_dis_wait_val = 0x6,
.pd = {
.name = "video_cc_mvs1c_gdsc",
},
.pwrsts = PWRSTS_OFF_ON,
.flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR,
};
static struct gdsc video_cc_mvs1_gdsc = {
.gdscr = 0x80c0,
.en_rest_wait_val = 0x2,
.en_few_wait_val = 0x2,
.clk_dis_wait_val = 0x6,
.pd = {
.name = "video_cc_mvs1_gdsc",
},
.pwrsts = PWRSTS_OFF_ON,
.parent = &video_cc_mvs1c_gdsc.pd,
.flags = RETAIN_FF_ENABLE | POLL_CFG_GDSCR | HW_CTRL_TRIGGER,
};
static struct clk_regmap *video_cc_sa8775p_clocks[] = {
[VIDEO_CC_AHB_CLK_SRC] = &video_cc_ahb_clk_src.clkr,
[VIDEO_CC_MVS0_CLK] = &video_cc_mvs0_clk.clkr,
[VIDEO_CC_MVS0_CLK_SRC] = &video_cc_mvs0_clk_src.clkr,
[VIDEO_CC_MVS0_DIV_CLK_SRC] = &video_cc_mvs0_div_clk_src.clkr,
[VIDEO_CC_MVS0C_CLK] = &video_cc_mvs0c_clk.clkr,
[VIDEO_CC_MVS0C_DIV2_DIV_CLK_SRC] = &video_cc_mvs0c_div2_div_clk_src.clkr,
[VIDEO_CC_MVS1_CLK] = &video_cc_mvs1_clk.clkr,
[VIDEO_CC_MVS1_CLK_SRC] = &video_cc_mvs1_clk_src.clkr,
[VIDEO_CC_MVS1_DIV_CLK_SRC] = &video_cc_mvs1_div_clk_src.clkr,
[VIDEO_CC_MVS1C_CLK] = &video_cc_mvs1c_clk.clkr,
[VIDEO_CC_MVS1C_DIV2_DIV_CLK_SRC] = &video_cc_mvs1c_div2_div_clk_src.clkr,
[VIDEO_CC_PLL_LOCK_MONITOR_CLK] = &video_cc_pll_lock_monitor_clk.clkr,
[VIDEO_CC_SLEEP_CLK_SRC] = &video_cc_sleep_clk_src.clkr,
[VIDEO_CC_SM_DIV_CLK_SRC] = &video_cc_sm_div_clk_src.clkr,
[VIDEO_CC_SM_OBS_CLK] = &video_cc_sm_obs_clk.clkr,
[VIDEO_CC_XO_CLK_SRC] = &video_cc_xo_clk_src.clkr,
[VIDEO_PLL0] = &video_pll0.clkr,
[VIDEO_PLL1] = &video_pll1.clkr,
};
static struct gdsc *video_cc_sa8775p_gdscs[] = {
[VIDEO_CC_MVS0_GDSC] = &video_cc_mvs0_gdsc,
[VIDEO_CC_MVS0C_GDSC] = &video_cc_mvs0c_gdsc,
[VIDEO_CC_MVS1_GDSC] = &video_cc_mvs1_gdsc,
[VIDEO_CC_MVS1C_GDSC] = &video_cc_mvs1c_gdsc,
};
static const struct qcom_reset_map video_cc_sa8775p_resets[] = {
[VIDEO_CC_INTERFACE_BCR] = { 0x80e8 },
[VIDEO_CC_MVS0_BCR] = { 0x8098 },
[VIDEO_CC_MVS0C_CLK_ARES] = { 0x8064, 2 },
[VIDEO_CC_MVS0C_BCR] = { 0x8048 },
[VIDEO_CC_MVS1_BCR] = { 0x80bc },
[VIDEO_CC_MVS1C_CLK_ARES] = { 0x808c, 2 },
[VIDEO_CC_MVS1C_BCR] = { 0x8070 },
};
static const struct regmap_config video_cc_sa8775p_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.max_register = 0xb000,
.fast_io = true,
};
static struct qcom_cc_desc video_cc_sa8775p_desc = {
.config = &video_cc_sa8775p_regmap_config,
.clks = video_cc_sa8775p_clocks,
.num_clks = ARRAY_SIZE(video_cc_sa8775p_clocks),
.resets = video_cc_sa8775p_resets,
.num_resets = ARRAY_SIZE(video_cc_sa8775p_resets),
.gdscs = video_cc_sa8775p_gdscs,
.num_gdscs = ARRAY_SIZE(video_cc_sa8775p_gdscs),
};
static const struct of_device_id video_cc_sa8775p_match_table[] = {
{ .compatible = "qcom,sa8775p-videocc" },
{ }
};
MODULE_DEVICE_TABLE(of, video_cc_sa8775p_match_table);
static int video_cc_sa8775p_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, &video_cc_sa8775p_desc);
if (IS_ERR(regmap)) {
pm_runtime_put(&pdev->dev);
return PTR_ERR(regmap);
}
clk_lucid_evo_pll_configure(&video_pll0, regmap, &video_pll0_config);
clk_lucid_evo_pll_configure(&video_pll1, regmap, &video_pll1_config);
/* Keep some clocks always enabled */
qcom_branch_set_clk_en(regmap, 0x80ec); /* VIDEO_CC_AHB_CLK */
qcom_branch_set_clk_en(regmap, 0x8144); /* VIDEO_CC_SLEEP_CLK */
qcom_branch_set_clk_en(regmap, 0x8128); /* VIDEO_CC_XO_CLK */
ret = qcom_cc_really_probe(&pdev->dev, &video_cc_sa8775p_desc, regmap);
pm_runtime_put(&pdev->dev);
return ret;
}
static struct platform_driver video_cc_sa8775p_driver = {
.probe = video_cc_sa8775p_probe,
.driver = {
.name = "videocc-sa8775p",
.of_match_table = video_cc_sa8775p_match_table,
},
};
module_platform_driver(video_cc_sa8775p_driver);
MODULE_DESCRIPTION("QTI VIDEOCC SA8775P Driver");
MODULE_LICENSE("GPL");

View File

@ -46,6 +46,21 @@ static const struct alpha_pll_config video_cc_pll0_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_video_cc_pll0_config = {
/* .l includes CAL_L_VAL, L_VAL fields */
.l = 0x1e,
.alpha = 0x0,
.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 video_cc_pll0 = {
.offset = 0x0,
.vco_table = lucid_evo_vco,
@ -74,6 +89,21 @@ static const struct alpha_pll_config video_cc_pll1_config = {
.user_ctl_hi_val = 0x00000805,
};
static const struct alpha_pll_config sm8475_video_cc_pll1_config = {
/* .l includes CAL_L_VAL, L_VAL fields */
.l = 0x2b,
.alpha = 0xc000,
.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 video_cc_pll1 = {
.offset = 0x1000,
.vco_table = lucid_evo_vco,
@ -397,6 +427,7 @@ static struct qcom_cc_desc video_cc_sm8450_desc = {
static const struct of_device_id video_cc_sm8450_match_table[] = {
{ .compatible = "qcom,sm8450-videocc" },
{ .compatible = "qcom,sm8475-videocc" },
{ }
};
MODULE_DEVICE_TABLE(of, video_cc_sm8450_match_table);
@ -420,8 +451,19 @@ static int video_cc_sm8450_probe(struct platform_device *pdev)
return PTR_ERR(regmap);
}
clk_lucid_evo_pll_configure(&video_cc_pll0, regmap, &video_cc_pll0_config);
clk_lucid_evo_pll_configure(&video_cc_pll1, regmap, &video_cc_pll1_config);
if (of_device_is_compatible(pdev->dev.of_node, "qcom,sm8475-videocc")) {
/* Update VideoCC PLL0 */
video_cc_pll0.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
/* Update VideoCC PLL1 */
video_cc_pll1.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE];
clk_lucid_ole_pll_configure(&video_cc_pll0, regmap, &sm8475_video_cc_pll0_config);
clk_lucid_ole_pll_configure(&video_cc_pll1, regmap, &sm8475_video_cc_pll1_config);
} else {
clk_lucid_evo_pll_configure(&video_cc_pll0, regmap, &video_cc_pll0_config);
clk_lucid_evo_pll_configure(&video_cc_pll1, regmap, &video_cc_pll1_config);
}
/* Keep some clocks always-on */
qcom_branch_set_clk_en(regmap, 0x80e4); /* VIDEO_CC_AHB_CLK */
@ -445,5 +487,5 @@ static struct platform_driver video_cc_sm8450_driver = {
module_platform_driver(video_cc_sm8450_driver);
MODULE_DESCRIPTION("QTI VIDEOCC SM8450 Driver");
MODULE_DESCRIPTION("QTI VIDEOCC SM8450 / SM8475 Driver");
MODULE_LICENSE("GPL");

View File

@ -0,0 +1,88 @@
/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
#ifndef __DTS_MARVELL_PXA1908_CLOCK_H
#define __DTS_MARVELL_PXA1908_CLOCK_H
/* plls */
#define PXA1908_CLK_CLK32 1
#define PXA1908_CLK_VCTCXO 2
#define PXA1908_CLK_PLL1_624 3
#define PXA1908_CLK_PLL1_416 4
#define PXA1908_CLK_PLL1_499 5
#define PXA1908_CLK_PLL1_832 6
#define PXA1908_CLK_PLL1_1248 7
#define PXA1908_CLK_PLL1_D2 8
#define PXA1908_CLK_PLL1_D4 9
#define PXA1908_CLK_PLL1_D8 10
#define PXA1908_CLK_PLL1_D16 11
#define PXA1908_CLK_PLL1_D6 12
#define PXA1908_CLK_PLL1_D12 13
#define PXA1908_CLK_PLL1_D24 14
#define PXA1908_CLK_PLL1_D48 15
#define PXA1908_CLK_PLL1_D96 16
#define PXA1908_CLK_PLL1_D13 17
#define PXA1908_CLK_PLL1_32 18
#define PXA1908_CLK_PLL1_208 19
#define PXA1908_CLK_PLL1_117 20
#define PXA1908_CLK_PLL1_416_GATE 21
#define PXA1908_CLK_PLL1_624_GATE 22
#define PXA1908_CLK_PLL1_832_GATE 23
#define PXA1908_CLK_PLL1_1248_GATE 24
#define PXA1908_CLK_PLL1_D2_GATE 25
#define PXA1908_CLK_PLL1_499_EN 26
#define PXA1908_CLK_PLL2VCO 27
#define PXA1908_CLK_PLL2 28
#define PXA1908_CLK_PLL2P 29
#define PXA1908_CLK_PLL2VCODIV3 30
#define PXA1908_CLK_PLL3VCO 31
#define PXA1908_CLK_PLL3 32
#define PXA1908_CLK_PLL3P 33
#define PXA1908_CLK_PLL3VCODIV3 34
#define PXA1908_CLK_PLL4VCO 35
#define PXA1908_CLK_PLL4 36
#define PXA1908_CLK_PLL4P 37
#define PXA1908_CLK_PLL4VCODIV3 38
/* apb (apbc) peripherals */
#define PXA1908_CLK_UART0 1
#define PXA1908_CLK_UART1 2
#define PXA1908_CLK_GPIO 3
#define PXA1908_CLK_PWM0 4
#define PXA1908_CLK_PWM1 5
#define PXA1908_CLK_PWM2 6
#define PXA1908_CLK_PWM3 7
#define PXA1908_CLK_SSP0 8
#define PXA1908_CLK_SSP1 9
#define PXA1908_CLK_IPC_RST 10
#define PXA1908_CLK_RTC 11
#define PXA1908_CLK_TWSI0 12
#define PXA1908_CLK_KPC 13
#define PXA1908_CLK_SWJTAG 14
#define PXA1908_CLK_SSP2 15
#define PXA1908_CLK_TWSI1 16
#define PXA1908_CLK_THERMAL 17
#define PXA1908_CLK_TWSI3 18
/* apb (apbcp) peripherals */
#define PXA1908_CLK_UART2 1
#define PXA1908_CLK_TWSI2 2
#define PXA1908_CLK_AICER 3
/* axi (apmu) peripherals */
#define PXA1908_CLK_CCIC1 1
#define PXA1908_CLK_ISP 2
#define PXA1908_CLK_DSI1 3
#define PXA1908_CLK_DISP1 4
#define PXA1908_CLK_CCIC0 5
#define PXA1908_CLK_SDH0 6
#define PXA1908_CLK_SDH1 7
#define PXA1908_CLK_USB 8
#define PXA1908_CLK_NF 9
#define PXA1908_CLK_CORE_DEBUG 10
#define PXA1908_CLK_VPU 11
#define PXA1908_CLK_GC 12
#define PXA1908_CLK_SDH2 13
#define PXA1908_CLK_GC2D 14
#define PXA1908_CLK_TRACE 15
#define PXA1908_CLK_DVC_DFC_DEBUG 16
#endif

View File

@ -194,6 +194,9 @@
#define GCC_VIDEO_AXI0_CLK 182
#define GCC_VIDEO_AXI1_CLK 183
#define GCC_VIDEO_XO_CLK 184
/* Additional SM8475-specific clocks */
#define SM8475_GCC_GPLL2 185
#define SM8475_GCC_GPLL3 186
/* GCC resets */
#define GCC_CAMERA_BCR 0

View File

@ -96,15 +96,7 @@
#define GCC_PCNOC_BFDCD_CLK_SRC 87
#define GCC_PCNOC_LPASS_CLK 88
#define GCC_PRNG_AHB_CLK 89
#define GCC_Q6_AHB_CLK 90
#define GCC_Q6_AHB_S_CLK 91
#define GCC_Q6_AXIM_CLK 92
#define GCC_Q6_AXIM_CLK_SRC 93
#define GCC_Q6_AXIS_CLK 94
#define GCC_Q6_TSCTR_1TO2_CLK 95
#define GCC_Q6SS_ATBM_CLK 96
#define GCC_Q6SS_PCLKDBG_CLK 97
#define GCC_Q6SS_TRIG_CLK 98
#define GCC_QDSS_AT_CLK 99
#define GCC_QDSS_AT_CLK_SRC 100
#define GCC_QDSS_CFG_AHB_CLK 101
@ -134,7 +126,6 @@
#define GCC_SNOC_PCIE3_2LANE_S_CLK 125
#define GCC_SNOC_USB_CLK 126
#define GCC_SYS_NOC_AT_CLK 127
#define GCC_SYS_NOC_WCSS_AHB_CLK 128
#define GCC_SYSTEM_NOC_BFDCD_CLK_SRC 129
#define GCC_UNIPHY0_AHB_CLK 130
#define GCC_UNIPHY0_SYS_CLK 131
@ -155,17 +146,6 @@
#define GCC_USB0_PIPE_CLK 146
#define GCC_USB0_SLEEP_CLK 147
#define GCC_WCSS_AHB_CLK_SRC 148
#define GCC_WCSS_AXIM_CLK 149
#define GCC_WCSS_AXIS_CLK 150
#define GCC_WCSS_DBG_IFC_APB_BDG_CLK 151
#define GCC_WCSS_DBG_IFC_APB_CLK 152
#define GCC_WCSS_DBG_IFC_ATB_BDG_CLK 153
#define GCC_WCSS_DBG_IFC_ATB_CLK 154
#define GCC_WCSS_DBG_IFC_NTS_BDG_CLK 155
#define GCC_WCSS_DBG_IFC_NTS_CLK 156
#define GCC_WCSS_ECAHB_CLK 157
#define GCC_WCSS_MST_ASYNC_BDG_CLK 158
#define GCC_WCSS_SLV_ASYNC_BDG_CLK 159
#define GCC_XO_CLK 160
#define GCC_XO_CLK_SRC 161
#define GCC_XO_DIV4_CLK 162

View File

@ -0,0 +1,156 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* Copyright (c) 2018,2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _DT_BINDINGS_CLOCK_IPQ_GCC_IPQ5424_H
#define _DT_BINDINGS_CLOCK_IPQ_GCC_IPQ5424_H
#define GPLL0 0
#define GPLL4 1
#define GPLL2 2
#define GPLL2_OUT_MAIN 3
#define GCC_SLEEP_CLK_SRC 4
#define GCC_APSS_DBG_CLK 5
#define GCC_USB0_EUD_AT_CLK 6
#define GCC_PCIE0_AXI_M_CLK_SRC 7
#define GCC_PCIE0_AXI_M_CLK 8
#define GCC_PCIE1_AXI_M_CLK_SRC 9
#define GCC_PCIE1_AXI_M_CLK 10
#define GCC_PCIE2_AXI_M_CLK_SRC 11
#define GCC_PCIE2_AXI_M_CLK 12
#define GCC_PCIE3_AXI_M_CLK_SRC 13
#define GCC_PCIE3_AXI_M_CLK 14
#define GCC_PCIE0_AXI_S_CLK_SRC 15
#define GCC_PCIE0_AXI_S_BRIDGE_CLK 16
#define GCC_PCIE0_AXI_S_CLK 17
#define GCC_PCIE1_AXI_S_CLK_SRC 18
#define GCC_PCIE1_AXI_S_BRIDGE_CLK 19
#define GCC_PCIE1_AXI_S_CLK 20
#define GCC_PCIE2_AXI_S_CLK_SRC 21
#define GCC_PCIE2_AXI_S_BRIDGE_CLK 22
#define GCC_PCIE2_AXI_S_CLK 23
#define GCC_PCIE3_AXI_S_CLK_SRC 24
#define GCC_PCIE3_AXI_S_BRIDGE_CLK 25
#define GCC_PCIE3_AXI_S_CLK 26
#define GCC_PCIE0_PIPE_CLK_SRC 27
#define GCC_PCIE0_PIPE_CLK 28
#define GCC_PCIE1_PIPE_CLK_SRC 29
#define GCC_PCIE1_PIPE_CLK 30
#define GCC_PCIE2_PIPE_CLK_SRC 31
#define GCC_PCIE2_PIPE_CLK 32
#define GCC_PCIE3_PIPE_CLK_SRC 33
#define GCC_PCIE3_PIPE_CLK 34
#define GCC_PCIE_AUX_CLK_SRC 35
#define GCC_PCIE0_AUX_CLK 36
#define GCC_PCIE1_AUX_CLK 37
#define GCC_PCIE2_AUX_CLK 38
#define GCC_PCIE3_AUX_CLK 39
#define GCC_PCIE0_AHB_CLK 40
#define GCC_PCIE1_AHB_CLK 41
#define GCC_PCIE2_AHB_CLK 42
#define GCC_PCIE3_AHB_CLK 43
#define GCC_USB0_AUX_CLK_SRC 44
#define GCC_USB0_AUX_CLK 45
#define GCC_USB0_MASTER_CLK 46
#define GCC_USB0_MOCK_UTMI_CLK_SRC 47
#define GCC_USB0_MOCK_UTMI_DIV_CLK_SRC 48
#define GCC_USB0_MOCK_UTMI_CLK 49
#define GCC_USB0_PIPE_CLK_SRC 50
#define GCC_USB0_PIPE_CLK 51
#define GCC_USB0_PHY_CFG_AHB_CLK 52
#define GCC_USB0_SLEEP_CLK 53
#define GCC_SDCC1_APPS_CLK_SRC 54
#define GCC_SDCC1_APPS_CLK 55
#define GCC_SDCC1_ICE_CORE_CLK_SRC 56
#define GCC_SDCC1_ICE_CORE_CLK 57
#define GCC_SDCC1_AHB_CLK 58
#define GCC_PCNOC_BFDCD_CLK_SRC 59
#define GCC_NSSCFG_CLK 60
#define GCC_NSSNOC_NSSCC_CLK 61
#define GCC_NSSCC_CLK 62
#define GCC_NSSNOC_PCNOC_1_CLK 63
#define GCC_QPIC_AHB_CLK 64
#define GCC_QPIC_CLK 65
#define GCC_MDIO_AHB_CLK 66
#define GCC_PRNG_AHB_CLK 67
#define GCC_UNIPHY0_AHB_CLK 68
#define GCC_UNIPHY1_AHB_CLK 69
#define GCC_UNIPHY2_AHB_CLK 70
#define GCC_CMN_12GPLL_AHB_CLK 71
#define GCC_SYSTEM_NOC_BFDCD_CLK_SRC 72
#define GCC_NSSNOC_SNOC_CLK 73
#define GCC_NSSNOC_SNOC_1_CLK 74
#define GCC_WCSS_AHB_CLK_SRC 75
#define GCC_QDSS_AT_CLK_SRC 76
#define GCC_NSSNOC_ATB_CLK 77
#define GCC_QDSS_AT_CLK 78
#define GCC_QDSS_TSCTR_CLK_SRC 79
#define GCC_NSS_TS_CLK 80
#define GCC_QPIC_IO_MACRO_CLK_SRC 81
#define GCC_QPIC_IO_MACRO_CLK 82
#define GCC_LPASS_AXIM_CLK_SRC 83
#define GCC_LPASS_CORE_AXIM_CLK 84
#define GCC_LPASS_SWAY_CLK_SRC 85
#define GCC_LPASS_SWAY_CLK 86
#define GCC_CNOC_LPASS_CFG_CLK 87
#define GCC_SNOC_LPASS_CLK 88
#define GCC_ADSS_PWM_CLK_SRC 89
#define GCC_ADSS_PWM_CLK 90
#define GCC_XO_CLK_SRC 91
#define GCC_NSSNOC_XO_DCD_CLK 92
#define GCC_NSSNOC_QOSGEN_REF_CLK 93
#define GCC_NSSNOC_TIMEOUT_REF_CLK 94
#define GCC_UNIPHY0_SYS_CLK 95
#define GCC_UNIPHY1_SYS_CLK 96
#define GCC_UNIPHY2_SYS_CLK 97
#define GCC_CMN_12GPLL_SYS_CLK 98
#define GCC_UNIPHY_SYS_CLK_SRC 99
#define GCC_NSS_TS_CLK_SRC 100
#define GCC_ANOC_PCIE0_1LANE_M_CLK 101
#define GCC_ANOC_PCIE1_1LANE_M_CLK 102
#define GCC_ANOC_PCIE2_2LANE_M_CLK 103
#define GCC_ANOC_PCIE3_2LANE_M_CLK 104
#define GCC_CNOC_PCIE0_1LANE_S_CLK 105
#define GCC_CNOC_PCIE1_1LANE_S_CLK 106
#define GCC_CNOC_PCIE2_2LANE_S_CLK 107
#define GCC_CNOC_PCIE3_2LANE_S_CLK 108
#define GCC_CNOC_USB_CLK 109
#define GCC_CNOC_WCSS_AHB_CLK 110
#define GCC_QUPV3_AHB_MST_CLK 111
#define GCC_QUPV3_AHB_SLV_CLK 112
#define GCC_QUPV3_I2C0_CLK 113
#define GCC_QUPV3_I2C1_CLK 114
#define GCC_QUPV3_SPI0_CLK 115
#define GCC_QUPV3_SPI1_CLK 116
#define GCC_QUPV3_UART0_CLK 117
#define GCC_QUPV3_UART1_CLK 118
#define GCC_QPIC_CLK_SRC 119
#define GCC_QUPV3_I2C0_CLK_SRC 120
#define GCC_QUPV3_I2C1_CLK_SRC 121
#define GCC_QUPV3_I2C0_DIV_CLK_SRC 122
#define GCC_QUPV3_I2C1_DIV_CLK_SRC 123
#define GCC_QUPV3_SPI0_CLK_SRC 124
#define GCC_QUPV3_SPI1_CLK_SRC 125
#define GCC_QUPV3_UART0_CLK_SRC 126
#define GCC_QUPV3_UART1_CLK_SRC 127
#define GCC_USB1_MASTER_CLK 128
#define GCC_USB1_MOCK_UTMI_CLK_SRC 129
#define GCC_USB1_MOCK_UTMI_DIV_CLK_SRC 130
#define GCC_USB1_MOCK_UTMI_CLK 131
#define GCC_USB1_SLEEP_CLK 132
#define GCC_USB1_PHY_CFG_AHB_CLK 133
#define GCC_USB0_MASTER_CLK_SRC 134
#define GCC_QDSS_DAP_CLK 135
#define GCC_PCIE0_RCHNG_CLK_SRC 136
#define GCC_PCIE0_RCHNG_CLK 137
#define GCC_PCIE1_RCHNG_CLK_SRC 138
#define GCC_PCIE1_RCHNG_CLK 139
#define GCC_PCIE2_RCHNG_CLK_SRC 140
#define GCC_PCIE2_RCHNG_CLK 141
#define GCC_PCIE3_RCHNG_CLK_SRC 142
#define GCC_PCIE3_RCHNG_CLK 143
#define GCC_IM_SLEEP_CLK 144
#endif

View File

@ -132,16 +132,8 @@
#define GCC_NSSNOC_SNOC_1_CLK 123
#define GCC_QDSS_ETR_USB_CLK 124
#define WCSS_AHB_CLK_SRC 125
#define GCC_Q6_AHB_CLK 126
#define GCC_Q6_AHB_S_CLK 127
#define GCC_WCSS_ECAHB_CLK 128
#define GCC_WCSS_ACMT_CLK 129
#define GCC_SYS_NOC_WCSS_AHB_CLK 130
#define WCSS_AXI_M_CLK_SRC 131
#define GCC_ANOC_WCSS_AXI_M_CLK 132
#define QDSS_AT_CLK_SRC 133
#define GCC_Q6SS_ATBM_CLK 134
#define GCC_WCSS_DBG_IFC_ATB_CLK 135
#define GCC_NSSNOC_ATB_CLK 136
#define GCC_QDSS_AT_CLK 137
#define GCC_SYS_NOC_AT_CLK 138
@ -154,27 +146,18 @@
#define QDSS_TRACECLKIN_CLK_SRC 145
#define GCC_QDSS_TRACECLKIN_CLK 146
#define QDSS_TSCTR_CLK_SRC 147
#define GCC_Q6_TSCTR_1TO2_CLK 148
#define GCC_WCSS_DBG_IFC_NTS_CLK 149
#define GCC_QDSS_TSCTR_DIV2_CLK 150
#define GCC_QDSS_TS_CLK 151
#define GCC_QDSS_TSCTR_DIV4_CLK 152
#define GCC_NSS_TS_CLK 153
#define GCC_QDSS_TSCTR_DIV8_CLK 154
#define GCC_QDSS_TSCTR_DIV16_CLK 155
#define GCC_Q6SS_PCLKDBG_CLK 156
#define GCC_Q6SS_TRIG_CLK 157
#define GCC_WCSS_DBG_IFC_APB_CLK 158
#define GCC_WCSS_DBG_IFC_DAPBUS_CLK 159
#define GCC_QDSS_DAP_CLK 160
#define GCC_QDSS_APB2JTAG_CLK 161
#define GCC_QDSS_TSCTR_DIV3_CLK 162
#define QPIC_IO_MACRO_CLK_SRC 163
#define GCC_QPIC_IO_MACRO_CLK 164
#define Q6_AXI_CLK_SRC 165
#define GCC_Q6_AXIM_CLK 166
#define GCC_WCSS_Q6_TBU_CLK 167
#define GCC_MEM_NOC_Q6_AXI_CLK 168
#define Q6_AXIM2_CLK_SRC 169
#define NSSNOC_MEMNOC_BFDCD_CLK_SRC 170
#define GCC_NSSNOC_MEMNOC_CLK 171
@ -199,7 +182,6 @@
#define GCC_UNIPHY2_SYS_CLK 190
#define GCC_CMN_12GPLL_SYS_CLK 191
#define GCC_NSSNOC_XO_DCD_CLK 192
#define GCC_Q6SS_BOOT_CLK 193
#define UNIPHY_SYS_CLK_SRC 194
#define NSS_TS_CLK_SRC 195
#define GCC_ANOC_PCIE0_1LANE_M_CLK 196

View File

@ -0,0 +1,234 @@
/* 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_QCS8300_H
#define _DT_BINDINGS_CLK_QCOM_GCC_QCS8300_H
/* GCC clocks */
#define GCC_GPLL0 0
#define GCC_GPLL0_OUT_EVEN 1
#define GCC_GPLL1 2
#define GCC_GPLL4 3
#define GCC_GPLL7 4
#define GCC_GPLL9 5
#define GCC_AGGRE_NOC_QUPV3_AXI_CLK 6
#define GCC_AGGRE_UFS_PHY_AXI_CLK 7
#define GCC_AGGRE_USB2_PRIM_AXI_CLK 8
#define GCC_AGGRE_USB3_PRIM_AXI_CLK 9
#define GCC_AHB2PHY0_CLK 10
#define GCC_AHB2PHY2_CLK 11
#define GCC_AHB2PHY3_CLK 12
#define GCC_BOOT_ROM_AHB_CLK 13
#define GCC_CAMERA_AHB_CLK 14
#define GCC_CAMERA_HF_AXI_CLK 15
#define GCC_CAMERA_SF_AXI_CLK 16
#define GCC_CAMERA_THROTTLE_XO_CLK 17
#define GCC_CAMERA_XO_CLK 18
#define GCC_CFG_NOC_USB2_PRIM_AXI_CLK 19
#define GCC_CFG_NOC_USB3_PRIM_AXI_CLK 20
#define GCC_DDRSS_GPU_AXI_CLK 21
#define GCC_DISP_AHB_CLK 22
#define GCC_DISP_HF_AXI_CLK 23
#define GCC_DISP_XO_CLK 24
#define GCC_EDP_REF_CLKREF_EN 25
#define GCC_EMAC0_AXI_CLK 26
#define GCC_EMAC0_PHY_AUX_CLK 27
#define GCC_EMAC0_PHY_AUX_CLK_SRC 28
#define GCC_EMAC0_PTP_CLK 29
#define GCC_EMAC0_PTP_CLK_SRC 30
#define GCC_EMAC0_RGMII_CLK 31
#define GCC_EMAC0_RGMII_CLK_SRC 32
#define GCC_EMAC0_SLV_AHB_CLK 33
#define GCC_GP1_CLK 34
#define GCC_GP1_CLK_SRC 35
#define GCC_GP2_CLK 36
#define GCC_GP2_CLK_SRC 37
#define GCC_GP3_CLK 38
#define GCC_GP3_CLK_SRC 39
#define GCC_GP4_CLK 40
#define GCC_GP4_CLK_SRC 41
#define GCC_GP5_CLK 42
#define GCC_GP5_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_MEMNOC_GFX_CENTER_PIPELINE_CLK 47
#define GCC_GPU_MEMNOC_GFX_CLK 48
#define GCC_GPU_SNOC_DVM_GFX_CLK 49
#define GCC_GPU_TCU_THROTTLE_AHB_CLK 50
#define GCC_GPU_TCU_THROTTLE_CLK 51
#define GCC_PCIE_0_AUX_CLK 52
#define GCC_PCIE_0_AUX_CLK_SRC 53
#define GCC_PCIE_0_CFG_AHB_CLK 54
#define GCC_PCIE_0_MSTR_AXI_CLK 55
#define GCC_PCIE_0_PHY_AUX_CLK 56
#define GCC_PCIE_0_PHY_AUX_CLK_SRC 57
#define GCC_PCIE_0_PHY_RCHNG_CLK 58
#define GCC_PCIE_0_PHY_RCHNG_CLK_SRC 59
#define GCC_PCIE_0_PIPE_CLK 60
#define GCC_PCIE_0_PIPE_CLK_SRC 61
#define GCC_PCIE_0_PIPE_DIV_CLK_SRC 62
#define GCC_PCIE_0_PIPEDIV2_CLK 63
#define GCC_PCIE_0_SLV_AXI_CLK 64
#define GCC_PCIE_0_SLV_Q2A_AXI_CLK 65
#define GCC_PCIE_1_AUX_CLK 66
#define GCC_PCIE_1_AUX_CLK_SRC 67
#define GCC_PCIE_1_CFG_AHB_CLK 68
#define GCC_PCIE_1_MSTR_AXI_CLK 69
#define GCC_PCIE_1_PHY_AUX_CLK 70
#define GCC_PCIE_1_PHY_AUX_CLK_SRC 71
#define GCC_PCIE_1_PHY_RCHNG_CLK 72
#define GCC_PCIE_1_PHY_RCHNG_CLK_SRC 73
#define GCC_PCIE_1_PIPE_CLK 74
#define GCC_PCIE_1_PIPE_CLK_SRC 75
#define GCC_PCIE_1_PIPE_DIV_CLK_SRC 76
#define GCC_PCIE_1_PIPEDIV2_CLK 77
#define GCC_PCIE_1_SLV_AXI_CLK 78
#define GCC_PCIE_1_SLV_Q2A_AXI_CLK 79
#define GCC_PCIE_CLKREF_EN 80
#define GCC_PCIE_THROTTLE_CFG_CLK 81
#define GCC_PDM2_CLK 82
#define GCC_PDM2_CLK_SRC 83
#define GCC_PDM_AHB_CLK 84
#define GCC_PDM_XO4_CLK 85
#define GCC_QMIP_CAMERA_NRT_AHB_CLK 86
#define GCC_QMIP_CAMERA_RT_AHB_CLK 87
#define GCC_QMIP_DISP_AHB_CLK 88
#define GCC_QMIP_DISP_ROT_AHB_CLK 89
#define GCC_QMIP_VIDEO_CVP_AHB_CLK 90
#define GCC_QMIP_VIDEO_VCODEC_AHB_CLK 91
#define GCC_QMIP_VIDEO_VCPU_AHB_CLK 92
#define GCC_QUPV3_WRAP0_CORE_2X_CLK 93
#define GCC_QUPV3_WRAP0_CORE_CLK 94
#define GCC_QUPV3_WRAP0_S0_CLK 95
#define GCC_QUPV3_WRAP0_S0_CLK_SRC 96
#define GCC_QUPV3_WRAP0_S1_CLK 97
#define GCC_QUPV3_WRAP0_S1_CLK_SRC 98
#define GCC_QUPV3_WRAP0_S2_CLK 99
#define GCC_QUPV3_WRAP0_S2_CLK_SRC 100
#define GCC_QUPV3_WRAP0_S3_CLK 101
#define GCC_QUPV3_WRAP0_S3_CLK_SRC 102
#define GCC_QUPV3_WRAP0_S4_CLK 103
#define GCC_QUPV3_WRAP0_S4_CLK_SRC 104
#define GCC_QUPV3_WRAP0_S5_CLK 105
#define GCC_QUPV3_WRAP0_S5_CLK_SRC 106
#define GCC_QUPV3_WRAP0_S6_CLK 107
#define GCC_QUPV3_WRAP0_S6_CLK_SRC 108
#define GCC_QUPV3_WRAP0_S7_CLK 109
#define GCC_QUPV3_WRAP0_S7_CLK_SRC 110
#define GCC_QUPV3_WRAP1_CORE_2X_CLK 111
#define GCC_QUPV3_WRAP1_CORE_CLK 112
#define GCC_QUPV3_WRAP1_S0_CLK 113
#define GCC_QUPV3_WRAP1_S0_CLK_SRC 114
#define GCC_QUPV3_WRAP1_S1_CLK 115
#define GCC_QUPV3_WRAP1_S1_CLK_SRC 116
#define GCC_QUPV3_WRAP1_S2_CLK 117
#define GCC_QUPV3_WRAP1_S2_CLK_SRC 118
#define GCC_QUPV3_WRAP1_S3_CLK 119
#define GCC_QUPV3_WRAP1_S3_CLK_SRC 120
#define GCC_QUPV3_WRAP1_S4_CLK 121
#define GCC_QUPV3_WRAP1_S4_CLK_SRC 122
#define GCC_QUPV3_WRAP1_S5_CLK 123
#define GCC_QUPV3_WRAP1_S5_CLK_SRC 124
#define GCC_QUPV3_WRAP1_S6_CLK 125
#define GCC_QUPV3_WRAP1_S6_CLK_SRC 126
#define GCC_QUPV3_WRAP1_S7_CLK 127
#define GCC_QUPV3_WRAP1_S7_CLK_SRC 128
#define GCC_QUPV3_WRAP3_CORE_2X_CLK 129
#define GCC_QUPV3_WRAP3_CORE_CLK 130
#define GCC_QUPV3_WRAP3_QSPI_CLK 131
#define GCC_QUPV3_WRAP3_S0_CLK 132
#define GCC_QUPV3_WRAP3_S0_CLK_SRC 133
#define GCC_QUPV3_WRAP3_S0_DIV_CLK_SRC 134
#define GCC_QUPV3_WRAP_0_M_AHB_CLK 135
#define GCC_QUPV3_WRAP_0_S_AHB_CLK 136
#define GCC_QUPV3_WRAP_1_M_AHB_CLK 137
#define GCC_QUPV3_WRAP_1_S_AHB_CLK 138
#define GCC_QUPV3_WRAP_3_M_AHB_CLK 139
#define GCC_QUPV3_WRAP_3_S_AHB_CLK 140
#define GCC_SDCC1_AHB_CLK 141
#define GCC_SDCC1_APPS_CLK 142
#define GCC_SDCC1_APPS_CLK_SRC 143
#define GCC_SDCC1_ICE_CORE_CLK 144
#define GCC_SDCC1_ICE_CORE_CLK_SRC 145
#define GCC_SGMI_CLKREF_EN 146
#define GCC_UFS_PHY_AHB_CLK 147
#define GCC_UFS_PHY_AXI_CLK 148
#define GCC_UFS_PHY_AXI_CLK_SRC 149
#define GCC_UFS_PHY_ICE_CORE_CLK 150
#define GCC_UFS_PHY_ICE_CORE_CLK_SRC 151
#define GCC_UFS_PHY_PHY_AUX_CLK 152
#define GCC_UFS_PHY_PHY_AUX_CLK_SRC 153
#define GCC_UFS_PHY_RX_SYMBOL_0_CLK 154
#define GCC_UFS_PHY_RX_SYMBOL_0_CLK_SRC 155
#define GCC_UFS_PHY_RX_SYMBOL_1_CLK 156
#define GCC_UFS_PHY_RX_SYMBOL_1_CLK_SRC 157
#define GCC_UFS_PHY_TX_SYMBOL_0_CLK 158
#define GCC_UFS_PHY_TX_SYMBOL_0_CLK_SRC 159
#define GCC_UFS_PHY_UNIPRO_CORE_CLK 160
#define GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC 161
#define GCC_USB20_MASTER_CLK 162
#define GCC_USB20_MASTER_CLK_SRC 163
#define GCC_USB20_MOCK_UTMI_CLK 164
#define GCC_USB20_MOCK_UTMI_CLK_SRC 165
#define GCC_USB20_MOCK_UTMI_POSTDIV_CLK_SRC 166
#define GCC_USB20_SLEEP_CLK 167
#define GCC_USB30_PRIM_MASTER_CLK 168
#define GCC_USB30_PRIM_MASTER_CLK_SRC 169
#define GCC_USB30_PRIM_MOCK_UTMI_CLK 170
#define GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC 171
#define GCC_USB30_PRIM_MOCK_UTMI_POSTDIV_CLK_SRC 172
#define GCC_USB30_PRIM_SLEEP_CLK 173
#define GCC_USB3_PRIM_PHY_AUX_CLK 174
#define GCC_USB3_PRIM_PHY_AUX_CLK_SRC 175
#define GCC_USB3_PRIM_PHY_COM_AUX_CLK 176
#define GCC_USB3_PRIM_PHY_PIPE_CLK 177
#define GCC_USB3_PRIM_PHY_PIPE_CLK_SRC 178
#define GCC_USB_CLKREF_EN 179
#define GCC_VIDEO_AHB_CLK 180
#define GCC_VIDEO_AXI0_CLK 181
#define GCC_VIDEO_AXI1_CLK 182
#define GCC_VIDEO_XO_CLK 183
/* GCC power domains */
#define GCC_EMAC0_GDSC 0
#define GCC_PCIE_0_GDSC 1
#define GCC_PCIE_1_GDSC 2
#define GCC_UFS_PHY_GDSC 3
#define GCC_USB20_PRIM_GDSC 4
#define GCC_USB30_PRIM_GDSC 5
/* GCC resets */
#define GCC_EMAC0_BCR 0
#define GCC_PCIE_0_BCR 1
#define GCC_PCIE_0_LINK_DOWN_BCR 2
#define GCC_PCIE_0_NOCSR_COM_PHY_BCR 3
#define GCC_PCIE_0_PHY_BCR 4
#define GCC_PCIE_0_PHY_NOCSR_COM_PHY_BCR 5
#define GCC_PCIE_1_BCR 6
#define GCC_PCIE_1_LINK_DOWN_BCR 7
#define GCC_PCIE_1_NOCSR_COM_PHY_BCR 8
#define GCC_PCIE_1_PHY_BCR 9
#define GCC_PCIE_1_PHY_NOCSR_COM_PHY_BCR 10
#define GCC_SDCC1_BCR 11
#define GCC_UFS_PHY_BCR 12
#define GCC_USB20_PRIM_BCR 13
#define GCC_USB2_PHY_PRIM_BCR 14
#define GCC_USB2_PHY_SEC_BCR 15
#define GCC_USB30_PRIM_BCR 16
#define GCC_USB3_DP_PHY_PRIM_BCR 17
#define GCC_USB3_PHY_PRIM_BCR 18
#define GCC_USB3_PHY_TERT_BCR 19
#define GCC_USB3_UNIPHY_MP0_BCR 20
#define GCC_USB3_UNIPHY_MP1_BCR 21
#define GCC_USB3PHY_PHY_PRIM_BCR 22
#define GCC_USB3UNIPHY_PHY_MP0_BCR 23
#define GCC_USB3UNIPHY_PHY_MP1_BCR 24
#define GCC_USB_PHY_CFG_AHB2PHY_BCR 25
#define GCC_VIDEO_BCR 26
#define GCC_VIDEO_AXI0_CLK_ARES 27
#define GCC_VIDEO_AXI1_CLK_ARES 28
#endif

View File

@ -0,0 +1,108 @@
/* 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_SA8775P_CAM_CC_H
#define _DT_BINDINGS_CLK_QCOM_SA8775P_CAM_CC_H
/* CAM_CC clocks */
#define CAM_CC_CAMNOC_AXI_CLK 0
#define CAM_CC_CAMNOC_AXI_CLK_SRC 1
#define CAM_CC_CAMNOC_DCD_XO_CLK 2
#define CAM_CC_CAMNOC_XO_CLK 3
#define CAM_CC_CCI_0_CLK 4
#define CAM_CC_CCI_0_CLK_SRC 5
#define CAM_CC_CCI_1_CLK 6
#define CAM_CC_CCI_1_CLK_SRC 7
#define CAM_CC_CCI_2_CLK 8
#define CAM_CC_CCI_2_CLK_SRC 9
#define CAM_CC_CCI_3_CLK 10
#define CAM_CC_CCI_3_CLK_SRC 11
#define CAM_CC_CORE_AHB_CLK 12
#define CAM_CC_CPAS_AHB_CLK 13
#define CAM_CC_CPAS_FAST_AHB_CLK 14
#define CAM_CC_CPAS_IFE_0_CLK 15
#define CAM_CC_CPAS_IFE_1_CLK 16
#define CAM_CC_CPAS_IFE_LITE_CLK 17
#define CAM_CC_CPAS_IPE_CLK 18
#define CAM_CC_CPAS_SFE_LITE_0_CLK 19
#define CAM_CC_CPAS_SFE_LITE_1_CLK 20
#define CAM_CC_CPHY_RX_CLK_SRC 21
#define CAM_CC_CSI0PHYTIMER_CLK 22
#define CAM_CC_CSI0PHYTIMER_CLK_SRC 23
#define CAM_CC_CSI1PHYTIMER_CLK 24
#define CAM_CC_CSI1PHYTIMER_CLK_SRC 25
#define CAM_CC_CSI2PHYTIMER_CLK 26
#define CAM_CC_CSI2PHYTIMER_CLK_SRC 27
#define CAM_CC_CSI3PHYTIMER_CLK 28
#define CAM_CC_CSI3PHYTIMER_CLK_SRC 29
#define CAM_CC_CSID_CLK 30
#define CAM_CC_CSID_CLK_SRC 31
#define CAM_CC_CSID_CSIPHY_RX_CLK 32
#define CAM_CC_CSIPHY0_CLK 33
#define CAM_CC_CSIPHY1_CLK 34
#define CAM_CC_CSIPHY2_CLK 35
#define CAM_CC_CSIPHY3_CLK 36
#define CAM_CC_FAST_AHB_CLK_SRC 37
#define CAM_CC_GDSC_CLK 38
#define CAM_CC_ICP_AHB_CLK 39
#define CAM_CC_ICP_CLK 40
#define CAM_CC_ICP_CLK_SRC 41
#define CAM_CC_IFE_0_CLK 42
#define CAM_CC_IFE_0_CLK_SRC 43
#define CAM_CC_IFE_0_FAST_AHB_CLK 44
#define CAM_CC_IFE_1_CLK 45
#define CAM_CC_IFE_1_CLK_SRC 46
#define CAM_CC_IFE_1_FAST_AHB_CLK 47
#define CAM_CC_IFE_LITE_AHB_CLK 48
#define CAM_CC_IFE_LITE_CLK 49
#define CAM_CC_IFE_LITE_CLK_SRC 50
#define CAM_CC_IFE_LITE_CPHY_RX_CLK 51
#define CAM_CC_IFE_LITE_CSID_CLK 52
#define CAM_CC_IFE_LITE_CSID_CLK_SRC 53
#define CAM_CC_IPE_AHB_CLK 54
#define CAM_CC_IPE_CLK 55
#define CAM_CC_IPE_CLK_SRC 56
#define CAM_CC_IPE_FAST_AHB_CLK 57
#define CAM_CC_MCLK0_CLK 58
#define CAM_CC_MCLK0_CLK_SRC 59
#define CAM_CC_MCLK1_CLK 60
#define CAM_CC_MCLK1_CLK_SRC 61
#define CAM_CC_MCLK2_CLK 62
#define CAM_CC_MCLK2_CLK_SRC 63
#define CAM_CC_MCLK3_CLK 64
#define CAM_CC_MCLK3_CLK_SRC 65
#define CAM_CC_PLL0 66
#define CAM_CC_PLL0_OUT_EVEN 67
#define CAM_CC_PLL0_OUT_ODD 68
#define CAM_CC_PLL2 69
#define CAM_CC_PLL3 70
#define CAM_CC_PLL3_OUT_EVEN 71
#define CAM_CC_PLL4 72
#define CAM_CC_PLL4_OUT_EVEN 73
#define CAM_CC_PLL5 74
#define CAM_CC_PLL5_OUT_EVEN 75
#define CAM_CC_SFE_LITE_0_CLK 76
#define CAM_CC_SFE_LITE_0_FAST_AHB_CLK 77
#define CAM_CC_SFE_LITE_1_CLK 78
#define CAM_CC_SFE_LITE_1_FAST_AHB_CLK 79
#define CAM_CC_SLEEP_CLK 80
#define CAM_CC_SLEEP_CLK_SRC 81
#define CAM_CC_SLOW_AHB_CLK_SRC 82
#define CAM_CC_SM_OBS_CLK 83
#define CAM_CC_XO_CLK_SRC 84
#define CAM_CC_QDSS_DEBUG_XO_CLK 85
/* CAM_CC power domains */
#define CAM_CC_TITAN_TOP_GDSC 0
/* CAM_CC resets */
#define CAM_CC_ICP_BCR 0
#define CAM_CC_IFE_0_BCR 1
#define CAM_CC_IFE_1_BCR 2
#define CAM_CC_IPE_0_BCR 3
#define CAM_CC_SFE_LITE_0_BCR 4
#define CAM_CC_SFE_LITE_1_BCR 5
#endif

View File

@ -0,0 +1,87 @@
/* 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_SA8775P_DISP_CC_H
#define _DT_BINDINGS_CLK_QCOM_SA8775P_DISP_CC_H
/* DISP_CC_0/1 clocks */
#define MDSS_DISP_CC_MDSS_AHB1_CLK 0
#define MDSS_DISP_CC_MDSS_AHB_CLK 1
#define MDSS_DISP_CC_MDSS_AHB_CLK_SRC 2
#define MDSS_DISP_CC_MDSS_BYTE0_CLK 3
#define MDSS_DISP_CC_MDSS_BYTE0_CLK_SRC 4
#define MDSS_DISP_CC_MDSS_BYTE0_DIV_CLK_SRC 5
#define MDSS_DISP_CC_MDSS_BYTE0_INTF_CLK 6
#define MDSS_DISP_CC_MDSS_BYTE1_CLK 7
#define MDSS_DISP_CC_MDSS_BYTE1_CLK_SRC 8
#define MDSS_DISP_CC_MDSS_BYTE1_DIV_CLK_SRC 9
#define MDSS_DISP_CC_MDSS_BYTE1_INTF_CLK 10
#define MDSS_DISP_CC_MDSS_DPTX0_AUX_CLK 11
#define MDSS_DISP_CC_MDSS_DPTX0_AUX_CLK_SRC 12
#define MDSS_DISP_CC_MDSS_DPTX0_CRYPTO_CLK 13
#define MDSS_DISP_CC_MDSS_DPTX0_CRYPTO_CLK_SRC 14
#define MDSS_DISP_CC_MDSS_DPTX0_LINK_CLK 15
#define MDSS_DISP_CC_MDSS_DPTX0_LINK_CLK_SRC 16
#define MDSS_DISP_CC_MDSS_DPTX0_LINK_DIV_CLK_SRC 17
#define MDSS_DISP_CC_MDSS_DPTX0_LINK_INTF_CLK 18
#define MDSS_DISP_CC_MDSS_DPTX0_PIXEL0_CLK 19
#define MDSS_DISP_CC_MDSS_DPTX0_PIXEL0_CLK_SRC 20
#define MDSS_DISP_CC_MDSS_DPTX0_PIXEL1_CLK 21
#define MDSS_DISP_CC_MDSS_DPTX0_PIXEL1_CLK_SRC 22
#define MDSS_DISP_CC_MDSS_DPTX0_PIXEL2_CLK 23
#define MDSS_DISP_CC_MDSS_DPTX0_PIXEL2_CLK_SRC 24
#define MDSS_DISP_CC_MDSS_DPTX0_PIXEL3_CLK 25
#define MDSS_DISP_CC_MDSS_DPTX0_PIXEL3_CLK_SRC 26
#define MDSS_DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK 27
#define MDSS_DISP_CC_MDSS_DPTX1_AUX_CLK 28
#define MDSS_DISP_CC_MDSS_DPTX1_AUX_CLK_SRC 29
#define MDSS_DISP_CC_MDSS_DPTX1_CRYPTO_CLK 30
#define MDSS_DISP_CC_MDSS_DPTX1_CRYPTO_CLK_SRC 31
#define MDSS_DISP_CC_MDSS_DPTX1_LINK_CLK 32
#define MDSS_DISP_CC_MDSS_DPTX1_LINK_CLK_SRC 33
#define MDSS_DISP_CC_MDSS_DPTX1_LINK_DIV_CLK_SRC 34
#define MDSS_DISP_CC_MDSS_DPTX1_LINK_INTF_CLK 35
#define MDSS_DISP_CC_MDSS_DPTX1_PIXEL0_CLK 36
#define MDSS_DISP_CC_MDSS_DPTX1_PIXEL0_CLK_SRC 37
#define MDSS_DISP_CC_MDSS_DPTX1_PIXEL1_CLK 38
#define MDSS_DISP_CC_MDSS_DPTX1_PIXEL1_CLK_SRC 39
#define MDSS_DISP_CC_MDSS_DPTX1_USB_ROUTER_LINK_INTF_CLK 40
#define MDSS_DISP_CC_MDSS_ESC0_CLK 41
#define MDSS_DISP_CC_MDSS_ESC0_CLK_SRC 42
#define MDSS_DISP_CC_MDSS_ESC1_CLK 43
#define MDSS_DISP_CC_MDSS_ESC1_CLK_SRC 44
#define MDSS_DISP_CC_MDSS_MDP1_CLK 45
#define MDSS_DISP_CC_MDSS_MDP_CLK 46
#define MDSS_DISP_CC_MDSS_MDP_CLK_SRC 47
#define MDSS_DISP_CC_MDSS_MDP_LUT1_CLK 48
#define MDSS_DISP_CC_MDSS_MDP_LUT_CLK 49
#define MDSS_DISP_CC_MDSS_NON_GDSC_AHB_CLK 50
#define MDSS_DISP_CC_MDSS_PCLK0_CLK 51
#define MDSS_DISP_CC_MDSS_PCLK0_CLK_SRC 52
#define MDSS_DISP_CC_MDSS_PCLK1_CLK 53
#define MDSS_DISP_CC_MDSS_PCLK1_CLK_SRC 54
#define MDSS_DISP_CC_MDSS_PLL_LOCK_MONITOR_CLK 55
#define MDSS_DISP_CC_MDSS_RSCC_AHB_CLK 56
#define MDSS_DISP_CC_MDSS_RSCC_VSYNC_CLK 57
#define MDSS_DISP_CC_MDSS_VSYNC1_CLK 58
#define MDSS_DISP_CC_MDSS_VSYNC_CLK 59
#define MDSS_DISP_CC_MDSS_VSYNC_CLK_SRC 60
#define MDSS_DISP_CC_PLL0 61
#define MDSS_DISP_CC_PLL1 62
#define MDSS_DISP_CC_SLEEP_CLK 63
#define MDSS_DISP_CC_SLEEP_CLK_SRC 64
#define MDSS_DISP_CC_SM_OBS_CLK 65
#define MDSS_DISP_CC_XO_CLK 66
#define MDSS_DISP_CC_XO_CLK_SRC 67
/* DISP_CC_0/1 power domains */
#define MDSS_DISP_CC_MDSS_CORE_GDSC 0
#define MDSS_DISP_CC_MDSS_CORE_INT2_GDSC 1
/* DISP_CC_0/1 resets */
#define MDSS_DISP_CC_MDSS_CORE_BCR 0
#define MDSS_DISP_CC_MDSS_RSCC_BCR 1
#endif

View File

@ -0,0 +1,47 @@
/* 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_SA8775P_VIDEO_CC_H
#define _DT_BINDINGS_CLK_QCOM_SA8775P_VIDEO_CC_H
/* VIDEO_CC clocks */
#define VIDEO_CC_AHB_CLK 0
#define VIDEO_CC_AHB_CLK_SRC 1
#define VIDEO_CC_MVS0_CLK 2
#define VIDEO_CC_MVS0_CLK_SRC 3
#define VIDEO_CC_MVS0_DIV_CLK_SRC 4
#define VIDEO_CC_MVS0C_CLK 5
#define VIDEO_CC_MVS0C_DIV2_DIV_CLK_SRC 6
#define VIDEO_CC_MVS1_CLK 7
#define VIDEO_CC_MVS1_CLK_SRC 8
#define VIDEO_CC_MVS1_DIV_CLK_SRC 9
#define VIDEO_CC_MVS1C_CLK 10
#define VIDEO_CC_MVS1C_DIV2_DIV_CLK_SRC 11
#define VIDEO_CC_PLL_LOCK_MONITOR_CLK 12
#define VIDEO_CC_SLEEP_CLK 13
#define VIDEO_CC_SLEEP_CLK_SRC 14
#define VIDEO_CC_SM_DIV_CLK_SRC 15
#define VIDEO_CC_SM_OBS_CLK 16
#define VIDEO_CC_XO_CLK 17
#define VIDEO_CC_XO_CLK_SRC 18
#define VIDEO_PLL0 19
#define VIDEO_PLL1 20
/* VIDEO_CC power domains */
#define VIDEO_CC_MVS0C_GDSC 0
#define VIDEO_CC_MVS0_GDSC 1
#define VIDEO_CC_MVS1C_GDSC 2
#define VIDEO_CC_MVS1_GDSC 3
/* VIDEO_CC resets */
#define VIDEO_CC_INTERFACE_BCR 0
#define VIDEO_CC_MVS0_BCR 1
#define VIDEO_CC_MVS0C_CLK_ARES 2
#define VIDEO_CC_MVS0C_BCR 3
#define VIDEO_CC_MVS1_BCR 4
#define VIDEO_CC_MVS1C_CLK_ARES 5
#define VIDEO_CC_MVS1C_BCR 6
#endif

View File

@ -0,0 +1,185 @@
/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
/*
* Copyright (c) 2021-2022, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _DT_BINDINGS_CLK_QCOM_GCC_SAR2130P_H
#define _DT_BINDINGS_CLK_QCOM_GCC_SAR2130P_H
/* GCC clocks */
#define GCC_GPLL0 0
#define GCC_GPLL0_OUT_EVEN 1
#define GCC_GPLL1 2
#define GCC_GPLL9 3
#define GCC_GPLL9_OUT_EVEN 4
#define GCC_AGGRE_NOC_PCIE_1_AXI_CLK 5
#define GCC_AGGRE_USB3_PRIM_AXI_CLK 6
#define GCC_BOOT_ROM_AHB_CLK 7
#define GCC_CAMERA_AHB_CLK 8
#define GCC_CAMERA_HF_AXI_CLK 9
#define GCC_CAMERA_SF_AXI_CLK 10
#define GCC_CAMERA_XO_CLK 11
#define GCC_CFG_NOC_PCIE_ANOC_AHB_CLK 12
#define GCC_CFG_NOC_USB3_PRIM_AXI_CLK 13
#define GCC_DDRSS_GPU_AXI_CLK 14
#define GCC_DDRSS_PCIE_SF_CLK 15
#define GCC_DISP_AHB_CLK 16
#define GCC_DISP_HF_AXI_CLK 17
#define GCC_GP1_CLK 18
#define GCC_GP1_CLK_SRC 19
#define GCC_GP2_CLK 20
#define GCC_GP2_CLK_SRC 21
#define GCC_GP3_CLK 22
#define GCC_GP3_CLK_SRC 23
#define GCC_GPU_CFG_AHB_CLK 24
#define GCC_GPU_GPLL0_CLK_SRC 25
#define GCC_GPU_GPLL0_DIV_CLK_SRC 26
#define GCC_GPU_MEMNOC_GFX_CLK 27
#define GCC_GPU_SNOC_DVM_GFX_CLK 28
#define GCC_IRIS_SS_HF_AXI1_CLK 29
#define GCC_IRIS_SS_SPD_AXI1_CLK 30
#define GCC_PCIE_0_AUX_CLK 31
#define GCC_PCIE_0_AUX_CLK_SRC 32
#define GCC_PCIE_0_CFG_AHB_CLK 33
#define GCC_PCIE_0_MSTR_AXI_CLK 34
#define GCC_PCIE_0_PHY_RCHNG_CLK 35
#define GCC_PCIE_0_PHY_RCHNG_CLK_SRC 36
#define GCC_PCIE_0_PIPE_CLK 37
#define GCC_PCIE_0_PIPE_CLK_SRC 38
#define GCC_PCIE_0_SLV_AXI_CLK 39
#define GCC_PCIE_0_SLV_Q2A_AXI_CLK 40
#define GCC_PCIE_1_AUX_CLK 41
#define GCC_PCIE_1_AUX_CLK_SRC 42
#define GCC_PCIE_1_CFG_AHB_CLK 43
#define GCC_PCIE_1_MSTR_AXI_CLK 44
#define GCC_PCIE_1_PHY_RCHNG_CLK 45
#define GCC_PCIE_1_PHY_RCHNG_CLK_SRC 46
#define GCC_PCIE_1_PIPE_CLK 47
#define GCC_PCIE_1_PIPE_CLK_SRC 48
#define GCC_PCIE_1_SLV_AXI_CLK 49
#define GCC_PCIE_1_SLV_Q2A_AXI_CLK 50
#define GCC_PDM2_CLK 51
#define GCC_PDM2_CLK_SRC 52
#define GCC_PDM_AHB_CLK 53
#define GCC_PDM_XO4_CLK 54
#define GCC_QMIP_CAMERA_NRT_AHB_CLK 55
#define GCC_QMIP_CAMERA_RT_AHB_CLK 56
#define GCC_QMIP_GPU_AHB_CLK 57
#define GCC_QMIP_PCIE_AHB_CLK 58
#define GCC_QMIP_VIDEO_CV_CPU_AHB_CLK 59
#define GCC_QMIP_VIDEO_CVP_AHB_CLK 60
#define GCC_QMIP_VIDEO_LSR_AHB_CLK 61
#define GCC_QMIP_VIDEO_V_CPU_AHB_CLK 62
#define GCC_QMIP_VIDEO_VCODEC_AHB_CLK 63
#define GCC_QUPV3_WRAP0_CORE_2X_CLK 64
#define GCC_QUPV3_WRAP0_CORE_CLK 65
#define GCC_QUPV3_WRAP0_S0_CLK 66
#define GCC_QUPV3_WRAP0_S0_CLK_SRC 67
#define GCC_QUPV3_WRAP0_S1_CLK 68
#define GCC_QUPV3_WRAP0_S1_CLK_SRC 69
#define GCC_QUPV3_WRAP0_S2_CLK 70
#define GCC_QUPV3_WRAP0_S2_CLK_SRC 71
#define GCC_QUPV3_WRAP0_S3_CLK 72
#define GCC_QUPV3_WRAP0_S3_CLK_SRC 73
#define GCC_QUPV3_WRAP0_S4_CLK 74
#define GCC_QUPV3_WRAP0_S4_CLK_SRC 75
#define GCC_QUPV3_WRAP0_S5_CLK 76
#define GCC_QUPV3_WRAP0_S5_CLK_SRC 77
#define GCC_QUPV3_WRAP1_CORE_2X_CLK 78
#define GCC_QUPV3_WRAP1_CORE_CLK 79
#define GCC_QUPV3_WRAP1_S0_CLK 80
#define GCC_QUPV3_WRAP1_S0_CLK_SRC 81
#define GCC_QUPV3_WRAP1_S1_CLK 82
#define GCC_QUPV3_WRAP1_S1_CLK_SRC 83
#define GCC_QUPV3_WRAP1_S2_CLK 84
#define GCC_QUPV3_WRAP1_S2_CLK_SRC 85
#define GCC_QUPV3_WRAP1_S3_CLK 86
#define GCC_QUPV3_WRAP1_S3_CLK_SRC 87
#define GCC_QUPV3_WRAP1_S4_CLK 88
#define GCC_QUPV3_WRAP1_S4_CLK_SRC 89
#define GCC_QUPV3_WRAP1_S5_CLK 90
#define GCC_QUPV3_WRAP1_S5_CLK_SRC 91
#define GCC_QUPV3_WRAP_0_M_AHB_CLK 92
#define GCC_QUPV3_WRAP_0_S_AHB_CLK 93
#define GCC_QUPV3_WRAP_1_M_AHB_CLK 94
#define GCC_QUPV3_WRAP_1_S_AHB_CLK 95
#define GCC_SDCC1_AHB_CLK 96
#define GCC_SDCC1_APPS_CLK 97
#define GCC_SDCC1_APPS_CLK_SRC 98
#define GCC_SDCC1_ICE_CORE_CLK 99
#define GCC_SDCC1_ICE_CORE_CLK_SRC 100
#define GCC_USB30_PRIM_MASTER_CLK 101
#define GCC_USB30_PRIM_MASTER_CLK_SRC 102
#define GCC_USB30_PRIM_MOCK_UTMI_CLK 103
#define GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC 104
#define GCC_USB30_PRIM_MOCK_UTMI_POSTDIV_CLK_SRC 105
#define GCC_USB30_PRIM_SLEEP_CLK 106
#define GCC_USB3_PRIM_PHY_AUX_CLK 107
#define GCC_USB3_PRIM_PHY_AUX_CLK_SRC 108
#define GCC_USB3_PRIM_PHY_COM_AUX_CLK 109
#define GCC_USB3_PRIM_PHY_PIPE_CLK 110
#define GCC_USB3_PRIM_PHY_PIPE_CLK_SRC 111
#define GCC_VIDEO_AHB_CLK 112
#define GCC_VIDEO_AXI0_CLK 113
#define GCC_VIDEO_AXI1_CLK 114
#define GCC_VIDEO_XO_CLK 115
#define GCC_GPLL4 116
#define GCC_GPLL5 117
#define GCC_GPLL7 118
#define GCC_DDRSS_SPAD_CLK 119
#define GCC_DDRSS_SPAD_CLK_SRC 120
#define GCC_VIDEO_AXI0_SREG 121
#define GCC_VIDEO_AXI1_SREG 122
#define GCC_IRIS_SS_HF_AXI1_SREG 123
#define GCC_IRIS_SS_SPD_AXI1_SREG 124
/* GCC resets */
#define GCC_CAMERA_BCR 0
#define GCC_DISPLAY_BCR 1
#define GCC_GPU_BCR 2
#define GCC_PCIE_0_BCR 3
#define GCC_PCIE_0_LINK_DOWN_BCR 4
#define GCC_PCIE_0_NOCSR_COM_PHY_BCR 5
#define GCC_PCIE_0_PHY_BCR 6
#define GCC_PCIE_0_PHY_NOCSR_COM_PHY_BCR 7
#define GCC_PCIE_1_BCR 8
#define GCC_PCIE_1_LINK_DOWN_BCR 9
#define GCC_PCIE_1_NOCSR_COM_PHY_BCR 10
#define GCC_PCIE_1_PHY_BCR 11
#define GCC_PCIE_1_PHY_NOCSR_COM_PHY_BCR 12
#define GCC_PCIE_PHY_BCR 13
#define GCC_PCIE_PHY_CFG_AHB_BCR 14
#define GCC_PCIE_PHY_COM_BCR 15
#define GCC_PDM_BCR 16
#define GCC_QUPV3_WRAPPER_0_BCR 17
#define GCC_QUPV3_WRAPPER_1_BCR 18
#define GCC_QUSB2PHY_PRIM_BCR 19
#define GCC_QUSB2PHY_SEC_BCR 20
#define GCC_SDCC1_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_IRIS_SS_HF_AXI_CLK_ARES 32
#define GCC_IRIS_SS_SPD_AXI_CLK_ARES 33
#define GCC_DDRSS_SPAD_CLK_ARES 34
/* GCC power domains */
#define PCIE_0_GDSC 0
#define PCIE_0_PHY_GDSC 1
#define PCIE_1_GDSC 2
#define PCIE_1_PHY_GDSC 3
#define USB30_PRIM_GDSC 4
#define USB3_PHY_GDSC 5
#define HLOS1_VOTE_MM_SNOC_MMU_TBU_HF0_GDSC 6
#define HLOS1_VOTE_MM_SNOC_MMU_TBU_SF0_GDSC 7
#define HLOS1_VOTE_TURING_MMU_TBU0_GDSC 8
#define HLOS1_VOTE_TURING_MMU_TBU1_GDSC 9
#endif

View File

@ -0,0 +1,33 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved
* Copyright (c) 2024, Linaro Limited
*/
#ifndef _DT_BINDINGS_CLK_QCOM_GPU_CC_SAR2130P_H
#define _DT_BINDINGS_CLK_QCOM_GPU_CC_SAR2130P_H
/* GPU_CC clocks */
#define GPU_CC_AHB_CLK 0
#define GPU_CC_CRC_AHB_CLK 1
#define GPU_CC_CX_FF_CLK 2
#define GPU_CC_CX_GMU_CLK 3
#define GPU_CC_CXO_AON_CLK 4
#define GPU_CC_CXO_CLK 5
#define GPU_CC_FF_CLK_SRC 6
#define GPU_CC_GMU_CLK_SRC 7
#define GPU_CC_GX_GMU_CLK 8
#define GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK 9
#define GPU_CC_HUB_AON_CLK 10
#define GPU_CC_HUB_CLK_SRC 11
#define GPU_CC_HUB_CX_INT_CLK 12
#define GPU_CC_MEMNOC_GFX_CLK 13
#define GPU_CC_PLL0 14
#define GPU_CC_PLL1 15
#define GPU_CC_SLEEP_CLK 16
/* GDSCs */
#define GPU_GX_GDSC 0
#define GPU_CX_GDSC 1
#endif

View File

@ -0,0 +1,310 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* Copyright (c) 2018,2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _DT_BINDINGS_RESET_IPQ_GCC_IPQ5424_H
#define _DT_BINDINGS_RESET_IPQ_GCC_IPQ5424_H
#define GCC_QUPV3_BCR 0
#define GCC_QUPV3_I2C0_BCR 1
#define GCC_QUPV3_UART0_BCR 2
#define GCC_QUPV3_I2C1_BCR 3
#define GCC_QUPV3_UART1_BCR 4
#define GCC_QUPV3_SPI0_BCR 5
#define GCC_QUPV3_SPI1_BCR 6
#define GCC_IMEM_BCR 7
#define GCC_TME_BCR 8
#define GCC_DDRSS_BCR 9
#define GCC_PRNG_BCR 10
#define GCC_BOOT_ROM_BCR 11
#define GCC_NSS_BCR 12
#define GCC_MDIO_BCR 13
#define GCC_UNIPHY0_BCR 14
#define GCC_UNIPHY1_BCR 15
#define GCC_UNIPHY2_BCR 16
#define GCC_WCSS_BCR 17
#define GCC_SEC_CTRL_BCR 19
#define GCC_TME_SEC_BUS_BCR 20
#define GCC_ADSS_BCR 21
#define GCC_LPASS_BCR 22
#define GCC_PCIE0_BCR 23
#define GCC_PCIE0_LINK_DOWN_BCR 24
#define GCC_PCIE0PHY_PHY_BCR 25
#define GCC_PCIE0_PHY_BCR 26
#define GCC_PCIE1_BCR 27
#define GCC_PCIE1_LINK_DOWN_BCR 28
#define GCC_PCIE1PHY_PHY_BCR 29
#define GCC_PCIE1_PHY_BCR 30
#define GCC_PCIE2_BCR 31
#define GCC_PCIE2_LINK_DOWN_BCR 32
#define GCC_PCIE2PHY_PHY_BCR 33
#define GCC_PCIE2_PHY_BCR 34
#define GCC_PCIE3_BCR 35
#define GCC_PCIE3_LINK_DOWN_BCR 36
#define GCC_PCIE3PHY_PHY_BCR 37
#define GCC_PCIE3_PHY_BCR 38
#define GCC_USB_BCR 39
#define GCC_QUSB2_0_PHY_BCR 40
#define GCC_USB0_PHY_BCR 41
#define GCC_USB3PHY_0_PHY_BCR 42
#define GCC_QDSS_BCR 43
#define GCC_SNOC_BCR 44
#define GCC_ANOC_BCR 45
#define GCC_PCNOC_BCR 46
#define GCC_PCNOC_BUS_TIMEOUT0_BCR 47
#define GCC_PCNOC_BUS_TIMEOUT1_BCR 48
#define GCC_PCNOC_BUS_TIMEOUT2_BCR 49
#define GCC_PCNOC_BUS_TIMEOUT3_BCR 50
#define GCC_PCNOC_BUS_TIMEOUT4_BCR 51
#define GCC_PCNOC_BUS_TIMEOUT5_BCR 52
#define GCC_PCNOC_BUS_TIMEOUT6_BCR 53
#define GCC_PCNOC_BUS_TIMEOUT7_BCR 54
#define GCC_PCNOC_BUS_TIMEOUT8_BCR 55
#define GCC_PCNOC_BUS_TIMEOUT9_BCR 56
#define GCC_QPIC_BCR 57
#define GCC_SDCC_BCR 58
#define GCC_DCC_BCR 59
#define GCC_SPDM_BCR 60
#define GCC_MPM_BCR 61
#define GCC_APC0_VOLTAGE_DROOP_DETECTOR_BCR 62
#define GCC_RBCPR_BCR 63
#define GCC_CMN_BLK_BCR 64
#define GCC_TCSR_BCR 65
#define GCC_TLMM_BCR 66
#define GCC_QUPV3_AHB_MST_ARES 67
#define GCC_QUPV3_CORE_ARES 68
#define GCC_QUPV3_2X_CORE_ARES 69
#define GCC_QUPV3_SLEEP_ARES 70
#define GCC_QUPV3_AHB_SLV_ARES 71
#define GCC_QUPV3_I2C0_ARES 72
#define GCC_QUPV3_UART0_ARES 73
#define GCC_QUPV3_I2C1_ARES 74
#define GCC_QUPV3_UART1_ARES 75
#define GCC_QUPV3_SPI0_ARES 76
#define GCC_QUPV3_SPI1_ARES 77
#define GCC_DEBUG_ARES 78
#define GCC_GP1_ARES 79
#define GCC_GP2_ARES 80
#define GCC_GP3_ARES 81
#define GCC_IMEM_AXI_ARES 82
#define GCC_IMEM_CFG_AHB_ARES 83
#define GCC_TME_ARES 84
#define GCC_TME_TS_ARES 85
#define GCC_TME_SLOW_ARES 86
#define GCC_TME_RTC_TOGGLE_ARES 87
#define GCC_TIC_ARES 88
#define GCC_PRNG_AHB_ARES 89
#define GCC_BOOT_ROM_AHB_ARES 90
#define GCC_NSSNOC_ATB_ARES 91
#define GCC_NSS_TS_ARES 92
#define GCC_NSSNOC_QOSGEN_REF_ARES 93
#define GCC_NSSNOC_TIMEOUT_REF_ARES 94
#define GCC_NSSNOC_MEMNOC_ARES 95
#define GCC_NSSNOC_SNOC_ARES 96
#define GCC_NSSCFG_ARES 97
#define GCC_NSSNOC_NSSCC_ARES 98
#define GCC_NSSCC_ARES 99
#define GCC_MDIO_AHB_ARES 100
#define GCC_UNIPHY0_SYS_ARES 101
#define GCC_UNIPHY0_AHB_ARES 102
#define GCC_UNIPHY1_SYS_ARES 103
#define GCC_UNIPHY1_AHB_ARES 104
#define GCC_UNIPHY2_SYS_ARES 105
#define GCC_UNIPHY2_AHB_ARES 106
#define GCC_NSSNOC_XO_DCD_ARES 107
#define GCC_NSSNOC_SNOC_1_ARES 108
#define GCC_NSSNOC_PCNOC_1_ARES 109
#define GCC_NSSNOC_MEMNOC_1_ARES 110
#define GCC_DDRSS_ATB_ARES 111
#define GCC_DDRSS_AHB_ARES 112
#define GCC_GEMNOC_AHB_ARES 113
#define GCC_GEMNOC_Q6_AXI_ARES 114
#define GCC_GEMNOC_NSSNOC_ARES 115
#define GCC_GEMNOC_SNOC_ARES 116
#define GCC_GEMNOC_APSS_ARES 117
#define GCC_GEMNOC_QOSGEN_EXTREF_ARES 118
#define GCC_GEMNOC_TS_ARES 119
#define GCC_DDRSS_SMS_SLOW_ARES 120
#define GCC_GEMNOC_CNOC_ARES 121
#define GCC_GEMNOC_XO_DBG_ARES 122
#define GCC_GEMNOC_ANOC_ARES 123
#define GCC_DDRSS_LLCC_ATB_ARES 124
#define GCC_LLCC_TPDM_CFG_ARES 125
#define GCC_TME_BUS_ARES 126
#define GCC_SEC_CTRL_ACC_ARES 127
#define GCC_SEC_CTRL_ARES 128
#define GCC_SEC_CTRL_SENSE_ARES 129
#define GCC_SEC_CTRL_AHB_ARES 130
#define GCC_SEC_CTRL_BOOT_ROM_PATCH_ARES 131
#define GCC_ADSS_PWM_ARES 132
#define GCC_TME_ATB_ARES 133
#define GCC_TME_DBGAPB_ARES 134
#define GCC_TME_DEBUG_ARES 135
#define GCC_TME_AT_ARES 136
#define GCC_TME_APB_ARES 137
#define GCC_TME_DMI_DBG_HS_ARES 138
#define GCC_APSS_AHB_ARES 139
#define GCC_APSS_AXI_ARES 140
#define GCC_CPUSS_TRIG_ARES 141
#define GCC_APSS_DBG_ARES 142
#define GCC_APSS_TS_ARES 143
#define GCC_APSS_ATB_ARES 144
#define GCC_Q6_AXIM_ARES 145
#define GCC_Q6_AXIS_ARES 146
#define GCC_Q6_AHB_ARES 147
#define GCC_Q6_AHB_S_ARES 148
#define GCC_Q6SS_ATBM_ARES 149
#define GCC_Q6_TSCTR_1TO2_ARES 150
#define GCC_Q6SS_PCLKDBG_ARES 151
#define GCC_Q6SS_TRIG_ARES 152
#define GCC_Q6SS_BOOT_CBCR_ARES 153
#define GCC_WCSS_DBG_IFC_APB_ARES 154
#define GCC_WCSS_DBG_IFC_ATB_ARES 155
#define GCC_WCSS_DBG_IFC_NTS_ARES 156
#define GCC_WCSS_DBG_IFC_DAPBUS_ARES 157
#define GCC_WCSS_DBG_IFC_APB_BDG_ARES 158
#define GCC_WCSS_DBG_IFC_NTS_BDG_ARES 159
#define GCC_WCSS_DBG_IFC_DAPBUS_BDG_ARES 160
#define GCC_WCSS_ECAHB_ARES 161
#define GCC_WCSS_ACMT_ARES 162
#define GCC_WCSS_AHB_S_ARES 163
#define GCC_WCSS_AXI_M_ARES 164
#define GCC_PCNOC_WAPSS_ARES 165
#define GCC_SNOC_WAPSS_ARES 166
#define GCC_LPASS_SWAY_ARES 167
#define GCC_LPASS_CORE_AXIM_ARES 168
#define GCC_PCIE0_AHB_ARES 169
#define GCC_PCIE0_AXI_M_ARES 170
#define GCC_PCIE0_AXI_S_ARES 171
#define GCC_PCIE0_AXI_S_BRIDGE_ARES 172
#define GCC_PCIE0_PIPE_ARES 173
#define GCC_PCIE0_AUX_ARES 174
#define GCC_PCIE1_AHB_ARES 175
#define GCC_PCIE1_AXI_M_ARES 176
#define GCC_PCIE1_AXI_S_ARES 177
#define GCC_PCIE1_AXI_S_BRIDGE_ARES 178
#define GCC_PCIE1_PIPE_ARES 179
#define GCC_PCIE1_AUX_ARES 180
#define GCC_PCIE2_AHB_ARES 181
#define GCC_PCIE2_AXI_M_ARES 182
#define GCC_PCIE2_AXI_S_ARES 183
#define GCC_PCIE2_AXI_S_BRIDGE_ARES 184
#define GCC_PCIE2_PIPE_ARES 185
#define GCC_PCIE2_AUX_ARES 186
#define GCC_PCIE3_AHB_ARES 187
#define GCC_PCIE3_AXI_M_ARES 188
#define GCC_PCIE3_AXI_S_ARES 189
#define GCC_PCIE3_AXI_S_BRIDGE_ARES 190
#define GCC_PCIE3_PIPE_ARES 191
#define GCC_PCIE3_AUX_ARES 192
#define GCC_USB0_MASTER_ARES 193
#define GCC_USB0_AUX_ARES 194
#define GCC_USB0_MOCK_UTMI_ARES 195
#define GCC_USB0_PIPE_ARES 196
#define GCC_USB0_SLEEP_ARES 197
#define GCC_USB0_PHY_CFG_AHB_ARES 198
#define GCC_QDSS_AT_ARES 199
#define GCC_QDSS_STM_ARES 200
#define GCC_QDSS_TRACECLKIN_ARES 201
#define GCC_QDSS_TSCTR_DIV2_ARES 202
#define GCC_QDSS_TSCTR_DIV3_ARES 203
#define GCC_QDSS_TSCTR_DIV4_ARES 204
#define GCC_QDSS_TSCTR_DIV8_ARES 205
#define GCC_QDSS_TSCTR_DIV16_ARES 206
#define GCC_QDSS_DAP_ARES 207
#define GCC_QDSS_APB2JTAG_ARES 208
#define GCC_QDSS_ETR_USB_ARES 209
#define GCC_QDSS_DAP_AHB_ARES 210
#define GCC_QDSS_CFG_AHB_ARES 211
#define GCC_QDSS_EUD_AT_ARES 212
#define GCC_QDSS_TS_ARES 213
#define GCC_QDSS_USB_ARES 214
#define GCC_SYS_NOC_AXI_ARES 215
#define GCC_SNOC_QOSGEN_EXTREF_ARES 216
#define GCC_CNOC_LPASS_CFG_ARES 217
#define GCC_SYS_NOC_AT_ARES 218
#define GCC_SNOC_PCNOC_AHB_ARES 219
#define GCC_SNOC_TME_ARES 220
#define GCC_SNOC_XO_DCD_ARES 221
#define GCC_SNOC_TS_ARES 222
#define GCC_ANOC0_AXI_ARES 223
#define GCC_ANOC_PCIE0_1LANE_M_ARES 224
#define GCC_ANOC_PCIE2_2LANE_M_ARES 225
#define GCC_ANOC_PCIE1_1LANE_M_ARES 226
#define GCC_ANOC_PCIE3_2LANE_M_ARES 227
#define GCC_ANOC_PCNOC_AHB_ARES 228
#define GCC_ANOC_QOSGEN_EXTREF_ARES 229
#define GCC_ANOC_XO_DCD_ARES 230
#define GCC_SNOC_XO_DBG_ARES 231
#define GCC_AGGRNOC_ATB_ARES 232
#define GCC_AGGRNOC_TS_ARES 233
#define GCC_USB0_EUD_AT_ARES 234
#define GCC_PCNOC_TIC_ARES 235
#define GCC_PCNOC_AHB_ARES 236
#define GCC_PCNOC_XO_DBG_ARES 237
#define GCC_SNOC_LPASS_ARES 238
#define GCC_PCNOC_AT_ARES 239
#define GCC_PCNOC_XO_DCD_ARES 240
#define GCC_PCNOC_TS_ARES 241
#define GCC_PCNOC_BUS_TIMEOUT0_AHB_ARES 242
#define GCC_PCNOC_BUS_TIMEOUT1_AHB_ARES 243
#define GCC_PCNOC_BUS_TIMEOUT2_AHB_ARES 244
#define GCC_PCNOC_BUS_TIMEOUT3_AHB_ARES 245
#define GCC_PCNOC_BUS_TIMEOUT4_AHB_ARES 246
#define GCC_PCNOC_BUS_TIMEOUT5_AHB_ARES 247
#define GCC_PCNOC_BUS_TIMEOUT6_AHB_ARES 248
#define GCC_PCNOC_BUS_TIMEOUT7_AHB_ARES 249
#define GCC_Q6_AXIM_RESET 250
#define GCC_Q6_AXIS_RESET 251
#define GCC_Q6_AHB_S_RESET 252
#define GCC_Q6_AHB_RESET 253
#define GCC_Q6SS_DBG_RESET 254
#define GCC_WCSS_ECAHB_RESET 255
#define GCC_WCSS_DBG_BDG_RESET 256
#define GCC_WCSS_DBG_RESET 257
#define GCC_WCSS_AXI_M_RESET 258
#define GCC_WCSS_AHB_S_RESET 259
#define GCC_WCSS_ACMT_RESET 260
#define GCC_WCSSAON_RESET 261
#define GCC_PCIE0_PIPE_RESET 262
#define GCC_PCIE0_CORE_STICKY_RESET 263
#define GCC_PCIE0_AXI_S_STICKY_RESET 264
#define GCC_PCIE0_AXI_S_RESET 265
#define GCC_PCIE0_AXI_M_STICKY_RESET 266
#define GCC_PCIE0_AXI_M_RESET 267
#define GCC_PCIE0_AUX_RESET 268
#define GCC_PCIE0_AHB_RESET 269
#define GCC_PCIE1_PIPE_RESET 270
#define GCC_PCIE1_CORE_STICKY_RESET 271
#define GCC_PCIE1_AXI_S_STICKY_RESET 272
#define GCC_PCIE1_AXI_S_RESET 273
#define GCC_PCIE1_AXI_M_STICKY_RESET 274
#define GCC_PCIE1_AXI_M_RESET 275
#define GCC_PCIE1_AUX_RESET 276
#define GCC_PCIE1_AHB_RESET 277
#define GCC_PCIE2_PIPE_RESET 278
#define GCC_PCIE2_CORE_STICKY_RESET 279
#define GCC_PCIE2_AXI_S_STICKY_RESET 280
#define GCC_PCIE2_AXI_S_RESET 281
#define GCC_PCIE2_AXI_M_STICKY_RESET 282
#define GCC_PCIE2_AXI_M_RESET 283
#define GCC_PCIE2_AUX_RESET 284
#define GCC_PCIE2_AHB_RESET 285
#define GCC_PCIE3_PIPE_RESET 286
#define GCC_PCIE3_CORE_STICKY_RESET 287
#define GCC_PCIE3_AXI_S_STICKY_RESET 288
#define GCC_PCIE3_AXI_S_RESET 289
#define GCC_PCIE3_AXI_M_STICKY_RESET 290
#define GCC_PCIE3_AXI_M_RESET 291
#define GCC_PCIE3_AUX_RESET 292
#define GCC_PCIE3_AHB_RESET 293
#define GCC_NSS_PARTIAL_RESET 294
#define GCC_UNIPHY0_XPCS_ARES 295
#define GCC_UNIPHY1_XPCS_ARES 296
#define GCC_UNIPHY2_XPCS_ARES 297
#define GCC_USB1_BCR 298
#define GCC_QUSB2_1_PHY_BCR 299
#endif

View File

@ -0,0 +1,14 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2024, Linaro Limited
*/
#ifndef _DT_BINDINGS_RESET_QCOM_GPU_CC_SAR2130P_H
#define _DT_BINDINGS_RESET_QCOM_GPU_CC_SAR2130P_H
#define GPUCC_GPU_CC_GX_BCR 0
#define GPUCC_GPU_CC_ACD_BCR 1
#define GPUCC_GPU_CC_GX_ACD_IROOT_BCR 2
#endif

View File

@ -496,11 +496,13 @@ int __must_check devm_clk_bulk_get_all(struct device *dev,
struct clk_bulk_data **clks);
/**
* devm_clk_bulk_get_all_enable - Get and enable all clocks of the consumer (managed)
* devm_clk_bulk_get_all_enabled - Get and enable all clocks of the consumer (managed)
* @dev: device for clock "consumer"
* @clks: pointer to the clk_bulk_data table of consumer
*
* Returns success (0) or negative errno.
* Returns a positive value for the number of clocks obtained while the
* clock references are stored in the clk_bulk_data table in @clks field.
* Returns 0 if there're none and a negative value if something failed.
*
* This helper function allows drivers to get all clocks of the
* consumer and enables them in one operation with management.
@ -508,8 +510,8 @@ int __must_check devm_clk_bulk_get_all(struct device *dev,
* is unbound.
*/
int __must_check devm_clk_bulk_get_all_enable(struct device *dev,
struct clk_bulk_data **clks);
int __must_check devm_clk_bulk_get_all_enabled(struct device *dev,
struct clk_bulk_data **clks);
/**
* devm_clk_get - lookup and obtain a managed reference to a clock producer.
@ -1034,7 +1036,7 @@ static inline int __must_check devm_clk_bulk_get_all(struct device *dev,
return 0;
}
static inline int __must_check devm_clk_bulk_get_all_enable(struct device *dev,
static inline int __must_check devm_clk_bulk_get_all_enabled(struct device *dev,
struct clk_bulk_data **clks)
{
return 0;
@ -1136,6 +1138,15 @@ static inline void clk_restore_context(void) {}
#endif
/* Deprecated. Use devm_clk_bulk_get_all_enabled() */
static inline int __must_check
devm_clk_bulk_get_all_enable(struct device *dev, struct clk_bulk_data **clks)
{
int ret = devm_clk_bulk_get_all_enabled(dev, clks);
return ret > 0 ? 0 : ret;
}
/* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
static inline int clk_prepare_enable(struct clk *clk)
{