From patchwork Thu Apr 24 06:21:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3937 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C70DF3F0D8 for ; Thu, 24 Apr 2025 08:22:01 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-43cf44b66f7sf3385925e9.1 for ; Wed, 23 Apr 2025 23:22:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1745475721; cv=pass; d=google.com; s=arc-20240605; b=Bh/Dzr3Y7ocl3QZ0VfzhoV0ESRhaav9vLXKh2cIV7WDU9qAsi9LRs0A/UuAquo6dQT vgbXJAsSsHonJkcpCWjz3KPui0kuVQQK7Da9RHl74aXfw0gkrhRQdM7A1keg7MRtjyOA 0RoX79x50PE75sbZBTJSQmYMZQMfiF0T48aLQr1igdEDhOYnwXD0Yhg8EhqD2TYbYrou lUEhWedbjziNTRcm0LVyqk4ZRxqnwUKayjvp66DN6CiXO8g/uBG+VS25bhfwC7iMXjk7 6gAPDf/nJSfOtO2gl2VroGKmSkTZV9XNY1EQa1XnSriuGGshuDZbMFft4+B6XrPhuOnc heTA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=CwLicoLl8Z+UEOfej537LDEz/IvYpYjGSogDZhZtDSY=; fh=m7Two+kd0mZq2ls/wjBRollIyOH2yP2qex4+mlNFtA8=; b=bKSEecwh7ap5Suna2VpvDpa/N75r8dH7IpYF3ETOd52i7MtgpEYw+TGW0TLUwA9qK2 0uh9pDsH/SMzxIcJSl7L9TMuXVwHb3HUVXOifeGANIlHHxtSqcA3ShkraKE1/1+lUFLR UY38NazNAhvjnjF96QUyByLrV9GjlmqgsW2XbrkPtj7gv70HOCQvKRDg/eK7a87+XbOq WHPXsVfyUuUflOy0OmyIzunG7GZ5Ip/pZM7Ux2F1q76vQvlOpoPZXVB7B4NOXa9VB9Hl k2ovd6gudkEHoaZVEHhiKaTMYZudT4pZhcE33hlVnrfNA3Mpv0TeZ7/8cji9NoadEFI8 8wuA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pv42k+gt; 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=1745475721; x=1746080521; 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:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=CwLicoLl8Z+UEOfej537LDEz/IvYpYjGSogDZhZtDSY=; b=rfQIfJ/FhN0Zen85wcnOA/k66gsMWrGMhaqxenvmf4hQBrMqXjk2O6Zr8hYWjkE+dx VZTFgcyTqJKcljdcNqe1L8/QOK1GIHo1orsH0rwPrXO4hAHhbJrqPdEYyE0msPW8Wonn LVZZSNb/60oWpp09GB1IjAcON56iqfQzBg5vs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745475721; x=1746080521; 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 :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CwLicoLl8Z+UEOfej537LDEz/IvYpYjGSogDZhZtDSY=; b=fUHpCrPzg9ophefBrYkZ0JaPl/HgqjhkK3EDG99kIzlAy5CawIzyN5NvhJ+bmnvOYP Ko8ZAdx0Ber8LQouD73AL3Wo35el23FRyHW0L446dSA7KH0BjQNTi+n4XG0R2hMpXyep ghegX9JsLp5N95Levl4KfwmKiZZvL+IzbPnpX1hMffBA27kFWQZHpe+79ihte5IyBlWb 1DNKolL9WvtqWNAPfSAl6a+aXHoBOyAtMEifOYH8aAE8xS6OIfEkEXv6/t0k7Vak/o4o 5DsKFDO+n2HfSjZkJGb8gv026hfKG41xxRl2K3utPOrDWnhlrEngQ2SeT+Y2pnccAgoX +ZrQ== X-Forwarded-Encrypted: i=2; AJvYcCX8tIRQVl/ygHChpIS5ICsvK9Rt5f9+ZOe3koaQr8WVvGp+SiykegIJsJOjKvl2U93dWEVu8ZkeBo8/upFN@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YzjnZaIeqFeetJWMKM48U6JrSvHjBoyukbmCMNVM8MtzysBgvZR vY1h5mQPN+icAU38dDzTS/s/r+RvBoMU1AlnndNzUaPsUERwnQcWvj4lnhkeN8wm6w== X-Google-Smtp-Source: AGHT+IHinulFrT6Z9S0u0LeZjwhFCKbT+DgfcDJ6qNzi47UziML/9kTNIZQETB4fCDCbnhY8PuMV5g== X-Received: by 2002:a05:600c:3d06:b0:440:67f8:7589 with SMTP id 5b1f17b1804b1-4409bd31addmr11594325e9.16.1745475720911; Wed, 23 Apr 2025 23:22:00 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h=ARLLPAIapgapn8uDvHPB+RoGDojpyJuAhJ8q+JlHoUVks2XU0Q== Received: by 2002:a05:600c:cc8:b0:43c:f7b4:5d58 with SMTP id 5b1f17b1804b1-44099e477f1ls3291535e9.1.-pod-prod-03-eu; Wed, 23 Apr 2025 23:21:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVrScF7bTIQ+DSc0GNeM5nZr1PWGOXfhmjmndpt5BGazWdYQ4/qHFU2mqRcD5H2EiLWfElAq859F6ZY6w0u@amarulasolutions.com X-Received: by 2002:a05:600c:3154:b0:43d:79:ae1b with SMTP id 5b1f17b1804b1-4409bd23b36mr8815025e9.14.1745475718566; Wed, 23 Apr 2025 23:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745475718; cv=none; d=google.com; s=arc-20240605; b=SaX2STjT5aH0R8Q2kuSzglGjEsOuceFAqHFKOJxXTcB8c0cnAxTMy/ON13Hb7aRWcl NNs+TG3NqLv5G3gxGIceXOH1YuYYkwc6/qsSigyxvPG8Ol8z2MDYOLuyPH9LHxzSxJ3o T11tXgGTHVcODJmRuVjX66oFV7w7SymKuyfNesTfZJwQOl7D9z/WnilLeG93Xo/nQ5Ar vsobil5wbzUmZ51cWnpkT1DQYfJYB7yFDK1LtXY4mwz7/FsktyOMj839oDxNKnekh3Y4 lQHSP3820fvhY0kQfEF8g4YzbXr01ww6lDkhRe4oo7jQotZV49rhwp5UbdXQDpKwAkww jluA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=XxxaGvQDvfu7Q9PX5MDYrjcRysLPu8BDWxxMsfcOWXo=; fh=X59Kag0tWTnfF45JApqN3usTpx+w57Pnk2aDDVcIItI=; b=AvcMuWcnyu/0m5KJj6LtqZcp3/A3jHAffphD96mR/dfAwV+MVOJInYV0xMwsl+MAp9 eaZULAqhYvHPAJSblxLSKWakI2EkniBqnqNWR7Ckhc2qhHC24XcZz6ePT8UJ4ebNj0qd oz6VVs+cvnrbTM1vqZz8+EEuoAS9Tsn0Dqbmh0hS74k47M4Evte70toj8RQlMFcReGX2 0LRLG/gtkLNO2wK1DR5oAFxqRfvstXU20iBsh5WqsFiQTofzlJNmbroPFmz4XFooykY/ e2t4RP5SUVleQwVP1RKNENP9Lq0jMqyM/uVxL/HckjHuEkaYdnwbpc22iRE3iBsw+MIW isHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pv42k+gt; 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 5b1f17b1804b1-4409c36725esor1851125e9.11.2025.04.23.23.21.58 for (Google Transport Security); Wed, 23 Apr 2025 23:21:58 -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-Forwarded-Encrypted: i=1; AJvYcCVefS3WMN8k2mhoghoi8f0ja3Oa5OJtwa5QhbQgE7hBEyCzvH4Grm+FcTnmvQtxCweMFEHLxteMQScycrnB@amarulasolutions.com X-Gm-Gg: ASbGncu+eL0wqPm7LU/hnw2WaslGxAUdCtw3GLZTFuWiELfokh99UO7La7tiPT6wiQL plXq7/Gl6NjupHGKAn27SzHPzxKfQA0HwfaXwvu4SKuokqwY9wQ0czNgN9EeKgMFuWigQ2EfPEk sA64MPha1wbeo/luEWcSuNfbmVtjJk2dyBKa4u6akKBeajNnItan8er2IsRh7pGnxn7pL0lnQ+s r9MiVlOPwqVuHogRv2QsQN+alqogTj5Gp5p4CFwZv6FWcIYgnPNy6sJPSv9BwwUKFF5MG0vYlEg OK6e4LnNd+y1ja2dOUYPkYXmzztLebJUm5oIuh0LEoOsgQbbmIfoI262Q4HkgWog3TgeHCiVAgu BVjKR X-Received: by 2002:a05:600c:cc8:b0:43b:c5a3:2e1a with SMTP id 5b1f17b1804b1-4409bd05289mr11180925e9.2.1745475718040; Wed, 23 Apr 2025 23:21:58 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.. ([2.196.40.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4409d2bf8dbsm7243435e9.35.2025.04.23.23.21.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 23:21:57 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Peng Fan , Stephen Boyd , Shawn Guo , linux-amarula@amarulasolutions.com, Abel Vesa , Dario Binacchi , Conor Dooley , Fabio Estevam , Krzysztof Kozlowski , Michael Turquette , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH v12 00/19] Support spread spectrum clocking for i.MX8M PLLs Date: Thu, 24 Apr 2025 08:21:30 +0200 Message-ID: <20250424062154.2999219-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 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=pv42k+gt; 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: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This version keeps the version v9 patches that can be merged and removes the patches that will need to be modified in case Peng's PR https://github.com/devicetree-org/dt-schema/pull/154 is accepted. The idea is to speed up the merging of the patches in the series that have already been reviewed and are not dependent on the introduction of the assigned-clocks-sscs property, and postpone the patches for spread spectrum to a future series once it becomes clear what needs to be done. Specifically, the patches: 01/18 dt-bindings: clock: imx8mm: add VIDEO_PLL clocks 02/18 clk: imx8mm: rename video_pll1 to video_pll 03/18 dt-bindings: clock: imx8mp: add VIDEO_PLL clocks 04/18 clk: imx8mp: rename video_pll1 to video_pll are a replica for i.MX8MM and i.MX8MP of the patch for i.MX8MM bedcf9d1dcf88 ("clk: imx: rename video_pll1 to video_pll"), which was merged some time ago. The patches are split into four because, during the review, Krzysztof asked me to separate the driver modifications from the dt-bindings changes. All the other patches in the series, from 5 to 18, are necessary for the implementation of the anatop driver for i.MX8M{M,N,P}. The review of this series has taken a long time, partly due to misunderstandings arising from incorrect design choices. As Peng stated in [1]: "In current design, CCM is taken as producer of CLK_IMX8M_VIDEO_PLL, not consumer." These patches fix this issue by ensuring that the PLLs are now produced by Anatop and consumed by CCM, aligning with the hardware logic. Finally, a clarification: I decided to keep the same title for the series despite having removed all the patches for spread spectrum support in order to maintain a clear connection with the previous versions. [1] https://patchwork.kernel.org/project/linux-clk/patch/20241106090549.3684963-2-dario.binacchi@amarulasolutions.com/ Changes in v12: - Add the patch 15/19: arm64: dts: imx8mp-aristainetos3a-som-v1: don't replicate clk properties to fix new warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/freescale/' Changes in v11: - Fix conflict while rebasing on master for patches: 13/18 clk: imx: add support for i.MX8MP anatop clock driver 14/18 clk: imx8mp: rename ccm_base to base 15/18 dt-bindings: clock: imx8m-clock: add PLLs - Add 'Reviewed-by' tag of Peng Fan for patches: 11/18 clk: imx: add support for i.MX8MM anatop clock driver 13/18 clk: imx: add support for i.MX8MP anatop clock driver 14/18 clk: imx8mp: rename ccm_base to base Changes in v10: - Drop the v9 patches: 16/23 dt-bindings: clock: imx8m-clock: support spread spectrum clocking 17/23 clk: imx: pll14xx: support spread spectrum clock generation 17/23 clk: imx8mn: support spread spectrum clock generation 21/23 clk: imx8mp: support spread spectrum clock generation 23/23 clk: imx8mm: support spread spectrum clock generation Changes in v9: - Add 'Reviewed-by' tag of Peng Fan for imx8mn platform patches - Fix building warning raised by the kernel test robot for patch v8, 11/18 clk: imx: add support for i.MX8MN anatop clock driver - Add patches for imx8m{m,p} platforms: - 23/23 clk: imx8mm: support spread spectrum clock generation - 22/23 clk: imx: add support for i.MX8MM anatop clock driver - 21/23 clk: imx8mp: support spread spectrum clock generation - 20/23 clk: imx8mp: rename ccm_base to base - 19/23 clk: imx: add support for i.MX8MP anatop clock driver Changes in v8: - Drop the patches added in version 7: - 10/23 dt-bindings: clock: imx8m-clock: add phandle to the anatop - 11/23 arm64: dts: imx8mm: add phandle to anatop within CCM - 12/23 arm64: dts: imx8mn: add phandle to anatop within CCM - 13/23 arm64: dts: imx8mp: add phandle to anatop within CCM - 14/23 arm64: dts: imx8mq: add phandle to anatop within CCM Changes in v7: - Add and manage fsl,anatop property as phandle to the anatop node with the new patches: - 10/23 dt-bindings: clock: imx8m-clock: add phandle to the anatop - 11/23 arm64: dts: imx8mm: add phandle to anatop within CCM - 12/23 arm64: dts: imx8mn: add phandle to anatop within CCM - 13/23 arm64: dts: imx8mp: add phandle to anatop within CCM - 14/23 arm64: dts: imx8mq: add phandle to anatop within CCM Changes in v6: - Merge patches: 10/20 dt-bindings: clock: imx8mm: add binding definitions for anatop 11/20 dt-bindings: clock: imx8mn: add binding definitions for anatop 12/20 dt-bindings: clock: imx8mp: add binding definitions for anatop to 05/20 dt-bindings: clock: imx8m-anatop: define clocks/clock-names now renamed 05/18 dt-bindings: clock: imx8m-anatop: add oscillators and PLLs - Split the patch 15/20 dt-bindings-clock-imx8m-clock-support-spread-spectru.patch into 12/18 dt-bindings: clock: imx8m-clock: add PLLs 16/18 dt-bindings: clock: imx8m-clock: support spread spectrum clocking Changes in v5: - Fix compilation errors. - Separate driver code from dt-bindings Changes in v4: - Add dt-bindings for anatop - Add anatop driver - Drop fsl,ssc-clocks from spread spectrum dt-bindings Changes in v3: - Patches 1/8 has been added in version 3. The dt-bindings have been moved from fsl,imx8m-anatop.yaml to imx8m-clock.yaml. The anatop device (fsl,imx8m-anatop.yaml) is indeed more or less a syscon, so it represents a memory area accessible by ccm (imx8m-clock.yaml) to setup the PLLs. - Patches {3,5}/8 have been added in version 3. - Patches {4,6,8}/8 use ccm device node instead of the anatop one. Changes in v2: - Add "allOf:" and place it after "required:" block, like in the example schema. - Move the properties definition to the top-level. - Drop unit types as requested by the "make dt_binding_check" command. Dario Binacchi (19): dt-bindings: clock: imx8mm: add VIDEO_PLL clocks clk: imx8mm: rename video_pll1 to video_pll dt-bindings: clock: imx8mp: add VIDEO_PLL clocks clk: imx8mp: rename video_pll1 to video_pll dt-bindings: clock: imx8m-anatop: add oscillators and PLLs arm64: dts: imx8mm: add anatop clocks arm64: dts: imx8mn: add anatop clocks arm64: dts: imx8mp: add anatop clocks arm64: dts: imx8mq: add anatop clocks clk: imx: add hw API imx_anatop_get_clk_hw clk: imx: add support for i.MX8MM anatop clock driver clk: imx: add support for i.MX8MN anatop clock driver clk: imx: add support for i.MX8MP anatop clock driver clk: imx8mp: rename ccm_base to base arm64: dts: imx8mp-aristainetos3a-som-v1: don't replicate clk properties dt-bindings: clock: imx8m-clock: add PLLs arm64: dts: imx8mm: add PLLs to clock controller module (CCM) arm64: dts: imx8mn: add PLLs to clock controller module (CCM) arm64: dts: imx8mp: add PLLs to clock controller module (CCM) .../bindings/clock/fsl,imx8m-anatop.yaml | 53 +- .../bindings/clock/imx8m-clock.yaml | 27 +- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 11 +- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 11 +- .../imx8mp-aristainetos3a-som-v1.dtsi | 4 - arch/arm64/boot/dts/freescale/imx8mp.dtsi | 11 +- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 + drivers/clk/imx/Makefile | 6 +- drivers/clk/imx/clk-imx8mm-anatop.c | 287 ++++++++ drivers/clk/imx/clk-imx8mm.c | 262 ++++--- drivers/clk/imx/clk-imx8mn-anatop.c | 283 ++++++++ drivers/clk/imx/clk-imx8mn.c | 183 +++-- drivers/clk/imx/clk-imx8mp-anatop.c | 306 ++++++++ drivers/clk/imx/clk-imx8mp.c | 672 +++++++++--------- drivers/clk/imx/clk.c | 15 + drivers/clk/imx/clk.h | 2 + include/dt-bindings/clock/imx8mm-clock.h | 76 +- include/dt-bindings/clock/imx8mn-clock.h | 64 ++ include/dt-bindings/clock/imx8mp-clock.h | 80 ++- 19 files changed, 1740 insertions(+), 615 deletions(-) create mode 100644 drivers/clk/imx/clk-imx8mm-anatop.c create mode 100644 drivers/clk/imx/clk-imx8mn-anatop.c create mode 100644 drivers/clk/imx/clk-imx8mp-anatop.c