From patchwork Sat Sep 28 08:37:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3530 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 498B93FA6C for ; Sat, 28 Sep 2024 10:38:21 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5c877a8db97sf1986385a12.0 for ; Sat, 28 Sep 2024 01:38:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727512701; cv=pass; d=google.com; s=arc-20240605; b=e6gqv2cNE7Fl0uu/XLbjRpo/ZQy8UfzDM4rUHzL6EOt12DyaOP1JutyQw6OXtega8l rm5u+rqcBQsRbBLj5Itid7FeyZsJ1VORXAZm05Z3b3j/OmGleVhCDJIZSI1KMrijemzp +WREB1IoCZsoKcE2//okscIupYjl+gXWNxSj1SCkbxtNsD07alMXjcCF5bexnOZq6vrR gXBPtCvQFkHQxJU9MSM+L8mjAqiodAATrfZp1p/glguxmNvzVbWKowAUtuSGCe4judAt r1pzISsiDkDMu8CUOA2M0ADKSK7LOpPuNBrxn4RJ9pypC8Pd6P17611ib0c6g2+ab0e5 i0rg== 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=Ig8TG/WROfQE3VTOrJ0pUmjlH2SjxILxAMTTEloFj7Q=; fh=BJ21x+Wo87euDVXCPcmNv/7Jf613rHP87tGUcKZ1I7o=; b=HeC04JsTHo81mo3oWJmwP76wI8E5Kb78seFvKj+HayBWwp1JaK/OTX0mbVUd8kGeiu h2CcPvm2AvWhNpHTjYqA37PALyNiLxp/pXX60uMNt80g3CwE13u3sce8h+BV/Df2GNzv L3EA/AGqzU35j2nWp/lmzPyR8/+LA3nuOri13BcBRSHhpin1aKU7AtBnUW4wSniv48nR tvdG2NND6Si/ju1t3lV7AkReifpQrCslvY1w35HfQPSolw1UHzs2VBVQv+i2m3CmEMFx R5/JS6OCPciEVDc6s7t2VP2mg8hBa3xf5Jl0LmzPudP4zkOPxn7D+cCFH1RXsfAuTGr3 AnKg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HxthSwqU; 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=1727512701; x=1728117501; 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=Ig8TG/WROfQE3VTOrJ0pUmjlH2SjxILxAMTTEloFj7Q=; b=k9EZ074SGLai+o/PVL2xqRtui9VrCBeMXFxeXtm+DqsQlkHtZIDisTXynSUvAZFRWg tMOdOkyCcFeLib0lbbK5QYd3n79VDpfkzJKFomnBZlReNVP8BzoNrnTgrp9P218stZUw WUlO2cpVkGVMQTMI7Zknudfv2yL/FFmnZv0rA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727512701; x=1728117501; 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=Ig8TG/WROfQE3VTOrJ0pUmjlH2SjxILxAMTTEloFj7Q=; b=nR3m4lrzT6rGM2rMzgJGdqQhn4gDbGXO4bpeY9Q7jZEmaTmBqbz5dTcCL8BpwBuXMi 5hloV2beW+67woe2DVsCnIV/fheRX0fV/WH1aaSmLpdnOUv1q5ODW54a0T9v/K5vNngG GDoi1Yg5ytdTtb7vRsUps16oHvdQ6C5AX2akKDvdQIAakRyKhE1EdbBlWrd8Y+zWnnej jYZGbRrQY37s4HsKcB27uY/eVL907ujl7YAX8UYFFQAmkMLAod+7oGQbjWKGhEe64zlD CoVyAvYnFUN3STfEeRCPzcnp+blcTRgzrkEYbhpXmmPhQBduymg3OKWpn9KZA3IBTWme QK/g== X-Forwarded-Encrypted: i=2; AJvYcCWks8dHjNgOlO0EC4vfc4MQsqMK+reyImjMcXUTaxjBpW0UWDkHQgfTNcxsMMJVO3kvBwiDNwSApuPMj4vN@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yz3oLIo9OyYq8G+42hFVhjE+hb/F5LThQK5BttcnWJDHonXGsdU /XDCZBXxTRUlNZepOULrX7hKRLLmyyiWu2X+hraeVqWAoW8Sog72PSf7eQbH2dX2NQ== X-Google-Smtp-Source: AGHT+IHwBXRR4QcZO2paZIWyxrPoC/oGOQODhP/Rss94UBsO3ZRqszg4gWLT+EsH/OnpvHcUOpjZow== X-Received: by 2002:a05:6402:5190:b0:5c8:8c35:7cb7 with SMTP id 4fb4d7f45d1cf-5c88c357e2emr693989a12.5.1727512700876; Sat, 28 Sep 2024 01:38:20 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:4307:b0:5c5:cdf0:178d with SMTP id 4fb4d7f45d1cf-5c8778191e3ls1625438a12.2.-pod-prod-06-eu; Sat, 28 Sep 2024 01:38:19 -0700 (PDT) X-Received: by 2002:a17:907:2dac:b0:a86:96ca:7f54 with SMTP id a640c23a62f3a-a93c490983amr487523066b.21.1727512699352; Sat, 28 Sep 2024 01:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727512699; cv=none; d=google.com; s=arc-20240605; b=la7W30kyOsD52SpKz+bCNkQrxyTCuee7oP7yyDNAxrszJAVsgTY5hh7Dy60Xuz88R1 MaOgUcEkHIp6bFDvT4psg1Bq2ee7GeIDJbloYAKxjengc0J9DBEVRyTVLcUDXoaZt430 +Yw8gUyapnfxxFKSpLgyZ2DEfoPWnZ+iN55q35OKWnV8wbW4DG2Og75/UiryBnkKX30J TUyumXTrk8Gif777qAy89CCpV1q0ums6l0+WzkEIxJ5L2t0esQigiSye33Z4EL4KRs/A Fkst1UlPxHgipQ3Nk1roVyWn5o5rhm+1fd/b/PRsGRA9SzrMxRnAD9pG/8tVtWaAcHr2 0Vag== 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=3VEkdzuU9Qc4GQ7KPC08t+6l9YpInoSw+Q79uFbywaU=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=jzwDVszqWDaTNhD/515hRiBhGqOBpJLbG5v9S0rA4DaTFHyZHYnY+aGN7eCkqk4r9K tHsUKY8hk2HN5ZASLXhKlMqrnZhjTSKTlGZVluoU185AFo7UdPIP0d6lVA9kTQHNpC8+ 0XWIzlqVl0EH+yKnQrB04vpK/znHRvKYT/ijjTCIyxFKjfZ6HhY5KIFWx8ACrNrxKMTx Kcm8bFEPdba/fQl1KvqTDJZ8JisZwpK0xyRdtHcvJr0LdRMl3Rtt3eEoTWfJBFIfv9I+ 6Fewy+Es2hLR0+JkUSdYFBn+U+r+QirfjZEJXp5GbHcptGdqs8Z52wGipO100BnrnX4M rb3g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HxthSwqU; 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-a93db7ec243sor41754766b.4.2024.09.28.01.38.19 for (Google Transport Security); Sat, 28 Sep 2024 01:38:19 -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:3f17:b0:a8d:c3b:b16 with SMTP id a640c23a62f3a-a93c49299c3mr607559266b.28.1727512698854; Sat, 28 Sep 2024 01:38:18 -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-a93c2947a48sm223679466b.118.2024.09.28.01.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 01:38:18 -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 3/6] clk: imx8mm: support spread spectrum clock generation Date: Sat, 28 Sep 2024 10:37:51 +0200 Message-ID: <20240928083804.1073942-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240928083804.1073942-1-dario.binacchi@amarulasolutions.com> References: <20240928083804.1073942-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=HxthSwqU; 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 --- 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);