From patchwork Sun Sep 29 17:27:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3539 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 291F23F03C for ; Sun, 29 Sep 2024 19:27:53 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5c87c784d50sf2282801a12.3 for ; Sun, 29 Sep 2024 10:27:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727630873; cv=pass; d=google.com; s=arc-20240605; b=B/tCafQbd/iIcMk4EFLa8UeuOSSQ9LEZpGMM0xpDY3gfSMDHXJ2qtMRdYrjSMl4+pv NN0PAaEEOH8DHgCt+acA7bSxUE2Gj0ME1lRfwqvljI4wPV/wlMqbWUf2cvGqGM3fh29a z6ltdO55X0F2Rg35vhzW1IGw8pf/mOisdyGh9X2VbVe9qVM61snqcyNOMkPfRjZWQ1EG Ww768p/GE8SwfucazXFDGhBmj8gwPp2tu8l0BRFuAyArHwq4+svrST4QdXR+7BCSGXB6 rpA/pm2tvsL2so5emJQxfhkDdvPgvzELcgn+Ud0CYmCaQDSPPEVfgrElQoKUTeDX+dXw XuxA== 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=H8MGpKuBGovpjQF+SRCrXw3SyfVUsjKsp1ASEgbMEEY=; fh=hQdHWFSwxujjOPKNnpSsgvZYLgb20Kwk3P8+0HG2QP0=; b=lDhTR4Gz9l2mXHVhJH1MmobwfHIVW21d0ErKWHsJFY09CSttQYBKCTwWaG1UlQ0FE8 YHKV1hLblBUw+LqhNBqIYSGGyS/VSn8YPc9izrXj55eaw1DketAU6M2M3HLWXefsfWxP SY87L6KZhWgpntBCdmQoPq3LVvjUKurzHezSqbQCHXiRLCptKJjVfiB/gY9b5WkIBlTd HM9jppHJu7Qsx41lLi1GPlHeJmMoIjsFw6gne/I3YkHX/8QgzriOqpWJ1ZEHigKW/imF R5IiKJw9ZYAKOe3ATiao/0M3TQODMnBg7HCG6uWQwHbYIweqKSF9wtq7LD6nPG5mLFq/ e2hA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nMQZ6Iov; 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=1727630873; x=1728235673; 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=H8MGpKuBGovpjQF+SRCrXw3SyfVUsjKsp1ASEgbMEEY=; b=BB1ixq2bAwYG0//dhq/XeYoQc1llLOQZmJvi3E8hPRxbjcz/oTkEJ7VZLl3ui6j6Xb snl5CxaZ3mgQeRR2SIcPRZk3GpbH/lwdqm0QCGa864Qpjfn+2trocwk5ptkdFlFUkly4 BBSCHEUd6aZwVadC742Ez8JCHlDm+QQvAC2qo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727630873; x=1728235673; 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=H8MGpKuBGovpjQF+SRCrXw3SyfVUsjKsp1ASEgbMEEY=; b=o+dZeHicfjF56eiDsi1y51ti4Sxnw0lgjT2SwjbdUPfxcll4wY/EAIdG5+8muJWIGy UzsgZfI4GKTw6NyVch7cnwtKGXAMA6qEv2uQf888VZ8q8wTRB9ZFKigEh0KxGDweLVD2 rg8CAMlFTEKQg82bP5O36ucrWfJWbMBiuznukuYMnA2Le7I5to+kpJOCpPf6a9JrofHs aNFZwPWz6m14t9Mpyn1AV7eac/eE+9Mg4vcRsW4Bnlr1uB/RDKuLzR3nbQds/814JbXK 6Li7p2SME/d0Sad8d0/pG/+ouvkTDG1W/6soSM2oILZ4Zrq1QTZ2f4sJ+01pSfZht1pc /B+g== X-Forwarded-Encrypted: i=2; AJvYcCUZYvITkl0iDC/tpuz0T8IGqfp+X67veDCUNz60rTa2J7bH3sYWOnP5sgJpY+wUqaGGMBK491U64Lxxxr4Y@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwSNuifP+BlWa32R8rNa/eEiqJvnSQ2vt4CQhnILSApZwWerA/H WN9mapUSDltsKu5LXvUY2MhQ20uZINhqwOnwkEJjbVep46PpUJ+7jUGYWt+XvzZrfQ== X-Google-Smtp-Source: AGHT+IG9pJ8j7ZMQJoSse3za/53QKCwVsRLQU3/X7EE+TxRGfTBZRntxb+MnfEOT87To007KleTcuQ== X-Received: by 2002:a05:6402:2814:b0:5c5:ba82:c3b1 with SMTP id 4fb4d7f45d1cf-5c8826034b5mr9556661a12.29.1727630872564; Sun, 29 Sep 2024 10:27:52 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:1ed1:b0:5c4:651d:a532 with SMTP id 4fb4d7f45d1cf-5c877765b81ls653885a12.0.-pod-prod-06-eu; Sun, 29 Sep 2024 10:27:51 -0700 (PDT) X-Received: by 2002:a17:906:d553:b0:a8a:87d5:2f5e with SMTP id a640c23a62f3a-a93c492a596mr1223163166b.34.1727630870840; Sun, 29 Sep 2024 10:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727630870; cv=none; d=google.com; s=arc-20240605; b=ZQGAvZaVLgOTx1Oyi7OpKJ4jaFtVp5gKhH7P/BFzi+LKOnv4WccUG69q+VKq19RIWz HPw7YzzicqKA5PZ4iu3j8o73KhukJamS3PvakhNUzTYmRcagmqrhK3Lb0rAlPudc2/wk z0ATcDQZLyD81xyhrScZXSDPreyAdVbG5mG72mTF1roOuxZBuo8LsPU1AKL2hLxIsqKM jziIQyjdRwJy2Oc9hnjCwQm8B45/USfdyLuUInI8FiaS+aZRQEOCWsaGJzVjKnC9tVt2 r7C05I/7XbwZL+K6uypf/8gmDsM6UQ3FLRXFDxjpsMNlLlJzMVccY7XAgEMUIo4hNFWd dTVg== 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=WlAZxFonTMYipfw1/+w0+N2nElhJYRwH4anfNSm1DKU=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=ZU0zlBVBGeYAQaTU7i/UEgSzOC0AXCKH6hsK3OL1+Y1z6CcXTPPZOlXSMd4UgitWOr XbskH72GqFz8xNm//hFqBl49pq9/KWFbI0qiYMOSTxBC1k+m3kA+bpnzz+sHdLPrJjIP VIq+TaUwy1gnfWBmo38MrnRWNyGSeEEKv8NHwAjP5gonUBgn2rT5wMuP6L1kut0nlm1X hhBJoq6NjotJY15nxABTEZNUzuylhuWRJYEKo21qk+ZG0yrexuWK4vrbsTZtowVwGnaG l7+QIN2YRZEtS9XPRBaF1LHANJpA2aB69OLCNhdwD31Fbz7ErzP9NDa1trLLWXMDWJdz XJVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nMQZ6Iov; 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-a93db859b01sor129652466b.10.2024.09.29.10.27.50 for (Google Transport Security); Sun, 29 Sep 2024 10:27:50 -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:7b8d:b0:a90:419f:d8c3 with SMTP id a640c23a62f3a-a93c4a607b7mr981791766b.49.1727630870391; Sun, 29 Sep 2024 10:27:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 10:27:50 -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 3/6] clk: imx8mm: support spread spectrum clock generation Date: Sun, 29 Sep 2024 19:27:13 +0200 Message-ID: <20240929172743.1758292-4-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=nMQZ6Iov; 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-imx8mm.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c index 342049b847b9..0acf2979c929 100644 --- a/drivers/clk/imx/clk-imx8mm.c +++ b/drivers/clk/imx/clk-imx8mm.c @@ -301,6 +301,7 @@ static int imx8mm_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 = kzalloc(struct_size(clk_hw_data, hws, @@ -334,10 +335,14 @@ static int imx8mm_clocks_probe(struct platform_device *pdev) hws[IMX8MM_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[IMX8MM_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[IMX8MM_AUDIO_PLL1] = imx_clk_hw_pll14xx("audio_pll1", "audio_pll1_ref_sel", base, &imx_1443x_pll); - hws[IMX8MM_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", base + 0x14, &imx_1443x_pll); - hws[IMX8MM_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", base + 0x28, &imx_1443x_pll); - hws[IMX8MM_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, IMX8MM_AUDIO_PLL1, &pll1443x_ssc); + hws[IMX8MM_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, IMX8MM_AUDIO_PLL2, &pll1443x_ssc); + hws[IMX8MM_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, IMX8MM_VIDEO_PLL1, &pll1443x_ssc); + hws[IMX8MM_VIDEO_PLL1] = imx_clk_hw_pll14xx_ssc("video_pll1", "video_pll1_ref_sel", base + 0x28, &imx_1443x_pll, &pll1443x_ssc); + imx_clk_pll14xx_get_ssc_conf(np, IMX8MM_DRAM_PLL, &pll1443x_ssc); + hws[IMX8MM_DRAM_PLL] = imx_clk_hw_pll14xx_ssc("dram_pll", "dram_pll_ref_sel", base + 0x50, &imx_1443x_dram_pll, &pll1443x_ssc); hws[IMX8MM_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", base + 0x64, &imx_1416x_pll); hws[IMX8MM_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", base + 0x74, &imx_1416x_pll); hws[IMX8MM_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", base + 0x84, &imx_1416x_pll);