linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alim Akhtar" <alim.akhtar@samsung.com>
To: "'Krzysztof Kozlowski'" <krzysztof.kozlowski@canonical.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Cc: <soc@kernel.org>, <linux-clk@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <olof@lixom.net>,
	<linus.walleij@linaro.org>, <catalin.marinas@arm.com>,
	<robh+dt@kernel.org>, <s.nawrocki@samsung.com>,
	<linux-samsung-soc@vger.kernel.org>, <pankaj.dubey@samsung.com>,
	<linux-fsd@tesla.com>,
	"'Aswani Reddy'" <aswani.reddy@samsung.com>,
	"'Niyas Ahmed S T'" <niyas.ahmed@samsung.com>,
	"'Chandrasekar R'" <rcsekar@samsung.com>,
	"'Jayati Sahu'" <jayati.sahu@samsung.com>,
	"'Sriranjani P'" <sriranjani.p@samsung.com>,
	"'Ajay Kumar'" <ajaykumar.rs@samsung.com>
Subject: RE: [PATCH 04/23] clk: samsung: fsd: Add cmu_peric block clock information
Date: Fri, 14 Jan 2022 12:00:17 +0530	[thread overview]
Message-ID: <077e01d80910$35ecd5b0$a1c68110$@samsung.com> (raw)
In-Reply-To: <1b246ad6-5b65-a02f-e887-5a07e8f12ec7@canonical.com>



