From patchwork Thu Sep 26 10:48:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3524 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 BBF4F3F38A for ; Thu, 26 Sep 2024 12:49:03 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42cb6f3c476sf6214065e9.0 for ; Thu, 26 Sep 2024 03:49:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727347743; cv=pass; d=google.com; s=arc-20240605; b=SSZEPXwm6ZauwfWmAiv6jxuCZcFTp5JAO1eUWkygUXFHv3bxoq8KdqlFtRPmoLyuqy 0Ny4hpC785FzTIY+UKkTSi18sXBM08XT84unSIm07n+tqfts/okZvBxvPW4aquIUTo6Z B8/v3to3Oa5URAEXo+d5YgznO/H8DI1NtI0rdxLETbQY3MjAXnu7sQCqgmMARkBffYRh Db35IPO3ao95Qqd3/eZII/7Q5wUGbOZzDLTbOAn/hf/EvRNnMDRHAWqTl2LKQb1qqLC+ xXRecBdG2lVuBniOosbd/LjtkTFkEpTO/mWOpVunqXdL12i4Y3BktJDw4tbNL7g/T4DM gjnQ== 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=zq7nlSstzM5H4fQVlpl3Vl51/f+q168W1Jhf+dpR4z8=; fh=0/IJABBzyyyyAXTc/gi+qoebGMZo9PbuEVeDmx364V0=; b=XJ5kHJ4adpCrep7ttPYGV6RIgh8ygrBQIbrmStmfaMiJLCJLhyb3a/4xhKOmlD5hTa E48d0F47mYr2JI/43aCZ6ieFR2I/f8nY4IHzKBLh7ZTz084WMfldkfaWe/CZJfxW3SsQ HWmUm+X+EcvA0rMldl+MpGGSPRevjWtKAsAbaKDcbESw1kL+DQloVVbFmSI2TnKyL0MF G8N4zBHYuyNPvUKi1hX0JeUQIzY+6vAB3csDwwkm/OcsfVCBzmNY7gMH32CSIi2e/JRH u7acfQLiN+XYLoC/ow2Xud6l3Fz5kW18PC2a5T3I18GF/8uqK5xDiECTMTQtFKbd7qu8 m7XQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MiFwpr9p; 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=1727347743; x=1727952543; 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=zq7nlSstzM5H4fQVlpl3Vl51/f+q168W1Jhf+dpR4z8=; b=hPFRgpu9MN9WOctDhGCp5CP0bL5s6xJUybD50y2QWYjibmhVLkb6a4qm3SVGGsL0p2 SN4l7x6dRggmeuneHChuWoxhm0SRBv5g/I7DZthABtMaCwYIgmagZg+6gnz2FeTLLFXF r0ck3zpAnq6KB7+Z2Obit01a9WTR1d2GE6DVQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727347743; x=1727952543; 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=zq7nlSstzM5H4fQVlpl3Vl51/f+q168W1Jhf+dpR4z8=; b=xKDXYaCBGvJubbRDfKPtvD86gnuQ6KsUcWpHGn0tLSybAClc/Ci8wR+gYuR02Y209o 1JN4yIU1oyilOpyZ1jnbpCEY71rvyCjBh2QLTwLzEev0fcMtGyBc0zZ4Q/Z32vcMFPoa gL7yyyXn1twokB5uHFg57ERTT10n2ZDnNO4n4C/uX4Vz19NiTJYSCtVVR1pjutZxrUII ZwnC4OGXvsvvhL9XwYBJ8xMMEHn7A5UuUMOBLQOGYI9BQKZvZ0aIN+Nx14LF2lKQFJV4 tTx17uufMd6/tkdtQ/Czv9dNH21UtcRpk1gihsOLhzwKv9cNR656x082MelnK6QwfQOY VKpA== X-Forwarded-Encrypted: i=2; AJvYcCUxoq6MoQXvJJwA6S9xMK/IaXkEHIuxjNm0Mi6OEA0BcGGeXFkQVuvtRlLGfPYAG5nREP48dtFJEhzKegbm@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwNVuqgThqg9kmWLFSUklcL8riGqI/bVprj4j9IP5fbPATScJ+V AJb3P3HGEVWTJrVbieqVOrp1FmJ9s8BzubM73ReCfi7QtB3fQ7fciVfhTHkXCjwsKw== X-Google-Smtp-Source: AGHT+IElLGwZSaZjyJAVAREZrVQnnZqorQ4pEjDWV3W15ZVmHfdFKCaDyNvUOKBcqZzxwLRsCtF4hA== X-Received: by 2002:a05:600c:3b1b:b0:42c:a90c:a8a with SMTP id 5b1f17b1804b1-42e96115d55mr45491585e9.21.1727347743369; Thu, 26 Sep 2024 03:49:03 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3b9c:b0:42c:af5b:facd with SMTP id 5b1f17b1804b1-42f52229b85ls3913215e9.1.-pod-prod-02-eu; Thu, 26 Sep 2024 03:49:02 -0700 (PDT) X-Received: by 2002:a05:600c:1c05:b0:42c:b63e:fea6 with SMTP id 5b1f17b1804b1-42e961362e8mr42955335e9.22.1727347741884; Thu, 26 Sep 2024 03:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727347741; cv=none; d=google.com; s=arc-20240605; b=cpLbF7Qj/HfkCfHM02W7u6dXQ+PniXT69CgOoent/N/0A3CxF11BhhPRA16hVJeoIe i/WBuxxKLsLGOq0LZ5kq+1foHghLGSu1R03omCc8qWc37uwjg7pE835hPhcsxunOlmdY +vLHAoteL/h4omTgwgCd77RD/tCUJ7Yff6ONhArZE9njIxtIHfDFaJD19uu0UlQcy4UF gpBI4uNlx40FawSIC1aXAWePOddEmzJI086Vn40XIUirSaz5/l3CPMdd8whWMI/1vGKW wCepF9Q1T1ZqR34NfarGV1OP97ltOZqI3w395yqu3ZB71J+u0AMB3Yi5blKnuyz4dnUt C9GQ== 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:to:from:dkim-signature; bh=8yZI1Cll/jgswR1C/8/RE7gUqkNMAx5u3jKxacFOTcY=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=Q/NfU1vTnPsJ0MRdMdzul3Gp1L8AhF/SbXd5lLUgkPs1zQa8cgFKQKJjDwzIXpaqtd iYffg7+YwG9b2wAkAXwCdwELMZFgLkJSW7PlhNgAH1/UgRb2W3VcNxeZawEeGKUja6Mg PXl8JOklwqOQhuEBqX+g3oB5AVE1GtpHimDuEdoTF+Mc+UtysJ2Nn7uQUWbDF1NIBxIB NAWJpABRi0aDKXg6WGVJZPkmqv2tLwIGygLfrrn1O3F7Zm6i8o7GRlyvQj4cCV1nUiQZ EtHB+sxHef7MKZIIleJvNPVSzpjXRGrXAIWrko1T6N4o3PJ7bVaUD2G11Bt9FHQOXd9p 9fww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MiFwpr9p; 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-42e906ae9ecsor26309265e9.6.2024.09.26.03.49.01 for (Google Transport Security); Thu, 26 Sep 2024 03:49:01 -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:1688:b0:42f:4f6:f8bc with SMTP id 5b1f17b1804b1-42f04f6fbf6mr37225345e9.9.1727347741147; Thu, 26 Sep 2024 03:49:01 -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.49.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 03:49:00 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 4/6] clk: imx8mn: support spread spectrum clock generation Date: Thu, 26 Sep 2024 12:48:53 +0200 Message-ID: <20240926104855.656121-5-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=MiFwpr9p; 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-imx8mn.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index ab77e148e70c..b33590a9b7b7 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -321,6 +321,7 @@ static int imx8mn_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 = devm_kzalloc(dev, struct_size(clk_hw_data, hws, @@ -356,10 +357,14 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_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[IMX8MN_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[IMX8MN_AUDIO_PLL1] = imx_clk_hw_pll14xx("audio_pll1", "audio_pll1_ref_sel", base, &imx_1443x_pll); - hws[IMX8MN_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", base + 0x14, &imx_1443x_pll); - hws[IMX8MN_VIDEO_PLL] = imx_clk_hw_pll14xx("video_pll", "video_pll_ref_sel", base + 0x28, &imx_1443x_pll); - hws[IMX8MN_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, IMX8MN_AUDIO_PLL1, &pll1443x_ssc); + hws[IMX8MN_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, IMX8MN_AUDIO_PLL2, &pll1443x_ssc); + hws[IMX8MN_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, IMX8MN_VIDEO_PLL, &pll1443x_ssc); + hws[IMX8MN_VIDEO_PLL] = imx_clk_hw_pll14xx_ssc("video_pll", "video_pll_ref_sel", base + 0x28, &imx_1443x_pll, &pll1443x_ssc); + imx_clk_pll14xx_get_ssc_conf(np, IMX8MN_DRAM_PLL, &pll1443x_ssc); + hws[IMX8MN_DRAM_PLL] = imx_clk_hw_pll14xx_ssc("dram_pll", "dram_pll_ref_sel", base + 0x50, &imx_1443x_dram_pll, &pll1443x_ssc); hws[IMX8MN_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", base + 0x64, &imx_1416x_pll); hws[IMX8MN_M7_ALT_PLL] = imx_clk_hw_pll14xx("m7_alt_pll", "m7_alt_pll_ref_sel", base + 0x74, &imx_1416x_pll); hws[IMX8MN_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", base + 0x84, &imx_1416x_pll);