From patchwork Thu Dec 5 11:17: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: 3710 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 4C02D3FA09 for ; Thu, 5 Dec 2024 12:20:16 +0100 (CET) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5d035c8f3afsf542192a12.2 for ; Thu, 05 Dec 2024 03:20:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1733397616; cv=pass; d=google.com; s=arc-20240605; b=B53/tajj9e9JJJmvuRR2NfEgVrmO5BZBIMpsu8crlPh67wwNmn9GGNzEwR2wddBnEF cldEn4MG2XiB5U3fHNGKTWda+iJwQY/c5LCcPsrm3nHnaXiXWFOPAOi5i2zhE/xqd7vd nvJWRYt8jlmgHUhKWrxj/1Y+P28o/ehXVdMjLQE2+3vwpnLoX5ZeZLm13OrOU2HEvzBn pznBiSFQyUmZiMq9Nr8krsH/r3RG3BrtGy7Hl3EN49UkUUKE1qkL6UBgOGeEg+Lhh1pr HIgH6zJbNPsQclCnyzsuwujLNK+RFbe9l2enc12huDjHk+nRvoK87tlig9uZJUOWG14T XPfg== 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=BDnQIvzq+KrpyPcTIII98xFUV6PS9JDARLEfi4BNiio=; fh=nipyntPCCpS/rIzKwoGGIKArIc0OeHLPxY96Ei9ea8c=; b=CDg0ZtRqhEGz9IAwpP3h5K5m3XAwto9L3iiQ3OF7hrd9btuF3uCsOcNDaTlgVwN8kq 7HqbMEYlME7JCHs4d0IDqfOav0FrTV85WS1oIo+PUq589sSf1Zm4KM0PnTAqpHl4BVgP 1dfGLf80weVXd/JtwJTtZ72HOtqLWk6XsrFKtbDmjTt6N8Ad1y5XRHLJyASYyepSEaTy LW2sI0UGPJmNEcdPJgleAX/lai3K7+E+SDXII9rSgtm+rRutZ2LrRuOI3mZLmCwBclIA H+wjCe9W0X8SLB/a5YnDu3CiNvn0Vbe4nI8658PtYYXqNAJYTRZELKnAS7Md6LEJYHPH r90A==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ckPxjpj1; 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=1733397616; x=1734002416; 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=BDnQIvzq+KrpyPcTIII98xFUV6PS9JDARLEfi4BNiio=; b=UAgSgQZCnIp5dhe5ZYskPiInzPfQ7iq3kvD5X7VMEqJS8alB4j1Nmd49zXO1s31EhI YI9MEmiA99zGnu170hzwG7jidDGbtuOnhuSA7dIvuPrFfkmTo83hOq0wNbIgAZkxQaSN 0KUn1vvmDtTIx4KkjwLbJlh+H28k2hCw0Hm98= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733397616; x=1734002416; 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=BDnQIvzq+KrpyPcTIII98xFUV6PS9JDARLEfi4BNiio=; b=QXV7DV2LD6BhzFxdLBU6Ue0o70cd0a6mv68m/FwPqrpWx0SYOtZblM742whGDkgnsG AwtaHrnNSogu51CsLVsEO+jk6rwVntXcAsFbvPyn4RJL2JFQunVKjqaSV4HJaqHCxxMn tnd2fbDgnakAi9V8kssERs3cfDno877+Op3DPV3DS785o+LCaimcKwkVH+PmTiori5an SL6jOQ8ofhk1Z7N/ShpkHVT3vNq53e2XVsu+K+56J6hPgYVRzeb5tIvVeL5qEUNyFvF2 Gy47sM4QtCo9OSR30seJvTZFymDbg+5+iJX+YW+DzjklBFdVFHAL9m60B3uO3UHX18sF +wHQ== X-Forwarded-Encrypted: i=2; AJvYcCVypaVpaClOlgHaCbfvZemxLIi7cZkWO+3giSBOZ70Dy/kjoREGMHzam1otSl+cUnz2G5V7CoF1BGHUqF7E@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyzM78KxCakSurUACLTvO6HDfulfoeXfaAcn3u6hHdI/z4vpufY ISoUI17smIkBI2bZegYnPMr5xYuv8Z2werMcqDrmDrSsEJObFW7DBUfDE916XQSR4rotwUhReg= = X-Google-Smtp-Source: AGHT+IHEh33yVuO5xt50DHKWhHMRur4+Lom7uO1n7xcov9Q0rNmTU2UR6+S/gJfJwl5k1SFcUhbTSQ== X-Received: by 2002:a05:6402:3506:b0:5d0:bf4a:3dfe with SMTP id 4fb4d7f45d1cf-5d10cb7d33cmr8446143a12.23.1733397615933; Thu, 05 Dec 2024 03:20:15 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a50:fc0e:0:b0:5d0:ccda:bda with SMTP id 4fb4d7f45d1cf-5d1251d71a3ls37286a12.1.-pod-prod-09-eu; Thu, 05 Dec 2024 03:20:13 -0800 (PST) X-Received: by 2002:a17:906:30d2:b0:a99:ff43:ca8f with SMTP id a640c23a62f3a-aa5f7cccb20mr735264066b.10.1733397612602; Thu, 05 Dec 2024 03:20:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733397612; cv=none; d=google.com; s=arc-20240605; b=YvnHSfsQgYEOE2ufhkijzjweWFyUqTnX8mqO6JwHABpyYly58mnY2KIMhddqAMOied z5kxVQo2/7f/O1yR+VpRj71FeygaUJNlgftoGqrVekYODh8ZyYmqp2lUqt4HBQ42C/Gn R7fTR6gRV72N58t4Ir9tLltG8vuW/HcW3ndLszwuuRUZvL2TCYjqabwXp5pj5FBF5I8h kBaJGuDykplxOFODtivTazMl0WmApCTYweAPjUIZzlIDwPjBIQTk29T2Swmexa6g4eG2 U9ZrCLegcDc1AdDLjmFkWKRhfzR0jtszm2mb7oeKuuQKdtaVKJaRSuQROR8wiuRdsoin J0Fg== 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=N9yTySfaJQhr7Fo3SgjYPb/w7zlE9/XQ3JsIQbT3gRE=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=aRpSC9fQx0cj48DcE5UpdVqXqeFVlYSEW6kAH3XlKH3CV2WJFOWbXiFRo6Vc2w2BFZ zGMteRLCyeN/tBxNZ9YamL0mRHilskB7pcB58j30ZmmcafhIP2WLD80u8ZyDegM74dY1 N04XfrrJBigH4685G2P0Po2NoKP/UyuR7fPLGvm6wr+63dqpq0WdgvfSmWtGBSt23y6e NVF2/FCVppNsQqQMFimmVt4OfzpC+4C0Cs2SOWxjOmrrEONbI+X6JqwrKsJm6xFCYIrk 0pDvIzXZtObYLi/f2md6dWMYDJi28W5lfWReT6VGcItwAYNzMy0kVCF3HOCEy5GEOVPi XTwA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ckPxjpj1; 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-aa625e93f9bsor41269566b.5.2024.12.05.03.20.12 for (Google Transport Security); Thu, 05 Dec 2024 03:20:12 -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-Gm-Gg: ASbGncsiZxS5Y5owyeU+ANuut51qtSGb5bSLz0DgOAWzYkgdoHax5PfjxyLJ1XwWJGp jvuRuqZIi8p+IlndDO9wS1RQheGsmgPSIdRgqJ/zKkU7hU1PGubc8dfbZaFHef4aaDq8MocYhZ5 IMqfajAZNKdJ0Q1Wz1HYsFWaBuU7AzA6DQuFAGSM3FKk+DsFEKarLrtqhEkpMZiLxmTg/fHGW8l aJBx3NIqTVwWWUJJGNyh5SULXNMmkUptSVfwmtNsgd0e2anHWym/+vtiAcMgkVJDMwT1vQBh0gY oxaqgfctcfRnwAtNSGR7yluwK5rYRrVm/Z2r6WM2LD07sw== X-Received: by 2002:a17:907:7841:b0:aa6:2987:9a4b with SMTP id a640c23a62f3a-aa629879b08mr105608066b.21.1733397612146; Thu, 05 Dec 2024 03:20:12 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2001:b07:6474:ebbf:61a1:9bc8:52c6:3c2d]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa625eedcd0sm77505266b.87.2024.12.05.03.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 03:20:11 -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 v5 20/20] clk: imx8mn: support spread spectrum clock generation Date: Thu, 5 Dec 2024 12:17:55 +0100 Message-ID: <20241205111939.1796244-21-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241205111939.1796244-1-dario.binacchi@amarulasolutions.com> References: <20241205111939.1796244-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=ckPxjpj1; 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: , Add 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, 13 insertions(+) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index 588cebce6c9d..c61368e724f7 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -306,6 +306,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 ssc_conf; int ret; base = devm_platform_ioremap_resource(pdev, 0); @@ -338,9 +339,21 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_SYS_PLL3_REF_SEL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_SYS_PLL3_REF_SEL); hws[IMX8MN_AUDIO_PLL1] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_AUDIO_PLL1); + if (!imx_clk_pll14xx_ssc_parse_dt(np, "audio_pll1", &ssc_conf)) + imx_clk_pll14xx_enable_ssc(hws[IMX8MN_AUDIO_PLL1], &ssc_conf); + hws[IMX8MN_AUDIO_PLL2] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_AUDIO_PLL2); + if (!imx_clk_pll14xx_ssc_parse_dt(np, "audio_pll2", &ssc_conf)) + imx_clk_pll14xx_enable_ssc(hws[IMX8MN_AUDIO_PLL2], &ssc_conf); + hws[IMX8MN_VIDEO_PLL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_VIDEO_PLL); + if (!imx_clk_pll14xx_ssc_parse_dt(np, "video_pll", &ssc_conf)) + imx_clk_pll14xx_enable_ssc(hws[IMX8MN_VIDEO_PLL], &ssc_conf); + hws[IMX8MN_DRAM_PLL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_DRAM_PLL); + if (!imx_clk_pll14xx_ssc_parse_dt(np, "dram_pll", &ssc_conf)) + imx_clk_pll14xx_enable_ssc(hws[IMX8MN_DRAM_PLL], &ssc_conf); + hws[IMX8MN_GPU_PLL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_GPU_PLL); hws[IMX8MN_M7_ALT_PLL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_M7_ALT_PLL); hws[IMX8MN_ARM_PLL] = imx8m_anatop_get_clk_hw(IMX8MN_ANATOP_ARM_PLL);