>-----Original Message-----
>From: Krzysztof Kozlowski [mailto:krzysztof.kozlowski@canonical.com]
>Sent: Thursday, January 13, 2022 6:25 PM
>To: Alim Akhtar <alim.akhtar@samsung.com>; linux-arm-
>kernel@lists.infradead.org; linux-kernel@vger.kernel.org
>Cc: soc@kernel.org; linux-clk@vger.kernel.org; devicetree@vger.kernel.org;
>olof@lixom.net; linus.walleij@linaro.org; catalin.marinas@arm.com;
>robh+dt@kernel.org; s.nawrocki@samsung.com; linux-samsung-
>soc@vger.kernel.org; pankaj.dubey@samsung.com; linux-fsd@tesla.com;
>Aswani Reddy <aswani.reddy@samsung.com>; Niyas Ahmed S T
><niyas.ahmed@samsung.com>; Chandrasekar R <rcsekar@samsung.com>;
>Jayati Sahu <jayati.sahu@samsung.com>; Sriranjani P
><sriranjani.p@samsung.com>; Ajay Kumar <ajaykumar.rs@samsung.com>
>Subject: Re: [PATCH 04/23] clk: samsung: fsd: Add cmu_peric block clock
>information
>
>On 13/01/2022 13:11, Alim Akhtar wrote:
>> This patch adds CMU_PERIC block clock information needed for various
>> IPs functions found in this block.
>
>Here and in all other commits, please do not use "This patch". Instead:
>https://protect2.fireeye.com/v1/url?k=5ec41fe1-015f26dc-5ec594ae-
>0cc47a31309a-72c796795ac37ef5&q=1&e=2a1e171b-f066-48ff-95a7-
>12605dbbf8a9&u=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Fv5.13%2Fso
>urce%2FDocumentation%2Fprocess%2Fsubmitting-patches.rst%23L89
>
Noted
>>
>> Cc: linux-fsd@tesla.com
>> Signed-off-by: Aswani Reddy <aswani.reddy@samsung.com>
>> Signed-off-by: Niyas Ahmed S T <niyas.ahmed@samsung.com>
>> Signed-off-by: Chandrasekar R <rcsekar@samsung.com>
>> Signed-off-by: Jayati Sahu <jayati.sahu@samsung.com>
>> Signed-off-by: Sriranjani P <sriranjani.p@samsung.com>
>> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
>> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
>> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
>> ---
>>  drivers/clk/samsung/clk-fsd.c | 464
>> +++++++++++++++++++++++++++++++++-
>>  1 file changed, 463 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/clk/samsung/clk-fsd.c
>> b/drivers/clk/samsung/clk-fsd.c index e47523106d9e..6da20966ba99
>> 100644
>> --- a/drivers/clk/samsung/clk-fsd.c
>> +++ b/drivers/clk/samsung/clk-fsd.c
>> @@ -9,12 +9,59 @@
>>   *
>>   */
>>
>> -#include <linux/clk-provider.h>
>>  #include <linux/of.h>
>> +#include <linux/clk.h>
>> +#include <linux/of_address.h>
>> +#include <linux/of_device.h>
>> +#include <linux/clk-provider.h>
>> +#include <linux/platform_device.h>
>
>Please order the includes alphabetically.
>
Sure will fix this
>>
>>  #include "clk.h"
>>  #include <dt-bindings/clock/fsd-clk.h>
>>
>> +/* Gate register bits */
>> +#define GATE_MANUAL		BIT(20)
>> +#define GATE_ENABLE_HWACG	BIT(28)
>> +
>> +/* Gate register offsets range */
>> +#define GATE_OFF_START		0x2000
>> +#define GATE_OFF_END		0x2fff
>> +
>> +/**
>> + * fsd_init_clocks - Set clocks initial configuration
>> + * @np:			CMU device tree node with "reg" property
>(CMU addr)
>> + * @reg_offs:		Register offsets array for clocks to init
>> + * @reg_offs_len:	Number of register offsets in reg_offs array
>> + *
>> + * Set manual control mode for all gate clocks.
>> + */
>> +static void __init fsd_init_clocks(struct device_node *np,
>> +		const unsigned long *reg_offs, size_t reg_offs_len)
>
>The same as exynos_arm64_init_clocks - please re-use instead of duplicating.
>
Will re-base on latest tree to have these common functions
>> +{
>> +	void __iomem *reg_base;
>> +	size_t i;
>> +
>> +	reg_base = of_iomap(np, 0);
>> +	if (!reg_base)
>> +		panic("%s: failed to map registers\n", __func__);
>> +
>> +	for (i = 0; i < reg_offs_len; ++i) {
>> +		void __iomem *reg = reg_base + reg_offs[i];
>> +		u32 val;
>> +
>> +		/* Modify only gate clock registers */
>> +		if (reg_offs[i] < GATE_OFF_START || reg_offs[i] >
>GATE_OFF_END)
>> +			continue;
>> +
>> +		val = readl(reg);
>> +		val |= GATE_MANUAL;
>> +		val &= ~GATE_ENABLE_HWACG;
>> +		writel(val, reg);
>> +	}
>> +
>> +	iounmap(reg_base);
>> +}
>> +
>
>(...)
>
>> +/**
>> + * fsd_cmu_probe - Probe function for FSD platform clocks
>> + * @pdev: Pointer to platform device
>> + *
>> + * Configure clock hierarchy for clock domains of FSD platform  */
>> +static int __init fsd_cmu_probe(struct platform_device *pdev) {
>> +	const struct samsung_cmu_info *info;
>> +	struct device *dev = &pdev->dev;
>> +	struct device_node *np = dev->of_node;
>> +
>> +	info = of_device_get_match_data(dev);
>> +	fsd_init_clocks(np, info->clk_regs, info->nr_clk_regs);
>> +	samsung_cmu_register_one(np, info);
>> +
>> +	/* Keep bus clock running, so it's possible to access CMU registers */
>> +	if (info->clk_name) {
>> +		struct clk *bus_clk;
>> +
>> +		bus_clk = clk_get(dev, info->clk_name);
>> +		if (IS_ERR(bus_clk)) {
>> +			pr_err("%s: could not find bus clock %s; err = %ld\n",
>> +			       __func__, info->clk_name, PTR_ERR(bus_clk));
>> +		} else {
>> +			clk_prepare_enable(bus_clk);
>> +		}
>> +	}
>> +
>> +	return 0;
>> +}
>
>Please re-use exynos_arm64_register_cmu(). This will also solve my previous
>comment about exynos_arm64_init_clocks().
>
ok
>> +
>> +/* CMUs which belong to Power Domains and need runtime PM to be
>> +implemented */ static const struct of_device_id fsd_cmu_of_match[] = {
>> +	{
>> +		.compatible = "tesla,fsd-clock-peric",
>> +		.data = &peric_cmu_info,
>> +	}, {
>> +	},
>> +};
>> +
>> +static struct platform_driver fsd_cmu_driver __refdata = {
>> +	.driver	= {
>> +		.name = "fsd-cmu",
>> +		.of_match_table = fsd_cmu_of_match,
>> +		.suppress_bind_attrs = true,
>> +	},
>> +	.probe = fsd_cmu_probe,
>> +};
>> +
>> +static int __init fsd_cmu_init(void)
>> +{
>> +	return platform_driver_register(&fsd_cmu_driver);
>> +}
>> +core_initcall(fsd_cmu_init);
>>
>
>
>Best regards,
>Krzysztof


  reply	other threads:[~2022-01-14  6:30 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220113122302epcas5p1d45c0714fe286f8f91d0f28c3fad86e4@epcas5p1.samsung.com>
2022-01-13 12:11 ` [PATCH 00/23] Add support for Tesla Full Self-Driving (FSD) SoC Alim Akhtar
2022-01-13 12:11   ` [PATCH 01/23] dt-bindings: clock: Document FSD CMU bindings Alim Akhtar
2022-01-13 12:40     ` Krzysztof Kozlowski
2022-01-14  5:48       ` Alim Akhtar
2022-01-13 23:33     ` Rob Herring
2022-01-13 12:11   ` [PATCH 02/23] dt-bindings: clock: Add bindings definitions for FSD CMU blocks Alim Akhtar
2022-01-13 12:11   ` [PATCH 03/23] clk: samsung: fsd: Add initial clock support Alim Akhtar
2022-01-13 12:49     ` Krzysztof Kozlowski
2022-01-14  6:16       ` Alim Akhtar
2022-01-13 12:11   ` [PATCH 04/23] clk: samsung: fsd: Add cmu_peric block clock information Alim Akhtar
2022-01-13 12:55     ` Krzysztof Kozlowski
2022-01-14  6:30       ` Alim Akhtar [this message]
2022-01-13 12:11   ` [PATCH 05/23] clk: samsung: fsd: Add cmu_fsys0 " Alim Akhtar
2022-01-13 12:11   ` [PATCH 06/23] clk: samsung: fsd: Add cmu_fsys1 " Alim Akhtar
2022-01-13 12:11   ` [PATCH 07/23] clk: samsung: fsd: Add cmu_imem block " Alim Akhtar
2022-01-13 12:11   ` [PATCH 08/23] clk: samsung: fsd: Add cmu_mfc " Alim Akhtar
2022-01-13 12:11   ` [PATCH 09/23] clk: samsung: fsd: Add cam_csi " Alim Akhtar
2022-01-13 12:11   ` [PATCH 10/23] dt-bindings: pinctrl: samsung: Add compatible for Tesla FSD SoC Alim Akhtar
2022-01-13 12:27     ` Krzysztof Kozlowski
2022-01-14  5:44       ` Alim Akhtar
2022-01-14  7:49         ` Krzysztof Kozlowski
2022-01-14  8:38           ` Alim Akhtar
2022-01-13 12:11   ` [PATCH 11/23] pinctrl: samsung: add FSD SoC specific data Alim Akhtar
2022-01-13 12:57     ` Krzysztof Kozlowski
2022-01-16 12:05     ` Linus Walleij
2022-01-13 12:11   ` [PATCH 12/23] dt-bindings: add vendor prefix for Tesla Alim Akhtar
2022-01-13 12:58     ` Krzysztof Kozlowski
2022-01-14  7:10       ` Alim Akhtar
2022-01-16 12:09     ` Linus Walleij
2022-01-13 12:11   ` [PATCH 13/23] dt-bindings: arm: add Tesla FSD ARM SoC Alim Akhtar
2022-01-13 12:33     ` Krzysztof Kozlowski
2022-01-14 16:57       ` Alim Akhtar
2022-01-14 17:29         ` Krzysztof Kozlowski
2022-01-17 13:26           ` Alim Akhtar
2022-01-17 14:14             ` Arnd Bergmann
2022-01-17 15:00               ` Krzysztof Kozlowski
2022-01-17 20:41                 ` Olof Johansson
2022-01-13 12:11   ` [PATCH 14/23] arm64: dts: fsd: Add initial device tree support Alim Akhtar
2022-01-13 13:16     ` Krzysztof Kozlowski
2022-01-13 14:23       ` Arnd Bergmann
2022-01-14  8:13         ` Alim Akhtar
2022-01-14  2:08     ` kernel test robot
2022-01-13 12:11   ` [PATCH 15/23] arm64: dts: fsd: Add initial pinctrl support Alim Akhtar
2022-01-13 13:19     ` Krzysztof Kozlowski
2022-01-17 13:44       ` Alim Akhtar
2022-01-17 13:50         ` Krzysztof Kozlowski
2022-01-18 14:58           ` Alim Akhtar
2022-01-13 12:11   ` [PATCH 16/23] arm64: defconfig: Enable Tesla FSD SoC Alim Akhtar
2022-01-13 12:11   ` [PATCH 17/23] Documentation: bindings: Add fsd spi compatible in dt-bindings document Alim Akhtar
2022-01-13 13:21     ` Krzysztof Kozlowski
2022-01-13 13:24     ` Krzysztof Kozlowski
2022-01-14  7:17       ` Alim Akhtar
2022-01-13 12:11   ` [PATCH 18/23] spi: s3c64xx: Add spi port configuration for Tesla FSD SoC Alim Akhtar
2022-01-13 13:28     ` Krzysztof Kozlowski
     [not found]     ` <YeAiIhfN216pRWhn@sirena.org.uk>
2022-01-14  7:15       ` Alim Akhtar
2022-01-16 12:12     ` Linus Walleij
2022-01-13 12:11   ` [PATCH 19/23] arm64: dts: fsd: Add SPI device nodes Alim Akhtar
2022-01-13 13:30     ` Krzysztof Kozlowski
2022-01-13 12:11   ` [PATCH 20/23] dt-bindings: iio: adc: exynos-adc: Add ADC-V3 variant Alim Akhtar
2022-01-13 13:32     ` Krzysztof Kozlowski
2022-01-17  9:47       ` Jonathan Cameron
2022-01-17 12:42         ` Alim Akhtar
2022-01-13 12:11   ` [PATCH 21/23] iio: adc: exynos-adc: Add support for ADC V3 controller Alim Akhtar
     [not found]     ` <20220116111939.413ece7e@jic23-huawei>
2022-01-17 12:20       ` Alim Akhtar
2022-01-13 12:11   ` [PATCH 22/23] arm64: dts: fsd: Add ADC device tree node Alim Akhtar
2022-01-13 13:33     ` Krzysztof Kozlowski
2022-01-13 12:11   ` [PATCH 23/23] clocksource: exynos_mct: Add support for handling three clusters Alim Akhtar
2022-01-13 13:36     ` Krzysztof Kozlowski
2022-01-13 12:31   ` [PATCH 00/23] Add support for Tesla Full Self-Driving (FSD) SoC Krzysztof Kozlowski
2022-01-13 18:53     ` Olof Johansson
2022-01-14  5:41     ` Alim Akhtar
2022-01-14  7:34       ` Krzysztof Kozlowski
2022-01-16  9:23   ` Pavel Machek
2022-01-17 20:53     ` Olof Johansson
2022-01-17 23:10       ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='077e01d80910$35ecd5b0$a1c68110$@samsung.com' \
    --to=alim.akhtar@samsung.com \
    --cc=ajaykumar.rs@samsung.com \
    --cc=aswani.reddy@samsung.com \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jayati.sahu@samsung.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-fsd@tesla.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=niyas.ahmed@samsung.com \
    --cc=olof@lixom.net \
    --cc=pankaj.dubey@samsung.com \
    --cc=rcsekar@samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=soc@kernel.org \
    --cc=sriranjani.p@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).