Merge branches 'clk-allwinner', 'clk-amlogic' and 'clk-qcom' into clk-next
* clk-allwinner: clk: sunxi-ng: add support for the A523/T527 PRCM CCU clk: sunxi-ng: a523: add reset lines clk: sunxi-ng: a523: add bus clock gates clk: sunxi-ng: a523: remaining mod clocks clk: sunxi-ng: a523: add USB mod clocks clk: sunxi-ng: a523: add interface mod clocks clk: sunxi-ng: a523: add system mod clocks clk: sunxi-ng: a523: add video mod clocks clk: sunxi-ng: a523: Add support for bus clocks clk: sunxi-ng: Add support for the A523/T527 CCU PLLs dt-bindings: clk: sunxi-ng: document two Allwinner A523 CCUs clk: sunxi-ng: Add support for update bit clk: sunxi-ng: mp: provide wrappers for setting feature flags clk: sunxi-ng: mp: introduce dual-divider clock clk: sunxi-ng: h616: Reparent GPU clock during frequency changes clk: sunxi-ng: h616: Add clock/reset for LCD TCON dt-bindings: clock: sun50i-h616-ccu: Add LCD TCON clk and reset * clk-amlogic: clk: amlogic: a1: fix a typo clk: amlogic: gxbb: drop non existing 32k clock parent clk: amlogic: gxbb: drop incorrect flag on 32k clock clk: amlogic: g12b: fix cluster A parent data clk: amlogic: g12a: fix mmc A peripheral clock * clk-qcom: (41 commits) clk: qcom: Add NSS clock Controller driver for IPQ9574 clk: qcom: gcc-ipq9574: Add support for gpll0_out_aux clock dt-bindings: clock: Add ipq9574 NSSCC clock and reset definitions dt-bindings: clock: gcc-ipq9574: Add definition for GPLL0_OUT_AUX clk: qcom: gcc-msm8953: fix stuck venus0_core0 clock clk: qcom: mmcc-sdm660: fix stuck video_subcore0 clock dt-bindings: clock: qcom,x1e80100-camcc: Fix the list of required-opps drivers: clk: qcom: ipq5424: fix the freq table of sdcc1_apps clock clk: qcom: lpassaudiocc-sc7280: Add support for LPASS resets for QCM6490 dt-bindings: clock: qcom: Add compatible for QCM6490 boards clk: qcom: gdsc: Update the status poll timeout for GDSC clk: qcom: gdsc: Set retain_ff before moving to HW CTRL clk: qcom: gcc-sm8650: Do not turn off USB GDSCs during gdsc_disable() clk: qcom: videocc: Constify 'struct qcom_cc_desc' clk: qcom: gpucc: Constify 'struct qcom_cc_desc' clk: qcom: dispcc: Constify 'struct qcom_cc_desc' clk: qcom: camcc: Constify 'struct qcom_cc_desc' dt-bindings: clock: qcom: sm8450-camcc: Remove qcom,x1e80100-camcc leftover clk: qcom: Add support for Video Clock Controller on QCS8300 clk: qcom: Add support for GPU Clock Controller on QCS8300 ...
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/clock/allwinner,sun55i-a523-ccu.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Allwinner A523 Clock Control Unit
|
||||
|
||||
maintainers:
|
||||
- Andre Przywara <andre.przywara@arm.com>
|
||||
|
||||
properties:
|
||||
"#clock-cells":
|
||||
const: 1
|
||||
|
||||
"#reset-cells":
|
||||
const: 1
|
||||
|
||||
compatible:
|
||||
enum:
|
||||
- allwinner,sun55i-a523-ccu
|
||||
- allwinner,sun55i-a523-r-ccu
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
clocks:
|
||||
minItems: 4
|
||||
maxItems: 5
|
||||
|
||||
clock-names:
|
||||
minItems: 4
|
||||
maxItems: 5
|
||||
|
||||
required:
|
||||
- "#clock-cells"
|
||||
- "#reset-cells"
|
||||
- compatible
|
||||
- reg
|
||||
- clocks
|
||||
- clock-names
|
||||
|
||||
allOf:
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- allwinner,sun55i-a523-ccu
|
||||
|
||||
then:
|
||||
properties:
|
||||
clocks:
|
||||
items:
|
||||
- description: High Frequency Oscillator (usually at 24MHz)
|
||||
- description: Low Frequency Oscillator (usually at 32kHz)
|
||||
- description: Internal Oscillator
|
||||
- description: Low Frequency Oscillator fanout
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: hosc
|
||||
- const: losc
|
||||
- const: iosc
|
||||
- const: losc-fanout
|
||||
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- allwinner,sun55i-a523-r-ccu
|
||||
|
||||
then:
|
||||
properties:
|
||||
clocks:
|
||||
items:
|
||||
- description: High Frequency Oscillator (usually at 24MHz)
|
||||
- description: Low Frequency Oscillator (usually at 32kHz)
|
||||
- description: Internal Oscillator
|
||||
- description: Peripherals PLL
|
||||
- description: Audio PLL
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: hosc
|
||||
- const: losc
|
||||
- const: iosc
|
||||
- const: pll-periph
|
||||
- const: pll-audio
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
clock-controller@2001000 {
|
||||
compatible = "allwinner,sun55i-a523-ccu";
|
||||
reg = <0x02001000 0x1000>;
|
||||
clocks = <&osc24M>, <&osc32k>, <&iosc>, <&r_ccu 1>;
|
||||
clock-names = "hosc", "losc", "iosc", "losc-fanout";
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
|
||||
...
|
||||
@@ -8,6 +8,7 @@ title: Qualcomm Graphics Clock & Reset Controller
|
||||
|
||||
maintainers:
|
||||
- Taniya Das <quic_tdas@quicinc.com>
|
||||
- Imran Shaik <quic_imrashai@quicinc.com>
|
||||
|
||||
description: |
|
||||
Qualcomm graphics clock control module provides the clocks, resets and power
|
||||
@@ -23,10 +24,12 @@ description: |
|
||||
include/dt-bindings/clock/qcom,gpucc-sm8150.h
|
||||
include/dt-bindings/clock/qcom,gpucc-sm8250.h
|
||||
include/dt-bindings/clock/qcom,gpucc-sm8350.h
|
||||
include/dt-bindings/clock/qcom,qcs8300-gpucc.h
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- qcom,qcs8300-gpucc
|
||||
- qcom,sdm845-gpucc
|
||||
- qcom,sa8775p-gpucc
|
||||
- qcom,sc7180-gpucc
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/clock/qcom,ipq9574-nsscc.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Qualcomm Networking Sub System Clock & Reset Controller on IPQ9574
|
||||
|
||||
maintainers:
|
||||
- Bjorn Andersson <andersson@kernel.org>
|
||||
- Anusha Rao <quic_anusha@quicinc.com>
|
||||
|
||||
description: |
|
||||
Qualcomm networking sub system clock control module provides the clocks,
|
||||
resets on IPQ9574
|
||||
|
||||
See also::
|
||||
include/dt-bindings/clock/qcom,ipq9574-nsscc.h
|
||||
include/dt-bindings/reset/qcom,ipq9574-nsscc.h
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: qcom,ipq9574-nsscc
|
||||
|
||||
clocks:
|
||||
items:
|
||||
- description: Board XO source
|
||||
- description: CMN_PLL NSS 1200MHz (Bias PLL cc) clock source
|
||||
- description: CMN_PLL PPE 353MHz (Bias PLL ubi nc) clock source
|
||||
- description: GCC GPLL0 OUT AUX clock source
|
||||
- description: Uniphy0 NSS Rx clock source
|
||||
- description: Uniphy0 NSS Tx clock source
|
||||
- description: Uniphy1 NSS Rx clock source
|
||||
- description: Uniphy1 NSS Tx clock source
|
||||
- description: Uniphy2 NSS Rx clock source
|
||||
- description: Uniphy2 NSS Tx clock source
|
||||
- description: GCC NSSCC clock source
|
||||
|
||||
'#interconnect-cells':
|
||||
const: 1
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: xo
|
||||
- const: nss_1200
|
||||
- const: ppe_353
|
||||
- const: gpll0_out
|
||||
- const: uniphy0_rx
|
||||
- const: uniphy0_tx
|
||||
- const: uniphy1_rx
|
||||
- const: uniphy1_tx
|
||||
- const: uniphy2_rx
|
||||
- const: uniphy2_tx
|
||||
- const: bus
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- clocks
|
||||
- clock-names
|
||||
|
||||
allOf:
|
||||
- $ref: qcom,gcc.yaml#
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/clock/qcom,ipq9574-gcc.h>
|
||||
#include <dt-bindings/clock/qcom,ipq-cmn-pll.h>
|
||||
clock-controller@39b00000 {
|
||||
compatible = "qcom,ipq9574-nsscc";
|
||||
reg = <0x39b00000 0x80000>;
|
||||
clocks = <&xo_board_clk>,
|
||||
<&cmn_pll NSS_1200MHZ_CLK>,
|
||||
<&cmn_pll PPE_353MHZ_CLK>,
|
||||
<&gcc GPLL0_OUT_AUX>,
|
||||
<&uniphy 0>,
|
||||
<&uniphy 1>,
|
||||
<&uniphy 2>,
|
||||
<&uniphy 3>,
|
||||
<&uniphy 4>,
|
||||
<&uniphy 5>,
|
||||
<&gcc GCC_NSSCC_CLK>;
|
||||
clock-names = "xo",
|
||||
"nss_1200",
|
||||
"ppe_353",
|
||||
"gpll0_out",
|
||||
"uniphy0_rx",
|
||||
"uniphy0_tx",
|
||||
"uniphy1_rx",
|
||||
"uniphy1_tx",
|
||||
"uniphy2_rx",
|
||||
"uniphy2_tx",
|
||||
"bus";
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
...
|
||||
@@ -44,6 +44,7 @@ properties:
|
||||
- qcom,rpmcc-msm8998
|
||||
- qcom,rpmcc-qcm2290
|
||||
- qcom,rpmcc-qcs404
|
||||
- qcom,rpmcc-sdm429
|
||||
- qcom,rpmcc-sdm660
|
||||
- qcom,rpmcc-sm6115
|
||||
- qcom,rpmcc-sm6125
|
||||
@@ -123,6 +124,7 @@ allOf:
|
||||
- qcom,rpmcc-msm8998
|
||||
- qcom,rpmcc-qcm2290
|
||||
- qcom,rpmcc-qcs404
|
||||
- qcom,rpmcc-sdm429
|
||||
- qcom,rpmcc-sdm660
|
||||
- qcom,rpmcc-sm6115
|
||||
- qcom,rpmcc-sm6125
|
||||
|
||||
@@ -8,16 +8,20 @@ title: Qualcomm Camera Clock & Reset Controller on SA8775P
|
||||
|
||||
maintainers:
|
||||
- Taniya Das <quic_tdas@quicinc.com>
|
||||
- Imran Shaik <quic_imrashai@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
|
||||
See also:
|
||||
include/dt-bindings/clock/qcom,qcs8300-camcc.h
|
||||
include/dt-bindings/clock/qcom,sa8775p-camcc.h
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- qcom,qcs8300-camcc
|
||||
- qcom,sa8775p-camcc
|
||||
|
||||
clocks:
|
||||
|
||||
@@ -18,6 +18,7 @@ description: |
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- qcom,qcs8300-videocc
|
||||
- qcom,sa8775p-videocc
|
||||
|
||||
clocks:
|
||||
|
||||
@@ -20,6 +20,7 @@ description: |
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- qcom,qcm6490-lpassaudiocc
|
||||
- qcom,sc7280-lpassaoncc
|
||||
- qcom,sc7280-lpassaudiocc
|
||||
- qcom,sc7280-lpasscorecc
|
||||
@@ -68,7 +69,9 @@ allOf:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
const: qcom,sc7280-lpassaudiocc
|
||||
enum:
|
||||
- qcom,qcm6490-lpassaudiocc
|
||||
- qcom,sc7280-lpassaudiocc
|
||||
|
||||
then:
|
||||
properties:
|
||||
|
||||
@@ -64,7 +64,6 @@ allOf:
|
||||
- qcom,sc8280xp-camcc
|
||||
- qcom,sm8450-camcc
|
||||
- qcom,sm8550-camcc
|
||||
- qcom,x1e80100-camcc
|
||||
then:
|
||||
required:
|
||||
- required-opps
|
||||
|
||||
@@ -40,9 +40,9 @@ properties:
|
||||
- description: A phandle to the MMCX power-domain
|
||||
|
||||
required-opps:
|
||||
maxItems: 1
|
||||
description:
|
||||
A phandle to an OPP node describing MMCX performance points.
|
||||
items:
|
||||
- description: A phandle to an OPP node describing MXC performance points
|
||||
- description: A phandle to an OPP node describing MMCX performance points
|
||||
|
||||
required:
|
||||
- compatible
|
||||
@@ -66,7 +66,8 @@ examples:
|
||||
<&sleep_clk>;
|
||||
power-domains = <&rpmhpd RPMHPD_MXC>,
|
||||
<&rpmhpd RPMHPD_MMCX>;
|
||||
required-opps = <&rpmhpd_opp_low_svs>;
|
||||
required-opps = <&rpmhpd_opp_low_svs>,
|
||||
<&rpmhpd_opp_low_svs>;
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
#power-domain-cells = <1>;
|
||||
|
||||
@@ -356,7 +356,7 @@ static struct platform_driver a1_pll_clkc_driver = {
|
||||
};
|
||||
module_platform_driver(a1_pll_clkc_driver);
|
||||
|
||||
MODULE_DESCRIPTION("Amlogic S4 PLL Clock Controller driver");
|
||||
MODULE_DESCRIPTION("Amlogic A1 PLL Clock Controller driver");
|
||||
MODULE_AUTHOR("Jian Hu <jian.hu@amlogic.com>");
|
||||
MODULE_AUTHOR("Dmitry Rokosov <ddrokosov@sberdevices.ru>");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
+25
-13
@@ -1137,8 +1137,18 @@ static struct clk_regmap g12a_cpu_clk_div16_en = {
|
||||
.hw.init = &(struct clk_init_data) {
|
||||
.name = "cpu_clk_div16_en",
|
||||
.ops = &clk_regmap_gate_ro_ops,
|
||||
.parent_hws = (const struct clk_hw *[]) {
|
||||
&g12a_cpu_clk.hw
|
||||
.parent_data = &(const struct clk_parent_data) {
|
||||
/*
|
||||
* Note:
|
||||
* G12A and G12B have different cpu clocks (with
|
||||
* different struct clk_hw). We fallback to the global
|
||||
* naming string mechanism so this clock picks
|
||||
* up the appropriate one. Same goes for the other
|
||||
* clock using cpu cluster A clock output and present
|
||||
* on both G12 variant.
|
||||
*/
|
||||
.name = "cpu_clk",
|
||||
.index = -1,
|
||||
},
|
||||
.num_parents = 1,
|
||||
/*
|
||||
@@ -1203,7 +1213,10 @@ static struct clk_regmap g12a_cpu_clk_apb_div = {
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "cpu_clk_apb_div",
|
||||
.ops = &clk_regmap_divider_ro_ops,
|
||||
.parent_hws = (const struct clk_hw *[]) { &g12a_cpu_clk.hw },
|
||||
.parent_data = &(const struct clk_parent_data) {
|
||||
.name = "cpu_clk",
|
||||
.index = -1,
|
||||
},
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
@@ -1237,7 +1250,10 @@ static struct clk_regmap g12a_cpu_clk_atb_div = {
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "cpu_clk_atb_div",
|
||||
.ops = &clk_regmap_divider_ro_ops,
|
||||
.parent_hws = (const struct clk_hw *[]) { &g12a_cpu_clk.hw },
|
||||
.parent_data = &(const struct clk_parent_data) {
|
||||
.name = "cpu_clk",
|
||||
.index = -1,
|
||||
},
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
@@ -1271,7 +1287,10 @@ static struct clk_regmap g12a_cpu_clk_axi_div = {
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "cpu_clk_axi_div",
|
||||
.ops = &clk_regmap_divider_ro_ops,
|
||||
.parent_hws = (const struct clk_hw *[]) { &g12a_cpu_clk.hw },
|
||||
.parent_data = &(const struct clk_parent_data) {
|
||||
.name = "cpu_clk",
|
||||
.index = -1,
|
||||
},
|
||||
.num_parents = 1,
|
||||
},
|
||||
};
|
||||
@@ -1306,13 +1325,6 @@ static struct clk_regmap g12a_cpu_clk_trace_div = {
|
||||
.name = "cpu_clk_trace_div",
|
||||
.ops = &clk_regmap_divider_ro_ops,
|
||||
.parent_data = &(const struct clk_parent_data) {
|
||||
/*
|
||||
* Note:
|
||||
* G12A and G12B have different cpu_clks (with
|
||||
* different struct clk_hw). We fallback to the global
|
||||
* naming string mechanism so cpu_clk_trace_div picks
|
||||
* up the appropriate one.
|
||||
*/
|
||||
.name = "cpu_clk",
|
||||
.index = -1,
|
||||
},
|
||||
@@ -4311,7 +4323,7 @@ static MESON_GATE(g12a_spicc_1, HHI_GCLK_MPEG0, 14);
|
||||
static MESON_GATE(g12a_hiu_reg, HHI_GCLK_MPEG0, 19);
|
||||
static MESON_GATE(g12a_mipi_dsi_phy, HHI_GCLK_MPEG0, 20);
|
||||
static MESON_GATE(g12a_assist_misc, HHI_GCLK_MPEG0, 23);
|
||||
static MESON_GATE(g12a_emmc_a, HHI_GCLK_MPEG0, 4);
|
||||
static MESON_GATE(g12a_emmc_a, HHI_GCLK_MPEG0, 24);
|
||||
static MESON_GATE(g12a_emmc_b, HHI_GCLK_MPEG0, 25);
|
||||
static MESON_GATE(g12a_emmc_c, HHI_GCLK_MPEG0, 26);
|
||||
static MESON_GATE(g12a_audio_codec, HHI_GCLK_MPEG0, 28);
|
||||
|
||||
@@ -1266,14 +1266,13 @@ static struct clk_regmap gxbb_cts_i958 = {
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* This table skips a clock named 'cts_slow_oscin' in the documentation
|
||||
* This clock does not exist yet in this controller or the AO one
|
||||
*/
|
||||
static u32 gxbb_32k_clk_parents_val_table[] = { 0, 2, 3 };
|
||||
static const struct clk_parent_data gxbb_32k_clk_parent_data[] = {
|
||||
{ .fw_name = "xtal", },
|
||||
/*
|
||||
* FIXME: This clock is provided by the ao clock controller but the
|
||||
* clock is not yet part of the binding of this controller, so string
|
||||
* name must be use to set this parent.
|
||||
*/
|
||||
{ .name = "cts_slow_oscin", .index = -1 },
|
||||
{ .hw = &gxbb_fclk_div3.hw },
|
||||
{ .hw = &gxbb_fclk_div5.hw },
|
||||
};
|
||||
@@ -1283,6 +1282,7 @@ static struct clk_regmap gxbb_32k_clk_sel = {
|
||||
.offset = HHI_32K_CLK_CNTL,
|
||||
.mask = 0x3,
|
||||
.shift = 16,
|
||||
.table = gxbb_32k_clk_parents_val_table,
|
||||
},
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "32k_clk_sel",
|
||||
@@ -1306,7 +1306,7 @@ static struct clk_regmap gxbb_32k_clk_div = {
|
||||
&gxbb_32k_clk_sel.hw
|
||||
},
|
||||
.num_parents = 1,
|
||||
.flags = CLK_SET_RATE_PARENT | CLK_DIVIDER_ROUND_CLOSEST,
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ config IPQ_GCC_4019
|
||||
|
||||
config IPQ_GCC_5018
|
||||
tristate "IPQ5018 Global Clock Controller"
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
depends on ARM || ARM64 || COMPILE_TEST
|
||||
help
|
||||
Support for global clock controller on ipq5018 devices.
|
||||
Say Y if you want to use peripheral devices such as UART, SPI,
|
||||
@@ -281,6 +281,13 @@ config IPQ_GCC_9574
|
||||
i2c, USB, SD/eMMC, etc. Select this for the root clock
|
||||
of ipq9574.
|
||||
|
||||
config IPQ_NSSCC_9574
|
||||
tristate "IPQ9574 NSS Clock Controller"
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
depends on IPQ_GCC_9574
|
||||
help
|
||||
Support for NSS clock controller on ipq9574 devices.
|
||||
|
||||
config IPQ_NSSCC_QCA8K
|
||||
tristate "QCA8K(QCA8386 or QCA8084) NSS Clock Controller"
|
||||
depends on MDIO_BUS
|
||||
|
||||
@@ -39,6 +39,7 @@ obj-$(CONFIG_IPQ_GCC_6018) += gcc-ipq6018.o
|
||||
obj-$(CONFIG_IPQ_GCC_806X) += gcc-ipq806x.o
|
||||
obj-$(CONFIG_IPQ_GCC_8074) += gcc-ipq8074.o
|
||||
obj-$(CONFIG_IPQ_GCC_9574) += gcc-ipq9574.o
|
||||
obj-$(CONFIG_IPQ_NSSCC_9574) += nsscc-ipq9574.o
|
||||
obj-$(CONFIG_IPQ_LCC_806X) += lcc-ipq806x.o
|
||||
obj-$(CONFIG_IPQ_NSSCC_QCA8K) += nsscc-qca8k.o
|
||||
obj-$(CONFIG_MDM_GCC_9607) += gcc-mdm9607.o
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#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>
|
||||
@@ -1801,7 +1800,7 @@ static const struct regmap_config cam_cc_sa8775p_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc cam_cc_sa8775p_desc = {
|
||||
static const struct qcom_cc_desc cam_cc_sa8775p_desc = {
|
||||
.config = &cam_cc_sa8775p_regmap_config,
|
||||
.clks = cam_cc_sa8775p_clocks,
|
||||
.num_clks = ARRAY_SIZE(cam_cc_sa8775p_clocks),
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_clock.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
|
||||
@@ -2987,7 +2987,7 @@ static const struct regmap_config camcc_sc8280xp_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc camcc_sc8280xp_desc = {
|
||||
static const struct qcom_cc_desc camcc_sc8280xp_desc = {
|
||||
.config = &camcc_sc8280xp_regmap_config,
|
||||
.clks = camcc_sc8280xp_clocks,
|
||||
.num_clks = ARRAY_SIZE(camcc_sc8280xp_clocks),
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#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/regmap.h>
|
||||
|
||||
@@ -1641,7 +1640,7 @@ static const struct regmap_config cam_cc_sm4450_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc cam_cc_sm4450_desc = {
|
||||
static const struct qcom_cc_desc cam_cc_sm4450_desc = {
|
||||
.config = &cam_cc_sm4450_regmap_config,
|
||||
.clks = cam_cc_sm4450_clocks,
|
||||
.num_clks = ARRAY_SIZE(cam_cc_sm4450_clocks),
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
@@ -2094,7 +2094,7 @@ static const struct regmap_config cam_cc_sm8150_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc cam_cc_sm8150_desc = {
|
||||
static const struct qcom_cc_desc cam_cc_sm8150_desc = {
|
||||
.config = &cam_cc_sm8150_regmap_config,
|
||||
.clks = cam_cc_sm8150_clocks,
|
||||
.num_clks = ARRAY_SIZE(cam_cc_sm8150_clocks),
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,camcc-sm8250.h>
|
||||
|
||||
@@ -411,7 +411,7 @@ static struct clk_rcg2 cam_cc_bps_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -433,7 +433,7 @@ static struct clk_rcg2 cam_cc_camnoc_axi_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -454,7 +454,7 @@ static struct clk_rcg2 cam_cc_cci_0_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -469,7 +469,7 @@ static struct clk_rcg2 cam_cc_cci_1_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -490,7 +490,7 @@ static struct clk_rcg2 cam_cc_cphy_rx_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -511,7 +511,7 @@ static struct clk_rcg2 cam_cc_csi0phytimer_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -526,7 +526,7 @@ static struct clk_rcg2 cam_cc_csi1phytimer_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -556,7 +556,7 @@ static struct clk_rcg2 cam_cc_csi3phytimer_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -571,7 +571,7 @@ static struct clk_rcg2 cam_cc_csi4phytimer_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -586,7 +586,7 @@ static struct clk_rcg2 cam_cc_csi5phytimer_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -611,7 +611,7 @@ static struct clk_rcg2 cam_cc_fast_ahb_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -634,7 +634,7 @@ static struct clk_rcg2 cam_cc_fd_core_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -649,7 +649,7 @@ static struct clk_rcg2 cam_cc_icp_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -673,7 +673,7 @@ static struct clk_rcg2 cam_cc_ife_0_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_2,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_2),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -710,7 +710,7 @@ static struct clk_rcg2 cam_cc_ife_0_csid_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -734,7 +734,7 @@ static struct clk_rcg2 cam_cc_ife_1_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_3,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_3),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -749,7 +749,7 @@ static struct clk_rcg2 cam_cc_ife_1_csid_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -771,7 +771,7 @@ static struct clk_rcg2 cam_cc_ife_lite_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -786,7 +786,7 @@ static struct clk_rcg2 cam_cc_ife_lite_csid_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -810,7 +810,7 @@ static struct clk_rcg2 cam_cc_ipe_0_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_4,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_4),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -825,7 +825,7 @@ static struct clk_rcg2 cam_cc_jpeg_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -847,7 +847,7 @@ static struct clk_rcg2 cam_cc_mclk0_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_1,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_1),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -862,7 +862,7 @@ static struct clk_rcg2 cam_cc_mclk1_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_1,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_1),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -877,7 +877,7 @@ static struct clk_rcg2 cam_cc_mclk2_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_1,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_1),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -892,7 +892,7 @@ static struct clk_rcg2 cam_cc_mclk3_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_1,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_1),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -907,7 +907,7 @@ static struct clk_rcg2 cam_cc_mclk4_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_1,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_1),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -922,7 +922,7 @@ static struct clk_rcg2 cam_cc_mclk5_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_1,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_1),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -993,7 +993,7 @@ static struct clk_rcg2 cam_cc_slow_ahb_clk_src = {
|
||||
.parent_data = cam_cc_parent_data_0,
|
||||
.num_parents = ARRAY_SIZE(cam_cc_parent_data_0),
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_rcg2_ops,
|
||||
.ops = &clk_rcg2_shared_ops,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -3487,7 +3487,7 @@ static const struct regmap_config cam_cc_sm8550_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc cam_cc_sm8550_desc = {
|
||||
static const struct qcom_cc_desc cam_cc_sm8550_desc = {
|
||||
.config = &cam_cc_sm8550_regmap_config,
|
||||
.clks = cam_cc_sm8550_clocks,
|
||||
.num_clks = ARRAY_SIZE(cam_cc_sm8550_clocks),
|
||||
|
||||
@@ -3517,7 +3517,7 @@ static const struct regmap_config cam_cc_sm8650_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc cam_cc_sm8650_desc = {
|
||||
static const struct qcom_cc_desc cam_cc_sm8650_desc = {
|
||||
.config = &cam_cc_sm8650_regmap_config,
|
||||
.clks = cam_cc_sm8650_clocks,
|
||||
.num_clks = ARRAY_SIZE(cam_cc_sm8650_clocks),
|
||||
|
||||
@@ -709,14 +709,19 @@ clk_alpha_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
|
||||
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
|
||||
u32 alpha_width = pll_alpha_width(pll);
|
||||
|
||||
regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l);
|
||||
if (regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l))
|
||||
return 0;
|
||||
|
||||
if (regmap_read(pll->clkr.regmap, PLL_USER_CTL(pll), &ctl))
|
||||
return 0;
|
||||
|
||||
regmap_read(pll->clkr.regmap, PLL_USER_CTL(pll), &ctl);
|
||||
if (ctl & PLL_ALPHA_EN) {
|
||||
regmap_read(pll->clkr.regmap, PLL_ALPHA_VAL(pll), &low);
|
||||
if (regmap_read(pll->clkr.regmap, PLL_ALPHA_VAL(pll), &low))
|
||||
return 0;
|
||||
if (alpha_width > 32) {
|
||||
regmap_read(pll->clkr.regmap, PLL_ALPHA_VAL_U(pll),
|
||||
&high);
|
||||
if (regmap_read(pll->clkr.regmap, PLL_ALPHA_VAL_U(pll),
|
||||
&high))
|
||||
return 0;
|
||||
a = (u64)high << 32 | low;
|
||||
} else {
|
||||
a = low & GENMASK(alpha_width - 1, 0);
|
||||
@@ -942,8 +947,11 @@ alpha_pll_huayra_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
|
||||
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
|
||||
u32 l, alpha = 0, ctl, alpha_m, alpha_n;
|
||||
|
||||
regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l);
|
||||
regmap_read(pll->clkr.regmap, PLL_USER_CTL(pll), &ctl);
|
||||
if (regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l))
|
||||
return 0;
|
||||
|
||||
if (regmap_read(pll->clkr.regmap, PLL_USER_CTL(pll), &ctl))
|
||||
return 0;
|
||||
|
||||
if (ctl & PLL_ALPHA_EN) {
|
||||
regmap_read(pll->clkr.regmap, PLL_ALPHA_VAL(pll), &alpha);
|
||||
@@ -1137,8 +1145,11 @@ clk_trion_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
|
||||
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
|
||||
u32 l, frac, alpha_width = pll_alpha_width(pll);
|
||||
|
||||
regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l);
|
||||
regmap_read(pll->clkr.regmap, PLL_ALPHA_VAL(pll), &frac);
|
||||
if (regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l))
|
||||
return 0;
|
||||
|
||||
if (regmap_read(pll->clkr.regmap, PLL_ALPHA_VAL(pll), &frac))
|
||||
return 0;
|
||||
|
||||
return alpha_pll_calc_rate(parent_rate, l, frac, alpha_width);
|
||||
}
|
||||
@@ -1196,7 +1207,8 @@ clk_alpha_pll_postdiv_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
|
||||
struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
|
||||
u32 ctl;
|
||||
|
||||
regmap_read(pll->clkr.regmap, PLL_USER_CTL(pll), &ctl);
|
||||
if (regmap_read(pll->clkr.regmap, PLL_USER_CTL(pll), &ctl))
|
||||
return 0;
|
||||
|
||||
ctl >>= PLL_POST_DIV_SHIFT;
|
||||
ctl &= PLL_POST_DIV_MASK(pll);
|
||||
@@ -1412,8 +1424,11 @@ static unsigned long alpha_pll_fabia_recalc_rate(struct clk_hw *hw,
|
||||
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
|
||||
u32 l, frac, alpha_width = pll_alpha_width(pll);
|
||||
|
||||
regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l);
|
||||
regmap_read(pll->clkr.regmap, PLL_FRAC(pll), &frac);
|
||||
if (regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l))
|
||||
return 0;
|
||||
|
||||
if (regmap_read(pll->clkr.regmap, PLL_FRAC(pll), &frac))
|
||||
return 0;
|
||||
|
||||
return alpha_pll_calc_rate(parent_rate, l, frac, alpha_width);
|
||||
}
|
||||
@@ -1563,7 +1578,8 @@ clk_trion_pll_postdiv_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
|
||||
struct regmap *regmap = pll->clkr.regmap;
|
||||
u32 i, div = 1, val;
|
||||
|
||||
regmap_read(regmap, PLL_USER_CTL(pll), &val);
|
||||
if (regmap_read(regmap, PLL_USER_CTL(pll), &val))
|
||||
return 0;
|
||||
|
||||
val >>= pll->post_div_shift;
|
||||
val &= PLL_POST_DIV_MASK(pll);
|
||||
@@ -2484,9 +2500,12 @@ static unsigned long alpha_pll_lucid_evo_recalc_rate(struct clk_hw *hw,
|
||||
struct regmap *regmap = pll->clkr.regmap;
|
||||
u32 l, frac;
|
||||
|
||||
regmap_read(regmap, PLL_L_VAL(pll), &l);
|
||||
if (regmap_read(regmap, PLL_L_VAL(pll), &l))
|
||||
return 0;
|
||||
l &= LUCID_EVO_PLL_L_VAL_MASK;
|
||||
regmap_read(regmap, PLL_ALPHA_VAL(pll), &frac);
|
||||
|
||||
if (regmap_read(regmap, PLL_ALPHA_VAL(pll), &frac))
|
||||
return 0;
|
||||
|
||||
return alpha_pll_calc_rate(parent_rate, l, frac, pll_alpha_width(pll));
|
||||
}
|
||||
@@ -2699,7 +2718,8 @@ static unsigned long clk_rivian_evo_pll_recalc_rate(struct clk_hw *hw,
|
||||
struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
|
||||
u32 l;
|
||||
|
||||
regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l);
|
||||
if (regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l))
|
||||
return 0;
|
||||
|
||||
return parent_rate * l;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ static bool clk_branch_in_hwcg_mode(const struct clk_branch *br)
|
||||
|
||||
static bool clk_branch_check_halt(const struct clk_branch *br, bool enabling)
|
||||
{
|
||||
bool invert = (br->halt_check == BRANCH_HALT_ENABLE);
|
||||
bool invert = (br->halt_check & BRANCH_HALT_ENABLE);
|
||||
u32 val;
|
||||
|
||||
regmap_read(br->clkr.regmap, br->halt_reg, &val);
|
||||
@@ -44,7 +44,7 @@ static bool clk_branch2_check_halt(const struct clk_branch *br, bool enabling)
|
||||
{
|
||||
u32 val;
|
||||
u32 mask;
|
||||
bool invert = (br->halt_check == BRANCH_HALT_ENABLE);
|
||||
bool invert = (br->halt_check & BRANCH_HALT_ENABLE);
|
||||
|
||||
mask = CBCR_NOC_FSM_STATUS;
|
||||
mask |= CBCR_CLK_OFF;
|
||||
|
||||
@@ -486,6 +486,7 @@ DEFINE_CLK_SMD_RPM(qup, QCOM_SMD_RPM_QUP_CLK, 0);
|
||||
|
||||
DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(bb_clk1, 1, 19200000);
|
||||
DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(bb_clk2, 2, 19200000);
|
||||
DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(bb_clk3, 3, 19200000);
|
||||
DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(ln_bb_clk1, 1, 19200000);
|
||||
DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(ln_bb_clk2, 2, 19200000);
|
||||
DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(ln_bb_clk3, 3, 19200000);
|
||||
@@ -1046,6 +1047,36 @@ static const struct rpm_smd_clk_desc rpm_clk_msm8998 = {
|
||||
.num_icc_clks = ARRAY_SIZE(msm8998_icc_clks),
|
||||
};
|
||||
|
||||
static struct clk_smd_rpm *sdm429_clks[] = {
|
||||
[RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo,
|
||||
[RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a,
|
||||
[RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk,
|
||||
[RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk,
|
||||
[RPM_SMD_BB_CLK1] = &clk_smd_rpm_bb_clk1,
|
||||
[RPM_SMD_BB_CLK1_A] = &clk_smd_rpm_bb_clk1_a,
|
||||
[RPM_SMD_BB_CLK2] = &clk_smd_rpm_bb_clk2,
|
||||
[RPM_SMD_BB_CLK2_A] = &clk_smd_rpm_bb_clk2_a,
|
||||
[RPM_SMD_BB_CLK3] = &clk_smd_rpm_bb_clk3,
|
||||
[RPM_SMD_BB_CLK3_A] = &clk_smd_rpm_bb_clk3_a,
|
||||
[RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2,
|
||||
[RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a,
|
||||
[RPM_SMD_DIV_CLK2] = &clk_smd_rpm_div_clk2,
|
||||
[RPM_SMD_DIV_A_CLK2] = &clk_smd_rpm_div_clk2_a,
|
||||
[RPM_SMD_BB_CLK1_PIN] = &clk_smd_rpm_bb_clk1_pin,
|
||||
[RPM_SMD_BB_CLK1_A_PIN] = &clk_smd_rpm_bb_clk1_a_pin,
|
||||
[RPM_SMD_BB_CLK2_PIN] = &clk_smd_rpm_bb_clk2_pin,
|
||||
[RPM_SMD_BB_CLK2_A_PIN] = &clk_smd_rpm_bb_clk2_a_pin,
|
||||
[RPM_SMD_BB_CLK3_PIN] = &clk_smd_rpm_bb_clk3_pin,
|
||||
[RPM_SMD_BB_CLK3_A_PIN] = &clk_smd_rpm_bb_clk3_a_pin,
|
||||
};
|
||||
|
||||
static const struct rpm_smd_clk_desc rpm_clk_sdm429 = {
|
||||
.clks = sdm429_clks,
|
||||
.num_clks = ARRAY_SIZE(sdm429_clks),
|
||||
.icc_clks = bimc_pcnoc_snoc_smmnoc_icc_clks,
|
||||
.num_icc_clks = ARRAY_SIZE(bimc_pcnoc_snoc_smmnoc_icc_clks),
|
||||
};
|
||||
|
||||
static struct clk_smd_rpm *sdm660_clks[] = {
|
||||
[RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo,
|
||||
[RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a,
|
||||
@@ -1276,6 +1307,7 @@ static const struct of_device_id rpm_smd_clk_match_table[] = {
|
||||
{ .compatible = "qcom,rpmcc-msm8998", .data = &rpm_clk_msm8998 },
|
||||
{ .compatible = "qcom,rpmcc-qcm2290", .data = &rpm_clk_qcm2290 },
|
||||
{ .compatible = "qcom,rpmcc-qcs404", .data = &rpm_clk_qcs404 },
|
||||
{ .compatible = "qcom,rpmcc-sdm429", .data = &rpm_clk_sdm429 },
|
||||
{ .compatible = "qcom,rpmcc-sdm660", .data = &rpm_clk_sdm660 },
|
||||
{ .compatible = "qcom,rpmcc-sm6115", .data = &rpm_clk_sm6115 },
|
||||
{ .compatible = "qcom,rpmcc-sm6125", .data = &rpm_clk_sm6125 },
|
||||
|
||||
@@ -22,6 +22,7 @@ struct qcom_cc {
|
||||
struct qcom_reset_controller reset;
|
||||
struct clk_regmap **rclks;
|
||||
size_t num_rclks;
|
||||
struct dev_pm_domain_list *pd_list;
|
||||
};
|
||||
|
||||
const
|
||||
@@ -299,6 +300,10 @@ int qcom_cc_really_probe(struct device *dev,
|
||||
if (!cc)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = devm_pm_domain_attach_list(dev, NULL, &cc->pd_list);
|
||||
if (ret < 0 && ret != -EEXIST)
|
||||
return ret;
|
||||
|
||||
reset = &cc->reset;
|
||||
reset->rcdev.of_node = dev->of_node;
|
||||
reset->rcdev.ops = &qcom_reset_ops;
|
||||
@@ -318,6 +323,7 @@ int qcom_cc_really_probe(struct device *dev,
|
||||
scd->dev = dev;
|
||||
scd->scs = desc->gdscs;
|
||||
scd->num = desc->num_gdscs;
|
||||
scd->pd_list = cc->pd_list;
|
||||
ret = gdsc_register(scd, &reset->rcdev, regmap);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
* Copyright (c) 2021, Linaro Ltd.
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -5,13 +5,12 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/pm_clock.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,dispcc-sc8280xp.h>
|
||||
|
||||
@@ -3114,7 +3113,7 @@ static const struct regmap_config disp_cc_sc8280xp_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc disp0_cc_sc8280xp_desc = {
|
||||
static const struct qcom_cc_desc disp0_cc_sc8280xp_desc = {
|
||||
.config = &disp_cc_sc8280xp_regmap_config,
|
||||
.clks = disp0_cc_sc8280xp_clocks,
|
||||
.num_clks = ARRAY_SIZE(disp0_cc_sc8280xp_clocks),
|
||||
@@ -3124,7 +3123,7 @@ static struct qcom_cc_desc disp0_cc_sc8280xp_desc = {
|
||||
.num_gdscs = ARRAY_SIZE(disp0_cc_sc8280xp_gdscs),
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc disp1_cc_sc8280xp_desc = {
|
||||
static const struct qcom_cc_desc disp1_cc_sc8280xp_desc = {
|
||||
.config = &disp_cc_sc8280xp_regmap_config,
|
||||
.clks = disp1_cc_sc8280xp_clocks,
|
||||
.num_clks = ARRAY_SIZE(disp1_cc_sc8280xp_clocks),
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,dispcc-sdm845.h>
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#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/regmap.h>
|
||||
|
||||
@@ -722,7 +721,7 @@ static const struct regmap_config disp_cc_sm4450_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc disp_cc_sm4450_desc = {
|
||||
static const struct qcom_cc_desc disp_cc_sm4450_desc = {
|
||||
.config = &disp_cc_sm4450_regmap_config,
|
||||
.clks = disp_cc_sm4450_clocks,
|
||||
.num_clks = ARRAY_SIZE(disp_cc_sm4450_clocks),
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
* Copyright (c) 2021, Linaro Ltd.
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,dispcc-sm8250.h>
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
* Copyright (c) 2022, Linaro Ltd.
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
@@ -1780,7 +1779,7 @@ static const struct regmap_config disp_cc_sm8450_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc disp_cc_sm8450_desc = {
|
||||
static const struct qcom_cc_desc disp_cc_sm8450_desc = {
|
||||
.config = &disp_cc_sm8450_regmap_config,
|
||||
.clks = disp_cc_sm8450_clocks,
|
||||
.num_clks = ARRAY_SIZE(disp_cc_sm8450_clocks),
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
* Copyright (c) 2023, Linaro Ltd.
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
@@ -1746,7 +1745,7 @@ static const struct regmap_config disp_cc_sm8550_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc disp_cc_sm8550_desc = {
|
||||
static const struct qcom_cc_desc disp_cc_sm8550_desc = {
|
||||
.config = &disp_cc_sm8550_regmap_config,
|
||||
.clks = disp_cc_sm8550_clocks,
|
||||
.num_clks = ARRAY_SIZE(disp_cc_sm8550_clocks),
|
||||
|
||||
@@ -1883,11 +1883,11 @@ static const struct regmap_config disp_cc_sm8750_regmap_config = {
|
||||
.reg_bits = 32,
|
||||
.reg_stride = 4,
|
||||
.val_bits = 32,
|
||||
.max_register = 0x11014,
|
||||
.max_register = 0xf004, /* 0x10000, 0x10004 and maybe others are for TZ */
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc disp_cc_sm8750_desc = {
|
||||
static const struct qcom_cc_desc disp_cc_sm8750_desc = {
|
||||
.config = &disp_cc_sm8750_regmap_config,
|
||||
.clks = disp_cc_sm8750_clocks,
|
||||
.num_clks = ARRAY_SIZE(disp_cc_sm8750_clocks),
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#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>
|
||||
@@ -1418,7 +1417,7 @@ static const struct regmap_config disp_cc_0_sa8775p_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc disp_cc_0_sa8775p_desc = {
|
||||
static const struct qcom_cc_desc disp_cc_0_sa8775p_desc = {
|
||||
.config = &disp_cc_0_sa8775p_regmap_config,
|
||||
.clks = disp_cc_0_sa8775p_clocks,
|
||||
.num_clks = ARRAY_SIZE(disp_cc_0_sa8775p_clocks),
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#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>
|
||||
@@ -1418,7 +1417,7 @@ static const struct regmap_config disp_cc_1_sa8775p_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc disp_cc_1_sa8775p_desc = {
|
||||
static const struct qcom_cc_desc disp_cc_1_sa8775p_desc = {
|
||||
.config = &disp_cc_1_sa8775p_regmap_config,
|
||||
.clks = disp_cc_1_sa8775p_clocks,
|
||||
.num_clks = ARRAY_SIZE(disp_cc_1_sa8775p_clocks),
|
||||
|
||||
@@ -592,13 +592,19 @@ static struct clk_rcg2 gcc_qupv3_spi1_clk_src = {
|
||||
};
|
||||
|
||||
static const struct freq_tbl ftbl_gcc_qupv3_uart0_clk_src[] = {
|
||||
F(960000, P_XO, 10, 2, 5),
|
||||
F(4800000, P_XO, 5, 0, 0),
|
||||
F(9600000, P_XO, 2, 4, 5),
|
||||
F(16000000, P_GPLL0_OUT_MAIN, 10, 1, 5),
|
||||
F(3686400, P_GCC_GPLL0_OUT_MAIN_DIV_CLK_SRC, 1, 144, 15625),
|
||||
F(7372800, P_GCC_GPLL0_OUT_MAIN_DIV_CLK_SRC, 1, 288, 15625),
|
||||
F(14745600, P_GCC_GPLL0_OUT_MAIN_DIV_CLK_SRC, 1, 576, 15625),
|
||||
F(24000000, P_XO, 1, 0, 0),
|
||||
F(25000000, P_GPLL0_OUT_MAIN, 16, 1, 2),
|
||||
F(50000000, P_GPLL0_OUT_MAIN, 16, 0, 0),
|
||||
F(32000000, P_GPLL0_OUT_MAIN, 1, 1, 25),
|
||||
F(40000000, P_GPLL0_OUT_MAIN, 1, 1, 20),
|
||||
F(46400000, P_GPLL0_OUT_MAIN, 1, 29, 500),
|
||||
F(48000000, P_GPLL0_OUT_MAIN, 1, 3, 50),
|
||||
F(51200000, P_GPLL0_OUT_MAIN, 1, 8, 125),
|
||||
F(56000000, P_GPLL0_OUT_MAIN, 1, 7, 100),
|
||||
F(58982400, P_GPLL0_OUT_MAIN, 1, 1152, 15625),
|
||||
F(60000000, P_GPLL0_OUT_MAIN, 1, 3, 40),
|
||||
F(64000000, P_GPLL0_OUT_MAIN, 12.5, 0, 0),
|
||||
{ }
|
||||
};
|
||||
@@ -634,11 +640,11 @@ static struct clk_rcg2 gcc_qupv3_uart1_clk_src = {
|
||||
static const struct freq_tbl ftbl_gcc_sdcc1_apps_clk_src[] = {
|
||||
F(144000, P_XO, 16, 12, 125),
|
||||
F(400000, P_XO, 12, 1, 5),
|
||||
F(24000000, P_XO, 1, 0, 0),
|
||||
F(48000000, P_GPLL2_OUT_MAIN, 12, 1, 2),
|
||||
F(96000000, P_GPLL2_OUT_MAIN, 6, 1, 2),
|
||||
F(24000000, P_GPLL2_OUT_MAIN, 12, 1, 2),
|
||||
F(48000000, P_GPLL2_OUT_MAIN, 12, 0, 0),
|
||||
F(96000000, P_GPLL2_OUT_MAIN, 6, 0, 0),
|
||||
F(177777778, P_GPLL0_OUT_MAIN, 4.5, 0, 0),
|
||||
F(192000000, P_GPLL2_OUT_MAIN, 6, 0, 0),
|
||||
F(192000000, P_GPLL2_OUT_MAIN, 3, 0, 0),
|
||||
F(200000000, P_GPLL0_OUT_MAIN, 4, 0, 0),
|
||||
{ }
|
||||
};
|
||||
|
||||
@@ -108,6 +108,20 @@ static struct clk_alpha_pll_postdiv gpll0 = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_alpha_pll_postdiv gpll0_out_aux = {
|
||||
.offset = 0x20000,
|
||||
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
|
||||
.width = 4,
|
||||
.clkr.hw.init = &(const struct clk_init_data) {
|
||||
.name = "gpll0_out_aux",
|
||||
.parent_hws = (const struct clk_hw *[]) {
|
||||
&gpll0_main.clkr.hw
|
||||
},
|
||||
.num_parents = 1,
|
||||
.ops = &clk_alpha_pll_postdiv_ro_ops,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_alpha_pll gpll4_main = {
|
||||
.offset = 0x22000,
|
||||
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO],
|
||||
@@ -3896,6 +3910,7 @@ static struct clk_regmap *gcc_ipq9574_clks[] = {
|
||||
[GCC_PCIE1_PIPE_CLK] = &gcc_pcie1_pipe_clk.clkr,
|
||||
[GCC_PCIE2_PIPE_CLK] = &gcc_pcie2_pipe_clk.clkr,
|
||||
[GCC_PCIE3_PIPE_CLK] = &gcc_pcie3_pipe_clk.clkr,
|
||||
[GPLL0_OUT_AUX] = &gpll0_out_aux.clkr,
|
||||
};
|
||||
|
||||
static const struct qcom_reset_map gcc_ipq9574_resets[] = {
|
||||
|
||||
@@ -3770,7 +3770,7 @@ static struct clk_branch gcc_venus0_axi_clk = {
|
||||
|
||||
static struct clk_branch gcc_venus0_core0_vcodec0_clk = {
|
||||
.halt_reg = 0x4c02c,
|
||||
.halt_check = BRANCH_HALT,
|
||||
.halt_check = BRANCH_HALT_SKIP,
|
||||
.clkr = {
|
||||
.enable_reg = 0x4c02c,
|
||||
.enable_mask = BIT(0),
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_platform.h>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/clk-provider.h>
|
||||
|
||||
@@ -2420,6 +2420,8 @@ static struct gdsc *gcc_sdm660_gdscs[] = {
|
||||
static const struct qcom_reset_map gcc_sdm660_resets[] = {
|
||||
[GCC_QUSB2PHY_PRIM_BCR] = { 0x12000 },
|
||||
[GCC_QUSB2PHY_SEC_BCR] = { 0x12004 },
|
||||
[GCC_SDCC2_BCR] = { 0x14000 },
|
||||
[GCC_SDCC1_BCR] = { 0x16000 },
|
||||
[GCC_UFS_BCR] = { 0x75000 },
|
||||
[GCC_USB3_DP_PHY_BCR] = { 0x50028 },
|
||||
[GCC_USB3_PHY_BCR] = { 0x50020 },
|
||||
|
||||
@@ -3497,7 +3497,7 @@ static struct gdsc usb30_prim_gdsc = {
|
||||
.pd = {
|
||||
.name = "usb30_prim_gdsc",
|
||||
},
|
||||
.pwrsts = PWRSTS_OFF_ON,
|
||||
.pwrsts = PWRSTS_RET_ON,
|
||||
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
|
||||
};
|
||||
|
||||
@@ -3506,7 +3506,7 @@ static struct gdsc usb3_phy_gdsc = {
|
||||
.pd = {
|
||||
.name = "usb3_phy_gdsc",
|
||||
},
|
||||
.pwrsts = PWRSTS_OFF_ON,
|
||||
.pwrsts = PWRSTS_RET_ON,
|
||||
.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
|
||||
};
|
||||
|
||||
|
||||
@@ -2564,19 +2564,6 @@ static struct clk_branch gcc_disp_hf_axi_clk = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_branch gcc_disp_xo_clk = {
|
||||
.halt_reg = 0x27018,
|
||||
.halt_check = BRANCH_HALT,
|
||||
.clkr = {
|
||||
.enable_reg = 0x27018,
|
||||
.enable_mask = BIT(0),
|
||||
.hw.init = &(const struct clk_init_data) {
|
||||
.name = "gcc_disp_xo_clk",
|
||||
.ops = &clk_branch2_ops,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_branch gcc_gp1_clk = {
|
||||
.halt_reg = 0x64000,
|
||||
.halt_check = BRANCH_HALT,
|
||||
@@ -2631,21 +2618,6 @@ static struct clk_branch gcc_gp3_clk = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_branch gcc_gpu_cfg_ahb_clk = {
|
||||
.halt_reg = 0x71004,
|
||||
.halt_check = BRANCH_HALT_VOTED,
|
||||
.hwcg_reg = 0x71004,
|
||||
.hwcg_bit = 1,
|
||||
.clkr = {
|
||||
.enable_reg = 0x71004,
|
||||
.enable_mask = BIT(0),
|
||||
.hw.init = &(const struct clk_init_data) {
|
||||
.name = "gcc_gpu_cfg_ahb_clk",
|
||||
.ops = &clk_branch2_ops,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_branch gcc_gpu_gpll0_cph_clk_src = {
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
@@ -6268,7 +6240,6 @@ static struct clk_regmap *gcc_x1e80100_clocks[] = {
|
||||
[GCC_CNOC_PCIE_TUNNEL_CLK] = &gcc_cnoc_pcie_tunnel_clk.clkr,
|
||||
[GCC_DDRSS_GPU_AXI_CLK] = &gcc_ddrss_gpu_axi_clk.clkr,
|
||||
[GCC_DISP_HF_AXI_CLK] = &gcc_disp_hf_axi_clk.clkr,
|
||||
[GCC_DISP_XO_CLK] = &gcc_disp_xo_clk.clkr,
|
||||
[GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
|
||||
[GCC_GP1_CLK_SRC] = &gcc_gp1_clk_src.clkr,
|
||||
[GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
|
||||
@@ -6281,7 +6252,6 @@ static struct clk_regmap *gcc_x1e80100_clocks[] = {
|
||||
[GCC_GPLL7] = &gcc_gpll7.clkr,
|
||||
[GCC_GPLL8] = &gcc_gpll8.clkr,
|
||||
[GCC_GPLL9] = &gcc_gpll9.clkr,
|
||||
[GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr,
|
||||
[GCC_GPU_GPLL0_CPH_CLK_SRC] = &gcc_gpu_gpll0_cph_clk_src.clkr,
|
||||
[GCC_GPU_GPLL0_DIV_CPH_CLK_SRC] = &gcc_gpu_gpll0_div_cph_clk_src.clkr,
|
||||
[GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr,
|
||||
|
||||
+74
-24
@@ -46,7 +46,7 @@
|
||||
#define RETAIN_MEM BIT(14)
|
||||
#define RETAIN_PERIPH BIT(13)
|
||||
|
||||
#define STATUS_POLL_TIMEOUT_US 1500
|
||||
#define STATUS_POLL_TIMEOUT_US 2000
|
||||
#define TIMEOUT_US 500
|
||||
|
||||
#define domain_to_gdsc(domain) container_of(domain, struct gdsc, pd)
|
||||
@@ -292,6 +292,9 @@ static int gdsc_enable(struct generic_pm_domain *domain)
|
||||
*/
|
||||
udelay(1);
|
||||
|
||||
if (sc->flags & RETAIN_FF_ENABLE)
|
||||
gdsc_retain_ff_on(sc);
|
||||
|
||||
/* Turn on HW trigger mode if supported */
|
||||
if (sc->flags & HW_CTRL) {
|
||||
ret = gdsc_hwctrl(sc, true);
|
||||
@@ -308,9 +311,6 @@ static int gdsc_enable(struct generic_pm_domain *domain)
|
||||
udelay(1);
|
||||
}
|
||||
|
||||
if (sc->flags & RETAIN_FF_ENABLE)
|
||||
gdsc_retain_ff_on(sc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -457,13 +457,6 @@ static int gdsc_init(struct gdsc *sc)
|
||||
goto err_disable_supply;
|
||||
}
|
||||
|
||||
/* Turn on HW trigger mode if supported */
|
||||
if (sc->flags & HW_CTRL) {
|
||||
ret = gdsc_hwctrl(sc, true);
|
||||
if (ret < 0)
|
||||
goto err_disable_supply;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure the retain bit is set if the GDSC is already on,
|
||||
* otherwise we end up turning off the GDSC and destroying all
|
||||
@@ -471,6 +464,14 @@ static int gdsc_init(struct gdsc *sc)
|
||||
*/
|
||||
if (sc->flags & RETAIN_FF_ENABLE)
|
||||
gdsc_retain_ff_on(sc);
|
||||
|
||||
/* Turn on HW trigger mode if supported */
|
||||
if (sc->flags & HW_CTRL) {
|
||||
ret = gdsc_hwctrl(sc, true);
|
||||
if (ret < 0)
|
||||
goto err_disable_supply;
|
||||
}
|
||||
|
||||
} else if (sc->flags & ALWAYS_ON) {
|
||||
/* If ALWAYS_ON GDSCs are not ON, turn them ON */
|
||||
gdsc_enable(&sc->pd);
|
||||
@@ -506,6 +507,55 @@ err_disable_supply:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int gdsc_add_subdomain_list(struct dev_pm_domain_list *pd_list,
|
||||
struct generic_pm_domain *subdomain)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; i < pd_list->num_pds; i++) {
|
||||
struct device *dev = pd_list->pd_devs[i];
|
||||
struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
|
||||
|
||||
ret = pm_genpd_add_subdomain(genpd, subdomain);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gdsc_remove_subdomain_list(struct dev_pm_domain_list *pd_list,
|
||||
struct generic_pm_domain *subdomain)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < pd_list->num_pds; i++) {
|
||||
struct device *dev = pd_list->pd_devs[i];
|
||||
struct generic_pm_domain *genpd = pd_to_genpd(dev->pm_domain);
|
||||
|
||||
pm_genpd_remove_subdomain(genpd, subdomain);
|
||||
}
|
||||
}
|
||||
|
||||
static void gdsc_pm_subdomain_remove(struct gdsc_desc *desc, size_t num)
|
||||
{
|
||||
struct device *dev = desc->dev;
|
||||
struct gdsc **scs = desc->scs;
|
||||
int i;
|
||||
|
||||
/* Remove subdomains */
|
||||
for (i = num - 1; i >= 0; i--) {
|
||||
if (!scs[i])
|
||||
continue;
|
||||
if (scs[i]->parent)
|
||||
pm_genpd_remove_subdomain(scs[i]->parent, &scs[i]->pd);
|
||||
else if (!IS_ERR_OR_NULL(dev->pm_domain))
|
||||
pm_genpd_remove_subdomain(pd_to_genpd(dev->pm_domain), &scs[i]->pd);
|
||||
else if (desc->pd_list)
|
||||
gdsc_remove_subdomain_list(desc->pd_list, &scs[i]->pd);
|
||||
}
|
||||
}
|
||||
|
||||
int gdsc_register(struct gdsc_desc *desc,
|
||||
struct reset_controller_dev *rcdev, struct regmap *regmap)
|
||||
{
|
||||
@@ -555,30 +605,30 @@ int gdsc_register(struct gdsc_desc *desc,
|
||||
if (!scs[i])
|
||||
continue;
|
||||
if (scs[i]->parent)
|
||||
pm_genpd_add_subdomain(scs[i]->parent, &scs[i]->pd);
|
||||
ret = pm_genpd_add_subdomain(scs[i]->parent, &scs[i]->pd);
|
||||
else if (!IS_ERR_OR_NULL(dev->pm_domain))
|
||||
pm_genpd_add_subdomain(pd_to_genpd(dev->pm_domain), &scs[i]->pd);
|
||||
ret = pm_genpd_add_subdomain(pd_to_genpd(dev->pm_domain), &scs[i]->pd);
|
||||
else if (desc->pd_list)
|
||||
ret = gdsc_add_subdomain_list(desc->pd_list, &scs[i]->pd);
|
||||
|
||||
if (ret)
|
||||
goto err_pm_subdomain_remove;
|
||||
}
|
||||
|
||||
return of_genpd_add_provider_onecell(dev->of_node, data);
|
||||
|
||||
err_pm_subdomain_remove:
|
||||
gdsc_pm_subdomain_remove(desc, i);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void gdsc_unregister(struct gdsc_desc *desc)
|
||||
{
|
||||
int i;
|
||||
struct device *dev = desc->dev;
|
||||
struct gdsc **scs = desc->scs;
|
||||
size_t num = desc->num;
|
||||
|
||||
/* Remove subdomains */
|
||||
for (i = 0; i < num; i++) {
|
||||
if (!scs[i])
|
||||
continue;
|
||||
if (scs[i]->parent)
|
||||
pm_genpd_remove_subdomain(scs[i]->parent, &scs[i]->pd);
|
||||
else if (!IS_ERR_OR_NULL(dev->pm_domain))
|
||||
pm_genpd_remove_subdomain(pd_to_genpd(dev->pm_domain), &scs[i]->pd);
|
||||
}
|
||||
gdsc_pm_subdomain_remove(desc, num);
|
||||
of_genpd_del_provider(dev->of_node);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ struct gdsc_desc {
|
||||
struct device *dev;
|
||||
struct gdsc **scs;
|
||||
size_t num;
|
||||
struct dev_pm_domain_list *pd_list;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_QCOM_GDSC
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,gpucc-msm8998.h>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,sa8775p-gpucc.h>
|
||||
#include <dt-bindings/clock/qcom,qcs8300-gpucc.h>
|
||||
|
||||
#include "clk-alpha-pll.h"
|
||||
#include "clk-branch.h"
|
||||
@@ -317,6 +317,24 @@ static struct clk_branch gpu_cc_crc_ahb_clk = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_branch gpu_cc_cx_accu_shift_clk = {
|
||||
.halt_reg = 0x95e8,
|
||||
.halt_check = BRANCH_HALT,
|
||||
.clkr = {
|
||||
.enable_reg = 0x95e8,
|
||||
.enable_mask = BIT(0),
|
||||
.hw.init = &(const struct clk_init_data){
|
||||
.name = "gpu_cc_cx_accu_shift_clk",
|
||||
.parent_hws = (const struct clk_hw*[]){
|
||||
&gpu_cc_xo_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,
|
||||
@@ -420,6 +438,24 @@ static struct clk_branch gpu_cc_demet_clk = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_branch gpu_cc_gx_accu_shift_clk = {
|
||||
.halt_reg = 0x95e4,
|
||||
.halt_check = BRANCH_HALT,
|
||||
.clkr = {
|
||||
.enable_reg = 0x95e4,
|
||||
.enable_mask = BIT(0),
|
||||
.hw.init = &(const struct clk_init_data){
|
||||
.name = "gpu_cc_gx_accu_shift_clk",
|
||||
.parent_hws = (const struct clk_hw*[]){
|
||||
&gpu_cc_xo_clk_src.clkr.hw,
|
||||
},
|
||||
.num_parents = 1,
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_branch2_ops,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk_branch gpu_cc_hlos1_vote_gpu_smmu_clk = {
|
||||
.halt_reg = 0x7000,
|
||||
.halt_check = BRANCH_HALT_VOTED,
|
||||
@@ -499,6 +535,7 @@ static struct clk_regmap *gpu_cc_sa8775p_clocks[] = {
|
||||
[GPU_CC_AHB_CLK] = &gpu_cc_ahb_clk.clkr,
|
||||
[GPU_CC_CB_CLK] = &gpu_cc_cb_clk.clkr,
|
||||
[GPU_CC_CRC_AHB_CLK] = &gpu_cc_crc_ahb_clk.clkr,
|
||||
[GPU_CC_CX_ACCU_SHIFT_CLK] = NULL,
|
||||
[GPU_CC_CX_FF_CLK] = &gpu_cc_cx_ff_clk.clkr,
|
||||
[GPU_CC_CX_GMU_CLK] = &gpu_cc_cx_gmu_clk.clkr,
|
||||
[GPU_CC_CX_SNOC_DVM_CLK] = &gpu_cc_cx_snoc_dvm_clk.clkr,
|
||||
@@ -508,6 +545,7 @@ static struct clk_regmap *gpu_cc_sa8775p_clocks[] = {
|
||||
[GPU_CC_DEMET_DIV_CLK_SRC] = &gpu_cc_demet_div_clk_src.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_ACCU_SHIFT_CLK] = NULL,
|
||||
[GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK] = &gpu_cc_hlos1_vote_gpu_smmu_clk.clkr,
|
||||
[GPU_CC_HUB_AHB_DIV_CLK_SRC] = &gpu_cc_hub_ahb_div_clk_src.clkr,
|
||||
[GPU_CC_HUB_AON_CLK] = &gpu_cc_hub_aon_clk.clkr,
|
||||
@@ -583,6 +621,7 @@ static const struct qcom_cc_desc gpu_cc_sa8775p_desc = {
|
||||
};
|
||||
|
||||
static const struct of_device_id gpu_cc_sa8775p_match_table[] = {
|
||||
{ .compatible = "qcom,qcs8300-gpucc" },
|
||||
{ .compatible = "qcom,sa8775p-gpucc" },
|
||||
{ }
|
||||
};
|
||||
@@ -596,6 +635,14 @@ static int gpu_cc_sa8775p_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(regmap))
|
||||
return PTR_ERR(regmap);
|
||||
|
||||
if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcs8300-gpucc")) {
|
||||
gpu_cc_pll0_config.l = 0x31;
|
||||
gpu_cc_pll0_config.alpha = 0xe555;
|
||||
|
||||
gpu_cc_sa8775p_clocks[GPU_CC_CX_ACCU_SHIFT_CLK] = &gpu_cc_cx_accu_shift_clk.clkr;
|
||||
gpu_cc_sa8775p_clocks[GPU_CC_GX_ACCU_SHIFT_CLK] = &gpu_cc_gx_accu_shift_clk.clkr;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
@@ -415,7 +416,7 @@ static const struct regmap_config gpu_cc_sc8280xp_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc gpu_cc_sc8280xp_desc = {
|
||||
static const struct qcom_cc_desc gpu_cc_sc8280xp_desc = {
|
||||
.config = &gpu_cc_sc8280xp_regmap_config,
|
||||
.clks = gpu_cc_sc8280xp_clocks,
|
||||
.num_clks = ARRAY_SIZE(gpu_cc_sc8280xp_clocks),
|
||||
|
||||
@@ -6,15 +6,14 @@
|
||||
*/
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,gpucc-sdm660.h>
|
||||
|
||||
#include "clk-alpha-pll.h"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#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/regmap.h>
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#include <linux/clk.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
|
||||
@@ -523,7 +523,7 @@ static const struct regmap_config gpu_cc_x1p42100_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc gpu_cc_x1p42100_desc = {
|
||||
static const struct qcom_cc_desc gpu_cc_x1p42100_desc = {
|
||||
.config = &gpu_cc_x1p42100_regmap_config,
|
||||
.clks = gpu_cc_x1p42100_clocks,
|
||||
.num_clks = ARRAY_SIZE(gpu_cc_x1p42100_clocks),
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
@@ -713,14 +714,24 @@ static const struct qcom_reset_map lpass_audio_cc_sc7280_resets[] = {
|
||||
[LPASS_AUDIO_SWR_WSA_CGCR] = { 0xb0, 1 },
|
||||
};
|
||||
|
||||
static const struct regmap_config lpass_audio_cc_sc7280_reset_regmap_config = {
|
||||
.name = "lpassaudio_cc_reset",
|
||||
.reg_bits = 32,
|
||||
.reg_stride = 4,
|
||||
.val_bits = 32,
|
||||
.fast_io = true,
|
||||
.max_register = 0xc8,
|
||||
};
|
||||
|
||||
static const struct qcom_cc_desc lpass_audio_cc_reset_sc7280_desc = {
|
||||
.config = &lpass_audio_cc_sc7280_regmap_config,
|
||||
.config = &lpass_audio_cc_sc7280_reset_regmap_config,
|
||||
.resets = lpass_audio_cc_sc7280_resets,
|
||||
.num_resets = ARRAY_SIZE(lpass_audio_cc_sc7280_resets),
|
||||
};
|
||||
|
||||
static const struct of_device_id lpass_audio_cc_sc7280_match_table[] = {
|
||||
{ .compatible = "qcom,sc7280-lpassaudiocc" },
|
||||
{ .compatible = "qcom,qcm6490-lpassaudiocc", .data = &lpass_audio_cc_reset_sc7280_desc },
|
||||
{ .compatible = "qcom,sc7280-lpassaudiocc", .data = &lpass_audio_cc_sc7280_desc },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, lpass_audio_cc_sc7280_match_table);
|
||||
@@ -752,13 +763,17 @@ static int lpass_audio_cc_sc7280_probe(struct platform_device *pdev)
|
||||
struct regmap *regmap;
|
||||
int ret;
|
||||
|
||||
desc = device_get_match_data(&pdev->dev);
|
||||
|
||||
if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcm6490-lpassaudiocc"))
|
||||
return qcom_cc_probe_by_index(pdev, 1, desc);
|
||||
|
||||
ret = lpass_audio_setup_runtime_pm(pdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
lpass_audio_cc_sc7280_regmap_config.name = "lpassaudio_cc";
|
||||
lpass_audio_cc_sc7280_regmap_config.max_register = 0x2f000;
|
||||
desc = &lpass_audio_cc_sc7280_desc;
|
||||
|
||||
regmap = qcom_cc_map(pdev, desc);
|
||||
if (IS_ERR(regmap)) {
|
||||
@@ -772,7 +787,7 @@ static int lpass_audio_cc_sc7280_probe(struct platform_device *pdev)
|
||||
regmap_write(regmap, 0x4, 0x3b);
|
||||
regmap_write(regmap, 0x8, 0xff05);
|
||||
|
||||
ret = qcom_cc_really_probe(&pdev->dev, &lpass_audio_cc_sc7280_desc, regmap);
|
||||
ret = qcom_cc_really_probe(&pdev->dev, desc, regmap);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to register LPASS AUDIO CC clocks\n");
|
||||
goto exit;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,lpass-sdm845.h>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_clock.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,lpasscorecc-sc7180.h>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_clock.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,mmcc-apq8084.h>
|
||||
#include <dt-bindings/reset/qcom,mmcc-apq8084.h>
|
||||
|
||||
@@ -8,13 +8,11 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,mmcc-msm8960.h>
|
||||
#include <dt-bindings/reset/qcom,mmcc-msm8960.h>
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,mmcc-msm8974.h>
|
||||
#include <dt-bindings/reset/qcom,mmcc-msm8974.h>
|
||||
|
||||
@@ -7,12 +7,11 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
#include <linux/clk.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,mmcc-msm8994.h>
|
||||
|
||||
|
||||
@@ -7,12 +7,10 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
#include <linux/clk.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,mmcc-msm8996.h>
|
||||
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
|
||||
#include <dt-bindings/clock/qcom,mmcc-msm8998.h>
|
||||
|
||||
|
||||
@@ -9,14 +9,10 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/reset-controller.h>
|
||||
#include <linux/clk.h>
|
||||
|
||||
|
||||
#include <dt-bindings/clock/qcom,mmcc-sdm660.h>
|
||||
|
||||
@@ -2544,7 +2540,7 @@ static struct clk_branch video_core_clk = {
|
||||
|
||||
static struct clk_branch video_subcore0_clk = {
|
||||
.halt_reg = 0x1048,
|
||||
.halt_check = BRANCH_HALT,
|
||||
.halt_check = BRANCH_HALT_SKIP,
|
||||
.clkr = {
|
||||
.enable_reg = 0x1048,
|
||||
.enable_mask = BIT(0),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -512,7 +512,7 @@ static const struct regmap_config video_cc_sa8775p_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc video_cc_sa8775p_desc = {
|
||||
static const 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),
|
||||
@@ -523,6 +523,7 @@ static struct qcom_cc_desc video_cc_sa8775p_desc = {
|
||||
};
|
||||
|
||||
static const struct of_device_id video_cc_sa8775p_match_table[] = {
|
||||
{ .compatible = "qcom,qcs8300-videocc" },
|
||||
{ .compatible = "qcom,sa8775p-videocc" },
|
||||
{ }
|
||||
};
|
||||
@@ -550,6 +551,13 @@ static int video_cc_sa8775p_probe(struct platform_device *pdev)
|
||||
clk_lucid_evo_pll_configure(&video_pll0, regmap, &video_pll0_config);
|
||||
clk_lucid_evo_pll_configure(&video_pll1, regmap, &video_pll1_config);
|
||||
|
||||
/*
|
||||
* Set mvs0c clock divider to div-3 to make the mvs0 and
|
||||
* mvs0c clocks to run at the same frequency on QCS8300
|
||||
*/
|
||||
if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcs8300-videocc"))
|
||||
regmap_write(regmap, video_cc_mvs0c_div2_div_clk_src.reg, 2);
|
||||
|
||||
/* 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 */
|
||||
|
||||
@@ -510,7 +510,7 @@ static const struct regmap_config video_cc_sm8350_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc video_cc_sm8350_desc = {
|
||||
static const struct qcom_cc_desc video_cc_sm8350_desc = {
|
||||
.config = &video_cc_sm8350_regmap_config,
|
||||
.clks = video_cc_sm8350_clocks,
|
||||
.num_clks = ARRAY_SIZE(video_cc_sm8350_clocks),
|
||||
|
||||
@@ -415,7 +415,7 @@ static const struct regmap_config video_cc_sm8450_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc video_cc_sm8450_desc = {
|
||||
static const struct qcom_cc_desc video_cc_sm8450_desc = {
|
||||
.config = &video_cc_sm8450_regmap_config,
|
||||
.clks = video_cc_sm8450_clocks,
|
||||
.num_clks = ARRAY_SIZE(video_cc_sm8450_clocks),
|
||||
|
||||
@@ -519,7 +519,7 @@ static const struct regmap_config video_cc_sm8550_regmap_config = {
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static struct qcom_cc_desc video_cc_sm8550_desc = {
|
||||
static const struct qcom_cc_desc video_cc_sm8550_desc = {
|
||||
.config = &video_cc_sm8550_regmap_config,
|
||||
.clks = video_cc_sm8550_clocks,
|
||||
.num_clks = ARRAY_SIZE(video_cc_sm8550_clocks),
|
||||
|
||||
@@ -52,6 +52,16 @@ config SUN50I_H6_R_CCU
|
||||
default y
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
|
||||
config SUN55I_A523_CCU
|
||||
tristate "Support for the Allwinner A523/T527 CCU"
|
||||
default y
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
|
||||
config SUN55I_A523_R_CCU
|
||||
tristate "Support for the Allwinner A523/T527 PRCM CCU"
|
||||
default y
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
|
||||
config SUN4I_A10_CCU
|
||||
tristate "Support for the Allwinner A10/A20 CCU"
|
||||
default y
|
||||
|
||||
@@ -33,6 +33,8 @@ obj-$(CONFIG_SUN50I_A100_R_CCU) += sun50i-a100-r-ccu.o
|
||||
obj-$(CONFIG_SUN50I_H6_CCU) += sun50i-h6-ccu.o
|
||||
obj-$(CONFIG_SUN50I_H6_R_CCU) += sun50i-h6-r-ccu.o
|
||||
obj-$(CONFIG_SUN50I_H616_CCU) += sun50i-h616-ccu.o
|
||||
obj-$(CONFIG_SUN55I_A523_CCU) += sun55i-a523-ccu.o
|
||||
obj-$(CONFIG_SUN55I_A523_R_CCU) += sun55i-a523-r-ccu.o
|
||||
obj-$(CONFIG_SUN4I_A10_CCU) += sun4i-a10-ccu.o
|
||||
obj-$(CONFIG_SUN5I_CCU) += sun5i-ccu.o
|
||||
obj-$(CONFIG_SUN6I_A31_CCU) += sun6i-a31-ccu.o
|
||||
@@ -58,6 +60,8 @@ sun50i-a100-r-ccu-y += ccu-sun50i-a100-r.o
|
||||
sun50i-h6-ccu-y += ccu-sun50i-h6.o
|
||||
sun50i-h6-r-ccu-y += ccu-sun50i-h6-r.o
|
||||
sun50i-h616-ccu-y += ccu-sun50i-h616.o
|
||||
sun55i-a523-ccu-y += ccu-sun55i-a523.o
|
||||
sun55i-a523-r-ccu-y += ccu-sun55i-a523-r.o
|
||||
sun4i-a10-ccu-y += ccu-sun4i-a10.o
|
||||
sun5i-ccu-y += ccu-sun5i.o
|
||||
sun6i-a31-ccu-y += ccu-sun6i-a31.o
|
||||
|
||||
@@ -328,10 +328,16 @@ static SUNXI_CCU_M_WITH_MUX_GATE(gpu0_clk, "gpu0", gpu0_parents, 0x670,
|
||||
24, 1, /* mux */
|
||||
BIT(31), /* gate */
|
||||
CLK_SET_RATE_PARENT);
|
||||
|
||||
/*
|
||||
* This clk is needed as a temporary fall back during GPU PLL freq changes.
|
||||
* Set CLK_IS_CRITICAL flag to prevent from being disabled.
|
||||
*/
|
||||
#define SUN50I_H616_GPU_CLK1_REG 0x674
|
||||
static SUNXI_CCU_M_WITH_GATE(gpu1_clk, "gpu1", "pll-periph0-2x", 0x674,
|
||||
0, 2, /* M */
|
||||
BIT(31),/* gate */
|
||||
0);
|
||||
CLK_IS_CRITICAL);
|
||||
|
||||
static SUNXI_CCU_GATE(bus_gpu_clk, "bus-gpu", "psi-ahb1-ahb2",
|
||||
0x67c, BIT(0), 0);
|
||||
@@ -645,6 +651,20 @@ static const char * const tcon_tv_parents[] = { "pll-video0",
|
||||
"pll-video0-4x",
|
||||
"pll-video1",
|
||||
"pll-video1-4x" };
|
||||
static SUNXI_CCU_MUX_WITH_GATE(tcon_lcd0_clk, "tcon-lcd0",
|
||||
tcon_tv_parents, 0xb60,
|
||||
24, 3, /* mux */
|
||||
BIT(31), /* gate */
|
||||
CLK_SET_RATE_PARENT);
|
||||
static SUNXI_CCU_MUX_WITH_GATE(tcon_lcd1_clk, "tcon-lcd1",
|
||||
tcon_tv_parents, 0xb64,
|
||||
24, 3, /* mux */
|
||||
BIT(31), /* gate */
|
||||
CLK_SET_RATE_PARENT);
|
||||
static SUNXI_CCU_GATE(bus_tcon_lcd0_clk, "bus-tcon-lcd0", "ahb3",
|
||||
0xb7c, BIT(0), 0);
|
||||
static SUNXI_CCU_GATE(bus_tcon_lcd1_clk, "bus-tcon-lcd1", "ahb3",
|
||||
0xb7c, BIT(1), 0);
|
||||
static SUNXI_CCU_MP_WITH_MUX_GATE(tcon_tv0_clk, "tcon-tv0",
|
||||
tcon_tv_parents, 0xb80,
|
||||
0, 4, /* M */
|
||||
@@ -855,8 +875,12 @@ static struct ccu_common *sun50i_h616_ccu_clks[] = {
|
||||
&hdmi_cec_clk.common,
|
||||
&bus_hdmi_clk.common,
|
||||
&bus_tcon_top_clk.common,
|
||||
&tcon_lcd0_clk.common,
|
||||
&tcon_lcd1_clk.common,
|
||||
&tcon_tv0_clk.common,
|
||||
&tcon_tv1_clk.common,
|
||||
&bus_tcon_lcd0_clk.common,
|
||||
&bus_tcon_lcd1_clk.common,
|
||||
&bus_tcon_tv0_clk.common,
|
||||
&bus_tcon_tv1_clk.common,
|
||||
&tve0_clk.common,
|
||||
@@ -989,8 +1013,12 @@ static struct clk_hw_onecell_data sun50i_h616_hw_clks = {
|
||||
[CLK_HDMI_CEC] = &hdmi_cec_clk.common.hw,
|
||||
[CLK_BUS_HDMI] = &bus_hdmi_clk.common.hw,
|
||||
[CLK_BUS_TCON_TOP] = &bus_tcon_top_clk.common.hw,
|
||||
[CLK_TCON_LCD0] = &tcon_lcd0_clk.common.hw,
|
||||
[CLK_TCON_LCD1] = &tcon_lcd1_clk.common.hw,
|
||||
[CLK_TCON_TV0] = &tcon_tv0_clk.common.hw,
|
||||
[CLK_TCON_TV1] = &tcon_tv1_clk.common.hw,
|
||||
[CLK_BUS_TCON_LCD0] = &bus_tcon_lcd0_clk.common.hw,
|
||||
[CLK_BUS_TCON_LCD1] = &bus_tcon_lcd1_clk.common.hw,
|
||||
[CLK_BUS_TCON_TV0] = &bus_tcon_tv0_clk.common.hw,
|
||||
[CLK_BUS_TCON_TV1] = &bus_tcon_tv1_clk.common.hw,
|
||||
[CLK_TVE0] = &tve0_clk.common.hw,
|
||||
@@ -1062,6 +1090,8 @@ static const struct ccu_reset_map sun50i_h616_ccu_resets[] = {
|
||||
[RST_BUS_HDMI] = { 0xb1c, BIT(16) },
|
||||
[RST_BUS_HDMI_SUB] = { 0xb1c, BIT(17) },
|
||||
[RST_BUS_TCON_TOP] = { 0xb5c, BIT(16) },
|
||||
[RST_BUS_TCON_LCD0] = { 0xb7c, BIT(16) },
|
||||
[RST_BUS_TCON_LCD1] = { 0xb7c, BIT(17) },
|
||||
[RST_BUS_TCON_TV0] = { 0xb9c, BIT(16) },
|
||||
[RST_BUS_TCON_TV1] = { 0xb9c, BIT(17) },
|
||||
[RST_BUS_TVE_TOP] = { 0xbbc, BIT(16) },
|
||||
@@ -1120,6 +1150,19 @@ static struct ccu_pll_nb sun50i_h616_pll_cpu_nb = {
|
||||
.lock = BIT(28),
|
||||
};
|
||||
|
||||
static struct ccu_mux_nb sun50i_h616_gpu_nb = {
|
||||
.common = &gpu0_clk.common,
|
||||
.cm = &gpu0_clk.mux,
|
||||
.delay_us = 1, /* manual doesn't really say */
|
||||
.bypass_index = 1, /* GPU_CLK1@400MHz */
|
||||
};
|
||||
|
||||
static struct ccu_pll_nb sun50i_h616_pll_gpu_nb = {
|
||||
.common = &pll_gpu_clk.common,
|
||||
.enable = BIT(29), /* LOCK_ENABLE */
|
||||
.lock = BIT(28),
|
||||
};
|
||||
|
||||
static int sun50i_h616_ccu_probe(struct platform_device *pdev)
|
||||
{
|
||||
void __iomem *reg;
|
||||
@@ -1170,6 +1213,14 @@ static int sun50i_h616_ccu_probe(struct platform_device *pdev)
|
||||
val |= BIT(0);
|
||||
writel(val, reg + SUN50I_H616_PLL_AUDIO_REG);
|
||||
|
||||
/*
|
||||
* Set the input-divider for the gpu1 clock to 3, to reach a safe 400 MHz.
|
||||
*/
|
||||
val = readl(reg + SUN50I_H616_GPU_CLK1_REG);
|
||||
val &= ~GENMASK(1, 0);
|
||||
val |= 2;
|
||||
writel(val, reg + SUN50I_H616_GPU_CLK1_REG);
|
||||
|
||||
/*
|
||||
* First clock parent (osc32K) is unusable for CEC. But since there
|
||||
* is no good way to force parent switch (both run with same frequency),
|
||||
@@ -1190,6 +1241,13 @@ static int sun50i_h616_ccu_probe(struct platform_device *pdev)
|
||||
/* Re-lock the CPU PLL after any rate changes */
|
||||
ccu_pll_notifier_register(&sun50i_h616_pll_cpu_nb);
|
||||
|
||||
/* Reparent GPU during GPU PLL rate changes */
|
||||
ccu_mux_notifier_register(pll_gpu_clk.common.hw.clk,
|
||||
&sun50i_h616_gpu_nb);
|
||||
|
||||
/* Re-lock the GPU PLL after any rate changes */
|
||||
ccu_pll_notifier_register(&sun50i_h616_pll_gpu_nb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,6 @@
|
||||
|
||||
#define CLK_BUS_DRAM 56
|
||||
|
||||
#define CLK_NUMBER (CLK_BUS_GPADC + 1)
|
||||
#define CLK_NUMBER (CLK_BUS_TCON_LCD1 + 1)
|
||||
|
||||
#endif /* _CCU_SUN50I_H616_H_ */
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2024 Arm Ltd.
|
||||
* Based on the D1 CCU driver:
|
||||
* Copyright (c) 2020 huangzhenwei@allwinnertech.com
|
||||
* Copyright (C) 2021 Samuel Holland <samuel@sholland.org>
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include "ccu_common.h"
|
||||
#include "ccu_reset.h"
|
||||
|
||||
#include "ccu_gate.h"
|
||||
#include "ccu_mp.h"
|
||||
|
||||
#include "ccu-sun55i-a523-r.h"
|
||||
|
||||
static const struct clk_parent_data r_ahb_apb_parents[] = {
|
||||
{ .fw_name = "hosc" },
|
||||
{ .fw_name = "losc" },
|
||||
{ .fw_name = "iosc" },
|
||||
{ .fw_name = "pll-periph" },
|
||||
{ .fw_name = "pll-audio" },
|
||||
};
|
||||
static SUNXI_CCU_M_DATA_WITH_MUX(r_ahb_clk, "r-ahb",
|
||||
r_ahb_apb_parents, 0x000,
|
||||
0, 5, /* M */
|
||||
24, 3, /* mux */
|
||||
0);
|
||||
|
||||
static SUNXI_CCU_M_DATA_WITH_MUX(r_apb0_clk, "r-apb0",
|
||||
r_ahb_apb_parents, 0x00c,
|
||||
0, 5, /* M */
|
||||
24, 3, /* mux */
|
||||
0);
|
||||
|
||||
static SUNXI_CCU_M_DATA_WITH_MUX(r_apb1_clk, "r-apb1",
|
||||
r_ahb_apb_parents, 0x010,
|
||||
0, 5, /* M */
|
||||
24, 3, /* mux */
|
||||
0);
|
||||
|
||||
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(r_cpu_timer0, "r-timer0",
|
||||
r_ahb_apb_parents, 0x100,
|
||||
0, 0, /* no M */
|
||||
1, 3, /* P */
|
||||
4, 3, /* mux */
|
||||
BIT(0),
|
||||
0);
|
||||
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(r_cpu_timer1, "r-timer1",
|
||||
r_ahb_apb_parents, 0x104,
|
||||
0, 0, /* no M */
|
||||
1, 3, /* P */
|
||||
4, 3, /* mux */
|
||||
BIT(0),
|
||||
0);
|
||||
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(r_cpu_timer2, "r-timer2",
|
||||
r_ahb_apb_parents, 0x108,
|
||||
0, 0, /* no M */
|
||||
1, 3, /* P */
|
||||
4, 3, /* mux */
|
||||
BIT(0),
|
||||
0);
|
||||
|
||||
static SUNXI_CCU_GATE_HW(bus_r_timer_clk, "bus-r-timer", &r_ahb_clk.common.hw,
|
||||
0x11c, BIT(0), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_twd_clk, "bus-r-twd", &r_apb0_clk.common.hw,
|
||||
0x12c, BIT(0), 0);
|
||||
|
||||
static const struct clk_parent_data r_pwmctrl_parents[] = {
|
||||
{ .fw_name = "hosc" },
|
||||
{ .fw_name = "losc" },
|
||||
{ .fw_name = "iosc" },
|
||||
};
|
||||
static SUNXI_CCU_MUX_DATA_WITH_GATE(r_pwmctrl_clk, "r-pwmctrl",
|
||||
r_pwmctrl_parents, 0x130,
|
||||
24, 2, /* mux */
|
||||
BIT(31),
|
||||
0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_pwmctrl_clk, "bus-r-pwmctrl",
|
||||
&r_apb0_clk.common.hw, 0x13c, BIT(0), 0);
|
||||
|
||||
/* SPI clock is /M/N (same as new MMC?) */
|
||||
static SUNXI_CCU_GATE_HW(bus_r_spi_clk, "bus-r-spi",
|
||||
&r_ahb_clk.common.hw, 0x15c, BIT(0), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_spinlock_clk, "bus-r-spinlock",
|
||||
&r_ahb_clk.common.hw, 0x16c, BIT(0), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_msgbox_clk, "bus-r-msgbox",
|
||||
&r_ahb_clk.common.hw, 0x17c, BIT(0), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_uart0_clk, "bus-r-uart0",
|
||||
&r_apb1_clk.common.hw, 0x18c, BIT(0), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_uart1_clk, "bus-r-uart1",
|
||||
&r_apb1_clk.common.hw, 0x18c, BIT(1), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_i2c0_clk, "bus-r-i2c0",
|
||||
&r_apb1_clk.common.hw, 0x19c, BIT(0), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_i2c1_clk, "bus-r-i2c1",
|
||||
&r_apb1_clk.common.hw, 0x19c, BIT(1), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_i2c2_clk, "bus-r-i2c2",
|
||||
&r_apb1_clk.common.hw, 0x19c, BIT(2), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_ppu0_clk, "bus-r-ppu0",
|
||||
&r_apb0_clk.common.hw, 0x1ac, BIT(0), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_ppu1_clk, "bus-r-ppu1",
|
||||
&r_apb0_clk.common.hw, 0x1ac, BIT(1), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_cpu_bist_clk, "bus-r-cpu-bist",
|
||||
&r_apb0_clk.common.hw, 0x1bc, BIT(0), 0);
|
||||
|
||||
static const struct clk_parent_data r_ir_rx_parents[] = {
|
||||
{ .fw_name = "losc" },
|
||||
{ .fw_name = "hosc" },
|
||||
};
|
||||
static SUNXI_CCU_M_DATA_WITH_MUX_GATE(r_ir_rx_clk, "r-ir-rx",
|
||||
r_ir_rx_parents, 0x1c0,
|
||||
0, 5, /* M */
|
||||
24, 2, /* mux */
|
||||
BIT(31), /* gate */
|
||||
0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_ir_rx_clk, "bus-r-ir-rx",
|
||||
&r_apb0_clk.common.hw, 0x1cc, BIT(0), 0);
|
||||
|
||||
static SUNXI_CCU_GATE_HW(bus_r_dma_clk, "bus-r-dma",
|
||||
&r_apb0_clk.common.hw, 0x1dc, BIT(0), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_rtc_clk, "bus-r-rtc",
|
||||
&r_apb0_clk.common.hw, 0x20c, BIT(0), 0);
|
||||
static SUNXI_CCU_GATE_HW(bus_r_cpucfg_clk, "bus-r-cpucfg",
|
||||
&r_apb0_clk.common.hw, 0x22c, BIT(0), 0);
|
||||
|
||||
static struct ccu_common *sun55i_a523_r_ccu_clks[] = {
|
||||
&r_ahb_clk.common,
|
||||
&r_apb0_clk.common,
|
||||
&r_apb1_clk.common,
|
||||
&r_cpu_timer0.common,
|
||||
&r_cpu_timer1.common,
|
||||
&r_cpu_timer2.common,
|
||||
&bus_r_timer_clk.common,
|
||||
&bus_r_twd_clk.common,
|
||||
&r_pwmctrl_clk.common,
|
||||
&bus_r_pwmctrl_clk.common,
|
||||
&bus_r_spi_clk.common,
|
||||
&bus_r_spinlock_clk.common,
|
||||
&bus_r_msgbox_clk.common,
|
||||
&bus_r_uart0_clk.common,
|
||||
&bus_r_uart1_clk.common,
|
||||
&bus_r_i2c0_clk.common,
|
||||
&bus_r_i2c1_clk.common,
|
||||
&bus_r_i2c2_clk.common,
|
||||
&bus_r_ppu0_clk.common,
|
||||
&bus_r_ppu1_clk.common,
|
||||
&bus_r_cpu_bist_clk.common,
|
||||
&r_ir_rx_clk.common,
|
||||
&bus_r_ir_rx_clk.common,
|
||||
&bus_r_dma_clk.common,
|
||||
&bus_r_rtc_clk.common,
|
||||
&bus_r_cpucfg_clk.common,
|
||||
};
|
||||
|
||||
static struct clk_hw_onecell_data sun55i_a523_r_hw_clks = {
|
||||
.num = CLK_NUMBER,
|
||||
.hws = {
|
||||
[CLK_R_AHB] = &r_ahb_clk.common.hw,
|
||||
[CLK_R_APB0] = &r_apb0_clk.common.hw,
|
||||
[CLK_R_APB1] = &r_apb1_clk.common.hw,
|
||||
[CLK_R_TIMER0] = &r_cpu_timer0.common.hw,
|
||||
[CLK_R_TIMER1] = &r_cpu_timer1.common.hw,
|
||||
[CLK_R_TIMER2] = &r_cpu_timer2.common.hw,
|
||||
[CLK_BUS_R_TIMER] = &bus_r_timer_clk.common.hw,
|
||||
[CLK_BUS_R_TWD] = &bus_r_twd_clk.common.hw,
|
||||
[CLK_R_PWMCTRL] = &r_pwmctrl_clk.common.hw,
|
||||
[CLK_BUS_R_PWMCTRL] = &bus_r_pwmctrl_clk.common.hw,
|
||||
[CLK_BUS_R_SPI] = &bus_r_spi_clk.common.hw,
|
||||
[CLK_BUS_R_SPINLOCK] = &bus_r_spinlock_clk.common.hw,
|
||||
[CLK_BUS_R_MSGBOX] = &bus_r_msgbox_clk.common.hw,
|
||||
[CLK_BUS_R_UART0] = &bus_r_uart0_clk.common.hw,
|
||||
[CLK_BUS_R_UART1] = &bus_r_uart1_clk.common.hw,
|
||||
[CLK_BUS_R_I2C0] = &bus_r_i2c0_clk.common.hw,
|
||||
[CLK_BUS_R_I2C1] = &bus_r_i2c1_clk.common.hw,
|
||||
[CLK_BUS_R_I2C2] = &bus_r_i2c2_clk.common.hw,
|
||||
[CLK_BUS_R_PPU0] = &bus_r_ppu0_clk.common.hw,
|
||||
[CLK_BUS_R_PPU1] = &bus_r_ppu1_clk.common.hw,
|
||||
[CLK_BUS_R_CPU_BIST] = &bus_r_cpu_bist_clk.common.hw,
|
||||
[CLK_R_IR_RX] = &r_ir_rx_clk.common.hw,
|
||||
[CLK_BUS_R_IR_RX] = &bus_r_ir_rx_clk.common.hw,
|
||||
[CLK_BUS_R_DMA] = &bus_r_dma_clk.common.hw,
|
||||
[CLK_BUS_R_RTC] = &bus_r_rtc_clk.common.hw,
|
||||
[CLK_BUS_R_CPUCFG] = &bus_r_cpucfg_clk.common.hw,
|
||||
},
|
||||
};
|
||||
|
||||
static struct ccu_reset_map sun55i_a523_r_ccu_resets[] = {
|
||||
[RST_BUS_R_TIMER] = { 0x11c, BIT(16) },
|
||||
[RST_BUS_R_TWD] = { 0x12c, BIT(16) },
|
||||
[RST_BUS_R_PWMCTRL] = { 0x13c, BIT(16) },
|
||||
[RST_BUS_R_SPI] = { 0x15c, BIT(16) },
|
||||
[RST_BUS_R_SPINLOCK] = { 0x16c, BIT(16) },
|
||||
[RST_BUS_R_MSGBOX] = { 0x17c, BIT(16) },
|
||||
[RST_BUS_R_UART0] = { 0x18c, BIT(16) },
|
||||
[RST_BUS_R_UART1] = { 0x18c, BIT(17) },
|
||||
[RST_BUS_R_I2C0] = { 0x19c, BIT(16) },
|
||||
[RST_BUS_R_I2C1] = { 0x19c, BIT(17) },
|
||||
[RST_BUS_R_I2C2] = { 0x19c, BIT(18) },
|
||||
[RST_BUS_R_PPU1] = { 0x1ac, BIT(17) },
|
||||
[RST_BUS_R_IR_RX] = { 0x1cc, BIT(16) },
|
||||
[RST_BUS_R_RTC] = { 0x20c, BIT(16) },
|
||||
[RST_BUS_R_CPUCFG] = { 0x22c, BIT(16) },
|
||||
};
|
||||
|
||||
static const struct sunxi_ccu_desc sun55i_a523_r_ccu_desc = {
|
||||
.ccu_clks = sun55i_a523_r_ccu_clks,
|
||||
.num_ccu_clks = ARRAY_SIZE(sun55i_a523_r_ccu_clks),
|
||||
|
||||
.hw_clks = &sun55i_a523_r_hw_clks,
|
||||
|
||||
.resets = sun55i_a523_r_ccu_resets,
|
||||
.num_resets = ARRAY_SIZE(sun55i_a523_r_ccu_resets),
|
||||
};
|
||||
|
||||
static int sun55i_a523_r_ccu_probe(struct platform_device *pdev)
|
||||
{
|
||||
void __iomem *reg;
|
||||
|
||||
reg = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(reg))
|
||||
return PTR_ERR(reg);
|
||||
|
||||
return devm_sunxi_ccu_probe(&pdev->dev, reg, &sun55i_a523_r_ccu_desc);
|
||||
}
|
||||
|
||||
static const struct of_device_id sun55i_a523_r_ccu_ids[] = {
|
||||
{ .compatible = "allwinner,sun55i-a523-r-ccu" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, sun55i_a523_r_ccu_ids);
|
||||
|
||||
static struct platform_driver sun55i_a523_r_ccu_driver = {
|
||||
.probe = sun55i_a523_r_ccu_probe,
|
||||
.driver = {
|
||||
.name = "sun55i-a523-r-ccu",
|
||||
.suppress_bind_attrs = true,
|
||||
.of_match_table = sun55i_a523_r_ccu_ids,
|
||||
},
|
||||
};
|
||||
module_platform_driver(sun55i_a523_r_ccu_driver);
|
||||
|
||||
MODULE_IMPORT_NS("SUNXI_CCU");
|
||||
MODULE_DESCRIPTION("Support for the Allwinner A523 PRCM CCU");
|
||||
MODULE_LICENSE("GPL");
|
||||
@@ -0,0 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright 2024 Arm Ltd.
|
||||
*/
|
||||
|
||||
#ifndef _CCU_SUN55I_A523_R_H
|
||||
#define _CCU_SUN55I_A523_R_H
|
||||
|
||||
#include <dt-bindings/clock/sun55i-a523-r-ccu.h>
|
||||
#include <dt-bindings/reset/sun55i-a523-r-ccu.h>
|
||||
|
||||
#define CLK_NUMBER (CLK_BUS_R_CPUCFG + 1)
|
||||
|
||||
#endif /* _CCU_SUN55I_A523_R_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright 2024 Arm Ltd.
|
||||
*/
|
||||
|
||||
#ifndef _CCU_SUN55I_A523_H
|
||||
#define _CCU_SUN55I_A523_H
|
||||
|
||||
#include <dt-bindings/clock/sun55i-a523-ccu.h>
|
||||
#include <dt-bindings/reset/sun55i-a523-ccu.h>
|
||||
|
||||
#define CLK_NUMBER (CLK_FANOUT2 + 1)
|
||||
|
||||
#endif /* _CCU_SUN55I_A523_H */
|
||||
@@ -19,10 +19,15 @@
|
||||
#define CCU_FEATURE_SIGMA_DELTA_MOD BIT(7)
|
||||
#define CCU_FEATURE_KEY_FIELD BIT(8)
|
||||
#define CCU_FEATURE_CLOSEST_RATE BIT(9)
|
||||
#define CCU_FEATURE_DUAL_DIV BIT(10)
|
||||
#define CCU_FEATURE_UPDATE_BIT BIT(11)
|
||||
|
||||
/* MMC timing mode switch bit */
|
||||
#define CCU_MMC_NEW_TIMING_MODE BIT(30)
|
||||
|
||||
/* Some clocks need this bit to actually apply register changes */
|
||||
#define CCU_SUNXI_UPDATE_BIT BIT(27)
|
||||
|
||||
struct device_node;
|
||||
|
||||
struct ccu_common {
|
||||
|
||||
@@ -106,6 +106,8 @@ static int ccu_div_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
|
||||
reg = readl(cd->common.base + cd->common.reg);
|
||||
reg &= ~GENMASK(cd->div.width + cd->div.shift - 1, cd->div.shift);
|
||||
if (cd->common.features & CCU_FEATURE_UPDATE_BIT)
|
||||
reg |= CCU_SUNXI_UPDATE_BIT;
|
||||
|
||||
writel(reg | (val << cd->div.shift),
|
||||
cd->common.base + cd->common.reg);
|
||||
|
||||
@@ -20,6 +20,8 @@ void ccu_gate_helper_disable(struct ccu_common *common, u32 gate)
|
||||
spin_lock_irqsave(common->lock, flags);
|
||||
|
||||
reg = readl(common->base + common->reg);
|
||||
if (common->features & CCU_FEATURE_UPDATE_BIT)
|
||||
reg |= CCU_SUNXI_UPDATE_BIT;
|
||||
writel(reg & ~gate, common->base + common->reg);
|
||||
|
||||
spin_unlock_irqrestore(common->lock, flags);
|
||||
@@ -44,6 +46,8 @@ int ccu_gate_helper_enable(struct ccu_common *common, u32 gate)
|
||||
spin_lock_irqsave(common->lock, flags);
|
||||
|
||||
reg = readl(common->base + common->reg);
|
||||
if (common->features & CCU_FEATURE_UPDATE_BIT)
|
||||
reg |= CCU_SUNXI_UPDATE_BIT;
|
||||
writel(reg | gate, common->base + common->reg);
|
||||
|
||||
spin_unlock_irqrestore(common->lock, flags);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user