From patchwork Sat Sep 28 08:37:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3531 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B38F43FA6C for ; Sat, 28 Sep 2024 10:38:22 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5c87b5179d9sf1785329a12.1 for ; Sat, 28 Sep 2024 01:38:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727512702; cv=pass; d=google.com; s=arc-20240605; b=NsM/VttWKkfjg4LOvPcCKRkDR3ViDqjW4czlCtsHgWCr0GEuV2GO4ZnSosklkA3xlf h2SughXZVyehulpYIvwWF5XWIoLdhr+KHD/bTpqfhl1eaidwl0mdFbn6HOOyBdfF8xr5 ibhcU6p6aaQOvT4zX4TGBoOm3zvRhuzlIppA+L7QsYvg/0/H+HUObEwX3fqLVUmmRanC B8fv6GL/iB8fovxhDFrm+xGznig+SP/6FDAOJmjVED8QEX0PMfcNz5XRNfGpjOm+5UPy n2NrWGvNT/2y6tuadfQO6cKER4BUb1zvn4gxItihSpr1OgLKuZxQwktSY+AC0p+MzO1F FInQ== 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=zq7nlSstzM5H4fQVlpl3Vl51/f+q168W1Jhf+dpR4z8=; fh=+AM8R7onTTrtHbll0oBeI54qIjSFe5so3Mv+3y+90Pk=; b=RQiPUWkOfBZEQDCcn7zfcawACwXjX7DBTsXRRFpRSouDIEDWMskAlH0Ivbu6caYiQL 13fmSJnN0O5kIQU4W9hXTadNRJB8gmPHaNwXPEiNwBmBVI3jBYhnc8z+kG81zgzCH+RP tFyUL8hjrRRi8qgUcS2JzKMV9JEAUJroZdNwpqsDgrBT6hbaqd7BmBmVdSO74izKBMSo OgzvjXxE2Szm3D8IaQfcUy1wFDJQdThL2I7G21M3gtUouS/WLyGL2EshE5jwhFpKVm1M ef5d9qUkWDj0xVQ+c6ypzZzQWX3mT3MwCYsvt9aCqipCizawSRTDGKLQCb5pHo2yiqw1 wLGw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rRSPzJev; 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=1727512702; x=1728117502; 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=zq7nlSstzM5H4fQVlpl3Vl51/f+q168W1Jhf+dpR4z8=; b=qud/cILuaquxTUrD4xbj5k8xXcZG1p0S8op+9LoH72W2MO78u+K3M4q5a2/aEsRD+Q lFT4wtTXyPXZQfKT2M43iQWkv2iv3rzUVjphlf1CaCEKLVTOgHU8/9K+Vq1ETVvTi133 79oSrv/ckX8SPDpHhGsMhdOGZ6LzAn1B3pZrc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727512702; x=1728117502; 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=zq7nlSstzM5H4fQVlpl3Vl51/f+q168W1Jhf+dpR4z8=; b=ENe5MzstJGQWC9gjqeAw+FcuEEwOUCfH4MX1q/5rmMDuAtOzwMOoOP+Iik9YO18Jw2 xAXPwc4jzXtqVhm8mKFg/GMTlD2mOkqo5q7Zh/H0tOP0ercOEyZO53IuAcChJIGXfxah SWZES8DiBwefK6gcP6W0XYzcu/x5QBD9HNye6AVJ/zKmXNT1B116vEC6m7ltiQKCr8zA hvfJeNYx688+f85CtM2g99pXOm7lJFTcDWe/rWGuhDz0HNV2NaX52HSDCZx6BrixFGV9 h9NPVNxIr0u/n3uYZDrTMNBDaVyGj1a8Ze6N1hlTnrP3UAID49lxSMUf+4rpVZlll2Jj GJcA== X-Forwarded-Encrypted: i=2; AJvYcCXRkCClxq7P0rcC8Z53yU0XeQ6PmVtwzSzuE4ttzlxnZbnYclVVHBHo/6PEOuhE49CfYO3sHccD8HVV/n7L@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yy660Ig+Pa8oIJ0sqbw8fZOyyAqtri3bzKFPRBm7huWcjwY7Fqk SlmEyOVSfoNG8q8WXcmObKAZiI/nWAQEzNw1l+y4vqccRK0TmT+xf0pIBttDzJpteA== X-Google-Smtp-Source: AGHT+IFWu9p+BygKZqyWJBc5y6XDEIVFBtz3EBFqLW0jaYG4VqwQeT/jNrA7qX9RzEU/o+YZteMeuQ== X-Received: by 2002:a05:6402:5292:b0:5c2:439e:d6cb with SMTP id 4fb4d7f45d1cf-5c8824d3d87mr4597644a12.12.1727512702248; Sat, 28 Sep 2024 01:38:22 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:4307:b0:5c5:cdf0:178d with SMTP id 4fb4d7f45d1cf-5c8778191e3ls1625451a12.2.-pod-prod-06-eu; Sat, 28 Sep 2024 01:38:21 -0700 (PDT) X-Received: by 2002:a17:907:31c9:b0:a91:158f:6693 with SMTP id a640c23a62f3a-a93c48e8f15mr570043466b.9.1727512700872; Sat, 28 Sep 2024 01:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727512700; cv=none; d=google.com; s=arc-20240605; b=Iwl/S0RmY4pDeoniE2WqB3J0IluXeeUpjbggUXYkTIBC+W9tu299V2HcU4XRrbWaY1 LS/ysSsUS57OtS2tk0LdmcvP4YYGigLKzcFkYFN7Wj81lBOKY4wTRgfclNrRDGp3JpoB YYM086FyFTKhOH9uAfao5jf20691R2dYKN9As/bq0kmEPdD+4rEz9Y9CIXUy2uOxRngx rpte/POPDLsyDqxpFweamX7sdSpLde71Wf2rusi67h8+I9xKh0UStGP1FvrA90EPS3BH +7nQ0HPxbkoRZL6suJiseqjvZ0JkrTl8m4sSF1irTtT7eXIIEilvxaA2hUs2g2xTvxif ljMQ== 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=8yZI1Cll/jgswR1C/8/RE7gUqkNMAx5u3jKxacFOTcY=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=ARuXJcNBOhF/0mqnZS7cYGAh/pnEMQVd8PPP1hhVwUzta1FJjdnY5re/2kOndY8ekX 1QYeAqvz2T6U+iTx6KwkP6CX0F+jfobTYKChXPm3uLzXPD9RSaHI31Bw8VNFcZlWDnf2 kBX1H1by/lyZvSdXAdXDg3PCI4b2fWU+lDRc5GNhfVCmchIzthk6QSeTbGdM/KyupL51 u66cW4kvDJbXBRkAEgv+FjOBc4IS1xpBir4UKgnG2jdW4N5uVAzOXSVo30gKEgFHDzzr mBvGmzZXVsajSK84tMxTQp1dhPX1GWPW4isiCDk6A2EjfQjB+3ovO2ED7sq94D3lunps QIRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rRSPzJev; 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-a93db7ec284sor39147366b.3.2024.09.28.01.38.20 for (Google Transport Security); Sat, 28 Sep 2024 01:38:20 -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:3203:b0:a86:851e:3a2b with SMTP id a640c23a62f3a-a93c49299e7mr544249166b.29.1727512700295; Sat, 28 Sep 2024 01:38:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 01:38:20 -0700 (PDT) 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 4/6] clk: imx8mn: support spread spectrum clock generation Date: Sat, 28 Sep 2024 10:37:52 +0200 Message-ID: <20240928083804.1073942-5-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=rRSPzJev; 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 patch adds support for spread spectrum clock generation for the audio, video, and DRAM PLLs. Signed-off-by: Dario Binacchi --- drivers/clk/imx/clk-imx8mn.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index ab77e148e70c..b33590a9b7b7 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -321,6 +321,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 pll1443x_ssc; int ret; clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, @@ -356,10 +357,14 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", base + 0x84, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); hws[IMX8MN_SYS_PLL3_REF_SEL] = imx_clk_hw_mux("sys_pll3_ref_sel", base + 0x114, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MN_AUDIO_PLL1] = imx_clk_hw_pll14xx("audio_pll1", "audio_pll1_ref_sel", base, &imx_1443x_pll); - hws[IMX8MN_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", base + 0x14, &imx_1443x_pll); - hws[IMX8MN_VIDEO_PLL] = imx_clk_hw_pll14xx("video_pll", "video_pll_ref_sel", base + 0x28, &imx_1443x_pll); - hws[IMX8MN_DRAM_PLL] = imx_clk_hw_pll14xx("dram_pll", "dram_pll_ref_sel", base + 0x50, &imx_1443x_dram_pll); + imx_clk_pll14xx_get_ssc_conf(np, IMX8MN_AUDIO_PLL1, &pll1443x_ssc); + hws[IMX8MN_AUDIO_PLL1] = imx_clk_hw_pll14xx_ssc("audio_pll1", "audio_pll1_ref_sel", base, &imx_1443x_pll, &pll1443x_ssc); + imx_clk_pll14xx_get_ssc_conf(np, IMX8MN_AUDIO_PLL2, &pll1443x_ssc); + hws[IMX8MN_AUDIO_PLL2] = imx_clk_hw_pll14xx_ssc("audio_pll2", "audio_pll2_ref_sel", base + 0x14, &imx_1443x_pll, &pll1443x_ssc); + imx_clk_pll14xx_get_ssc_conf(np, IMX8MN_VIDEO_PLL, &pll1443x_ssc); + hws[IMX8MN_VIDEO_PLL] = imx_clk_hw_pll14xx_ssc("video_pll", "video_pll_ref_sel", base + 0x28, &imx_1443x_pll, &pll1443x_ssc); + imx_clk_pll14xx_get_ssc_conf(np, IMX8MN_DRAM_PLL, &pll1443x_ssc); + hws[IMX8MN_DRAM_PLL] = imx_clk_hw_pll14xx_ssc("dram_pll", "dram_pll_ref_sel", base + 0x50, &imx_1443x_dram_pll, &pll1443x_ssc); hws[IMX8MN_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", base + 0x64, &imx_1416x_pll); hws[IMX8MN_M7_ALT_PLL] = imx_clk_hw_pll14xx("m7_alt_pll", "m7_alt_pll_ref_sel", base + 0x74, &imx_1416x_pll); hws[IMX8MN_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", base + 0x84, &imx_1416x_pll);