From patchwork Sat Sep 28 08:37:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3533 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D4AC93FA6C for ; Sat, 28 Sep 2024 10:38:25 +0200 (CEST) Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a8a9094c96csf194654066b.1 for ; Sat, 28 Sep 2024 01:38:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727512705; cv=pass; d=google.com; s=arc-20240605; b=fNl+c7zlnMf/4Rrbo9F/n3v2J1UX4aHqFw+SeGFupVVYu+gQM3/D9MbOe/d25PKAYj XAay88TD5ZN75ijwXY3PRvPZmVuof9b3+Lij5miGMWBMKr4dVllN+BwFDari97vR9yS9 dKvzquvfsEYQVkj4quSSwnzGGOIQhowf68nLrqSNK8iqM8YWMIVf2j6dmxFbT12fbK4V NH+B2Ul/2mbELogfa7djr9agzNd7QPpFLDpxr7CzEFNzrhSKIpHNrutCdO3UOUvPd7GA 1OpPHhOPLS/OseD8hDaaEdYRK648nmXBb3q9hqQIayi3abN2+WZXDxhvLXADi1Am3It1 5hOQ== 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=/49e88ScGTaYGQd3ub28lfNQG6D4TrXc9H1hUqI6cz4=; fh=R2l14idxMc4WOv8Ku5HhpAetIcsh2KTLMShCDZP+zxE=; b=gSCSfHFmX8g/+KPxkaz29+C5/8x54RLZgpUK668zy1Izd94dT954K1U8HORTqEI8Wa K0G68ehEh8/Pc8TfpJ+pn6Z8jKFYuiHJ4yYr26uZBY3POWFLrnNxShXkql5jaHR2MPjt L9NZ3oqNo08/uV45DJ2eyEk/go9pNM4q4FxPQRIz6ddnjd8fPD2s/vvidj3oe8ZpWdje Amw60YG2wMLhCdyAF03gXAd7DQi+fIalwxCMif9HMEIY/aNP2arH8XMINVIgUAMByE+a OJ+c8iLQhoBW1EnJtAw3ZXufq2yGCfCrbsO09CRkCFeGMln0cSg1+inb4wLb1W51FGci 2CuQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HfyqbE6O; 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=1727512705; x=1728117505; 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=/49e88ScGTaYGQd3ub28lfNQG6D4TrXc9H1hUqI6cz4=; b=Nc2fAUQhVXiCYNrMJ0wlhic+EDEqsD2Ht48/xgdGPop/smnl4X1bnNFuXoMuQi0FXi r4O+Th/4+GEf9h4G/WxcN+owOv3TQqQ/wKB+Pv78OHIc5LyvAIe7NbueSEABgl2MBDOd wc+pWc9jjKcoIsLOhlR81bAmo6qserIYB2ZR8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727512705; x=1728117505; 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=/49e88ScGTaYGQd3ub28lfNQG6D4TrXc9H1hUqI6cz4=; b=fi4UlVLiRmUT7J9+R43bXhoXsdPcDtPizNlmAJPewmtjaOqiYhOGzibUXqPh5CPna3 flIFR9bHHNQd/kyN5/C/CX0655VVc0PtO5KmYRNrQElRwhxzLiBuooAClVmibys1jb/V kVuZGBGdtGTL2AJBEM9WiwRXtU5mSgJxRp0w6gIeVlX0NbRMWJsSRWGZ+lAWK1HZOgPr lLs/2QArcBH6x8wCqHheoW/ajLCLR2+dgNjOUQODRzLEJVu4DnG5YrWPEy+Epmjrg716 fFQ4ly1+9HHFNT+ZCto41EWBcoIxX2gMmIt8ZYqGDd9Qhl+Tqryt9CRknNZTZirIWBw6 C15Q== X-Forwarded-Encrypted: i=2; AJvYcCV0DETtN7E9FvKtXMNs9x9r+UqiqLhMdFdONw3tDb0pmsP+0RBtQlxMzF/eJX/K2jGvwRJHuFVLYNXhwafV@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyeuhyhTRShMzZ4XDKL4Smvz06rrCy1Mjf21NLozIqE7G6XdZtX cbEVgL+8nGxKct1pkEN6UUuDw+gP8JHVnpZu4yin5Q6IaY/3934aGAtZ7pMWJDOTOg== X-Google-Smtp-Source: AGHT+IHCJBbUHUXHoBptkDASq17K9GVPqkLi6j1JobzUIY5r6l19L/CsQSOaXeCjXsVieNqgh8s18g== X-Received: by 2002:a17:907:748:b0:a86:a30f:4aef with SMTP id a640c23a62f3a-a93c49199b6mr523144566b.22.1727512705516; Sat, 28 Sep 2024 01:38:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:5113:b0:5c4:62b5:9aec with SMTP id 4fb4d7f45d1cf-5c8778096d0ls574232a12.2.-pod-prod-07-eu; Sat, 28 Sep 2024 01:38:24 -0700 (PDT) X-Received: by 2002:a17:906:794d:b0:a8e:a578:29df with SMTP id a640c23a62f3a-a93c48f0c1cmr626990266b.6.1727512703869; Sat, 28 Sep 2024 01:38:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727512703; cv=none; d=google.com; s=arc-20240605; b=BJzr8OMtrJEFrArXCRHFkCnEQe5JhOlykgb9bpPlS1cKMK6BbdxVz3hqhig3JC2+J3 ZmSt9skBd9TC98AHCtT5jmCdGyLjOL78z2i6Fn2aTnXbpH0+Vtq6C2RmyyNQn5ukWYE1 g1N7JQkJhJCC75lB2r5Sm1IuPUwQ0ovskOm8wibSt0jpO82j/Zko6+/TA5pQlHT8Pyws d9XOXOVgg684yH97wQ6MKKFBQmFzJvDFvkecRUuht6C0JWQFS6QSpm2nXdceu6yhO5qn CI8rTJ+Ea1f7uSzvHmwRR0/5Wt7YPWjB2XwAYOqhTtcgNdF6Ay8FpFXTbqkWEvVO/oT6 syYg== 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=SqdVHCjP2z3b3GmppGHkZvxobZmXnCslqoKDvGYxVNw=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=iJ8izh2aoVkBlzntXY7mEc0HlpJfeF8yHyD4xrZ0PArqDTpwhi0J+IjJ+Jnr0aXutt Ah4KhdCuc9LY6Q5PO3njkocqAzHLYd43OZYLVhr8gU8+Yx3MuLd030UE6LQKHdWRuC+X DQA9BDUH+5oYmEVdYMicXw91WeRVE5AxzTtn5acKTx4ANt4xW9AvObyaNVZkYCBzEktD yxkPL3WUU349rEgg2twOTR3WV76zo+IRkgqpOVpb8drBofRYolN52gIodz6HI0+p1tzP fSJO2AvOVbiXcF5mE/fxIgaqMXo6ZjFTLenPFojQulnFyeAjzHUh0bsybd4saDZXMC6Z 30YA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HfyqbE6O; 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-a93db801612sor29354766b.2.2024.09.28.01.38.23 for (Google Transport Security); Sat, 28 Sep 2024 01:38:23 -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:74c:b0:a8a:3ece:d073 with SMTP id a640c23a62f3a-a93c48f1b54mr526812266b.10.1727512703361; Sat, 28 Sep 2024 01:38:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 01:38:23 -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 6/6] clk: imx8mp: support spread spectrum clock generation Date: Sat, 28 Sep 2024 10:37:54 +0200 Message-ID: <20240928083804.1073942-7-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=HfyqbE6O; 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-imx8mp.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c index b2778958a572..460e8271def5 100644 --- a/drivers/clk/imx/clk-imx8mp.c +++ b/drivers/clk/imx/clk-imx8mp.c @@ -410,6 +410,7 @@ static int imx8mp_clocks_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *np, *anatop_np; void __iomem *anatop_base, *ccm_base; + struct imx_pll14xx_ssc pll1443x_ssc; int err; anatop_np = of_find_compatible_node(NULL, NULL, "fsl,imx8mp-anatop"); @@ -449,10 +450,14 @@ static int imx8mp_clocks_probe(struct platform_device *pdev) hws[IMX8MP_SYS_PLL2_REF_SEL] = imx_clk_hw_mux("sys_pll2_ref_sel", anatop_base + 0x104, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); hws[IMX8MP_SYS_PLL3_REF_SEL] = imx_clk_hw_mux("sys_pll3_ref_sel", anatop_base + 0x114, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MP_AUDIO_PLL1] = imx_clk_hw_pll14xx("audio_pll1", "audio_pll1_ref_sel", anatop_base, &imx_1443x_pll); - hws[IMX8MP_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", anatop_base + 0x14, &imx_1443x_pll); - hws[IMX8MP_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", anatop_base + 0x28, &imx_1443x_pll); - hws[IMX8MP_DRAM_PLL] = imx_clk_hw_pll14xx("dram_pll", "dram_pll_ref_sel", anatop_base + 0x50, &imx_1443x_dram_pll); + imx_clk_pll14xx_get_ssc_conf(anatop_np, IMX8MP_AUDIO_PLL1, &pll1443x_ssc); + hws[IMX8MP_AUDIO_PLL1] = imx_clk_hw_pll14xx_ssc("audio_pll1", "audio_pll1_ref_sel", anatop_base, &imx_1443x_pll, &pll1443x_ssc); + imx_clk_pll14xx_get_ssc_conf(anatop_np, IMX8MP_AUDIO_PLL2, &pll1443x_ssc); + hws[IMX8MP_AUDIO_PLL2] = imx_clk_hw_pll14xx_ssc("audio_pll2", "audio_pll2_ref_sel", anatop_base + 0x14, &imx_1443x_pll, &pll1443x_ssc); + imx_clk_pll14xx_get_ssc_conf(anatop_np, IMX8MP_VIDEO_PLL1, &pll1443x_ssc); + hws[IMX8MP_VIDEO_PLL1] = imx_clk_hw_pll14xx_ssc("video_pll1", "video_pll1_ref_sel", anatop_base + 0x28, &imx_1443x_pll, &pll1443x_ssc); + imx_clk_pll14xx_get_ssc_conf(anatop_np, IMX8MP_DRAM_PLL, &pll1443x_ssc); + hws[IMX8MP_DRAM_PLL] = imx_clk_hw_pll14xx_ssc("dram_pll", "dram_pll_ref_sel", anatop_base + 0x50, &imx_1443x_dram_pll, &pll1443x_ssc); hws[IMX8MP_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", anatop_base + 0x64, &imx_1416x_pll); hws[IMX8MP_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", anatop_base + 0x74, &imx_1416x_pll); hws[IMX8MP_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", anatop_base + 0x84, &imx_1416x_pll);