From patchwork Thu Sep 26 10:48:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3526 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D578A3F9F6 for ; Thu, 26 Sep 2024 12:49:05 +0200 (CEST) Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-42f310f0ed2sf7777665e9.1 for ; Thu, 26 Sep 2024 03:49:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727347745; cv=pass; d=google.com; s=arc-20240605; b=b8cr3AovRUzBpS1JmU4SmkPGqRawUA9tFSw/xg/fKDethtd8S0sB7hdwtgz28bxEcE KbO4f3lNTHX9GaAYtQEVjpvgzgdAmEpGsEW7pm6053bQ37COmJ0TXl1ZpkpYil43f3Z7 m6/bXs0yDoHBxLpRBxs1FjnemNZKZlbOROJtsugY5ZXBmBJW5Su03Ijul9n0MfHcuVU4 9y8iNpkcR+Iz+YsTOwpCoRQMcZwWdhUnDndzwZk6mLI4n8eXOM3vnetomwIgjVJ6wD6v ua/9df/P67KFIUHptMcn2d+12Izs5L0QLYHoOliQ10LUrHOCcgAY5/tarRyFxv6uxK9P 3I5w== 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:to:from:dkim-signature; bh=/49e88ScGTaYGQd3ub28lfNQG6D4TrXc9H1hUqI6cz4=; fh=thVpoqiiHzyfaivadIgg5AaNYL+HI4jIoQO3YoLOcaU=; b=QXPw3ChXxN9IskcGQ+8TFSjL4jHVmWJk8gex2/IQBeOVr5gaR3m1SEcIN46E4dn0uw Z4njDajbYy4D+gMH0HsOD86rt67NGUE8vCAURrKveGi779WVl6dLtB7dLHeesEDqZwSy +wqV8sl33LgmBSWai85ue/Ql7x5Y3q1Fi05RTqDJbvNuDrHnoMD2kNMOjgu7WAKqUGZA ZkI91Z1kCtDmfRNS0nXBeBBHLcQpRGgzYKzwL9lOJmE801UBBt+pWk+zciGxBu+00GKL Ad0h7Hjz2EgVbNzJ5e/9fN2LVRQsPuk47epjtA4OkU+sbRoQBPSJ2LAXlf5nFDeJAf/4 uNoQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Aj83gvQd; 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=1727347745; x=1727952545; 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:to:from:from:to:cc:subject:date:message-id:reply-to; bh=/49e88ScGTaYGQd3ub28lfNQG6D4TrXc9H1hUqI6cz4=; b=GGGw3511HGJ33wzNNWmb3BTy1fmTXY+scfapSzEdjHDHlNrk8REQsNvICda8jLt3f/ pj+g0KiiiHwCAfjheuQj5mq87X/CXTpQAAAvDvS4QlBjHpnk5w/4QDqk35AdpMzZJeKw pHAlvWkaszzWTGwtpBQBk/h1kWrknwtzhLIFs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727347745; x=1727952545; 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:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/49e88ScGTaYGQd3ub28lfNQG6D4TrXc9H1hUqI6cz4=; b=NyvuoDt8KkMnwMfejhPara9lPs9urdjz+MiOOrXU+bxqSSYyMUf0yPsvaX2Bm7yfy9 miGJ9/5vlFeeF7xHEjUxMjxX+anh9N2E4mNPq6xw+HkbIw58LQNROKS9cdZB5drGqwQk PzTf9vDQRbQCSCWAjdyurIxwWaXyNvtqrw8O1iNH62hlkIWzSkr5jNCgpPTvGhlfBHqB 5UPifwSEgN8uAjwpqGPbbEqo8h7GshUq8zUHMkO5v4mxxDn1a1C6DiHR+Smt1+5gR1bA TCr9F8ogN40xE+dFPTGbAOLxTv2QNe78JApvqpEeOvGYx+LdMzRLMbJGfInSxTCcrP0S T4nA== X-Forwarded-Encrypted: i=2; AJvYcCV0Td3GTM2zEUCXjuD9p8A+fEBFeFP/x9Db2dI+pBRL3EuaFNpqXigRqq4YhcTD3Fb5SSub20CcJOLXzdIE@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yzq04HicUzkZfbAoz2vZynSObjN6vmQi20z3qbUQ33MpowIMMZh gDYhe5GFL3dphbCZvlq4nztYiM4b/zv/RIDMVzUN9hzonezSDuOPYPJsp9jMld22jQ== X-Google-Smtp-Source: AGHT+IGuN/DCpalysLwTlUwm68kgF2ypHwSzxq7kgU/tnCsEzXtMijht3r6KNDSFm64jQofK8yFybQ== X-Received: by 2002:a05:6000:18c9:b0:374:c3e4:d6b1 with SMTP id ffacd0b85a97d-37cc24b25b5mr4647178f8f.44.1727347745162; Thu, 26 Sep 2024 03:49:05 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5d:540b:0:b0:368:31b2:9e96 with SMTP id ffacd0b85a97d-37ccdb8419cls359261f8f.1.-pod-prod-05-eu; Thu, 26 Sep 2024 03:49:04 -0700 (PDT) X-Received: by 2002:a05:600c:4b97:b0:426:62c5:4731 with SMTP id 5b1f17b1804b1-42e96ab6d1fmr53742115e9.29.1727347743659; Thu, 26 Sep 2024 03:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727347743; cv=none; d=google.com; s=arc-20240605; b=CyIYZjJVmSv3lJipq46W4Od+Y2IBNaL0rdAWHYPik9j+lb2Bghy7O97Yw0iu0ee2zd CHYfpsy+aVBzU3KMSMsuGsoOndN9z8lmOSeAQzaI4OoVnuJ+iEnEjzGUerlqzZMH6pIY k0LB1TblCUIr3ImoOkbDU0zr4gmlvewf29ADNaCm+/xE1kzpxTK7mr9MJOV+oRismc+K nYsCZ0k2KcguTR4MWQFbEA0eVGIdMifmMO0cyeCBw+jd1tLOqEPmE1Cfhb9INZMvdW0v 4vKQ3AUuXnDrxsN1qxzujXmeiZ3vxnAJ8/45BQfUAtpirxy0Lw2RxvqsIpoP46BbeyQa 1ihA== 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:to:from:dkim-signature; bh=SqdVHCjP2z3b3GmppGHkZvxobZmXnCslqoKDvGYxVNw=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=SpS//DrhCkbvdQWL8FkJOHkmwRR/Zl7kLj9KIoMLfN4jJoZrukBni+8Ddg/f20FlrU 9nyLnAAZwTjszKDA1nSBKrvw+xXQuosxz2+Yv+mo+XQKmGL5nzw2gwywuBkFeUqwCyam 859lrGfT5iRPIMPXHWCtn+oEXe1Fgy3f3VOaxGy2Xuwk9cINV4FVA2GqEzr0Reqienx2 9w67mUjWPyalkGe6Ewd/pLCjJuab8p0tp76U3k4STlg/PyoKoJxt3sSNXoBtMap2hrw9 SZSeNLaFwx4HJrWN+n9TRxGC6GFhlqDKZuqzrwNRl2eRo5Farcb+ZkK6yW6MFtg2WULo 4i/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Aj83gvQd; 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 5b1f17b1804b1-42f53098a16sor7972635e9.9.2024.09.26.03.49.03 for (Google Transport Security); Thu, 26 Sep 2024 03:49:03 -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:a05:600c:4511:b0:42c:a387:6a6f with SMTP id 5b1f17b1804b1-42e96118b2amr57858245e9.20.1727347742942; Thu, 26 Sep 2024 03:49:02 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.126]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a55336sm43314755e9.47.2024.09.26.03.49.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 03:49:02 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 6/6] clk: imx8mp: support spread spectrum clock generation Date: Thu, 26 Sep 2024 12:48:55 +0200 Message-ID: <20240926104855.656121-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240926104855.656121-1-dario.binacchi@amarulasolutions.com> References: <20240926104855.656121-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=Aj83gvQd; 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-imx8mp.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c index b2778958a572..460e8271def5 100644 --- a/drivers/clk/imx/clk-imx8mp.c +++ b/drivers/clk/imx/clk-imx8mp.c @@ -410,6 +410,7 @@ static int imx8mp_clocks_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *np, *anatop_np; void __iomem *anatop_base, *ccm_base; + struct imx_pll14xx_ssc pll1443x_ssc; int err; anatop_np = of_find_compatible_node(NULL, NULL, "fsl,imx8mp-anatop"); @@ -449,10 +450,14 @@ static int imx8mp_clocks_probe(struct platform_device *pdev) hws[IMX8MP_SYS_PLL2_REF_SEL] = imx_clk_hw_mux("sys_pll2_ref_sel", anatop_base + 0x104, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); hws[IMX8MP_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[IMX8MP_AUDIO_PLL1] = imx_clk_hw_pll14xx("audio_pll1", "audio_pll1_ref_sel", anatop_base, &imx_1443x_pll); - hws[IMX8MP_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", anatop_base + 0x14, &imx_1443x_pll); - hws[IMX8MP_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", anatop_base + 0x28, &imx_1443x_pll); - hws[IMX8MP_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(anatop_np, IMX8MP_AUDIO_PLL1, &pll1443x_ssc); + hws[IMX8MP_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(anatop_np, IMX8MP_AUDIO_PLL2, &pll1443x_ssc); + hws[IMX8MP_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(anatop_np, IMX8MP_VIDEO_PLL1, &pll1443x_ssc); + hws[IMX8MP_VIDEO_PLL1] = imx_clk_hw_pll14xx_ssc("video_pll1", "video_pll1_ref_sel", anatop_base + 0x28, &imx_1443x_pll, &pll1443x_ssc); + imx_clk_pll14xx_get_ssc_conf(anatop_np, IMX8MP_DRAM_PLL, &pll1443x_ssc); + hws[IMX8MP_DRAM_PLL] = imx_clk_hw_pll14xx_ssc("dram_pll", "dram_pll_ref_sel", anatop_base + 0x50, &imx_1443x_dram_pll, &pll1443x_ssc); hws[IMX8MP_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", anatop_base + 0x64, &imx_1416x_pll); hws[IMX8MP_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", anatop_base + 0x74, &imx_1416x_pll); hws[IMX8MP_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", anatop_base + 0x84, &imx_1416x_pll);