From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A73FC10F16 for ; Fri, 3 May 2024 12:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-reply-to: Date:Subject:Cc:To:From:References:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CsrnQCMQU/igT7614MRu7W/Wa0bvSpBiMq/XqWRdj3M=; b=ohjcqQ4Rn2/IW7 ERMLvgviBeBFQcNtk7w1QbXaN19E3hfJIWOKj/AHXji8Io0+KFrcupg3ma+his4ic7B/u+brG+8x1 NxV1jufV7iM4dOX52Bdsjt1vcff/r5dloYWH4iUR3COshYqrnOMr6yVtsKFe7Vs83qOjXu8C5cErb MIWVoQtgl06JKhe3g0RH2+MUz4c8gqH6l/ABRow92CnpeSlQANmWaNXTEIzMM8Mcojzd5VtKL6OlK 8FV+UigrcFwX837dWYRoBN+Rr8MPbCTkdUG8xSX+vopRIt1XlUHPr/IWWyQaFrpA7sXPzHOS1AUNx s8dIo0+3m6sN0vR89FDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2rtS-0000000GOvR-2TSg; Fri, 03 May 2024 12:20:02 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2rtO-0000000GOty-0vRA for linux-amlogic@lists.infradead.org; Fri, 03 May 2024 12:20:00 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-51f0f6b613dso2483576e87.1 for ; Fri, 03 May 2024 05:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1714738792; x=1715343592; darn=lists.infradead.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=2eqCGUNVwZTag5I7AILZ3zgJXV85rMS4OnjGvjuWay0=; b=JyvHc2AhZMLEWpv46O4ArQTIpJIamCDKMSGrfBACuNUGUzK0Tt5pqGcE9xIE5MfDAi 2WyT2kUj9dFdtYQKv9XIrFCgEoQAms8KWePKQS9P1tcyecldmYsKt5WF+8jYEg/uYOaM uNcHgLvW285DBUNY35COG08wDg8UhWf4sEhdCPsTrcJR1V/zZbBsN8ktyO/hbOk2lFFV DvQRdsrgTnbLpES5+hF54i4e8yXRPamE/5vVj7rdrRffkPlkjNzY3BrcBlYyZpFr9ioE FcmUmtLFsOE7ZZ6BIykTWu4SWRGGpf0KxksRbpq8q8OYMw2SInFVcrCPwEQZmxtRENgH YFJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714738792; x=1715343592; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2eqCGUNVwZTag5I7AILZ3zgJXV85rMS4OnjGvjuWay0=; b=kaRXB8KYy5RZiGilyOhghqrKonPnDffMH7Kl/ImmSVtGt2/c2yG9ZUXivKVIWJ4XT9 YLr6HNtS9PhV6ktcXdCyd9otno14ZVxwoitvw49eKh2+cfvPtFX5eJhfnjhiME7bZC++ k9lh6uTS2FX/Wnxcem0H+kdZI/GPdy445gLImRL7blDsnLeYZPjMan0jZDx8quoELXVb ow5/+ZXfl4j7WrBnGxOPVcBz17KvJF+woujXNowxJeeNelEFfFiRQkbHIAFIQG+1aNHd AjVy3i8tSVH4yMOM+K26dvhYkBHY8hx+CB4Zf/SA2DkJgscV41vB107oJQx3slIYqpV7 BDNQ== X-Forwarded-Encrypted: i=1; AJvYcCWZrs3pW34byU+ytkEyL7UbXtzNbfSNQBcwIPOpZgbNc4xTswpdDTJbaLog/SMMTSq0nS52IVmOQqgCgTIqVITGnAnBbn2kD4XGpYchcai4wUs= X-Gm-Message-State: AOJu0YzoA9yfhE+xAIYevBaGWBDS4SXvi3W45i7cGywqn4BGuuLH9/hj 9NMLtgfSIKn2P1oIj/5Z2Qy7y5nEc2J+hXmpKMJ9+3D/Sqk5Oal10XJbVYVS/NU= X-Google-Smtp-Source: AGHT+IHCsUvbERAVRCqb5stqTzQ2F0+83tkFBnxwOqCKN+ECOXNxNs4F4W5oi11tZ2FknKUU/uEH9Q== X-Received: by 2002:ac2:47e4:0:b0:51a:c207:12b with SMTP id b4-20020ac247e4000000b0051ac207012bmr1640318lfp.37.1714738792161; Fri, 03 May 2024 05:19:52 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:1b85:e590:355b:9957]) by smtp.gmail.com with ESMTPSA id ay2-20020a05600c1e0200b00418948a5eb0sm9229978wmb.32.2024.05.03.05.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 05:19:51 -0700 (PDT) References: <20240424050928.1997820-1-xianwei.zhao@amlogic.com> <20240424050928.1997820-6-xianwei.zhao@amlogic.com> <20240424200107.GA372179-robh@kernel.org> <9a9ab302-5da5-47bb-85f1-d2295fa9f8c9@amlogic.com> User-agent: mu4e 1.10.8; emacs 29.2 From: Jerome Brunet To: Xianwei Zhao Cc: Rob Herring , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong , Jerome Brunet , Michael Turquette , Stephen Boyd , Krzysztof Kozlowski , Conor Dooley , Kevin Hilman , Chuan Liu Subject: Re: [PATCH v7 5/5] clk: meson: c3: add c3 clock peripherals controller driver Date: Fri, 03 May 2024 14:16:17 +0200 In-reply-to: <9a9ab302-5da5-47bb-85f1-d2295fa9f8c9@amlogic.com> Message-ID: <1jle4r3x5l.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240503_051958_386535_3C7C02EB X-CRM114-Status: GOOD ( 21.61 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org On Thu 25 Apr 2024 at 14:28, Xianwei Zhao wrote: > Hi Rob, > Thanks for your review. > > On 2024/4/25 04:01, Rob Herring wrote: >> [ EXTERNAL EMAIL ] >> On Wed, Apr 24, 2024 at 01:09:28PM +0800, Xianwei Zhao wrote: >>> Add the C3 peripherals clock controller driver in the C3 SoC family. >>> >>> Co-developed-by: Chuan Liu >>> Signed-off-by: Chuan Liu >>> Signed-off-by: Xianwei Zhao >>> --- >>> drivers/clk/meson/Kconfig | 15 + >>> drivers/clk/meson/Makefile | 1 + >>> drivers/clk/meson/c3-peripherals.c | 2366 ++++++++++++++++++++++++++++ >>> 3 files changed, 2382 insertions(+) >>> create mode 100644 drivers/clk/meson/c3-peripherals.c >>> >>> diff --git a/drivers/clk/meson/Kconfig b/drivers/clk/meson/Kconfig >>> index 9f975a980581..0b85d584910e 100644 >>> --- a/drivers/clk/meson/Kconfig >>> +++ b/drivers/clk/meson/Kconfig >>> @@ -142,6 +142,21 @@ config COMMON_CLK_C3_PLL >>> AKA C3. Say Y if you want the board to work, because PLLs are the parent >>> of most peripherals. >>> >>> +config COMMON_CLK_C3_PERIPHERALS >>> + tristate "Amlogic C3 peripherals clock controller" >>> + depends on ARM64 >>> + depends on ARM_SCMI_PROTOCOL >> I may have missed it, but I don't see the dependency on SCMI in this >> driver. >> > > Some clock sources for peripherals controller from SCMI module. > In previous version, Jerome suggest us the clock that relevant registers > can only be accessed securely is implemented through SCMI. > There is no dependency but you are guranteed to have have problem if SCMI is missing because it provides several inputs to this controller. IMO, this controller should 'imply ARM_SCMI_PROTOCOL' You have already posted a v8 without it. I expect a fix up change on top of v8 if there is no other comment on this v8 version. Part of v9 otherwise. >>> + depends on COMMON_CLK_SCMI >>> + depends on COMMON_CLK_C3_PLL >>> + default y >>> + select COMMON_CLK_MESON_REGMAP >>> + select COMMON_CLK_MESON_DUALDIV >>> + select COMMON_CLK_MESON_CLKC_UTILS >>> + help >>> + Support for the Peripherals clock controller on Amlogic C302X and >>> + C308L devices, AKA C3. Say Y if you want the peripherals clock to >>> + work. >>> + >>> config COMMON_CLK_G12A >>> tristate "G12 and SM1 SoC clock controllers support" >>> depends on ARM64 >>> diff --git a/drivers/clk/meson/Makefile b/drivers/clk/meson/Makefile >>> index 4420af628b31..20ad9482c892 100644 >>> --- a/drivers/clk/meson/Makefile >>> +++ b/drivers/clk/meson/Makefile >>> @@ -20,6 +20,7 @@ obj-$(CONFIG_COMMON_CLK_AXG_AUDIO) += axg-audio.o >>> obj-$(CONFIG_COMMON_CLK_A1_PLL) += a1-pll.o >>> obj-$(CONFIG_COMMON_CLK_A1_PERIPHERALS) += a1-peripherals.o >>> obj-$(CONFIG_COMMON_CLK_C3_PLL) += c3-pll.o >>> +obj-$(CONFIG_COMMON_CLK_C3_PERIPHERALS) += c3-peripherals.o >>> obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o >>> obj-$(CONFIG_COMMON_CLK_G12A) += g12a.o g12a-aoclk.o >>> obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o meson8-ddr.o >>> diff --git a/drivers/clk/meson/c3-peripherals.c b/drivers/clk/meson/c3-peripherals.c >>> new file mode 100644 >>> index 000000000000..0f834ced0ee9 >>> --- /dev/null >>> +++ b/drivers/clk/meson/c3-peripherals.c >>> @@ -0,0 +1,2366 @@ >>> +// SPDX-License-Identifier: GPL-2.0-only >>> +/* >>> + * Amlogic C3 Peripherals Clock Controller Driver >>> + * >>> + * Copyright (c) 2023 Amlogic, inc. >>> + * Author: Chuan Liu >>> + */ >>> + >>> +#include >>> +#include >> I don't think you need this header. >> > > Yes, I will fix it with c3-pll.c. > >>> +#include >>> +#include "clk-regmap.h" >>> +#include "clk-dualdiv.h" >>> +#include "meson-clkc-utils.h" >>> +#include -- Jerome _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic