From patchwork Wed Nov 6 08:58:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3625 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 86C213F14C for ; Wed, 6 Nov 2024 10:06:16 +0100 (CET) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5c92e8b8101sf4569536a12.2 for ; Wed, 06 Nov 2024 01:06:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730883976; cv=pass; d=google.com; s=arc-20240605; b=fx23XoZc4BaleKFVE0vOe7z3IcyQINJUTLAWOrIy9XsUjbfNeJF5cPH7DXvr8rfrGc Re1FmPAxkmZ53HRerQorOuA70Fw6WTqMxsud5wYw2FEMVn7OEAWEKTOkfY2qq5MjWLS9 xjWsj+GV3HP3Feec3wo0r59bMQz3YGkS//5wF6R8rPNy3ym0uRBNRzQZSlxzYOh0y7A5 DG8mP+YLsRizs7kD+tSzpj9MAczoG7GIdwu9Ybc+CLNxiW5ztiIBkKgA1uG7fiekHF64 6c0cybMxMmEnaaPYy3qC81+A1GXs32EM29gIpxW1aWD1m3dS5+gpYOLbgppvc/LOumYE Y6RA== 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=acdTQnlVGy1WudhIZxDn7GRP5VzXiDxhF2FVMjPjQFE=; fh=4K2CIUn+l/UafjyS4l+L2l8jatYS7G07s9tmviXwgTE=; b=jPg3NK95gkINXcbYNl7VZf9DwEELdLrP08TTZxWvQK4Clw2L8kE/SlZ6FGyz/nQyGB XAlWlFVroiI63cLyoYzkTXPgiGH1vyPB3193CFxDzeOr1DpBW1nLrKwjkXgpb9e9TfP1 jZF8TB80dmANw1NI3YRRNioB5LqEyzvjRX0kQVkG07WV/eHxcG5PRJvrAb4OqxDUJDoW 7ZCUp+emHJEcHKH/Nd/yIR92y0M3dBnuj9WX0yw44OruIFSUzsxw9qcV88gsZdJWxwMe UTVvtF87VAwqNltA18pHaNEDKQzYXCWOdZdxWX/7ig3Y41is2aaf0YMMEzvdAWQiwKaN XIFQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=o90Xy03Z; 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=1730883976; x=1731488776; 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=acdTQnlVGy1WudhIZxDn7GRP5VzXiDxhF2FVMjPjQFE=; b=ncXLV6UYgR7xAPzGBjgXucJZX1s/gFwAgZ4+Xof6M0+U9yoyGHTKzPlexTi3qDXnt7 15atMCzDiLYvU3B4RsPpV1u8vN5e4b5x1cqsu2BayW0cVoILVz8EGVmFN2fyd3dp8v5r TLwD0efXx9mGFks40LNoUxhKJyZEhiGENHXds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730883976; x=1731488776; 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=acdTQnlVGy1WudhIZxDn7GRP5VzXiDxhF2FVMjPjQFE=; b=gTaXSJEuzqcyRxClthh//Ys4O6OftrXSBoEYl3hMYquirnJMv/2epLIH++QD0rP9Bl GTj+86gcw3V2z6lJlL6y86dtxhzls1ufX1cbU9hKsFXqpO8lZqBK3OXb89m0861JdCZV 6TiTxeUoRazE19z8DwgL+mroXj/k7IZDfx4j/df2P4Dzi20chRC4cym5yBEb73/ZEytF ueQFc9NLeNKt/jKvHU960UDfjhkn4D1IOUw8U+BoDTMrZyAdidbBafo7uYRq9MEePoU1 TexYamkZJ9JQXRLh7B/TuE8CidKepSsyxZWh8W5nB2RLbcioYulEr+QJG3nocG038+rF Td/g== X-Forwarded-Encrypted: i=2; AJvYcCXOevzWqKwu9alOCDH7Zpyex4NzcEdJsKkcGzK/v69ABK3LF51zvF7vj2xKCSHxc70d8w84Iyhznk057Rjs@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxCC1CgASKSZ0ekfkToaFbjdpHGPuJpWT9LhlRDey2wVL/mO9/W FvimokQ84j9K4YYsnvmcfqmQJ8GkHtRBpIxMWS2CCI83/0dwu/Z6yz/pZU65Su4L+g== X-Google-Smtp-Source: AGHT+IH3HL8S4BKQmdYs+FPIB8zSwEpjdNIFlq4sq6eWCh4JvyzDKMbkTj+MWcGCANYjY6k1rYY8uA== X-Received: by 2002:a05:6402:2688:b0:5ce:d53e:f27e with SMTP id 4fb4d7f45d1cf-5ced53ef62dmr9004571a12.0.1730883976059; Wed, 06 Nov 2024 01:06:16 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:c518:0:b0:5bf:bf:efe4 with SMTP id 4fb4d7f45d1cf-5ceed258bd4ls678629a12.2.-pod-prod-08-eu; Wed, 06 Nov 2024 01:06:14 -0800 (PST) X-Received: by 2002:a17:907:9407:b0:a9a:4d1:c628 with SMTP id a640c23a62f3a-a9de6166babmr4063043666b.45.1730883974151; Wed, 06 Nov 2024 01:06:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730883974; cv=none; d=google.com; s=arc-20240605; b=LLMni6nA6bXnU24IKilTpoASnJA9a7B/WBezy/BLnNj5F34y3NGUdq1qgEzO1yrdAC DtT86mw1scJJ2syDZSSBGOEyL+FHcVdt2CGL9dZdSx7Dsz8M2VemihTD03Ok0Bu7vJ/c wm1NJqgNVUSZwd7Wac6MbWz+9NxogvlpOEtpjQVSC39uEMSqKLGfrVMSfu9hLpRjKhwR hr7OmmzojlmZUzGkmAjJQQtOArfK8R1ooiCdnRgXiyNb2QMxWKCFgo/jxUtmwabkVTrx CHjlYg6+oriIi1u71Zef4FBs2zWItZ+lskF3ffBQe8Dl/onjPbDkHO33dTCXG4xcdFVY uMYw== 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=K9/BOp61tpriPDyxNyMCGSbfD3+1Oa6yDDGnpxFC9Dw=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=JfbabI5yyOIvO4U1kb3A65Cbv5EbZQZ+Qht1TqO191INRneuK8KQVUvb78lhV+2GvS Y+UF/m/qdM1UjEryw78ykhCAW3EaZJ9l3udKANYw1ZJ4XZFs/IYxI60rVSe77a1VGS1X pzEWz0AYM+u82SVi0PJ1QaNg6UuWC++dhoAOgr54Opis7z8UuWPgaM9vKSqE4Jh4Wk+i Q8OzX8RoMlzSOgl4Tekx97eTqVPCZaGpOeL3y1dY5KQdIU/6iZJRE9oK/D8QX/sOv7Sk 4V7/8vGBs2rui1u1qVjURwPBJARLU4Wf3MYvn57MhEXr6Uxteq+sDd8MBZHbHaoN1dC5 jhHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=o90Xy03Z; 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-a9e564bc86asor616682866b.7.2024.11.06.01.06.14 for (Google Transport Security); Wed, 06 Nov 2024 01:06:14 -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:a17:906:f58e:b0:a9a:2afc:e4cc with SMTP id a640c23a62f3a-a9de61a128amr3626458166b.58.1730883973693; Wed, 06 Nov 2024 01:06:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:06:13 -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 4/8] clk: imx8mm: support spread spectrum clock generation Date: Wed, 6 Nov 2024 09:58:00 +0100 Message-ID: <20241106090549.3684963-5-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=o90Xy03Z; 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-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 0cf53b5b15c8..482e471d086b 100644 --- a/drivers/clk/imx/clk-imx8mm.c +++ b/drivers/clk/imx/clk-imx8mm.c @@ -302,6 +302,7 @@ static int imx8mm_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 = kzalloc(struct_size(clk_hw_data, hws, @@ -335,10 +336,14 @@ static int imx8mm_clocks_probe(struct platform_device *pdev) hws[IMX8MM_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[IMX8MM_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[IMX8MM_AUDIO_PLL1] = imx_clk_hw_pll14xx("audio_pll1", "audio_pll1_ref_sel", anatop_base, &imx_1443x_pll); - hws[IMX8MM_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", anatop_base + 0x14, &imx_1443x_pll); - hws[IMX8MM_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", anatop_base + 0x28, &imx_1443x_pll); - hws[IMX8MM_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, IMX8MM_AUDIO_PLL1, &pll1443x_ssc); + hws[IMX8MM_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, IMX8MM_AUDIO_PLL2, &pll1443x_ssc); + hws[IMX8MM_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, IMX8MM_VIDEO_PLL1, &pll1443x_ssc); + hws[IMX8MM_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(np, IMX8MM_DRAM_PLL, &pll1443x_ssc); + hws[IMX8MM_DRAM_PLL] = imx_clk_hw_pll14xx_ssc("dram_pll", "dram_pll_ref_sel", anatop_base + 0x50, &imx_1443x_dram_pll, &pll1443x_ssc); hws[IMX8MM_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", anatop_base + 0x64, &imx_1416x_pll); hws[IMX8MM_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", anatop_base + 0x74, &imx_1416x_pll); hws[IMX8MM_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", anatop_base + 0x84, &imx_1416x_pll);