Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4186498rwd; Tue, 23 May 2023 04:35:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4y5V242kFTAVLv9eSI2A7iT+otmkOYPyM/PzLIzFMX2Vt4eiq9YzOvjLZ52cDFXFu08cGJ X-Received: by 2002:a05:6a00:16cc:b0:63b:8a91:e641 with SMTP id l12-20020a056a0016cc00b0063b8a91e641mr18825378pfc.11.1684841735143; Tue, 23 May 2023 04:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684841735; cv=none; d=google.com; s=arc-20160816; b=buB12luilX+ITlPXe8SVYYcmZuV9lleKbNc3ObTGCEJbwqEa2lzXLv36e/2sAW5Xm9 FSx3pSyHL+RxSH1XUuHgqdb7SvC2v1YcqIHrwQSYaR5cVVVEtNuowvjH9D9f1uyq1gCy Jn4no+HDtVH0Qx3UPQolCwvDRm778nRI5UfdXGBl4IVvKn/OztovSx/iM1VgpyCXhRDo /d1soyP8O4i30Ul8o1bRb5DtNIZjQpFeB4cWUzq8zbJH8eXi7koDbrQr+/nsvrONrdnk sfaKy9WrvhzctwpWWnDFT6o6TkS06OuN0IdNPNUqNiz2mayNvIhOU4sKsowWrMPbwfS2 BcZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=YVDmEwT7E+oF73BJjnW+cW2TbpxTH1N6C3Em8DAHmDM=; b=lblD6gJ5zEkbNrkefpcK35rPRzyG1dMPaPLNaGWKdV1tSG4bX4/2qh6nNJjTGuoLq2 bmkDSTx4DLAgLmPY2zJGxY1yiJ+wFV1PVmHMh2TH8Kt36A1JB9NZhD/RrHLl6ub2ruEB d9/4wQI99U1rfu9lVdRGbDdYXymmdiEoc3sWhhQMbMwDvAAGfR/1jZ4CUjHHYWAl5lF1 T2gGT3R8zpdDzPrabqHL+n+/sbwmjGbRoJMBo7+sSRX5e4J/x2nAGLnZ2d+27TB/1BjR cOYLfwPrHhaw5t9VY4XPMa5Cdn33A39FHiER/9k5Cs1TqZEF6iUNMBRqAR5YulU+zdhW xmpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020aa79525000000b006434a04f2fcsi6524830pfp.297.2023.05.23.04.35.22; Tue, 23 May 2023 04:35:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236633AbjEWLK6 (ORCPT + 99 others); Tue, 23 May 2023 07:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236022AbjEWLK5 (ORCPT ); Tue, 23 May 2023 07:10:57 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ABA0129; Tue, 23 May 2023 04:10:44 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 107) id 4927E68B05; Tue, 23 May 2023 13:10:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from blackhole.lan (p5b33fa9c.dip0.t-ipconnect.de [91.51.250.156]) by verein.lst.de (Postfix) with ESMTPSA id 676E867328; Tue, 23 May 2023 13:10:11 +0200 (CEST) Date: Tue, 23 May 2023 13:10:06 +0200 From: Torsten Duwe To: Conor Dooley Cc: Xingyu Wu , , , , Michael Turquette , Stephen Boyd , Krzysztof Kozlowski , Philipp Zabel , Conor Dooley , Emil Renner Berthing , Rob Herring , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , William Qiu , , Subject: Re: [PATCH v4 1/7] dt-bindings: clock: Add StarFive JH7110 PLL clock generator Message-ID: <20230523131006.46997d84@blackhole.lan> In-Reply-To: <20230523-fondue-monotype-0c751a8f0c13@wendy> References: <20230512022036.97987-1-xingyu.wu@starfivetech.com> <20230512022036.97987-2-xingyu.wu@starfivetech.com> <20230519135733.GA10188@lst.de> <20230519-smokeless-guileless-2a71cae06509@wendy> <20230523-fondue-monotype-0c751a8f0c13@wendy> Organization: LST e.V. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.34; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 May 2023 09:28:39 +0100 Conor Dooley wrote: > On Tue, May 23, 2023 at 10:56:43AM +0800, Xingyu Wu wrote: > > On 2023/5/19 22:16, Conor Dooley wrote: > > > On Fri, May 19, 2023 at 03:57:33PM +0200, Torsten Duwe wrote: > > >> On Fri, May 12, 2023 at 10:20:30AM +0800, Xingyu Wu wrote: > > >> [...] > > >> > +/* PLL clocks */ > > >> > +#define JH7110_CLK_PLL0_OUT 0 > > >> > +#define JH7110_CLK_PLL1_OUT 1 > > >> > +#define JH7110_CLK_PLL2_OUT 2 > > >> > > >> In U-Boot commit 58c9c60b Yanhong Wang added: > > >> > > >> + > > >> +#define JH7110_SYSCLK_PLL0_OUT 190 > > >> +#define JH7110_SYSCLK_PLL1_OUT 191 > > >> +#define JH7110_SYSCLK_PLL2_OUT 192 > > >> + > > >> +#define JH7110_SYSCLK_END 193 [...] > > > Ohh, that's not good.. If you pass the U-Boot dtb to Linux it > > > won't understand the numbering. The headers are part of the > > > dt-binding :/ In fact, the clock index >= 190 makes linux hang on boot, waiting with EPROBE_DEFER for every device's clock, because the sysclk driver errors out with EINVAL (jh7110_sysclk_get()). > > Because PLL driver is separated from SYSCRG drivers in Linux, the > > numbering starts from 0. But in Uboot, the PLL driver is included > > in the SYSCRG driver, and the number follows the SYSCRG. > > Unfortunately, how you choose to construct your drivers has nothing to > do with this. > These defines/numbers appear in the dts and are part of the DT ABI. > The same dts is supposed to work for Linux & U-Boot. The JH7110 has 6 blocks of 64k iomem in that functional area: {SYS,STG,AON} x {CRG,SYSCON}. None of these has 190 clocks. The good news: the current DTS, as proposed here and in U-Boot master, provides nodes for all 6 entities. The bad news is that the clock assignments to those nodes and their numbering is messed up. AFAICT PLL{0,1,2} _are_ generated in SYS_SYSCON and thus U-Boot gets it wrong, in addition to the erroneous DTS. Torsten