2022-09-14 02:21:23

by Richard Acayan

[permalink] [raw]
Subject: [PATCH v4 0/3] SDM670 Global Clocks

Changes since v3:
- rebase onto next-20220913
- accumulate review tags

Changes since v2:
- drop GCC_SDCC1_BCR reset
- reorder gcc-sdm845 and gcc-sdm670 if statements in bindings
- add space
- accumulate review tags

Changes since v1:
- regenerate patches to fixed malformed patch
- fix schema so that the parent clocks are specified correctly
- remove core_bi_test_pll_se from new parent_data to match array sizes
- reference correct frequency table for gcc_sdm670_cpuss_rbcpr_clk_src
- set correct index for sdcc1_ice_core_clk_src

This patch series adds global clocks essential for features of the Qualcomm
Snapdragon 670 (hopefully) cleanly into the SDM845 driver without doing
runtime fixups like in Google's bonito kernel (see patch 3).

This series (mostly patch 2) affects kernels made for Snapdragon 845 and
might need some further testing on SDM845 devices. I do not have a
Snapdragon 845-based device so someone else will have to double check if
necessary.

.../devicetree/bindings/clock/qcom,gcc-sdm845.yaml | 59 ++-
drivers/clk/qcom/Kconfig | 4 +-
drivers/clk/qcom/gcc-sdm845.c | 400 ++++++++++++++++++++-
include/dt-bindings/clock/qcom,gcc-sdm845.h | 1 +
4 files changed, 447 insertions(+), 17 deletions(-)



2022-09-14 02:21:28

by Richard Acayan

[permalink] [raw]
Subject: [PATCH v4 2/3] clk: qcom: gcc-sdm845: use device tree match data

This driver will support more than one SoC's set of clocks, and set of
GDSCs. This behavior would be unclean with hard-coded static variables.
Support it by grabbing clocks, GDSCs, and BCRs in the match data.

Signed-off-by: Richard Acayan <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
---
drivers/clk/qcom/gcc-sdm845.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/gcc-sdm845.c b/drivers/clk/qcom/gcc-sdm845.c
index 58aa3ec9a7fc..cd6e4e41dc9b 100644
--- a/drivers/clk/qcom/gcc-sdm845.c
+++ b/drivers/clk/qcom/gcc-sdm845.c
@@ -3574,7 +3574,7 @@ static const struct qcom_cc_desc gcc_sdm845_desc = {
};

static const struct of_device_id gcc_sdm845_match_table[] = {
- { .compatible = "qcom,gcc-sdm845" },
+ { .compatible = "qcom,gcc-sdm845", .data = &gcc_sdm845_desc },
{ }
};
MODULE_DEVICE_TABLE(of, gcc_sdm845_match_table);
@@ -3600,6 +3600,7 @@ static const struct clk_rcg_dfs_data gcc_dfs_clocks[] = {

static int gcc_sdm845_probe(struct platform_device *pdev)
{
+ const struct qcom_cc_desc *gcc_desc;
struct regmap *regmap;
int ret;

@@ -3616,7 +3617,8 @@ static int gcc_sdm845_probe(struct platform_device *pdev)
if (ret)
return ret;

- return qcom_cc_really_probe(pdev, &gcc_sdm845_desc, regmap);
+ gcc_desc = of_device_get_match_data(&pdev->dev);
+ return qcom_cc_really_probe(pdev, gcc_desc, regmap);
}

static struct platform_driver gcc_sdm845_driver = {
--
2.37.3

2022-09-15 03:49:14

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v4 0/3] SDM670 Global Clocks

On Tue, 13 Sep 2022 21:39:19 -0400, Richard Acayan wrote:
> Changes since v3:
> - rebase onto next-20220913
> - accumulate review tags
>
> Changes since v2:
> - drop GCC_SDCC1_BCR reset
> - reorder gcc-sdm845 and gcc-sdm670 if statements in bindings
> - add space
> - accumulate review tags
>
> [...]

Applied, thanks!

[1/3] dt-bindings: clock: gcc-sdm845: add sdm670 global clocks
commit: 657e9326658c1c570eb1e8fd122a4a7936433673
[2/3] clk: qcom: gcc-sdm845: use device tree match data
commit: 8e90216d2db99f0b883be3b40d5b581437dc4a5d
[3/3] clk: qcom: gcc-sdm845: add sdm670 global clock data
commit: ae66b1fe48e2dd91229f2b8f25295bce629382d0

Best regards,
--
Bjorn Andersson <[email protected]>