Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1673667 > unrolled thread
| Started by | Georgi Djakov <georgi.djakov@linaro.org> |
|---|---|
| First post | 2017-06-23 18:20 +0200 |
| Last post | 2017-06-27 18:30 +0200 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v8 0/3] Add support for Qualcomm A53 CPU clock Georgi Djakov <georgi.djakov@linaro.org> - 2017-06-23 18:20 +0200
[PATCH v8 1/3] clk: qcom: Add A53 PLL support Georgi Djakov <georgi.djakov@linaro.org> - 2017-06-23 18:20 +0200
Re: [PATCH v8 1/3] clk: qcom: Add A53 PLL support Rob Herring <robh@kernel.org> - 2017-06-26 21:50 +0200
Re: [PATCH v8 1/3] clk: qcom: Add A53 PLL support Riku Voipio <riku.voipio@linaro.org> - 2017-06-27 11:50 +0200
Re: [PATCH v8 1/3] clk: qcom: Add A53 PLL support Georgi Djakov <georgi.djakov@linaro.org> - 2017-06-27 18:30 +0200
| From | Georgi Djakov <georgi.djakov@linaro.org> |
|---|---|
| Date | 2017-06-23 18:20 +0200 |
| Subject | [PATCH v8 0/3] Add support for Qualcomm A53 CPU clock |
| Message-ID | <tVztn-4pX-3@gated-at.bofh.it> |
This patchset adds support for the A53 CPU clock and allows scaling of the CPU frequency on msm8916 based platforms. Changes since v7 (https://lkml.org/lkml/2016/10/31/296) * Add the APCS clock controller to the APCS driver to expose both the mailbox and clock controller functionality as discussed earlier: https://lkml.org/lkml/2016/11/14/860 * Changed the a53pll compatible string as suggested by Rob. Changes since v6 (https://lkml.org/lkml/2016/9/7/347) * Addressed various comments from Stephen Boyd Changes since v5 (https://lkml.org/lkml/2016/2/1/407) * Rebase to clk-next and update according to the recent API changes. Changes since v4 (https://lkml.org/lkml/2015/12/14/367) * Convert to builtin drivers as now __clk_lookup() is used Changes since v3 (https://lkml.org/lkml/2015/8/12/585) * Split driver into two parts - and separate A53 PLL and A53 clock controller drivers. * Drop the safe switch hook patch. Add a clock notifier in the clock provider to handle switching via safe mux and divider configuration. Changes since v2 (https://lkml.org/lkml/2015/7/24/526) * Drop gpll0_vote patch. * Switch to the new clk_hw_* APIs. * Rebase to the current clk-next. Changes since v1 (https://lkml.org/lkml/2015/6/12/193) * Drop SR2 PLL patch, as it is already applied. * Add gpll0_vote rate propagation patch. * Update/rebase patches to the current clk-next. Georgi Djakov (3): clk: qcom: Add A53 PLL support clk: qcom: Add regmap mux-div clocks support mailbox: qcom: Add support for APCS clock controller .../devicetree/bindings/clock/qcom,a53pll.txt | 22 ++ .../bindings/mailbox/qcom,apcs-kpss-global.txt | 5 + drivers/clk/qcom/Kconfig | 9 + drivers/clk/qcom/Makefile | 2 + drivers/clk/qcom/a53-pll.c | 94 ++++++++ drivers/clk/qcom/clk-regmap-mux-div.c | 237 +++++++++++++++++++++ drivers/clk/qcom/clk-regmap-mux-div.h | 52 +++++ drivers/mailbox/qcom-apcs-ipc-mailbox.c | 122 +++++++++++ 8 files changed, 543 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/qcom,a53pll.txt create mode 100644 drivers/clk/qcom/a53-pll.c create mode 100644 drivers/clk/qcom/clk-regmap-mux-div.c create mode 100644 drivers/clk/qcom/clk-regmap-mux-div.h
[toc] | [next] | [standalone]
| From | Georgi Djakov <georgi.djakov@linaro.org> |
|---|---|
| Date | 2017-06-23 18:20 +0200 |
| Subject | [PATCH v8 1/3] clk: qcom: Add A53 PLL support |
| Message-ID | <tVzto-4pX-21@gated-at.bofh.it> |
| In reply to | #1673667 |
The CPUs on Qualcomm MSM8916-based platforms are clocked by two PLLs,
a primary (A53) CPU PLL and a secondary fixed-rate GPLL0. These sources
are connected to a mux and half-integer divider, which is feeding the
CPU cores.
This patch adds support for the primary CPU PLL which generates the
higher range of frequencies above 1GHz.
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
---
.../devicetree/bindings/clock/qcom,a53pll.txt | 22 +++++
drivers/clk/qcom/Kconfig | 9 +++
drivers/clk/qcom/Makefile | 1 +
drivers/clk/qcom/a53-pll.c | 94 ++++++++++++++++++++++
4 files changed, 126 insertions(+)
create mode 100644 Documentation/devicetree/bindings/clock/qcom,a53pll.txt
create mode 100644 drivers/clk/qcom/a53-pll.c
diff --git a/Documentation/devicetree/bindings/clock/qcom,a53pll.txt b/Documentation/devicetree/bindings/clock/qcom,a53pll.txt
new file mode 100644
index 000000000000..f4c2fddf6e7f
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/qcom,a53pll.txt
@@ -0,0 +1,22 @@
+MSM8916 A53 PLL Binding
+---------------
+The A53 PLL on MSM8916 platforms is the main CPU PLL used used for frequencies
+above 1GHz.
+
+Required properties :
+- compatible : Shall contain only one of the following:
+
+ "qcom,msm8916-a53pll"
+
+- reg : shall contain base register location and length
+
+- #clock-cells : must be set to <0>
+
+Example:
+
+ a53pll: clock@b016000 {
+ compatible = "qcom,msm8916-a53pll";
+ reg = <0xb016000 0x40>;
+ #clock-cells = <0>;
+ };
+
diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
index 9f6c278deead..057cf60ed037 100644
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
@@ -12,6 +12,15 @@ config COMMON_CLK_QCOM
select REGMAP_MMIO
select RESET_CONTROLLER
+config QCOM_A53PLL
+ bool "A53 PLL"
+ depends on COMMON_CLK_QCOM
+ help
+ Support for the A53 PLL on Qualcomm MSM8916 devices. It provides
+ support for CPU frequencies above 1GHz.
+ Say Y if you want to support CPU frequency scaling on devices
+ such as MSM8916.
+
config QCOM_CLK_RPM
tristate "RPM based Clock Controller"
depends on COMMON_CLK_QCOM && MFD_QCOM_RPM
diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
index 3f3aff229fb7..19ae884b5166 100644
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
@@ -31,5 +31,6 @@ obj-$(CONFIG_MSM_LCC_8960) += lcc-msm8960.o
obj-$(CONFIG_MSM_MMCC_8960) += mmcc-msm8960.o
obj-$(CONFIG_MSM_MMCC_8974) += mmcc-msm8974.o
obj-$(CONFIG_MSM_MMCC_8996) += mmcc-msm8996.o
+obj-$(CONFIG_QCOM_A53PLL) += a53-pll.o
obj-$(CONFIG_QCOM_CLK_RPM) += clk-rpm.o
obj-$(CONFIG_QCOM_CLK_SMD_RPM) += clk-smd-rpm.o
diff --git a/drivers/clk/qcom/a53-pll.c b/drivers/clk/qcom/a53-pll.c
new file mode 100644
index 000000000000..e039937e89fc
--- /dev/null
+++ b/drivers/clk/qcom/a53-pll.c
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2017, Linaro Limited
+ * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+
+#include "clk-pll.h"
+#include "clk-regmap.h"
+
+static const struct pll_freq_tbl a53pll_freq[] = {
+ { 998400000, 52, 0x0, 0x1, 0 },
+ { 1094400000, 57, 0x0, 0x1, 0 },
+ { 1152000000, 62, 0x0, 0x1, 0 },
+ { 1209600000, 65, 0x0, 0x1, 0 },
+ { 1401600000, 73, 0x0, 0x1, 0 },
+};
+
+static const struct regmap_config a53pll_regmap_config = {
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+ .max_register = 0x40,
+ .fast_io = true,
+ .val_format_endian = REGMAP_ENDIAN_LITTLE,
+};
+
+static const struct of_device_id qcom_a53pll_match_table[] = {
+ { .compatible = "qcom,msm8916-a53pll" },
+ { }
+};
+
+static int qcom_a53pll_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct clk_pll *pll;
+ struct resource *res;
+ void __iomem *base;
+ struct regmap *regmap;
+ struct clk_init_data init = { };
+
+ pll = devm_kzalloc(dev, sizeof(*pll), GFP_KERNEL);
+ if (!pll)
+ return -ENOMEM;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
+ regmap = devm_regmap_init_mmio(dev, base, &a53pll_regmap_config);
+ if (IS_ERR(regmap))
+ return PTR_ERR(regmap);
+
+ pll->l_reg = 0x04;
+ pll->m_reg = 0x08;
+ pll->n_reg = 0x0c;
+ pll->config_reg = 0x14;
+ pll->mode_reg = 0x00;
+ pll->status_reg = 0x1c;
+ pll->status_bit = 16;
+ pll->freq_tbl = a53pll_freq;
+
+ init.name = "a53pll";
+ init.parent_names = (const char *[]){ "xo" };
+ init.num_parents = 1;
+ init.ops = &clk_pll_sr2_ops;
+ init.flags = CLK_IS_CRITICAL;
+ pll->clkr.hw.init = &init;
+
+ return devm_clk_register_regmap(dev, &pll->clkr);
+}
+
+static struct platform_driver qcom_a53pll_driver = {
+ .probe = qcom_a53pll_probe,
+ .driver = {
+ .name = "qcom-a53pll",
+ .of_match_table = qcom_a53pll_match_table,
+ },
+};
+
+builtin_platform_driver(qcom_a53pll_driver);
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2017-06-26 21:50 +0200 |
| Subject | Re: [PATCH v8 1/3] clk: qcom: Add A53 PLL support |
| Message-ID | <tWIbg-6vE-21@gated-at.bofh.it> |
| In reply to | #1673669 |
On Fri, Jun 23, 2017 at 07:15:31PM +0300, Georgi Djakov wrote:
> The CPUs on Qualcomm MSM8916-based platforms are clocked by two PLLs,
> a primary (A53) CPU PLL and a secondary fixed-rate GPLL0. These sources
> are connected to a mux and half-integer divider, which is feeding the
> CPU cores.
>
> This patch adds support for the primary CPU PLL which generates the
> higher range of frequencies above 1GHz.
>
> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
> ---
> .../devicetree/bindings/clock/qcom,a53pll.txt | 22 +++++
It's preferred to split bindings to a separate patch. In any case,
Acked-by: Rob Herring <robh@kernel.org>
One kconfig comment though:
> drivers/clk/qcom/Kconfig | 9 +++
> drivers/clk/qcom/Makefile | 1 +
> drivers/clk/qcom/a53-pll.c | 94 ++++++++++++++++++++++
> 4 files changed, 126 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/clock/qcom,a53pll.txt
> create mode 100644 drivers/clk/qcom/a53-pll.c
>
> diff --git a/Documentation/devicetree/bindings/clock/qcom,a53pll.txt b/Documentation/devicetree/bindings/clock/qcom,a53pll.txt
> new file mode 100644
> index 000000000000..f4c2fddf6e7f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/qcom,a53pll.txt
> @@ -0,0 +1,22 @@
> +MSM8916 A53 PLL Binding
> +---------------
> +The A53 PLL on MSM8916 platforms is the main CPU PLL used used for frequencies
> +above 1GHz.
> +
> +Required properties :
> +- compatible : Shall contain only one of the following:
> +
> + "qcom,msm8916-a53pll"
> +
> +- reg : shall contain base register location and length
> +
> +- #clock-cells : must be set to <0>
> +
> +Example:
> +
> + a53pll: clock@b016000 {
> + compatible = "qcom,msm8916-a53pll";
> + reg = <0xb016000 0x40>;
> + #clock-cells = <0>;
> + };
> +
> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
> index 9f6c278deead..057cf60ed037 100644
> --- a/drivers/clk/qcom/Kconfig
> +++ b/drivers/clk/qcom/Kconfig
> @@ -12,6 +12,15 @@ config COMMON_CLK_QCOM
> select REGMAP_MMIO
> select RESET_CONTROLLER
>
> +config QCOM_A53PLL
> + bool "A53 PLL"
Figuring out config options needed for a specific QC SoC is "fun". If
this is only for MSM8916, then add that to the config option or prompt
text at least.
And please update the arm64 defconfig with this option.
> + depends on COMMON_CLK_QCOM
> + help
> + Support for the A53 PLL on Qualcomm MSM8916 devices. It provides
> + support for CPU frequencies above 1GHz.
> + Say Y if you want to support CPU frequency scaling on devices
> + such as MSM8916.
[toc] | [prev] | [next] | [standalone]
| From | Riku Voipio <riku.voipio@linaro.org> |
|---|---|
| Date | 2017-06-27 11:50 +0200 |
| Subject | Re: [PATCH v8 1/3] clk: qcom: Add A53 PLL support |
| Message-ID | <tWVia-739-31@gated-at.bofh.it> |
| In reply to | #1675070 |
On 26 June 2017 at 22:40, Rob Herring <robh@kernel.org> wrote:
> On Fri, Jun 23, 2017 at 07:15:31PM +0300, Georgi Djakov wrote:
>> The CPUs on Qualcomm MSM8916-based platforms are clocked by two PLLs,
>> a primary (A53) CPU PLL and a secondary fixed-rate GPLL0. These sources
>> are connected to a mux and half-integer divider, which is feeding the
>> CPU cores.
>>
>> This patch adds support for the primary CPU PLL which generates the
>> higher range of frequencies above 1GHz.
>>
>> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
>> ---
>> .../devicetree/bindings/clock/qcom,a53pll.txt | 22 +++++
>
> It's preferred to split bindings to a separate patch. In any case,
>
> Acked-by: Rob Herring <robh@kernel.org>
>
> One kconfig comment though:
>
>> drivers/clk/qcom/Kconfig | 9 +++
>> drivers/clk/qcom/Makefile | 1 +
>> drivers/clk/qcom/a53-pll.c | 94 ++++++++++++++++++++++
>> 4 files changed, 126 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/clock/qcom,a53pll.txt
>> create mode 100644 drivers/clk/qcom/a53-pll.c
>>
>> diff --git a/Documentation/devicetree/bindings/clock/qcom,a53pll.txt b/Documentation/devicetree/bindings/clock/qcom,a53pll.txt
>> new file mode 100644
>> index 000000000000..f4c2fddf6e7f
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/clock/qcom,a53pll.txt
>> @@ -0,0 +1,22 @@
>> +MSM8916 A53 PLL Binding
>> +---------------
>> +The A53 PLL on MSM8916 platforms is the main CPU PLL used used for frequencies
>> +above 1GHz.
>> +
>> +Required properties :
>> +- compatible : Shall contain only one of the following:
>> +
>> + "qcom,msm8916-a53pll"
>> +
>> +- reg : shall contain base register location and length
>> +
>> +- #clock-cells : must be set to <0>
>> +
>> +Example:
>> +
>> + a53pll: clock@b016000 {
>> + compatible = "qcom,msm8916-a53pll";
>> + reg = <0xb016000 0x40>;
>> + #clock-cells = <0>;
>> + };
>> +
>> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
>> index 9f6c278deead..057cf60ed037 100644
>> --- a/drivers/clk/qcom/Kconfig
>> +++ b/drivers/clk/qcom/Kconfig
>> @@ -12,6 +12,15 @@ config COMMON_CLK_QCOM
>> select REGMAP_MMIO
>> select RESET_CONTROLLER
>>
>> +config QCOM_A53PLL
>> + bool "A53 PLL"
>
> Figuring out config options needed for a specific QC SoC is "fun". If
> this is only for MSM8916, then add that to the config option or prompt
> text at least.
> And please update the arm64 defconfig with this option.
Maybe instead of updating defconfig set:
default ARCH_QCOM
I think the effect is roughly same but it makes the life of
distribution maintainers easier.
>> + depends on COMMON_CLK_QCOM
>> + help
>> + Support for the A53 PLL on Qualcomm MSM8916 devices. It provides
>> + support for CPU frequencies above 1GHz.
>> + Say Y if you want to support CPU frequency scaling on devices
>> + such as MSM8916.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[toc] | [prev] | [next] | [standalone]
| From | Georgi Djakov <georgi.djakov@linaro.org> |
|---|---|
| Date | 2017-06-27 18:30 +0200 |
| Subject | Re: [PATCH v8 1/3] clk: qcom: Add A53 PLL support |
| Message-ID | <tX1xg-32b-17@gated-at.bofh.it> |
| In reply to | #1675474 |
On 06/27/2017 12:48 PM, Riku Voipio wrote:
> On 26 June 2017 at 22:40, Rob Herring <robh@kernel.org> wrote:
>> On Fri, Jun 23, 2017 at 07:15:31PM +0300, Georgi Djakov wrote:
>>> The CPUs on Qualcomm MSM8916-based platforms are clocked by two PLLs,
>>> a primary (A53) CPU PLL and a secondary fixed-rate GPLL0. These sources
>>> are connected to a mux and half-integer divider, which is feeding the
>>> CPU cores.
>>>
>>> This patch adds support for the primary CPU PLL which generates the
>>> higher range of frequencies above 1GHz.
>>>
>>> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
>>> ---
>>> .../devicetree/bindings/clock/qcom,a53pll.txt | 22 +++++
>>
>> It's preferred to split bindings to a separate patch. In any case,
>>
>> Acked-by: Rob Herring <robh@kernel.org>
>>
>> One kconfig comment though:
>>
>>> drivers/clk/qcom/Kconfig | 9 +++
>>> drivers/clk/qcom/Makefile | 1 +
>>> drivers/clk/qcom/a53-pll.c | 94 ++++++++++++++++++++++
>>> 4 files changed, 126 insertions(+)
>>> create mode 100644 Documentation/devicetree/bindings/clock/qcom,a53pll.txt
>>> create mode 100644 drivers/clk/qcom/a53-pll.c
>>>
>>> diff --git a/Documentation/devicetree/bindings/clock/qcom,a53pll.txt b/Documentation/devicetree/bindings/clock/qcom,a53pll.txt
>>> new file mode 100644
>>> index 000000000000..f4c2fddf6e7f
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/clock/qcom,a53pll.txt
>>> @@ -0,0 +1,22 @@
>>> +MSM8916 A53 PLL Binding
>>> +---------------
>>> +The A53 PLL on MSM8916 platforms is the main CPU PLL used used for frequencies
>>> +above 1GHz.
>>> +
>>> +Required properties :
>>> +- compatible : Shall contain only one of the following:
>>> +
>>> + "qcom,msm8916-a53pll"
>>> +
>>> +- reg : shall contain base register location and length
>>> +
>>> +- #clock-cells : must be set to <0>
>>> +
>>> +Example:
>>> +
>>> + a53pll: clock@b016000 {
>>> + compatible = "qcom,msm8916-a53pll";
>>> + reg = <0xb016000 0x40>;
>>> + #clock-cells = <0>;
>>> + };
>>> +
>>> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
>>> index 9f6c278deead..057cf60ed037 100644
>>> --- a/drivers/clk/qcom/Kconfig
>>> +++ b/drivers/clk/qcom/Kconfig
>>> @@ -12,6 +12,15 @@ config COMMON_CLK_QCOM
>>> select REGMAP_MMIO
>>> select RESET_CONTROLLER
>>>
>>> +config QCOM_A53PLL
>>> + bool "A53 PLL"
>>
>> Figuring out config options needed for a specific QC SoC is "fun". If
>> this is only for MSM8916, then add that to the config option or prompt
>> text at least.
>
>> And please update the arm64 defconfig with this option.
>
> Maybe instead of updating defconfig set:
>
> default ARCH_QCOM
>
> I think the effect is roughly same but it makes the life of
> distribution maintainers easier.>
Thanks for the ideas, Riku and Rob. It looks like currently its only
used in msm8916 (but i might be wrong), so i will add MSM8916 to the
prompt and rename it to MSM_A53PLL_8916 to be more consistent with the
rest of the options.
If there are no objections, i can add:
default ARCH_QCOM && ARM64
Thanks,
Georgi
>>> + depends on COMMON_CLK_QCOM
>>> + help
>>> + Support for the A53 PLL on Qualcomm MSM8916 devices. It provides
>>> + support for CPU frequencies above 1GHz.
>>> + Say Y if you want to support CPU frequency scaling on devices
>>> + such as MSM8916.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web