From patchwork Wed Nov 6 08:58:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3629 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4AA773F14C for ; Wed, 6 Nov 2024 10:06:22 +0100 (CET) Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5cd50bf580csf4840883a12.0 for ; Wed, 06 Nov 2024 01:06:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730883982; cv=pass; d=google.com; s=arc-20240605; b=aucVCNYEfPoOi5OArbDcgSfcFv0rtscAvDwtpaZoVWEEeqy69Eh6OHtwHlsMdNOoGK bCLDaULrmNZw9yaFNXH37IvVK/G5JV9pkfIltjhD53LRbjsG8dAX63iOCTnM7cBz8nnU dWkXu0c7VQNo5MDIzeFEPb2HCnrBDGN+wWfugP9r2X21MV98S+SJIoB/tr+kTrT8WYvJ Oq+zXI2MWXsbNE92hprybG9KVZcVAW4U/yUerZojKZldbtk4co8zqy3+ebHEHkbWhBS5 x6LHwhtki1VdyTxfC6xD6CoZ98Xjgmy9BEkfJyzonZflSBHTY8CzGzDje+iCutZCv8BN suDA== 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=GLdMXTYpU11ggDWT+hfJ38Qdc37pDWBA5m/cxRFaSGQ=; fh=oZCegZ8GasR0ehToDku0JqWYBrIc5Zsa0Kwirfe+BFk=; b=X5vYAid3RLDr1xgxjKUasOxZGRXwdi1vfcyiZRCzZfEd7dRx15BVeAriXPszn9+kEQ 5RDg5yP+dNcAmfvY2yKjnfSG2Q3Re3xD5s9dcX8RDIZkamroQtejAVPASjuGpeFLo3cl VRdkMHIjukiR21GvBEic5Udz/KSkcKYWplMJlYFsSd/ZbyhrFL55sdJnt6eYZ1DYxQP4 /ABNHXpNAN0Hm/hA/gSorvDyAgTf6cbYOpQ+3rCjVMHpK7gkE55Xz+aI7htrjRvsqyNl 0yiJw/YB7/95gaMfMFYleKZb0Jt8NjYYMwtxtX+4lgHVB0wh0TknL5zAKAPntnyz2mG5 aXzQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MD8JMzyv; 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=1730883982; x=1731488782; 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=GLdMXTYpU11ggDWT+hfJ38Qdc37pDWBA5m/cxRFaSGQ=; b=qb2mWLv/EoOtj9EzyNBEytu1VXGSPCmZCwJhjuGp0rxRwAxP+sQtRB15RgCPidMGmB 06vw4dx2PybbyUN9fIymxnQW+PVVOIcB4WCpThi9S8xjLizej/LK0USsiypwlK82iA/a Q8hc3QpereJws9JWG6asIGrnEKJgurR2A2RQE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730883982; x=1731488782; 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=GLdMXTYpU11ggDWT+hfJ38Qdc37pDWBA5m/cxRFaSGQ=; b=c8s8rTmY+WRrDaLfHo8HCljMSTH9tYNu0GPBSOqJzeNx/GmAPqSd23tzLqvNxAtmPm TtdnNotGiY/kpNFq1j3gzWlXc87oLfpr5l1jkK6e8XQ78y+KWMVwoYvkWIg2etUurgjg gOWbXQJVlu6O6idEml3bTLIxzAMi2hzz9v9hf/Gsp40RsdBHcpGSoe36bwlAy9ZZnv6h qmjuAraBCFzaEh0NydAvKLasumBsLrLO6JZPfAwY7sEl8gs6CMwvULVAVWFwcKJIaQEv deIj3y3MJYmeQiflmZLGW7pj7UbVJDFfTn6gyiND1+DMME2OA/bHBxjXH2VOX/1s/5fd dsoQ== X-Forwarded-Encrypted: i=2; AJvYcCXLtoeKlI8ehD6haejuJXpZpiZEdjAfaIStZBXqGR27OjlSS06E4/ZXV0bpCQdbBJAm1sEdnwXUCb/ULohv@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwtqaxNEt587G9FxMm0sB2NIEhIDT7w0PkAsdZXBE0P3GbtL5ak pN3TA7MA7dTCtSVFoFwlzMQ0/kFAjudDOOWVLqZC+scpPV8A7GZfn0wUdu+Laswwbg== X-Google-Smtp-Source: AGHT+IFoY5nMpXbZikYra+xkBbD/WXKTN5aBVYp4viXTZYDWEEqRwIjktxv4MeToCcNSanF2y9lgaQ== X-Received: by 2002:a05:6402:5170:b0:5ce:b720:8bf1 with SMTP id 4fb4d7f45d1cf-5ceb93847cfmr11658115a12.31.1730883981871; Wed, 06 Nov 2024 01:06:21 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:c143:0:b0:5ce:c9e0:aeb2 with SMTP id 4fb4d7f45d1cf-5cec9e0b1a0ls805932a12.1.-pod-prod-04-eu; Wed, 06 Nov 2024 01:06:20 -0800 (PST) X-Received: by 2002:a17:906:b84b:b0:a9e:b68e:909 with SMTP id a640c23a62f3a-a9eb68e0a79mr387361766b.15.1730883980006; Wed, 06 Nov 2024 01:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730883979; cv=none; d=google.com; s=arc-20240605; b=L5CbMk5Invkm17/O2KXFMhQdfdMRwch1IFBixg2vzyUgc0jr0AEGfivam42pNGXIPy WFQdm2RrWEGBbAIEWBfZIsQg4MY3wBswA6dYBUDU0f/xtkTDnpVXnaM4KrjMJqb74Riu 2AXqQztfAbIidYpg75mTVrncp7ZhMQYH5ENdRYLy+zCO1SOTLaryi6VuYhsMlbMWJ39y VBS3eKXI03KuQJ5CW+HtPfDv+02aDPZARdpJIF/h2gZc2jamWPTZ6iK955Kg1biycPrj O0KQd/lBm7FX5E9KYBIXHe8R2WGj4nOrYwAW9OYDK6z8j8vp7s/4XgWjNOaxcrVaVoZc 1QAA== 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=eK2D5YdiBqlMNYfxLWNo7UJDqbeX8vHqHTifMmfFsII=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=kOSe0xYi5M89YQS+WprhV5IBew2BA8rn9cJNZbthazTL1CUDIfCd0beRbCFDurTOCx sx5AjckrgDk38E1bzvsF+ghwowxJe8P9zUvKBmQk9taMuKIfs4uutFnR+y+LP04r0RnR tajj5wMW/3uXvSM4Qf55bKuu54RW7DzLG1kpa5ZjG9/XWc4qoI6PjOPEYoRZ/74JaqsI 7xJmEEb8DOHNyGbMRTOBH5peKQMNxkJZ6znNCjn8Ht8NSllJayQ4cTHRTRj5acDRPwh8 hKSLg0C4i7F7j4BFSt896krR+AvC0Iatt6kGpAKBQ0FcdAOIXqRlnhhg/zrzCWFJCP+n dUtw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MD8JMzyv; 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-a9e564a48e9sor611866866b.5.2024.11.06.01.06.19 for (Google Transport Security); Wed, 06 Nov 2024 01:06:19 -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-Received: by 2002:a17:906:b84b:b0:a9e:b68e:909 with SMTP id a640c23a62f3a-a9eb68e0a79mr387359966b.15.1730883979467; Wed, 06 Nov 2024 01:06:19 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6474:ebbf:afb5:f524:6416:8e3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9eb17f9422sm247781366b.139.2024.11.06.01.06.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:06:19 -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 v3 8/8] clk: imx8mp: support spread spectrum clock generation Date: Wed, 6 Nov 2024 09:58:04 +0100 Message-ID: <20241106090549.3684963-9-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241106090549.3684963-1-dario.binacchi@amarulasolutions.com> References: <20241106090549.3684963-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=MD8JMzyv; 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 --- Changes in v3: - Use ccm node device 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-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..e53a688d2cfe 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(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(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(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(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);