Received: by 2002:ac8:5349:0:b0:427:7d78:cd45 with SMTP id d9csp823647qto; Wed, 20 Dec 2023 05:08:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2OYHondDo/iRaGqLUscQ8JkEJC7COcEFpt3wMpHLdH3LAhUYZ40GTFGZMMLeJzs6C+dbf X-Received: by 2002:a05:6808:1309:b0:3b9:d68d:d513 with SMTP id y9-20020a056808130900b003b9d68dd513mr23246663oiv.81.1703077687935; Wed, 20 Dec 2023 05:08:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703077687; cv=none; d=google.com; s=arc-20160816; b=NTBbfbvy84EBwYclqGtREuph9DM8Lg34s0PpKTdIAOfQdG7knh0/LbLPP7rS5YPD4C 6dRj2mKDTs39GJ0hmfAf81ruHhyxhGgVCqVVlOEEKjBF9eewVmkjavWCpR1h2Yz2Cj4Z VYwk9E2RTPccs85pr4sd9SzoRXrwoWgLOTNRAjbrSC61GVCrTOcV2/TGv5GCQJvqLlD8 tQNq8vkDbbtJl5cNwVqIcC+WWpJ4q52IWgNhQMmoUDHjQhdRoJfm19J8JGzAVHS/yh03 FkC4BxwlXd01hfBrX1/2NSRIs/ecMBTrNHhSRH0fyc/p/etB/bHidhPmHTXmz9+2Fh/n /PPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:from :dkim-signature; bh=r0CdQOvCJT9PWx3Toc+lT3OhGIYfIqGUNbKWq1eVXYI=; fh=hgyne+bi88tQpWIIiOrCLlTmx2FOplV6lVmgwhnJ9u4=; b=GHDNSEFnDXLisQBrerKx7DuSlieuIXubGqBnU2GdG66s1OPw1bd4KM92mI4rf+FjJy d0mOajauSOafyhCqupNR7wLW7hWYyDXUnqr8/rpFN/hQc6ehSpBBoB3UX9JWv1/RnXsB s7VgfXGXZ7zN1FSgYnzd5czB7EUAAuWSlvLoZEYYVaCboUW/LVJZUOx4hQ40ZM5I3eVC 4AuGmo5hjXq61Ku0efXGlu2UrO6heClaJY9dJC9/JyAInz9XlVAfzp0yrp0tSvV6Me6t ic66kaSOS+n94v4TtmRv3tadS4ZyiR2OTMt7Otmp6SwnNsynXzTqxbb+xRK0kHbOQ51o cBHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=aczibMGd; spf=pass (google.com: domain of linux-kernel+bounces-6936-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6936-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r25-20020a67cd99000000b00466a2510b9esi954523vsl.355.2023.12.20.05.08.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 05:08:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6936-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=aczibMGd; spf=pass (google.com: domain of linux-kernel+bounces-6936-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6936-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id ADE731C23086 for ; Wed, 20 Dec 2023 13:08:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E85F92D636; Wed, 20 Dec 2023 13:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="aczibMGd" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06D7F2576F for ; Wed, 20 Dec 2023 13:07:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id F21F13F740 for ; Wed, 20 Dec 2023 13:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1703077660; bh=r0CdQOvCJT9PWx3Toc+lT3OhGIYfIqGUNbKWq1eVXYI=; h=From:In-Reply-To:References:Mime-Version:Date:Message-ID:Subject: To:Cc:Content-Type; b=aczibMGd2dwJB7IFX0XhlxAGrMJOWu2mxs6h9amke3UEiQlToYE1+KJAtetXgs4/A Ya5EeCO+k/fxL4X0KbYo/lrlNImpPeOfx2/dF8HnIkWaD1BrWl4Z/I1FdjfPsvrDyQ pwE09SXa7Nhgvw0+eF2nlq5i9R8qW1Za+TTw2FBPkE7aBPz+tp62/xwliCsAEjUueT DJeHIKCDzvPc2Ao2MPY88wghFbJdyjkxlhLJe6YIe1p9+zrUUS4hoXjZzvUjYOJemU y59pwiwursxYp1ylccGogY1BKMflRieeCEskd5rj1z+kl3dGJRcQ1BZh243SIaNc1b Nv+L+KPG+zFWg== Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-423dfab246cso91532021cf.3 for ; Wed, 20 Dec 2023 05:07:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703077659; x=1703682459; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r0CdQOvCJT9PWx3Toc+lT3OhGIYfIqGUNbKWq1eVXYI=; b=FnxvEmamdtpmo5/PMAceRzXjj8xuOslbKWqerdFs5L9wVYI2TfQmNY59q3T0ffg9aT UoJJwJpNZof401VIsEaT0JEPduo8X/EHmpYnYhdOmubUYmBQsJeAWSQBS8VXTQ0TO8vS J1zVLKiRl6VdLoay4jzBOF98zjW5apampRnYXAGwAkj9CMmGOsqQjQYeEysFECpoG3Z1 jeWjOQdHgaU4yiAMsttkagyvmuBliWfNnfXbaaTuaDC4/6c002UVNyQRqfjmENIMFZrZ B8GU++5pztYGFafolM8nuTpEM/JBJqAcWG6jJCy12zXRt3NV12qIYnbYYQqcLvQOI94U 57hQ== X-Gm-Message-State: AOJu0YzoAO4fJY5lrdiNOq3owQXQzXyrXo89xveN1c+ybCuIze3kvdZy SxlQBX7uYvB/MU1H+RK59uF0dQnZSZ41MEeRsKbL0NONXvNU6EgSKN0MuPK1Iyqfzb/LMIRgeQX iOiKIrwhfbGnqoonlte5eFCnQBaZrC/H4trjHpPcuH89/TOs5Uhxl5ycc+A== X-Received: by 2002:a05:622a:151:b0:425:4043:41bb with SMTP id v17-20020a05622a015100b00425404341bbmr28425859qtw.103.1703077658771; Wed, 20 Dec 2023 05:07:38 -0800 (PST) X-Received: by 2002:a05:622a:151:b0:425:4043:41bb with SMTP id v17-20020a05622a015100b00425404341bbmr28425841qtw.103.1703077658527; Wed, 20 Dec 2023 05:07:38 -0800 (PST) Received: from 348282803490 named unknown by gmailapi.google.com with HTTPREST; Wed, 20 Dec 2023 05:07:38 -0800 From: Emil Renner Berthing In-Reply-To: <07a8ac42184f440fae1b0d13db4e43cc@EXMBX066.cuchost.com> References: <20231206115000.295825-1-jeeheng.sia@starfivetech.com> <20231206115000.295825-7-jeeheng.sia@starfivetech.com> <9ae86c6786bc4ac7b93c971ba00084a6@EXMBX066.cuchost.com> <07a8ac42184f440fae1b0d13db4e43cc@EXMBX066.cuchost.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Date: Wed, 20 Dec 2023 05:07:38 -0800 Message-ID: Subject: RE: [PATCH v1 06/16] clk: starfive: Add JH8100 System clock generator driver To: JeeHeng Sia , Emil Renner Berthing , "kernel@esmil.dk" , "conor@kernel.org" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "paul.walmsley@sifive.com" , "palmer@dabbelt.com" , "aou@eecs.berkeley.edu" , "mturquette@baylibre.com" , "sboyd@kernel.org" , "p.zabel@pengutronix.de" , Hal Feng , Xingyu Wu Cc: "linux-riscv@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-clk@vger.kernel.org" , Leyfoon Tan Content-Type: text/plain; charset="UTF-8" JeeHeng Sia wrote: > > > > -----Original Message----- > > From: Emil Renner Berthing > > Sent: Wednesday, December 13, 2023 7:57 PM > > To: JeeHeng Sia ; Emil Renner Berthing ; kernel@esmil.dk; > > conor@kernel.org; robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org; paul.walmsley@sifive.com; palmer@dabbelt.com; > > aou@eecs.berkeley.edu; mturquette@baylibre.com; sboyd@kernel.org; p.zabel@pengutronix.de; Hal Feng > > ; Xingyu Wu > > Cc: linux-riscv@lists.infradead.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-clk@vger.kernel.org; Leyfoon Tan > > > > Subject: RE: [PATCH v1 06/16] clk: starfive: Add JH8100 System clock generator driver > > > > JeeHeng Sia wrote: > > > > -----Original Message----- > > > > From: Emil Renner Berthing > > > > Sent: Saturday, December 9, 2023 12:25 AM > > > > To: JeeHeng Sia ; kernel@esmil.dk; conor@kernel.org; robh+dt@kernel.org; > > > > krzysztof.kozlowski+dt@linaro.org; paul.walmsley@sifive.com; palmer@dabbelt.com; aou@eecs.berkeley.edu; > > > > mturquette@baylibre.com; sboyd@kernel.org; p.zabel@pengutronix.de; emil.renner.berthing@canonical.com; Hal Feng > > > > ; Xingyu Wu > > > > Cc: linux-riscv@lists.infradead.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-clk@vger.kernel.org; Leyfoon > > Tan > > > > > > > > Subject: Re: [PATCH v1 06/16] clk: starfive: Add JH8100 System clock generator driver > > > > > > > > Sia Jee Heng wrote: > > > > > Add support for JH8100 System clock generator. > > > > > > > > > > Signed-off-by: Sia Jee Heng > > > > > Reviewed-by: Ley Foon Tan > > > > > --- > > > > > MAINTAINERS | 8 + > > > > > drivers/clk/starfive/Kconfig | 9 + > > > > > drivers/clk/starfive/Makefile | 1 + > > > > > drivers/clk/starfive/clk-starfive-common.h | 9 +- > > > > > drivers/clk/starfive/jh8100/Makefile | 3 + > > > > > .../clk/starfive/jh8100/clk-starfive-jh8100.h | 11 + > > > > > drivers/clk/starfive/jh8100/clk-sys.c | 455 ++++++++++++++++++ > > > > > 7 files changed, 495 insertions(+), 1 deletion(-) > > > > > create mode 100644 drivers/clk/starfive/jh8100/Makefile > > > > > create mode 100644 drivers/clk/starfive/jh8100/clk-starfive-jh8100.h > > > > > create mode 100644 drivers/clk/starfive/jh8100/clk-sys.c > > ... > > > > > diff --git a/drivers/clk/starfive/Makefile b/drivers/clk/starfive/Makefile > > > > > index 012f7ee83f8e..6cb3ce823330 100644 > > > > > --- a/drivers/clk/starfive/Makefile > > > > > +++ b/drivers/clk/starfive/Makefile > > > > > @@ -10,3 +10,4 @@ obj-$(CONFIG_CLK_STARFIVE_JH7110_AON) += clk-starfive-jh7110-aon.o > > > > > obj-$(CONFIG_CLK_STARFIVE_JH7110_STG) += clk-starfive-jh7110-stg.o > > > > > obj-$(CONFIG_CLK_STARFIVE_JH7110_ISP) += clk-starfive-jh7110-isp.o > > > > > obj-$(CONFIG_CLK_STARFIVE_JH7110_VOUT) += clk-starfive-jh7110-vout.o > > > > > +obj-$(CONFIG_CLK_STARFIVE_JH8100_SYS) += jh8100/ > > > > > > > > I don't really see why do you need a special subdirectory for the JH8100? The > > > > JH7110 drivers do fine without it. > > > Each subfolder can represent a different platform, making it easier to > > > locate and maintain platform-specific code. Since the code is expected > > > to grow in the future, let's start organizing it in a folder-based structure > > > for easier maintenance at a later stage. > > > > Yes, but that's not what you're doing here. You're making just one of the 3 > > almost identical drivers be different for no good reason. > > > > > > > diff --git a/drivers/clk/starfive/clk-starfive-common.h b/drivers/clk/starfive/clk-starfive-common.h > > > > > index fed45311360c..ec30af0658cf 100644 > > > > > --- a/drivers/clk/starfive/clk-starfive-common.h > > > > > +++ b/drivers/clk/starfive/clk-starfive-common.h > > > > > @@ -103,6 +103,13 @@ struct starfive_clk_data { > > > > > .parents = { [0] = _parent }, \ > > > > > } > > > > > > > > > > +#define STARFIVE_GINV(_idx, _name, _flags, _parent)[_idx] = { \ > > > > > + .name = _name, \ > > > > > + .flags = _flags, \ > > > > > + .max = STARFIVE_CLK_ENABLE | STARFIVE_CLK_INVERT, \ > > > > > + .parents = { [0] = _parent }, \ > > > > > +} > > > > > + > > > > > struct starfive_clk { > > > > > struct clk_hw hw; > > > > > unsigned int idx; > > > > > @@ -114,7 +121,7 @@ struct starfive_clk_priv { > > > > > spinlock_t rmw_lock; > > > > > struct device *dev; > > > > > void __iomem *base; > > > > > - struct clk_hw *pll[3]; > > > > > + struct clk_hw *pll[8]; > > > > > > > > These extra slots are just used for fixed factor dummy PLLs right now, similar > > > > to how the JH7110 first used them and later had to rework drivers and device > > > > trees for the proper PLL driver. > > > Yes, its intention is similar to JH8100. We will submit other clock > > > domains and PLL at later stage but not so soon. > > > > > > > > This time around I'd much rather you work on getting the PLL driver in first, > > > > so we don't need all that churn. > > > I am sorry but we started development on FPGA. Unfortunately, the PLL driver > > > and other domains are planned to be finished at a later stage. I have tried > > > to minimize the churn as much as possible. > > > > It's awesome that you're beginning upstreaming early, but if you don't have > > this in silicon yet, how do you even know that this driver works? > > > > If you're just using this for testing on FPGAs you can create dummy fixed > > clocks in the device tree for the PLLs that this driver can consume. Then > > later when you have a PLL driver you can replace those fixed clocks with the > > output of that driver. > The PLL fixed clocks were created in the C code. I interpret this message > as a suggestion to create a PLL fixed clock in the DT? Yes, then you don't need to change the clock driver and its bindings but just need to update the clock references to the PLL driver once you have that. /Emil