From patchwork Wed Nov 6 08:57:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3622 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3428F3F14C for ; Wed, 6 Nov 2024 10:06:13 +0100 (CET) Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2fb5bd1c324sf28520341fa.3 for ; Wed, 06 Nov 2024 01:06:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730883972; cv=pass; d=google.com; s=arc-20240605; b=lV2eQ3d6IddDMWsN9C3yzSVK6egSC71WjhfwgenJ3wrzh++wBJcztJlSWF+vR1HHkF TvY8eqU+R18O85N0IpgF3aGADlE/dNfJZXVJ5fR9oZ7JtcJ7lCthqEdewRMhnfqJnCZz DmybTj6FFayeMRQXAQ727pIwsAcungdvFScWxwleWRc6/6+QSgh0byircNnq8BpM/+8I KvFiOJreCOBtc5gEp5budqDNbVm/4fQ0CAWdSWz6w+cP9q6fWhqmipbJoqWyQ9lVZG0z 2WQvM31q1CbAiNc7w55xFIOOtojgitfEKxchcT6ZGmh7v7ZdcdCvA8i05tlWVi7SPn2Z +9LQ== 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=gBrom9i9pGsV7o7pojwiflszqoArdJP4I7MkrGWDWSY=; fh=NKCigd9oYImJSghBAGUzDlVxh45dxmsEQiToSTRDTP0=; b=NTH3Rdv9pJCQe6byBM6BNBrnWx/AUd6Nr4fmlaPPqupw+EXaURH+G4ZFVPAGecNlaK xz5Tijy5PNUTZM8sEmHKp5UJYjv9ewCDXxH+l/WCesy1Yz/6XH7g44sH5Jzr/J+807Ok V1LR4ifC0YucUdj7ZmkRg64U8rh8LixF2nNCqzLEnn1TAM3Y1eX/nYIEv8dU5sVU4Q2y vzkGIxCQICEMAFGe2AOMqbsNTVAq6xBedeIafiyJ4IW+mIgepE2IZf4UA/K4LDlHAP1I fGJyUeGKb5ZaHyIveFRb3383ijGnhwPtWHtmQKKQla65NPHFzc2YN6rPEmhl1U2ISyjR /PHA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="q49/rzgc"; 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=1730883972; x=1731488772; 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=gBrom9i9pGsV7o7pojwiflszqoArdJP4I7MkrGWDWSY=; b=iavMK693gA9mueEjXkr5EAQChoKSNCQ2OU/wUkqAtUktpGijEfezqiseL0CAd+MZHx vGQl/N9Lmeb7QeE3+/ZswlzJYPoycZKgzh36zko6n4z6S6OParhZCyMwE75YI9XOAFb0 5mTdQGiZmS052a6JnhgedG3nymOdWfbKuyAPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730883972; x=1731488772; 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=gBrom9i9pGsV7o7pojwiflszqoArdJP4I7MkrGWDWSY=; b=WvTilrMzQqX9YOMfZ/inTiyZz6Y2hns7JatiSxXLb6MnHNA6+MIuLnx2pIcMfr+pRr bxteD7iUVrSc2OUEtZn3O4hodS5TgnonUnvcvWRKAO5PHfPeZ/jq9eW0QgIc1J4Ag3cs qYaiwoWQ5HtKRuRcUT31dVi8ZGAR8nzHMsNKj+shQfJ1Qqs0CxRc/WplMmYr7SJ2+nI0 Acgvnendhv4p3nXpUVPAADcxJzFfljDuOJBu4gECQadOS0a9jiJaePPMyYusO71LCQJh ywEYM56rrn4yS+xv505nKQBM8VSIX7fgfF0U2DwtJBK1t6Abm59VHtZ+pKMXAIHc2nJb X64w== X-Forwarded-Encrypted: i=2; AJvYcCVAL6bnfRzk+s1SJlJ0VkDHhi6StfnPLwVIgNn+QUaSohqLjt4xiEM8Xp0iwQtLanrHgFE+MvxQljTbzPAt@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyIwWor3nlUmvWm9CIGMvTB83vDoLCQMH55Pjh6aHP59Ycf18Ce /VMVb2kfFEAAOB/yKJ5/6uY7k+hL/mZGTTjswdXYmVMcGWQO64p1dNAfwtEPpeJaAj6tdtvmpA= = X-Google-Smtp-Source: AGHT+IEZG+3xbCL487px55/IH3SdRseNOmyKEEGgD9yDKccSuMdw593YiQ4gAdPutW1DuZRKI1qBTA== X-Received: by 2002:a2e:bc83:0:b0:2fe:f8e1:5127 with SMTP id 38308e7fff4ca-2fef8e15294mr44226831fa.9.1730883972158; Wed, 06 Nov 2024 01:06:12 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:758:b0:5ce:aed7:a90 with SMTP id 4fb4d7f45d1cf-5ceaed71228ls707629a12.2.-pod-prod-02-eu; Wed, 06 Nov 2024 01:06:10 -0800 (PST) X-Received: by 2002:a17:907:6e94:b0:a9a:67aa:31f5 with SMTP id a640c23a62f3a-a9e508aaa56mr2124789466b.10.1730883970187; Wed, 06 Nov 2024 01:06:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730883970; cv=none; d=google.com; s=arc-20240605; b=NtCSsyj0Nb0q1FrmtzlIKpZzFLXi7OoFFMCkRG00EsyCIQ3c+mbIrQEU9NgYYS5/Bi I79XFguUI8gq9yY7G0LpNoLpfxfAZ1iwV+pIZh5J+4McKvjHScz2GGOTE7+JhpxnXHJj U8HdID3J743RRj+QOXAhzn947xHv2G9jchctAqhEGcYkAQ3EkhOmOLHHpNQ5/I+zk82d R6ZJwLba6teehxjlUHk16eO1wDHE15aR3nKRmaS+mSgdFk82/zNco/UpGN3kEsASNY1G O1WByGDEGPTxe1tzfZCiGOzwCYsgqwiPHrUr7QOKo5pc8tMtS3W26ft+nmER5oG4OpmW DavA== 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=QrNsJPPKHO5Lk6rFyymH1MtDjL//mpL7mQleFPtlyis=; fh=2TL5gdVAJyX/yhk5/AxHrADrCeVz/BiuKBD/sWsuHYo=; b=MCBKogxEMvAXSv7a4SRTRFQrsHeeGuCNgntiaeVnqGPs/89vRuEviHjIFvt3WMUqPW RVrFeaI4SY1SO5M/AKUrX29rcM6fi2vJw+1CsTmTNizqVWejtENMErKm1xX/t3rj5BVn qy2wWOE50k2yLHBeES8tY3wGT57uN6UUuD8aVMV5xicGOeGwG4JxjzhRf1VMbhm5sfy2 aHhm9MC6/z5HmuS7hi5cSLaoY0p4CWdL08/kL+LspW3aCbkKrE3hW5LDjrs5vUkLkTa+ IpzM8zeeX1vZhCGJeWVnTwox0g+H4UWrGIai9Zfy+jLgtqHyFBrVMbYgDphdqv6jkAfg 6V+A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="q49/rzgc"; 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-a9e565674c2sor577866666b.13.2024.11.06.01.06.10 for (Google Transport Security); Wed, 06 Nov 2024 01:06:10 -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:907:3f9f:b0:a9a:2afc:e4d7 with SMTP id a640c23a62f3a-a9e50b948d0mr2311624866b.44.1730883969647; Wed, 06 Nov 2024 01:06:09 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:06:09 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Abel Vesa , Conor Dooley , Fabio Estevam , Krzysztof Kozlowski , Michael Turquette , Peng Fan , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , Stephen Boyd , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH v3 1/8] dt-bindings: clock: imx8m-clock: support spread spectrum clocking Date: Wed, 6 Nov 2024 09:57:57 +0100 Message-ID: <20241106090549.3684963-2-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="q49/rzgc"; 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 the DT bindings for enabling and tuning spread spectrum clocking generation. Signed-off-by: Dario Binacchi --- Changes in v3: - Added in v3 - The dt-bindings have been moved from fsl,imx8m-anatop.yaml to imx8m-clock.yaml. The anatop device (fsl,imx8m-anatop.yaml) is indeed more or less a syscon, so it represents a memory area accessible by ccm (imx8m-clock.yaml) to setup the PLLs. .../bindings/clock/imx8m-clock.yaml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/imx8m-clock.yaml b/Documentation/devicetree/bindings/clock/imx8m-clock.yaml index c643d4a81478..7920393e518e 100644 --- a/Documentation/devicetree/bindings/clock/imx8m-clock.yaml +++ b/Documentation/devicetree/bindings/clock/imx8m-clock.yaml @@ -43,6 +43,40 @@ properties: ID in its "clocks" phandle cell. See include/dt-bindings/clock/imx8m-clock.h for the full list of i.MX8M clock IDs. + fsl,ssc-clocks: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + Phandles of the PLL with spread spectrum generation hardware capability. + minItems: 1 + maxItems: 4 + + fsl,ssc-modfreq-hz: + description: + The values of modulation frequency (Hz unit) of spread spectrum + clocking for each PLL. + minItems: 1 + maxItems: 4 + + fsl,ssc-modrate-percent: + description: + The percentage values of modulation rate of spread spectrum + clocking for each PLL. + minItems: 1 + maxItems: 4 + + fsl,ssc-modmethod: + $ref: /schemas/types.yaml#/definitions/string-array + description: + The modulation techniques of spread spectrum clocking for + each PLL. + minItems: 1 + maxItems: 4 + items: + enum: + - down-spread + - up-spread + - center-spread + required: - compatible - reg @@ -76,6 +110,11 @@ allOf: - const: clk_ext2 - const: clk_ext3 - const: clk_ext4 + fsl,ssc-clocks: false + fsl,ssc-modfreq-hz: false + fsl,ssc-modrate-percent: false + fsl,ssc-modmethod: false + else: properties: clocks: @@ -101,6 +140,8 @@ additionalProperties: false examples: # Clock Control Module node: - | + #include + clock-controller@30380000 { compatible = "fsl,imx8mm-ccm"; reg = <0x30380000 0x10000>; @@ -109,6 +150,11 @@ examples: <&clk_ext3>, <&clk_ext4>; clock-names = "osc_32k", "osc_24m", "clk_ext1", "clk_ext2", "clk_ext3", "clk_ext4"; + fsl,ssc-clocks = <&clk IMX8MM_AUDIO_PLL1>, + <&clk IMX8MM_VIDEO_PLL1>; + fsl,ssc-modfreq-hz = <6818>, <2419>; + fsl,ssc-modrate-percent = <3>, <7>; + fsl,ssc-modmethod = "down-spread", "center-spread"; }; - | From patchwork Wed Nov 6 08:57:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3623 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 264883F14C for ; Wed, 6 Nov 2024 10:06:14 +0100 (CET) Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5cd50bf580csf4840740a12.0 for ; Wed, 06 Nov 2024 01:06:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730883974; cv=pass; d=google.com; s=arc-20240605; b=h9T+p8NU7FWGxKuyVGGSdQTuWDBOTjTEzVXYtOaWeL/CXW3z3P1wrQVxdrd0j4x9t8 CT0B+pqwo03ohyZNPDYnPktalhiVclOA4gbNW7e6rsjwu6NrFDn2NEOu+70ki+IfqnNQ OEe15VpN55eUHBiBtkZTr3j8i5dsXBz/R0PWBOIU22C6TIU24Jwk+Gsz/P/Brp9pvZwN NUU4UDNE4QGPFT+13qDJevjXt17dGe/WBT1eGXxKdwS8A5ozsWBoam8q/lLOvv4PZgDm 8YsieJZsH2dFk5QnvxyLdFIKspAqRnLHu7n4aRvNTJpcfc0Vwbo7cjul+lXFe+s75NcV eCHA== 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=hDpHbkpfdx4gXd1JCeuNz3EmiSCdKkWZGM7BYT+VG9o=; fh=wIqwhvTUiLEB//xDMlIj7Y1ZB8NirH6YUloIpp4wltE=; b=O1aKHnC/jPnByGzntUSvFbV5NDwA80prpFYcaZr87E5EompQOiMn4xuHjfzgFaV6Vs yDyYZPmOIHqPZJG5lZCIH4+wOs5lgXqZshIkgGUpQNwltYU7Q+YnqtaXQRMXkJ0oj57a oqnlb5NOD4SYPfJrPY/RzQMnLTvukMKaSsdYSx+VjSYOCG3N2Wdy+iSmXmwNqqYgxErZ 4vLUG8Wj3sLqbrHPCMTxmGnQL0bpKb9wWm7+o+I+MiG4s2lTJaIhl1CBZ9jbfH2/HVdc gnq4JveNFPcjHQyazYOkX05HZf258zIkm7LH17nY3bXzLPz7N2HGa5cjIcOro3rrh6aD na6Q==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZpR0GtVE; 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=1730883974; x=1731488774; 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=hDpHbkpfdx4gXd1JCeuNz3EmiSCdKkWZGM7BYT+VG9o=; b=iLkS0jKigdPrOgg2kwCdZ5dgU2Y/4RfMmWTBDwUBQ97qKg+Q/1qourwgtEyWJ4803D vcyhv6gvonNzbbJi3PZFK89o589gjHpbAXIC0y56SGAxsvtMaZQejouq25OL7SaUyDzY gAMMdITEK4APqCjXyDT54CWgRjLNGzF2Jrxlo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730883974; x=1731488774; 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=hDpHbkpfdx4gXd1JCeuNz3EmiSCdKkWZGM7BYT+VG9o=; b=KmSAnnV+x07Qw437xz1Lrnrj9Fh7lpYSZNsdF53bYc5WrX8u06a12sutVJT9txEDIC +IX9E8kyttFaI+ZnxLxKRLqZDL/+taFLszon643ewNUB5DzT4mMK8B4y0BPKDyHYwnkR 6j1ZwHdkVxUrBXjQaph7X24uTXUvjjfXHhc1X5HtUoxFJ5XYHX0KVBXSFx013qpV5AQ9 6pO1E78sG33s8xerXg5Ixy/xMd7QSpqrPNdTRvL3bIhYbkr5Pzlr4aK6/AfFxNAq+iJj UygVnualMqEY9dDCR1q+qAfGe9BUF6WQG7tqnwjzuC2oKTh6yuids7tYzn0N4vND5B3x bHbA== X-Forwarded-Encrypted: i=2; AJvYcCXMFu+Yo11OQH2N3QJMx8ApvRxYzqjSTwprsiWyaU4ExQ5r98YBWP2uzzM2v0l2YGj1Hkoh6FJz4CjUL5dA@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwuWUq9UNTim1Z+OfJpBsww6H+Uaf+4+4pZNnJRhiORIdJ1kRcz SJaSoQ1WxzOogu/vFULvw6mboj7FfP75H7LWXIcg681bUHZrScGSoKI5zYw+TrWHng== X-Google-Smtp-Source: AGHT+IEE5kPnzttnV0mhvbUU176GWwkdyO7iIQqZF1v7nqRfKz+7BZ3SRM8LHtz8gCDvpkU+xS24EQ== X-Received: by 2002:a05:6402:180f:b0:5ce:afba:f48e with SMTP id 4fb4d7f45d1cf-5ceb9383c22mr11461871a12.32.1730883973433; Wed, 06 Nov 2024 01:06:13 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:c143:0:b0:5ce:c9e0:aeb2 with SMTP id 4fb4d7f45d1cf-5cec9e0b1a0ls805839a12.1.-pod-prod-04-eu; Wed, 06 Nov 2024 01:06:11 -0800 (PST) X-Received: by 2002:a17:907:2684:b0:a99:543e:94b4 with SMTP id a640c23a62f3a-a9e658be221mr1913741166b.56.1730883971450; Wed, 06 Nov 2024 01:06:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730883971; cv=none; d=google.com; s=arc-20240605; b=ixsSaGTvy0NBAx9j8spfMUrkPQJ3mccDM0EAZSZxyau5XLFvG5/loGwyyjZi9fuT1t yEPsOFhnDLX2WYZsXyB5Urq7Jitrqt6VWGRYFv/23Ug8pzQR0pOmZKcicke5Z24DVRvm 5ZWrOaLripKz1BPcPz+QXPqySogxM5lRLcG52zGzu0CRAcMF52FeOFaRKLmARANvUa8X 8ujgvd9QDRaaYDBmP2AFoNuhMZiwcLTYKqlDssDGiLqcKkkn8KwtIdfOzMY50LGeFLB6 EppF/GJ35vVE5BjChHK45an5ZfkKkMYsSreEkdZxdXT0aiRTXGicOPdnDezx0BGuX36x 0N0g== 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=HYFE+8+xJyXnOIazKfuEkYOBmIG07KamRjf0rhIE9ik=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=TKnBRwNcGMRdwwcXFOU+zGoJu/2qyXFtDFtWVamntoPeecQsnm0PNPf3LrXrd+K0QV NXFpEXToCefG+I850mfeo0EmCjQK2JJd/4spm+kXnmN86parA4uiSI3OX0nalVdIcwPW h3N+rTJBYEKO2dS9mn7aycBFMSQvB2ugvaazbgGMBv85NiBhDr875uu9BbKyEcEbc1vU 16yRdxv4zhZUR/Cj6WLdNWpErU1rtzqo+o3MGqman56MZ/AiedY+jeCyg45/6DcRmme1 G6Z20/q8fIuuR2ijLlobgfzxmIIZ2G33v/7DpNs4k63ZfNnXdo4lhiakL8pSe0nkCcfx G/HA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZpR0GtVE; 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-a9e564b97e7sor606585766b.8.2024.11.06.01.06.11 for (Google Transport Security); Wed, 06 Nov 2024 01:06:11 -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:907:3f05:b0:a99:375f:4523 with SMTP id a640c23a62f3a-a9e6587e27dmr1945150966b.44.1730883970924; Wed, 06 Nov 2024 01:06:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:06:10 -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 2/8] clk: imx: pll14xx: support spread spectrum clock generation Date: Wed, 6 Nov 2024 09:57:58 +0100 Message-ID: <20241106090549.3684963-3-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=ZpR0GtVE; 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: , This patch adds support for spread spectrum clock (SSC) generation for the pll14xxx. The addition of the "imx_clk_hw_pll14xx_ssc" macro has minimized the number of changes required to avoid compilation errors following the addition of the SSC setup parameter to the "imx_dev_clk_hw_pll14xx" macro used in the files clk-imx8m{m,n,p}.c. The change to the clk-imx8mp-audiomix.c file prevents the patch from causing a compilation error. Signed-off-by: Dario Binacchi --- (no changes since v1) drivers/clk/imx/clk-imx8mp-audiomix.c | 2 +- drivers/clk/imx/clk-pll14xx.c | 102 +++++++++++++++++++++++++- drivers/clk/imx/clk.h | 24 +++++- 3 files changed, 124 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mp-audiomix.c b/drivers/clk/imx/clk-imx8mp-audiomix.c index b2cb157703c5..bfcf2975c217 100644 --- a/drivers/clk/imx/clk-imx8mp-audiomix.c +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c @@ -365,7 +365,7 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev) clk_hw_data->hws[IMX8MP_CLK_AUDIOMIX_SAI_PLL_REF_SEL] = hw; hw = imx_dev_clk_hw_pll14xx(dev, "sai_pll", "sai_pll_ref_sel", - base + 0x400, &imx_1443x_pll); + base + 0x400, &imx_1443x_pll, NULL); if (IS_ERR(hw)) { ret = PTR_ERR(hw); goto err_clk_register; diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c index d63564dbb12c..76014e243a57 100644 --- a/drivers/clk/imx/clk-pll14xx.c +++ b/drivers/clk/imx/clk-pll14xx.c @@ -20,6 +20,8 @@ #define GNRL_CTL 0x0 #define DIV_CTL0 0x4 #define DIV_CTL1 0x8 +#define SSCG_CTRL 0xc + #define LOCK_STATUS BIT(31) #define LOCK_SEL_MASK BIT(29) #define CLKE_MASK BIT(11) @@ -31,6 +33,10 @@ #define KDIV_MASK GENMASK(15, 0) #define KDIV_MIN SHRT_MIN #define KDIV_MAX SHRT_MAX +#define SSCG_ENABLE BIT(31) +#define MFREQ_CTL_MASK GENMASK(19, 12) +#define MRAT_CTL_MASK GENMASK(9, 4) +#define SEL_PF_MASK GENMASK(1, 0) #define LOCK_TIMEOUT_US 10000 @@ -40,6 +46,7 @@ struct clk_pll14xx { enum imx_pll14xx_type type; const struct imx_pll14xx_rate_table *rate_table; int rate_count; + struct imx_pll14xx_ssc ssc; }; #define to_clk_pll14xx(_hw) container_of(_hw, struct clk_pll14xx, hw) @@ -347,6 +354,27 @@ static int clk_pll1416x_set_rate(struct clk_hw *hw, unsigned long drate, return 0; } +static void clk_pll1443x_set_sscg(struct clk_hw *hw, unsigned long parent_rate, + unsigned int pdiv, unsigned int mdiv) +{ + struct clk_pll14xx *pll = to_clk_pll14xx(hw); + struct imx_pll14xx_ssc *ssc = &pll->ssc; + u32 sscg_ctrl = readl_relaxed(pll->base + SSCG_CTRL); + + sscg_ctrl &= + ~(SSCG_ENABLE | MFREQ_CTL_MASK | MRAT_CTL_MASK | SEL_PF_MASK); + if (ssc->enable) { + u32 mfr = parent_rate / (ssc->mod_freq * pdiv * (1 << 5)); + u32 mrr = (ssc->mod_rate * mdiv * (1 << 6)) / (100 * mfr); + + sscg_ctrl |= SSCG_ENABLE | FIELD_PREP(MFREQ_CTL_MASK, mfr) | + FIELD_PREP(MRAT_CTL_MASK, mrr) | + FIELD_PREP(SEL_PF_MASK, ssc->mod_type); + } + + writel_relaxed(sscg_ctrl, pll->base + SSCG_CTRL); +} + static int clk_pll1443x_set_rate(struct clk_hw *hw, unsigned long drate, unsigned long prate) { @@ -368,6 +396,9 @@ static int clk_pll1443x_set_rate(struct clk_hw *hw, unsigned long drate, writel_relaxed(FIELD_PREP(KDIV_MASK, rate.kdiv), pll->base + DIV_CTL1); + if (pll->ssc.enable) + clk_pll1443x_set_sscg(hw, prate, rate.pdiv, rate.mdiv); + return 0; } @@ -408,6 +439,9 @@ static int clk_pll1443x_set_rate(struct clk_hw *hw, unsigned long drate, gnrl_ctl &= ~BYPASS_MASK; writel_relaxed(gnrl_ctl, pll->base + GNRL_CTL); + if (pll->ssc.enable) + clk_pll1443x_set_sscg(hw, prate, rate.pdiv, rate.mdiv); + return 0; } @@ -487,7 +521,8 @@ static const struct clk_ops clk_pll1443x_ops = { struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name, const char *parent_name, void __iomem *base, - const struct imx_pll14xx_clk *pll_clk) + const struct imx_pll14xx_clk *pll_clk, + const struct imx_pll14xx_ssc *ssc) { struct clk_pll14xx *pll; struct clk_hw *hw; @@ -525,6 +560,8 @@ struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name, pll->type = pll_clk->type; pll->rate_table = pll_clk->rate_table; pll->rate_count = pll_clk->rate_count; + if (ssc) + memcpy(&pll->ssc, ssc, sizeof(pll->ssc)); val = readl_relaxed(pll->base + GNRL_CTL); val &= ~BYPASS_MASK; @@ -542,3 +579,66 @@ struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name, return hw; } EXPORT_SYMBOL_GPL(imx_dev_clk_hw_pll14xx); + +static enum imx_pll14xx_ssc_mod_type clk_pll14xx_ssc_mode(const char *name, + enum imx_pll14xx_ssc_mod_type def) +{ + int i; + struct { + const char *name; + enum imx_pll14xx_ssc_mod_type id; + } mod_methods[] = { + { .name = "down-spread", .id = IMX_PLL14XX_SSC_DOWN_SPREAD }, + { .name = "up-spread", .id = IMX_PLL14XX_SSC_UP_SPREAD }, + { .name = "center-spread", .id = IMX_PLL14XX_SSC_CENTER_SPREAD } + }; + + for (i = 0; i < ARRAY_SIZE(mod_methods); i++) { + if (!strcmp(name, mod_methods[i].name)) + return mod_methods[i].id; + } + + return def; +} + +void imx_clk_pll14xx_get_ssc_conf(struct device_node *np, int pll_id, + struct imx_pll14xx_ssc *ssc) +{ + int i, ret, offset, num_clks; + u32 clk_id, clk_cell_size; + const char *s; + + if (!ssc) + return; + + memset(ssc, 0, sizeof(*ssc)); + + num_clks = of_count_phandle_with_args(np, "fsl,ssc-clocks", + "#clock-cells"); + if (num_clks <= 0) + return; + + ret = of_property_read_u32(np, "#clock-cells", &clk_cell_size); + if (ret) + return; + + for (i = 0; i < num_clks; i++) { + offset = i * clk_cell_size + 1; + of_property_read_u32_index(np, "fsl,ssc-clocks", offset, + &clk_id); + if (clk_id != pll_id) + continue; + + of_property_read_u32_index(np, "fsl,ssc-modfreq-hz", i, + &ssc->mod_freq); + of_property_read_u32_index(np, "fsl,ssc-modrate-percent", i, + &ssc->mod_rate); + if (!of_property_read_string(np, "fsl,ssc-modmethod", &s)) + ssc->mod_type = clk_pll14xx_ssc_mode( + s, IMX_PLL14XX_SSC_DOWN_SPREAD); + + ssc->enable = true; + break; + } +} +EXPORT_SYMBOL_GPL(imx_clk_pll14xx_get_ssc_conf); diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index aa5202f284f3..8cbc75480569 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -62,6 +62,19 @@ struct imx_pll14xx_rate_table { unsigned int kdiv; }; +enum imx_pll14xx_ssc_mod_type { + IMX_PLL14XX_SSC_DOWN_SPREAD, + IMX_PLL14XX_SSC_UP_SPREAD, + IMX_PLL14XX_SSC_CENTER_SPREAD, +}; + +struct imx_pll14xx_ssc { + bool enable; + unsigned int mod_freq; + unsigned int mod_rate; + enum imx_pll14xx_ssc_mod_type mod_type; +}; + struct imx_pll14xx_clk { enum imx_pll14xx_type type; const struct imx_pll14xx_rate_table *rate_table; @@ -222,11 +235,18 @@ extern struct imx_fracn_gppll_clk imx_fracn_gppll_integer; __imx_clk_hw_divider(name, parent, reg, shift, width, flags) #define imx_clk_hw_pll14xx(name, parent_name, base, pll_clk) \ - imx_dev_clk_hw_pll14xx(NULL, name, parent_name, base, pll_clk) + imx_dev_clk_hw_pll14xx(NULL, name, parent_name, base, pll_clk, NULL) + +#define imx_clk_hw_pll14xx_ssc(name, parent_name, base, pll_clk, ssc) \ + imx_dev_clk_hw_pll14xx(NULL, name, parent_name, base, pll_clk, ssc) struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name, const char *parent_name, void __iomem *base, - const struct imx_pll14xx_clk *pll_clk); + const struct imx_pll14xx_clk *pll_clk, + const struct imx_pll14xx_ssc *ssc); + +void imx_clk_pll14xx_get_ssc_conf(struct device_node *np, int pll_id, + struct imx_pll14xx_ssc *ssc); struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name, const char *parent, void __iomem *base); From patchwork Wed Nov 6 08:57:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3624 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 3AF263F14C for ; Wed, 6 Nov 2024 10:06:15 +0100 (CET) Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5c94a70a3f5sf4570714a12.0 for ; Wed, 06 Nov 2024 01:06:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730883975; cv=pass; d=google.com; s=arc-20240605; b=Hzh0+aHS4iJV5vMCZhJKmTDo/SE8LwXYUOfGN9RMX/J49JiXLj2cn4OUtgUxPaCv05 B/KNDWuXkWy2GSeczLSAM9e82MOeZW3b/IfrF4rr3b2zhlKpVJX6aMNsuuLZnkV/+5q9 sldwVEOPMmK8vEmK4De5Wz5z7aK+svdBrrsdSHPqJrF4uAoeU4lb3PSFK92o46JsHsCi 0iBQF1R4IOJpNo+BkDiDxlTa7ZWbiKkOCsBBK5ACQ2khSSHiCX+6Q4mwzYqb/kIIMh9k 6T8R+UnTPERs8U0dv+l+0ZjVIPJYgIeL+gpial4zfDw4nZ7QQPieuhOeBGQwtASRdRJN +qDw== 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=eZO3zL0svuhX1KjEQwKS19TCjHrukz3GZXZFyttMSUA=; fh=It1NlikqlnNt59Bra0jQwqyAmbTGvPcFEgw54g+WYiY=; b=FcHN5x3Ok0ofe9GkFiNKntz8Ukti+oqb7R5y6QCvUjzfy1ta+/FNTtmygVp/uWlNL8 Arns44AL21OudgzjuzLLk/zs9g3TTCgrfRr2ySROiFQEEn957hZT9zbXXun//ZVpNUqz NgrlXsyGBbL/Ixc0jHEN/N54SwpU7HFyiqk18zmBm9Put0SVoA9tHZz1ZEf2F05w+TFI j5ZbiuupO7ZNFGgGFnp682tilfMixVv4J9kqMuuoUnwJLKCRy5I94ZmzP1KZdKjzVo/k 6+fdYLgg2AvhdYStRzilI2v2LV+rXu3kPsJM9x3Dlkx/FQlcrvN3/0K5ANr0UAnhHgTi K29A==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="G33C9Yc/"; 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=1730883975; x=1731488775; 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=eZO3zL0svuhX1KjEQwKS19TCjHrukz3GZXZFyttMSUA=; b=U3l56tA9u6XObNQrtAEKDLb11O59bwidY85FKuxeAGx0byQyfiu496sXbmReALPlSR DLpWQ7iJb8E/Y1JZ+YG8MXao3ToUfHs9SaMW+NBgdoQVbuRl/pO55TtVaix3vHPgJB5c Cqwz75iVIyc94l6mdqZFlS7nnfJnWryTVF6jM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730883975; x=1731488775; 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=eZO3zL0svuhX1KjEQwKS19TCjHrukz3GZXZFyttMSUA=; b=jNgp+Q+qChv78aHtaQ1ZA01qxQvNzVNDvLR0XqHnEjoD8B+5nLqQyvCbpF0ZH5WenD VlA8nnIdnNHlY8dWQn7adimMbYMIrkqJuVEi2/iymm8Pq/B/s3Fz32qnWiHvoPPjbgsr y3R4uYQVGgHdXWLh686uXZ6CGSDM9cmI+f7LigG+gyQT8P1PVWPrt8HNdlJ2kJGkGreM +6MrgNYpqognKsHSL3gnk8xYepsxV4gKugzI19A/bjimZ0ggZxmLrUfiO1DzSAZ0NZW8 do1swuzTrXfbABf6AI1nyBtPqd8le6V+F9algNeheMlWlxiQxQppBcyTxpgtKvWWJb6x pfYg== X-Forwarded-Encrypted: i=2; AJvYcCVxbIsbghiHM1TrheKGm9viI8qqWf+XzuZpXQGUkA2D9sJLx98g3iMehMU5GzRjC6G80nfG0U9Ifk47R5Hl@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yx7CdQ8X5CQ3MXNVSc0tvcGbCMXuVsbvDwqskt4psTdxHbHX+63 tAQTq4Kp4zbNP5cC6R0dkqAYnW/Hh/fxuTI9WmTDoG8nDBOG7GNkmkX/a/ziUNxD/A== X-Google-Smtp-Source: AGHT+IF+anw4/E2imiiSc5/b4Cksk6ilyyMan1/G94up6fVVNlgs9X0k++z5HLKN/HUJuf4ATpq50w== X-Received: by 2002:a05:6402:350b:b0:5ce:cf5e:51ac with SMTP id 4fb4d7f45d1cf-5cecf5e5342mr10376887a12.17.1730883974884; Wed, 06 Nov 2024 01:06:14 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:4492:b0:5ce:aed7:a6e with SMTP id 4fb4d7f45d1cf-5ceecd29c87ls56026a12.2.-pod-prod-03-eu; Wed, 06 Nov 2024 01:06:13 -0800 (PST) X-Received: by 2002:a17:907:9708:b0:a9a:47f9:c3c6 with SMTP id a640c23a62f3a-a9e5089e9a5mr2129816466b.6.1730883972929; Wed, 06 Nov 2024 01:06:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730883972; cv=none; d=google.com; s=arc-20240605; b=bFRLRQ2fXMYiZ6F4djdRa5ue94bbMCuyWqB6c4APSDHkTAJxlGvwQRFXdB0cnBana5 ZlQVf7IJAkFzuWzL8yEuCh3NWGZVU21HNFwutHOTtEDvFZozOFCHZecc7i4j/D6EZsoi /SE6FzgkORkJJJANvI9hgHYmcPnpu7VkeJImU+aWdK0hPMJlV6xNW6sPp3fVVme++QUr wcDk+talycHfS5QZdtjqujWpPO0nnLUNlRBCNUX6rlsfEqI9+s5UY9298YUjuWiOy9Ze K36TxNZprI2J7f5PGYCZwskBYUzH66+jm4vLSRuMADIYB2yIjDssLckft8EvWYZrjHHH FOcw== 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=CFIJLHLJ576OlYTnsrdTvE3ja/a4o6R56stRZF1bSdU=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=SJ9AAV9t6w2upIjKfqMrIky3n+0e0yfGNihZMS+Lnd3zGzzSnuiqRtbvXvfMnLw9/J 8mkJwpa5/dwuhdP1iVMb2YgAV799ouu0LwrGJbKvks7WECQCQKfdypuAYjpgNZkAJHtF kdXBjY2/aW3ttlO0zteHWHufEK3T8MSIIWZL3jV44+PzF1EWCh5mURRef/Yy7iDydHOj wKScFFKcSygM0sAZSrXQKQHi2jkU4sLdwxmIOjjJ6WPKOz7SBgLYRokCuZSShE/LSzB9 H7hH3OggQ4OM9dJm4YlBRXGXrZZe974HoLdixiqgYD95Podh5RRyz8Ibqp085sO/FoYE KsCg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="G33C9Yc/"; 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-a9e565f949asor654616366b.18.2024.11.06.01.06.12 for (Google Transport Security); Wed, 06 Nov 2024 01:06:12 -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:907:25cd:b0:a9a:4f78:b8 with SMTP id a640c23a62f3a-a9e5089c09amr2182362166b.2.1730883972386; Wed, 06 Nov 2024 01:06:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:06:11 -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 3/8] clk: imx: imx8mm: distinguish between ccm and anatop references Date: Wed, 6 Nov 2024 09:57:59 +0100 Message-ID: <20241106090549.3684963-4-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="G33C9Yc/"; 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 distinguishes between the references to the ccm node (np, base) and those to the anatop node (anatop_np, anatop_base). In this way, the code improves in readability and is less prone to errors. The patch is also preparatory for future developments. Signed-off-by: Dario Binacchi --- Changes in v3: - Added in version 3 drivers/clk/imx/clk-imx8mm.c | 94 ++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c index 342049b847b9..0cf53b5b15c8 100644 --- a/drivers/clk/imx/clk-imx8mm.c +++ b/drivers/clk/imx/clk-imx8mm.c @@ -300,7 +300,8 @@ 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 device_node *anatop_np; + void __iomem *base, *anatop_base; int ret; clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, @@ -319,54 +320,54 @@ static int imx8mm_clocks_probe(struct platform_device *pdev) hws[IMX8MM_CLK_EXT3] = imx_get_clk_hw_by_name(np, "clk_ext3"); hws[IMX8MM_CLK_EXT4] = imx_get_clk_hw_by_name(np, "clk_ext4"); - np = of_find_compatible_node(NULL, NULL, "fsl,imx8mm-anatop"); - base = of_iomap(np, 0); - of_node_put(np); - if (WARN_ON(!base)) + anatop_np = of_find_compatible_node(NULL, NULL, "fsl,imx8mm-anatop"); + anatop_base = of_iomap(anatop_np, 0); + of_node_put(anatop_np); + if (WARN_ON(!anatop_base)) return -ENOMEM; - hws[IMX8MM_AUDIO_PLL1_REF_SEL] = imx_clk_hw_mux("audio_pll1_ref_sel", base + 0x0, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MM_AUDIO_PLL2_REF_SEL] = imx_clk_hw_mux("audio_pll2_ref_sel", base + 0x14, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MM_VIDEO_PLL1_REF_SEL] = imx_clk_hw_mux("video_pll1_ref_sel", base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MM_DRAM_PLL_REF_SEL] = imx_clk_hw_mux("dram_pll_ref_sel", base + 0x50, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MM_GPU_PLL_REF_SEL] = imx_clk_hw_mux("gpu_pll_ref_sel", base + 0x64, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MM_VPU_PLL_REF_SEL] = imx_clk_hw_mux("vpu_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - 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); - 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); + hws[IMX8MM_AUDIO_PLL1_REF_SEL] = imx_clk_hw_mux("audio_pll1_ref_sel", anatop_base + 0x0, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MM_AUDIO_PLL2_REF_SEL] = imx_clk_hw_mux("audio_pll2_ref_sel", anatop_base + 0x14, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MM_VIDEO_PLL1_REF_SEL] = imx_clk_hw_mux("video_pll1_ref_sel", anatop_base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MM_DRAM_PLL_REF_SEL] = imx_clk_hw_mux("dram_pll_ref_sel", anatop_base + 0x50, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MM_GPU_PLL_REF_SEL] = imx_clk_hw_mux("gpu_pll_ref_sel", anatop_base + 0x64, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MM_VPU_PLL_REF_SEL] = imx_clk_hw_mux("vpu_pll_ref_sel", anatop_base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MM_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", anatop_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", anatop_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", anatop_base, &imx_1443x_pll); + hws[IMX8MM_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", anatop_base + 0x14, &imx_1443x_pll); + hws[IMX8MM_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", anatop_base + 0x28, &imx_1443x_pll); + hws[IMX8MM_DRAM_PLL] = imx_clk_hw_pll14xx("dram_pll", "dram_pll_ref_sel", anatop_base + 0x50, &imx_1443x_dram_pll); + hws[IMX8MM_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", anatop_base + 0x64, &imx_1416x_pll); + hws[IMX8MM_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", anatop_base + 0x74, &imx_1416x_pll); + hws[IMX8MM_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", anatop_base + 0x84, &imx_1416x_pll); hws[IMX8MM_SYS_PLL1] = imx_clk_hw_fixed("sys_pll1", 800000000); hws[IMX8MM_SYS_PLL2] = imx_clk_hw_fixed("sys_pll2", 1000000000); - hws[IMX8MM_SYS_PLL3] = imx_clk_hw_pll14xx("sys_pll3", "sys_pll3_ref_sel", base + 0x114, &imx_1416x_pll); + hws[IMX8MM_SYS_PLL3] = imx_clk_hw_pll14xx("sys_pll3", "sys_pll3_ref_sel", anatop_base + 0x114, &imx_1416x_pll); /* PLL bypass out */ - hws[IMX8MM_AUDIO_PLL1_BYPASS] = imx_clk_hw_mux_flags("audio_pll1_bypass", base, 16, 1, audio_pll1_bypass_sels, ARRAY_SIZE(audio_pll1_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MM_AUDIO_PLL2_BYPASS] = imx_clk_hw_mux_flags("audio_pll2_bypass", base + 0x14, 16, 1, audio_pll2_bypass_sels, ARRAY_SIZE(audio_pll2_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MM_VIDEO_PLL1_BYPASS] = imx_clk_hw_mux_flags("video_pll1_bypass", base + 0x28, 16, 1, video_pll1_bypass_sels, ARRAY_SIZE(video_pll1_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MM_DRAM_PLL_BYPASS] = imx_clk_hw_mux_flags("dram_pll_bypass", base + 0x50, 16, 1, dram_pll_bypass_sels, ARRAY_SIZE(dram_pll_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MM_GPU_PLL_BYPASS] = imx_clk_hw_mux_flags("gpu_pll_bypass", base + 0x64, 28, 1, gpu_pll_bypass_sels, ARRAY_SIZE(gpu_pll_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MM_VPU_PLL_BYPASS] = imx_clk_hw_mux_flags("vpu_pll_bypass", base + 0x74, 28, 1, vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MM_ARM_PLL_BYPASS] = imx_clk_hw_mux_flags("arm_pll_bypass", base + 0x84, 28, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MM_SYS_PLL3_BYPASS] = imx_clk_hw_mux_flags("sys_pll3_bypass", base + 0x114, 28, 1, sys_pll3_bypass_sels, ARRAY_SIZE(sys_pll3_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MM_AUDIO_PLL1_BYPASS] = imx_clk_hw_mux_flags("audio_pll1_bypass", anatop_base, 16, 1, audio_pll1_bypass_sels, ARRAY_SIZE(audio_pll1_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MM_AUDIO_PLL2_BYPASS] = imx_clk_hw_mux_flags("audio_pll2_bypass", anatop_base + 0x14, 16, 1, audio_pll2_bypass_sels, ARRAY_SIZE(audio_pll2_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MM_VIDEO_PLL1_BYPASS] = imx_clk_hw_mux_flags("video_pll1_bypass", anatop_base + 0x28, 16, 1, video_pll1_bypass_sels, ARRAY_SIZE(video_pll1_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MM_DRAM_PLL_BYPASS] = imx_clk_hw_mux_flags("dram_pll_bypass", anatop_base + 0x50, 16, 1, dram_pll_bypass_sels, ARRAY_SIZE(dram_pll_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MM_GPU_PLL_BYPASS] = imx_clk_hw_mux_flags("gpu_pll_bypass", anatop_base + 0x64, 28, 1, gpu_pll_bypass_sels, ARRAY_SIZE(gpu_pll_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MM_VPU_PLL_BYPASS] = imx_clk_hw_mux_flags("vpu_pll_bypass", anatop_base + 0x74, 28, 1, vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MM_ARM_PLL_BYPASS] = imx_clk_hw_mux_flags("arm_pll_bypass", anatop_base + 0x84, 28, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MM_SYS_PLL3_BYPASS] = imx_clk_hw_mux_flags("sys_pll3_bypass", anatop_base + 0x114, 28, 1, sys_pll3_bypass_sels, ARRAY_SIZE(sys_pll3_bypass_sels), CLK_SET_RATE_PARENT); /* PLL out gate */ - hws[IMX8MM_AUDIO_PLL1_OUT] = imx_clk_hw_gate("audio_pll1_out", "audio_pll1_bypass", base, 13); - hws[IMX8MM_AUDIO_PLL2_OUT] = imx_clk_hw_gate("audio_pll2_out", "audio_pll2_bypass", base + 0x14, 13); - hws[IMX8MM_VIDEO_PLL1_OUT] = imx_clk_hw_gate("video_pll1_out", "video_pll1_bypass", base + 0x28, 13); - hws[IMX8MM_DRAM_PLL_OUT] = imx_clk_hw_gate("dram_pll_out", "dram_pll_bypass", base + 0x50, 13); - hws[IMX8MM_GPU_PLL_OUT] = imx_clk_hw_gate("gpu_pll_out", "gpu_pll_bypass", base + 0x64, 11); - hws[IMX8MM_VPU_PLL_OUT] = imx_clk_hw_gate("vpu_pll_out", "vpu_pll_bypass", base + 0x74, 11); - hws[IMX8MM_ARM_PLL_OUT] = imx_clk_hw_gate("arm_pll_out", "arm_pll_bypass", base + 0x84, 11); - hws[IMX8MM_SYS_PLL3_OUT] = imx_clk_hw_gate("sys_pll3_out", "sys_pll3_bypass", base + 0x114, 11); + hws[IMX8MM_AUDIO_PLL1_OUT] = imx_clk_hw_gate("audio_pll1_out", "audio_pll1_bypass", anatop_base, 13); + hws[IMX8MM_AUDIO_PLL2_OUT] = imx_clk_hw_gate("audio_pll2_out", "audio_pll2_bypass", anatop_base + 0x14, 13); + hws[IMX8MM_VIDEO_PLL1_OUT] = imx_clk_hw_gate("video_pll1_out", "video_pll1_bypass", anatop_base + 0x28, 13); + hws[IMX8MM_DRAM_PLL_OUT] = imx_clk_hw_gate("dram_pll_out", "dram_pll_bypass", anatop_base + 0x50, 13); + hws[IMX8MM_GPU_PLL_OUT] = imx_clk_hw_gate("gpu_pll_out", "gpu_pll_bypass", anatop_base + 0x64, 11); + hws[IMX8MM_VPU_PLL_OUT] = imx_clk_hw_gate("vpu_pll_out", "vpu_pll_bypass", anatop_base + 0x74, 11); + hws[IMX8MM_ARM_PLL_OUT] = imx_clk_hw_gate("arm_pll_out", "arm_pll_bypass", anatop_base + 0x84, 11); + hws[IMX8MM_SYS_PLL3_OUT] = imx_clk_hw_gate("sys_pll3_out", "sys_pll3_bypass", anatop_base + 0x114, 11); /* SYS PLL1 fixed output */ - hws[IMX8MM_SYS_PLL1_OUT] = imx_clk_hw_gate("sys_pll1_out", "sys_pll1", base + 0x94, 11); + hws[IMX8MM_SYS_PLL1_OUT] = imx_clk_hw_gate("sys_pll1_out", "sys_pll1", anatop_base + 0x94, 11); hws[IMX8MM_SYS_PLL1_40M] = imx_clk_hw_fixed_factor("sys_pll1_40m", "sys_pll1_out", 1, 20); hws[IMX8MM_SYS_PLL1_80M] = imx_clk_hw_fixed_factor("sys_pll1_80m", "sys_pll1_out", 1, 10); @@ -379,7 +380,7 @@ static int imx8mm_clocks_probe(struct platform_device *pdev) hws[IMX8MM_SYS_PLL1_800M] = imx_clk_hw_fixed_factor("sys_pll1_800m", "sys_pll1_out", 1, 1); /* SYS PLL2 fixed output */ - hws[IMX8MM_SYS_PLL2_OUT] = imx_clk_hw_gate("sys_pll2_out", "sys_pll2", base + 0x104, 11); + hws[IMX8MM_SYS_PLL2_OUT] = imx_clk_hw_gate("sys_pll2_out", "sys_pll2", anatop_base + 0x104, 11); hws[IMX8MM_SYS_PLL2_50M] = imx_clk_hw_fixed_factor("sys_pll2_50m", "sys_pll2_out", 1, 20); hws[IMX8MM_SYS_PLL2_100M] = imx_clk_hw_fixed_factor("sys_pll2_100m", "sys_pll2_out", 1, 10); hws[IMX8MM_SYS_PLL2_125M] = imx_clk_hw_fixed_factor("sys_pll2_125m", "sys_pll2_out", 1, 8); @@ -390,14 +391,13 @@ static int imx8mm_clocks_probe(struct platform_device *pdev) hws[IMX8MM_SYS_PLL2_500M] = imx_clk_hw_fixed_factor("sys_pll2_500m", "sys_pll2_out", 1, 2); hws[IMX8MM_SYS_PLL2_1000M] = imx_clk_hw_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1); - hws[IMX8MM_CLK_CLKOUT1_SEL] = imx_clk_hw_mux2("clkout1_sel", base + 0x128, 4, 4, clkout_sels, ARRAY_SIZE(clkout_sels)); - hws[IMX8MM_CLK_CLKOUT1_DIV] = imx_clk_hw_divider("clkout1_div", "clkout1_sel", base + 0x128, 0, 4); - hws[IMX8MM_CLK_CLKOUT1] = imx_clk_hw_gate("clkout1", "clkout1_div", base + 0x128, 8); - hws[IMX8MM_CLK_CLKOUT2_SEL] = imx_clk_hw_mux2("clkout2_sel", base + 0x128, 20, 4, clkout_sels, ARRAY_SIZE(clkout_sels)); - hws[IMX8MM_CLK_CLKOUT2_DIV] = imx_clk_hw_divider("clkout2_div", "clkout2_sel", base + 0x128, 16, 4); - hws[IMX8MM_CLK_CLKOUT2] = imx_clk_hw_gate("clkout2", "clkout2_div", base + 0x128, 24); + hws[IMX8MM_CLK_CLKOUT1_SEL] = imx_clk_hw_mux2("clkout1_sel", anatop_base + 0x128, 4, 4, clkout_sels, ARRAY_SIZE(clkout_sels)); + hws[IMX8MM_CLK_CLKOUT1_DIV] = imx_clk_hw_divider("clkout1_div", "clkout1_sel", anatop_base + 0x128, 0, 4); + hws[IMX8MM_CLK_CLKOUT1] = imx_clk_hw_gate("clkout1", "clkout1_div", anatop_base + 0x128, 8); + hws[IMX8MM_CLK_CLKOUT2_SEL] = imx_clk_hw_mux2("clkout2_sel", anatop_base + 0x128, 20, 4, clkout_sels, ARRAY_SIZE(clkout_sels)); + hws[IMX8MM_CLK_CLKOUT2_DIV] = imx_clk_hw_divider("clkout2_div", "clkout2_sel", anatop_base + 0x128, 16, 4); + hws[IMX8MM_CLK_CLKOUT2] = imx_clk_hw_gate("clkout2", "clkout2_div", anatop_base + 0x128, 24); - np = dev->of_node; base = devm_platform_ioremap_resource(pdev, 0); if (WARN_ON(IS_ERR(base))) return PTR_ERR(base); From patchwork Wed Nov 6 08:58:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3625 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 86C213F14C for ; Wed, 6 Nov 2024 10:06:16 +0100 (CET) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5c92e8b8101sf4569536a12.2 for ; Wed, 06 Nov 2024 01:06:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730883976; cv=pass; d=google.com; s=arc-20240605; b=fx23XoZc4BaleKFVE0vOe7z3IcyQINJUTLAWOrIy9XsUjbfNeJF5cPH7DXvr8rfrGc Re1FmPAxkmZ53HRerQorOuA70Fw6WTqMxsud5wYw2FEMVn7OEAWEKTOkfY2qq5MjWLS9 xjWsj+GV3HP3Feec3wo0r59bMQz3YGkS//5wF6R8rPNy3ym0uRBNRzQZSlxzYOh0y7A5 DG8mP+YLsRizs7kD+tSzpj9MAczoG7GIdwu9Ybc+CLNxiW5ztiIBkKgA1uG7fiekHF64 6c0cybMxMmEnaaPYy3qC81+A1GXs32EM29gIpxW1aWD1m3dS5+gpYOLbgppvc/LOumYE Y6RA== 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=acdTQnlVGy1WudhIZxDn7GRP5VzXiDxhF2FVMjPjQFE=; fh=4K2CIUn+l/UafjyS4l+L2l8jatYS7G07s9tmviXwgTE=; b=jPg3NK95gkINXcbYNl7VZf9DwEELdLrP08TTZxWvQK4Clw2L8kE/SlZ6FGyz/nQyGB XAlWlFVroiI63cLyoYzkTXPgiGH1vyPB3193CFxDzeOr1DpBW1nLrKwjkXgpb9e9TfP1 jZF8TB80dmANw1NI3YRRNioB5LqEyzvjRX0kQVkG07WV/eHxcG5PRJvrAb4OqxDUJDoW 7ZCUp+emHJEcHKH/Nd/yIR92y0M3dBnuj9WX0yw44OruIFSUzsxw9qcV88gsZdJWxwMe UTVvtF87VAwqNltA18pHaNEDKQzYXCWOdZdxWX/7ig3Y41is2aaf0YMMEzvdAWQiwKaN XIFQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=o90Xy03Z; 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=1730883976; x=1731488776; 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=acdTQnlVGy1WudhIZxDn7GRP5VzXiDxhF2FVMjPjQFE=; b=ncXLV6UYgR7xAPzGBjgXucJZX1s/gFwAgZ4+Xof6M0+U9yoyGHTKzPlexTi3qDXnt7 15atMCzDiLYvU3B4RsPpV1u8vN5e4b5x1cqsu2BayW0cVoILVz8EGVmFN2fyd3dp8v5r TLwD0efXx9mGFks40LNoUxhKJyZEhiGENHXds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730883976; x=1731488776; 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=acdTQnlVGy1WudhIZxDn7GRP5VzXiDxhF2FVMjPjQFE=; b=gTaXSJEuzqcyRxClthh//Ys4O6OftrXSBoEYl3hMYquirnJMv/2epLIH++QD0rP9Bl GTj+86gcw3V2z6lJlL6y86dtxhzls1ufX1cbU9hKsFXqpO8lZqBK3OXb89m0861JdCZV 6TiTxeUoRazE19z8DwgL+mroXj/k7IZDfx4j/df2P4Dzi20chRC4cym5yBEb73/ZEytF ueQFc9NLeNKt/jKvHU960UDfjhkn4D1IOUw8U+BoDTMrZyAdidbBafo7uYRq9MEePoU1 TexYamkZJ9JQXRLh7B/TuE8CidKepSsyxZWh8W5nB2RLbcioYulEr+QJG3nocG038+rF Td/g== X-Forwarded-Encrypted: i=2; AJvYcCXOevzWqKwu9alOCDH7Zpyex4NzcEdJsKkcGzK/v69ABK3LF51zvF7vj2xKCSHxc70d8w84Iyhznk057Rjs@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxCC1CgASKSZ0ekfkToaFbjdpHGPuJpWT9LhlRDey2wVL/mO9/W FvimokQ84j9K4YYsnvmcfqmQJ8GkHtRBpIxMWS2CCI83/0dwu/Z6yz/pZU65Su4L+g== X-Google-Smtp-Source: AGHT+IH3HL8S4BKQmdYs+FPIB8zSwEpjdNIFlq4sq6eWCh4JvyzDKMbkTj+MWcGCANYjY6k1rYY8uA== X-Received: by 2002:a05:6402:2688:b0:5ce:d53e:f27e with SMTP id 4fb4d7f45d1cf-5ced53ef62dmr9004571a12.0.1730883976059; Wed, 06 Nov 2024 01:06:16 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:c518:0:b0:5bf:bf:efe4 with SMTP id 4fb4d7f45d1cf-5ceed258bd4ls678629a12.2.-pod-prod-08-eu; Wed, 06 Nov 2024 01:06:14 -0800 (PST) X-Received: by 2002:a17:907:9407:b0:a9a:4d1:c628 with SMTP id a640c23a62f3a-a9de6166babmr4063043666b.45.1730883974151; Wed, 06 Nov 2024 01:06:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730883974; cv=none; d=google.com; s=arc-20240605; b=LLMni6nA6bXnU24IKilTpoASnJA9a7B/WBezy/BLnNj5F34y3NGUdq1qgEzO1yrdAC DtT86mw1scJJ2syDZSSBGOEyL+FHcVdt2CGL9dZdSx7Dsz8M2VemihTD03Ok0Bu7vJ/c wm1NJqgNVUSZwd7Wac6MbWz+9NxogvlpOEtpjQVSC39uEMSqKLGfrVMSfu9hLpRjKhwR hr7OmmzojlmZUzGkmAjJQQtOArfK8R1ooiCdnRgXiyNb2QMxWKCFgo/jxUtmwabkVTrx CHjlYg6+oriIi1u71Zef4FBs2zWItZ+lskF3ffBQe8Dl/onjPbDkHO33dTCXG4xcdFVY uMYw== 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=K9/BOp61tpriPDyxNyMCGSbfD3+1Oa6yDDGnpxFC9Dw=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=JfbabI5yyOIvO4U1kb3A65Cbv5EbZQZ+Qht1TqO191INRneuK8KQVUvb78lhV+2GvS Y+UF/m/qdM1UjEryw78ykhCAW3EaZJ9l3udKANYw1ZJ4XZFs/IYxI60rVSe77a1VGS1X pzEWz0AYM+u82SVi0PJ1QaNg6UuWC++dhoAOgr54Opis7z8UuWPgaM9vKSqE4Jh4Wk+i Q8OzX8RoMlzSOgl4Tekx97eTqVPCZaGpOeL3y1dY5KQdIU/6iZJRE9oK/D8QX/sOv7Sk 4V7/8vGBs2rui1u1qVjURwPBJARLU4Wf3MYvn57MhEXr6Uxteq+sDd8MBZHbHaoN1dC5 jhHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=o90Xy03Z; 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-a9e564bc86asor616682866b.7.2024.11.06.01.06.14 for (Google Transport Security); Wed, 06 Nov 2024 01:06:14 -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:f58e:b0:a9a:2afc:e4cc with SMTP id a640c23a62f3a-a9de61a128amr3626458166b.58.1730883973693; Wed, 06 Nov 2024 01:06:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:06:13 -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 4/8] clk: imx8mm: support spread spectrum clock generation Date: Wed, 6 Nov 2024 09:58:00 +0100 Message-ID: <20241106090549.3684963-5-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=o90Xy03Z; 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 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 0cf53b5b15c8..482e471d086b 100644 --- a/drivers/clk/imx/clk-imx8mm.c +++ b/drivers/clk/imx/clk-imx8mm.c @@ -302,6 +302,7 @@ static int imx8mm_clocks_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; struct device_node *anatop_np; void __iomem *base, *anatop_base; + struct imx_pll14xx_ssc pll1443x_ssc; int ret; clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, @@ -335,10 +336,14 @@ static int imx8mm_clocks_probe(struct platform_device *pdev) hws[IMX8MM_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", anatop_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", anatop_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", anatop_base, &imx_1443x_pll); - hws[IMX8MM_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", anatop_base + 0x14, &imx_1443x_pll); - hws[IMX8MM_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", anatop_base + 0x28, &imx_1443x_pll); - hws[IMX8MM_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, IMX8MM_AUDIO_PLL1, &pll1443x_ssc); + hws[IMX8MM_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, IMX8MM_AUDIO_PLL2, &pll1443x_ssc); + hws[IMX8MM_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, IMX8MM_VIDEO_PLL1, &pll1443x_ssc); + hws[IMX8MM_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, IMX8MM_DRAM_PLL, &pll1443x_ssc); + hws[IMX8MM_DRAM_PLL] = imx_clk_hw_pll14xx_ssc("dram_pll", "dram_pll_ref_sel", anatop_base + 0x50, &imx_1443x_dram_pll, &pll1443x_ssc); hws[IMX8MM_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", anatop_base + 0x64, &imx_1416x_pll); hws[IMX8MM_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", anatop_base + 0x74, &imx_1416x_pll); hws[IMX8MM_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", anatop_base + 0x84, &imx_1416x_pll); From patchwork Wed Nov 6 08:58:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3626 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 2C0323F14C for ; Wed, 6 Nov 2024 10:06:18 +0100 (CET) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5c94a70a3f5sf4570729a12.0 for ; Wed, 06 Nov 2024 01:06:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730883978; cv=pass; d=google.com; s=arc-20240605; b=FCHW0bRfGFk14Vyt8m5mPMCKuKdJ1JihStZ23x/sTQw9/R1wPSUr+J+R3Zc6aPypYx lO6RsXIpbuvA7wm1dOdwvn7yaL7miSQTk1HR+uD7caDIcSHL/i6viJZXy2S7mx2Ek8PQ TWhmGze0T4ekz6Fpiuep8eQVC6Z4dZfLLZTtqH4RPV/q95rIjpPT1KkOJEHaAR6S+GQW WIiv/wk0Zp8nB1ptIm3sItJ9UgYtiORl93twU62QkULTa6mDBcydBopoXn5VpD+HGCm0 /yrm1a0HZQ+PBD5ZqV6VUtZjrMdPY/HA501CScPdofQ+grkg0cGfIicAHH6sREFkW2os lQdw== 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=/DkwoFnNT8K1VSfFYHWRZFckVimeGP9BYKIGWuf9NLs=; fh=wA8uA9zC3Qt7ANfNbaGMny7YZFyh52CIi7rUwi2htCw=; b=eKlZuL0bknIAvPazfQ6F9TjhvRuCGQKc9SU29sdphmUqRBy/7czro9UmMptZeRoU4W z9ioSG11HNS/2+hA60LVfErIxrPu0wKtdcK7Vcqp3Y0q9RwroVl+LyQ4OsVxIeVX7gUc NjNGhYofKeqnRr3EKqtWXEzoSwonxjsJz7tOTL7ucdqO60pMkvEeG0wSoYXIdk0Kef2g XU9MpPrUfnAcncxXQJe8/R2sgvVojKLf38hTQ8b+a1CQjO0Dfjs5hoglk2PIj0bFmLtz 6eQ4OdDnoWmbdsG3GBH4JwKzeMycV8LApN5qYDovwhNeLpFXW5NfnufnZfVskG5ciAix J99A==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kawnURy0; 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=1730883978; x=1731488778; 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=/DkwoFnNT8K1VSfFYHWRZFckVimeGP9BYKIGWuf9NLs=; b=daTOiPR0Vgv1dZSRphSmIVKtvOUET6WCHlQKO7DL0KAcmBZvF7Wl5iA5CAIy0H2KUf TViqjvSHxIGr9Vg3wTptJC5pJWhjz5rfinauj8SyQJNkNttQNjvKqU5FWW0e7jPXA2JH DoKUDwY/QVY+HyfvLjw78gzA59ICm36KfFeXk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730883978; x=1731488778; 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=/DkwoFnNT8K1VSfFYHWRZFckVimeGP9BYKIGWuf9NLs=; b=BQflvxjUl9PcwYSdrn2nIeDDYEDH47behyggTIk1rZz4lCIlyUXaaGYvVXfHKN56e8 txCrEwC61Sb3TzWxAJwBpW7RRC+DKRmbpp3qxCA0wuP5HpjqHAXoR945ZksCu4HUAv1e RVa7ZMyKToQkmneW39P5ApZdI6ZTXxeWx97LGuQcI+FlQ08w/PJuEAOShtIcdEKrCcwS iUVh4ZJcBJG9DcjL962hW1AjihMxwN0/HtGTq1NJb50JaWYJqgaGI3EayFfsM4PLx11E JNas705NBqka4COdQf/jDkK8IwhLgR//fogAJ83ZN4g8o27dGf+s8zPpx/A6RWVi11y9 WKaA== X-Forwarded-Encrypted: i=2; AJvYcCUbtGxJCMb++flWrSVESZ+WBYS1Vr1X5l6yJJTc5+vb+cDIbX5+cIEM4lQwKRt4jln6pWk08wKOkaxG3K1t@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyzmCvX5z83fsDUBTw7HU9WEdpOi4NWYOqYiLIHko+gRti4tNVJ A1xJOuBpNzaZ1TBG6LEn/SLiM/FdBbUJ4grG08Ls9AYjESl3lXUcW48r5hPMqX+mBg== X-Google-Smtp-Source: AGHT+IE4S27CPJmTDBg0PQ/+ckjEaB4r3Pe1+11L35S5ijh0b7po7CzVEn0NqYCb+PiBX2cQuSWMIA== X-Received: by 2002:a05:6402:5107:b0:5ce:dde6:dd6f with SMTP id 4fb4d7f45d1cf-5cedde6de53mr7228123a12.24.1730883977512; Wed, 06 Nov 2024 01:06:17 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:180d:b0:5ce:de2d:8fee with SMTP id 4fb4d7f45d1cf-5cede2d909cls48352a12.0.-pod-prod-03-eu; Wed, 06 Nov 2024 01:06:16 -0800 (PST) X-Received: by 2002:a17:907:f182:b0:a9e:b08e:b02d with SMTP id a640c23a62f3a-a9eb08eb074mr516459266b.18.1730883975691; Wed, 06 Nov 2024 01:06:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730883975; cv=none; d=google.com; s=arc-20240605; b=Ldt4/7Lzwrj2sS+IJS2ZsnZ5Xxeu4LTyJroR6w4neC6gVhJP9MIYZKXrdIdjbxtp2d FT+nw6EhDPTTepnEhhUZ7XEkxe+z/WL1Gow5n6R3sPv1JkMdc/6zP0kPzgGhOPpxPs4M O13JRIUP+xLag8j2Ja9XrmEBJk6FC3JRvf4t4Wk4F1+ymtOeQBV3uSlhSs93IkJ/n1vI sxuhCLSg3PkNLp7Jx6/V3PAGLN3u88dyvFgJ7DatdAkyjtIcR5OdWAj2n1xzTwzBuGVr lxqcV0xrIdOlYgxKRY+yiOn5h9MhThkRaGKzjQWyEWwN5MkpgVjfgdRr6p1T+CazVBA2 9vUQ== 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=QGtA8JEBTsqn1sM2hkjbMZ3AKWpFz4hmGmOhZO8OlbQ=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=eKWNcQRYoWyDFCpAeHeKsLNlpmyREreWNrYpWDmBlT5HoJPp55WPzKel10HbWeDuXj HRlgo3gNxAIsYdLnkyOIIwsgNld06XNDm6X9tI2yXeabTXRKjYI6ShR7TKnL4AjgF4Jh YmprQhUp5EiZ0Ruq2qrEOj8WJLMmvq1UTlELQ1Fo4bUm3dHtnJyfntCEVO2y2WHYP6ar bZ5E66kHw/l70MAx/jsJmlce+qu8MdF8j1rZeiVeQuPPRGrGhujFS6VHsD5iPna5ynQX d36RpMemdgJ1hZx/NCqmPATdskbPRe8kc6JI3srsb+5PHWOSGPfjAETX9EeUoL4OWy5E HySA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kawnURy0; 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-a9e56485533sor625019466b.1.2024.11.06.01.06.15 for (Google Transport Security); Wed, 06 Nov 2024 01:06:15 -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:907:2da0:b0:a99:ed2e:3875 with SMTP id a640c23a62f3a-a9e50b56a41mr2088102066b.42.1730883975183; Wed, 06 Nov 2024 01:06:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:06:14 -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 5/8] clk: imx: imx8mn: distinguish between ccm and anatop references Date: Wed, 6 Nov 2024 09:58:01 +0100 Message-ID: <20241106090549.3684963-6-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=kawnURy0; 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 distinguishes between the references to the ccm node (np, base) and those to the anatop node (anatop_np, anatop_base). In this way, the code improves in readability and is less prone to errors. The patch is also preparatory for future developments. Signed-off-by: Dario Binacchi --- Changes in v3: - Added in version 3 drivers/clk/imx/clk-imx8mn.c | 96 ++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index ab77e148e70c..feefc9ef4f51 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -320,7 +320,8 @@ 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 device_node *anatop_np; + void __iomem *base, *anatop_base; int ret; clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, @@ -339,56 +340,56 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_CLK_EXT3] = imx_get_clk_hw_by_name(np, "clk_ext3"); hws[IMX8MN_CLK_EXT4] = imx_get_clk_hw_by_name(np, "clk_ext4"); - np = of_find_compatible_node(NULL, NULL, "fsl,imx8mn-anatop"); - base = devm_of_iomap(dev, np, 0, NULL); - of_node_put(np); - if (WARN_ON(IS_ERR(base))) { - ret = PTR_ERR(base); + anatop_np = of_find_compatible_node(NULL, NULL, "fsl,imx8mn-anatop"); + anatop_base = devm_of_iomap(dev, anatop_np, 0, NULL); + of_node_put(anatop_np); + if (WARN_ON(IS_ERR(anatop_base))) { + ret = PTR_ERR(anatop_base); goto unregister_hws; } - hws[IMX8MN_AUDIO_PLL1_REF_SEL] = imx_clk_hw_mux("audio_pll1_ref_sel", base + 0x0, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MN_AUDIO_PLL2_REF_SEL] = imx_clk_hw_mux("audio_pll2_ref_sel", base + 0x14, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MN_VIDEO_PLL_REF_SEL] = imx_clk_hw_mux("video_pll_ref_sel", base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MN_DRAM_PLL_REF_SEL] = imx_clk_hw_mux("dram_pll_ref_sel", base + 0x50, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MN_GPU_PLL_REF_SEL] = imx_clk_hw_mux("gpu_pll_ref_sel", base + 0x64, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MN_M7_ALT_PLL_REF_SEL] = imx_clk_hw_mux("m7_alt_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - 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); - 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); + hws[IMX8MN_AUDIO_PLL1_REF_SEL] = imx_clk_hw_mux("audio_pll1_ref_sel", anatop_base + 0x0, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MN_AUDIO_PLL2_REF_SEL] = imx_clk_hw_mux("audio_pll2_ref_sel", anatop_base + 0x14, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MN_VIDEO_PLL_REF_SEL] = imx_clk_hw_mux("video_pll_ref_sel", anatop_base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MN_DRAM_PLL_REF_SEL] = imx_clk_hw_mux("dram_pll_ref_sel", anatop_base + 0x50, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MN_GPU_PLL_REF_SEL] = imx_clk_hw_mux("gpu_pll_ref_sel", anatop_base + 0x64, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MN_M7_ALT_PLL_REF_SEL] = imx_clk_hw_mux("m7_alt_pll_ref_sel", anatop_base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MN_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", anatop_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", anatop_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", anatop_base, &imx_1443x_pll); + hws[IMX8MN_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", anatop_base + 0x14, &imx_1443x_pll); + hws[IMX8MN_VIDEO_PLL] = imx_clk_hw_pll14xx("video_pll", "video_pll_ref_sel", anatop_base + 0x28, &imx_1443x_pll); + hws[IMX8MN_DRAM_PLL] = imx_clk_hw_pll14xx("dram_pll", "dram_pll_ref_sel", anatop_base + 0x50, &imx_1443x_dram_pll); + hws[IMX8MN_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", anatop_base + 0x64, &imx_1416x_pll); + hws[IMX8MN_M7_ALT_PLL] = imx_clk_hw_pll14xx("m7_alt_pll", "m7_alt_pll_ref_sel", anatop_base + 0x74, &imx_1416x_pll); + hws[IMX8MN_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", anatop_base + 0x84, &imx_1416x_pll); hws[IMX8MN_SYS_PLL1] = imx_clk_hw_fixed("sys_pll1", 800000000); hws[IMX8MN_SYS_PLL2] = imx_clk_hw_fixed("sys_pll2", 1000000000); - hws[IMX8MN_SYS_PLL3] = imx_clk_hw_pll14xx("sys_pll3", "sys_pll3_ref_sel", base + 0x114, &imx_1416x_pll); + hws[IMX8MN_SYS_PLL3] = imx_clk_hw_pll14xx("sys_pll3", "sys_pll3_ref_sel", anatop_base + 0x114, &imx_1416x_pll); /* PLL bypass out */ - hws[IMX8MN_AUDIO_PLL1_BYPASS] = imx_clk_hw_mux_flags("audio_pll1_bypass", base, 16, 1, audio_pll1_bypass_sels, ARRAY_SIZE(audio_pll1_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MN_AUDIO_PLL2_BYPASS] = imx_clk_hw_mux_flags("audio_pll2_bypass", base + 0x14, 16, 1, audio_pll2_bypass_sels, ARRAY_SIZE(audio_pll2_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MN_VIDEO_PLL_BYPASS] = imx_clk_hw_mux_flags("video_pll_bypass", base + 0x28, 16, 1, video_pll_bypass_sels, ARRAY_SIZE(video_pll_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MN_DRAM_PLL_BYPASS] = imx_clk_hw_mux_flags("dram_pll_bypass", base + 0x50, 16, 1, dram_pll_bypass_sels, ARRAY_SIZE(dram_pll_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MN_GPU_PLL_BYPASS] = imx_clk_hw_mux_flags("gpu_pll_bypass", base + 0x64, 28, 1, gpu_pll_bypass_sels, ARRAY_SIZE(gpu_pll_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MN_M7_ALT_PLL_BYPASS] = imx_clk_hw_mux_flags("m7_alt_pll_bypass", base + 0x74, 28, 1, m7_alt_pll_bypass_sels, ARRAY_SIZE(m7_alt_pll_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MN_ARM_PLL_BYPASS] = imx_clk_hw_mux_flags("arm_pll_bypass", base + 0x84, 28, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MN_SYS_PLL3_BYPASS] = imx_clk_hw_mux_flags("sys_pll3_bypass", base + 0x114, 28, 1, sys_pll3_bypass_sels, ARRAY_SIZE(sys_pll3_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MN_AUDIO_PLL1_BYPASS] = imx_clk_hw_mux_flags("audio_pll1_bypass", anatop_base, 16, 1, audio_pll1_bypass_sels, ARRAY_SIZE(audio_pll1_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MN_AUDIO_PLL2_BYPASS] = imx_clk_hw_mux_flags("audio_pll2_bypass", anatop_base + 0x14, 16, 1, audio_pll2_bypass_sels, ARRAY_SIZE(audio_pll2_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MN_VIDEO_PLL_BYPASS] = imx_clk_hw_mux_flags("video_pll_bypass", anatop_base + 0x28, 16, 1, video_pll_bypass_sels, ARRAY_SIZE(video_pll_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MN_DRAM_PLL_BYPASS] = imx_clk_hw_mux_flags("dram_pll_bypass", anatop_base + 0x50, 16, 1, dram_pll_bypass_sels, ARRAY_SIZE(dram_pll_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MN_GPU_PLL_BYPASS] = imx_clk_hw_mux_flags("gpu_pll_bypass", anatop_base + 0x64, 28, 1, gpu_pll_bypass_sels, ARRAY_SIZE(gpu_pll_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MN_M7_ALT_PLL_BYPASS] = imx_clk_hw_mux_flags("m7_alt_pll_bypass", anatop_base + 0x74, 28, 1, m7_alt_pll_bypass_sels, ARRAY_SIZE(m7_alt_pll_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MN_ARM_PLL_BYPASS] = imx_clk_hw_mux_flags("arm_pll_bypass", anatop_base + 0x84, 28, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MN_SYS_PLL3_BYPASS] = imx_clk_hw_mux_flags("sys_pll3_bypass", anatop_base + 0x114, 28, 1, sys_pll3_bypass_sels, ARRAY_SIZE(sys_pll3_bypass_sels), CLK_SET_RATE_PARENT); /* PLL out gate */ - hws[IMX8MN_AUDIO_PLL1_OUT] = imx_clk_hw_gate("audio_pll1_out", "audio_pll1_bypass", base, 13); - hws[IMX8MN_AUDIO_PLL2_OUT] = imx_clk_hw_gate("audio_pll2_out", "audio_pll2_bypass", base + 0x14, 13); - hws[IMX8MN_VIDEO_PLL_OUT] = imx_clk_hw_gate("video_pll_out", "video_pll_bypass", base + 0x28, 13); - hws[IMX8MN_DRAM_PLL_OUT] = imx_clk_hw_gate("dram_pll_out", "dram_pll_bypass", base + 0x50, 13); - hws[IMX8MN_GPU_PLL_OUT] = imx_clk_hw_gate("gpu_pll_out", "gpu_pll_bypass", base + 0x64, 11); - hws[IMX8MN_M7_ALT_PLL_OUT] = imx_clk_hw_gate("m7_alt_pll_out", "m7_alt_pll_bypass", base + 0x74, 11); - hws[IMX8MN_ARM_PLL_OUT] = imx_clk_hw_gate("arm_pll_out", "arm_pll_bypass", base + 0x84, 11); - hws[IMX8MN_SYS_PLL3_OUT] = imx_clk_hw_gate("sys_pll3_out", "sys_pll3_bypass", base + 0x114, 11); + hws[IMX8MN_AUDIO_PLL1_OUT] = imx_clk_hw_gate("audio_pll1_out", "audio_pll1_bypass", anatop_base, 13); + hws[IMX8MN_AUDIO_PLL2_OUT] = imx_clk_hw_gate("audio_pll2_out", "audio_pll2_bypass", anatop_base + 0x14, 13); + hws[IMX8MN_VIDEO_PLL_OUT] = imx_clk_hw_gate("video_pll_out", "video_pll_bypass", anatop_base + 0x28, 13); + hws[IMX8MN_DRAM_PLL_OUT] = imx_clk_hw_gate("dram_pll_out", "dram_pll_bypass", anatop_base + 0x50, 13); + hws[IMX8MN_GPU_PLL_OUT] = imx_clk_hw_gate("gpu_pll_out", "gpu_pll_bypass", anatop_base + 0x64, 11); + hws[IMX8MN_M7_ALT_PLL_OUT] = imx_clk_hw_gate("m7_alt_pll_out", "m7_alt_pll_bypass", anatop_base + 0x74, 11); + hws[IMX8MN_ARM_PLL_OUT] = imx_clk_hw_gate("arm_pll_out", "arm_pll_bypass", anatop_base + 0x84, 11); + hws[IMX8MN_SYS_PLL3_OUT] = imx_clk_hw_gate("sys_pll3_out", "sys_pll3_bypass", anatop_base + 0x114, 11); /* SYS PLL1 fixed output */ - hws[IMX8MN_SYS_PLL1_OUT] = imx_clk_hw_gate("sys_pll1_out", "sys_pll1", base + 0x94, 11); + hws[IMX8MN_SYS_PLL1_OUT] = imx_clk_hw_gate("sys_pll1_out", "sys_pll1", anatop_base + 0x94, 11); hws[IMX8MN_SYS_PLL1_40M] = imx_clk_hw_fixed_factor("sys_pll1_40m", "sys_pll1_out", 1, 20); hws[IMX8MN_SYS_PLL1_80M] = imx_clk_hw_fixed_factor("sys_pll1_80m", "sys_pll1_out", 1, 10); hws[IMX8MN_SYS_PLL1_100M] = imx_clk_hw_fixed_factor("sys_pll1_100m", "sys_pll1_out", 1, 8); @@ -400,7 +401,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_SYS_PLL1_800M] = imx_clk_hw_fixed_factor("sys_pll1_800m", "sys_pll1_out", 1, 1); /* SYS PLL2 fixed output */ - hws[IMX8MN_SYS_PLL2_OUT] = imx_clk_hw_gate("sys_pll2_out", "sys_pll2", base + 0x104, 11); + hws[IMX8MN_SYS_PLL2_OUT] = imx_clk_hw_gate("sys_pll2_out", "sys_pll2", anatop_base + 0x104, 11); hws[IMX8MN_SYS_PLL2_50M] = imx_clk_hw_fixed_factor("sys_pll2_50m", "sys_pll2_out", 1, 20); hws[IMX8MN_SYS_PLL2_100M] = imx_clk_hw_fixed_factor("sys_pll2_100m", "sys_pll2_out", 1, 10); hws[IMX8MN_SYS_PLL2_125M] = imx_clk_hw_fixed_factor("sys_pll2_125m", "sys_pll2_out", 1, 8); @@ -411,14 +412,13 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_SYS_PLL2_500M] = imx_clk_hw_fixed_factor("sys_pll2_500m", "sys_pll2_out", 1, 2); hws[IMX8MN_SYS_PLL2_1000M] = imx_clk_hw_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1); - hws[IMX8MN_CLK_CLKOUT1_SEL] = imx_clk_hw_mux2("clkout1_sel", base + 0x128, 4, 4, clkout_sels, ARRAY_SIZE(clkout_sels)); - hws[IMX8MN_CLK_CLKOUT1_DIV] = imx_clk_hw_divider("clkout1_div", "clkout1_sel", base + 0x128, 0, 4); - hws[IMX8MN_CLK_CLKOUT1] = imx_clk_hw_gate("clkout1", "clkout1_div", base + 0x128, 8); - hws[IMX8MN_CLK_CLKOUT2_SEL] = imx_clk_hw_mux2("clkout2_sel", base + 0x128, 20, 4, clkout_sels, ARRAY_SIZE(clkout_sels)); - hws[IMX8MN_CLK_CLKOUT2_DIV] = imx_clk_hw_divider("clkout2_div", "clkout2_sel", base + 0x128, 16, 4); - hws[IMX8MN_CLK_CLKOUT2] = imx_clk_hw_gate("clkout2", "clkout2_div", base + 0x128, 24); + hws[IMX8MN_CLK_CLKOUT1_SEL] = imx_clk_hw_mux2("clkout1_sel", anatop_base + 0x128, 4, 4, clkout_sels, ARRAY_SIZE(clkout_sels)); + hws[IMX8MN_CLK_CLKOUT1_DIV] = imx_clk_hw_divider("clkout1_div", "clkout1_sel", anatop_base + 0x128, 0, 4); + hws[IMX8MN_CLK_CLKOUT1] = imx_clk_hw_gate("clkout1", "clkout1_div", anatop_base + 0x128, 8); + hws[IMX8MN_CLK_CLKOUT2_SEL] = imx_clk_hw_mux2("clkout2_sel", anatop_base + 0x128, 20, 4, clkout_sels, ARRAY_SIZE(clkout_sels)); + hws[IMX8MN_CLK_CLKOUT2_DIV] = imx_clk_hw_divider("clkout2_div", "clkout2_sel", anatop_base + 0x128, 16, 4); + hws[IMX8MN_CLK_CLKOUT2] = imx_clk_hw_gate("clkout2", "clkout2_div", anatop_base + 0x128, 24); - np = dev->of_node; base = devm_platform_ioremap_resource(pdev, 0); if (WARN_ON(IS_ERR(base))) { ret = PTR_ERR(base); From patchwork Wed Nov 6 08:58:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3627 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B1F0F3F14C for ; Wed, 6 Nov 2024 10:06:19 +0100 (CET) Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-539fe4e75c4sf5428518e87.0 for ; Wed, 06 Nov 2024 01:06:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730883979; cv=pass; d=google.com; s=arc-20240605; b=H9zOf7HM/6dw4Tq6GAlwpMf6Tmw/Mm8okMCO4wQmfQZklnSV6ra5KeLm2JMorrmj8V 9ChlrHj/GoalXxeTcY6x01XeQ9u71CW/VwOb0Jc33h3Vc7rebUaQSL0RuMh7mAQzBwxH rBuxD7Ya9ZjAgT5utLcCneX5UWrrS9Xap0y84ZlbMLdNbvj9J55kmz1rzVIj30MQ/7zH orfAZ7jVhx8Ppc1uYRJdMAu+9vUl55J5fMdkLYJoC+GNBPZ2jXzUTEeQ+N7hh+zSwulI RIfc80og4b95OEPgbArFyFiSeFFqeDiRA8XZcKbGUEsSDNSSMBHsHChae1V3+5g88eqg UimQ== 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=BOD1An72YMXvMJfKl41oc3Awhw/ATEyhAcR3Iz3d9Q8=; fh=cVo4+EljbcC1W02WDTAytOr8R37yrPcdnODvERO72F4=; b=BCf/z7tmY0PM+T5GN3yt7Fisatb2BnossFQE8oIMxJx7IsYbBbgL6vDdH9Uc/AZQ+t CWEwCm4NmN29m+K4Qm61NiuJRgcON4pbVgEd31cwpyYasjE58AdCRe0bRAslmn17i8+V 0DiT3WM5Ay116vqUzL8tK9NAP7RldvYmqLs0xOpDPpuB4CkGk4pNw68B0K7/8cwOWHop 0FbIEKzap3j0md3udN3dVZqK5c3irIVgmuCMP/X8SiXEr3xEdiaQR2qPWWOYZ8xWzGa/ Y+vdXRsiCApw+TN4afcNb2cJCxqwCc8ynlWeQNrsXvsxy+D8z7EOkSqDJvX0W4dAfgIQ rmTA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Vgdcho3L; 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=1730883979; x=1731488779; 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=BOD1An72YMXvMJfKl41oc3Awhw/ATEyhAcR3Iz3d9Q8=; b=XRSBMx58XGeBot51XSxc+v7/LXPqdYy67R6L3z5BjFRjJYpsuwr5xwNlADvN0g0Rvq zQRbR/H3rb3H83j7SzsJymliwfUuuwhElyT/lAomSbzcWVDEuEEDvI6qRXHdi22wrLtK ZBo7KLA44zCYTwy6BxqN03bGXa/0qNhWAvCJk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730883979; x=1731488779; 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=BOD1An72YMXvMJfKl41oc3Awhw/ATEyhAcR3Iz3d9Q8=; b=w8PacDFviuQaS45cxSLENWlWbsibCUDNVMJ4ov+1b3OeY0kyw/arhkJeewnkYyKo/u zJWXRd2FR/t+ENewHvUbKWYvkhWzLam/Xg0qoy7VOP0RBELb5Isr3AlHq9FO/t01nu4C ImLmKktpLM7Y5gTE6LL/0hXmCWLy+JimiPW5N2muQVKGM7X2ULguICfcTDPArPIpFif+ zG+5smV3VuVEC72WXU1SeWD0uBY3dM+qQLGTwCLzCtSZinSfWz+9UvH+XZznNnLip3tN TyN32UkgHGjyUujdynI+57G6ZYb/BevU1VfURuoxalVsPrKbwqx6artgOjS25sb77fQk A4eA== X-Forwarded-Encrypted: i=2; AJvYcCXx2JC08A5Y7xPWiUf1ytVOsZZsl9pFvV+xqGut8Nse29CWkcQt2l9CrIF4d6lavdULI9z6glkUurU5DqxT@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwOV8Lu42WlN7GV2VhTNTxgAhJ9oNinRYs1df/h5JGyHoIbRsrd VJhW3M8UI6i4KJEmNzde+qhXo6YuhVVNQ2t8wDtMdLfQWxEcEOqaXdnqE4Pg88ksiiEDNtrU1g= = X-Google-Smtp-Source: AGHT+IFhVWhg/usj1J3LjMyiC6IKOM0LuGlEAQRIXwo26b/S4FXWbvwPpT+3i0NtN6YHkMU5w7b8MQ== X-Received: by 2002:ac2:4c54:0:b0:530:b773:b4ce with SMTP id 2adb3069b0e04-53d65df25d9mr15459068e87.33.1730883979008; Wed, 06 Nov 2024 01:06:19 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:ea8:b0:53c:75d1:4f2c with SMTP id 2adb3069b0e04-53c794ff769ls16256e87.1.-pod-prod-05-eu; Wed, 06 Nov 2024 01:06:17 -0800 (PST) X-Received: by 2002:a05:6512:ba0:b0:53c:74a7:43de with SMTP id 2adb3069b0e04-53d65df2488mr14394420e87.29.1730883977011; Wed, 06 Nov 2024 01:06:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730883976; cv=none; d=google.com; s=arc-20240605; b=X8j9YbeVeg/iordQeOIJufR+I/cdiKs7ayL7QR+YIp8KCR/bRuBlMBgNdFFFc+5mus Lfd2lATNQlTWRMOk681oR1iQQ1wOWjhKK5rCjlIqbpr3bmcWIUvJGgzGvtDU6dVxi8na 3wdUyRIT8d3T6ehDRLf13VGZ27mKQteGf3D0vDtCq34CbupiwCajWoVj74jcQLI0udsS KeCcOLgW80lPc42TSoIcPLz06yLssm6I1lDaBrFvHuQnVdOdtl2pdTEg0/H/heCqAq6U dLWnL+83HcSfJ4PioX7XDTneBXkUcPgqgDE5vsG36oodvjXNC92YEcwtc8i94NCe0WlY M9cw== 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=Hk3reyPLNpPW1T5hBq9gLHNsgFGFKl4S7Oe3HhKsMOw=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=QQyHGuJoeDa4jSN72Gn5pIMackTdUJu99dysq2+I1Z85F+HX6snWLq0NufeX2dCVAy FMIoJCqxMpk2PaqWb7YGB6zdcCYhjfuwm6x60qyzJKX2nhh6EYxyM7/mOhg2l6bh9F1Q 8b1QG1qbe3zL18Yd5r9E1jSkNU0InTQGgdqq1WjeZ1mzjjbKGpiYaxZBvasC6y0VvRl8 Ef7oIn2WrmQh4qiTURBDRcxLyZEy9TONIkByHj1fu20TlOkgtxGiPowKNukG9/+A48q4 4jKdp2LJnho+VHbKbdBmsi31x7SZl52Z70Ap7rDw6QZ6Y2HIJmhdgZ8PopUJ434xT5Tu PB8g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Vgdcho3L; 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 2adb3069b0e04-53c7bcce9absor4477828e87.21.2024.11.06.01.06.16 for (Google Transport Security); Wed, 06 Nov 2024 01:06:16 -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:a05:6512:159c:b0:539:8f3c:4586 with SMTP id 2adb3069b0e04-53d65e16881mr13255338e87.55.1730883976448; Wed, 06 Nov 2024 01:06:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:06:16 -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 6/8] clk: imx8mn: support spread spectrum clock generation Date: Wed, 6 Nov 2024 09:58:02 +0100 Message-ID: <20241106090549.3684963-7-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=Vgdcho3L; 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 drivers/clk/imx/clk-imx8mn.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index feefc9ef4f51..91b819d1c523 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -322,6 +322,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; struct device_node *anatop_np; void __iomem *base, *anatop_base; + struct imx_pll14xx_ssc pll1443x_ssc; int ret; clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, @@ -357,13 +358,18 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", anatop_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", anatop_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", anatop_base, &imx_1443x_pll); - hws[IMX8MN_AUDIO_PLL2] = imx_clk_hw_pll14xx("audio_pll2", "audio_pll2_ref_sel", anatop_base + 0x14, &imx_1443x_pll); - hws[IMX8MN_VIDEO_PLL] = imx_clk_hw_pll14xx("video_pll", "video_pll_ref_sel", anatop_base + 0x28, &imx_1443x_pll); - hws[IMX8MN_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, IMX8MN_AUDIO_PLL1, &pll1443x_ssc); + hws[IMX8MN_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, IMX8MN_AUDIO_PLL2, &pll1443x_ssc); + hws[IMX8MN_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, IMX8MN_VIDEO_PLL, &pll1443x_ssc); + hws[IMX8MN_VIDEO_PLL] = imx_clk_hw_pll14xx_ssc("video_pll", "video_pll_ref_sel", anatop_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", anatop_base + 0x50, &imx_1443x_dram_pll, &pll1443x_ssc); hws[IMX8MN_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", anatop_base + 0x64, &imx_1416x_pll); hws[IMX8MN_M7_ALT_PLL] = imx_clk_hw_pll14xx("m7_alt_pll", "m7_alt_pll_ref_sel", anatop_base + 0x74, &imx_1416x_pll); hws[IMX8MN_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", anatop_base + 0x84, &imx_1416x_pll); + hws[IMX8MN_SYS_PLL1] = imx_clk_hw_fixed("sys_pll1", 800000000); hws[IMX8MN_SYS_PLL2] = imx_clk_hw_fixed("sys_pll2", 1000000000); hws[IMX8MN_SYS_PLL3] = imx_clk_hw_pll14xx("sys_pll3", "sys_pll3_ref_sel", anatop_base + 0x114, &imx_1416x_pll); From patchwork Wed Nov 6 08:58:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3628 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 13FC13F14C for ; Wed, 6 Nov 2024 10:06:21 +0100 (CET) Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5c94273656csf4391416a12.0 for ; Wed, 06 Nov 2024 01:06:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730883981; cv=pass; d=google.com; s=arc-20240605; b=DDpu8s4k9iW8Tm8fsJN3ElkZk5ZTRZycMaGk04MrSyPdmRlLvHMjvw607zDw3ZnxPR mb7fdIspu/pxbBxkqZO+YMJgyT3GfTGFMPePM9kL4id/puNEMg7rIoA0IBVJjzNHYBsm 5JjCp56uYz2Q8v/d4eI3iZ5C2+Fd2MDtBDSXERqoNFyiAVi1Uwd6IsgMW5Y/93wh2yR1 9tbpY4/7Og94CITYQ+cZanOYqfR+kDQ1v95bNdF58tb1vzGkAow4Z/qUTqqHxzQCY3kq FSm6G0XxJa9iTd1N/JZIObCfJHDS0rk5+3/yWmZ+x7RVrVvOHREz3lG7Zo3UoADfRYfV EmEg== 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=TMc6idWCwYsdkWVpvdqJO5S0odDJpt4d5aF8jZIuk8M=; fh=8L9TSvzQBqb+luKbcqY+9sk+E3XCYMUOIt8MmwqsM9M=; b=agBEFvplyKOJb3SkSUjZLVt3eVBUXS76sTcI88GlYtEtCg6SOvY2HyTS6HUWqq9zNE qwKsIUCAfj2Rf9AO7C/vfN/nUbItCEDbRkYtKCP57TNMVTAX9uXriLpDmKrNmlwMOGZf 8jGr7TIT9Xx8ui9QYn+V/skyPxw8OfClAUk5iYVS7b2WxTYOWxyxbF8AFEZSxLZie6m4 Sc/spFg+PTezke9AA+Ck6yNH4JDirlxgSghua8PkjFnin6Ju5e5JsQTWKO9BKkTL3nlJ 7k72jjU4PrAAYBPRK3YJaojL2h6XumnwAhjp5H7esdBodvQILZ1Tsko35Xpuvy7Cd5fe Uung==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IyexGci7; 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=1730883981; x=1731488781; 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=TMc6idWCwYsdkWVpvdqJO5S0odDJpt4d5aF8jZIuk8M=; b=ZbyYpcwelTULFzlMZsyOrexpQX4ciBiQ7ETjp4xm2Hdm4QUxKzyWVLTfgJhpP9TkAf KvnK+DOa4dRHTldqYBkpweMTQ3me0UNxKg5Jh+IwUg9ha4Lgj9Bf+Dx6FuvZE7uAB3wN Bax9BS5JSjQ1uZb4wex2LnQAlyuLojdWNBPpc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730883981; x=1731488781; 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=TMc6idWCwYsdkWVpvdqJO5S0odDJpt4d5aF8jZIuk8M=; b=Wgig3Bx6iRyAnWbFqumBY3BvgjJmMOyuplKb8z2SJ9U0FJ3XrsYNj6aLHWfK4fw56J tYHKWKLrAlpDPXPo+N0QxF95nQ5NJhDCp3kE5/icUB0wDd4xu6hcxJhcHL1UhL8E8c6e fxf/Poz02UDf1ZduqsN7q4DHf4hmiqK0XbNJRY34C1YbSWu1IuXLNGs2y3AgAaZQEUUo D/3Ek+B9Zlfr5n7Mj+eLWWhcL/tk9PNdBNC8rm0u9pqlj6wmPLZOuvyJxjBM/xnHEOa0 +L8gw7+ak7AXCcc+nyL6rtlonG/VRezlHxHyqZEUnnjhvJ+50l99Pm6bTeACFqlOxNLr LHDQ== X-Forwarded-Encrypted: i=2; AJvYcCWnzmg9aLbMeUmvMPPwoX62zbQo6vjyLO4FiAYCeVBty06yauez4tov7iR5hZFOkpW16seoGMPV7CXHWYxa@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yz5cBZ1J3d/VY5u8RAAXXwU5JI7DzqYhkhdiJvVlfPKAiNLtFAi 3AHySdrG8QgyuNE9UuIsKsPtyTyPxufpQbWjCUJKMXBTMfmLJsUhpyfBUJOZlVeByQ== X-Google-Smtp-Source: AGHT+IGIOHrn8fdbR7J3ipNUXX+xWfGpGcsXmDgowvrA2MeRcgel+ilp1m3bHt3vj3B28NeXaB96kQ== X-Received: by 2002:a05:6402:3595:b0:5cb:def2:be0a with SMTP id 4fb4d7f45d1cf-5cbdef2bf78mr24463457a12.21.1730883980569; Wed, 06 Nov 2024 01:06:20 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:280d:b0:5c5:bad2:2aa4 with SMTP id 4fb4d7f45d1cf-5cedfdac119ls24366a12.0.-pod-prod-07-eu; Wed, 06 Nov 2024 01:06:19 -0800 (PST) X-Received: by 2002:a17:907:9802:b0:a9a:422:ec7 with SMTP id a640c23a62f3a-a9de5f6e2f9mr3963362766b.32.1730883978633; Wed, 06 Nov 2024 01:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730883978; cv=none; d=google.com; s=arc-20240605; b=CHKcUi9Mq3Dza3+z+bDuwPQfiwM7jFh/mEtejiNUw7xigiBMJQUF8ID4ydoHsuVg8B 60SkdUODPvBcUAPKY/6ss/pYP2lm0tLDd+prlk+lb4XfW2zSDGYfKoPiymd8JpJ9btTb 4AKNsuUTf+w+eC8Lc/YzMjSoSYDy6gHdPdaKxVL+sOyca9BBxPddyhE5jyUQLbg8eQqf k3txLWaq93LuRsH1CohftXjAE3UYMWkIGDsH9I2fXwK+QvievOWzXCW5DQ5Bl6Zs0i/M 6n95PQeOL003XD29InaZMIZGIVInq5HbWXhDutPHXnOR9fpl+ucMt1z24C7J9IC+QN7L xKDA== 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=2RymkxnNQTDpNcXN6Qg1uYxhHB5JeOGRw/tDAC3s4FE=; fh=u/u80m6tBSaxW7VWG5AQatIbYzkIAnRGhZp/RTASK5o=; b=NqzNvnqxVf4oxsGLvFgf0gWqfVFSMmXak9x8aaXR20HE+QxnDM75kGZU07s24RR13k ZHkbIO0jQImrDSZsmyWzy4eF6eDJ4bc/IOYyUMfJgLaXxUttvslERoSJaSJDqmZznw00 CESNP9jmkbK9Nqj9OuS8SaVC4ajth59B3NTZPi4eovqwrCJ5IJ03un0ZjiTg3Yqw6rfb LBKRAMRy2sHJOir6usponHrvyY1nLHmweDNQDDOrbPzw2bVTRMr5Q2rJQywHNXFHiT4N f4x/ZfITLSKpjf0q5mWtTsf5iuT/ysBCa3eO48GreyTtdqIGBYE7lMUew4rANehFDabN NsAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IyexGci7; 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-a9e5649b303sor602349066b.6.2024.11.06.01.06.18 for (Google Transport Security); Wed, 06 Nov 2024 01:06:18 -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:907:9724:b0:a99:ec3c:15cd with SMTP id a640c23a62f3a-a9de632bf49mr3313553366b.54.1730883978186; Wed, 06 Nov 2024 01:06:18 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:06:17 -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 7/8] clk: imx8mp: don't lose the anatop device node Date: Wed, 6 Nov 2024 09:58:03 +0100 Message-ID: <20241106090549.3684963-8-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=IyexGci7; 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: , Setting the "clk" (clock-controller@30380000) device node caused the reference to the "anatop" (clock-controller@30360000) device node to be lost. This patch, similar to what was already done for the base address, now distinguishes between the "anatop" device node and the "clk" device node. This change is preparatory for future developments. Signed-off-by: Dario Binacchi --- (no changes since v1) drivers/clk/imx/clk-imx8mp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c index 516dbd170c8a..b2778958a572 100644 --- a/drivers/clk/imx/clk-imx8mp.c +++ b/drivers/clk/imx/clk-imx8mp.c @@ -408,13 +408,13 @@ static struct clk_hw_onecell_data *clk_hw_data; static int imx8mp_clocks_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *np; + struct device_node *np, *anatop_np; void __iomem *anatop_base, *ccm_base; int err; - np = of_find_compatible_node(NULL, NULL, "fsl,imx8mp-anatop"); - anatop_base = devm_of_iomap(dev, np, 0, NULL); - of_node_put(np); + anatop_np = of_find_compatible_node(NULL, NULL, "fsl,imx8mp-anatop"); + anatop_base = devm_of_iomap(dev, anatop_np, 0, NULL); + of_node_put(anatop_np); if (WARN_ON(IS_ERR(anatop_base))) return PTR_ERR(anatop_base); 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);