From patchwork Wed Nov 6 08:58:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3627 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B1F0F3F14C for ; Wed, 6 Nov 2024 10:06:19 +0100 (CET) Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-539fe4e75c4sf5428518e87.0 for ; Wed, 06 Nov 2024 01:06:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730883979; cv=pass; d=google.com; s=arc-20240605; b=H9zOf7HM/6dw4Tq6GAlwpMf6Tmw/Mm8okMCO4wQmfQZklnSV6ra5KeLm2JMorrmj8V 9ChlrHj/GoalXxeTcY6x01XeQ9u71CW/VwOb0Jc33h3Vc7rebUaQSL0RuMh7mAQzBwxH rBuxD7Ya9ZjAgT5utLcCneX5UWrrS9Xap0y84ZlbMLdNbvj9J55kmz1rzVIj30MQ/7zH orfAZ7jVhx8Ppc1uYRJdMAu+9vUl55J5fMdkLYJoC+GNBPZ2jXzUTEeQ+N7hh+zSwulI RIfc80og4b95OEPgbArFyFiSeFFqeDiRA8XZcKbGUEsSDNSSMBHsHChae1V3+5g88eqg UimQ== 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=BOD1An72YMXvMJfKl41oc3Awhw/ATEyhAcR3Iz3d9Q8=; fh=cVo4+EljbcC1W02WDTAytOr8R37yrPcdnODvERO72F4=; b=BCf/z7tmY0PM+T5GN3yt7Fisatb2BnossFQE8oIMxJx7IsYbBbgL6vDdH9Uc/AZQ+t CWEwCm4NmN29m+K4Qm61NiuJRgcON4pbVgEd31cwpyYasjE58AdCRe0bRAslmn17i8+V 0DiT3WM5Ay116vqUzL8tK9NAP7RldvYmqLs0xOpDPpuB4CkGk4pNw68B0K7/8cwOWHop 0FbIEKzap3j0md3udN3dVZqK5c3irIVgmuCMP/X8SiXEr3xEdiaQR2qPWWOYZ8xWzGa/ Y+vdXRsiCApw+TN4afcNb2cJCxqwCc8ynlWeQNrsXvsxy+D8z7EOkSqDJvX0W4dAfgIQ rmTA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Vgdcho3L; 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=1730883979; x=1731488779; 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=BOD1An72YMXvMJfKl41oc3Awhw/ATEyhAcR3Iz3d9Q8=; b=XRSBMx58XGeBot51XSxc+v7/LXPqdYy67R6L3z5BjFRjJYpsuwr5xwNlADvN0g0Rvq zQRbR/H3rb3H83j7SzsJymliwfUuuwhElyT/lAomSbzcWVDEuEEDvI6qRXHdi22wrLtK ZBo7KLA44zCYTwy6BxqN03bGXa/0qNhWAvCJk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730883979; x=1731488779; 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=BOD1An72YMXvMJfKl41oc3Awhw/ATEyhAcR3Iz3d9Q8=; b=w8PacDFviuQaS45cxSLENWlWbsibCUDNVMJ4ov+1b3OeY0kyw/arhkJeewnkYyKo/u zJWXRd2FR/t+ENewHvUbKWYvkhWzLam/Xg0qoy7VOP0RBELb5Isr3AlHq9FO/t01nu4C ImLmKktpLM7Y5gTE6LL/0hXmCWLy+JimiPW5N2muQVKGM7X2ULguICfcTDPArPIpFif+ zG+5smV3VuVEC72WXU1SeWD0uBY3dM+qQLGTwCLzCtSZinSfWz+9UvH+XZznNnLip3tN TyN32UkgHGjyUujdynI+57G6ZYb/BevU1VfURuoxalVsPrKbwqx6artgOjS25sb77fQk A4eA== X-Forwarded-Encrypted: i=2; AJvYcCXx2JC08A5Y7xPWiUf1ytVOsZZsl9pFvV+xqGut8Nse29CWkcQt2l9CrIF4d6lavdULI9z6glkUurU5DqxT@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwOV8Lu42WlN7GV2VhTNTxgAhJ9oNinRYs1df/h5JGyHoIbRsrd VJhW3M8UI6i4KJEmNzde+qhXo6YuhVVNQ2t8wDtMdLfQWxEcEOqaXdnqE4Pg88ksiiEDNtrU1g= = X-Google-Smtp-Source: AGHT+IFhVWhg/usj1J3LjMyiC6IKOM0LuGlEAQRIXwo26b/S4FXWbvwPpT+3i0NtN6YHkMU5w7b8MQ== X-Received: by 2002:ac2:4c54:0:b0:530:b773:b4ce with SMTP id 2adb3069b0e04-53d65df25d9mr15459068e87.33.1730883979008; Wed, 06 Nov 2024 01:06:19 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:ea8:b0:53c:75d1:4f2c with SMTP id 2adb3069b0e04-53c794ff769ls16256e87.1.-pod-prod-05-eu; Wed, 06 Nov 2024 01:06:17 -0800 (PST) X-Received: by 2002:a05:6512:ba0:b0:53c:74a7:43de with SMTP id 2adb3069b0e04-53d65df2488mr14394420e87.29.1730883977011; Wed, 06 Nov 2024 01:06:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730883976; cv=none; d=google.com; s=arc-20240605; b=X8j9YbeVeg/iordQeOIJufR+I/cdiKs7ayL7QR+YIp8KCR/bRuBlMBgNdFFFc+5mus Lfd2lATNQlTWRMOk681oR1iQQ1wOWjhKK5rCjlIqbpr3bmcWIUvJGgzGvtDU6dVxi8na 3wdUyRIT8d3T6ehDRLf13VGZ27mKQteGf3D0vDtCq34CbupiwCajWoVj74jcQLI0udsS KeCcOLgW80lPc42TSoIcPLz06yLssm6I1lDaBrFvHuQnVdOdtl2pdTEg0/H/heCqAq6U dLWnL+83HcSfJ4PioX7XDTneBXkUcPgqgDE5vsG36oodvjXNC92YEcwtc8i94NCe0WlY M9cw== 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=Hk3reyPLNpPW1T5hBq9gLHNsgFGFKl4S7Oe3HhKsMOw=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=QQyHGuJoeDa4jSN72Gn5pIMackTdUJu99dysq2+I1Z85F+HX6snWLq0NufeX2dCVAy FMIoJCqxMpk2PaqWb7YGB6zdcCYhjfuwm6x60qyzJKX2nhh6EYxyM7/mOhg2l6bh9F1Q 8b1QG1qbe3zL18Yd5r9E1jSkNU0InTQGgdqq1WjeZ1mzjjbKGpiYaxZBvasC6y0VvRl8 Ef7oIn2WrmQh4qiTURBDRcxLyZEy9TONIkByHj1fu20TlOkgtxGiPowKNukG9/+A48q4 4jKdp2LJnho+VHbKbdBmsi31x7SZl52Z70Ap7rDw6QZ6Y2HIJmhdgZ8PopUJ434xT5Tu PB8g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Vgdcho3L; 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 2adb3069b0e04-53c7bcce9absor4477828e87.21.2024.11.06.01.06.16 for (Google Transport Security); Wed, 06 Nov 2024 01:06:16 -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-Received: by 2002:a05:6512:159c:b0:539:8f3c:4586 with SMTP id 2adb3069b0e04-53d65e16881mr13255338e87.55.1730883976448; Wed, 06 Nov 2024 01:06:16 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6474:ebbf:afb5:f524:6416:8e3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9eb17f9422sm247781366b.139.2024.11.06.01.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:06:16 -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 v3 6/8] clk: imx8mn: support spread spectrum clock generation Date: Wed, 6 Nov 2024 09:58:02 +0100 Message-ID: <20241106090549.3684963-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241106090549.3684963-1-dario.binacchi@amarulasolutions.com> References: <20241106090549.3684963-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=Vgdcho3L; 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 --- Changes in v3: - Use ccm node device drivers/clk/imx/clk-imx8mn.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index feefc9ef4f51..91b819d1c523 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -322,6 +322,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; struct device_node *anatop_np; void __iomem *base, *anatop_base; + struct imx_pll14xx_ssc pll1443x_ssc; int ret; clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, @@ -357,13 +358,18 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", anatop_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", anatop_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", anatop_base, &imx_1443x_pll); - hws[IMX8MN_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", anatop_base + 0x14, &imx_1443x_pll); - hws[IMX8MN_VIDEO_PLL] = imx_clk_hw_pll14xx("video_pll", "video_pll_ref_sel", anatop_base + 0x28, &imx_1443x_pll); - hws[IMX8MN_DRAM_PLL] = imx_clk_hw_pll14xx("dram_pll", "dram_pll_ref_sel", anatop_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", anatop_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", anatop_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", anatop_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", anatop_base + 0x50, &imx_1443x_dram_pll, &pll1443x_ssc); hws[IMX8MN_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", anatop_base + 0x64, &imx_1416x_pll); hws[IMX8MN_M7_ALT_PLL] = imx_clk_hw_pll14xx("m7_alt_pll", "m7_alt_pll_ref_sel", anatop_base + 0x74, &imx_1416x_pll); hws[IMX8MN_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", anatop_base + 0x84, &imx_1416x_pll); + hws[IMX8MN_SYS_PLL1] = imx_clk_hw_fixed("sys_pll1", 800000000); hws[IMX8MN_SYS_PLL2] = imx_clk_hw_fixed("sys_pll2", 1000000000); hws[IMX8MN_SYS_PLL3] = imx_clk_hw_pll14xx("sys_pll3", "sys_pll3_ref_sel", anatop_base + 0x114, &imx_1416x_pll);