* [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150
@ 2024-07-02 15:50 Satya Priya Kakitapalli
2024-07-02 15:50 ` [PATCH v2 1/6] clk: qcom: alpha-pll: Fix the pll post div mask and shift Satya Priya Kakitapalli
` (6 more replies)
0 siblings, 7 replies; 33+ messages in thread
From: Satya Priya Kakitapalli @ 2024-07-02 15:50 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Satya Priya Kakitapalli, stable, Krzysztof Kozlowski,
Bryan O'Donoghue
Add camcc support and Regera PLL ops. Also, fix the pll post div mask.
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
---
Changes in v2:
- As per Konrad's comments, re-use the zonda pll code for regera, as
both are mostly same.
- Fix the zonda_set_rate API and also the pll_post_div shift used in
trion pll post div set rate API
- Link to v1: https://lore.kernel.org/r/20240229-camcc-support-sm8150-v1-0-8c28c6c87990@quicinc.com
---
Satya Priya Kakitapalli (5):
clk: qcom: alpha-pll: Fix the pll post div mask and shift
clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL
dt-bindings: clock: qcom: Add SM8150 camera clock controller
clk: qcom: Add camera clock controller driver for SM8150
arm64: dts: qcom: Add camera clock controller for sm8150
Taniya Das (1):
clk: qcom: clk-alpha-pll: Add support for Regera PLL ops
.../bindings/clock/qcom,sm8150-camcc.yaml | 77 +
arch/arm64/boot/dts/qcom/sa8155p.dtsi | 4 +
arch/arm64/boot/dts/qcom/sm8150.dtsi | 13 +
drivers/clk/qcom/Kconfig | 9 +
drivers/clk/qcom/Makefile | 1 +
drivers/clk/qcom/camcc-sm8150.c | 2159 ++++++++++++++++++++
drivers/clk/qcom/clk-alpha-pll.c | 56 +-
drivers/clk/qcom/clk-alpha-pll.h | 5 +
include/dt-bindings/clock/qcom,sm8150-camcc.h | 135 ++
9 files changed, 2455 insertions(+), 4 deletions(-)
---
base-commit: 20af1ca418d2c0b11bc2a1fe8c0c88f67bcc2a7e
change-id: 20240229-camcc-support-sm8150-d3f72a4a1a2b
Best regards,
--
Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH v2 1/6] clk: qcom: alpha-pll: Fix the pll post div mask and shift
2024-07-02 15:50 [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Satya Priya Kakitapalli
@ 2024-07-02 15:50 ` Satya Priya Kakitapalli
2024-07-03 10:01 ` Dmitry Baryshkov
2024-07-02 15:50 ` [PATCH v2 2/6] clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL Satya Priya Kakitapalli
` (5 subsequent siblings)
6 siblings, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli @ 2024-07-02 15:50 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Satya Priya Kakitapalli, stable
The PLL_POST_DIV_MASK should be 0 to (width - 1) bits. Fix it.
Also, correct the pll postdiv shift used in trion pll postdiv
set rate API. The shift value is not same for different types of
plls and should be taken from the pll's .post_div_shift member.
Fixes: 1c3541145cbf ("clk: qcom: support for 2 bit PLL post divider")
Cc: stable@vger.kernel.org
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
---
drivers/clk/qcom/clk-alpha-pll.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
index 8a412ef47e16..6107c144c0f5 100644
--- a/drivers/clk/qcom/clk-alpha-pll.c
+++ b/drivers/clk/qcom/clk-alpha-pll.c
@@ -40,7 +40,7 @@
#define PLL_USER_CTL(p) ((p)->offset + (p)->regs[PLL_OFF_USER_CTL])
# define PLL_POST_DIV_SHIFT 8
-# define PLL_POST_DIV_MASK(p) GENMASK((p)->width, 0)
+# define PLL_POST_DIV_MASK(p) GENMASK((p)->width - 1, 0)
# define PLL_ALPHA_EN BIT(24)
# define PLL_ALPHA_MODE BIT(25)
# define PLL_VCO_SHIFT 20
@@ -1496,8 +1496,8 @@ clk_trion_pll_postdiv_set_rate(struct clk_hw *hw, unsigned long rate,
}
return regmap_update_bits(regmap, PLL_USER_CTL(pll),
- PLL_POST_DIV_MASK(pll) << PLL_POST_DIV_SHIFT,
- val << PLL_POST_DIV_SHIFT);
+ PLL_POST_DIV_MASK(pll) << pll->post_div_shift,
+ val << pll->post_div_shift);
}
const struct clk_ops clk_alpha_pll_postdiv_trion_ops = {
--
2.25.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v2 2/6] clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL
2024-07-02 15:50 [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Satya Priya Kakitapalli
2024-07-02 15:50 ` [PATCH v2 1/6] clk: qcom: alpha-pll: Fix the pll post div mask and shift Satya Priya Kakitapalli
@ 2024-07-02 15:50 ` Satya Priya Kakitapalli
2024-07-03 10:02 ` Dmitry Baryshkov
2024-07-06 13:39 ` Konrad Dybcio
2024-07-02 15:50 ` [PATCH v2 3/6] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops Satya Priya Kakitapalli
` (4 subsequent siblings)
6 siblings, 2 replies; 33+ messages in thread
From: Satya Priya Kakitapalli @ 2024-07-02 15:50 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Satya Priya Kakitapalli
The Zonda PLL has a 16 bit signed alpha and in the cases where the alpha
value is greater than 0.5, the L value needs to be adjusted accordingly.
Thus update the logic for the same.
Also, fix zonda set_rate failure when PLL is disabled. Currently,
clk_zonda_pll_set_rate polls for the PLL to lock even if the PLL is
disabled. However, if the PLL is disabled then LOCK_DET will never
assert and we'll return an error. There is no reason to poll LOCK_DET
if the PLL is already disabled, so skip polling in this case.
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
---
drivers/clk/qcom/clk-alpha-pll.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
index 6107c144c0f5..d2bef078588f 100644
--- a/drivers/clk/qcom/clk-alpha-pll.c
+++ b/drivers/clk/qcom/clk-alpha-pll.c
@@ -2061,6 +2061,18 @@ static void clk_zonda_pll_disable(struct clk_hw *hw)
regmap_write(regmap, PLL_OPMODE(pll), 0x0);
}
+static void zonda_pll_adjust_l_val(unsigned long rate, unsigned long prate, u32 *l)
+{
+ u64 remainder, quotient;
+
+ quotient = rate;
+ remainder = do_div(quotient, prate);
+ *l = quotient;
+
+ if ((remainder * 2) / prate)
+ *l = *l + 1;
+}
+
static int clk_zonda_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long prate)
{
@@ -2077,9 +2089,15 @@ static int clk_zonda_pll_set_rate(struct clk_hw *hw, unsigned long rate,
if (ret < 0)
return ret;
+ if (a & BIT(15))
+ zonda_pll_adjust_l_val(rate, prate, &l);
+
regmap_write(pll->clkr.regmap, PLL_ALPHA_VAL(pll), a);
regmap_write(pll->clkr.regmap, PLL_L_VAL(pll), l);
+ if (!clk_hw_is_enabled(hw))
+ return 0;
+
/* Wait before polling for the frequency latch */
udelay(5);
--
2.25.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v2 3/6] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops
2024-07-02 15:50 [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Satya Priya Kakitapalli
2024-07-02 15:50 ` [PATCH v2 1/6] clk: qcom: alpha-pll: Fix the pll post div mask and shift Satya Priya Kakitapalli
2024-07-02 15:50 ` [PATCH v2 2/6] clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL Satya Priya Kakitapalli
@ 2024-07-02 15:50 ` Satya Priya Kakitapalli
2024-07-03 10:05 ` Dmitry Baryshkov
2024-07-02 15:50 ` [PATCH v2 4/6] dt-bindings: clock: qcom: Add SM8150 camera clock controller Satya Priya Kakitapalli
` (3 subsequent siblings)
6 siblings, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli @ 2024-07-02 15:50 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Satya Priya Kakitapalli
From: Taniya Das <quic_tdas@quicinc.com>
Regera PLL ops are required to control the Regera PLL from clock
controller drivers, thus add support for the same.
Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
---
drivers/clk/qcom/clk-alpha-pll.c | 32 +++++++++++++++++++++++++++++++-
drivers/clk/qcom/clk-alpha-pll.h | 5 +++++
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
index d2bef078588f..afb7ab72c90d 100644
--- a/drivers/clk/qcom/clk-alpha-pll.c
+++ b/drivers/clk/qcom/clk-alpha-pll.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2015, 2018, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021, 2023, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021, 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/kernel.h>
@@ -2605,3 +2605,33 @@ const struct clk_ops clk_alpha_pll_stromer_plus_ops = {
.set_rate = clk_alpha_pll_stromer_plus_set_rate,
};
EXPORT_SYMBOL_GPL(clk_alpha_pll_stromer_plus_ops);
+
+void clk_regera_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
+ const struct alpha_pll_config *config)
+{
+ clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l);
+ clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);
+ clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL(pll), config->config_ctl_val);
+ clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U(pll), config->config_ctl_hi_val);
+ clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U1(pll), config->config_ctl_hi1_val);
+ clk_alpha_pll_write_config(regmap, PLL_USER_CTL(pll), config->user_ctl_val);
+ clk_alpha_pll_write_config(regmap, PLL_USER_CTL_U(pll), config->user_ctl_hi_val);
+ clk_alpha_pll_write_config(regmap, PLL_USER_CTL_U1(pll), config->user_ctl_hi1_val);
+ clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), config->test_ctl_val);
+ clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), config->test_ctl_hi_val);
+ clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll), config->test_ctl_hi1_val);
+
+ /* Set operation mode to STANDBY */
+ regmap_write(regmap, PLL_OPMODE(pll), PLL_STANDBY);
+}
+EXPORT_SYMBOL_GPL(clk_regera_pll_configure);
+
+const struct clk_ops clk_alpha_pll_regera_ops = {
+ .enable = clk_zonda_pll_enable,
+ .disable = clk_zonda_pll_disable,
+ .is_enabled = clk_alpha_pll_is_enabled,
+ .recalc_rate = clk_trion_pll_recalc_rate,
+ .round_rate = clk_alpha_pll_round_rate,
+ .set_rate = clk_zonda_pll_set_rate,
+};
+EXPORT_SYMBOL_GPL(clk_alpha_pll_regera_ops);
diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h
index fb6d50263bb9..5bb0a07da53d 100644
--- a/drivers/clk/qcom/clk-alpha-pll.h
+++ b/drivers/clk/qcom/clk-alpha-pll.h
@@ -21,6 +21,7 @@ enum {
CLK_ALPHA_PLL_TYPE_LUCID = CLK_ALPHA_PLL_TYPE_TRION,
CLK_ALPHA_PLL_TYPE_AGERA,
CLK_ALPHA_PLL_TYPE_ZONDA,
+ CLK_ALPHA_PLL_TYPE_REGERA = CLK_ALPHA_PLL_TYPE_ZONDA,
CLK_ALPHA_PLL_TYPE_ZONDA_OLE,
CLK_ALPHA_PLL_TYPE_LUCID_EVO,
CLK_ALPHA_PLL_TYPE_LUCID_OLE,
@@ -189,6 +190,8 @@ extern const struct clk_ops clk_alpha_pll_postdiv_lucid_evo_ops;
extern const struct clk_ops clk_alpha_pll_rivian_evo_ops;
#define clk_alpha_pll_postdiv_rivian_evo_ops clk_alpha_pll_postdiv_fabia_ops
+extern const struct clk_ops clk_alpha_pll_regera_ops;
+
void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
const struct alpha_pll_config *config);
void clk_fabia_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
@@ -210,5 +213,7 @@ void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regm
const struct alpha_pll_config *config);
void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
const struct alpha_pll_config *config);
+void clk_regera_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
+ const struct alpha_pll_config *config);
#endif
--
2.25.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v2 4/6] dt-bindings: clock: qcom: Add SM8150 camera clock controller
2024-07-02 15:50 [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Satya Priya Kakitapalli
` (2 preceding siblings ...)
2024-07-02 15:50 ` [PATCH v2 3/6] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops Satya Priya Kakitapalli
@ 2024-07-02 15:50 ` Satya Priya Kakitapalli
2024-07-03 10:14 ` Dmitry Baryshkov
2024-07-02 15:50 ` [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150 Satya Priya Kakitapalli
` (2 subsequent siblings)
6 siblings, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli @ 2024-07-02 15:50 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Satya Priya Kakitapalli, Krzysztof Kozlowski
Add device tree bindings for the camera clock controller on
Qualcomm SM8150 platform.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
---
.../bindings/clock/qcom,sm8150-camcc.yaml | 77 ++++++++++++
include/dt-bindings/clock/qcom,sm8150-camcc.h | 135 +++++++++++++++++++++
2 files changed, 212 insertions(+)
diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml
new file mode 100644
index 000000000000..8fc27ba4be4b
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,sm8150-camcc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Camera Clock & Reset Controller on SM8150
+
+maintainers:
+ - Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
+
+description: |
+ Qualcomm camera clock control module provides the clocks, resets and
+ power domains on SM8150.
+
+ See also:: include/dt-bindings/clock/qcom,sm8150-camcc.h
+
+properties:
+ compatible:
+ const: qcom,sm8150-camcc
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ items:
+ - description: Board XO source
+ - description: Camera AHB clock from GCC
+
+ power-domains:
+ maxItems: 1
+ description:
+ A phandle and PM domain specifier for the MMCX power domain.
+
+ required-opps:
+ maxItems: 1
+ description:
+ A phandle to an OPP node describing required MMCX performance point.
+
+ '#clock-cells':
+ const: 1
+
+ '#reset-cells':
+ const: 1
+
+ '#power-domain-cells':
+ const: 1
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - power-domains
+ - required-opps
+ - '#clock-cells'
+ - '#reset-cells'
+ - '#power-domain-cells'
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/qcom,gcc-sm8150.h>
+ #include <dt-bindings/clock/qcom,rpmh.h>
+ #include <dt-bindings/power/qcom-rpmpd.h>
+ clock-controller@ad00000 {
+ compatible = "qcom,sm8150-camcc";
+ reg = <0x0ad00000 0x10000>;
+ clocks = <&rpmhcc RPMH_CXO_CLK>,
+ <&gcc GCC_CAMERA_AHB_CLK>;
+ power-domains = <&rpmhpd SM8150_MMCX>;
+ required-opps = <&rpmhpd_opp_low_svs>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ #power-domain-cells = <1>;
+ };
+...
diff --git a/include/dt-bindings/clock/qcom,sm8150-camcc.h b/include/dt-bindings/clock/qcom,sm8150-camcc.h
new file mode 100644
index 000000000000..5444035efa93
--- /dev/null
+++ b/include/dt-bindings/clock/qcom,sm8150-camcc.h
@@ -0,0 +1,135 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_CAM_CC_SM8150_H
+#define _DT_BINDINGS_CLK_QCOM_CAM_CC_SM8150_H
+
+/* CAM_CC clocks */
+#define CAM_CC_PLL0 0
+#define CAM_CC_PLL0_OUT_EVEN 1
+#define CAM_CC_PLL0_OUT_ODD 2
+#define CAM_CC_PLL1 3
+#define CAM_CC_PLL1_OUT_EVEN 4
+#define CAM_CC_PLL2 5
+#define CAM_CC_PLL2_OUT_MAIN 6
+#define CAM_CC_PLL3 7
+#define CAM_CC_PLL3_OUT_EVEN 8
+#define CAM_CC_PLL4 9
+#define CAM_CC_PLL4_OUT_EVEN 10
+#define CAM_CC_BPS_AHB_CLK 11
+#define CAM_CC_BPS_AREG_CLK 12
+#define CAM_CC_BPS_AXI_CLK 13
+#define CAM_CC_BPS_CLK 14
+#define CAM_CC_BPS_CLK_SRC 15
+#define CAM_CC_CAMNOC_AXI_CLK 16
+#define CAM_CC_CAMNOC_AXI_CLK_SRC 17
+#define CAM_CC_CAMNOC_DCD_XO_CLK 18
+#define CAM_CC_CCI_0_CLK 19
+#define CAM_CC_CCI_0_CLK_SRC 20
+#define CAM_CC_CCI_1_CLK 21
+#define CAM_CC_CCI_1_CLK_SRC 22
+#define CAM_CC_CORE_AHB_CLK 23
+#define CAM_CC_CPAS_AHB_CLK 24
+#define CAM_CC_CPHY_RX_CLK_SRC 25
+#define CAM_CC_CSI0PHYTIMER_CLK 26
+#define CAM_CC_CSI0PHYTIMER_CLK_SRC 27
+#define CAM_CC_CSI1PHYTIMER_CLK 28
+#define CAM_CC_CSI1PHYTIMER_CLK_SRC 29
+#define CAM_CC_CSI2PHYTIMER_CLK 30
+#define CAM_CC_CSI2PHYTIMER_CLK_SRC 31
+#define CAM_CC_CSI3PHYTIMER_CLK 32
+#define CAM_CC_CSI3PHYTIMER_CLK_SRC 33
+#define CAM_CC_CSIPHY0_CLK 34
+#define CAM_CC_CSIPHY1_CLK 35
+#define CAM_CC_CSIPHY2_CLK 36
+#define CAM_CC_CSIPHY3_CLK 37
+#define CAM_CC_FAST_AHB_CLK_SRC 38
+#define CAM_CC_FD_CORE_CLK 39
+#define CAM_CC_FD_CORE_CLK_SRC 40
+#define CAM_CC_FD_CORE_UAR_CLK 41
+#define CAM_CC_GDSC_CLK 42
+#define CAM_CC_ICP_AHB_CLK 43
+#define CAM_CC_ICP_CLK 44
+#define CAM_CC_ICP_CLK_SRC 45
+#define CAM_CC_IFE_0_AXI_CLK 46
+#define CAM_CC_IFE_0_CLK 47
+#define CAM_CC_IFE_0_CLK_SRC 48
+#define CAM_CC_IFE_0_CPHY_RX_CLK 49
+#define CAM_CC_IFE_0_CSID_CLK 50
+#define CAM_CC_IFE_0_CSID_CLK_SRC 51
+#define CAM_CC_IFE_0_DSP_CLK 52
+#define CAM_CC_IFE_1_AXI_CLK 53
+#define CAM_CC_IFE_1_CLK 54
+#define CAM_CC_IFE_1_CLK_SRC 55
+#define CAM_CC_IFE_1_CPHY_RX_CLK 56
+#define CAM_CC_IFE_1_CSID_CLK 57
+#define CAM_CC_IFE_1_CSID_CLK_SRC 58
+#define CAM_CC_IFE_1_DSP_CLK 59
+#define CAM_CC_IFE_LITE_0_CLK 60
+#define CAM_CC_IFE_LITE_0_CLK_SRC 61
+#define CAM_CC_IFE_LITE_0_CPHY_RX_CLK 62
+#define CAM_CC_IFE_LITE_0_CSID_CLK 63
+#define CAM_CC_IFE_LITE_0_CSID_CLK_SRC 64
+#define CAM_CC_IFE_LITE_1_CLK 65
+#define CAM_CC_IFE_LITE_1_CLK_SRC 66
+#define CAM_CC_IFE_LITE_1_CPHY_RX_CLK 67
+#define CAM_CC_IFE_LITE_1_CSID_CLK 68
+#define CAM_CC_IFE_LITE_1_CSID_CLK_SRC 69
+#define CAM_CC_IPE_0_AHB_CLK 70
+#define CAM_CC_IPE_0_AREG_CLK 71
+#define CAM_CC_IPE_0_AXI_CLK 72
+#define CAM_CC_IPE_0_CLK 73
+#define CAM_CC_IPE_0_CLK_SRC 74
+#define CAM_CC_IPE_1_AHB_CLK 75
+#define CAM_CC_IPE_1_AREG_CLK 76
+#define CAM_CC_IPE_1_AXI_CLK 77
+#define CAM_CC_IPE_1_CLK 78
+#define CAM_CC_JPEG_CLK 79
+#define CAM_CC_JPEG_CLK_SRC 80
+#define CAM_CC_LRME_CLK 81
+#define CAM_CC_LRME_CLK_SRC 82
+#define CAM_CC_MCLK0_CLK 83
+#define CAM_CC_MCLK0_CLK_SRC 84
+#define CAM_CC_MCLK1_CLK 85
+#define CAM_CC_MCLK1_CLK_SRC 86
+#define CAM_CC_MCLK2_CLK 87
+#define CAM_CC_MCLK2_CLK_SRC 88
+#define CAM_CC_MCLK3_CLK 89
+#define CAM_CC_MCLK3_CLK_SRC 90
+#define CAM_CC_SLOW_AHB_CLK_SRC 91
+
+/* CAM_CC power domains */
+#define TITAN_TOP_GDSC 0
+#define BPS_GDSC 1
+#define IFE_0_GDSC 2
+#define IFE_1_GDSC 3
+#define IPE_0_GDSC 4
+#define IPE_1_GDSC 5
+
+/* CAM_CC resets */
+#define CAM_CC_BPS_BCR 0
+#define CAM_CC_CAMNOC_BCR 1
+#define CAM_CC_CCI_BCR 2
+#define CAM_CC_CPAS_BCR 3
+#define CAM_CC_CSI0PHY_BCR 4
+#define CAM_CC_CSI1PHY_BCR 5
+#define CAM_CC_CSI2PHY_BCR 6
+#define CAM_CC_CSI3PHY_BCR 7
+#define CAM_CC_FD_BCR 8
+#define CAM_CC_ICP_BCR 9
+#define CAM_CC_IFE_0_BCR 10
+#define CAM_CC_IFE_1_BCR 11
+#define CAM_CC_IFE_LITE_0_BCR 12
+#define CAM_CC_IFE_LITE_1_BCR 13
+#define CAM_CC_IPE_0_BCR 14
+#define CAM_CC_IPE_1_BCR 15
+#define CAM_CC_JPEG_BCR 16
+#define CAM_CC_LRME_BCR 17
+#define CAM_CC_MCLK0_BCR 18
+#define CAM_CC_MCLK1_BCR 19
+#define CAM_CC_MCLK2_BCR 20
+#define CAM_CC_MCLK3_BCR 21
+
+#endif
--
2.25.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-02 15:50 [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Satya Priya Kakitapalli
` (3 preceding siblings ...)
2024-07-02 15:50 ` [PATCH v2 4/6] dt-bindings: clock: qcom: Add SM8150 camera clock controller Satya Priya Kakitapalli
@ 2024-07-02 15:50 ` Satya Priya Kakitapalli
2024-07-03 10:20 ` Dmitry Baryshkov
2024-07-02 15:50 ` [PATCH v2 6/6] arm64: dts: qcom: Add camera clock controller for sm8150 Satya Priya Kakitapalli
2024-07-03 10:08 ` [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Dmitry Baryshkov
6 siblings, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli @ 2024-07-02 15:50 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Satya Priya Kakitapalli, Bryan O'Donoghue
Add support for the camera clock controller for camera clients
to be able to request for camcc clocks on SM8150 platform.
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
---
drivers/clk/qcom/Kconfig | 9 +
drivers/clk/qcom/Makefile | 1 +
drivers/clk/qcom/camcc-sm8150.c | 2159 +++++++++++++++++++++++++++++++++++++++
3 files changed, 2169 insertions(+)
diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
index 8ab08e7b5b6c..79cb97903c4c 100644
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
@@ -802,6 +802,15 @@ config SM_CAMCC_6350
Support for the camera clock controller on SM6350 devices.
Say Y if you want to support camera devices and camera functionality.
+config SM_CAMCC_8150
+ tristate "SM8150 Camera Clock Controller"
+ select SM_GCC_8150
+ help
+ Support for the camera clock controller on Qualcomm Technologies, Inc
+ SM8150 devices.
+ Say Y if you want to support camera devices and functionality such as
+ capturing pictures.
+
config SM_CAMCC_8250
tristate "SM8250 Camera Clock Controller"
depends on ARM64 || COMPILE_TEST
diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
index dec5b6db6860..01fb8f7ce86e 100644
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
@@ -106,6 +106,7 @@ obj-$(CONFIG_SDX_GCC_55) += gcc-sdx55.o
obj-$(CONFIG_SDX_GCC_65) += gcc-sdx65.o
obj-$(CONFIG_SDX_GCC_75) += gcc-sdx75.o
obj-$(CONFIG_SM_CAMCC_6350) += camcc-sm6350.o
+obj-$(CONFIG_SM_CAMCC_8150) += camcc-sm8150.o
obj-$(CONFIG_SM_CAMCC_8250) += camcc-sm8250.o
obj-$(CONFIG_SM_CAMCC_8450) += camcc-sm8450.o
obj-$(CONFIG_SM_CAMCC_8550) += camcc-sm8550.o
diff --git a/drivers/clk/qcom/camcc-sm8150.c b/drivers/clk/qcom/camcc-sm8150.c
new file mode 100644
index 000000000000..45200841c1bc
--- /dev/null
+++ b/drivers/clk/qcom/camcc-sm8150.c
@@ -0,0 +1,2159 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/err.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/regmap.h>
+#include <linux/pm_runtime.h>
+
+#include <dt-bindings/clock/qcom,sm8150-camcc.h>
+
+#include "clk-alpha-pll.h"
+#include "clk-branch.h"
+#include "clk-rcg.h"
+#include "clk-regmap.h"
+#include "common.h"
+#include "gdsc.h"
+#include "reset.h"
+
+enum {
+ DT_BI_TCXO,
+ DT_IFACE,
+};
+
+enum {
+ P_BI_TCXO,
+ P_CAM_CC_PLL0_OUT_EVEN,
+ P_CAM_CC_PLL0_OUT_MAIN,
+ P_CAM_CC_PLL0_OUT_ODD,
+ P_CAM_CC_PLL1_OUT_EVEN,
+ P_CAM_CC_PLL2_OUT_EARLY,
+ P_CAM_CC_PLL2_OUT_MAIN,
+ P_CAM_CC_PLL3_OUT_EVEN,
+ P_CAM_CC_PLL4_OUT_EVEN,
+};
+
+static const struct pll_vco regera_vco[] = {
+ { 600000000, 3300000000, 0 },
+};
+
+static const struct pll_vco trion_vco[] = {
+ { 249600000, 2000000000, 0 },
+};
+
+static const struct alpha_pll_config cam_cc_pll0_config = {
+ .l = 0x3e,
+ .alpha = 0x8000,
+ .config_ctl_val = 0x20485699,
+ .config_ctl_hi_val = 0x00002267,
+ .config_ctl_hi1_val = 0x00000024,
+ .test_ctl_val = 0x00000000,
+ .test_ctl_hi_val = 0x00000000,
+ .test_ctl_hi1_val = 0x00000020,
+ .user_ctl_val = 0x00003100,
+ .user_ctl_hi_val = 0x00000805,
+ .user_ctl_hi1_val = 0x000000D0,
+};
+
+static struct clk_alpha_pll cam_cc_pll0 = {
+ .offset = 0x0,
+ .vco_table = trion_vco,
+ .num_vco = ARRAY_SIZE(trion_vco),
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION],
+ .clkr = {
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll0",
+ .parent_data = &(const struct clk_parent_data) {
+ .index = DT_BI_TCXO,
+ },
+ .num_parents = 1,
+ .ops = &clk_alpha_pll_trion_ops,
+ },
+ },
+};
+
+static const struct clk_div_table post_div_table_cam_cc_pll0_out_even[] = {
+ { 0x1, 2 },
+ { }
+};
+
+static struct clk_alpha_pll_postdiv cam_cc_pll0_out_even = {
+ .offset = 0x0,
+ .post_div_shift = 8,
+ .post_div_table = post_div_table_cam_cc_pll0_out_even,
+ .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll0_out_even),
+ .width = 4,
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION],
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll0_out_even",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_pll0.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_alpha_pll_postdiv_trion_ops,
+ },
+};
+
+static const struct clk_div_table post_div_table_cam_cc_pll0_out_odd[] = {
+ { 0x3, 3 },
+ { }
+};
+
+static struct clk_alpha_pll_postdiv cam_cc_pll0_out_odd = {
+ .offset = 0x0,
+ .post_div_shift = 12,
+ .post_div_table = post_div_table_cam_cc_pll0_out_odd,
+ .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll0_out_odd),
+ .width = 4,
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION],
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll0_out_odd",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_pll0.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_alpha_pll_postdiv_trion_ops,
+ },
+};
+
+static const struct alpha_pll_config cam_cc_pll1_config = {
+ .l = 0x1f,
+ .alpha = 0x4000,
+ .config_ctl_val = 0x20485699,
+ .config_ctl_hi_val = 0x00002267,
+ .config_ctl_hi1_val = 0x00000024,
+ .test_ctl_val = 0x00000000,
+ .test_ctl_hi_val = 0x00000000,
+ .test_ctl_hi1_val = 0x00000020,
+ .user_ctl_val = 0x00000100,
+ .user_ctl_hi_val = 0x00000805,
+ .user_ctl_hi1_val = 0x000000D0,
+};
+
+static struct clk_alpha_pll cam_cc_pll1 = {
+ .offset = 0x1000,
+ .vco_table = trion_vco,
+ .num_vco = ARRAY_SIZE(trion_vco),
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION],
+ .clkr = {
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll1",
+ .parent_data = &(const struct clk_parent_data) {
+ .index = DT_BI_TCXO,
+ },
+ .num_parents = 1,
+ .ops = &clk_alpha_pll_trion_ops,
+ },
+ },
+};
+
+static const struct clk_div_table post_div_table_cam_cc_pll1_out_even[] = {
+ { 0x1, 2 },
+ { }
+};
+
+static struct clk_alpha_pll_postdiv cam_cc_pll1_out_even = {
+ .offset = 0x1000,
+ .post_div_shift = 8,
+ .post_div_table = post_div_table_cam_cc_pll1_out_even,
+ .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll1_out_even),
+ .width = 4,
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION],
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll1_out_even",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_pll1.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_alpha_pll_postdiv_trion_ops,
+ },
+};
+
+static const struct alpha_pll_config cam_cc_pll2_config = {
+ .l = 0x32,
+ .alpha = 0x0,
+ .config_ctl_val = 0x10000807,
+ .config_ctl_hi_val = 0x00000011,
+ .config_ctl_hi1_val = 0x04300142,
+ .test_ctl_val = 0x04000400,
+ .test_ctl_hi_val = 0x00004000,
+ .test_ctl_hi1_val = 0x00000000,
+ .user_ctl_val = 0x00000100,
+ .user_ctl_hi_val = 0x00000000,
+ .user_ctl_hi1_val = 0x00000000,
+};
+
+static struct clk_alpha_pll cam_cc_pll2 = {
+ .offset = 0x2000,
+ .vco_table = regera_vco,
+ .num_vco = ARRAY_SIZE(regera_vco),
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_REGERA],
+ .clkr = {
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll2",
+ .parent_data = &(const struct clk_parent_data) {
+ .index = DT_BI_TCXO,
+ },
+ .num_parents = 1,
+ .ops = &clk_alpha_pll_regera_ops,
+ },
+ },
+};
+
+static const struct clk_div_table post_div_table_cam_cc_pll2_out_main[] = {
+ { 0x1, 2 },
+ { }
+};
+
+static struct clk_alpha_pll_postdiv cam_cc_pll2_out_main = {
+ .offset = 0x2000,
+ .post_div_shift = 8,
+ .post_div_table = post_div_table_cam_cc_pll2_out_main,
+ .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll2_out_main),
+ .width = 2,
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_REGERA],
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll2_out_main",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_pll2.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_alpha_pll_postdiv_trion_ops,
+ },
+};
+
+static const struct alpha_pll_config cam_cc_pll3_config = {
+ .l = 0x29,
+ .alpha = 0xaaaa,
+ .config_ctl_val = 0x20485699,
+ .config_ctl_hi_val = 0x00002267,
+ .config_ctl_hi1_val = 0x00000024,
+ .test_ctl_val = 0x00000000,
+ .test_ctl_hi_val = 0x00000000,
+ .test_ctl_hi1_val = 0x00000020,
+ .user_ctl_val = 0x00000100,
+ .user_ctl_hi_val = 0x00000805,
+ .user_ctl_hi1_val = 0x000000D0,
+};
+
+static struct clk_alpha_pll cam_cc_pll3 = {
+ .offset = 0x3000,
+ .vco_table = trion_vco,
+ .num_vco = ARRAY_SIZE(trion_vco),
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION],
+ .clkr = {
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll3",
+ .parent_data = &(const struct clk_parent_data) {
+ .index = DT_BI_TCXO,
+ },
+ .num_parents = 1,
+ .ops = &clk_alpha_pll_trion_ops,
+ },
+ },
+};
+
+static const struct clk_div_table post_div_table_cam_cc_pll3_out_even[] = {
+ { 0x1, 2 },
+ { }
+};
+
+static struct clk_alpha_pll_postdiv cam_cc_pll3_out_even = {
+ .offset = 0x3000,
+ .post_div_shift = 8,
+ .post_div_table = post_div_table_cam_cc_pll3_out_even,
+ .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll3_out_even),
+ .width = 4,
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION],
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll3_out_even",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_pll3.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_alpha_pll_postdiv_trion_ops,
+ },
+};
+
+static const struct alpha_pll_config cam_cc_pll4_config = {
+ .l = 0x29,
+ .alpha = 0xaaaa,
+ .config_ctl_val = 0x20485699,
+ .config_ctl_hi_val = 0x00002267,
+ .config_ctl_hi1_val = 0x00000024,
+ .test_ctl_val = 0x00000000,
+ .test_ctl_hi_val = 0x00000000,
+ .test_ctl_hi1_val = 0x00000020,
+ .user_ctl_val = 0x00000100,
+ .user_ctl_hi_val = 0x00000805,
+ .user_ctl_hi1_val = 0x000000D0,
+};
+
+static struct clk_alpha_pll cam_cc_pll4 = {
+ .offset = 0x4000,
+ .vco_table = trion_vco,
+ .num_vco = ARRAY_SIZE(trion_vco),
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION],
+ .clkr = {
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll4",
+ .parent_data = &(const struct clk_parent_data) {
+ .index = DT_BI_TCXO,
+ },
+ .num_parents = 1,
+ .ops = &clk_alpha_pll_trion_ops,
+ },
+ },
+};
+
+static const struct clk_div_table post_div_table_cam_cc_pll4_out_even[] = {
+ { 0x1, 2 },
+ { }
+};
+
+static struct clk_alpha_pll_postdiv cam_cc_pll4_out_even = {
+ .offset = 0x4000,
+ .post_div_shift = 8,
+ .post_div_table = post_div_table_cam_cc_pll4_out_even,
+ .num_post_div = ARRAY_SIZE(post_div_table_cam_cc_pll4_out_even),
+ .width = 4,
+ .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION],
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_pll4_out_even",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_pll4.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_alpha_pll_postdiv_trion_ops,
+ },
+};
+
+static const struct parent_map cam_cc_parent_map_0[] = {
+ { P_BI_TCXO, 0 },
+ { P_CAM_CC_PLL0_OUT_MAIN, 1 },
+ { P_CAM_CC_PLL0_OUT_EVEN, 2 },
+ { P_CAM_CC_PLL0_OUT_ODD, 3 },
+ { P_CAM_CC_PLL2_OUT_MAIN, 5 },
+};
+
+static const struct clk_parent_data cam_cc_parent_data_0[] = {
+ { .index = DT_BI_TCXO },
+ { .hw = &cam_cc_pll0.clkr.hw },
+ { .hw = &cam_cc_pll0_out_even.clkr.hw },
+ { .hw = &cam_cc_pll0_out_odd.clkr.hw },
+ { .hw = &cam_cc_pll2_out_main.clkr.hw },
+};
+
+static const struct parent_map cam_cc_parent_map_1[] = {
+ { P_BI_TCXO, 0 },
+ { P_CAM_CC_PLL2_OUT_EARLY, 5 },
+};
+
+static const struct clk_parent_data cam_cc_parent_data_1[] = {
+ { .index = DT_BI_TCXO },
+ { .hw = &cam_cc_pll2.clkr.hw },
+};
+
+static const struct parent_map cam_cc_parent_map_2[] = {
+ { P_BI_TCXO, 0 },
+ { P_CAM_CC_PLL3_OUT_EVEN, 6 },
+};
+
+static const struct clk_parent_data cam_cc_parent_data_2[] = {
+ { .index = DT_BI_TCXO },
+ { .hw = &cam_cc_pll3_out_even.clkr.hw },
+};
+
+static const struct parent_map cam_cc_parent_map_3[] = {
+ { P_BI_TCXO, 0 },
+ { P_CAM_CC_PLL4_OUT_EVEN, 6 },
+};
+
+static const struct clk_parent_data cam_cc_parent_data_3[] = {
+ { .index = DT_BI_TCXO },
+ { .hw = &cam_cc_pll4_out_even.clkr.hw },
+};
+
+static const struct parent_map cam_cc_parent_map_4[] = {
+ { P_BI_TCXO, 0 },
+ { P_CAM_CC_PLL1_OUT_EVEN, 4 },
+};
+
+static const struct clk_parent_data cam_cc_parent_data_4[] = {
+ { .index = DT_BI_TCXO },
+ { .hw = &cam_cc_pll1_out_even.clkr.hw },
+};
+
+static const struct freq_tbl ftbl_cam_cc_bps_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(100000000, P_CAM_CC_PLL0_OUT_EVEN, 6, 0, 0),
+ F(200000000, P_CAM_CC_PLL0_OUT_ODD, 2, 0, 0),
+ F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0),
+ F(480000000, P_CAM_CC_PLL2_OUT_MAIN, 1, 0, 0),
+ F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_bps_clk_src = {
+ .cmd_rcgr = 0x7010,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_bps_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_camnoc_axi_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(150000000, P_CAM_CC_PLL0_OUT_EVEN, 4, 0, 0),
+ F(266666667, P_CAM_CC_PLL0_OUT_ODD, 1.5, 0, 0),
+ F(320000000, P_CAM_CC_PLL2_OUT_MAIN, 1.5, 0, 0),
+ F(400000000, P_CAM_CC_PLL0_OUT_MAIN, 3, 0, 0),
+ F(480000000, P_CAM_CC_PLL2_OUT_MAIN, 1, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_camnoc_axi_clk_src = {
+ .cmd_rcgr = 0xc170,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_camnoc_axi_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_cci_0_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(37500000, P_CAM_CC_PLL0_OUT_EVEN, 16, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_cci_0_clk_src = {
+ .cmd_rcgr = 0xc108,
+ .mnd_width = 8,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_cci_0_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_cci_1_clk_src = {
+ .cmd_rcgr = 0xc124,
+ .mnd_width = 8,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_cci_0_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_cphy_rx_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_cphy_rx_clk_src = {
+ .cmd_rcgr = 0xa064,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_cphy_rx_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_csi0phytimer_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(300000000, P_CAM_CC_PLL0_OUT_EVEN, 2, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_csi0phytimer_clk_src = {
+ .cmd_rcgr = 0x6004,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_csi1phytimer_clk_src = {
+ .cmd_rcgr = 0x6028,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_csi2phytimer_clk_src = {
+ .cmd_rcgr = 0x604c,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_csi2phytimer_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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_csi3phytimer_clk_src = {
+ .cmd_rcgr = 0x6070,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_csi0phytimer_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_fast_ahb_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(50000000, P_CAM_CC_PLL0_OUT_EVEN, 12, 0, 0),
+ F(100000000, P_CAM_CC_PLL0_OUT_EVEN, 6, 0, 0),
+ F(200000000, P_CAM_CC_PLL0_OUT_EVEN, 3, 0, 0),
+ F(300000000, P_CAM_CC_PLL0_OUT_MAIN, 4, 0, 0),
+ F(400000000, P_CAM_CC_PLL0_OUT_MAIN, 3, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_fast_ahb_clk_src = {
+ .cmd_rcgr = 0x703c,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_fast_ahb_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_fd_core_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0),
+ F(480000000, P_CAM_CC_PLL2_OUT_MAIN, 1, 0, 0),
+ F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_fd_core_clk_src = {
+ .cmd_rcgr = 0xc0e0,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_fd_core_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_icp_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0),
+ F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_icp_clk_src = {
+ .cmd_rcgr = 0xc0b8,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_icp_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_ife_0_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(400000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0),
+ F(558000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0),
+ F(637000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0),
+ F(847000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0),
+ F(950000000, P_CAM_CC_PLL3_OUT_EVEN, 1, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_ife_0_clk_src = {
+ .cmd_rcgr = 0xa010,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_2,
+ .freq_tbl = ftbl_cam_cc_ife_0_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_ife_0_csid_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(75000000, P_CAM_CC_PLL0_OUT_EVEN, 8, 0, 0),
+ F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0),
+ F(480000000, P_CAM_CC_PLL2_OUT_MAIN, 1, 0, 0),
+ F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_ife_0_csid_clk_src = {
+ .cmd_rcgr = 0xa03c,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_ife_0_csid_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_ife_1_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(400000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0),
+ F(558000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0),
+ F(637000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0),
+ F(847000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0),
+ F(950000000, P_CAM_CC_PLL4_OUT_EVEN, 1, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_ife_1_clk_src = {
+ .cmd_rcgr = 0xb010,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_3,
+ .freq_tbl = ftbl_cam_cc_ife_1_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_ife_1_csid_clk_src = {
+ .cmd_rcgr = 0xb034,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_ife_0_csid_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_ife_lite_0_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(320000000, P_CAM_CC_PLL2_OUT_MAIN, 1.5, 0, 0),
+ F(400000000, P_CAM_CC_PLL0_OUT_ODD, 1, 0, 0),
+ F(480000000, P_CAM_CC_PLL2_OUT_MAIN, 1, 0, 0),
+ F(600000000, P_CAM_CC_PLL0_OUT_MAIN, 2, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_ife_lite_0_clk_src = {
+ .cmd_rcgr = 0xc004,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_ife_lite_0_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_lite_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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_ife_lite_0_csid_clk_src = {
+ .cmd_rcgr = 0xc020,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_fd_core_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_lite_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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_ife_lite_1_clk_src = {
+ .cmd_rcgr = 0xc048,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_ife_lite_0_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_lite_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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_ife_lite_1_csid_clk_src = {
+ .cmd_rcgr = 0xc064,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_fd_core_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_lite_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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_ipe_0_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(300000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0),
+ F(475000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0),
+ F(520000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0),
+ F(600000000, P_CAM_CC_PLL1_OUT_EVEN, 1, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_ipe_0_clk_src = {
+ .cmd_rcgr = 0x8010,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_4,
+ .freq_tbl = ftbl_cam_cc_ipe_0_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_jpeg_clk_src = {
+ .cmd_rcgr = 0xc08c,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_bps_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_lrme_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(100000000, P_CAM_CC_PLL0_OUT_EVEN, 6, 0, 0),
+ F(240000000, P_CAM_CC_PLL2_OUT_MAIN, 2, 0, 0),
+ F(300000000, P_CAM_CC_PLL0_OUT_EVEN, 2, 0, 0),
+ F(320000000, P_CAM_CC_PLL2_OUT_MAIN, 1.5, 0, 0),
+ F(400000000, P_CAM_CC_PLL0_OUT_MAIN, 3, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_lrme_clk_src = {
+ .cmd_rcgr = 0xc144,
+ .mnd_width = 0,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_lrme_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_lrme_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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_mclk0_clk_src[] = {
+ F(12000000, P_CAM_CC_PLL2_OUT_EARLY, 10, 1, 8),
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(24000000, P_CAM_CC_PLL2_OUT_EARLY, 10, 1, 4),
+ F(68571429, P_CAM_CC_PLL2_OUT_EARLY, 14, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_mclk0_clk_src = {
+ .cmd_rcgr = 0x5004,
+ .mnd_width = 8,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_1,
+ .freq_tbl = ftbl_cam_cc_mclk0_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_mclk1_clk_src = {
+ .cmd_rcgr = 0x5024,
+ .mnd_width = 8,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_1,
+ .freq_tbl = ftbl_cam_cc_mclk0_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_mclk2_clk_src = {
+ .cmd_rcgr = 0x5044,
+ .mnd_width = 8,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_1,
+ .freq_tbl = ftbl_cam_cc_mclk0_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static struct clk_rcg2 cam_cc_mclk3_clk_src = {
+ .cmd_rcgr = 0x5064,
+ .mnd_width = 8,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_1,
+ .freq_tbl = ftbl_cam_cc_mclk0_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static const struct freq_tbl ftbl_cam_cc_slow_ahb_clk_src[] = {
+ F(19200000, P_BI_TCXO, 1, 0, 0),
+ F(80000000, P_CAM_CC_PLL0_OUT_EVEN, 7.5, 0, 0),
+ { }
+};
+
+static struct clk_rcg2 cam_cc_slow_ahb_clk_src = {
+ .cmd_rcgr = 0x7058,
+ .mnd_width = 8,
+ .hid_width = 5,
+ .parent_map = cam_cc_parent_map_0,
+ .freq_tbl = ftbl_cam_cc_slow_ahb_clk_src,
+ .clkr.hw.init = &(const struct clk_init_data) {
+ .name = "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_shared_ops,
+ },
+};
+
+static struct clk_branch cam_cc_bps_ahb_clk = {
+ .halt_reg = 0x7070,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x7070,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_bps_ahb_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_slow_ahb_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_bps_areg_clk = {
+ .halt_reg = 0x7054,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x7054,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_bps_areg_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_fast_ahb_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_bps_axi_clk = {
+ .halt_reg = 0x7038,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x7038,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_bps_axi_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_camnoc_axi_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_bps_clk = {
+ .halt_reg = 0x7028,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x7028,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_bps_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_bps_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_camnoc_axi_clk = {
+ .halt_reg = 0xc18c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc18c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_camnoc_axi_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_camnoc_axi_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_camnoc_dcd_xo_clk = {
+ .halt_reg = 0xc194,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc194,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_camnoc_dcd_xo_clk",
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_cci_0_clk = {
+ .halt_reg = 0xc120,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc120,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_cci_0_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_cci_0_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_cci_1_clk = {
+ .halt_reg = 0xc13c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc13c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_cci_1_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_cci_1_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_core_ahb_clk = {
+ .halt_reg = 0xc1c8,
+ .halt_check = BRANCH_HALT_DELAY,
+ .clkr = {
+ .enable_reg = 0xc1c8,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_core_ahb_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_slow_ahb_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_cpas_ahb_clk = {
+ .halt_reg = 0xc168,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc168,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_cpas_ahb_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_slow_ahb_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_csi0phytimer_clk = {
+ .halt_reg = 0x601c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x601c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_csi0phytimer_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_csi0phytimer_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_csi1phytimer_clk = {
+ .halt_reg = 0x6040,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x6040,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_csi1phytimer_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_csi1phytimer_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_csi2phytimer_clk = {
+ .halt_reg = 0x6064,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x6064,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_csi2phytimer_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_csi2phytimer_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_csi3phytimer_clk = {
+ .halt_reg = 0x6088,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x6088,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_csi3phytimer_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_csi3phytimer_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_csiphy0_clk = {
+ .halt_reg = 0x6020,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x6020,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_csiphy0_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_cphy_rx_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_csiphy1_clk = {
+ .halt_reg = 0x6044,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x6044,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_csiphy1_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_cphy_rx_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_csiphy2_clk = {
+ .halt_reg = 0x6068,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x6068,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_csiphy2_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_cphy_rx_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_csiphy3_clk = {
+ .halt_reg = 0x608c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x608c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_csiphy3_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_cphy_rx_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_fd_core_clk = {
+ .halt_reg = 0xc0f8,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc0f8,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_fd_core_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_fd_core_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_fd_core_uar_clk = {
+ .halt_reg = 0xc100,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc100,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_fd_core_uar_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_fd_core_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_icp_ahb_clk = {
+ .halt_reg = 0xc0d8,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc0d8,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_icp_ahb_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_slow_ahb_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_icp_clk = {
+ .halt_reg = 0xc0d0,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc0d0,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_icp_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_icp_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_0_axi_clk = {
+ .halt_reg = 0xa080,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xa080,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_0_axi_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_camnoc_axi_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_0_clk = {
+ .halt_reg = 0xa028,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xa028,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_0_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ife_0_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_0_cphy_rx_clk = {
+ .halt_reg = 0xa07c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xa07c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_0_cphy_rx_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_cphy_rx_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_0_csid_clk = {
+ .halt_reg = 0xa054,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xa054,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_0_csid_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ife_0_csid_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_0_dsp_clk = {
+ .halt_reg = 0xa038,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xa038,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_0_dsp_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ife_0_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_1_axi_clk = {
+ .halt_reg = 0xb058,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xb058,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_1_axi_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_camnoc_axi_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_1_clk = {
+ .halt_reg = 0xb028,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xb028,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_1_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ife_1_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_1_cphy_rx_clk = {
+ .halt_reg = 0xb054,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xb054,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_1_cphy_rx_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_cphy_rx_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_1_csid_clk = {
+ .halt_reg = 0xb04c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xb04c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_1_csid_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ife_1_csid_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_1_dsp_clk = {
+ .halt_reg = 0xb030,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xb030,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_1_dsp_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ife_1_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_lite_0_clk = {
+ .halt_reg = 0xc01c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc01c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_lite_0_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ife_lite_0_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_lite_0_cphy_rx_clk = {
+ .halt_reg = 0xc040,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc040,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_lite_0_cphy_rx_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_cphy_rx_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_lite_0_csid_clk = {
+ .halt_reg = 0xc038,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc038,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_lite_0_csid_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ife_lite_0_csid_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_lite_1_clk = {
+ .halt_reg = 0xc060,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc060,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_lite_1_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ife_lite_1_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_lite_1_cphy_rx_clk = {
+ .halt_reg = 0xc084,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc084,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_lite_1_cphy_rx_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_cphy_rx_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ife_lite_1_csid_clk = {
+ .halt_reg = 0xc07c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc07c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ife_lite_1_csid_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ife_lite_1_csid_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ipe_0_ahb_clk = {
+ .halt_reg = 0x8040,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x8040,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ipe_0_ahb_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_slow_ahb_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ipe_0_areg_clk = {
+ .halt_reg = 0x803c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x803c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ipe_0_areg_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_fast_ahb_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ipe_0_axi_clk = {
+ .halt_reg = 0x8038,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x8038,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ipe_0_axi_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_camnoc_axi_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ipe_0_clk = {
+ .halt_reg = 0x8028,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x8028,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ipe_0_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ipe_0_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ipe_1_ahb_clk = {
+ .halt_reg = 0x9028,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x9028,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ipe_1_ahb_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_slow_ahb_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ipe_1_areg_clk = {
+ .halt_reg = 0x9024,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x9024,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ipe_1_areg_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_fast_ahb_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ipe_1_axi_clk = {
+ .halt_reg = 0x9020,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x9020,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ipe_1_axi_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_camnoc_axi_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_ipe_1_clk = {
+ .halt_reg = 0x9010,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x9010,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_ipe_1_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_ipe_0_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_jpeg_clk = {
+ .halt_reg = 0xc0a4,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc0a4,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_jpeg_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_jpeg_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_lrme_clk = {
+ .halt_reg = 0xc15c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0xc15c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_lrme_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_lrme_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_mclk0_clk = {
+ .halt_reg = 0x501c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x501c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_mclk0_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_mclk0_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_mclk1_clk = {
+ .halt_reg = 0x503c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x503c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_mclk1_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_mclk1_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_mclk2_clk = {
+ .halt_reg = 0x505c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x505c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_mclk2_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_mclk2_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct clk_branch cam_cc_mclk3_clk = {
+ .halt_reg = 0x507c,
+ .halt_check = BRANCH_HALT,
+ .clkr = {
+ .enable_reg = 0x507c,
+ .enable_mask = BIT(0),
+ .hw.init = &(const struct clk_init_data) {
+ .name = "cam_cc_mclk3_clk",
+ .parent_hws = (const struct clk_hw*[]) {
+ &cam_cc_mclk3_clk_src.clkr.hw,
+ },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ .ops = &clk_branch2_ops,
+ },
+ },
+};
+
+static struct gdsc titan_top_gdsc = {
+ .gdscr = 0xc1bc,
+ .en_rest_wait_val = 0x2,
+ .en_few_wait_val = 0x2,
+ .clk_dis_wait_val = 0xf,
+ .pd = {
+ .name = "titan_top_gdsc",
+ },
+ .pwrsts = PWRSTS_OFF_ON,
+ .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
+};
+
+static struct gdsc bps_gdsc = {
+ .gdscr = 0x7004,
+ .en_rest_wait_val = 0x2,
+ .en_few_wait_val = 0x2,
+ .clk_dis_wait_val = 0xf,
+ .pd = {
+ .name = "bps_gdsc",
+ },
+ .pwrsts = PWRSTS_OFF_ON,
+ .parent = &titan_top_gdsc.pd,
+ .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
+};
+
+static struct gdsc ife_0_gdsc = {
+ .gdscr = 0xa004,
+ .en_rest_wait_val = 0x2,
+ .en_few_wait_val = 0x2,
+ .clk_dis_wait_val = 0xf,
+ .pd = {
+ .name = "ife_0_gdsc",
+ },
+ .pwrsts = PWRSTS_OFF_ON,
+ .parent = &titan_top_gdsc.pd,
+ .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
+};
+
+static struct gdsc ife_1_gdsc = {
+ .gdscr = 0xb004,
+ .en_rest_wait_val = 0x2,
+ .en_few_wait_val = 0x2,
+ .clk_dis_wait_val = 0xf,
+ .pd = {
+ .name = "ife_1_gdsc",
+ },
+ .pwrsts = PWRSTS_OFF_ON,
+ .parent = &titan_top_gdsc.pd,
+ .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
+};
+
+static struct gdsc ipe_0_gdsc = {
+ .gdscr = 0x8004,
+ .en_rest_wait_val = 0x2,
+ .en_few_wait_val = 0x2,
+ .clk_dis_wait_val = 0xf,
+ .pd = {
+ .name = "ipe_0_gdsc",
+ },
+ .pwrsts = PWRSTS_OFF_ON,
+ .parent = &titan_top_gdsc.pd,
+ .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
+};
+
+static struct gdsc ipe_1_gdsc = {
+ .gdscr = 0x9004,
+ .en_rest_wait_val = 0x2,
+ .en_few_wait_val = 0x2,
+ .clk_dis_wait_val = 0xf,
+ .pd = {
+ .name = "ipe_1_gdsc",
+ },
+ .pwrsts = PWRSTS_OFF_ON,
+ .parent = &titan_top_gdsc.pd,
+ .flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
+};
+
+static struct clk_regmap *cam_cc_sm8150_clocks[] = {
+ [CAM_CC_PLL0] = &cam_cc_pll0.clkr,
+ [CAM_CC_PLL0_OUT_EVEN] = &cam_cc_pll0_out_even.clkr,
+ [CAM_CC_PLL0_OUT_ODD] = &cam_cc_pll0_out_odd.clkr,
+ [CAM_CC_PLL1] = &cam_cc_pll1.clkr,
+ [CAM_CC_PLL1_OUT_EVEN] = &cam_cc_pll1_out_even.clkr,
+ [CAM_CC_PLL2] = &cam_cc_pll2.clkr,
+ [CAM_CC_PLL2_OUT_MAIN] = &cam_cc_pll2_out_main.clkr,
+ [CAM_CC_PLL3] = &cam_cc_pll3.clkr,
+ [CAM_CC_PLL3_OUT_EVEN] = &cam_cc_pll3_out_even.clkr,
+ [CAM_CC_PLL4] = &cam_cc_pll4.clkr,
+ [CAM_CC_PLL4_OUT_EVEN] = &cam_cc_pll4_out_even.clkr,
+ [CAM_CC_BPS_AHB_CLK] = &cam_cc_bps_ahb_clk.clkr,
+ [CAM_CC_BPS_AREG_CLK] = &cam_cc_bps_areg_clk.clkr,
+ [CAM_CC_BPS_AXI_CLK] = &cam_cc_bps_axi_clk.clkr,
+ [CAM_CC_BPS_CLK] = &cam_cc_bps_clk.clkr,
+ [CAM_CC_BPS_CLK_SRC] = &cam_cc_bps_clk_src.clkr,
+ [CAM_CC_CAMNOC_AXI_CLK] = &cam_cc_camnoc_axi_clk.clkr,
+ [CAM_CC_CAMNOC_AXI_CLK_SRC] = &cam_cc_camnoc_axi_clk_src.clkr,
+ [CAM_CC_CAMNOC_DCD_XO_CLK] = &cam_cc_camnoc_dcd_xo_clk.clkr,
+ [CAM_CC_CCI_0_CLK] = &cam_cc_cci_0_clk.clkr,
+ [CAM_CC_CCI_0_CLK_SRC] = &cam_cc_cci_0_clk_src.clkr,
+ [CAM_CC_CCI_1_CLK] = &cam_cc_cci_1_clk.clkr,
+ [CAM_CC_CCI_1_CLK_SRC] = &cam_cc_cci_1_clk_src.clkr,
+ [CAM_CC_CORE_AHB_CLK] = &cam_cc_core_ahb_clk.clkr,
+ [CAM_CC_CPAS_AHB_CLK] = &cam_cc_cpas_ahb_clk.clkr,
+ [CAM_CC_CPHY_RX_CLK_SRC] = &cam_cc_cphy_rx_clk_src.clkr,
+ [CAM_CC_CSI0PHYTIMER_CLK] = &cam_cc_csi0phytimer_clk.clkr,
+ [CAM_CC_CSI0PHYTIMER_CLK_SRC] = &cam_cc_csi0phytimer_clk_src.clkr,
+ [CAM_CC_CSI1PHYTIMER_CLK] = &cam_cc_csi1phytimer_clk.clkr,
+ [CAM_CC_CSI1PHYTIMER_CLK_SRC] = &cam_cc_csi1phytimer_clk_src.clkr,
+ [CAM_CC_CSI2PHYTIMER_CLK] = &cam_cc_csi2phytimer_clk.clkr,
+ [CAM_CC_CSI2PHYTIMER_CLK_SRC] = &cam_cc_csi2phytimer_clk_src.clkr,
+ [CAM_CC_CSI3PHYTIMER_CLK] = &cam_cc_csi3phytimer_clk.clkr,
+ [CAM_CC_CSI3PHYTIMER_CLK_SRC] = &cam_cc_csi3phytimer_clk_src.clkr,
+ [CAM_CC_CSIPHY0_CLK] = &cam_cc_csiphy0_clk.clkr,
+ [CAM_CC_CSIPHY1_CLK] = &cam_cc_csiphy1_clk.clkr,
+ [CAM_CC_CSIPHY2_CLK] = &cam_cc_csiphy2_clk.clkr,
+ [CAM_CC_CSIPHY3_CLK] = &cam_cc_csiphy3_clk.clkr,
+ [CAM_CC_FAST_AHB_CLK_SRC] = &cam_cc_fast_ahb_clk_src.clkr,
+ [CAM_CC_FD_CORE_CLK] = &cam_cc_fd_core_clk.clkr,
+ [CAM_CC_FD_CORE_CLK_SRC] = &cam_cc_fd_core_clk_src.clkr,
+ [CAM_CC_FD_CORE_UAR_CLK] = &cam_cc_fd_core_uar_clk.clkr,
+ [CAM_CC_ICP_AHB_CLK] = &cam_cc_icp_ahb_clk.clkr,
+ [CAM_CC_ICP_CLK] = &cam_cc_icp_clk.clkr,
+ [CAM_CC_ICP_CLK_SRC] = &cam_cc_icp_clk_src.clkr,
+ [CAM_CC_IFE_0_AXI_CLK] = &cam_cc_ife_0_axi_clk.clkr,
+ [CAM_CC_IFE_0_CLK] = &cam_cc_ife_0_clk.clkr,
+ [CAM_CC_IFE_0_CLK_SRC] = &cam_cc_ife_0_clk_src.clkr,
+ [CAM_CC_IFE_0_CPHY_RX_CLK] = &cam_cc_ife_0_cphy_rx_clk.clkr,
+ [CAM_CC_IFE_0_CSID_CLK] = &cam_cc_ife_0_csid_clk.clkr,
+ [CAM_CC_IFE_0_CSID_CLK_SRC] = &cam_cc_ife_0_csid_clk_src.clkr,
+ [CAM_CC_IFE_0_DSP_CLK] = &cam_cc_ife_0_dsp_clk.clkr,
+ [CAM_CC_IFE_1_AXI_CLK] = &cam_cc_ife_1_axi_clk.clkr,
+ [CAM_CC_IFE_1_CLK] = &cam_cc_ife_1_clk.clkr,
+ [CAM_CC_IFE_1_CLK_SRC] = &cam_cc_ife_1_clk_src.clkr,
+ [CAM_CC_IFE_1_CPHY_RX_CLK] = &cam_cc_ife_1_cphy_rx_clk.clkr,
+ [CAM_CC_IFE_1_CSID_CLK] = &cam_cc_ife_1_csid_clk.clkr,
+ [CAM_CC_IFE_1_CSID_CLK_SRC] = &cam_cc_ife_1_csid_clk_src.clkr,
+ [CAM_CC_IFE_1_DSP_CLK] = &cam_cc_ife_1_dsp_clk.clkr,
+ [CAM_CC_IFE_LITE_0_CLK] = &cam_cc_ife_lite_0_clk.clkr,
+ [CAM_CC_IFE_LITE_0_CLK_SRC] = &cam_cc_ife_lite_0_clk_src.clkr,
+ [CAM_CC_IFE_LITE_0_CPHY_RX_CLK] = &cam_cc_ife_lite_0_cphy_rx_clk.clkr,
+ [CAM_CC_IFE_LITE_0_CSID_CLK] = &cam_cc_ife_lite_0_csid_clk.clkr,
+ [CAM_CC_IFE_LITE_0_CSID_CLK_SRC] = &cam_cc_ife_lite_0_csid_clk_src.clkr,
+ [CAM_CC_IFE_LITE_1_CLK] = &cam_cc_ife_lite_1_clk.clkr,
+ [CAM_CC_IFE_LITE_1_CLK_SRC] = &cam_cc_ife_lite_1_clk_src.clkr,
+ [CAM_CC_IFE_LITE_1_CPHY_RX_CLK] = &cam_cc_ife_lite_1_cphy_rx_clk.clkr,
+ [CAM_CC_IFE_LITE_1_CSID_CLK] = &cam_cc_ife_lite_1_csid_clk.clkr,
+ [CAM_CC_IFE_LITE_1_CSID_CLK_SRC] = &cam_cc_ife_lite_1_csid_clk_src.clkr,
+ [CAM_CC_IPE_0_AHB_CLK] = &cam_cc_ipe_0_ahb_clk.clkr,
+ [CAM_CC_IPE_0_AREG_CLK] = &cam_cc_ipe_0_areg_clk.clkr,
+ [CAM_CC_IPE_0_AXI_CLK] = &cam_cc_ipe_0_axi_clk.clkr,
+ [CAM_CC_IPE_0_CLK] = &cam_cc_ipe_0_clk.clkr,
+ [CAM_CC_IPE_0_CLK_SRC] = &cam_cc_ipe_0_clk_src.clkr,
+ [CAM_CC_IPE_1_AHB_CLK] = &cam_cc_ipe_1_ahb_clk.clkr,
+ [CAM_CC_IPE_1_AREG_CLK] = &cam_cc_ipe_1_areg_clk.clkr,
+ [CAM_CC_IPE_1_AXI_CLK] = &cam_cc_ipe_1_axi_clk.clkr,
+ [CAM_CC_IPE_1_CLK] = &cam_cc_ipe_1_clk.clkr,
+ [CAM_CC_JPEG_CLK] = &cam_cc_jpeg_clk.clkr,
+ [CAM_CC_JPEG_CLK_SRC] = &cam_cc_jpeg_clk_src.clkr,
+ [CAM_CC_LRME_CLK] = &cam_cc_lrme_clk.clkr,
+ [CAM_CC_LRME_CLK_SRC] = &cam_cc_lrme_clk_src.clkr,
+ [CAM_CC_MCLK0_CLK] = &cam_cc_mclk0_clk.clkr,
+ [CAM_CC_MCLK0_CLK_SRC] = &cam_cc_mclk0_clk_src.clkr,
+ [CAM_CC_MCLK1_CLK] = &cam_cc_mclk1_clk.clkr,
+ [CAM_CC_MCLK1_CLK_SRC] = &cam_cc_mclk1_clk_src.clkr,
+ [CAM_CC_MCLK2_CLK] = &cam_cc_mclk2_clk.clkr,
+ [CAM_CC_MCLK2_CLK_SRC] = &cam_cc_mclk2_clk_src.clkr,
+ [CAM_CC_MCLK3_CLK] = &cam_cc_mclk3_clk.clkr,
+ [CAM_CC_MCLK3_CLK_SRC] = &cam_cc_mclk3_clk_src.clkr,
+ [CAM_CC_SLOW_AHB_CLK_SRC] = &cam_cc_slow_ahb_clk_src.clkr,
+};
+
+static struct gdsc *cam_cc_sm8150_gdscs[] = {
+ [TITAN_TOP_GDSC] = &titan_top_gdsc,
+ [BPS_GDSC] = &bps_gdsc,
+ [IFE_0_GDSC] = &ife_0_gdsc,
+ [IFE_1_GDSC] = &ife_1_gdsc,
+ [IPE_0_GDSC] = &ipe_0_gdsc,
+ [IPE_1_GDSC] = &ipe_1_gdsc,
+};
+
+static const struct qcom_reset_map cam_cc_sm8150_resets[] = {
+ [CAM_CC_BPS_BCR] = { 0x7000 },
+ [CAM_CC_CAMNOC_BCR] = { 0xc16c },
+ [CAM_CC_CCI_BCR] = { 0xc104 },
+ [CAM_CC_CPAS_BCR] = { 0xc164 },
+ [CAM_CC_CSI0PHY_BCR] = { 0x6000 },
+ [CAM_CC_CSI1PHY_BCR] = { 0x6024 },
+ [CAM_CC_CSI2PHY_BCR] = { 0x6048 },
+ [CAM_CC_CSI3PHY_BCR] = { 0x606c },
+ [CAM_CC_FD_BCR] = { 0xc0dc },
+ [CAM_CC_ICP_BCR] = { 0xc0b4 },
+ [CAM_CC_IFE_0_BCR] = { 0xa000 },
+ [CAM_CC_IFE_1_BCR] = { 0xb000 },
+ [CAM_CC_IFE_LITE_0_BCR] = { 0xc000 },
+ [CAM_CC_IFE_LITE_1_BCR] = { 0xc044 },
+ [CAM_CC_IPE_0_BCR] = { 0x8000 },
+ [CAM_CC_IPE_1_BCR] = { 0x9000 },
+ [CAM_CC_JPEG_BCR] = { 0xc088 },
+ [CAM_CC_LRME_BCR] = { 0xc140 },
+ [CAM_CC_MCLK0_BCR] = { 0x5000 },
+ [CAM_CC_MCLK1_BCR] = { 0x5020 },
+ [CAM_CC_MCLK2_BCR] = { 0x5040 },
+ [CAM_CC_MCLK3_BCR] = { 0x5060 },
+};
+
+static const struct regmap_config cam_cc_sm8150_regmap_config = {
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+ .max_register = 0xe004,
+ .fast_io = true,
+};
+
+static 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),
+ .resets = cam_cc_sm8150_resets,
+ .num_resets = ARRAY_SIZE(cam_cc_sm8150_resets),
+ .gdscs = cam_cc_sm8150_gdscs,
+ .num_gdscs = ARRAY_SIZE(cam_cc_sm8150_gdscs),
+};
+
+static const struct of_device_id cam_cc_sm8150_match_table[] = {
+ { .compatible = "qcom,sm8150-camcc" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, cam_cc_sm8150_match_table);
+
+static int cam_cc_sm8150_probe(struct platform_device *pdev)
+{
+ struct regmap *regmap;
+ int ret;
+
+ ret = devm_pm_runtime_enable(&pdev->dev);
+ if (ret)
+ return ret;
+
+ ret = pm_runtime_resume_and_get(&pdev->dev);
+ if (ret)
+ return ret;
+
+ regmap = qcom_cc_map(pdev, &cam_cc_sm8150_desc);
+ if (IS_ERR(regmap)) {
+ pm_runtime_put(&pdev->dev);
+ return PTR_ERR(regmap);
+ }
+
+ clk_trion_pll_configure(&cam_cc_pll0, regmap, &cam_cc_pll0_config);
+ clk_trion_pll_configure(&cam_cc_pll1, regmap, &cam_cc_pll1_config);
+ clk_regera_pll_configure(&cam_cc_pll2, regmap, &cam_cc_pll2_config);
+ clk_trion_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config);
+ clk_trion_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config);
+
+ /* Keep the critical clock always-on */
+ qcom_branch_set_clk_en(regmap, 0xc1e4); /* cam_cc_gdsc_clk */
+
+ ret = qcom_cc_really_probe(pdev, &cam_cc_sm8150_desc, regmap);
+
+ pm_runtime_put(&pdev->dev);
+
+ return ret;
+}
+
+static struct platform_driver cam_cc_sm8150_driver = {
+ .probe = cam_cc_sm8150_probe,
+ .driver = {
+ .name = "camcc-sm8150",
+ .of_match_table = cam_cc_sm8150_match_table,
+ },
+};
+
+module_platform_driver(cam_cc_sm8150_driver);
+
+MODULE_DESCRIPTION("QTI CAM_CC SM8150 Driver");
+MODULE_LICENSE("GPL");
--
2.25.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v2 6/6] arm64: dts: qcom: Add camera clock controller for sm8150
2024-07-02 15:50 [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Satya Priya Kakitapalli
` (4 preceding siblings ...)
2024-07-02 15:50 ` [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150 Satya Priya Kakitapalli
@ 2024-07-02 15:50 ` Satya Priya Kakitapalli
2024-07-03 10:08 ` [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Dmitry Baryshkov
6 siblings, 0 replies; 33+ messages in thread
From: Satya Priya Kakitapalli @ 2024-07-02 15:50 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Satya Priya Kakitapalli
Add device node for camera clock controller on Qualcomm
SM8150 platform.
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
---
arch/arm64/boot/dts/qcom/sa8155p.dtsi | 4 ++++
arch/arm64/boot/dts/qcom/sm8150.dtsi | 13 +++++++++++++
2 files changed, 17 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sa8155p.dtsi b/arch/arm64/boot/dts/qcom/sa8155p.dtsi
index ffb7ab695213..52f6019885c1 100644
--- a/arch/arm64/boot/dts/qcom/sa8155p.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8155p.dtsi
@@ -9,6 +9,10 @@
#include "sm8150.dtsi"
+&camcc {
+ power-domains = <&rpmhpd SA8155P_CX>;
+};
+
&dispcc {
power-domains = <&rpmhpd SA8155P_CX>;
};
diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index a35c0852b5a1..7ea6c5e4f886 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -16,6 +16,7 @@
#include <dt-bindings/clock/qcom,gpucc-sm8150.h>
#include <dt-bindings/interconnect/qcom,osm-l3.h>
#include <dt-bindings/interconnect/qcom,sm8150.h>
+#include <dt-bindings/clock/qcom,sm8150-camcc.h>
#include <dt-bindings/thermal/thermal.h>
/ {
@@ -3722,6 +3723,18 @@ camnoc_virt: interconnect@ac00000 {
qcom,bcm-voters = <&apps_bcm_voter>;
};
+ camcc: clock-controller@ad00000 {
+ compatible = "qcom,sm8150-camcc";
+ reg = <0 0x0ad00000 0 0x10000>;
+ clocks = <&rpmhcc RPMH_CXO_CLK>,
+ <&gcc GCC_CAMERA_AHB_CLK>;
+ power-domains = <&rpmhpd SM8150_MMCX>;
+ required-opps = <&rpmhpd_opp_low_svs>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ #power-domain-cells = <1>;
+ };
+
mdss: display-subsystem@ae00000 {
compatible = "qcom,sm8150-mdss";
reg = <0 0x0ae00000 0 0x1000>;
--
2.25.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [PATCH v2 1/6] clk: qcom: alpha-pll: Fix the pll post div mask and shift
2024-07-02 15:50 ` [PATCH v2 1/6] clk: qcom: alpha-pll: Fix the pll post div mask and shift Satya Priya Kakitapalli
@ 2024-07-03 10:01 ` Dmitry Baryshkov
0 siblings, 0 replies; 33+ messages in thread
From: Dmitry Baryshkov @ 2024-07-03 10:01 UTC (permalink / raw)
To: Satya Priya Kakitapalli
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona, stable
On Tue, Jul 02, 2024 at 09:20:39PM GMT, Satya Priya Kakitapalli wrote:
> The PLL_POST_DIV_MASK should be 0 to (width - 1) bits. Fix it.
> Also, correct the pll postdiv shift used in trion pll postdiv
> set rate API. The shift value is not same for different types of
> plls and should be taken from the pll's .post_div_shift member.
Two separate commits for two different fixes, please.
>
> Fixes: 1c3541145cbf ("clk: qcom: support for 2 bit PLL post divider")
> Cc: stable@vger.kernel.org
> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> ---
> drivers/clk/qcom/clk-alpha-pll.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
> index 8a412ef47e16..6107c144c0f5 100644
> --- a/drivers/clk/qcom/clk-alpha-pll.c
> +++ b/drivers/clk/qcom/clk-alpha-pll.c
> @@ -40,7 +40,7 @@
>
> #define PLL_USER_CTL(p) ((p)->offset + (p)->regs[PLL_OFF_USER_CTL])
> # define PLL_POST_DIV_SHIFT 8
> -# define PLL_POST_DIV_MASK(p) GENMASK((p)->width, 0)
> +# define PLL_POST_DIV_MASK(p) GENMASK((p)->width - 1, 0)
> # define PLL_ALPHA_EN BIT(24)
> # define PLL_ALPHA_MODE BIT(25)
> # define PLL_VCO_SHIFT 20
> @@ -1496,8 +1496,8 @@ clk_trion_pll_postdiv_set_rate(struct clk_hw *hw, unsigned long rate,
> }
>
> return regmap_update_bits(regmap, PLL_USER_CTL(pll),
> - PLL_POST_DIV_MASK(pll) << PLL_POST_DIV_SHIFT,
> - val << PLL_POST_DIV_SHIFT);
> + PLL_POST_DIV_MASK(pll) << pll->post_div_shift,
> + val << pll->post_div_shift);
> }
>
> const struct clk_ops clk_alpha_pll_postdiv_trion_ops = {
>
> --
> 2.25.1
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 2/6] clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL
2024-07-02 15:50 ` [PATCH v2 2/6] clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL Satya Priya Kakitapalli
@ 2024-07-03 10:02 ` Dmitry Baryshkov
2024-07-06 13:39 ` Konrad Dybcio
1 sibling, 0 replies; 33+ messages in thread
From: Dmitry Baryshkov @ 2024-07-03 10:02 UTC (permalink / raw)
To: Satya Priya Kakitapalli
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On Tue, Jul 02, 2024 at 09:20:40PM GMT, Satya Priya Kakitapalli wrote:
> The Zonda PLL has a 16 bit signed alpha and in the cases where the alpha
> value is greater than 0.5, the L value needs to be adjusted accordingly.
> Thus update the logic for the same.
>
> Also, fix zonda set_rate failure when PLL is disabled. Currently,
> clk_zonda_pll_set_rate polls for the PLL to lock even if the PLL is
> disabled. However, if the PLL is disabled then LOCK_DET will never
> assert and we'll return an error. There is no reason to poll LOCK_DET
> if the PLL is already disabled, so skip polling in this case.
Two separate commits, missing Fixes tags.
>
> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> ---
> drivers/clk/qcom/clk-alpha-pll.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 3/6] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops
2024-07-02 15:50 ` [PATCH v2 3/6] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops Satya Priya Kakitapalli
@ 2024-07-03 10:05 ` Dmitry Baryshkov
2024-07-06 13:45 ` Konrad Dybcio
2024-07-09 10:51 ` Satya Priya Kakitapalli (Temp)
0 siblings, 2 replies; 33+ messages in thread
From: Dmitry Baryshkov @ 2024-07-03 10:05 UTC (permalink / raw)
To: Satya Priya Kakitapalli
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On Tue, Jul 02, 2024 at 09:20:41PM GMT, Satya Priya Kakitapalli wrote:
> From: Taniya Das <quic_tdas@quicinc.com>
>
> Regera PLL ops are required to control the Regera PLL from clock
> controller drivers, thus add support for the same.
the same what?
>
> Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> ---
> drivers/clk/qcom/clk-alpha-pll.c | 32 +++++++++++++++++++++++++++++++-
> drivers/clk/qcom/clk-alpha-pll.h | 5 +++++
> 2 files changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
> index d2bef078588f..afb7ab72c90d 100644
> --- a/drivers/clk/qcom/clk-alpha-pll.c
> +++ b/drivers/clk/qcom/clk-alpha-pll.c
> @@ -1,7 +1,7 @@
> // SPDX-License-Identifier: GPL-2.0
> /*
> * Copyright (c) 2015, 2018, The Linux Foundation. All rights reserved.
> - * Copyright (c) 2021, 2023, Qualcomm Innovation Center, Inc. All rights reserved.
> + * Copyright (c) 2021, 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
> */
>
> #include <linux/kernel.h>
> @@ -2605,3 +2605,33 @@ const struct clk_ops clk_alpha_pll_stromer_plus_ops = {
> .set_rate = clk_alpha_pll_stromer_plus_set_rate,
> };
> EXPORT_SYMBOL_GPL(clk_alpha_pll_stromer_plus_ops);
> +
> +void clk_regera_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
> + const struct alpha_pll_config *config)
> +{
> + clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l);
> + clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);
> + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL(pll), config->config_ctl_val);
> + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U(pll), config->config_ctl_hi_val);
> + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U1(pll), config->config_ctl_hi1_val);
> + clk_alpha_pll_write_config(regmap, PLL_USER_CTL(pll), config->user_ctl_val);
> + clk_alpha_pll_write_config(regmap, PLL_USER_CTL_U(pll), config->user_ctl_hi_val);
> + clk_alpha_pll_write_config(regmap, PLL_USER_CTL_U1(pll), config->user_ctl_hi1_val);
> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), config->test_ctl_val);
> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), config->test_ctl_hi_val);
> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll), config->test_ctl_hi1_val);
> +
> + /* Set operation mode to STANDBY */
> + regmap_write(regmap, PLL_OPMODE(pll), PLL_STANDBY);
> +}
> +EXPORT_SYMBOL_GPL(clk_regera_pll_configure);
Does it make sense to call this function from clk_zonda_pll_configure()?
> +
> +const struct clk_ops clk_alpha_pll_regera_ops = {
> + .enable = clk_zonda_pll_enable,
> + .disable = clk_zonda_pll_disable,
> + .is_enabled = clk_alpha_pll_is_enabled,
> + .recalc_rate = clk_trion_pll_recalc_rate,
> + .round_rate = clk_alpha_pll_round_rate,
> + .set_rate = clk_zonda_pll_set_rate,
> +};
> +EXPORT_SYMBOL_GPL(clk_alpha_pll_regera_ops);
> diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h
> index fb6d50263bb9..5bb0a07da53d 100644
> --- a/drivers/clk/qcom/clk-alpha-pll.h
> +++ b/drivers/clk/qcom/clk-alpha-pll.h
> @@ -21,6 +21,7 @@ enum {
> CLK_ALPHA_PLL_TYPE_LUCID = CLK_ALPHA_PLL_TYPE_TRION,
> CLK_ALPHA_PLL_TYPE_AGERA,
> CLK_ALPHA_PLL_TYPE_ZONDA,
> + CLK_ALPHA_PLL_TYPE_REGERA = CLK_ALPHA_PLL_TYPE_ZONDA,
> CLK_ALPHA_PLL_TYPE_ZONDA_OLE,
> CLK_ALPHA_PLL_TYPE_LUCID_EVO,
> CLK_ALPHA_PLL_TYPE_LUCID_OLE,
> @@ -189,6 +190,8 @@ extern const struct clk_ops clk_alpha_pll_postdiv_lucid_evo_ops;
> extern const struct clk_ops clk_alpha_pll_rivian_evo_ops;
> #define clk_alpha_pll_postdiv_rivian_evo_ops clk_alpha_pll_postdiv_fabia_ops
>
> +extern const struct clk_ops clk_alpha_pll_regera_ops;
> +
> void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
> const struct alpha_pll_config *config);
> void clk_fabia_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
> @@ -210,5 +213,7 @@ void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regm
> const struct alpha_pll_config *config);
> void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
> const struct alpha_pll_config *config);
> +void clk_regera_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
> + const struct alpha_pll_config *config);
>
> #endif
>
> --
> 2.25.1
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150
2024-07-02 15:50 [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Satya Priya Kakitapalli
` (5 preceding siblings ...)
2024-07-02 15:50 ` [PATCH v2 6/6] arm64: dts: qcom: Add camera clock controller for sm8150 Satya Priya Kakitapalli
@ 2024-07-03 10:08 ` Dmitry Baryshkov
6 siblings, 0 replies; 33+ messages in thread
From: Dmitry Baryshkov @ 2024-07-03 10:08 UTC (permalink / raw)
To: Satya Priya Kakitapalli
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona, stable,
Krzysztof Kozlowski, Bryan O'Donoghue
On Tue, Jul 02, 2024 at 09:20:38PM GMT, Satya Priya Kakitapalli wrote:
> Add camcc support and Regera PLL ops. Also, fix the pll post div mask.
>
> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> ---
> Changes in v2:
> - As per Konrad's comments, re-use the zonda pll code for regera, as
> both are mostly same.
> - Fix the zonda_set_rate API and also the pll_post_div shift used in
> trion pll post div set rate API
> - Link to v1: https://lore.kernel.org/r/20240229-camcc-support-sm8150-v1-0-8c28c6c87990@quicinc.com
>
> ---
> Satya Priya Kakitapalli (5):
> clk: qcom: alpha-pll: Fix the pll post div mask and shift
> clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL
> dt-bindings: clock: qcom: Add SM8150 camera clock controller
> clk: qcom: Add camera clock controller driver for SM8150
> arm64: dts: qcom: Add camera clock controller for sm8150
>
> Taniya Das (1):
> clk: qcom: clk-alpha-pll: Add support for Regera PLL ops
>
> .../bindings/clock/qcom,sm8150-camcc.yaml | 77 +
> arch/arm64/boot/dts/qcom/sa8155p.dtsi | 4 +
> arch/arm64/boot/dts/qcom/sm8150.dtsi | 13 +
> drivers/clk/qcom/Kconfig | 9 +
> drivers/clk/qcom/Makefile | 1 +
> drivers/clk/qcom/camcc-sm8150.c | 2159 ++++++++++++++++++++
> drivers/clk/qcom/clk-alpha-pll.c | 56 +-
> drivers/clk/qcom/clk-alpha-pll.h | 5 +
> include/dt-bindings/clock/qcom,sm8150-camcc.h | 135 ++
> 9 files changed, 2455 insertions(+), 4 deletions(-)
> ---
> base-commit: 20af1ca418d2c0b11bc2a1fe8c0c88f67bcc2a7e
20240228 is very very old. Please don't base your changes on historical
linux-next trees. Currently your patchset doesn't even apply cleanly.
> change-id: 20240229-camcc-support-sm8150-d3f72a4a1a2b
>
> Best regards,
> --
> Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 4/6] dt-bindings: clock: qcom: Add SM8150 camera clock controller
2024-07-02 15:50 ` [PATCH v2 4/6] dt-bindings: clock: qcom: Add SM8150 camera clock controller Satya Priya Kakitapalli
@ 2024-07-03 10:14 ` Dmitry Baryshkov
2024-07-09 10:53 ` Satya Priya Kakitapalli (Temp)
0 siblings, 1 reply; 33+ messages in thread
From: Dmitry Baryshkov @ 2024-07-03 10:14 UTC (permalink / raw)
To: Satya Priya Kakitapalli
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Krzysztof Kozlowski
On Tue, Jul 02, 2024 at 09:20:42PM GMT, Satya Priya Kakitapalli wrote:
> Add device tree bindings for the camera clock controller on
> Qualcomm SM8150 platform.
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> ---
> .../bindings/clock/qcom,sm8150-camcc.yaml | 77 ++++++++++++
> include/dt-bindings/clock/qcom,sm8150-camcc.h | 135 +++++++++++++++++++++
> 2 files changed, 212 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml
> new file mode 100644
> index 000000000000..8fc27ba4be4b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml
> @@ -0,0 +1,77 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/clock/qcom,sm8150-camcc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Camera Clock & Reset Controller on SM8150
> +
> +maintainers:
> + - Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> +
> +description: |
> + Qualcomm camera clock control module provides the clocks, resets and
> + power domains on SM8150.
> +
> + See also:: include/dt-bindings/clock/qcom,sm8150-camcc.h
> +
> +properties:
> + compatible:
> + const: qcom,sm8150-camcc
> +
> + reg:
> + maxItems: 1
> +
> + clocks:
> + items:
> + - description: Board XO source
> + - description: Camera AHB clock from GCC
No sleep clock?
> +
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-02 15:50 ` [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150 Satya Priya Kakitapalli
@ 2024-07-03 10:20 ` Dmitry Baryshkov
2024-07-09 10:52 ` Satya Priya Kakitapalli (Temp)
0 siblings, 1 reply; 33+ messages in thread
From: Dmitry Baryshkov @ 2024-07-03 10:20 UTC (permalink / raw)
To: Satya Priya Kakitapalli
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Bryan O'Donoghue
On Tue, Jul 02, 2024 at 09:20:43PM GMT, Satya Priya Kakitapalli wrote:
> Add support for the camera clock controller for camera clients
> to be able to request for camcc clocks on SM8150 platform.
>
> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> ---
> drivers/clk/qcom/Kconfig | 9 +
> drivers/clk/qcom/Makefile | 1 +
> drivers/clk/qcom/camcc-sm8150.c | 2159 +++++++++++++++++++++++++++++++++++++++
> 3 files changed, 2169 insertions(+)
The patch mostly LGTM, several quesitons:
- There are no cam_cc_sleep_clk and no cam_cc_xo_clk_src. Why?
- Why is cam_cc_gdsc_clk not modelled in the clock framework?
- I see that most if not all RCG clocks use rcg2_shared ops instead of
using simple rcg2 ops, could you please clarify that?
- RETAIN_FF_ENABLE has been used for GDSCs for sc7280, sc8280xp, sm8550,
sm8650 and x1e8 platforms. Should it really be set for sm8150? If so,
should it also be added to other camcc drivers (if so, for which
platforms)?
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 2/6] clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL
2024-07-02 15:50 ` [PATCH v2 2/6] clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL Satya Priya Kakitapalli
2024-07-03 10:02 ` Dmitry Baryshkov
@ 2024-07-06 13:39 ` Konrad Dybcio
2024-07-09 10:56 ` Satya Priya Kakitapalli (Temp)
1 sibling, 1 reply; 33+ messages in thread
From: Konrad Dybcio @ 2024-07-06 13:39 UTC (permalink / raw)
To: Satya Priya Kakitapalli, Bjorn Andersson, Michael Turquette,
Stephen Boyd, Abhishek Sahu, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 2.07.2024 5:50 PM, Satya Priya Kakitapalli wrote:
> The Zonda PLL has a 16 bit signed alpha and in the cases where the alpha
> value is greater than 0.5, the L value needs to be adjusted accordingly.
> Thus update the logic for the same.
>
> Also, fix zonda set_rate failure when PLL is disabled. Currently,
> clk_zonda_pll_set_rate polls for the PLL to lock even if the PLL is
> disabled. However, if the PLL is disabled then LOCK_DET will never
> assert and we'll return an error. There is no reason to poll LOCK_DET
> if the PLL is already disabled, so skip polling in this case.
>
> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> ---
[...]
> @@ -2077,9 +2089,15 @@ static int clk_zonda_pll_set_rate(struct clk_hw *hw, unsigned long rate,
> if (ret < 0)
> return ret;
>
> + if (a & BIT(15))
> + zonda_pll_adjust_l_val(rate, prate, &l);
A random check for a seemingly random, undocumented bit only confuses the reader
Konrad
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 3/6] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops
2024-07-03 10:05 ` Dmitry Baryshkov
@ 2024-07-06 13:45 ` Konrad Dybcio
2024-07-09 10:51 ` Satya Priya Kakitapalli (Temp)
1 sibling, 0 replies; 33+ messages in thread
From: Konrad Dybcio @ 2024-07-06 13:45 UTC (permalink / raw)
To: Dmitry Baryshkov, Satya Priya Kakitapalli
Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Abhishek Sahu,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Stephen Boyd,
linux-arm-msm, linux-clk, linux-kernel, devicetree, Ajit Pandey,
Imran Shaik, Taniya Das, Jagadeesh Kona
On 3.07.2024 12:05 PM, Dmitry Baryshkov wrote:
> On Tue, Jul 02, 2024 at 09:20:41PM GMT, Satya Priya Kakitapalli wrote:
>> From: Taniya Das <quic_tdas@quicinc.com>
>>
>> Regera PLL ops are required to control the Regera PLL from clock
>> controller drivers, thus add support for the same.
>
> the same what?
I think it bears a similar meaning to "this" in OPP, as in referring to
the main subject in the sentence.. Although I think I've only seen this
phrasing in QC commit messages so far /shrug
Konrad
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 3/6] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops
2024-07-03 10:05 ` Dmitry Baryshkov
2024-07-06 13:45 ` Konrad Dybcio
@ 2024-07-09 10:51 ` Satya Priya Kakitapalli (Temp)
2024-07-26 8:10 ` Satya Priya Kakitapalli (Temp)
1 sibling, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli (Temp) @ 2024-07-09 10:51 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 7/3/2024 3:35 PM, Dmitry Baryshkov wrote:
> On Tue, Jul 02, 2024 at 09:20:41PM GMT, Satya Priya Kakitapalli wrote:
>> From: Taniya Das <quic_tdas@quicinc.com>
>>
>> Regera PLL ops are required to control the Regera PLL from clock
>> controller drivers, thus add support for the same.
> the same what?
I'll rephrase the commit text.
>> Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
>> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>> ---
>> drivers/clk/qcom/clk-alpha-pll.c | 32 +++++++++++++++++++++++++++++++-
>> drivers/clk/qcom/clk-alpha-pll.h | 5 +++++
>> 2 files changed, 36 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
>> index d2bef078588f..afb7ab72c90d 100644
>> --- a/drivers/clk/qcom/clk-alpha-pll.c
>> +++ b/drivers/clk/qcom/clk-alpha-pll.c
>> @@ -1,7 +1,7 @@
>> // SPDX-License-Identifier: GPL-2.0
>> /*
>> * Copyright (c) 2015, 2018, The Linux Foundation. All rights reserved.
>> - * Copyright (c) 2021, 2023, Qualcomm Innovation Center, Inc. All rights reserved.
>> + * Copyright (c) 2021, 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
>> */
>>
>> #include <linux/kernel.h>
>> @@ -2605,3 +2605,33 @@ const struct clk_ops clk_alpha_pll_stromer_plus_ops = {
>> .set_rate = clk_alpha_pll_stromer_plus_set_rate,
>> };
>> EXPORT_SYMBOL_GPL(clk_alpha_pll_stromer_plus_ops);
>> +
>> +void clk_regera_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
>> + const struct alpha_pll_config *config)
>> +{
>> + clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l);
>> + clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);
>> + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL(pll), config->config_ctl_val);
>> + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U(pll), config->config_ctl_hi_val);
>> + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U1(pll), config->config_ctl_hi1_val);
>> + clk_alpha_pll_write_config(regmap, PLL_USER_CTL(pll), config->user_ctl_val);
>> + clk_alpha_pll_write_config(regmap, PLL_USER_CTL_U(pll), config->user_ctl_hi_val);
>> + clk_alpha_pll_write_config(regmap, PLL_USER_CTL_U1(pll), config->user_ctl_hi1_val);
>> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), config->test_ctl_val);
>> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), config->test_ctl_hi_val);
>> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll), config->test_ctl_hi1_val);
>> +
>> + /* Set operation mode to STANDBY */
>> + regmap_write(regmap, PLL_OPMODE(pll), PLL_STANDBY);
>> +}
>> +EXPORT_SYMBOL_GPL(clk_regera_pll_configure);
> Does it make sense to call this function from clk_zonda_pll_configure()?
Okay, I'll evaluate this internally and see if that can be done.
>
>> +
>> +const struct clk_ops clk_alpha_pll_regera_ops = {
>> + .enable = clk_zonda_pll_enable,
>> + .disable = clk_zonda_pll_disable,
>> + .is_enabled = clk_alpha_pll_is_enabled,
>> + .recalc_rate = clk_trion_pll_recalc_rate,
>> + .round_rate = clk_alpha_pll_round_rate,
>> + .set_rate = clk_zonda_pll_set_rate,
>> +};
>> +EXPORT_SYMBOL_GPL(clk_alpha_pll_regera_ops);
>> diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h
>> index fb6d50263bb9..5bb0a07da53d 100644
>> --- a/drivers/clk/qcom/clk-alpha-pll.h
>> +++ b/drivers/clk/qcom/clk-alpha-pll.h
>> @@ -21,6 +21,7 @@ enum {
>> CLK_ALPHA_PLL_TYPE_LUCID = CLK_ALPHA_PLL_TYPE_TRION,
>> CLK_ALPHA_PLL_TYPE_AGERA,
>> CLK_ALPHA_PLL_TYPE_ZONDA,
>> + CLK_ALPHA_PLL_TYPE_REGERA = CLK_ALPHA_PLL_TYPE_ZONDA,
>> CLK_ALPHA_PLL_TYPE_ZONDA_OLE,
>> CLK_ALPHA_PLL_TYPE_LUCID_EVO,
>> CLK_ALPHA_PLL_TYPE_LUCID_OLE,
>> @@ -189,6 +190,8 @@ extern const struct clk_ops clk_alpha_pll_postdiv_lucid_evo_ops;
>> extern const struct clk_ops clk_alpha_pll_rivian_evo_ops;
>> #define clk_alpha_pll_postdiv_rivian_evo_ops clk_alpha_pll_postdiv_fabia_ops
>>
>> +extern const struct clk_ops clk_alpha_pll_regera_ops;
>> +
>> void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
>> const struct alpha_pll_config *config);
>> void clk_fabia_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
>> @@ -210,5 +213,7 @@ void clk_rivian_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regm
>> const struct alpha_pll_config *config);
>> void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
>> const struct alpha_pll_config *config);
>> +void clk_regera_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
>> + const struct alpha_pll_config *config);
>>
>> #endif
>>
>> --
>> 2.25.1
>>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-03 10:20 ` Dmitry Baryshkov
@ 2024-07-09 10:52 ` Satya Priya Kakitapalli (Temp)
2024-07-10 22:10 ` Dmitry Baryshkov
0 siblings, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli (Temp) @ 2024-07-09 10:52 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Bryan O'Donoghue
On 7/3/2024 3:50 PM, Dmitry Baryshkov wrote:
> On Tue, Jul 02, 2024 at 09:20:43PM GMT, Satya Priya Kakitapalli wrote:
>> Add support for the camera clock controller for camera clients
>> to be able to request for camcc clocks on SM8150 platform.
>>
>> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
>> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>> ---
>> drivers/clk/qcom/Kconfig | 9 +
>> drivers/clk/qcom/Makefile | 1 +
>> drivers/clk/qcom/camcc-sm8150.c | 2159 +++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 2169 insertions(+)
> The patch mostly LGTM, several quesitons:
>
> - There are no cam_cc_sleep_clk and no cam_cc_xo_clk_src. Why?
These are not required for camcc sm8150 hence not modelled.
> - Why is cam_cc_gdsc_clk not modelled in the clock framework?
This clock is kept enabled from probe, hence not required to be modelled
explicitly.
> - I see that most if not all RCG clocks use rcg2_shared ops instead of
> using simple rcg2 ops, could you please clarify that?
As per the HW design recommendation, RCG needs to be parked at a safe
clock source(XO) in the disable path, shared_ops is used to achieve the
same.
> - RETAIN_FF_ENABLE has been used for GDSCs for sc7280, sc8280xp, sm8550,
> sm8650 and x1e8 platforms. Should it really be set for sm8150? If so,
> should it also be added to other camcc drivers (if so, for which
> platforms)?
I have rechecked this in downstream and seems it is not really needed
for sm8150, I'll drop in next post.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 4/6] dt-bindings: clock: qcom: Add SM8150 camera clock controller
2024-07-03 10:14 ` Dmitry Baryshkov
@ 2024-07-09 10:53 ` Satya Priya Kakitapalli (Temp)
0 siblings, 0 replies; 33+ messages in thread
From: Satya Priya Kakitapalli (Temp) @ 2024-07-09 10:53 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Krzysztof Kozlowski
On 7/3/2024 3:44 PM, Dmitry Baryshkov wrote:
> On Tue, Jul 02, 2024 at 09:20:42PM GMT, Satya Priya Kakitapalli wrote:
>> Add device tree bindings for the camera clock controller on
>> Qualcomm SM8150 platform.
>>
>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>> ---
>> .../bindings/clock/qcom,sm8150-camcc.yaml | 77 ++++++++++++
>> include/dt-bindings/clock/qcom,sm8150-camcc.h | 135 +++++++++++++++++++++
>> 2 files changed, 212 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml
>> new file mode 100644
>> index 000000000000..8fc27ba4be4b
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/clock/qcom,sm8150-camcc.yaml
>> @@ -0,0 +1,77 @@
>> +# SPDX-License-Identifier: GPL-2.0-only
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/clock/qcom,sm8150-camcc.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Qualcomm Camera Clock & Reset Controller on SM8150
>> +
>> +maintainers:
>> + - Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>> +
>> +description: |
>> + Qualcomm camera clock control module provides the clocks, resets and
>> + power domains on SM8150.
>> +
>> + See also:: include/dt-bindings/clock/qcom,sm8150-camcc.h
>> +
>> +properties:
>> + compatible:
>> + const: qcom,sm8150-camcc
>> +
>> + reg:
>> + maxItems: 1
>> +
>> + clocks:
>> + items:
>> + - description: Board XO source
>> + - description: Camera AHB clock from GCC
> No sleep clock?
No, for sm8150 there is no need of sleep clock. It is not used for any
of the camcc clocks.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 2/6] clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL
2024-07-06 13:39 ` Konrad Dybcio
@ 2024-07-09 10:56 ` Satya Priya Kakitapalli (Temp)
0 siblings, 0 replies; 33+ messages in thread
From: Satya Priya Kakitapalli (Temp) @ 2024-07-09 10:56 UTC (permalink / raw)
To: Konrad Dybcio, Bjorn Andersson, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 7/6/2024 7:09 PM, Konrad Dybcio wrote:
> On 2.07.2024 5:50 PM, Satya Priya Kakitapalli wrote:
>> The Zonda PLL has a 16 bit signed alpha and in the cases where the alpha
>> value is greater than 0.5, the L value needs to be adjusted accordingly.
>> Thus update the logic for the same.
>>
>> Also, fix zonda set_rate failure when PLL is disabled. Currently,
>> clk_zonda_pll_set_rate polls for the PLL to lock even if the PLL is
>> disabled. However, if the PLL is disabled then LOCK_DET will never
>> assert and we'll return an error. There is no reason to poll LOCK_DET
>> if the PLL is already disabled, so skip polling in this case.
>>
>> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>> ---
> [...]
>
>> @@ -2077,9 +2089,15 @@ static int clk_zonda_pll_set_rate(struct clk_hw *hw, unsigned long rate,
>> if (ret < 0)
>> return ret;
>>
>> + if (a & BIT(15))
>> + zonda_pll_adjust_l_val(rate, prate, &l);
> A random check for a seemingly random, undocumented bit only confuses the reader
Sure, I'll define a macro for this.
Thanks.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-09 10:52 ` Satya Priya Kakitapalli (Temp)
@ 2024-07-10 22:10 ` Dmitry Baryshkov
2024-07-11 9:51 ` Bryan O'Donoghue
2024-07-15 10:22 ` Satya Priya Kakitapalli (Temp)
0 siblings, 2 replies; 33+ messages in thread
From: Dmitry Baryshkov @ 2024-07-10 22:10 UTC (permalink / raw)
To: Satya Priya Kakitapalli (Temp)
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Bryan O'Donoghue
On Tue, 9 Jul 2024 at 13:53, Satya Priya Kakitapalli (Temp)
<quic_skakitap@quicinc.com> wrote:
>
>
> On 7/3/2024 3:50 PM, Dmitry Baryshkov wrote:
> > On Tue, Jul 02, 2024 at 09:20:43PM GMT, Satya Priya Kakitapalli wrote:
> >> Add support for the camera clock controller for camera clients
> >> to be able to request for camcc clocks on SM8150 platform.
> >>
> >> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> >> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> >> ---
> >> drivers/clk/qcom/Kconfig | 9 +
> >> drivers/clk/qcom/Makefile | 1 +
> >> drivers/clk/qcom/camcc-sm8150.c | 2159 +++++++++++++++++++++++++++++++++++++++
> >> 3 files changed, 2169 insertions(+)
> > The patch mostly LGTM, several quesitons:
> >
> > - There are no cam_cc_sleep_clk and no cam_cc_xo_clk_src. Why?
>
>
> These are not required for camcc sm8150 hence not modelled.
>
>
> > - Why is cam_cc_gdsc_clk not modelled in the clock framework?
>
>
> This clock is kept enabled from probe, hence not required to be modelled
> explicitly.
Yes, I'm asking why it's kept up enabled from probe rather than via
clock framework?
> > - I see that most if not all RCG clocks use rcg2_shared ops instead of
> > using simple rcg2 ops, could you please clarify that?
>
>
> As per the HW design recommendation, RCG needs to be parked at a safe
> clock source(XO) in the disable path, shared_ops is used to achieve the
> same.
Does it apply to SM8150? For example, on SM8250 RCG2s are not parked.
>
>
> > - RETAIN_FF_ENABLE has been used for GDSCs for sc7280, sc8280xp, sm8550,
> > sm8650 and x1e8 platforms. Should it really be set for sm8150? If so,
> > should it also be added to other camcc drivers (if so, for which
> > platforms)?
>
>
> I have rechecked this in downstream and seems it is not really needed
> for sm8150, I'll drop in next post.
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-10 22:10 ` Dmitry Baryshkov
@ 2024-07-11 9:51 ` Bryan O'Donoghue
2024-07-15 10:36 ` Satya Priya Kakitapalli (Temp)
2024-07-15 10:22 ` Satya Priya Kakitapalli (Temp)
1 sibling, 1 reply; 33+ messages in thread
From: Bryan O'Donoghue @ 2024-07-11 9:51 UTC (permalink / raw)
To: Dmitry Baryshkov, Satya Priya Kakitapalli (Temp)
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 10/07/2024 23:10, Dmitry Baryshkov wrote:
>>> - Why is cam_cc_gdsc_clk not modelled in the clock framework?
>>
>> This clock is kept enabled from probe, hence not required to be modelled
>> explicitly.
> Yes, I'm asking why it's kept up enabled from probe rather than via
> clock framework?
FWIW my preference is to do it as Dmitry is suggesting here.
I'm not a big fan of hitting the register and leaving it as-is, would
much prefer to move to the model of having the CCF do it - so that for
example the clock appears in the /sys clock summary.
---
bod
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-10 22:10 ` Dmitry Baryshkov
2024-07-11 9:51 ` Bryan O'Donoghue
@ 2024-07-15 10:22 ` Satya Priya Kakitapalli (Temp)
2024-07-15 10:38 ` Dmitry Baryshkov
1 sibling, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli (Temp) @ 2024-07-15 10:22 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Bryan O'Donoghue
On 7/11/2024 3:40 AM, Dmitry Baryshkov wrote:
> On Tue, 9 Jul 2024 at 13:53, Satya Priya Kakitapalli (Temp)
> <quic_skakitap@quicinc.com> wrote:
>> On 7/3/2024 3:50 PM, Dmitry Baryshkov wrote:
>>> On Tue, Jul 02, 2024 at 09:20:43PM GMT, Satya Priya Kakitapalli wrote:
>>>> Add support for the camera clock controller for camera clients
>>>> to be able to request for camcc clocks on SM8150 platform.
>>>>
>>>> Reviewed-by: Bryan O'Donoghue<bryan.odonoghue@linaro.org>
>>>> Signed-off-by: Satya Priya Kakitapalli<quic_skakitap@quicinc.com>
>>>> ---
>>>> drivers/clk/qcom/Kconfig | 9 +
>>>> drivers/clk/qcom/Makefile | 1 +
>>>> drivers/clk/qcom/camcc-sm8150.c | 2159 +++++++++++++++++++++++++++++++++++++++
>>>> 3 files changed, 2169 insertions(+)
>>> The patch mostly LGTM, several quesitons:
>>>
>>> - There are no cam_cc_sleep_clk and no cam_cc_xo_clk_src. Why?
>> These are not required for camcc sm8150 hence not modelled.
>>
>>
>>> - Why is cam_cc_gdsc_clk not modelled in the clock framework?
>> This clock is kept enabled from probe, hence not required to be modelled
>> explicitly.
> Yes, I'm asking why it's kept up enabled from probe rather than via
> clock framework?
>>> - I see that most if not all RCG clocks use rcg2_shared ops instead of
>>> using simple rcg2 ops, could you please clarify that?
>> As per the HW design recommendation, RCG needs to be parked at a safe
>> clock source(XO) in the disable path, shared_ops is used to achieve the
>> same.
> Does it apply to SM8150? For example, on SM8250 RCG2s are not parked.
Yes, it applies to SM8150.
>>> - RETAIN_FF_ENABLE has been used for GDSCs for sc7280, sc8280xp, sm8550,
>>> sm8650 and x1e8 platforms. Should it really be set for sm8150? If so,
>>> should it also be added to other camcc drivers (if so, for which
>>> platforms)?
>> I have rechecked this in downstream and seems it is not really needed
>> for sm8150, I'll drop in next post.
>>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-11 9:51 ` Bryan O'Donoghue
@ 2024-07-15 10:36 ` Satya Priya Kakitapalli (Temp)
2024-07-17 10:53 ` Bryan O'Donoghue
0 siblings, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli (Temp) @ 2024-07-15 10:36 UTC (permalink / raw)
To: Bryan O'Donoghue, Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 7/11/2024 3:21 PM, Bryan O'Donoghue wrote:
> On 10/07/2024 23:10, Dmitry Baryshkov wrote:
>>>> - Why is cam_cc_gdsc_clk not modelled in the clock framework?
>>>
>>> This clock is kept enabled from probe, hence not required to be
>>> modelled
>>> explicitly.
>> Yes, I'm asking why it's kept up enabled from probe rather than via
>> clock framework?
>
> FWIW my preference is to do it as Dmitry is suggesting here.
>
> I'm not a big fan of hitting the register and leaving it as-is, would
> much prefer to move to the model of having the CCF do it - so that for
> example the clock appears in the /sys clock summary.
>
This clock is PoR ON clock and expected to be always enabled from HW
perspective, we are just re-ensuring it is ON from probe. Modelling this
clock is unnecessary, and we have been following this approach for gdsc
clock in all the recent chipsets, like for example sm8550 camcc.
> ---
> bod
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-15 10:22 ` Satya Priya Kakitapalli (Temp)
@ 2024-07-15 10:38 ` Dmitry Baryshkov
2024-07-15 15:01 ` Bryan O'Donoghue
2024-07-26 8:25 ` Satya Priya Kakitapalli (Temp)
0 siblings, 2 replies; 33+ messages in thread
From: Dmitry Baryshkov @ 2024-07-15 10:38 UTC (permalink / raw)
To: Satya Priya Kakitapalli (Temp)
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Bryan O'Donoghue
On Mon, 15 Jul 2024 at 13:23, Satya Priya Kakitapalli (Temp)
<quic_skakitap@quicinc.com> wrote:
>
>
> On 7/11/2024 3:40 AM, Dmitry Baryshkov wrote:
> > On Tue, 9 Jul 2024 at 13:53, Satya Priya Kakitapalli (Temp)
> > <quic_skakitap@quicinc.com> wrote:
> >> On 7/3/2024 3:50 PM, Dmitry Baryshkov wrote:
> >>> On Tue, Jul 02, 2024 at 09:20:43PM GMT, Satya Priya Kakitapalli wrote:
> >>>> Add support for the camera clock controller for camera clients
> >>>> to be able to request for camcc clocks on SM8150 platform.
> >>>>
> >>>> Reviewed-by: Bryan O'Donoghue<bryan.odonoghue@linaro.org>
> >>>> Signed-off-by: Satya Priya Kakitapalli<quic_skakitap@quicinc.com>
> >>>> ---
> >>>> drivers/clk/qcom/Kconfig | 9 +
> >>>> drivers/clk/qcom/Makefile | 1 +
> >>>> drivers/clk/qcom/camcc-sm8150.c | 2159 +++++++++++++++++++++++++++++++++++++++
> >>>> 3 files changed, 2169 insertions(+)
> >>> The patch mostly LGTM, several quesitons:
> >>>
> >>> - There are no cam_cc_sleep_clk and no cam_cc_xo_clk_src. Why?
> >> These are not required for camcc sm8150 hence not modelled.
> >>
> >>
> >>> - Why is cam_cc_gdsc_clk not modelled in the clock framework?
> >> This clock is kept enabled from probe, hence not required to be modelled
> >> explicitly.
> > Yes, I'm asking why it's kept up enabled from probe rather than via
> > clock framework?
>
>
> >>> - I see that most if not all RCG clocks use rcg2_shared ops instead of
> >>> using simple rcg2 ops, could you please clarify that?
> >> As per the HW design recommendation, RCG needs to be parked at a safe
> >> clock source(XO) in the disable path, shared_ops is used to achieve the
> >> same.
> > Does it apply to SM8150? For example, on SM8250 RCG2s are not parked.
>
>
> Yes, it applies to SM8150.
Should the same logic be applied to other chipsets supported upstream?
If this is the case, which chipsets?
> >>> - RETAIN_FF_ENABLE has been used for GDSCs for sc7280, sc8280xp, sm8550,
> >>> sm8650 and x1e8 platforms. Should it really be set for sm8150? If so,
> >>> should it also be added to other camcc drivers (if so, for which
> >>> platforms)?
> >> I have rechecked this in downstream and seems it is not really needed
> >> for sm8150, I'll drop in next post.
> >>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-15 10:38 ` Dmitry Baryshkov
@ 2024-07-15 15:01 ` Bryan O'Donoghue
2024-07-17 6:24 ` Satya Priya Kakitapalli (Temp)
2024-07-26 8:25 ` Satya Priya Kakitapalli (Temp)
1 sibling, 1 reply; 33+ messages in thread
From: Bryan O'Donoghue @ 2024-07-15 15:01 UTC (permalink / raw)
To: Dmitry Baryshkov, Satya Priya Kakitapalli (Temp)
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 15/07/2024 11:38, Dmitry Baryshkov wrote:
>>> Does it apply to SM8150? For example, on SM8250 RCG2s are not parked.
>>
>> Yes, it applies to SM8150.
> Should the same logic be applied to other chipsets supported upstream?
> If this is the case, which chipsets?
If you are representing the "top" GDSC inside of the CCF instead of
doing this
+ /* Keep the critical clock always-on */
+ qcom_branch_set_clk_en(regmap, 0xc1e4); /* cam_cc_gdsc_clk */
then the clock should be parked else you'll find the GDSC doesn't come
out of reset.
and... as I look at it now we have a logical conflict in
drivers/clk/qcom/camcc-sc8280xp.c
static struct clk_branch camcc_gdsc_clk = {
.halt_reg = 0xc1e4,
.halt_check = BRANCH_HALT,
.clkr = {
.enable_reg = 0xc1e4,
.enable_mask = BIT(0),
.hw.init = &(struct clk_init_data){
.name = "camcc_gdsc_clk",
.parent_hws = (const struct clk_hw*[]){
&camcc_xo_clk_src.clkr.hw,
},
.num_parents = 1,
.flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops,
},
},
};
Patch sent.
https://lore.kernel.org/linux-arm-msm/20240715-linux-next-24-07-13-sc8280xp-camcc-fixes-v1-1-fadb5d9445c1@linaro.org/T/#u
In the round I think we should avoid these horrific hard-coded always-on
writes where possible.
Personally I think parking is better than always-on specifically because
you define the clock and "see" it in the clock tree.
---
bod
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-15 15:01 ` Bryan O'Donoghue
@ 2024-07-17 6:24 ` Satya Priya Kakitapalli (Temp)
2024-07-17 11:07 ` Bryan O'Donoghue
0 siblings, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli (Temp) @ 2024-07-17 6:24 UTC (permalink / raw)
To: Bryan O'Donoghue, Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 7/15/2024 8:31 PM, Bryan O'Donoghue wrote:
> On 15/07/2024 11:38, Dmitry Baryshkov wrote:
>>>> Does it apply to SM8150? For example, on SM8250 RCG2s are not parked.
>>>
>>> Yes, it applies to SM8150.
>> Should the same logic be applied to other chipsets supported upstream?
>> If this is the case, which chipsets?
>
> If you are representing the "top" GDSC inside of the CCF instead of
> doing this
>
> + /* Keep the critical clock always-on */
> + qcom_branch_set_clk_en(regmap, 0xc1e4); /* cam_cc_gdsc_clk */
>
> then the clock should be parked else you'll find the GDSC doesn't come
> out of reset.
>
> and... as I look at it now we have a logical conflict in
> drivers/clk/qcom/camcc-sc8280xp.c
>
> static struct clk_branch camcc_gdsc_clk = {
> .halt_reg = 0xc1e4,
> .halt_check = BRANCH_HALT,
> .clkr = {
> .enable_reg = 0xc1e4,
> .enable_mask = BIT(0),
> .hw.init = &(struct clk_init_data){
> .name = "camcc_gdsc_clk",
> .parent_hws = (const struct clk_hw*[]){
> &camcc_xo_clk_src.clkr.hw,
> },
> .num_parents = 1,
> .flags = CLK_SET_RATE_PARENT,
> .ops = &clk_branch2_ops,
> },
> },
> };
>
> Patch sent.
>
> https://lore.kernel.org/linux-arm-msm/20240715-linux-next-24-07-13-sc8280xp-camcc-fixes-v1-1-fadb5d9445c1@linaro.org/T/#u
>
>
If the clock is modelled, it can get disabled during the late init call,
when the CCF disables the unused clocks. But, it is a PoR ON clock and
expectation from design team is to keep it always-on for GDSC functionality.
So, we should not model this, instead just keep it always on from probe.
> In the round I think we should avoid these horrific hard-coded
> always-on writes where possible.
>
We have been suggested to make such clocks always ON from probe on
previous upstream discussions. This is also recently acknowledged by
maintainers, please see [1] and [2].
[1]
https://lore.kernel.org/linux-clk/6286a410-6faa-4996-8a9e-dc334dd9421f@linaro.org/
[2]
https://lore.kernel.org/linux-clk/664cca91-8615-d3f6-7525-15b9b6725cce@quicinc.com/
> Personally I think parking is better than always-on specifically
> because you define the clock and "see" it in the clock tree.
>
> ---
> bod
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-15 10:36 ` Satya Priya Kakitapalli (Temp)
@ 2024-07-17 10:53 ` Bryan O'Donoghue
2024-07-17 11:08 ` Satya Priya Kakitapalli (Temp)
0 siblings, 1 reply; 33+ messages in thread
From: Bryan O'Donoghue @ 2024-07-17 10:53 UTC (permalink / raw)
To: Satya Priya Kakitapalli (Temp), Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 15/07/2024 11:36, Satya Priya Kakitapalli (Temp) wrote:
> This clock is PoR ON clock and expected to be always enabled from HW
> perspective, we are just re-ensuring it is ON from probe. Modelling this
> clock is unnecessary, and we have been following this approach for gdsc
> clock in all the recent chipsets, like for example sm8550 camcc.
Having a difficult time following the logic
- Re-enabling an already enabled always-on clock is necessary
- Modelling the always-on clock in the CCF to park it at XO is
unnecessary
I think that's a pretty vague argument to be honest.
---
bod
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-17 6:24 ` Satya Priya Kakitapalli (Temp)
@ 2024-07-17 11:07 ` Bryan O'Donoghue
0 siblings, 0 replies; 33+ messages in thread
From: Bryan O'Donoghue @ 2024-07-17 11:07 UTC (permalink / raw)
To: Satya Priya Kakitapalli (Temp), Bryan O'Donoghue,
Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 17/07/2024 07:24, Satya Priya Kakitapalli (Temp) wrote:
>> Patch sent.
>>
>> https://lore.kernel.org/linux-arm-msm/20240715-linux-next-24-07-13-sc8280xp-camcc-fixes-v1-1-fadb5d9445c1@linaro.org/T/#u
>>
>
> If the clock is modelled, it can get disabled during the late init call,
> when the CCF disables the unused clocks. But, it is a PoR ON clock and
> expectation from design team is to keep it always-on for GDSC
> functionality.
Not if it _parks_ - that's what parking does, also what is the upstream
usecase to sustain the clock as on from PoR to CAMSS probe(); ?
---
bod
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-17 10:53 ` Bryan O'Donoghue
@ 2024-07-17 11:08 ` Satya Priya Kakitapalli (Temp)
0 siblings, 0 replies; 33+ messages in thread
From: Satya Priya Kakitapalli (Temp) @ 2024-07-17 11:08 UTC (permalink / raw)
To: Bryan O'Donoghue, Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 7/17/2024 4:23 PM, Bryan O'Donoghue wrote:
> On 15/07/2024 11:36, Satya Priya Kakitapalli (Temp) wrote:
>> This clock is PoR ON clock and expected to be always enabled from HW
>> perspective, we are just re-ensuring it is ON from probe. Modelling
>> this clock is unnecessary, and we have been following this approach
>> for gdsc clock in all the recent chipsets, like for example sm8550
>> camcc.
>
> Having a difficult time following the logic
>
> - Re-enabling an already enabled always-on clock is necessary
There is no hard requirement to enable it again , but to be on safe side
incase bootloaders disabled this clock, we are enabling it again in probe.
> - Modelling the always-on clock in the CCF to park it at XO is
> unnecessary
>
Modelling the clock will cause the CCF to disable the clock in late
init. I have tested on SM8150 by modelling the gdsc clock now and I see
it is getting disabled in late init.
Parking the parent clock(rcg) at XO, doesn't ensure the branch clock to
be ON. If CCF disables the clock it gets disabled.
> I think that's a pretty vague argument to be honest.
>
> ---
> bod
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 3/6] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops
2024-07-09 10:51 ` Satya Priya Kakitapalli (Temp)
@ 2024-07-26 8:10 ` Satya Priya Kakitapalli (Temp)
2024-07-27 10:57 ` Dmitry Baryshkov
0 siblings, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli (Temp) @ 2024-07-26 8:10 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On 7/9/2024 4:21 PM, Satya Priya Kakitapalli (Temp) wrote:
>
> On 7/3/2024 3:35 PM, Dmitry Baryshkov wrote:
>> On Tue, Jul 02, 2024 at 09:20:41PM GMT, Satya Priya Kakitapalli wrote:
>>> From: Taniya Das <quic_tdas@quicinc.com>
>>>
>>> Regera PLL ops are required to control the Regera PLL from clock
>>> controller drivers, thus add support for the same.
>> the same what?
>
>
> I'll rephrase the commit text.
>
>
>>> Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
>>> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>>> ---
>>> drivers/clk/qcom/clk-alpha-pll.c | 32
>>> +++++++++++++++++++++++++++++++-
>>> drivers/clk/qcom/clk-alpha-pll.h | 5 +++++
>>> 2 files changed, 36 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/clk/qcom/clk-alpha-pll.c
>>> b/drivers/clk/qcom/clk-alpha-pll.c
>>> index d2bef078588f..afb7ab72c90d 100644
>>> --- a/drivers/clk/qcom/clk-alpha-pll.c
>>> +++ b/drivers/clk/qcom/clk-alpha-pll.c
>>> @@ -1,7 +1,7 @@
>>> // SPDX-License-Identifier: GPL-2.0
>>> /*
>>> * Copyright (c) 2015, 2018, The Linux Foundation. All rights
>>> reserved.
>>> - * Copyright (c) 2021, 2023, Qualcomm Innovation Center, Inc. All
>>> rights reserved.
>>> + * Copyright (c) 2021, 2023-2024, Qualcomm Innovation Center, Inc.
>>> All rights reserved.
>>> */
>>> #include <linux/kernel.h>
>>> @@ -2605,3 +2605,33 @@ const struct clk_ops
>>> clk_alpha_pll_stromer_plus_ops = {
>>> .set_rate = clk_alpha_pll_stromer_plus_set_rate,
>>> };
>>> EXPORT_SYMBOL_GPL(clk_alpha_pll_stromer_plus_ops);
>>> +
>>> +void clk_regera_pll_configure(struct clk_alpha_pll *pll, struct
>>> regmap *regmap,
>>> + const struct alpha_pll_config *config)
>>> +{
>>> + clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l);
>>> + clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll),
>>> config->alpha);
>>> + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL(pll),
>>> config->config_ctl_val);
>>> + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U(pll),
>>> config->config_ctl_hi_val);
>>> + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U1(pll),
>>> config->config_ctl_hi1_val);
>>> + clk_alpha_pll_write_config(regmap, PLL_USER_CTL(pll),
>>> config->user_ctl_val);
>>> + clk_alpha_pll_write_config(regmap, PLL_USER_CTL_U(pll),
>>> config->user_ctl_hi_val);
>>> + clk_alpha_pll_write_config(regmap, PLL_USER_CTL_U1(pll),
>>> config->user_ctl_hi1_val);
>>> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll),
>>> config->test_ctl_val);
>>> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll),
>>> config->test_ctl_hi_val);
>>> + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll),
>>> config->test_ctl_hi1_val);
>>> +
>>> + /* Set operation mode to STANDBY */
>>> + regmap_write(regmap, PLL_OPMODE(pll), PLL_STANDBY);
>>> +}
>>> +EXPORT_SYMBOL_GPL(clk_regera_pll_configure);
>> Does it make sense to call this function from clk_zonda_pll_configure()?
>
>
> Okay, I'll evaluate this internally and see if that can be done.
>
I have checked this, although there is common part between Zonda and
Regera PLL configure APIs, a different sequence needs to be followed for
Zonda, and calling this function from zonda_pll_configure would affect
the sequence. Hence, I think it is better to leave it as is.
>
>>
>>> +
>>> +const struct clk_ops clk_alpha_pll_regera_ops = {
>>> + .enable = clk_zonda_pll_enable,
>>> + .disable = clk_zonda_pll_disable,
>>> + .is_enabled = clk_alpha_pll_is_enabled,
>>> + .recalc_rate = clk_trion_pll_recalc_rate,
>>> + .round_rate = clk_alpha_pll_round_rate,
>>> + .set_rate = clk_zonda_pll_set_rate,
>>> +};
>>> +EXPORT_SYMBOL_GPL(clk_alpha_pll_regera_ops);
>>> diff --git a/drivers/clk/qcom/clk-alpha-pll.h
>>> b/drivers/clk/qcom/clk-alpha-pll.h
>>> index fb6d50263bb9..5bb0a07da53d 100644
>>> --- a/drivers/clk/qcom/clk-alpha-pll.h
>>> +++ b/drivers/clk/qcom/clk-alpha-pll.h
>>> @@ -21,6 +21,7 @@ enum {
>>> CLK_ALPHA_PLL_TYPE_LUCID = CLK_ALPHA_PLL_TYPE_TRION,
>>> CLK_ALPHA_PLL_TYPE_AGERA,
>>> CLK_ALPHA_PLL_TYPE_ZONDA,
>>> + CLK_ALPHA_PLL_TYPE_REGERA = CLK_ALPHA_PLL_TYPE_ZONDA,
>>> CLK_ALPHA_PLL_TYPE_ZONDA_OLE,
>>> CLK_ALPHA_PLL_TYPE_LUCID_EVO,
>>> CLK_ALPHA_PLL_TYPE_LUCID_OLE,
>>> @@ -189,6 +190,8 @@ extern const struct clk_ops
>>> clk_alpha_pll_postdiv_lucid_evo_ops;
>>> extern const struct clk_ops clk_alpha_pll_rivian_evo_ops;
>>> #define clk_alpha_pll_postdiv_rivian_evo_ops
>>> clk_alpha_pll_postdiv_fabia_ops
>>> +extern const struct clk_ops clk_alpha_pll_regera_ops;
>>> +
>>> void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct
>>> regmap *regmap,
>>> const struct alpha_pll_config *config);
>>> void clk_fabia_pll_configure(struct clk_alpha_pll *pll, struct
>>> regmap *regmap,
>>> @@ -210,5 +213,7 @@ void clk_rivian_evo_pll_configure(struct
>>> clk_alpha_pll *pll, struct regmap *regm
>>> const struct alpha_pll_config *config);
>>> void clk_stromer_pll_configure(struct clk_alpha_pll *pll, struct
>>> regmap *regmap,
>>> const struct alpha_pll_config *config);
>>> +void clk_regera_pll_configure(struct clk_alpha_pll *pll, struct
>>> regmap *regmap,
>>> + const struct alpha_pll_config *config);
>>> #endif
>>>
>>> --
>>> 2.25.1
>>>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-15 10:38 ` Dmitry Baryshkov
2024-07-15 15:01 ` Bryan O'Donoghue
@ 2024-07-26 8:25 ` Satya Priya Kakitapalli (Temp)
2024-07-26 10:43 ` Dmitry Baryshkov
1 sibling, 1 reply; 33+ messages in thread
From: Satya Priya Kakitapalli (Temp) @ 2024-07-26 8:25 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Bryan O'Donoghue
>>>>> - I see that most if not all RCG clocks use rcg2_shared ops instead of
>>>>> using simple rcg2 ops, could you please clarify that?
>>>> As per the HW design recommendation, RCG needs to be parked at a safe
>>>> clock source(XO) in the disable path, shared_ops is used to achieve the
>>>> same.
>>> Does it apply to SM8150? For example, on SM8250 RCG2s are not parked.
>>
>> Yes, it applies to SM8150.
> Should the same logic be applied to other chipsets supported upstream?
> If this is the case, which chipsets?
I will evaluate for what all chipsets it is applicable and post a series
to fix it.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150
2024-07-26 8:25 ` Satya Priya Kakitapalli (Temp)
@ 2024-07-26 10:43 ` Dmitry Baryshkov
0 siblings, 0 replies; 33+ messages in thread
From: Dmitry Baryshkov @ 2024-07-26 10:43 UTC (permalink / raw)
To: Satya Priya Kakitapalli (Temp)
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona,
Bryan O'Donoghue
On Fri, 26 Jul 2024 at 11:26, Satya Priya Kakitapalli (Temp)
<quic_skakitap@quicinc.com> wrote:
>
>
> >>>>> - I see that most if not all RCG clocks use rcg2_shared ops instead of
> >>>>> using simple rcg2 ops, could you please clarify that?
> >>>> As per the HW design recommendation, RCG needs to be parked at a safe
> >>>> clock source(XO) in the disable path, shared_ops is used to achieve the
> >>>> same.
> >>> Does it apply to SM8150? For example, on SM8250 RCG2s are not parked.
> >>
> >> Yes, it applies to SM8150.
> > Should the same logic be applied to other chipsets supported upstream?
> > If this is the case, which chipsets?
>
>
> I will evaluate for what all chipsets it is applicable and post a series
> to fix it.
Thanks a lot!
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v2 3/6] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops
2024-07-26 8:10 ` Satya Priya Kakitapalli (Temp)
@ 2024-07-27 10:57 ` Dmitry Baryshkov
0 siblings, 0 replies; 33+ messages in thread
From: Dmitry Baryshkov @ 2024-07-27 10:57 UTC (permalink / raw)
To: Satya Priya Kakitapalli (Temp)
Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
Abhishek Sahu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel, devicetree,
Ajit Pandey, Imran Shaik, Taniya Das, Jagadeesh Kona
On Fri, Jul 26, 2024 at 01:40:33PM GMT, Satya Priya Kakitapalli (Temp) wrote:
>
> On 7/9/2024 4:21 PM, Satya Priya Kakitapalli (Temp) wrote:
> >
> > On 7/3/2024 3:35 PM, Dmitry Baryshkov wrote:
> > > On Tue, Jul 02, 2024 at 09:20:41PM GMT, Satya Priya Kakitapalli wrote:
> > > > From: Taniya Das <quic_tdas@quicinc.com>
> > > >
> > > > Regera PLL ops are required to control the Regera PLL from clock
> > > > controller drivers, thus add support for the same.
> > > the same what?
> >
> >
> > I'll rephrase the commit text.
> >
> >
> > > > Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
> > > > Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> > > > ---
> > > > drivers/clk/qcom/clk-alpha-pll.c | 32
> > > > +++++++++++++++++++++++++++++++-
> > > > drivers/clk/qcom/clk-alpha-pll.h | 5 +++++
> > > > 2 files changed, 36 insertions(+), 1 deletion(-)
[...]
> > > > +EXPORT_SYMBOL_GPL(clk_regera_pll_configure);
> > > Does it make sense to call this function from clk_zonda_pll_configure()?
> >
> >
> > Okay, I'll evaluate this internally and see if that can be done.
> >
>
> I have checked this, although there is common part between Zonda and Regera
> PLL configure APIs, a different sequence needs to be followed for Zonda, and
> calling this function from zonda_pll_configure would affect the sequence.
> Hence, I think it is better to leave it as is.
Ack.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 33+ messages in thread
end of thread, other threads:[~2024-07-27 10:57 UTC | newest]
Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-02 15:50 [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Satya Priya Kakitapalli
2024-07-02 15:50 ` [PATCH v2 1/6] clk: qcom: alpha-pll: Fix the pll post div mask and shift Satya Priya Kakitapalli
2024-07-03 10:01 ` Dmitry Baryshkov
2024-07-02 15:50 ` [PATCH v2 2/6] clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL Satya Priya Kakitapalli
2024-07-03 10:02 ` Dmitry Baryshkov
2024-07-06 13:39 ` Konrad Dybcio
2024-07-09 10:56 ` Satya Priya Kakitapalli (Temp)
2024-07-02 15:50 ` [PATCH v2 3/6] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops Satya Priya Kakitapalli
2024-07-03 10:05 ` Dmitry Baryshkov
2024-07-06 13:45 ` Konrad Dybcio
2024-07-09 10:51 ` Satya Priya Kakitapalli (Temp)
2024-07-26 8:10 ` Satya Priya Kakitapalli (Temp)
2024-07-27 10:57 ` Dmitry Baryshkov
2024-07-02 15:50 ` [PATCH v2 4/6] dt-bindings: clock: qcom: Add SM8150 camera clock controller Satya Priya Kakitapalli
2024-07-03 10:14 ` Dmitry Baryshkov
2024-07-09 10:53 ` Satya Priya Kakitapalli (Temp)
2024-07-02 15:50 ` [PATCH v2 5/6] clk: qcom: Add camera clock controller driver for SM8150 Satya Priya Kakitapalli
2024-07-03 10:20 ` Dmitry Baryshkov
2024-07-09 10:52 ` Satya Priya Kakitapalli (Temp)
2024-07-10 22:10 ` Dmitry Baryshkov
2024-07-11 9:51 ` Bryan O'Donoghue
2024-07-15 10:36 ` Satya Priya Kakitapalli (Temp)
2024-07-17 10:53 ` Bryan O'Donoghue
2024-07-17 11:08 ` Satya Priya Kakitapalli (Temp)
2024-07-15 10:22 ` Satya Priya Kakitapalli (Temp)
2024-07-15 10:38 ` Dmitry Baryshkov
2024-07-15 15:01 ` Bryan O'Donoghue
2024-07-17 6:24 ` Satya Priya Kakitapalli (Temp)
2024-07-17 11:07 ` Bryan O'Donoghue
2024-07-26 8:25 ` Satya Priya Kakitapalli (Temp)
2024-07-26 10:43 ` Dmitry Baryshkov
2024-07-02 15:50 ` [PATCH v2 6/6] arm64: dts: qcom: Add camera clock controller for sm8150 Satya Priya Kakitapalli
2024-07-03 10:08 ` [PATCH v2 0/6] clk: qcom: sm8150: Add camera clock controller support for SM8150 Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).