From patchwork Sun Dec 29 14:49:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3783 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 2B0E83F174 for ; Sun, 29 Dec 2024 15:51:05 +0100 (CET) Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-5d09962822bsf996777a12.1 for ; Sun, 29 Dec 2024 06:51:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1735483865; cv=pass; d=google.com; s=arc-20240605; b=f70Mu9r7vHn7y7RBsl5iWbGOsOBQVjDiUkRvr+oeeuulHCzvoAPa0uaDuGx9W6eQ00 6+PBFivrGDjCjkM9KQgkpRYGfc2SzTnLTp7MnWj0FPjuRzEwpUy0wzWre48iR6hiK629 9swyTeUGBjidXuYRH/A/H+TpZw2eWn3VUM5gW999ec17M2I2uN8M4w37j1EXfEztefAp TMnbWKuvrcFlZ/WUQKrCxITSClf+RJpmRDrLXcqjn66FNtbgKQIFapRVbTsNy28PI5Yu 9uRYHB5EPqO6k6BBXKgnTTKj7Yk+3qIxb4kr8wz2KhdfMPIf6Znwijz+2Bfrfdb8Sa+A UTNQ== 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=+kTpyKw7kJkddxrSzbV4edW+GArfJkeYcLiTQqR8NxU=; fh=QtKPhS/BCs5VY/Gy8BmDSZH6H1x0YJzMfayzWyS57OY=; b=eq4qgpSGN6N2MZz/iuLxzmjzWuJCzlr896LagRXAHcL25RL8yI6jd94pMjZTs54KVD qMwnirbP7BN5vcWjXwPHAmavBEdHtdYP9Je0v/Cf6QWXsbKSi0VXFOuy7kMLKaz8od4R yEXjuDJmh8EJPheFJwOsnCKJj27q6x87Yconfj/xoIoZ4fny1BHyNX6rR/trp5ZkLND9 ig+Z5JgTFbC9zPvRJtvcclmV+5FmYzkr8VpOPFOL9iuHEqJj8AwzVdPbKdLbbCZG6+Q8 ApbZyjbM8XLLAq6jN74l3yafrW3RnHoiEOd5hUgN4gGd114vZUKu7reduQH2nOGXiQgB +g/A==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Cp6VmmKJ; 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=1735483865; x=1736088665; 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=+kTpyKw7kJkddxrSzbV4edW+GArfJkeYcLiTQqR8NxU=; b=Qlqb9ARfvdmdOluRmkyexLwBDiLJHioGhRMTpoOJ1N7JX+3Qn0faJe+rRahAsIDtOR ayhQosV/O/NI5REEATYzYD91iHbBiqptvLI4/KOep9qBMWsCfOP5qiAZv1H9IbmLLeHs P83SlDWgkvwOJ+8y09t1HGGCZML9X2rQ3hweE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735483865; x=1736088665; 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=+kTpyKw7kJkddxrSzbV4edW+GArfJkeYcLiTQqR8NxU=; b=hyF0Qeo2eJRT1DfNlqzSUVo0vwtkxpMcqPE5cJXFU1IlZ9agg2FMbL5WmRjFFm326P w6GP+V8mFunJvc/FiC8660OYqVwiY0Gu4NhXpOBcawlZ/SRWCgDcwY8zAQrvw3Hbg53R iEAqZLz1qanL8HaZiRkHH7SzSwwlbqoddgUv5H8tBVynAuY/CTWlRuCpFGfIlyFu61O4 kmYPkHHXad3FMytRwtaLq0eFvZz2w5E3MPqv5XfLSCZuvFvCjN8u9AjJaVwFWLwulG3h ErgKBcgopxtokC067UJ868FNFxMII4/Q2Hp9VeFYAE1ttQfStWrB+xE6mnRZaQDEVCGX 4WJg== X-Forwarded-Encrypted: i=2; AJvYcCWZBX57EiGGW/qNhOt1F4Z2cU8ZsKGXhrr+ID00qXZJJdAWx1UjCBU7ZOh6z/YjXYXhzIRduy66hGKeuLK5@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yz/NMQb09x4WWDMnKih33Q+LBO6umeh+UecepJgns6vOtAgOk4J 49Kdl9zGKpev0mEGuYG0D6yXKLGOoRrzntPy7snt79cl/xs4uUQEsW9hGZHKnXKRFw== X-Google-Smtp-Source: AGHT+IHNT+mu6o4/LJ1d7hysAisowoXK1vnR0/ClM9LBi4PvujinOSYwCguUoN5SsQr9evd2/8GHsQ== X-Received: by 2002:a05:6402:210b:b0:5d3:d19e:6d57 with SMTP id 4fb4d7f45d1cf-5d81de0669fmr25030396a12.34.1735483864840; Sun, 29 Dec 2024 06:51:04 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:550d:b0:5d0:bcd8:21e with SMTP id 4fb4d7f45d1cf-5d88fd7ff8fls225967a12.0.-pod-prod-06-eu; Sun, 29 Dec 2024 06:51:03 -0800 (PST) X-Received: by 2002:a05:6402:4405:b0:5d8:16ea:cfb4 with SMTP id 4fb4d7f45d1cf-5d81dd7d02cmr31183475a12.8.1735483863053; Sun, 29 Dec 2024 06:51:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735483863; cv=none; d=google.com; s=arc-20240605; b=H1+YTsvCfxAk1gTAok3SjkX8c3NlB4IJCgyhBYlGrXXMlvMXGk1rZ6g+bdXb0E87fR F+RIAfhUValro9oDXAoKaBYKh8E2buT5WhF6bpTZvnx9mdmHjyOV7qIHsRCwCUcV3HLt Hr+PTX0/6CCPsxmuMcDc03Aq8Pcg73ldi4ANc1qerkPstj8/vVHtmUlddJFAbN50Nx+1 davZqxxH8Xu++xTyrkdgDN93/XQaAQsogaLbEwOw1n9+hnecds4ZcqQqoMdYB61d5NDX tEvn0lzLb4GAP4MRu9jv+/mYqOMq3dd/VmZJy/KlvvBFxqIeqU5wu0KFM4P2fCfIjQWX b6Rg== 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=6wKU7hDbBAEhh5ugFEv8c2E//GwNCMwODyh4qXAxbC4=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=lbyt1a/RJR3QMi0riTjTvybYokLnB+z185QremYAMlRfRuyHVGMEaxbeR2q3KmvWvA Bl1cn1K4c378cClNOMMt9NvI8HiLqVHQYdNAGQjxfJheGxRFveq7a4YvE8aUJjuSlAZs F+xtsWJj+OB9N2bzO3wV6oYrTaJbmbmNkufMzF6Ap/WhjksgMXDj9hLoospWdtBff3yZ fw8O/jd64MSDByeWr81Zrj+3jmYOfypVZEZdvWSQHxZ7GpZuVvrbI8Xf+wb21CCh7f4N MElJlCHojalH16M52WDc27e2OX/csBmF7Vc6aYMyUmZ37X+iaWr+ZrGyK5ExmBROxmif nfJA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Cp6VmmKJ; 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 4fb4d7f45d1cf-5d806fc78adsor6103309a12.8.2024.12.29.06.51.03 for (Google Transport Security); Sun, 29 Dec 2024 06:51:03 -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: ASbGncsG06MzZthfki36VaXodJiDob+WyPf4t6K0OqsJAEj1/NaFr2+laxRSylWah01 JW227ZxSO6y7RhIhGE9f+fg/KG3DgE9WgfiYj0ovP6d9NHFrgVJN2XDQxVkNPKo4+FVBHC9a/wU sfxxxtBgeOhaNBrUAjK97h1jn/NpCjjMSyiIiPo2PO8zDSU9jyY8Ur46CXeXkOX/4DnqA5IS+ms i3ymF8Z+b49QpNKFTCCQbx3gfD9Wu0jrEvmA3iwSKXaRdNVAdKLNtInVh7KrKibGDvZCNJS8vWg NaAX9mBBmoWNVfvWNXCpnA== X-Received: by 2002:a17:907:2d2c:b0:aa6:8b38:52a3 with SMTP id a640c23a62f3a-aac33787557mr2382898066b.50.1735483861073; Sun, 29 Dec 2024 06:51:01 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.. ([2.196.43.175]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895080sm1362084466b.47.2024.12.29.06.50.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Dec 2024 06:51:00 -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 v8 18/18] clk: imx8mn: support spread spectrum clock generation Date: Sun, 29 Dec 2024 15:49:42 +0100 Message-ID: <20241229145027.3984542-19-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241229145027.3984542-1-dario.binacchi@amarulasolutions.com> References: <20241229145027.3984542-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=Cp6VmmKJ; 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 Reviewed-by: Peng Fan --- Changes in v8: - Drop the patches added in version 7: - 10/23 dt-bindings: clock: imx8m-clock: add phandle to the anatop - 11/23 arm64: dts: imx8mm: add phandle to anatop within CCM - 12/23 arm64: dts: imx8mn: add phandle to anatop within CCM - 13/23 arm64: dts: imx8mp: add phandle to anatop within CCM - 14/23 arm64: dts: imx8mq: add phandle to anatop within CCM Changes in v7: - Add and manage fsl,anatop property as phandle to the anatop node with the new patches: - 10/23 dt-bindings: clock: imx8m-clock: add phandle to the anatop - 11/23 arm64: dts: imx8mm: add phandle to anatop within CCM - 12/23 arm64: dts: imx8mn: add phandle to anatop within CCM - 13/23 arm64: dts: imx8mp: add phandle to anatop within CCM - 14/23 arm64: dts: imx8mq: add phandle to anatop within CCM Changes in v6: - Merge patches: 10/20 dt-bindings: clock: imx8mm: add binding definitions for anatop 11/20 dt-bindings: clock: imx8mn: add binding definitions for anatop 12/20 dt-bindings: clock: imx8mp: add binding definitions for anatop to 05/20 dt-bindings: clock: imx8m-anatop: define clocks/clock-names now renamed 05/18 dt-bindings: clock: imx8m-anatop: add oscillators and PLLs - Split the patch 15/20 dt-bindings-clock-imx8m-clock-support-spread-spectru.patch into 12/18 dt-bindings: clock: imx8m-clock: add PLLs 16/18 dt-bindings: clock: imx8m-clock: support spread spectrum clocking Changes in v5: - Fix compilation errors. - Separate driver code from dt-bindings Changes in v4: - Add dt-bindings for anatop - Add anatop driver - Drop fsl,ssc-clocks from spread spectrum dt-bindings Changes in v3: - Patches 1/8 has been added in version 3. The dt-bindings have been moved from fsl,imx8m-anatop.yaml to imx8m-clock.yaml. The anatop device (fsl,imx8m-anatop.yaml) is indeed more or less a syscon, so it represents a memory area accessible by ccm (imx8m-clock.yaml) to setup the PLLs. - Patches {3,5}/8 have been added in version 3. - Patches {4,6,8}/8 use ccm device node instead of the anatop one. Changes in v2: - Add "allOf:" and place it after "required:" block, like in the example schema. - Move the properties definition to the top-level. - Drop unit types as requested by the "make dt_binding_check" command. 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 c3a3d063d58e..090b5924fa01 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, *anp; void __iomem *base; + struct imx_pll14xx_ssc ssc_conf; int ret; base = devm_platform_ioremap_resource(pdev, 0); @@ -344,9 +345,21 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_SYS_PLL3_REF_SEL] = imx_anatop_get_clk_hw(anp, IMX8MN_ANATOP_SYS_PLL3_REF_SEL); hws[IMX8MN_AUDIO_PLL1] = imx_anatop_get_clk_hw(anp, 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] = imx_anatop_get_clk_hw(anp, 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] = imx_anatop_get_clk_hw(anp, 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] = imx_anatop_get_clk_hw(anp, 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] = imx_anatop_get_clk_hw(anp, IMX8MN_ANATOP_GPU_PLL); hws[IMX8MN_M7_ALT_PLL] = imx_anatop_get_clk_hw(anp, IMX8MN_ANATOP_M7_ALT_PLL); hws[IMX8MN_ARM_PLL] = imx_anatop_get_clk_hw(anp, IMX8MN_ANATOP_ARM_PLL);