From patchwork Sun Dec 22 17:04:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3720 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6546040CF6 for ; Sun, 22 Dec 2024 18:05:41 +0100 (CET) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5d3ff3c1b34sf4169788a12.1 for ; Sun, 22 Dec 2024 09:05:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1734887141; cv=pass; d=google.com; s=arc-20240605; b=VJQ+UjCttC8RRfcsLpqHyrjjmfHiPEXxBI0oxJEesXdUT3yqIpFAD53Y7P7MfbS9R6 niIhJTlj1P39gU2Ugm3Mgvp8TF16CROLbe/TLIBMd6svt+XW8TQmU3rGgHd+v+utu9D6 kmqJWPOwjFMWkC3Li1tO9AYbPFL0DLRcNyuLLyasw9CmeKBy83CTJHKkWdRUkzhA2dgi uUDSRCEuxhiBM55WvGkWTRzl8v/oeHVyDLsuQlvkXLOq2BWerqzj5Zf4tRgGmMOGzzPe z/sAtkWx2EotkqYf7YOOBPoJJZxTXir79bzX8fgSw1gVn6UpllhnWkW5pfeW/hIKjCjN boKA== 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=9j3tGoHOgXX2riQKRBio9UVxfsYpoZjmfyyEl6e3f2c=; fh=ohvGqI0Nl1kfhCOK2e3PXbDPZ+uc8bv/VSHU/4gzBkg=; b=Alu6/GfK9zyCxj4OGhcB3tivPboBWh3jvd9EyUETl3myLvw41xuRONDXtsc3SsH1oX spzy3rW8kZlIfSnRhrkNyUUy5u7nKO9x8sVowJiXmbYiZqHz2rV+T25obmB5cowucfbh AQSrRrrI0UEMWSOs37j9k0sLtcv/oNf55dmLpjBhsBY2QtrKlqITL1GAlzu1JYCHka10 MEnfXrT5Lc3McGiseYOl7GPzrHylg9R1Mh1pD+U7L8leN8cvm0h56Fm/xyNMRCQ82Ymq bskWgZvVQyehSb3fNW5SCttr2wyyQpzKRChBBtRMaL8Z+pNmDsdH8n5fSuHtfSH8aFno FQYw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d2dP+N1J; 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=1734887141; x=1735491941; 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=9j3tGoHOgXX2riQKRBio9UVxfsYpoZjmfyyEl6e3f2c=; b=EL+5OygwpOuTiL3ge4MfCo8N2k8IF8GzW6rI88Rd/gGGSte3apCF0raV554pSuSsV6 euwbIspM7CCZORUmG0Ikr7ZTcpcKJOMYYwV88y0/oUIZJNbz0RLBK54Hc101+OmwjfBQ H5P/fA4+pn/zZS7j5rpGHQTWSP9KOsV3/V01U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734887141; x=1735491941; 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=9j3tGoHOgXX2riQKRBio9UVxfsYpoZjmfyyEl6e3f2c=; b=E8O5Ds4BiwXC0W2f0lZZtDDAQ0VhUN40C0j3CizkkBAfG9GuG8ngXptASgGz9FF/3T 3D/rzaBAG+fBLmGPCkHrE3OYudDlcu63qnTQCTXKHvOrCgFWMXxH7IY39HhyQ/NgTQ3l B5lkp2g+bUBSDH9djJeoDrvP8RN0PTDiormDZNXvPtDBMB8QkH7K4yPliw9cMxqrnjPp bdRI51HL6sOej+WVgdMtia5ys71KLXEwECt+SyjHVchnZj/KHxBTIRfjMEivx6ZVq6of evdwpn614kJh731fyLxmopKvkhVS4bm4DcXM5yJuJlaxFHOMCRsAmg1JELV+ROD8lyP8 +hUA== X-Forwarded-Encrypted: i=2; AJvYcCVc64tOR3ITwenQp8xo9kjHJf7SDb2DFvvP1j14LoxN/VTx1G5UxJX6v+5eKT/DdA3qfROENhFfo5aCzuQD@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YzG5bzhL3F71aa3KoicDdp6/Ytyctv+AOlrl20nFSWPk5338CJk xNdJpbNwXvhO+0pMxdlUU3/VRA80qMWzO7nqcbVsy1jFkibDDl6G76OQxvijZ+KKQA== X-Google-Smtp-Source: AGHT+IG4OS7UKsETE551HTTLlvtRBut4SeHZdwfWFUS7kDJ3J3/ODU04TvhL34+qMH9QXkE1tjf7xg== X-Received: by 2002:a05:6402:2689:b0:5cf:b079:68ef with SMTP id 4fb4d7f45d1cf-5d81de1645dmr7798167a12.26.1734887140604; Sun, 22 Dec 2024 09:05:40 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a50:d648:0:b0:5d3:ea2f:696f with SMTP id 4fb4d7f45d1cf-5d83f6c1e0fls1124284a12.0.-pod-prod-01-eu; Sun, 22 Dec 2024 09:05:39 -0800 (PST) X-Received: by 2002:a17:907:3fa8:b0:aa6:66bc:8788 with SMTP id a640c23a62f3a-aac3355fec0mr962104466b.45.1734887138655; Sun, 22 Dec 2024 09:05:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734887138; cv=none; d=google.com; s=arc-20240605; b=CeNSqTWYqIOJdm5M1GZ22wvWooOub6yC68vwXoIT5oLUwy0JRYEJ45oNTAPd1urTBN 5svhrhIESMcl7dyA25isx6JqKGtmsmJ2gb2wxSGTs4j2xpM3Gp95VaQSlL6g3GZUwWt4 a2Jbbu3ZTkDR6i31Yd936yVHDFLiTCSAb1cRvruLDT3S+izJbIgRmQcPQIJYCwopxbQE b0BHFHrFRVMgND7EMaaQMqZWjXBquvAUAzeD60kgg2aBcEo6x4ui7jZ4B5DEwog9sdRV uHJ/3yzaPkiSBBC6i/n+64dw436EF5N8OO+twMudAI8QSOXLT1qP69xbGgvKppkJGUcH u4FA== 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=RhtmpZ+ZLYSsrqpu6pU/Lyj2nnsgcpK7OCWx/PXTdug=; fh=2TL5gdVAJyX/yhk5/AxHrADrCeVz/BiuKBD/sWsuHYo=; b=FLaWg5enW92tTduTxGohaDmq+6JYhhA0goGanQmc7gVB70DXTLEdxnCn2Hq+mXeLBJ zbC9DikvRzLq/ZFKfFeyNe1b7bucqIjFdhdFOXyxCKH8YFbIrZWuHtfzcZ/5RWJTg98X vJ5/y+uMxGFDAcTJH4KCs44gq4rFKXaczfj30E83fuGeA8Nhbb7vOefEBm6ipXD8/B40 7a9KLxQWamAzSku0SKFAKlaEaNMSTXL8Wr6ZLpkBkFgewwd4uLgKXm/gDlu/kNxYrJ5n +dZTqM1k75blu6a2tHqrrW0HQ9GwRqBUxB6HCU4th/IGHnVH6FgC83zMvMoCLqzlh8FM 1HwQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d2dP+N1J; 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-aac0eaea996sor300345066b.9.2024.12.22.09.05.38 for (Google Transport Security); Sun, 22 Dec 2024 09:05:38 -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: ASbGncvaN8cV9aC2ryekmGLhMi25qiRbz1La/dQRT0tKCRWyoywjmI3SCKywFxq3cs+ WbMRH4pnnJIqImrAo0FQNCrU/vR/RAU5POubpUemAThQz0xjJSi5H6WYlJ/dsbPSlkeD7wNAwH8 Rj0HPsE3sbwk5GUoAxZaKOrrU/6Q6bXVxyyoF3cR9lvRQt1gJ15iXjljQ0qeL7bB0K2LkHrQpy4 XaT5XoJyQbl8HPQsYNWLV5dpZoQqm48p3lhQ6UfuG8B0ODfbEYH//zQ7lKKrG1w6rr+91t/bwXO 971YIJK9fPFL29POlcnbpoIBy7JbEtvCacrTDp/D49DH6A== X-Received: by 2002:a17:907:1819:b0:aae:8308:532c with SMTP id a640c23a62f3a-aae830854dcmr621726066b.59.1734887137954; Sun, 22 Dec 2024 09:05:37 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.41.87]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0efe48d6sm414056566b.127.2024.12.22.09.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 09:05:37 -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 v6 00/18] Support spread spectrum clocking for i.MX8N PLLs Date: Sun, 22 Dec 2024 18:04:15 +0100 Message-ID: <20241222170534.3621453-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=d2dP+N1J; 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 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 imx8m_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 | 65 +++- 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 | 188 ++++++------ drivers/clk/imx/clk-imx8mp.c | 118 ++++---- drivers/clk/imx/clk-pll14xx.c | 134 +++++++++ drivers/clk/imx/clk.c | 28 ++ drivers/clk/imx/clk.h | 23 ++ 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, 1017 insertions(+), 234 deletions(-) create mode 100644 drivers/clk/imx/clk-imx8mn-anatop.c