| Message ID | 20240928083804.1073942-2-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path:
<linux-amarula+bncBCQ4XFG47UFRB6MA363QMGQEXXKI4GQ@amarulasolutions.com>
X-Original-To: linux-amarula@patchwork.amarulasolutions.com
Delivered-To: linux-amarula@patchwork.amarulasolutions.com
Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com
[209.85.218.70])
by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4E8A63FADA
for <linux-amarula@patchwork.amarulasolutions.com>;
Sat, 28 Sep 2024 10:38:18 +0200 (CEST)
Received: by mail-ej1-f70.google.com with SMTP id
a640c23a62f3a-a8ff95023b6sf208931166b.3
for <linux-amarula@patchwork.amarulasolutions.com>;
Sat, 28 Sep 2024 01:38:18 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1727512698; cv=pass;
d=google.com; s=arc-20240605;
b=HBA3A2qkJZv+VPbGugOROlI7CV3/Uiqxu7dT1RgoMK4WLwu7NaERErzf8TeQy7iPVA
1pP1vpKxDCJxfUXT2qivvVa7kny6kmcxj3dIMOGnN1T1ce+g3AC1zZzfGIlKqLW/t4xL
bQuHVrqrKQU93g7gZnjvNqhLHfJ00BncBtPIWDMiqMpd7ezD/MFWtKfYaQ7qr3bpbb/h
47/RcD1aTmhRaf+MTXlXgG3Nauvj0PU1GCqC5KhXFBQZtbdZ0vHGsYrTlqdgTAr9VoC8
NacTkcZ0s1l8Kfe+kgwEIQvUnbyWyxwPSvF4ZrTiS4rbgCcc86hT+eei42XRKXxSNQ1i
Ikmg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:dkim-signature;
bh=KKjCxc9wOoF4nBE1KmU1wYzNDV/fuglG12YjXQqIsWs=;
fh=osq6qoEIL6RwQ1VOxV58UafEjxvDDAg4v1oNeeWrfkw=;
b=fiMYa7DkBU9IHkKYEn+QISjXJe6cu6ONGQAAgDpHFk/98S9ptdKz2bYsn+haD78t0X
s9gjAZHth8hJnksH6n/rmvMMm8GvNcJM6V5f/oU0+rsgZBL0vDCSh1S2k2Lr/7NK77wq
HIbxSxnfHVZqgdnwVxvRzp6I4hTtrjHc/QP4zAmfgXpJjMTyK3Tq5prcwqqBNIXiRc8q
4IKMESRiOSdGiKBmQw7mlkHvGAtKOinMwoLlk+ZN/tFb4yOsTsEVXb2d0xK8GHRCyxB0
SU7XN1UJnmu+aB6WTfIjWeUQqoReBFONRRnJ0S9RBNW/IZA9mXUtQejMnG6UEhAQ2ikk
rFIg==;
darn=patchwork.amarulasolutions.com
ARC-Authentication-Results: i=2; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=XqGSERyG;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=amarulasolutions.com; s=google; t=1727512698; x=1728117498;
darn=patchwork.amarulasolutions.com;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:x-original-authentication-results
:x-original-sender:mime-version:references:in-reply-to:message-id
:date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=KKjCxc9wOoF4nBE1KmU1wYzNDV/fuglG12YjXQqIsWs=;
b=du94KgSuaUhsnxnQ/oxS28yJA7IBly0M0XHezV6fnP5Eb0/TgnSdesYQ+muTE8MGqz
ByjAC/pPmt/Lzf0evP9Q1X93NYNfplSNvpdnYZvzv3IUvnp5NwURb++dzw2o3jPLb/7K
fZ3WnlfSlGslnGOFwMctjNOpfNqulRiXmbqog=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1727512698; x=1728117498;
h=list-unsubscribe:list-archive:list-help:list-post
:x-spam-checked-in-group:list-id:mailing-list:precedence
:x-original-authentication-results:x-original-sender:mime-version
:references:in-reply-to:message-id:date:subject:cc:to:from
:x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=KKjCxc9wOoF4nBE1KmU1wYzNDV/fuglG12YjXQqIsWs=;
b=ZOsPzWob6CCD6RfBBvN1Z6uW4KINad6ViujTEX+/F87GSrYqNT0sEMIQwZaSxaU5T9
zMCGlHiX1xdxzbZFAf23ECuTqKX6ieUOALO8Vtgx0D9wcVn/GTBpfY7LN/z1hnCUmEH1
SgcmqLXAB7TNojeN07cRdaAxgblM489UKxFN6yU6RKT5GeRse6c2Ynwmd3ghu9deiFJQ
+3kjBd6B6suR+KkMb+LRnlf7X5QFxxyuNwU/nyUYQ/M81psrT5EiiKqeI1DGFAmg8Pbl
g7DnrpFYQdYcTZQTYHloeWZp2fPtoZcWPyD0JIV0IJS0ufROG1W8S2y1DxUGvnvhIBnp
X02w==
X-Forwarded-Encrypted: i=2;
AJvYcCWpnPq6GZyJsVZCmJkWzSNR2O1PJ08ZM+fdeGhmgXZXnwuZYtvYpoy0wCdYEGzrSm0fnlyt0kO+JkV1tVa/@patchwork.amarulasolutions.com
X-Gm-Message-State: AOJu0YxgvJYWJcFyZqvzPz1hOdIqU6rjXiu+3FS77svBUH4p/e68e8h8
BIN+RczYqG91trFk4chwF/DlKPjt4nQYLdmy4l/A+0DzJexQtHDHdaNOCduNxc6XEw==
X-Google-Smtp-Source:
AGHT+IF1EV3CE03ZNa1m2G51tS3W3zmGtF06/yv0w6Kj3zc6iN+ZOIKeb0jB413poJfGDk4euFWGow==
X-Received: by 2002:a17:907:9341:b0:a8d:4e26:c9b9 with SMTP id
a640c23a62f3a-a93c49218abmr576717466b.17.1727512697870;
Sat, 28 Sep 2024 01:38:17 -0700 (PDT)
X-BeenThere: linux-amarula@amarulasolutions.com
Received: by 2002:a05:6402:26c9:b0:5c4:6c19:f742 with SMTP id
4fb4d7f45d1cf-5c877819335ls702396a12.2.-pod-prod-02-eu; Sat, 28 Sep 2024
01:38:16 -0700 (PDT)
X-Received: by 2002:a17:906:dac2:b0:a8d:fa3:bb24 with SMTP id
a640c23a62f3a-a93c4921a34mr635901666b.23.1727512696243;
Sat, 28 Sep 2024 01:38:16 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1727512696; cv=none;
d=google.com; s=arc-20240605;
b=IpS7UFIsqJSuxxObUN5H0jFo2WhTNNP5DTWz8fdmfeb0LNHDnSrNchnuCYEvQgogak
lJ0TP/6HUFFLIqsAMqVWpRRyEr7/JhTo7udUeqkINkMiYMKh5Bq5AozXtAxlCrw8jmdq
W+0qrt7pIoyhDdMTLkOOi5XqAFqF81L65jrxgqfc+3n7CfaOqlUSfbezFtXTUBck+ojJ
axllxQ04asJ+43DiqOshOMwz4GWb/ScTN/Cc7BcYkXVGmQNWZy+XX5kpJj0z0WGqIyCm
7eeLuWrowYzOEMX3N2EEAPyrxFRsEabN/GFxB1GoMxwxaMEIdHEYGDsZaT3HG6j8fnEo
tjaw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:dkim-signature;
bh=hgBA2YgBzcVdnVEoc6s2KOvaf1NpbuG7MmZKT5HNBsQ=;
fh=TcT5mq+DOC99WOQKF/pyM5BqA4EvWwQBAkqh1EN56Eg=;
b=N2YPtxFJK0o62H7MspscquRwNjZrtdaVY4dFmeo2O7Q/Z5mnUOgaEbgvCXgZrfNHMB
XKI6vBhfHxupKTfjVztbHo6ubfWkRjDo6BL5YH28Rc3tlueyYNJrylXnuUkVSqg893ag
2hFVTWHUvRQ3USNxGu9EH9158J5Tufura6CCml+ZptxjOp8cJymLEoq+5jBsh6dlrDAx
MxfA1920GC2iBZ5t2dpKTbB8RfZk7Ui+0oqTLZxQvN0Km0KMREZEdt+8D1xlxSOfUDk3
c0W9t6WFN65s0iC659RFPal0YU7o6fdx3I4ZU1mvy3ZGXAtYXviddEfm3o8cUO2y9b3F
sh1A==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=XqGSERyG;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com.
[209.85.220.41])
by mx.google.com with SMTPS id
a640c23a62f3a-a93c29b38d2sor120223666b.14.2024.09.28.01.38.16
for <linux-amarula@amarulasolutions.com>
(Google Transport Security);
Sat, 28 Sep 2024 01:38:16 -0700 (PDT)
Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a17:907:1c19:b0:a80:bf95:7743 with SMTP id
a640c23a62f3a-a93c48f8a9emr546855266b.13.1727512695646;
Sat, 28 Sep 2024 01:38:15 -0700 (PDT)
Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it
(host-79-54-102-102.retail.telecomitalia.it. [79.54.102.102])
by smtp.gmail.com with ESMTPSA id
a640c23a62f3a-a93c2947a48sm223679466b.118.2024.09.28.01.38.14
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sat, 28 Sep 2024 01:38:15 -0700 (PDT)
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: linux-amarula@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Conor Dooley <conor+dt@kernel.org>,
Fabio Estevam <festevam@gmail.com>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Peng Fan <peng.fan@nxp.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Rob Herring <robh@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Shawn Guo <shawnguo@kernel.org>,
Stephen Boyd <sboyd@kernel.org>,
devicetree@vger.kernel.org,
imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-clk@vger.kernel.org
Subject: [PATCH 1/6] dt-bindings: clock: imx8m-anatop: support spread spectrum
clocking
Date: Sat, 28 Sep 2024 10:37:49 +0200
Message-ID: <20240928083804.1073942-2-dario.binacchi@amarulasolutions.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240928083804.1073942-1-dario.binacchi@amarulasolutions.com>
References: <20240928083804.1073942-1-dario.binacchi@amarulasolutions.com>
MIME-Version: 1.0
X-Original-Sender: dario.binacchi@amarulasolutions.com
X-Original-Authentication-Results: mx.google.com; dkim=pass
header.i=@amarulasolutions.com header.s=google header.b=XqGSERyG;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
Content-Type: text/plain; charset="UTF-8"
Precedence: list
Mailing-list: list linux-amarula@amarulasolutions.com;
contact linux-amarula+owners@amarulasolutions.com
List-ID: <linux-amarula.amarulasolutions.com>
X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com
X-Google-Group-Id: 476853432473
List-Post:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>,
<mailto:linux-amarula@amarulasolutions.com>
List-Help:
<https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>,
<mailto:linux-amarula+help@amarulasolutions.com>
List-Archive:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/>
List-Unsubscribe:
<mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>,
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe>
|
| Series |
Support spread spectrum clocking for i.MX8{M,N,P} PLLs
|
|
Commit Message
Dario Binacchi
Sept. 28, 2024, 8:37 a.m. UTC
The patch adds the DT bindings for enabling and tuning spread spectrum
clocking generation.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
.../bindings/clock/fsl,imx8m-anatop.yaml | 41 +++++++++++++++++++
1 file changed, 41 insertions(+)
Comments
On 28/09/2024 10:37, Dario Binacchi wrote: > The patch adds the DT bindings for enabling and tuning spread spectrum > clocking generation. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > --- > > .../bindings/clock/fsl,imx8m-anatop.yaml | 41 +++++++++++++++++++ > 1 file changed, 41 insertions(+) > > diff --git a/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml b/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml > index bbd22e95b319..c91eb4229ed3 100644 > --- a/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml > +++ b/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml > @@ -32,6 +32,47 @@ properties: > > '#clock-cells': > const: 1 > +if: This should be allOf: and placed after required: block, like in example schema. > + properties: > + compatible: > + contains: > + enum: > + - fsl,imx8mm-anatop > + > +then: > + properties: > + fsl,ssc-clocks: Nope. Properties must be defined in top-level. > + $ref: /schemas/types.yaml#/definitions/phandle-array > + description: > + The phandles to the PLLs with spread spectrum clock generation > + hardware capability. These should be clocks. > + maxItems: 4 > + > + fsl,ssc-modfreq-hz: > + $ref: /schemas/types.yaml#/definitions/uint32-array This should fail. I don't think you tested this patch. https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml > + description: > + The values of modulation frequency (Hz unit) of spread spectrum > + clocking for each PLL. > + maxItems: 4 > + > + fsl,ssc-modrate-percent: Same problems Best regards, Krzysztof To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Sat, Sep 28, 2024 at 2:09 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > On 28/09/2024 10:37, Dario Binacchi wrote: > > The patch adds the DT bindings for enabling and tuning spread spectrum > > clocking generation. > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > > > .../bindings/clock/fsl,imx8m-anatop.yaml | 41 +++++++++++++++++++ > > 1 file changed, 41 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml b/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml > > index bbd22e95b319..c91eb4229ed3 100644 > > --- a/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml > > +++ b/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml > > @@ -32,6 +32,47 @@ properties: > > > > '#clock-cells': > > const: 1 > > +if: > > This should be allOf: and placed after required: block, like in example > schema. > > > > + properties: > > + compatible: > > + contains: > > + enum: > > + - fsl,imx8mm-anatop > > + > > +then: > > + properties: > > + fsl,ssc-clocks: > > Nope. Properties must be defined in top-level. > > > + $ref: /schemas/types.yaml#/definitions/phandle-array > > + description: > > + The phandles to the PLLs with spread spectrum clock generation > > + hardware capability. > > These should be clocks. Sorry, but I can't understand what you're asking me. Could you kindly explain it to me in more detail? > > > + maxItems: 4 > > + > > + fsl,ssc-modfreq-hz: > > + $ref: /schemas/types.yaml#/definitions/uint32-array > > This should fail. I don't think you tested this patch. I executed the command make dt_binding_check DT_SCHEMA_FILES=fsl,imx8m-anatop.yaml and it did not raise any errors. Thanks and regards, Dario > > https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml > > > + description: > > + The values of modulation frequency (Hz unit) of spread spectrum > > + clocking for each PLL. > > + maxItems: 4 > > + > > + fsl,ssc-modrate-percent: > > Same problems > > > > Best regards, > Krzysztof >
On 29/09/2024 22:00, Dario Binacchi wrote: >> >> >>> + properties: >>> + compatible: >>> + contains: >>> + enum: >>> + - fsl,imx8mm-anatop >>> + >>> +then: >>> + properties: >>> + fsl,ssc-clocks: >> >> Nope. Properties must be defined in top-level. >> >>> + $ref: /schemas/types.yaml#/definitions/phandle-array >>> + description: >>> + The phandles to the PLLs with spread spectrum clock generation >>> + hardware capability. >> >> These should be clocks. > > Sorry, but I can't understand what you're asking me. > Could you kindly explain it to me in more detail? You added new property instead of using existing one for this purpose: 'clocks'. Best regards, Krzysztof To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Mon, Sep 30, 2024 at 8:45 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > On 29/09/2024 22:00, Dario Binacchi wrote: > >> > >> > >>> + properties: > >>> + compatible: > >>> + contains: > >>> + enum: > >>> + - fsl,imx8mm-anatop > >>> + > >>> +then: > >>> + properties: > >>> + fsl,ssc-clocks: > >> > >> Nope. Properties must be defined in top-level. > >> > >>> + $ref: /schemas/types.yaml#/definitions/phandle-array > >>> + description: > >>> + The phandles to the PLLs with spread spectrum clock generation > >>> + hardware capability. > >> > >> These should be clocks. > > > > Sorry, but I can't understand what you're asking me. > > Could you kindly explain it to me in more detail? > > You added new property instead of using existing one for this purpose: > 'clocks'. > > > > Best regards, > Krzysztof > I added this new property specifically for managing spread-spectrum. Indeed, not all clocks/PLLs managed by the node/peripheral support spread-spectrum, and the added properties specify parameters for enabling and tuning SSC for each individual PLL based on the index of each list. If I were to use the 'clocks' property and add a clock to this list that does not support SSC, IMHO the pairings would be less clear. AFAIK the confusion arises from the fact that this node, which is a clock controller, was used only to export its base address, but perhaps it should have also exported its clocks, which the other clock controller does, as shown in: Documentation/devicetree/bindings/clock/imx8m-clock.yaml. If I consider its 'compatible' entries: - 'fsl,imx8mm-ccm' -> drivers/clk/imx/clk-imx8mm.c - 'fsl,imx8mn-ccm' -> drivers/clk/imx/clk-imx8mn.c - 'fsl,imx8mp-ccm' -> drivers/clk/imx/clk-imx8mp.c the probe function, triggered by fsl,imx8m{m,n,p}-ccm (and not fsl,imx8m{m,n,p}-anatop), retrieves the anatop node solely to get its base address, also registering its clocks, which I would have expected to be registered by another driver, specifically the one for anatop: static int imx8mn_clocks_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; void __iomem *base; struct imx_pll14xx_ssc pll1443x_ssc; int ret; clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, IMX8MN_CLK_END), GFP_KERNEL); if (WARN_ON(!clk_hw_data)) return -ENOMEM; clk_hw_data->num = IMX8MN_CLK_END; hws = clk_hw_data->hws; hws[IMX8MN_CLK_DUMMY] = imx_clk_hw_fixed("dummy", 0); hws[IMX8MN_CLK_24M] = imx_get_clk_hw_by_name(np, "osc_24m"); hws[IMX8MN_CLK_32K] = imx_get_clk_hw_by_name(np, "osc_32k"); hws[IMX8MN_CLK_EXT1] = imx_get_clk_hw_by_name(np, "clk_ext1"); hws[IMX8MN_CLK_EXT2] = imx_get_clk_hw_by_name(np, "clk_ext2"); hws[IMX8MN_CLK_EXT3] = imx_get_clk_hw_by_name(np, "clk_ext3"); hws[IMX8MN_CLK_EXT4] = imx_get_clk_hw_by_name(np, "clk_ext4"); np = of_find_compatible_node(NULL, NULL, "fsl,imx8mn-anatop"); base = devm_of_iomap(dev, np, 0, NULL); of_node_put(np); if (WARN_ON(IS_ERR(base))) { ret = PTR_ERR(base); goto unregister_hws; } hws[IMX8MN_AUDIO_PLL1_REF_SEL] = imx_clk_hw_mux("audio_pll1_ref_sel", base + 0x0, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); hws[IMX8MN_AUDIO_PLL2_REF_SEL] = imx_clk_hw_mux("audio_pll2_ref_sel", base + 0x14, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); hws[IMX8MN_VIDEO_PLL_REF_SEL] = imx_clk_hw_mux("video_pll_ref_sel", base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); Thanks and regards, Dario
On 01/10/2024 08:29, Dario Binacchi wrote: > On Mon, Sep 30, 2024 at 8:45 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: >> >> On 29/09/2024 22:00, Dario Binacchi wrote: >>>> >>>> >>>>> + properties: >>>>> + compatible: >>>>> + contains: >>>>> + enum: >>>>> + - fsl,imx8mm-anatop >>>>> + >>>>> +then: >>>>> + properties: >>>>> + fsl,ssc-clocks: >>>> >>>> Nope. Properties must be defined in top-level. >>>> >>>>> + $ref: /schemas/types.yaml#/definitions/phandle-array >>>>> + description: >>>>> + The phandles to the PLLs with spread spectrum clock generation >>>>> + hardware capability. >>>> >>>> These should be clocks. >>> >>> Sorry, but I can't understand what you're asking me. >>> Could you kindly explain it to me in more detail? >> >> You added new property instead of using existing one for this purpose: >> 'clocks'. > >> >> >> >> Best regards, >> Krzysztof >> > > I added this new property specifically for managing spread-spectrum. > Indeed, not all clocks/PLLs > managed by the node/peripheral support spread-spectrum, and the added > properties specify > parameters for enabling and tuning SSC for each individual PLL based > on the index of each list. > If I were to use the 'clocks' property and add a clock to this list > that does not support SSC, IMHO > the pairings would be less clear. You duplicate property with argument "pairings shall match". Well, I am not happy with the duplication. Clocks have specific order, thus it is explicit which one needs tuning. Your other properties can match them as well, just index from clocks is offset... > > AFAIK the confusion arises from the fact that this node, which is a > clock controller, was used only > to export its base address, but perhaps it should have also exported > its clocks, which the other > clock controller does, as shown in: > Documentation/devicetree/bindings/clock/imx8m-clock.yaml. You use it as clocks, so I don't understand this comment. > If I consider its 'compatible' entries: > - 'fsl,imx8mm-ccm' -> drivers/clk/imx/clk-imx8mm.c > - 'fsl,imx8mn-ccm' -> drivers/clk/imx/clk-imx8mn.c > - 'fsl,imx8mp-ccm' -> drivers/clk/imx/clk-imx8mp.c > the probe function, triggered by fsl,imx8m{m,n,p}-ccm (and not > fsl,imx8m{m,n,p}-anatop), > retrieves the anatop node solely to get its base address, also > registering its clocks, which > I would have expected to be registered by another driver, specifically > the one for anatop: > > static int imx8mn_clocks_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > struct device_node *np = dev->of_node; > void __iomem *base; > struct imx_pll14xx_ssc pll1443x_ssc; > int ret; > > clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, > IMX8MN_CLK_END), GFP_KERNEL); > if (WARN_ON(!clk_hw_data)) > return -ENOMEM; > > clk_hw_data->num = IMX8MN_CLK_END; > hws = clk_hw_data->hws; > > hws[IMX8MN_CLK_DUMMY] = imx_clk_hw_fixed("dummy", 0); > hws[IMX8MN_CLK_24M] = imx_get_clk_hw_by_name(np, "osc_24m"); > hws[IMX8MN_CLK_32K] = imx_get_clk_hw_by_name(np, "osc_32k"); > hws[IMX8MN_CLK_EXT1] = imx_get_clk_hw_by_name(np, "clk_ext1"); > hws[IMX8MN_CLK_EXT2] = imx_get_clk_hw_by_name(np, "clk_ext2"); > hws[IMX8MN_CLK_EXT3] = imx_get_clk_hw_by_name(np, "clk_ext3"); > hws[IMX8MN_CLK_EXT4] = imx_get_clk_hw_by_name(np, "clk_ext4"); > > np = of_find_compatible_node(NULL, NULL, "fsl,imx8mn-anatop"); > base = devm_of_iomap(dev, np, 0, NULL); > of_node_put(np); > if (WARN_ON(IS_ERR(base))) { > ret = PTR_ERR(base); > goto unregister_hws; > } > > hws[IMX8MN_AUDIO_PLL1_REF_SEL] = imx_clk_hw_mux("audio_pll1_ref_sel", > base + 0x0, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > hws[IMX8MN_AUDIO_PLL2_REF_SEL] = imx_clk_hw_mux("audio_pll2_ref_sel", > base + 0x14, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > hws[IMX8MN_VIDEO_PLL_REF_SEL] = imx_clk_hw_mux("video_pll_ref_sel", > base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); Sorry, I am not going to dwell into drivers code. We talk here about bindings and new properties. Best regards, Krzysztof To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Thu, Oct 3, 2024 at 12:46 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > On 01/10/2024 08:29, Dario Binacchi wrote: > > On Mon, Sep 30, 2024 at 8:45 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > >> > >> On 29/09/2024 22:00, Dario Binacchi wrote: > >>>> > >>>> > >>>>> + properties: > >>>>> + compatible: > >>>>> + contains: > >>>>> + enum: > >>>>> + - fsl,imx8mm-anatop > >>>>> + > >>>>> +then: > >>>>> + properties: > >>>>> + fsl,ssc-clocks: > >>>> > >>>> Nope. Properties must be defined in top-level. > >>>> > >>>>> + $ref: /schemas/types.yaml#/definitions/phandle-array > >>>>> + description: > >>>>> + The phandles to the PLLs with spread spectrum clock generation > >>>>> + hardware capability. > >>>> > >>>> These should be clocks. > >>> > >>> Sorry, but I can't understand what you're asking me. > >>> Could you kindly explain it to me in more detail? > >> > >> You added new property instead of using existing one for this purpose: > >> 'clocks'. > > > >> > >> > >> > >> Best regards, > >> Krzysztof > >> > > > > I added this new property specifically for managing spread-spectrum. > > Indeed, not all clocks/PLLs > > managed by the node/peripheral support spread-spectrum, and the added > > properties specify > > parameters for enabling and tuning SSC for each individual PLL based > > on the index of each list. > > If I were to use the 'clocks' property and add a clock to this list > > that does not support SSC, IMHO > > the pairings would be less clear. > > You duplicate property with argument "pairings shall match". Well, I am > not happy with the duplication. Clocks have specific order, thus it is > explicit which one needs tuning. Your other properties can match them as > well, just index from clocks is offset... Just to check if I understood correctly what you are suggesting before submitting version 3 of the patch. Something, for example, like: clocks = <&clk, IMX8MP_AUDIO_PLL1>, <&clk, IMX8MP_AUDIO_PLL2>, <&clk IMX8MP_VIDEO_PLL1>; fsl,ssc-modfreq-hz = <0, 3517>, <2, 6818>; Where the spread spectrum is enabled only for AUDIO_PLL1 and VIDEO_PLL1 and not for IMX8MP_AUDIO_PLL2. Is this what you meant? Thanks and regards, Dario > > > > > > AFAIK the confusion arises from the fact that this node, which is a > > clock controller, was used only > > to export its base address, but perhaps it should have also exported > > its clocks, which the other > > clock controller does, as shown in: > > Documentation/devicetree/bindings/clock/imx8m-clock.yaml. > > You use it as clocks, so I don't understand this comment. > > > If I consider its 'compatible' entries: > > - 'fsl,imx8mm-ccm' -> drivers/clk/imx/clk-imx8mm.c > > - 'fsl,imx8mn-ccm' -> drivers/clk/imx/clk-imx8mn.c > > - 'fsl,imx8mp-ccm' -> drivers/clk/imx/clk-imx8mp.c > > the probe function, triggered by fsl,imx8m{m,n,p}-ccm (and not > > fsl,imx8m{m,n,p}-anatop), > > retrieves the anatop node solely to get its base address, also > > registering its clocks, which > > I would have expected to be registered by another driver, specifically > > the one for anatop: > > > > static int imx8mn_clocks_probe(struct platform_device *pdev) > > { > > struct device *dev = &pdev->dev; > > struct device_node *np = dev->of_node; > > void __iomem *base; > > struct imx_pll14xx_ssc pll1443x_ssc; > > int ret; > > > > clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, > > IMX8MN_CLK_END), GFP_KERNEL); > > if (WARN_ON(!clk_hw_data)) > > return -ENOMEM; > > > > clk_hw_data->num = IMX8MN_CLK_END; > > hws = clk_hw_data->hws; > > > > hws[IMX8MN_CLK_DUMMY] = imx_clk_hw_fixed("dummy", 0); > > hws[IMX8MN_CLK_24M] = imx_get_clk_hw_by_name(np, "osc_24m"); > > hws[IMX8MN_CLK_32K] = imx_get_clk_hw_by_name(np, "osc_32k"); > > hws[IMX8MN_CLK_EXT1] = imx_get_clk_hw_by_name(np, "clk_ext1"); > > hws[IMX8MN_CLK_EXT2] = imx_get_clk_hw_by_name(np, "clk_ext2"); > > hws[IMX8MN_CLK_EXT3] = imx_get_clk_hw_by_name(np, "clk_ext3"); > > hws[IMX8MN_CLK_EXT4] = imx_get_clk_hw_by_name(np, "clk_ext4"); > > > > np = of_find_compatible_node(NULL, NULL, "fsl,imx8mn-anatop"); > > base = devm_of_iomap(dev, np, 0, NULL); > > of_node_put(np); > > if (WARN_ON(IS_ERR(base))) { > > ret = PTR_ERR(base); > > goto unregister_hws; > > } > > > > hws[IMX8MN_AUDIO_PLL1_REF_SEL] = imx_clk_hw_mux("audio_pll1_ref_sel", > > base + 0x0, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > hws[IMX8MN_AUDIO_PLL2_REF_SEL] = imx_clk_hw_mux("audio_pll2_ref_sel", > > base + 0x14, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > hws[IMX8MN_VIDEO_PLL_REF_SEL] = imx_clk_hw_mux("video_pll_ref_sel", > > base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > Sorry, I am not going to dwell into drivers code. We talk here about > bindings and new properties. > > Best regards, > Krzysztof >
On 05/10/2024 10:57, Dario Binacchi wrote: > On Thu, Oct 3, 2024 at 12:46 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: >> >> On 01/10/2024 08:29, Dario Binacchi wrote: >>> On Mon, Sep 30, 2024 at 8:45 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: >>>> >>>> On 29/09/2024 22:00, Dario Binacchi wrote: >>>>>> >>>>>> >>>>>>> + properties: >>>>>>> + compatible: >>>>>>> + contains: >>>>>>> + enum: >>>>>>> + - fsl,imx8mm-anatop >>>>>>> + >>>>>>> +then: >>>>>>> + properties: >>>>>>> + fsl,ssc-clocks: >>>>>> >>>>>> Nope. Properties must be defined in top-level. >>>>>> >>>>>>> + $ref: /schemas/types.yaml#/definitions/phandle-array >>>>>>> + description: >>>>>>> + The phandles to the PLLs with spread spectrum clock generation >>>>>>> + hardware capability. >>>>>> >>>>>> These should be clocks. >>>>> >>>>> Sorry, but I can't understand what you're asking me. >>>>> Could you kindly explain it to me in more detail? >>>> >>>> You added new property instead of using existing one for this purpose: >>>> 'clocks'. >>> >>>> >>>> >>>> >>>> Best regards, >>>> Krzysztof >>>> >>> >>> I added this new property specifically for managing spread-spectrum. >>> Indeed, not all clocks/PLLs >>> managed by the node/peripheral support spread-spectrum, and the added >>> properties specify >>> parameters for enabling and tuning SSC for each individual PLL based >>> on the index of each list. >>> If I were to use the 'clocks' property and add a clock to this list >>> that does not support SSC, IMHO >>> the pairings would be less clear. >> >> You duplicate property with argument "pairings shall match". Well, I am >> not happy with the duplication. Clocks have specific order, thus it is >> explicit which one needs tuning. Your other properties can match them as >> well, just index from clocks is offset... > > Just to check if I understood correctly what you are suggesting before > submitting version 3 of the patch. > Something, for example, like: > > clocks = <&clk, IMX8MP_AUDIO_PLL1>, <&clk, IMX8MP_AUDIO_PLL2>, <&clk > IMX8MP_VIDEO_PLL1>; > fsl,ssc-modfreq-hz = <0, 3517>, <2, 6818>; Hm, what is 0? If clock index, then no, it's redundant. The first item in cannot point to other clock. Also, what exactly are you setting here and why assigned-clock-rates are not working? Best regards, Krzysztof To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Sun, Oct 6, 2024 at 3:13 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > On 05/10/2024 10:57, Dario Binacchi wrote: > > On Thu, Oct 3, 2024 at 12:46 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > >> > >> On 01/10/2024 08:29, Dario Binacchi wrote: > >>> On Mon, Sep 30, 2024 at 8:45 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > >>>> > >>>> On 29/09/2024 22:00, Dario Binacchi wrote: > >>>>>> > >>>>>> > >>>>>>> + properties: > >>>>>>> + compatible: > >>>>>>> + contains: > >>>>>>> + enum: > >>>>>>> + - fsl,imx8mm-anatop > >>>>>>> + > >>>>>>> +then: > >>>>>>> + properties: > >>>>>>> + fsl,ssc-clocks: > >>>>>> > >>>>>> Nope. Properties must be defined in top-level. > >>>>>> > >>>>>>> + $ref: /schemas/types.yaml#/definitions/phandle-array > >>>>>>> + description: > >>>>>>> + The phandles to the PLLs with spread spectrum clock generation > >>>>>>> + hardware capability. > >>>>>> > >>>>>> These should be clocks. > >>>>> > >>>>> Sorry, but I can't understand what you're asking me. > >>>>> Could you kindly explain it to me in more detail? > >>>> > >>>> You added new property instead of using existing one for this purpose: > >>>> 'clocks'. > >>> > >>>> > >>>> > >>>> > >>>> Best regards, > >>>> Krzysztof > >>>> > >>> > >>> I added this new property specifically for managing spread-spectrum. > >>> Indeed, not all clocks/PLLs > >>> managed by the node/peripheral support spread-spectrum, and the added > >>> properties specify > >>> parameters for enabling and tuning SSC for each individual PLL based > >>> on the index of each list. > >>> If I were to use the 'clocks' property and add a clock to this list > >>> that does not support SSC, IMHO > >>> the pairings would be less clear. > >> > >> You duplicate property with argument "pairings shall match". Well, I am > >> not happy with the duplication. Clocks have specific order, thus it is > >> explicit which one needs tuning. Your other properties can match them as > >> well, just index from clocks is offset... > > > > Just to check if I understood correctly what you are suggesting before > > submitting version 3 of the patch. > > Something, for example, like: > > > > clocks = <&clk, IMX8MP_AUDIO_PLL1>, <&clk, IMX8MP_AUDIO_PLL2>, <&clk > > IMX8MP_VIDEO_PLL1>; > > fsl,ssc-modfreq-hz = <0, 3517>, <2, 6818>; > > Hm, what is 0? If clock index, then no, it's redundant. The first item > in cannot point to other clock. > > Also, what exactly are you setting here I am enabling and configuring the spread spectrum. Normal clock: Without spread spectrum, the clock signal has a fixed and repetitive frequency (e.g., 100 MHz). This frequency generates an electromagnetic signal concentrated on a single frequency, and if strong enough, it can disturb other devices. Spread spectrum: With spread spectrum, the clock frequency is slightly "modulated," meaning it oscillates around a central value. For example, if the base frequency is 100 MHz, the clock might vary between 99.5 MHz and 100.5 MHz in a cyclic manner. This small variation spreads the energy over a wider range of frequencies (from 99.5 to 100.5 MHz), reducing the intensity of the signal at any one frequency. > and why assigned-clock-rates are > not working? The traditional clock properties, such as clocks, assigned-clocks-rates, etc retain their usual meaning even when spread spectrum is applied. However, to implement the spread spectrum mechanism in a circuit with a PLL (Phase-Locked Loop), additional specific parameters are introduced to properly configure the frequency modulation: - Modulation frequency: i. e. fsl,ssc-modfreq-hz - Modulation rate: i.e. fsl,ssc-modrate-percent - Modulation type: i. e. fsl,ssc-modmethod (center-spread, down-spread) Additionally, it should be noted that not all anatop PLLs are equipped with circuitry for spread spectrum, but only a small subset of them. This is the reason why I introduced the property "fsl, ssc-clocks". This is another commit [1] on enabling spread spectrum that I implemented some time ago for the am335x. The most evident difference is that in that case the node was a clock node and not a clock controller, as in the case of anatop. The parameters are also not exactly the same, but that depends on the platform. [1] 4a8bc2644ef0cbf8e ("dt-bindings: ti: dpll: add spread spectrum support") Thanks and regards, Dario > > Best regards, > Krzysztof >
On 07/10/2024 17:02, Dario Binacchi wrote: > On Sun, Oct 6, 2024 at 3:13 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: >> >> On 05/10/2024 10:57, Dario Binacchi wrote: >>> On Thu, Oct 3, 2024 at 12:46 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: >>>> >>>> On 01/10/2024 08:29, Dario Binacchi wrote: >>>>> On Mon, Sep 30, 2024 at 8:45 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: >>>>>> >>>>>> On 29/09/2024 22:00, Dario Binacchi wrote: >>>>>>>> >>>>>>>> >>>>>>>>> + properties: >>>>>>>>> + compatible: >>>>>>>>> + contains: >>>>>>>>> + enum: >>>>>>>>> + - fsl,imx8mm-anatop >>>>>>>>> + >>>>>>>>> +then: >>>>>>>>> + properties: >>>>>>>>> + fsl,ssc-clocks: >>>>>>>> >>>>>>>> Nope. Properties must be defined in top-level. >>>>>>>> >>>>>>>>> + $ref: /schemas/types.yaml#/definitions/phandle-array >>>>>>>>> + description: >>>>>>>>> + The phandles to the PLLs with spread spectrum clock generation >>>>>>>>> + hardware capability. >>>>>>>> >>>>>>>> These should be clocks. >>>>>>> >>>>>>> Sorry, but I can't understand what you're asking me. >>>>>>> Could you kindly explain it to me in more detail? >>>>>> >>>>>> You added new property instead of using existing one for this purpose: >>>>>> 'clocks'. >>>>> >>>>>> >>>>>> >>>>>> >>>>>> Best regards, >>>>>> Krzysztof >>>>>> >>>>> >>>>> I added this new property specifically for managing spread-spectrum. >>>>> Indeed, not all clocks/PLLs >>>>> managed by the node/peripheral support spread-spectrum, and the added >>>>> properties specify >>>>> parameters for enabling and tuning SSC for each individual PLL based >>>>> on the index of each list. >>>>> If I were to use the 'clocks' property and add a clock to this list >>>>> that does not support SSC, IMHO >>>>> the pairings would be less clear. >>>> >>>> You duplicate property with argument "pairings shall match". Well, I am >>>> not happy with the duplication. Clocks have specific order, thus it is >>>> explicit which one needs tuning. Your other properties can match them as >>>> well, just index from clocks is offset... >>> >>> Just to check if I understood correctly what you are suggesting before >>> submitting version 3 of the patch. >>> Something, for example, like: >>> >>> clocks = <&clk, IMX8MP_AUDIO_PLL1>, <&clk, IMX8MP_AUDIO_PLL2>, <&clk >>> IMX8MP_VIDEO_PLL1>; >>> fsl,ssc-modfreq-hz = <0, 3517>, <2, 6818>; >> >> Hm, what is 0? If clock index, then no, it's redundant. The first item >> in cannot point to other clock. >> >> Also, what exactly are you setting here > > I am enabling and configuring the spread spectrum. > > Normal clock: Without spread spectrum, the clock signal has a fixed and > repetitive frequency (e.g., 100 MHz). This frequency generates an > electromagnetic > signal concentrated on a single frequency, and if strong enough, it can disturb > other devices. > > Spread spectrum: With spread spectrum, the clock frequency is > slightly "modulated," > meaning it oscillates around a central value. For example, if the base > frequency is 100 MHz, > the clock might vary between 99.5 MHz and 100.5 MHz in a cyclic manner. This > small variation spreads the energy over a wider range of frequencies > (from 99.5 to 100.5 MHz), > reducing the intensity of the signal at any one frequency. Sure, so each board will come with its own, different values and you will not put into the SoC DTSI? Where is the DTS? I received only this patch. > >> and why assigned-clock-rates are >> not working? > > The traditional clock properties, such as clocks, > assigned-clocks-rates, etc retain their usual > meaning even when spread spectrum is applied. However, to implement > the spread spectrum > mechanism in a circuit with a PLL (Phase-Locked Loop), additional > specific parameters are > introduced to properly configure the frequency modulation: > > - Modulation frequency: i. e. fsl,ssc-modfreq-hz > - Modulation rate: i.e. fsl,ssc-modrate-percent > - Modulation type: i. e. fsl,ssc-modmethod (center-spread, down-spread) > > Additionally, it should be noted that not all anatop PLLs are equipped > with circuitry for spread > spectrum, but only a small subset of them. This is the reason why I > introduced the property > "fsl, ssc-clocks". > > This is another commit [1] on enabling spread spectrum that I > implemented some time ago for > the am335x. The most evident difference is that in that case the node > was a clock node and not > a clock controller, as in the case of anatop. The parameters are also > not exactly the same, but > that depends on the platform. > > [1] 4a8bc2644ef0cbf8e ("dt-bindings: ti: dpll: add spread spectrum support") OK, I still do not know what "0" was, but the items are fixed, so you know exactly which clock you are configuring here. Best regards, Krzysztof To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Tue, Oct 8, 2024 at 10:20 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > On 07/10/2024 17:02, Dario Binacchi wrote: > > On Sun, Oct 6, 2024 at 3:13 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > >> > >> On 05/10/2024 10:57, Dario Binacchi wrote: > >>> On Thu, Oct 3, 2024 at 12:46 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > >>>> > >>>> On 01/10/2024 08:29, Dario Binacchi wrote: > >>>>> On Mon, Sep 30, 2024 at 8:45 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > >>>>>> > >>>>>> On 29/09/2024 22:00, Dario Binacchi wrote: > >>>>>>>> > >>>>>>>> > >>>>>>>>> + properties: > >>>>>>>>> + compatible: > >>>>>>>>> + contains: > >>>>>>>>> + enum: > >>>>>>>>> + - fsl,imx8mm-anatop > >>>>>>>>> + > >>>>>>>>> +then: > >>>>>>>>> + properties: > >>>>>>>>> + fsl,ssc-clocks: > >>>>>>>> > >>>>>>>> Nope. Properties must be defined in top-level. > >>>>>>>> > >>>>>>>>> + $ref: /schemas/types.yaml#/definitions/phandle-array > >>>>>>>>> + description: > >>>>>>>>> + The phandles to the PLLs with spread spectrum clock generation > >>>>>>>>> + hardware capability. > >>>>>>>> > >>>>>>>> These should be clocks. > >>>>>>> > >>>>>>> Sorry, but I can't understand what you're asking me. > >>>>>>> Could you kindly explain it to me in more detail? > >>>>>> > >>>>>> You added new property instead of using existing one for this purpose: > >>>>>> 'clocks'. > >>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> Best regards, > >>>>>> Krzysztof > >>>>>> > >>>>> > >>>>> I added this new property specifically for managing spread-spectrum. > >>>>> Indeed, not all clocks/PLLs > >>>>> managed by the node/peripheral support spread-spectrum, and the added > >>>>> properties specify > >>>>> parameters for enabling and tuning SSC for each individual PLL based > >>>>> on the index of each list. > >>>>> If I were to use the 'clocks' property and add a clock to this list > >>>>> that does not support SSC, IMHO > >>>>> the pairings would be less clear. > >>>> > >>>> You duplicate property with argument "pairings shall match". Well, I am > >>>> not happy with the duplication. Clocks have specific order, thus it is > >>>> explicit which one needs tuning. Your other properties can match them as > >>>> well, just index from clocks is offset... > >>> > >>> Just to check if I understood correctly what you are suggesting before > >>> submitting version 3 of the patch. > >>> Something, for example, like: > >>> > >>> clocks = <&clk, IMX8MP_AUDIO_PLL1>, <&clk, IMX8MP_AUDIO_PLL2>, <&clk > >>> IMX8MP_VIDEO_PLL1>; > >>> fsl,ssc-modfreq-hz = <0, 3517>, <2, 6818>; > >> > >> Hm, what is 0? If clock index, then no, it's redundant. The first item > >> in cannot point to other clock. > >> > >> Also, what exactly are you setting here > > > > I am enabling and configuring the spread spectrum. > > > > Normal clock: Without spread spectrum, the clock signal has a fixed and > > repetitive frequency (e.g., 100 MHz). This frequency generates an > > electromagnetic > > signal concentrated on a single frequency, and if strong enough, it can disturb > > other devices. > > > > Spread spectrum: With spread spectrum, the clock frequency is > > slightly "modulated," > > meaning it oscillates around a central value. For example, if the base > > frequency is 100 MHz, > > the clock might vary between 99.5 MHz and 100.5 MHz in a cyclic manner. This > > small variation spreads the energy over a wider range of frequencies > > (from 99.5 to 100.5 MHz), > > reducing the intensity of the signal at any one frequency. > > Sure, so each board will come with its own, different values and you > will not put into the SoC DTSI? Yes, exactly. > > Where is the DTS? I received only this patch. I haven't had time to push the board I'm working on upstream yet. Locally, I apply this patch: --- a/arch/arm64/boot/dts/freescale/imx8mp-icore-mx8mp-ctouch2-of10.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-icore-mx8mp-ctouch2-of10.dts @@ -113,6 +113,13 @@ reg_usdhc2_vmmc: regulator-usdhc2 { }; }; +&anatop { + fsl,ssc-clocks = <&clk IMX8MP_VIDEO_PLL1>; + fsl,ssc-modfreq-hz = <6818>; + fsl,ssc-modrate-percent = <3>; + fsl,ssc-modmethod = "down-spread"; +}; + /* Ethernet */ &eqos { pinctrl-names = "default"; > > > > >> and why assigned-clock-rates are > >> not working? > > > > The traditional clock properties, such as clocks, > > assigned-clocks-rates, etc retain their usual > > meaning even when spread spectrum is applied. However, to implement > > the spread spectrum > > mechanism in a circuit with a PLL (Phase-Locked Loop), additional > > specific parameters are > > introduced to properly configure the frequency modulation: > > > > - Modulation frequency: i. e. fsl,ssc-modfreq-hz > > - Modulation rate: i.e. fsl,ssc-modrate-percent > > - Modulation type: i. e. fsl,ssc-modmethod (center-spread, down-spread) > > > > Additionally, it should be noted that not all anatop PLLs are equipped > > with circuitry for spread > > spectrum, but only a small subset of them. This is the reason why I > > introduced the property > > "fsl, ssc-clocks". > > > > This is another commit [1] on enabling spread spectrum that I > > implemented some time ago for > > the am335x. The most evident difference is that in that case the node > > was a clock node and not > > a clock controller, as in the case of anatop. The parameters are also > > not exactly the same, but > > that depends on the platform. > > > > [1] 4a8bc2644ef0cbf8e ("dt-bindings: ti: dpll: add spread spectrum support") > > > OK, I still do not know what "0" was, but the items are fixed, so you > know exactly which clock you are configuring here. So, after delving deeper into the topic, is it now acceptable to use the property "fsl,ssc-clocks" instead of "clocks"? As in the patch I applied locally? Thanks and regards, Dario > > Best regards, > Krzysztof >
On Tue, Oct 8, 2024 at 11:16 AM Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > > On Tue, Oct 8, 2024 at 10:20 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > > > On 07/10/2024 17:02, Dario Binacchi wrote: > > > On Sun, Oct 6, 2024 at 3:13 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > >> > > >> On 05/10/2024 10:57, Dario Binacchi wrote: > > >>> On Thu, Oct 3, 2024 at 12:46 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > >>>> > > >>>> On 01/10/2024 08:29, Dario Binacchi wrote: > > >>>>> On Mon, Sep 30, 2024 at 8:45 AM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > >>>>>> > > >>>>>> On 29/09/2024 22:00, Dario Binacchi wrote: > > >>>>>>>> > > >>>>>>>> > > >>>>>>>>> + properties: > > >>>>>>>>> + compatible: > > >>>>>>>>> + contains: > > >>>>>>>>> + enum: > > >>>>>>>>> + - fsl,imx8mm-anatop > > >>>>>>>>> + > > >>>>>>>>> +then: > > >>>>>>>>> + properties: > > >>>>>>>>> + fsl,ssc-clocks: > > >>>>>>>> > > >>>>>>>> Nope. Properties must be defined in top-level. > > >>>>>>>> > > >>>>>>>>> + $ref: /schemas/types.yaml#/definitions/phandle-array > > >>>>>>>>> + description: > > >>>>>>>>> + The phandles to the PLLs with spread spectrum clock generation > > >>>>>>>>> + hardware capability. > > >>>>>>>> > > >>>>>>>> These should be clocks. > > >>>>>>> > > >>>>>>> Sorry, but I can't understand what you're asking me. > > >>>>>>> Could you kindly explain it to me in more detail? > > >>>>>> > > >>>>>> You added new property instead of using existing one for this purpose: > > >>>>>> 'clocks'. > > >>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> Best regards, > > >>>>>> Krzysztof > > >>>>>> > > >>>>> > > >>>>> I added this new property specifically for managing spread-spectrum. > > >>>>> Indeed, not all clocks/PLLs > > >>>>> managed by the node/peripheral support spread-spectrum, and the added > > >>>>> properties specify > > >>>>> parameters for enabling and tuning SSC for each individual PLL based > > >>>>> on the index of each list. > > >>>>> If I were to use the 'clocks' property and add a clock to this list > > >>>>> that does not support SSC, IMHO > > >>>>> the pairings would be less clear. > > >>>> > > >>>> You duplicate property with argument "pairings shall match". Well, I am > > >>>> not happy with the duplication. Clocks have specific order, thus it is > > >>>> explicit which one needs tuning. Your other properties can match them as > > >>>> well, just index from clocks is offset... > > >>> > > >>> Just to check if I understood correctly what you are suggesting before > > >>> submitting version 3 of the patch. > > >>> Something, for example, like: > > >>> > > >>> clocks = <&clk, IMX8MP_AUDIO_PLL1>, <&clk, IMX8MP_AUDIO_PLL2>, <&clk > > >>> IMX8MP_VIDEO_PLL1>; > > >>> fsl,ssc-modfreq-hz = <0, 3517>, <2, 6818>; > > >> > > >> Hm, what is 0? If clock index, then no, it's redundant. The first item > > >> in cannot point to other clock. > > >> > > >> Also, what exactly are you setting here > > > > > > I am enabling and configuring the spread spectrum. > > > > > > Normal clock: Without spread spectrum, the clock signal has a fixed and > > > repetitive frequency (e.g., 100 MHz). This frequency generates an > > > electromagnetic > > > signal concentrated on a single frequency, and if strong enough, it can disturb > > > other devices. > > > > > > Spread spectrum: With spread spectrum, the clock frequency is > > > slightly "modulated," > > > meaning it oscillates around a central value. For example, if the base > > > frequency is 100 MHz, > > > the clock might vary between 99.5 MHz and 100.5 MHz in a cyclic manner. This > > > small variation spreads the energy over a wider range of frequencies > > > (from 99.5 to 100.5 MHz), > > > reducing the intensity of the signal at any one frequency. > > > > Sure, so each board will come with its own, different values and you > > will not put into the SoC DTSI? > > Yes, exactly. > > > > > Where is the DTS? I received only this patch. > > I haven't had time to push the board I'm working on upstream yet. > Locally, I apply this patch: > > --- a/arch/arm64/boot/dts/freescale/imx8mp-icore-mx8mp-ctouch2-of10.dts > +++ b/arch/arm64/boot/dts/freescale/imx8mp-icore-mx8mp-ctouch2-of10.dts > @@ -113,6 +113,13 @@ reg_usdhc2_vmmc: regulator-usdhc2 { > }; > }; > > +&anatop { > + fsl,ssc-clocks = <&clk IMX8MP_VIDEO_PLL1>; > + fsl,ssc-modfreq-hz = <6818>; > + fsl,ssc-modrate-percent = <3>; > + fsl,ssc-modmethod = "down-spread"; > +}; > + > /* Ethernet */ > &eqos { > pinctrl-names = "default"; > > > > > > > > >> and why assigned-clock-rates are > > >> not working? > > > > > > The traditional clock properties, such as clocks, > > > assigned-clocks-rates, etc retain their usual > > > meaning even when spread spectrum is applied. However, to implement > > > the spread spectrum > > > mechanism in a circuit with a PLL (Phase-Locked Loop), additional > > > specific parameters are > > > introduced to properly configure the frequency modulation: > > > > > > - Modulation frequency: i. e. fsl,ssc-modfreq-hz > > > - Modulation rate: i.e. fsl,ssc-modrate-percent > > > - Modulation type: i. e. fsl,ssc-modmethod (center-spread, down-spread) > > > > > > Additionally, it should be noted that not all anatop PLLs are equipped > > > with circuitry for spread > > > spectrum, but only a small subset of them. This is the reason why I > > > introduced the property > > > "fsl, ssc-clocks". > > > > > > This is another commit [1] on enabling spread spectrum that I > > > implemented some time ago for > > > the am335x. The most evident difference is that in that case the node > > > was a clock node and not > > > a clock controller, as in the case of anatop. The parameters are also > > > not exactly the same, but > > > that depends on the platform. > > > > > > [1] 4a8bc2644ef0cbf8e ("dt-bindings: ti: dpll: add spread spectrum support") > > > > > > OK, I still do not know what "0" was, but the items are fixed, so you > > know exactly which clock you are configuring here. > > So, after delving deeper into the topic, is it now acceptable to use > the property > "fsl,ssc-clocks" instead of "clocks"? As in the patch I applied locally? A gentle ping. Sorry, but I haven't yet received your response to the previous email, and I'm not sure how to proceed. Thanks and regards, Dario > > Thanks and regards, > Dario > > > > > Best regards, > > Krzysztof > > > > > -- > > Dario Binacchi > > Senior Embedded Linux Developer > > dario.binacchi@amarulasolutions.com > > __________________________________ > > > Amarula Solutions SRL > > Via Le Canevare 30, 31100 Treviso, Veneto, IT > > T. +39 042 243 5310 > info@amarulasolutions.com > > www.amarulasolutions.com
On 23/10/2024 16:58, Dario Binacchi wrote: >>>> >>>> This is another commit [1] on enabling spread spectrum that I >>>> implemented some time ago for >>>> the am335x. The most evident difference is that in that case the node >>>> was a clock node and not >>>> a clock controller, as in the case of anatop. The parameters are also >>>> not exactly the same, but >>>> that depends on the platform. >>>> >>>> [1] 4a8bc2644ef0cbf8e ("dt-bindings: ti: dpll: add spread spectrum support") >>> >>> >>> OK, I still do not know what "0" was, but the items are fixed, so you >>> know exactly which clock you are configuring here. >> >> So, after delving deeper into the topic, is it now acceptable to use >> the property >> "fsl,ssc-clocks" instead of "clocks"? As in the patch I applied locally? > > A gentle ping. > Sorry, but I haven't yet received your response to the previous email, > and I'm not sure how to proceed. > Yeah, the property is fine, but I don't think you need the clock index. The lists - like clocks and your spread property - have strictly defined items, so it is enough if schema lists items and says which spread points to which clock. P.S. I think you might pinged me on IRC, but you know, https://nohello.net/en/ Best regards, Krzysztof To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Wed, Oct 23, 2024 at 7:49 PM Krzysztof Kozlowski <krzk@kernel.org> wrote: > > On 23/10/2024 16:58, Dario Binacchi wrote: > >>>> > >>>> This is another commit [1] on enabling spread spectrum that I > >>>> implemented some time ago for > >>>> the am335x. The most evident difference is that in that case the node > >>>> was a clock node and not > >>>> a clock controller, as in the case of anatop. The parameters are also > >>>> not exactly the same, but > >>>> that depends on the platform. > >>>> > >>>> [1] 4a8bc2644ef0cbf8e ("dt-bindings: ti: dpll: add spread spectrum support") > >>> > >>> > >>> OK, I still do not know what "0" was, but the items are fixed, so you > >>> know exactly which clock you are configuring here. > >> > >> So, after delving deeper into the topic, is it now acceptable to use > >> the property > >> "fsl,ssc-clocks" instead of "clocks"? As in the patch I applied locally? > > > > A gentle ping. > > Sorry, but I haven't yet received your response to the previous email, > > and I'm not sure how to proceed. > > > > Yeah, the property is fine, but I don't think you need the clock index. So it then becomes reviewable v2, which I had already sent some time ago? https://patchwork.kernel.org/project/linux-clk/patch/20240929172743.1758292-2-dario.binacchi@amarulasolutions.com/ Thanks and regards, Dario > The lists - like clocks and your spread property - have strictly defined > items, so it is enough if schema lists items and says which spread > points to which clock. > > > P.S. I think you might pinged me on IRC, but you know, > https://nohello.net/en/ > > > Best regards, > Krzysztof >
diff --git a/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml b/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml index bbd22e95b319..c91eb4229ed3 100644 --- a/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml +++ b/Documentation/devicetree/bindings/clock/fsl,imx8m-anatop.yaml @@ -32,6 +32,47 @@ properties: '#clock-cells': const: 1 +if: + properties: + compatible: + contains: + enum: + - fsl,imx8mm-anatop + +then: + properties: + fsl,ssc-clocks: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + The phandles to the PLLs with spread spectrum clock generation + hardware capability. + maxItems: 4 + + fsl,ssc-modfreq-hz: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + The values of modulation frequency (Hz unit) of spread spectrum + clocking for each PLL. + maxItems: 4 + + fsl,ssc-modrate-percent: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + The percentage values of modulation rate of spread spectrum + clocking for each PLL. + maxItems: 4 + + fsl,ssc-modmethod: + $ref: /schemas/types.yaml#/definitions/string-array + description: + The modulation techniques of spread spectrum clocking for + each PLL. + oneOf: + - enum: + - down-spread + - up-spread + - center-spread + maxItems: 4 required: - compatible