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 13BBCC04A68 for ; Thu, 28 Jul 2022 10:04:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-reply-to: Date:Subject:To:From:References:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cu3GXYN1G/9VoppXTJ5DX/vy+AMNQhOiyA4WEqUOizU=; b=dLYIRnZtQOak4V NtwjDNnrws2M7g+gT5dk3Zr1p0IIzHiLbJ4kTBiGubI/JWeJJy3tDrywuTEToCvj4uNF9HaTs9pC7 UBVNSFvdOUGNruZMmgPsfHvP5Yyj2m8+Nbk3bJs3dWV494tmKWWevBQwGJRNIFsnh/vxVNOj8mhzu L4IFFQhd6iQBVPEqg4q2xsiu5DYk1P8javiwqkva1mx2AJkH0tEzwAJc24lym7TGlNHeZPCWI5qY9 MpHmiKCCZ1dQgjWA9JVBy5V3dCmi+3vbijUH6f7Y9efsVeVqoZh8JhhwjWnnsT4m0rwnIGQDRbCJi Bhs86+hdYb3eHCIXSAFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oH0N5-008A6q-Ev; Thu, 28 Jul 2022 10:03:59 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oH0Mr-0089pZ-RC for linux-amlogic@lists.infradead.org; Thu, 28 Jul 2022 10:03:48 +0000 Received: by mail-wr1-x42c.google.com with SMTP id l4so1507532wrm.13 for ; Thu, 28 Jul 2022 03:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=y4T0HC+LgWXmkogwugZt7HLiFgtmRV8VQfPIoPRbde0=; b=csdItTfYI8AMJ6g7jI8x9ssnGKX+BNs9aZD4R1pd2bQRdogBMITspj/oV2UzNUupdo MBwl06n5qBT34W0MDXH3vcscdrnedwcSZdAk35NNTINrlJgG5JhkMzXc0tO4+O8fNh1A FjBmJHspacXIgWkhDNxtqGEdmf8LK4zRFY0uvJJ0pVlPRwbfMFlsRKGZ7FKRhG/HykKi OWVgf63m6zJ0Xom3esoEzx10YevVuBsL2h0ZbqwtVJD4AZVgxCggyhq991xFotWZUijv n3D5glVbGwxbTrgZax66+8MSsTjxdNiYgBGgcEeDUwQhP6gD91X6kybOqly3tEP+9/Hy CMEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=y4T0HC+LgWXmkogwugZt7HLiFgtmRV8VQfPIoPRbde0=; b=pmsCvZ4GHAM5tTEc74/8+KiYATHhooFr1Ydxz/gS56dJLRvWT2JnB2HZ9lD1fE3We/ DsSXegYOjJdqR1JPtwnsT0pQtspmUmSar8LpxuwAXr9jkf+HuchqaBQYa6jQt8dPmZO3 jxQkZI3abHny6J9Ws3kk8JIMynChBf3Iy8BY59o+0JltuwCtRxeFQWCG4iCzsCgu2yrp HjGpP10GyJox6NiWjUFIB4WiEmOMW9PpY/mMCLKvGDoUwG+olF2c3Lw6kh2zutIV3Pfn FdVkFPJQ1p0XqvVhJkkF8gT2ZcG7ydAlscfw6SG/ZZH5XAscsL0vWIcp5U23KbJmx5fK e58w== X-Gm-Message-State: AJIora8G7xsKuHVuod4O85qbBbZC4NOUdYP5z2HJQf49xPrA0eXutKE1 oCOTzmqiSMeKt00PU3cjYPL9tQ== X-Google-Smtp-Source: AGRyM1sVUOYVm8VpDrMDKjr0I9JufvhLIMmqV/AteNtB09x3qu5lBkrmNvYEnEoreb0NoNtADZen7w== X-Received: by 2002:a5d:6dc6:0:b0:21e:a87c:91bc with SMTP id d6-20020a5d6dc6000000b0021ea87c91bcmr7694254wrz.165.1659002622171; Thu, 28 Jul 2022 03:03:42 -0700 (PDT) Received: from localhost (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m20-20020a056000181400b0021e571a99d5sm526097wrh.17.2022.07.28.03.03.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 03:03:41 -0700 (PDT) References: <20220728054202.6981-1-yu.tu@amlogic.com> <20220728054202.6981-2-yu.tu@amlogic.com> <82e3fd36-df96-a555-4cea-47fabd26502b@linaro.org> <1jv8rhfw8h.fsf@starbuckisacylon.baylibre.com> <367cf98b-ef06-8f44-76c8-9099a1ec13dc@linaro.org> <1jmtctfuli.fsf@starbuckisacylon.baylibre.com> User-agent: mu4e 1.8.6; emacs 27.1 From: Jerome Brunet To: Krzysztof Kozlowski , Yu Tu , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Neil Armstrong , Kevin Hilman , Michael Turquette , Stephen Boyd , Krzysztof Kozlowski , Martin Blumenstingl Subject: Re: [PATCH V2 1/3] dt-bindings: clk: meson: add S4 SoC clock controller bindings Date: Thu, 28 Jul 2022 11:54:49 +0200 In-reply-to: Message-ID: <1jfsilftab.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220728_030346_118687_73FBE550 X-CRM114-Status: GOOD ( 20.41 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org On Thu 28 Jul 2022 at 11:48, Krzysztof Kozlowski wrote: > On 28/07/2022 11:09, Jerome Brunet wrote: >> >> On Thu 28 Jul 2022 at 11:02, Krzysztof Kozlowski wrote: >> >>> On 28/07/2022 10:50, Jerome Brunet wrote: >>>> >>>> On Thu 28 Jul 2022 at 10:41, Krzysztof Kozlowski wrote: >>>> >>>>> On 28/07/2022 07:42, Yu Tu wrote: >> [...] >>>>>> +/* >>>>>> + * CLKID index values >>>>>> + */ >>>>>> + >>>>>> +#define CLKID_FIXED_PLL 1 >>>>>> +#define CLKID_FCLK_DIV2 3 >>>>>> +#define CLKID_FCLK_DIV3 5 >>>>>> +#define CLKID_FCLK_DIV4 7 >>>>>> +#define CLKID_FCLK_DIV5 9 >>>>>> +#define CLKID_FCLK_DIV7 11 >>>>> >>>>> Why these aren't continuous? IDs are expected to be incremented by 1. >>>>> >>>> >>>> All clocks have IDs, it is one big table in the driver, but we are not exposing them all. >>>> For example, with composite 'mux / div / gate' assembly, we usually need >>>> only the leaf. >>> >>> I understand you do not expose them all, but that is not the reason to >>> increment ID by 2 or 3... Otherwise these are not IDs and you are not >>> expected to put register offsets into the bindings (you do not bindings >>> in such case). >> >> Why is it not an IDs if it not continuous in the bindings ? >> >> If there is technical reason, we'll probably end up exposing everything. It >> would not be a dramatic change. I asked for this over v1 because we have >> done that is the past and I think it makes sense. >> >> I'm happy to be convinced to do things differently. Just looking for the >> technical reason that require contiuous exposed IDs. >> >> The other IDs exists, but we do not expose them as bindings. >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/clk/meson/gxbb.h#n125 > > https://lore.kernel.org/linux-devicetree/CAK8P3a1APzs74YTcZ=m43G3zrmwJZKcYSTvV5eDDQX-37UY7Tw@mail.gmail.com/ > > https://lore.kernel.org/linux-devicetree/CAK8P3a0fDJQvGLEtG0fxLkG08Fh9V7LEMPsx4AaS+2Ldo_xWxw@mail.gmail.com/ > > https://lore.kernel.org/linux-devicetree/b60f5fd2-dc48-9375-da1c-ffcfe8292683@linaro.org/ > > The IDs are abstract numbers, where the number does not matter because > it is not tied to driver implementation or device programming model. The > driver maps ID to respective clock. > > Using some meaningful numbers as these IDs, means you tied bindings to > your implementation and any change in implementation requires change in > the bindings. This contradicts the idea of bindings. > I totally agree. Bindings ID are abstract numbers. We do follow that. We even document it: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/clk/meson/gxbb.h#n118 It is just a choice to not expose some IDs. It is not tied to the implementation at all. I think we actually follow the rules and the idea behind it. We can expose then all If you still think what we are doing is not appropriate. I'd like things to be consistent though. So if the decision is to expose everything, I'll probably end up doing the same for the old SoCs. _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic