Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2393985rdb; Fri, 8 Dec 2023 07:02:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVv7AZYxIw4OsHKUg7Wr7ryOVghrdgqn68PB3JzdwTKywfTy2vwbIFmPPC68kTQGJNhGrr X-Received: by 2002:a17:90a:6e41:b0:285:c1c0:ffb4 with SMTP id s1-20020a17090a6e4100b00285c1c0ffb4mr164666pjm.37.1702047755938; Fri, 08 Dec 2023 07:02:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702047755; cv=none; d=google.com; s=arc-20160816; b=rkTXwTOw4RioeqLKQSUQhFNnFd4KiwIOQtj7wqAfBMWVM3LWRHqxyR89Cj16cCAKGU 02ptm00GVOFvsUh4ays56CJji6BmfbnLx3IalpCGZ8CgL7BtT/7FpdVgMB23vftJ9nRn TFOA8+qDhvvfNOIG8tnrjWEY3ufa68npxSU0Kjyavlg1xEabVwapXT3zXs1zdxW5/Sma d6FHI/BnLC23A0+fx0CGlkqfgcqMHjMQ4fDRW+wGp1uakkio7NT8BoP67FWRpmRlcJ03 GQm0w+YPgeTUslDCLd8L1qo/YkzsyuGBn+mfpyanmHk+n1460nseVcQZWXoaOEtfPKZP KTGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=b8A/mVHNuVX5PkyBrc/sgBXt4D4Gpg+hKGvI3SY89R0=; fh=8OhFXhvtg6gEoMkqyH7kCfCYueBqp4oxUcSac3wlNJM=; b=CNkcPLNGWC/FF+QTvOzkl5SxJir8J2JuKZtXk1qulpb6BeP6nvhuuYkRt6fY7fMdkI RC+Yr3Yr6mzGLxSpT70/ldbvIerHSoaeGrXKSrM5ZqEN8hWQ6IPpfV/xpS5GPbDZfdrf azJX+H5/e+fQQ0Oz+C4qAMAbP9GKCpK6pKkyQg+L7/9CPjk3VU+VeILH1F2HjHLw5DfW sw9gzL33pX6vb42ZLwFozV4YyFDHwpFlAkn6x4LQ4nixuqone3Nj1C5YOghTfHijWB+B YeFf9uJzLV8vZ9JrOeyExrqnS67bC2HFvbbxT8xBiBY5DC5UttiOIvwMbrZiFID3+OhP Qhcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="rIly/t4z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id i12-20020a170902c94c00b001cfb52101e3si1791816pla.413.2023.12.08.07.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 07:02:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="rIly/t4z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4F83481A207B; Fri, 8 Dec 2023 07:02:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574051AbjLHPCS (ORCPT + 99 others); Fri, 8 Dec 2023 10:02:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574071AbjLHPCQ (ORCPT ); Fri, 8 Dec 2023 10:02:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9D70173F for ; Fri, 8 Dec 2023 07:02:22 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87D5DC433CB; Fri, 8 Dec 2023 15:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702047742; bh=FYyAmF1FLZB0d+sYHpsbh3ZPGKkX6ZCON1fKf13O41A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rIly/t4zsSSGjYhjmShXbOMup1HhkUBNtqsqpe1+vgxOzgoeU9shtrxIFhJ3/+jO6 zQKoX/0M/9cE5F8hhjQqXQbmhPlJQB8fEZ4Tblw5GT6spaL8rqXn+x5h7ro4WFm6NB 3wEimo7eIbT5uVSmnU0N1u8qO1bb7mgc9Ets+SMYWyjC8g1FRTbPodFH0kmWoHgrus 6C2ocJnqaAcmRvUvEWMS4JkVTMHv8z3R5yQgtZcALDt8UoTHnxvRxXq0l2ULMLJ/DA nZgZWfeM7KBA10I3cs8fl6v2fV4dyMwjmSSAZ3QDGNQEoCeCwOzvAgmXDinyIXcdz/ EAr6k5k9TozDQ== Date: Fri, 8 Dec 2023 15:02:16 +0000 From: Conor Dooley To: Inochi Amaoto Cc: Krzysztof Kozlowski , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chao Wei , Chen Wang , Paul Walmsley , Palmer Dabbelt , Albert Ou , Jisheng Zhang , Liu Gui , Emil Renner Berthing , qiujingbao.dlmu@gmail.com, dlan@gentoo.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v3 3/4] riscv: dts: sophgo: add clock generator for Sophgo CV1800 series SoC Message-ID: <20231208-overdue-reapprove-4b507f5f4262@spud> References: <20231207-doze-spinster-0bfad3b1441a@spud> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="H6wgxik8XqEwV3+C" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 08 Dec 2023 07:02:33 -0800 (PST) --H6wgxik8XqEwV3+C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 08, 2023 at 09:13:34AM +0800, Inochi Amaoto wrote: > >On Thu, Dec 07, 2023 at 01:52:16PM +0100, Krzysztof Kozlowski wrote: > >> On 07/12/2023 10:42, Inochi Amaoto wrote: > >>>>> +&clk { > >>>>> + compatible =3D "sophgo,cv1810-clk"; > >>>>> +}; > >>>>> diff --git a/arch/riscv/boot/dts/sophgo/cv18xx.dtsi b/arch/riscv/bo= ot/dts/sophgo/cv18xx.dtsi > >>>>> index 2d6f4a4b1e58..6ea1b2784db9 100644 > >>>>> --- a/arch/riscv/boot/dts/sophgo/cv18xx.dtsi > >>>>> +++ b/arch/riscv/boot/dts/sophgo/cv18xx.dtsi > >>>>> @@ -53,6 +53,12 @@ soc { > >>>>> dma-noncoherent; > >>>>> ranges; > >>>>> > >>>>> + clk: clock-controller@3002000 { > >>>>> + reg =3D <0x03002000 0x1000>; > >>>>> + clocks =3D <&osc>; > >>>>> + #clock-cells =3D <1>; > >>>> > >>>> I don't find such layout readable and maintainable. I did some parts > >>>> like this long, long time ago for one of my SoCs (Exynos54xx), but I > >>>> find it over time unmaintainable approach. I strongly suggest to have > >>>> compatible and other properties in one place, so cv1800 and cv1812, = even > >>>> if it duplicates the code. > >>>> > >>> > >>> Hi Krzysztof: > >>> > >>> Thanks for your advice, but I have a question about this: when I shou= ld > >>> use the DT override? The memory mapping of the CV1800 and CV1810 are > >>> almost the same (the CV1810 have more peripheral and the future SG200X > >>> have the same layout). IIRC, this is why conor suggested using DT ove= rride > >>> to make modification easier. But duplicating node seems to break thiS= , so > >>> I's pretty confused. > >> > >> Go with whatever your subarchitecture and architecture maintainers > >> prefer, I just shared my opinion that I find such code difficult to re= ad > >> and maintain. > >> > >> Extending node with supplies, pinctrl or even clocks would be readable. > >> But the compatible: no. The same applies when you need to delete > >> property or subnode: not readable/maintainable IMHO. > > > >There are apparently 3 or 4 of these SoCs that are basically identical, > >which is why the approach was taken. I do agree that it looks somewhat > >messy because I was looking for device-specific compatibles for these > >SoCs. > > >=20 > I agree that this may be messy. But it might still be acceptable if we > limit the number of devices in this format. >=20 > IIRC, only clint, plic, clk, maybe pinmux only needs different compatible. > For more complex device, such as tpu and codec, I agree with duplicating > nodes and make them SoC specific. Okay. We will see how it goes. We are not stuck doing it one way, we can revisit the decision later if things start to be confusing. >=20 > As for this patch, I have already adjusted the order of clock to ensure > the compatible among different SoCs. This will make the clock assignment > easier. --H6wgxik8XqEwV3+C Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZXMv+AAKCRB4tDGHoIJi 0rHNAP40ibEG9PFiYJyQVknOajvwqEylPpHx444D6tFiSzWEzwD/a6cLF6ldVr95 5gVOtpUeO9FMgr+lYcECNfos9DTBBgQ= =uY0H -----END PGP SIGNATURE----- --H6wgxik8XqEwV3+C--