Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp235067rdb; Thu, 30 Nov 2023 03:33:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXe1P9CS6QStyIwnhuYICcnZFKy3HT92nEFEchjAhyfrFMKeeG6evlZ7eqjc5b50iI3yaN X-Received: by 2002:a05:6870:788c:b0:1e9:d158:7e85 with SMTP id hc12-20020a056870788c00b001e9d1587e85mr22649175oab.30.1701344033839; Thu, 30 Nov 2023 03:33:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701344033; cv=pass; d=google.com; s=arc-20160816; b=my8A6mB5/YvNMxnSEBm9l9UM11x46dVCmiAHYwphVI03/Ff1TY5cQKho84YBMpLPFM obq7lfZt1uw68ils35UPn7BwpBBJ+3cryUBt6bc8Q6+IrIUKfcS5JnQETGsGR4fCn5qO KdxhBEnkKmGSSyRUBSUC3Vjyq8YpXonAk9AMzK5eN0XHbjbF/STRcaEMT5spyXNgzUW5 Pyayz1hYSuckfqoO6TOyMxX1oDnIixOW2/CuwBpMIf3byhcOeQiVCCUsBucSGZA05/5I dEV9L0qLd3b5OgKgLMAfKyq7idkeC6WTh+uw7Jh3iLLfi+BGbe6QKuNebbeW5PUyjyEq Ly6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:subject:user-agent:date :message-id:dkim-signature; bh=0ySqHa3to6LVZ5DNI4EE3X0iC915mESko3uK92pW0Og=; fh=yCrjf1oYCSJbx2Lbg/8gWfurK68iMUcJWgDd2LvcJTY=; b=EN8Up5vWcfEqGa/42ChyV0oY2gF8yoAau+usBvTCpVK+9UgiYHRxmIJSqM4QZkyMfm k9a4nDZChq1l2D+aGXJqkXTg7WyZWQqRPwzSZWV0ayrv+RaBdw9Xvnjne6z4YOTCa7Ir T4/XOIR0ncjdzqG0vGOMk3PbIC9t0IfGQ377H2srQbYv3E3+aSmAcf2vS9InO0joTbIN QiCSzpOkh0LHgdV2ur5Oa4TFXHx4DfjA+jDJ4ii0BhUknUw1E1hv8F5AZHvmscGNDX2q f1m6ZFP5p8Sjg3qV1UdVKI68U3yf+eXFKRUF94P8KbTuKAjBG4B4tUoxauv6U75wAN91 suyw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=c8dA60KQ; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id l68-20020a632547000000b005be1ee5dd00si1062804pgl.764.2023.11.30.03.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 03:33:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=c8dA60KQ; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D2E88829AA05; Thu, 30 Nov 2023 03:33:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345231AbjK3LdV (ORCPT + 99 others); Thu, 30 Nov 2023 06:33:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345195AbjK3LdA (ORCPT ); Thu, 30 Nov 2023 06:33:00 -0500 Received: from IND01-MAX-obe.outbound.protection.outlook.com (mail-maxind01olkn2065.outbound.protection.outlook.com [40.92.102.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0404910E2; Thu, 30 Nov 2023 03:32:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VS2aIsRQ0Tf/6FaQzgU2ZrronB3p5puhrTLnVf40wxnl9am/2UmnHF+fjpCZQVnWq9eiYOUlYTcdB179QF7lyraMISDjNgX+aR4qWIZ50LuhqcAWhte5x2tOhmeY6U3SH8xz6e9IFpgbnELHvMrv90xDv+mH9U7Q6xdyINcuWfJwm1l3guTnzp+GzmoBRxB/FAFIeP8rJnPg1HBRcyzzSQdy9O5QEZaL7p8DZN5+oeo5hQjn8nwsbFEjyt9ukcQ4Bn60LWQWicJY9XiRBaTkmJXLgGqR5+f2dhzQEVBTk5i1ZAHB9CaP8stgDS0afei8WubN6RShDTmHIIh1tQvP6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0ySqHa3to6LVZ5DNI4EE3X0iC915mESko3uK92pW0Og=; b=R96V7Z2rwFKHbWYFPSuuvbQrM0NustjIBfE4a4V8Z0EMbJ58CYPnRrAyWrIH/c8upvoQQDUq2C1SfsAUL7afFEcGQOELShOs8dXzOQp3Fp0oCocIgLszzYo2H+Hym0isyTmkLdrqtC6X/B/jv8XnmR165C98eYnRRUYZ71JhwYdSkFC71uR/6R3pkZ/waFZSZJMl8jq+1Qu0pajUgDhggC8XY2UXKwrUjU7m1AuU8EmBHloCT0gEWgHuoVz+waH0GcbGKHab7YO20JmT+K2DVDWOJqarTxZoqHB/ZUQwBYn5vgbiNZDdvtDUKJ15OUf9g9hOvPHLK8+nea3jcYP9iQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0ySqHa3to6LVZ5DNI4EE3X0iC915mESko3uK92pW0Og=; b=c8dA60KQsxYF+kFNlI++SJrDNXTp2w4QerUzZgTS/Zg+uyhAxBR0jItBt8FeFD1jHVcAdY/0kxX9rGqdPNG58T54NIg3JE+H2SDRBaaz+7TLjI5oLDaiiCc6PxXMYjrUnfB0yEmcsNFd9GuitC3JXq5htqzjA6MevdT+bRKhAMheE/XrQiFGW/XOWywkQBfaA4QXy3S1WoolhkbmBd6gwVaP78Waf+0IVz05+3l+vZlEP9v5bGElXRKUufOFi45x2c30WPOu8Zaa5mJ7hZVSwgm0HX4poGwddDoJI0Ms+JB+M/Zhu/egsrFWHXO64uf9/iEt36dwKLRMjyHR954U3w== Received: from MA0P287MB0332.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:ab::5) by MA0P287MB0419.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:bf::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24; Thu, 30 Nov 2023 11:32:47 +0000 Received: from MA0P287MB0332.INDP287.PROD.OUTLOOK.COM ([fe80::b1a7:eee7:e903:9ef3]) by MA0P287MB0332.INDP287.PROD.OUTLOOK.COM ([fe80::b1a7:eee7:e903:9ef3%7]) with mapi id 15.20.7046.024; Thu, 30 Nov 2023 11:32:47 +0000 Message-ID: Date: Thu, 30 Nov 2023 19:32:36 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/4] clk: sophgo: Add SG2042 clock generator driver To: Conor Dooley Cc: Krzysztof Kozlowski , Chen Wang , aou@eecs.berkeley.edu, chao.wei@sophgo.com, krzysztof.kozlowski+dt@linaro.org, mturquette@baylibre.com, palmer@dabbelt.com, paul.walmsley@sifive.com, richardcochran@gmail.com, robh+dt@kernel.org, sboyd@kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, haijiao.liu@sophgo.com, xiaoguang.xing@sophgo.com, guoren@kernel.org, jszhang@kernel.org, inochiama@outlook.com, samuel.holland@sifive.com References: <81d421c8-bfd6-42b5-9da1-f067792f8f48@linaro.org> <2a268c8c-ce55-4321-b390-092b8df61407@linaro.org> <20231130-enlarging-decode-31dc66f4490b@spud> From: Chen Wang In-Reply-To: <20231130-enlarging-decode-31dc66f4490b@spud> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TMN: [5MZuf4iJYQIzVY2VCTPvPhC10L8E/9ac] X-ClientProxiedBy: SE2P216CA0013.KORP216.PROD.OUTLOOK.COM (2603:1096:101:117::8) To MA0P287MB0332.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:ab::5) X-Microsoft-Original-Message-ID: <42d7a4e1-ddcf-4014-af1c-96be444d7804@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MA0P287MB0332:EE_|MA0P287MB0419:EE_ X-MS-Office365-Filtering-Correlation-Id: fc79f6c0-0790-46a3-9348-08dbf1981337 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BuYe8gi/QGOjbyUk7jrOdK4rQvnOXlkMJ1+Lv7j336Z8cNAGicswQSfnelo+/lSNHmih8yQe47gxBDq7BHCr1L4z4QHluLJWX/LL2hGIxCXdxFaOEkoPF2nPm+hGvmAETIO5dpGe3rQr63SDOxdgo/FLKAl2Ed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f-8?B?UlVRcjRvekFuZEEweVZqVXZta1JucE1KNDJpUWJRU2JNR1RLQ3N0TCtsYXhS?= =?utf-8?B?eW05TVJUNzN3Z3hDbnhUMWZiNTF6MUpZZTUwWUl3KzRCQnJOdWhVRk8vZFVz?= =?utf-8?B?VFJiTlRpa2dRcjJ3WDdhOStFM3RJSjNjUTJoM2ltekNHam9OaUNDajVHWDRm?= =?utf-8?B?dEtxY3llQU9oNUhVMnpKZ0p5OW9ycHMxU3JBQTJucCtrNFIrbGllT29vSHVx?= =?utf-8?B?L1ZYSGVyL040U25KUUQ3RWl3UEc0cFF4c25OSk9uSmxHUkpKMFphbCt0ZjNW?= =?utf-8?Q?mgmY3Y0P331CeBCJZCPQWd4JwxL2+jj0nASHOIPqbWPs=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc79f6c0-0790-46a3-9348-08dbf1981337 X-MS-Exchange-CrossTenant-AuthSource: MA0P287MB0332.INDP287.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2023 11:32:46.8663 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MA0P287MB0419 X-Spam-Status: No, score=1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FORGED_MUA_MOZILLA,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 30 Nov 2023 03:33:45 -0800 (PST) On 2023/11/30 16:12, Conor Dooley wrote: > On Thu, Nov 30, 2023 at 02:37:53PM +0800, Chen Wang wrote: >> On 2023/11/27 17:16, Krzysztof Kozlowski wrote: >>> On 27/11/2023 09:07, Chen Wang wrote: >>>> On 2023/11/27 15:12, Krzysztof Kozlowski wrote: >>>>> On 27/11/2023 02:15, Chen Wang wrote: >>>>>> From: Chen Wang >>>>>> >>>>>> Add a driver for the SOPHGO SG2042 clock generator. >>>>>> >>>>>> Signed-off-by: Chen Wang >>>>> ... >>>>> >>>>> +} >>>>> + >>>>> +CLK_OF_DECLARE(sg2042_clk, "sophgo,sg2042-clkgen", sg2042_clk_init); >>>>> No, this should be platform device. It's a child of another device, so >>>>> you cannot use other way of init ordering. >>>> hi, Krzysztof, >>>> >>>> Thanks for your review. >>>> >>>> I don't quite understand your opinion. Do you mean CLK_OF_DECLARE is >>>> only used for platform device so it can not be use here? But I think >>> No, I meant you mix init ordering: you depend now on syscon earlier >>> initcall than CLK_OF_DECLARE. Do you remember which one is first? If >>> anything changes here, your driver is broken. There is no dependency, no >>> probe deferral. >> hi, Krzysztof, >> >> I found that the initcall method cannot be used for the clock controller of >> sg2042. We need to initialize the clock earlier because there are two >> dw-apb-timers in sg2042 (Sorry, I have not added them in the current DTS of >> sg2042, will be submitted later). The initialization of these timers >> (timer_probe()) depends on the initialization of the clock controller. If we >> use the initcall mechanism, it will be too late for the timer. So it seems >> better to use CLK_OF_DECLARE provided by CCF. >> >> I have a question here that I would like to discuss. The design of sg2042 is >> like this, according to the design of memorymap in its TRM: >> >> 070:3001:0000 ~ 070:3001:0FFF SYS_CTRL 4K >> 070:3001:1000 ~ 070:3001:1FFF PINMUX 4K >> 070:3001:2000 ~ 070:3001:2FFF CLOCK 4K >> 070:3001:3000 ~ 070:3001:3FFF RESET 4K >> >> But also as per hw design (I don't know why and I don't like it also :( ), >> some of the PLL/GATE CLOCK control registers are defined in the scope of >> SYS_CTRL, and others are defined in the scope of CLOCK. That's why in the >> current code, I define the syscon node corresponding to SYS_CTRL. The >> purpose is just to get the regmap of syscon for the clock controller through >> the device tree (through device_node_to_regmap()), so that the syscon >> defined in SYS_CTRL can be accessed through the regmap from clock. The clock >> controller driver itself does not rely on other operations of syscon. >> >> So based on the above analysis, is it still necessary for us to define the >> clock controller as a child node of syscon? In the version v1 of this patch, >> I actually did not define the clock controller as a child node of syscon, >> but only accessed syscon through the phandle method. [1] > In that version of the code, clkgen, your DTS, looked like: > + clkgen: clock-controller { > + compatible = "sophgo,sg2042-clkgen"; > + #clock-cells = <1>; > + system-ctrl = <&sys_ctrl>; > + clocks = <&cgi>; > + assigned-clocks = \ > > + assigned-clock-rates = \ > > + }; > > It had no register regions of its own, just what it got from the sys > ctrl block, which is why I said that. The syscon block looked like: > > + sys_ctrl: syscon@7030010000 { > + compatible = "sophgo,sg2042-syscon", "syscon"; > + reg = <0x70 0x30010000 0x0 0x8000>; > + }; > > which given the register map does not seem like an accurate reflection > of the size of this region. The "0x8000" should be "0x1000". Thanks for your carefully checking. The history is when I was working on v1, the description in TRM was: 070:3001:0000 ~ 070:3001:7FFF SYS_CTRL 32K Now the TRM is updated and the SYS_CTRL is divided into 4 parts. >> After more read of the TRM, I believe this situation only exists for clock. >> That is to say, there will be only one child node of clook under syscon. >> From a hardware design perspective, CLOCK and SYS_CTRL are two different >> blocks. So I think it is better to restore the original method, that is, >> restore clock and syscon to nodes of the same level, and let clock use >> phandle to access syscon. > This sounds two me like there are two different devices. One the "CLOCK" > region at 070:3001:2000 that should be documented as being > "sophgo,sg2042-clkgen" or similar and the second being the "SYS_CTRL" at > 070:3001:0000 that is called something like "sophgo,sg2042-sysctrl". > Having more than one clock controller is not a problem and sounds like a > more accurate description of the hardware. Yes, I agree a new "sg2042-sysctrl" is better and "syscon" should not be used as per input from Krzysztof. Actually in the TRM, the "SYS_CTRL" is described as a block composed of many registers for different misc functions, and controlling of clocks are just part of it. The hw designer scatter clock registers into differnet area of registers and make people confused. > >> What do you think or do you have any good suggestions? >> >> Link: https://lore.kernel.org/linux-riscv/20231114-timid-habitat-a06e52e59c9c@squawk/#t >> [1] >> >> Thanks >> >> Chen >> >>>> this driver is still for platform device though I move the clock >>>> controller node as a child of the system contoller node. System >>>> controller node is just a block of registers which are used to control >>>> some other platform devices ,such as clock controller, reset controller >>>> and pin controller for this SoC. >>>> >>>> And I also see other similar code in kernel, for example: >>>> drivers/clk/clk-k210.c. >>>> >>>> And I'm confused by your input "so you cannot use other way of init >>>> ordering." Do you mean "so you CAN use other way of init ordering"? >>> No, I meant you cannot. If you want to use syscon, then your driver >>> should be a proper driver. Therefore add a driver. >>> >>>> What's the other way of init ordering do you mean? >>> The one coming not from initcalls but driver model. >>> >>> Best regards, >>> Krzysztof >>>