From patchwork Sun Dec 29 14:49:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3765 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 436D73F174 for ; Sun, 29 Dec 2024 15:50:34 +0100 (CET) Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-5d09962822bsf996702a12.1 for ; Sun, 29 Dec 2024 06:50:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1735483834; cv=pass; d=google.com; s=arc-20240605; b=cKDSzClxB+gE+Kh1q8e6eojgDljEKpEyyLyc67NHpE9692zxsxG18nA5VZIR7oDG6O WfhKNN5UVdYPDfBbheCezH6sEBy+mwfL3nlllPJxIg8LzOJtDfBcelyQ4HPCO6sk/Krw NzMpLmJ+oJELHBbRK2me9L/zeYTVY/DRiPfPD3tzuVuWyktW4xyrrVm9b4fxhMfALCIV RFqaw2n+KJieVLn0YbXM641n7qV0DVNND5LO4O3scEty3KzinTQDonW9IS82xGdJ/C0e elHXR2wNtZ2ThipmtHuqT059lqRu8cyrFG0sl79kii7D+T/8RX/c4Z6BSUCGUxJHffy6 5T+A== 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=ClE+YiflDPLyQo35k6qedfgMyKnjbnsAiSahbrj2uHk=; fh=SH0pJukZ6RneVocomRgXLn7rU/tNS7jclCr9kvIvPHw=; b=cYoec7OY6qLeZtHK4Fa4eLNwb+3Gb1j9ty1Bzqo21+ZViiJXwLnLbexaLiNxHubV1U MbmN1GvPz5Kb5rLV7H+JUqo+r1GNUkrYAb3nhdH/hortkUOqZNENJPpuweXeVXADQ4MK cmjMdwBJ9+WaZbFqaJUvj4L7tESpKT1+c5ZziWkwqpQWo1hdj1n8ZRzUh77CEJfR4VFQ D4Iv0vAn7O6NJ7AdxGuLJ9ZhoBM3CCITluA3cYUOsDvrxX1reXBUHfcMjI6NJ8pZZ2Yt P6sphLUBQ+9CjC3SyfX3GzyFdR2froK+Rscm9CQOiywCepg8MeFrQjo8bbg8qElxORgT CaXQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Fqhz+eqS; 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=1735483834; x=1736088634; 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=ClE+YiflDPLyQo35k6qedfgMyKnjbnsAiSahbrj2uHk=; b=Bucr8jeecFH8MkYixr4r25uBCsOMVUhLhPzvguEqF8bEY4OUXwJCdb1uDa7YKFysGz YfrrvgiG+kK+y4+7ZDfTjVjZage+OBhgzfvj4+TPBOv1HKiZbjk269dImL0qdJoD91x4 6tptdaWx5oPJaT2QhkwFineGGrpiOw6sTMpqU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735483834; x=1736088634; 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=ClE+YiflDPLyQo35k6qedfgMyKnjbnsAiSahbrj2uHk=; b=MiYgiH05AuaVLj2Y8De80jtYldv70FztEcgj8IkGEVJZn0l+XwlNfaAHXgDH0a5MHm qi7A7wdI5xFJzVLH3pCnywzFuoJaCAbsXMz++9GuonIYQbdyMqTtnrJgynhEi47CoiI6 dt33cqCKT0tFh2oAzs8PIf+GAq7yO3XyVg/W5MygKomz+FiVRU0STAAUmGRDnRSUZOmo jJMjIbQ2CEXCB4kH2E6hZQUM0deZMN+3n8zdvGT1zvcTGAhE2mcya9g2MZIr5TIxXdja wi+d/v7RiVx/WaevbGah+pc1w8nt7/U6KHXt/PZk0y/Jj9EkZunD3ijOfVp2ua4rDA3b /vXQ== X-Forwarded-Encrypted: i=2; AJvYcCUUizE8YGZZTP21q4wbUg+ZjZoE+i5LVibjdo63TGMChZPVlcKBiabkqRuGP4x836fRHzpwaFzeGUp+hWw5@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yx6aXELVCs239pAv0NXTNKOrN7BRF1gSK10NDZolnlctfsJffI2 Tj+h82vXNrKXvZx0E+SozfozQFD33yVCVQWlnQbhmLDgaNZbTLedQWdPFUswjGCZNg== X-Google-Smtp-Source: AGHT+IGV0TC/U08BFTrXcz9yof308q3Uxy1/370jpUzHRlVmvMzNOzndnt7mZFNAk4cmu+mWX6qw9w== X-Received: by 2002:a05:6402:3228:b0:5d0:d330:c965 with SMTP id 4fb4d7f45d1cf-5d81dc6575bmr30499253a12.0.1735483833575; Sun, 29 Dec 2024 06:50:33 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a50:bb0d:0:b0:5d3:cdb1:60a with SMTP id 4fb4d7f45d1cf-5d88364fe0als190881a12.2.-pod-prod-06-eu; Sun, 29 Dec 2024 06:50:32 -0800 (PST) X-Received: by 2002:a17:907:9801:b0:aa6:7354:e926 with SMTP id a640c23a62f3a-aac2d4686f8mr2610170766b.36.1735483831729; Sun, 29 Dec 2024 06:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735483831; cv=none; d=google.com; s=arc-20240605; b=XDBuKpCS70YrbSjyC05Q7nRcMAZkL9pQoURKuBJ4UnpcayYhZXszgC+yq5cNnsh9JM AHEYdElny+K1I8bKNK94jTUiBdDIPKeHwyH9J1/zyBrKjSUI7t/uilbsMkSfQjeOznZI e65PXkUjMm7qJFAQ2t6uq8XTCPdj2aMXL42bHG/9Nr1jfDXy09jFG8n/Y7B51Qpg/Fey s930c614+8xL3IFZ5/KtMdL9Kmr0nQmxpqSh9y7T1HLsl2jhVtVac1IoFKa+ARvqE9aD vMxnB++QR782RKGs+X/YqzG697E8r0FevKaoWfj03560aCY/1v1HbxTT4XXwKirho37J 0GOQ== 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=F6+f7jMoIATRyOE70ikq3cyEvYNf4urCVh8EzVTjWJY=; fh=2TL5gdVAJyX/yhk5/AxHrADrCeVz/BiuKBD/sWsuHYo=; b=UrUEb+nbEKTgdDkqA6cb6m+axmNgQGQtzUDl1UG70ATLcSd0LYEMRf5fhrKynKXd9Z cbu4rqV1+dnxRoVhRiy8R/YQAYld4cGpKaSRoKFIa9toFrP7imGYGFZ8hiHirOFQNuWs HHh9zBtlT88wfgpAMDTH4lxoHeiu7nKyxEqbKwMnmeSSZD9v3d2dK56BGns2pOOCazZe DZ+ZvdgrmVTc2k0idsVrHsHzQlOuC9fFuU7z5+y9R1k6mHe/ubcyRWiULJOMo00iyM4W Zlz2Lj0oMSPD9Bo/FcAeLt1GkKi3zVfzAzQJM3E3bSVYJ0V7KNn3f4COc6BKv225cXG3 ml4A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Fqhz+eqS; 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-aac0e83ed8fsor730000566b.6.2024.12.29.06.50.31 for (Google Transport Security); Sun, 29 Dec 2024 06:50:31 -0800 (PST) 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-Gm-Gg: ASbGncvxq4JFX+DHHn7dE1KgL/96CMPVGZ9vjg2qauZQAXFZVu4Q8+8NG40bGwM8sfU ouL5izrv+D9t425Lm+Savl688fw04MTV5gEEo5e1Q7x5do4/ds74Ng0S5KLgl15TDlhp8grhRSa 5VM6S5VDISM0annyC1Por+kvwuvpMzfQzmuR88d2LFqZXrJFK9LFzvFJyuj1LuvaiFktTDvmOlG N/tuaQlS6EJ/VZFteMH24QbnQ8JrK1f+vOLGLvUJ1DKjcxnBbkWJy3J7pa+idbSCyolVm7ifqDd qJZ+LXbkrZNxfH3I7pkFLg== X-Received: by 2002:a17:907:1c14:b0:aa6:a228:afaf with SMTP id a640c23a62f3a-aac3378d0b4mr2559257666b.52.1735483831243; Sun, 29 Dec 2024 06:50:31 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.. ([2.196.43.175]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895080sm1362084466b.47.2024.12.29.06.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Dec 2024 06:50:30 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Abel Vesa , Conor Dooley , Fabio Estevam , Krzysztof Kozlowski , Michael Turquette , Peng Fan , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , Stephen Boyd , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH v8 00/18] Support spread spectrum clocking for i.MX8N PLLs Date: Sun, 29 Dec 2024 15:49:24 +0100 Message-ID: <20241229145027.3984542-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=Fqhz+eqS; 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: , The series adds support for spread spectrum clocking for i.MX8MN PLLs (audio, video and DRAM). It has been tested for the video PLL on a board using i.MX8MN. The patches added in version 4, such as the dt-bindings and the driver for anatop, were inspired by the extensive email exchange from version 3: https://lore.kernel.org/imx/20241106090549.3684963-1-dario.binacchi@amarulasolutions.com/ The series added spectrum spread support for the imx8mn platform only, but in case it was merged, confirming that the directives and suggestions made by the maintainers were correctly understood and implemented, I will extend this support to the imx8mm and imx8mp platforms as well. 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 (18): 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.MX8MN anatop clock driver 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) dt-bindings: clock: imx8m-clock: support spread spectrum clocking clk: imx: pll14xx: support spread spectrum clock generation clk: imx8mn: support spread spectrum clock generation .../bindings/clock/fsl,imx8m-anatop.yaml | 53 +++- .../bindings/clock/imx8m-clock.yaml | 74 ++++- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 11 +- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 11 +- arch/arm64/boot/dts/freescale/imx8mp.dtsi | 11 +- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 + drivers/clk/imx/Makefile | 2 +- drivers/clk/imx/clk-imx8mm.c | 102 +++---- drivers/clk/imx/clk-imx8mn-anatop.c | 283 ++++++++++++++++++ drivers/clk/imx/clk-imx8mn.c | 196 ++++++------ drivers/clk/imx/clk-imx8mp.c | 118 ++++---- drivers/clk/imx/clk-pll14xx.c | 134 +++++++++ drivers/clk/imx/clk.c | 15 + drivers/clk/imx/clk.h | 18 ++ include/dt-bindings/clock/imx8mm-clock.h | 76 ++++- include/dt-bindings/clock/imx8mn-clock.h | 64 ++++ include/dt-bindings/clock/imx8mp-clock.h | 80 ++++- 17 files changed, 1015 insertions(+), 235 deletions(-) create mode 100644 drivers/clk/imx/clk-imx8mn-anatop.c