From patchwork Sun Dec 1 17:46:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3689 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 AFCE83F033 for ; Sun, 1 Dec 2024 18:47:56 +0100 (CET) Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-5d0ae45646esf2352862a12.1 for ; Sun, 01 Dec 2024 09:47:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1733075276; cv=pass; d=google.com; s=arc-20240605; b=XyNRG8vKPdTtl/NVKGPAD+P4BAj1K3MGhlVxsjG+UMLXABd3diJ2wgbC04KJyLRi+v NwPV87Rxip1+PbFTv2tGeUIlY1MKTzeFki4F9s28QRhNvtlRWY+q9K8TK8Q9zdCUChyz b0WvZPqG1/aVoeWs+Bx+MDT+Pf08UVU+K+n1KkEjdVmwQoPzH+l87j1gx4h/44XDDIzx bcyh93CyL3MwfZyz94RfCMDvCvyiRJJ/23lepSVxSMS0WyymAhJCuRb7cep2w1FxB49s YRbUaFHtlWD0dCzoGdeBrmsQpp+ohNrPVcO7Wd5c9LeLNw8Nfxech9jVevvbkYZqDWrd Cr8w== 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=BDnQIvzq+KrpyPcTIII98xFUV6PS9JDARLEfi4BNiio=; fh=oNEk2guzQBVEdi4mrNK6xXhzPkafn6eW1x2dGPQ842U=; b=PwC2bopsZUHy6tWQHrkBa/KiP90SZvYPW0Uj/Ig7Cp7ioffH3BuNo967XNumXFDIns GQwzKlO+5+fhRK6VOvG9vLhgpQjKjoS5XRdeFDBbKNuqoYr2gOE4q0DSsBCX7HQbnmRk Fb/XPfGqYF1DajdbKGvlSDifKJsIqKaDb+4Lg9CV0LunGHwfzSA+pjk3athmC5L4zKV7 oQM/KBjsQzBL0WaYXoMxZBBuRJMpAGL1qcSF3/D/0g2w13eD+NYql7Kvcu96B68iWCuj Le0+b4pnCBWqRDjBvERCRQD3tEVN+JVxgSDgT+jc2vITXzjt4wuWGYcVxYZTKhPuvAhA w73A==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WtjWXL9H; 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=1733075276; x=1733680076; 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=BDnQIvzq+KrpyPcTIII98xFUV6PS9JDARLEfi4BNiio=; b=WcB0UYkDrc7JnUYG1v+Lha/1zXnNJihjFq7Ztnxoa5CM+gFQqxD0H5SqLaOajUi3Q6 Pi+rHPZbzhpfUxRLUe9B1TwjyxSGnnOvCnZJaSQ33ScGDMAf2Kizpjgz4FryODSPC9e+ ZBrpQPqd3Wy7VRkVVYNiZAwpi2JvcGJtHFY40= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733075276; x=1733680076; 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=BDnQIvzq+KrpyPcTIII98xFUV6PS9JDARLEfi4BNiio=; b=t5B5Qyf9rxzERt3LLm1TniOQ0IV95KLUU2Ybq1IeMnuYpoS8W1ortVnT9pH//+QElW wknxzcdQgmvH1gbY0Ae26GSP4+9FGuuUBOmHmSWQT2k6h59Eu+Q9KVyx/0EPNcgqJl0x /mU7lSDBV4eqteef0FvP2Kc4ANpSWlsms37SSuqR5IIy90whi05mBa3A7wytktjeyY03 Af0esY9SWRzcmYPKsC7PzDl0fAIXxoeHcF1PcaPrEP2ha8+0X0okcpamQD4tMa1om1RZ 92jnfDVq3k8HTLM58p0J3FZ2SYgsXHOkS+y1LaO4ENWQNvpbME5vb2gy3A++nRwl5dN/ TQxQ== X-Forwarded-Encrypted: i=2; AJvYcCXE9LlFzKU6ciZ70De9i4CfDwzO8eMXdMv2ZZDKC47DCR8jys0TTGyfbSWC06n+pm+96OmmhhtN41P+3N34@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwvDG52g+EtYEWxkQZTyBJe/7goJ6nSCkzWWz11If5qyCTDhJ2a s3iGIRkYfk4lDW+3FAH3SbVLXH7Qhi7wGYODeH5MxrkBi5BPp4T3rY/qfFAukFpvXQ== X-Google-Smtp-Source: AGHT+IFjm6z1uJB5Dxpl+4j34Pc34VNbk/2C5FwvWKPj4VGmUeyRGIFKKHyMQkwICxobwaLTDdf0CQ== X-Received: by 2002:a05:6402:321f:b0:5d0:d2b1:6831 with SMTP id 4fb4d7f45d1cf-5d0d2b16da4mr5396160a12.14.1733075276407; Sun, 01 Dec 2024 09:47:56 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:5c2:b0:5d0:9595:fd41 with SMTP id 4fb4d7f45d1cf-5d09595fda4ls777981a12.2.-pod-prod-00-eu; Sun, 01 Dec 2024 09:47:55 -0800 (PST) X-Received: by 2002:a17:906:1bb2:b0:aa5:c9c:31c5 with SMTP id a640c23a62f3a-aa5945f54ccmr1738892166b.17.1733075274664; Sun, 01 Dec 2024 09:47:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733075274; cv=none; d=google.com; s=arc-20240605; b=eJuNoI16Fo1sJS822TLJmWDWHdbZb6sGVAoNodKOLGWbFI0Q14WGt43iW83VObnUMa V+ojRyLpwFsMgITnX7Q60oCITPcj4ypebtQpOz8PX7W7FH4Ht8n2Wmp8SGQyHG+r2y9n OZ6v5G3UEcgtnCof4K+tuS6mVnKQ7HCL55ESz6lMB3k0u9lMxcF5p8UvH49NVjVI7tS+ hIJpImqulepmGN0Dvbo5ha3V16sHS5l1vBq2e3GhTJAAXYrVP5GrCIWNPxS7KfgybF54 5QAXQH/MWOL6iN1kFEKhjTTpG6+TCHp7sftTkUuaCt0ja1h1rwACI9QEz+xuFSNPoS3e ae8g== 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=N9yTySfaJQhr7Fo3SgjYPb/w7zlE9/XQ3JsIQbT3gRE=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=eI4ikCH5pX1oJR9bBaOp3EAc+62Rn6cf+Uuig77deHVMDJWrfr3r9yYu0ciOEixPVc WoFfZvkOYK5qln71obevSsD9Km7Nt8rOn2cnBGpIdnknVLP9q+C7rI/+CLVEvF09CqBt XdflDkdx8ef3hNOElKk/rmrn4cExiFmdvw2x1US2il7WsmD/0yLzTunu+mKM3D7PXoMU v973xlOjCWByJlo7/ez1DM8UyFx40vXIu6faJJBqQqW3CUSB3lbD08xN/9TPgqOzujqQ s9F5wSk7tydPn3+rSyyZTs4tHLC2a+JWjKFLybcjaCX99vp49grV1z0i9q4ZEK1R9l7E 6/jQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WtjWXL9H; 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-aa58369371dsor321179466b.0.2024.12.01.09.47.54 for (Google Transport Security); Sun, 01 Dec 2024 09:47:54 -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: ASbGncuocHvV3PtshuLj1nIvclsLqGFwB59vUY5eJQja5jgNqneGp2fuk/TgysTF6vT EfGJMEyri/+jWuKqFbf+U+ZFAXKXbjaRljPwEeZN5CZPY4sYOm1AaA6RZxERWKCYVppqrng7HwH 3RANMhy7izU8sg/u27Tx9jb6ahVllndRKeV3dJbYd3CzlfsRovPj3sTT3/1NOLRgiNMULTUXrEw bKNNhwclYl7VtCE9JqaOUgInz7yTXujtxZQ0xMoCGOjq7ItaO8sn7k6VFMT4ZMVLd9OmDzNCBKf V0Aag324RKyd+64I6eToA7sTz04WMb+m7Q11XxROe0v/E5IyEA4I0sJSCtodGijZgF7HrZl9Ysi lDMAbaCxsCkGr2TV/ X-Received: by 2002:a17:907:3683:b0:aa5:500f:56b3 with SMTP id a640c23a62f3a-aa5945ea088mr1602165966b.18.1733075274323; Sun, 01 Dec 2024 09:47:54 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-82-54-94-193.retail.telecomitalia.it. [82.54.94.193]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa59990a78esm415220066b.163.2024.12.01.09.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Dec 2024 09:47:53 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Abel Vesa , Fabio Estevam , Michael Turquette , Peng Fan , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Stephen Boyd , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH v4 18/18] clk: imx8mn: support spread spectrum clock generation Date: Sun, 1 Dec 2024 18:46:18 +0100 Message-ID: <20241201174639.742000-19-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241201174639.742000-1-dario.binacchi@amarulasolutions.com> References: <20241201174639.742000-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=WtjWXL9H; 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: , Add support for spread spectrum clock generation for the audio, video, and DRAM PLLs. Signed-off-by: Dario Binacchi --- (no changes since v1) drivers/clk/imx/clk-imx8mn.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index 588cebce6c9d..c61368e724f7 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -306,6 +306,7 @@ 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 ssc_conf; int ret; base = devm_platform_ioremap_resource(pdev, 0); @@ -338,9 +339,21 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_SYS_PLL3_REF_SEL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_SYS_PLL3_REF_SEL); hws[IMX8MN_AUDIO_PLL1] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_AUDIO_PLL1); + if (!imx_clk_pll14xx_ssc_parse_dt(np, "audio_pll1", &ssc_conf)) + imx_clk_pll14xx_enable_ssc(hws[IMX8MN_AUDIO_PLL1], &ssc_conf); + hws[IMX8MN_AUDIO_PLL2] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_AUDIO_PLL2); + if (!imx_clk_pll14xx_ssc_parse_dt(np, "audio_pll2", &ssc_conf)) + imx_clk_pll14xx_enable_ssc(hws[IMX8MN_AUDIO_PLL2], &ssc_conf); + hws[IMX8MN_VIDEO_PLL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_VIDEO_PLL); + if (!imx_clk_pll14xx_ssc_parse_dt(np, "video_pll", &ssc_conf)) + imx_clk_pll14xx_enable_ssc(hws[IMX8MN_VIDEO_PLL], &ssc_conf); + hws[IMX8MN_DRAM_PLL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_DRAM_PLL); + if (!imx_clk_pll14xx_ssc_parse_dt(np, "dram_pll", &ssc_conf)) + imx_clk_pll14xx_enable_ssc(hws[IMX8MN_DRAM_PLL], &ssc_conf); + hws[IMX8MN_GPU_PLL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_GPU_PLL); hws[IMX8MN_M7_ALT_PLL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_M7_ALT_PLL); hws[IMX8MN_ARM_PLL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_ARM_PLL);