From patchwork Thu Sep 26 10:48:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3523 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DBAAA3FA6B for ; Thu, 26 Sep 2024 12:49:02 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42cb236ad4asf4755665e9.3 for ; Thu, 26 Sep 2024 03:49:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727347742; cv=pass; d=google.com; s=arc-20240605; b=kVcz1H50Cu9662IFyops0HwQ9eZFGrrduYyWjut03p2jAWcqATYWdGAaNosOX1NizR PwmiqJH34g3Zvo/Lg6dRRM/PgXwIgyNW4jnzdhHzSXX334PR44GRN76dyapp4pQoO8Pt 64H62THJvQnrSYo2udEq7P1PVhBqWF7RUVS1u1lcpLIp/1Xe6Tb/ytPvjpcKGGpu+VQk 1Y/bN+okzKMRsYSyfFbnZt/381fd3N4fzZZ3ayYVGNV1py2f/ZKeMDsB0XoscilzTqOB jMu5evBH8NJznujf0JTsmr5CCjzR7w6mB5m3FyHax+o6kYQCDdPlX5fWop/90TmhsFS1 hVYg== 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:to:from:dkim-signature; bh=Ig8TG/WROfQE3VTOrJ0pUmjlH2SjxILxAMTTEloFj7Q=; fh=t9qN/NylXtS16ordiKRInwYcAPWW4guBvNqLBZrlHLI=; b=KXmpyLEPIoV1vIMBwfNA9cwkCv4KfutdjYLPuEWrwAtDEwrSJZDl/djjp5rXEOwL2U b0IusoQnPLyJz3kcuuqs/i0tvOxF3GtL7+rZ+5SZQEfGiZNYOMkkc8xN33UPgl/f8gdh d+0ODvODuWe6VskMUdp4E0fszrl7oYgJoEl+QBBbYecWL2amCgGAvLN9msdCIYFuXFIz s/ge17rkiWcA1YZqhhKzOjXSCBoxhkwCWmXNmgt+84tjOTNIxzV+xIJDob4o0EFd+i1H myTFIk4dIl/alH98VkIlrsxNs6rJRESzCcTTtwY/2uLWTpk9ChoxZXqziuKGDcOCaXTL aUSA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=o6T3SSgJ; 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=1727347742; x=1727952542; 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:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ig8TG/WROfQE3VTOrJ0pUmjlH2SjxILxAMTTEloFj7Q=; b=I/oehOWzHDI00MsQFAR1K48AISz90gIkTdDtb+Mpm43bepJNugMmhxj/Qd1lZwlXAI XYUXB9W/O+OotCEKt2BkctZ94S99S9rUYH69eg/GFG5O+mEDxTC5sy/j8SdWD/qI5bnn P3G1J45ytDVRfnp6jYYn92NnmB369TKiAta3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727347742; x=1727952542; 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:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ig8TG/WROfQE3VTOrJ0pUmjlH2SjxILxAMTTEloFj7Q=; b=o4nAcCRErs7whIGKTA+mfGxxa4cCl4gsAPOMuT22yz3w3xEbjvu2boRugfwuq1w4lE 9eChnzs14joQ21vFWjnYRPYsyjr8bkj3pT3xvmJuy/XzmBVTg6yoS5Rpvz6j7XxqOagF zt17vGMzI50Fmxrr5Kcg8alkp5Mr4sBZTceHF2CKQMc+wMJXimCOtPFHLsRYmzvclMIQ 6QEcHl+EQfuZgLtvAgp48T9L+JAj71jYb4yMnHLnNr71utGVfPr3aryYv8EWsRRpqtPa oBL7mysSJeaJv2Zmi0gdqYtqQmW2A1saDo0Lfqfeb8y1+TsIksBNvCTu/USTmVZ9+F74 Kojw== X-Forwarded-Encrypted: i=2; AJvYcCXKYxByCnx6DRMdm6dcEFQmg+a/E6Jb97ImBrkCF6H36WxdvE3lsxG/1S33iWoZriW8MjeldaiaFhIenZpR@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yz1hJiUMArvD23r8+4K3S4cLjtlZWXkJI3Eg7leRFe5PR+L5aFV yAl86G41oPhR+mwFjzudLbjzBMmOn5UQNbdsdj1ckuWJZx/foj60pKhXQkwmLMfBzQ== X-Google-Smtp-Source: AGHT+IG55nMicqo4ZLR6xpfrsRypzO+ndcaX963tarCuZNYe49bFX9r6Kt3OMJLcPAx2YijnTOTFaA== X-Received: by 2002:a05:600c:1c26:b0:425:7bbf:fd07 with SMTP id 5b1f17b1804b1-42e96103a1amr37816105e9.5.1727347742422; Thu, 26 Sep 2024 03:49:02 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6000:2712:b0:37c:ce3c:dfa2 with SMTP id ffacd0b85a97d-37cce3ce04dls204935f8f.1.-pod-prod-08-eu; Thu, 26 Sep 2024 03:49:01 -0700 (PDT) X-Received: by 2002:a5d:6a45:0:b0:37c:cc01:f7e with SMTP id ffacd0b85a97d-37ccc010fc8mr2012825f8f.58.1727347740926; Thu, 26 Sep 2024 03:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727347740; cv=none; d=google.com; s=arc-20160816; b=Y5w6bY9GoTcqS3KuKWzl5i4IlDGooNFgp8Yvio00TLuMFLhcyHHDqXGGcLzIIZ73Jk HzM1QR/SwVfBNeqWBE+sZdUDN34iOeQ52HGmVpGfOXB5dUEQ3HmnVzW9boycT3qUU+nr Zba3Evg9uMweJFWeCcaDFNBdgZHZERoLUz7//LIMNP1dj/DS9COSq/xgCclOCPUJDUyJ zvw63TaZZi7RRi5CzR6PAZc89VVdimizlDm5oLuNv1K3ecBgCYC7PwQqCO5Cx5N4z96z QWpg9jKOopOcfLeorkY4Il+Fdy6eNi+JzLxaqOpg2KI0P2Q00IiSsMgDApigsxHrLtmv z2FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=3VEkdzuU9Qc4GQ7KPC08t+6l9YpInoSw+Q79uFbywaU=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=1LXceJZ2GEDbHYoYG/9jJPy1nVP2IasT+cThrNuYhPx0UwhxpnRlqJ0a7c1My0VF6H aCYjTVHSRvbIJekW8ai73XZrQCi88z0m3F6yVApAUX0UxWisDyeSpmDrVxnrkT5SSQ41 2eeZjj0VEkWEE0ELqIsF9peZJaV4D2ay23z/SFLeP03j0r7nzYioczyPDZB0HjNWJvpf /P+ebpxL5To69qNOwEuqPLn19l1sG5x+6Nh11JmnNbtznnbsQNr6vUsgKSptlhUOxAiS myEeKJJz8h0y/a2lNtFrPfsBAaMnMcL8GxujYaGnOp/mn8tsfmdJXn82Lokef05QjCKw +E5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=o6T3SSgJ; 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 5b1f17b1804b1-42e906570dcsor22620735e9.0.2024.09.26.03.49.00 for (Google Transport Security); Thu, 26 Sep 2024 03:49:00 -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:a05:600c:3d05:b0:42c:de2f:da27 with SMTP id 5b1f17b1804b1-42e9610381bmr39911275e9.2.1727347740288; Thu, 26 Sep 2024 03:49:00 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.126]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e96a55336sm43314755e9.47.2024.09.26.03.48.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 03:48:59 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 3/6] clk: imx8mm: support spread spectrum clock generation Date: Thu, 26 Sep 2024 12:48:52 +0200 Message-ID: <20240926104855.656121-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240926104855.656121-1-dario.binacchi@amarulasolutions.com> References: <20240926104855.656121-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=o6T3SSgJ; 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);