From patchwork Sun Sep 29 17:27:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3540 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 5680B3FA1A for ; Sun, 29 Sep 2024 19:27:55 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5c88e8d0a69sf993273a12.0 for ; Sun, 29 Sep 2024 10:27:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727630875; cv=pass; d=google.com; s=arc-20240605; b=GZ+hbvgBczeb0UxIo0QPQqBczIvDcs60XDh5h3qAcXRtKVpFjNGM4XAjzpFsVsTd5d aO+tUCgR99OoHmQ3nCdXtsSwlaLN39cT0wiC0vC8veiGQfQfltqgrkg9cOqtbECoXFUh Alm22o9p4FNAUfTW4OylWwASq3KHiVEvWP+N52peRaCAZP9ZtXOlBzuLCdtfMp5ENzkb +cM7W0Nd9zZj0mR9aSJZ633VTcKrSK3Fej7kWFZ7qkhtGyfxSVpwqIGH6x+WvO31iu3h frodRfjIKXVEC3As5MJ1x4wLvFPJPlXvs5Ra5iNCf6RxhxBlsXg4xjuOKpgstUW6uSCI S2Bw== 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=Sk8HHWFKWLhI3/uk7zGgvu/nJPUkx9Xs9+YnkSnTtOQ=; fh=gpyDpVGV82DUZIoLeADkUGHm/gh5BRC1JDDnmbUydPk=; b=EMEtnX0GcwU7gV0TJ5fjcAtbcLvs+v1BsK4fbXVkTColDPJ6fVrpJ+sei3qjcm9184 FPETLznM+rVMCv3cGELzR4TAgGVzYxidSzn1WN0J1K93pAqAXPPtIyoWkajAiFYmoIjp kdCZcGKS5E9sfFJu0CSawd5TY/tUM+HidcHtCQ96QcebzNCA0TipCEcuMzRFMG6ydP42 EKq7mf3mmGLj2IEBTUxuUVykD8jVUOuJbZT1Uyueg5xVyOhfKxXFQqpefjvPtQmuQ62g nwkKwHbgsT/yIjhRRYonARdFifrCge8ZW8vjWHLHwAzEA27QixBxTPrSrJ9aF9aZ6QiQ iIVw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MKOzp2M9; 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=1727630875; x=1728235675; 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=Sk8HHWFKWLhI3/uk7zGgvu/nJPUkx9Xs9+YnkSnTtOQ=; b=GFUx9H8frDAxH+fhEDlKgggIVz7iEV4uDwPcBUecuGXjRHBVxjTVBTU4eeYxc1dmnM pYmifgB6hscsTVpd/QDGoBdZTBJem88o2M+U5OZeYv9RJGp7oaWXV8bI2Nfh1qcBoCWe IEoXlQfVF2e0Xeiv1IdQTFVZHf43Lm/ygPrB4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727630875; x=1728235675; 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=Sk8HHWFKWLhI3/uk7zGgvu/nJPUkx9Xs9+YnkSnTtOQ=; b=fR1njke5MKQ+boJzD3a2VD5OKTJ87Pbu1JQqveG8IsSmUOZGrHwfAa2LfIAu199nTO WssuEglDoMPD6M5ZxcauVhu6kYIGnp+j+9SJCPkmVdnXp6dnvRuLW2KVtOcPK74cIpn2 o5s9s5xfP8VvoJXXhJWODy6n9j3wbJsOz2pzd1ft4Of9RCEaLsqsaU6wgcyNk2Y00OcQ Dvx5vYvwu1Qd/jBP0zAUJ6mIPeA6aAon3cqy/ZA66x2ii6by8dyHkZ/kcPe7qfkgJxpx YkG+n6YNSfktlItWrJIZTBvZDl0983LLMpsX84Cze3UxziaVtkFpK7uJgjqRVHtaF6FV 837w== X-Forwarded-Encrypted: i=2; AJvYcCUnIzC89xlMzOAKQPRRcQGLnrLDO0IGPz8V3/FcxSeiqcb6YFy8RG87jMfJSFrxi1Jq0Ih32SM6aOD7xgcU@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyjxgTpBcRtq8HFqWgf0eEqZB9g66H/tVAUhk4AGeJcDM4EkaOm mwwxLVQ+EmYg3QNglzrXjfRCEsXzn/3CGgJ2sxvoAFyF+vbA+gVzzmB7Go1C04wOhA== X-Google-Smtp-Source: AGHT+IHdLfZacb6juVSWSAhdhggZG1HxsTsLT4uvwUTizfUC6MewP7jPvG9tn2zAwj/mox6jFR23LQ== X-Received: by 2002:a05:6402:1e93:b0:5c5:cb7f:e56a with SMTP id 4fb4d7f45d1cf-5c8777af668mr14901644a12.1.1727630874891; Sun, 29 Sep 2024 10:27:54 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:51c9:b0:5c4:651d:a541 with SMTP id 4fb4d7f45d1cf-5c877764409ls1414566a12.0.-pod-prod-00-eu; Sun, 29 Sep 2024 10:27:53 -0700 (PDT) X-Received: by 2002:a17:907:3e1c:b0:a6f:996f:23ea with SMTP id a640c23a62f3a-a93c30f0cccmr1021662766b.15.1727630873254; Sun, 29 Sep 2024 10:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727630873; cv=none; d=google.com; s=arc-20160816; b=SWwC/jpIY1Y2yXM7FtdzGrNDkC8yY+6r4pDw2kwhbFGwkdA+F9fLQC5c/Y/RAgIHqd WaMrr/8FYn2aRWjRGtlEUTbXHWEjOfFavifZVZO5txt422W82m+FczwpHPdCUNm0ajhi n1wcqSPMY6YVAenRsixdIYcm6enxJ0MCW0TfMb/3nOEAJUZfN/uoQoVV524Ya/TM+eEU njNfGDJTgA9wCcPsD8spI0DPNcLWDn2xNTxPxGZk4nFQYebT0Y+LFwr7qZgp2IJ8YtDb FHbEQwI0NW03V9ke+EE2BWWYgfHtAt4SkhKQ04ZatsG1N1XLfbkaLu+5eCHVHDP4KwYN P+oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=I7j0vOxwdIuLpD77WK2SWPTcyyL5hPZ0rRLo8GOdwiU=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=NZzKRGu5l0/QMX1w6qDsDKk+pzANaGLkQHh34tj1QlL/dwjbYz0Q70I3tD0nOahA1Y apbzt24dxHWBImuQZ+68FEq+li04wEFqSkjheiHfR0XcUiqDTSmh51JrmZOESeRGUhk5 /wpCoAYCMYPQ5kK7orKNLFCp1x5+u1gAdsVE4rhdVaetOjg1if673bCoTU5jhEyuc32T yO5W7zjUeZtFyu9B+u/QihkKTVMKFmJXtRL7CaFz6H4S8uXWBzPFRlqu8bh1+ElJCHah fQKqd3dnmcfbbVptRhaQ8UY+m7wKNLzLfqpFbw7+NE7+eWLCMVBr6CBrUzYLIJkiCaHq szoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MKOzp2M9; 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-a93a4e0c829sor413867666b.6.2024.09.29.10.27.53 for (Google Transport Security); Sun, 29 Sep 2024 10:27:53 -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:749:b0:a8d:41d8:14ad with SMTP id a640c23a62f3a-a93b1679b22mr1493843566b.29.1727630872356; Sun, 29 Sep 2024 10:27:52 -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-a93c27776a1sm403176866b.8.2024.09.29.10.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 10:27:51 -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 v2 4/6] clk: imx8mn: support spread spectrum clock generation Date: Sun, 29 Sep 2024 19:27:14 +0200 Message-ID: <20240929172743.1758292-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240929172743.1758292-1-dario.binacchi@amarulasolutions.com> References: <20240929172743.1758292-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=MKOzp2M9; 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 --- (no changes since v1) 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);