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 10311C28B2E for ; Mon, 10 Mar 2025 11:54:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5nrjoakSV+aXyp9FtF2QEGa9iPOTgpE6PinOBCHA/Nc=; b=cEiWkORZfQgHKJMvz8aYBSZTf/ OLCwu0jz8E6NehjnMeVDN0Oi4cTPp6xb0C4CX6Hhk8Bs3xbmnSit8y0WoFWaw3c9CQyxkj3p4lmX4 5O+MtDIqg/QDFhXXX7d5nAYY7XF04EJ8LHIXA/az8zCEEJT40KfXdjW+YQAbCL82XlMi2B1IovVJr UdbolYC01A7Pto9LUsoSAuxxo+iyBCCmp/b24bNFookU6C3/ZYcoxiMljUa3ihKvQ107EkdT+0ULS 1L3pXTl+gU7L7zj4jsELaBWDEkoUqwfeBLJZ3131QEB95124u0sf8KTySRW4c/l++paYUWxCnVdJv 5J21+O0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1trbiR-00000002USO-0jMI; Mon, 10 Mar 2025 11:54:39 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1trbVZ-00000002Sma-1hRK; Mon, 10 Mar 2025 11:41:22 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 71510A44945; Mon, 10 Mar 2025 11:35:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B986C4CEE5; Mon, 10 Mar 2025 11:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741606880; bh=baohKrHUnm8F0gCGlhMlMZHHLAAXGDAnlAu9F2b27x0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Bb1rVcHODTTepAe2xtV9cg9zhjo7Gtb/OcDWaMECFAMc2aU2bzCWklhW4EP1LEM4k fHAFRnpxf/EImdd5ML0W3fZkubfXqUJOHGc9SJ2ve+HKdyEKdFKS79qOfE8X+KPoxP zheGIkLwsrYx5pGIR3G3Eu31Ts1u2dbgGGwn8Oh1y28V99CexsPZW9NVEt0XC6pngk z0kIXD5pFZd2Up8z14U5doOmKsuUeVxXjibhUnVGGb6ekcYBrFbeKnTdMHfgahfC2J 4++nwajOCndh9jhY9XmjDx9bYZaHPd/zH+/3+yPlS6IXvd0xK73hAmNIhvoX/jnBoA iZxnW8rp0BSgg== Message-ID: <026296c8-a460-43ca-a423-0fa38269fbc2@kernel.org> Date: Mon, 10 Mar 2025 12:41:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 05/13] dt-bindings: mfd: add Documentation for Airoha EN7581 SCU To: Christian Marangi Cc: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Vinod Koul , Kishon Vijay Abraham I , Matthias Brugger , AngeloGioacchino Del Regno , Greg Kroah-Hartman , Lorenzo Bianconi , Daniel Danzberger , Arnd Bergmann , Linus Walleij , Nikita Shubin , Guo Ren , Yangyu Chen , Ben Hutchings , Felix Fietkau , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-usb@vger.kernel.org, upstream@airoha.com References: <20250309132959.19045-1-ansuelsmth@gmail.com> <20250309132959.19045-6-ansuelsmth@gmail.com> <67cec328.170a0220.27ecbc.9c6e@mx.google.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE Fg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91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <67cec328.170a0220.27ecbc.9c6e@mx.google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250310_044121_591049_A7D5F1C0 X-CRM114-Status: GOOD ( 36.52 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On 10/03/2025 11:47, Christian Marangi wrote: > On Mon, Mar 10, 2025 at 10:21:45AM +0100, Krzysztof Kozlowski wrote: >> On 09/03/2025 14:29, Christian Marangi wrote: >>> Add Documentation for Airoha EN7581 SCU. >>> >>> Airoha EN7581 SoC expose registers to control miscellaneous pheriperals >>> via the SCU (System Controller Unit). >>> >>> Example of these pheriperals are reset-controller, clock-controller, >>> PCIe line speed controller and bits to configure different Serdes ports >>> for USB or Ethernet usage. >>> >>> Signed-off-by: Christian Marangi >>> --- >>> .../mfd/airoha,en7581-scu-sysctl.yaml | 68 +++++++++++++++++++ >>> 1 file changed, 68 insertions(+) >>> create mode 100644 Documentation/devicetree/bindings/mfd/airoha,en7581-scu-sysctl.yaml >>> >>> diff --git a/Documentation/devicetree/bindings/mfd/airoha,en7581-scu-sysctl.yaml b/Documentation/devicetree/bindings/mfd/airoha,en7581-scu-sysctl.yaml >>> new file mode 100644 >>> index 000000000000..d7dc66f912c1 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/mfd/airoha,en7581-scu-sysctl.yaml >>> @@ -0,0 +1,68 @@ >>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/mfd/airoha,en7581-scu-sysctl.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: Airoha EN7581 SCU (System Controller Unit) >>> + >>> +maintainers: >>> + - Christian Marangi >>> + >>> +description: >>> + Airoha EN7581 SoC expose registers to control miscellaneous >>> + pheriperals via the SCU (System Controller Unit). >>> + >> One more comment - there is no such thing as "sysctl" in your hardware. >> Look at the SCU binding which clearly says that it is the hardware you >> are duplicating here, so the "System Control Unit". >> >> So you have existing "This node defines the System Control Unit of the >> EN7523 SoC" and you add one more node which defines the "System Control >> Unit", so you have two "System Control Unit" device nodes? >> >> Look also what Stephen asked for: >> >> https://lore.kernel.org/all/20220106013100.842FCC36AEB@smtp.kernel.org/ >> >> so how system-controller can now became clock-controller? Now, it was >> the system controller since the beginning. >> > > The main problem here (and we had a similar problem with GPIO and PWM) > is that the Vendor (Airoha) wasn't so bright in placing the different > registers for the SoC so we have case where everything is mixed and not > one after another... > > Example we have > - CLK register part 1 > - Some bits that configure PCIe > - CLK register part 2 > - GPIO > - CLK register part 3 > - ... This does not explain that binding said "This node defines the System Control Unit". So what are you adding here if not SCU? > > The driver solution for this is syscon and the simple-mfd node > structure. Let's keep driver entirely separate, we don't talk about them and mixing arguments won't make it easier. > > Now the main problem is how to modle this in DT. There are lots of case > where the simple-mfd model is used (like the one proposed) but probably > this is not accepted anymore. But again this should be clearly stated or > we have a chicken-egg problem when other devs implement similar thing and > have to implement simple MFD driver to handle this. (and driver > maintainers say "Use the simple-mfd model like it was already done) simple-mfd has nothing to do here. Describe the hardware - what is the SCU? > > For this specific case (and to give an answer to the clock patch after > this) the problem is that this register space was originally used only > to control the clock and I wasn't aware that it was also used to control > USB. Now that I'm implementing support for it, the disaster happened. > > So In short SCU is lots of thing, both a system-controller, a > clock-controller and even a reset-controller. And you have bindings for that already. Done. > > To make it short, 2 different solution: > 1. We can keep the current node structure of the node-controller and add a > child node for the SSR part (with a dedicated compatible). No, you do not add child nodes just because you want some drivers. What is SSR? How is it a device? > 2. Those property need to be be defined in the clock-controller node? In the SCU node. Do you have only one SCU or more? > > The ideal solution is 1. Does it work for you? > > Sorry for the long post and hope you understand why this mess of > reworking the binding. > Best regards, Krzysztof