From patchwork Fri Dec 27 16:56:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3762 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C77F343434 for ; Fri, 27 Dec 2024 17:58:04 +0100 (CET) Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-aa683e90dd3sf638958066b.3 for ; Fri, 27 Dec 2024 08:58:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1735318684; cv=pass; d=google.com; s=arc-20240605; b=Fqr7EMGp340ZXfgoE/1/7Scz7EqF+NDVkIMAxcJvtl0pz1p1twPRmE+LuUcJIq/pSH l4y/q00zog3BHYnCVPSgANviTx4XIbn2x/IxzeWOClQcamEeooU4ByRiZyhQNKQgT4fs G0wu5Q+zlN7utttUQ+9BViTVhnwgCz4r7K3mQwb97Tsp8DVhBr1hA99birwp1t2lRuHR LJsk25CEK0ee5E7bkItAiQ3tQMUMNZVhSY9ncQGvahLZpvYaiAw5lDpNc5JSsXb75OAZ TKoKEn4pEGlceLPly34e2fi0keNiHO7gN22J15it+YmsoufMtQTj7/Dak6XsDJmuFClu 0TCQ== 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=BaSTRnHUsnhIv/8zA0ysZpAKDQp1C1s57I+sPOkgxeA=; fh=RilTidoywDbsL82lyU4UqZXWXUQ3j44eq0DoduKLosM=; b=JHy/9c6yCh6/e5mpYe5pLasNGcUhN2MtUn0EGg08luycE59ka08H8XziHOERU59SAd 1oV8yiCeMOaAPFGo9+TKrBVm1jK28qDjbhuCfU1GzkZfIj1QPzowNPotIYFPNERC11HY Luw7yYgHJaYc0TL5kjFlx6mfdQA0T+2EqficM9cPO2mkwUIbnk/M+nISfHiTL5dq35m0 j4qvb1eZowz/ZbUT0t+CU426tC37JiMV59V+ph+DQrwTl6Qb6/zY1WxtAN0yukalq/6b ZCUkLgWe/apJFBP7N3r9moCDQ0fipLRKUxV9j2DGJDp9ukizK+M2sJyRnORQrwBnj5Km CfKA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=En+LWJIi; 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=1735318684; x=1735923484; 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=BaSTRnHUsnhIv/8zA0ysZpAKDQp1C1s57I+sPOkgxeA=; b=R06i/UrZvf3KlGKHxchLuLp6u+sYKlSUB1IFVQPGJA1GAuJZyhadBQ9i3N4QNxdt+Y LXOSzA96E5Vd2TSj0L0Xxv0Cw+NRlOblskLbE1mfQcnm8472DQtig+l3TNmvvXDk5wFN H118OPQa28btBDgeNMsMCK+8sYf+0tdZKkomM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735318684; x=1735923484; 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=BaSTRnHUsnhIv/8zA0ysZpAKDQp1C1s57I+sPOkgxeA=; b=GxA9eNzhMgIAIIwrrBaojmhQ4DNA+H2HGbgKVHXsxSD0x7/kyCCaoixYH0Lb1ZUdMD Y4lK5Vzg6w8sa0VEV061T58BFxgrwkd15x7lKO4GHiKYtBNc5oe2rMifc21MtWW2A9m1 VrVSepS/PIar7B/IyhtGHvHrE4/v1TvtKSZw7fkNDCycspIv4QMyZWt7wp/6RAAYR9Nr 7rV7Ed9SUOSxENMbxGS18CowmR3B/4u0yYfICXDIyBRTwivlqusNFL/1qKFS4INzr0gC dlP6kuwD6+p+9hzTkrhprK+3kM72MnCtDwP4b7Kg52/J20qbNdtPU1V+5/ayqgQsu6x4 TstA== X-Forwarded-Encrypted: i=2; AJvYcCWGIDzrntVpiPY5OCT7DVdaA4AvofuZrRyU0YzmeDfnzsoQzy/3gf7NMInMQaX0oSmX4axG36ncuM2CtyWQ@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YzFRpnPJgVT3fxuKtvvjxKcZ7Gj6SYbh8lbuhIktah5m2H2xbX9 /YqIBRPs9LV+pzzzbsAIuln0PvmewaRg8WRk5VsoGxu84cOjvbB7Y4Ng7/zjJrzp+g== X-Google-Smtp-Source: AGHT+IHjm2K8GcF1ray5V9syYe1zrafzPVvBpnoLN7LmsMHxrOND3qFu+lO2qNHLIgIDR9PqkuVKnQ== X-Received: by 2002:a17:907:2da0:b0:aa6:5201:7ae3 with SMTP id a640c23a62f3a-aac3465011bmr2294591266b.40.1735318684429; Fri, 27 Dec 2024 08:58:04 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a50:c310:0:b0:5d0:b549:b21 with SMTP id 4fb4d7f45d1cf-5d88fd90365ls178715a12.0.-pod-prod-09-eu; Fri, 27 Dec 2024 08:58:02 -0800 (PST) X-Received: by 2002:a17:907:36ce:b0:aa6:7165:504b with SMTP id a640c23a62f3a-aac2d41ebc3mr2951777966b.31.1735318682398; Fri, 27 Dec 2024 08:58:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735318682; cv=none; d=google.com; s=arc-20240605; b=XQSBaC66OE+yZGJS8LrorFLDdBmxeeguB/vW7n1DhCczqnVLVekU4qVvtR93TqfRjL UDvixZX7xqPnt/+5b1oNcMblPgXwNqn1GxnYtdhlzSghQOlz0sccFxupCBpN96W/5P9/ pGwEJsbf5vd6TKDqUaqhssQHuBSzfQcb0IJkQk6jzgEBy7twXuB1qoyGiEp6Q/+4SsPW W3WildPceOrFrS2ss0uiqJEaSOYG94albA2gldg5An507KrOzto08zGtQJtE2CLvp6Dl De5wcs0UFH5hH/E0haqKRHva+jRNx065oZGFhC7RGI6ko8okmP9RYa87P/aBO1augo2M wQDQ== 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=t9y65mSKckiOGkTEuAAogO736LDDvGviKkEok9cQB10=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=l0OMGM2MMX4Bw8u8fYKarjeURPQpDnmBd89hruoA2IviqONmoMLBDNfxQkd0CA1dRd w50R/qNoUyfyP5BVA3nndHv2hA6FRM1zDjajrTtT8b4oDsRrExLDrkYGRp3ItKaEdVj7 MXHoVaj+th4w8GnrwquVZA2JxBqZI4qnzSo95PQawl2e7mzd+DpdQkFPIraqm4geWvXD PzY5Y4MrIDKCDFM3QbZZZRXO/CVq9nop3i2zwd1COYqjwQPc96QkpzOIZaCqVSX97aWt JbeKhV5fhjRreHMzCF+abmanrNLkbPPxMxBpxtQ9bem/MLYoMk7Q8a0K4w3VHmm4+4eJ eidQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=En+LWJIi; 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-aac0f00eee6sor279064366b.16.2024.12.27.08.58.02 for (Google Transport Security); Fri, 27 Dec 2024 08:58:02 -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: ASbGncsWrWNAQql1tUnjflNo23HN9FLGEjvjrMimRnzrUpHOJhUOyY28vHt4ef456GX Ijk53xRMXIbuEYP1VHAe3ttBgyzfvVmb+Du3qB10vxYXBEr71Wvg1NYAMUeBi0cKUrydjN/t3lg DB5UGw757Z6l+PBTA+MbwhL6JnTdxLpujySSg8bPgtsDKCF6tN3VuJGGw9+/XF0MZWcyltnGsNx d8zfm9vq3/3uOuhYQUO9h326EQmWUy/bnSJLsxxQKN2YqR8007rZ8ys8v7npAd343Gj2OpjI7QD ErDinIe0f2dpWq8fTmP+sQ== X-Received: by 2002:a17:907:2d2c:b0:aa6:8a1b:8b78 with SMTP id a640c23a62f3a-aac271318f9mr2143573966b.6.1735318680458; Fri, 27 Dec 2024 08:58:00 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.. ([2.196.43.175]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f0159f1sm1130097266b.154.2024.12.27.08.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Dec 2024 08:58: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 v7 23/23] clk: imx8mn: support spread spectrum clock generation Date: Fri, 27 Dec 2024 17:56:26 +0100 Message-ID: <20241227165719.3902388-24-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241227165719.3902388-1-dario.binacchi@amarulasolutions.com> References: <20241227165719.3902388-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=En+LWJIi; 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 --- 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 984331372139..9a04e8138b7d 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); @@ -347,9 +348,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);