From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 04 Dec 2026 13:37:18 +0100 Received: from mx1.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::107]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xZSXO-006DnQ-1p for lore@lore.pengutronix.de; Fri, 04 Dec 2026 13:37:18 +0100 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPS id 0A953201A3F for ; Fri, 04 Dec 2026 13:37:18 +0100 (CET) Authentication-Results: mx1.white.stw.pengutronix.de; dkim=pass header.d=lists.infradead.org header.s=bombadil.20210309 header.b=o8RmsQ9J; dkim=pass header.d=gmail.com header.s=20260707 header.b="C/RuP1yk"; spf=pass (mx1.white.stw.pengutronix.de: domain of "barebox-bounces+lore=pengutronix.de@lists.infradead.org" designates 2607:7c80:54:3::133 as permitted sender) smtp.mailfrom="barebox-bounces+lore=pengutronix.de@lists.infradead.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1796387838; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=/v+hhvhlpbRFU1ypmQVtC/vzSGoeg7LOy3Jc13LY9Hw=; b=fJv8rhHFngZDmqEeziR5LY7GrcqGSlO9Wlx3hOrturv9xbU+zsi/Weo4sVgjymTKw4wfnQ XblYRi7/I5R/PDFqC+Og663nbU1fXfyP8T0Es17hQrFDxA31AJrCKkyuJjV6o0cHhun2gZ tWCwGO0N4HeVR4Cb5Bh8ludlOyZiDwjS3btzBcqmnqJu1B8Bws6U3bpdciqKN8lk6PzP3k inH6kNiBkA6XnKXiZOYNawhCzhr79PjKSEiVamhueNiJruM+7T2+xWEOtRGBqNWuQ/Gzpo qQCOm+nZdN25kJOxgWPscHngXNJ94qbrIugql6T/CI6YcB96aRbuIhClzAWfEg== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1796387838; a=rsa-sha256; cv=none; b=f24dXG4nqb2gxH3FmZRRnsedOFDiAVa5KW9J6eRZZA97h/zsn20xBe9nbX5YE19pmQcGB9 zs5oxYS8LW2+JcsYOOC/WIuP5ZKD7j71c82pEB47tPwOSLCOqHpOq/+FZmPwXe+wP2btcE IAC0RzoZAmHGXR7d0OBndJOEU6Flfk44QfH4oP4PSzpouWp3I/uMadK/En/tyFK/kJqwtW c/GM8MCb7Un1wJ+B8nafJzcT/Givvxo943AIbbkrXoazjSfOJDcBCKiMNaQuIKh9U5ml0r Py8EL8m1E2XXKqfJ989F5q12veVZN3SJDOq2jT5Bo8qlrLbtN545xFc7NbiKGQ== ARC-Authentication-Results: i=1; mx1.white.stw.pengutronix.de; dkim=pass header.d=lists.infradead.org header.s=bombadil.20210309 header.b=o8RmsQ9J; dkim=pass header.d=gmail.com header.s=20260707 header.b="C/RuP1yk"; spf=pass (mx1.white.stw.pengutronix.de: domain of "barebox-bounces+lore=pengutronix.de@lists.infradead.org" designates 2607:7c80:54:3::133 as permitted sender) smtp.mailfrom="barebox-bounces+lore=pengutronix.de@lists.infradead.org"; dmarc=pass (policy=none) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=/v+hhvhlpbRFU1ypmQVtC/vzSGoeg7LOy3Jc13LY9Hw=; b=o8RmsQ9JCarTNuMiE8OAInCPFE UJghe/zB2coI4LwMuD7MHIin9oTs6LPt7RTeCI2LmfQArVtKYHGUXdX8YddfVx4E615Yc/Sj9+rtj YURpKNVuhpGYFqo9briocwWVCznMKdadWYkDR7yy0T4OQjyH85MKaxrPkTxvGVXB0uj2FEJbVD+wb 5NGBqB9hXsfcBO+EPqT01j3nrifTzf2r2aHfDMRIBnVdd1kabqeH11xeWgd8SI6+sLFkJvYa8VLdV jABoCWtZqhf7Hf5N2jkygTyBTbsh9HCPqkjUXSAfjkZpXaxYgSDy3cfg2UAeKvy/VHJiQZJMA84h1 /8EIDovw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZSVS-00000000IAr-3atc; Fri, 04 Dec 2026 12:35:18 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZSVP-00000000IA2-2S4V for barebox@lists.infradead.org; Fri, 04 Dec 2026 12:35:17 +0000 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-5bfbc67991cso640886e87.0 for ; Fri, 04 Dec 2026 04:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796387708; x=1796992508; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=/v+hhvhlpbRFU1ypmQVtC/vzSGoeg7LOy3Jc13LY9Hw=; b=C/RuP1ykDzEuRoLmlv0rdxCBcVP02mCiet3Urb+ylYBcg0heF5rd/AHQkxfNuv/KUM fgWFY0+CyEogSiTSarI0Zrqc522MGp2BcyD3ZVMgNaUgO7mPqf2+vO6LCHrCTgWmfCXb zWBdiCtqKG2R8PO6c0sWhn0XmChkWBB6YnVMkrAUOlMwE0AafhrKpPFw8i7+SbIjTOBp SuN/hAKgo1el3LGzpvlzOGcsVikEY2zf20IItG+zY1kI98PRssKd8Yts+78HwhJmH7VK RDkHk3BIoP+l730Nqhs3/mBM+abOoaNhXw7Dx+rvo0prihpUR4kfx6q0G3tg0JbOmk/t NEDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796387708; x=1796992508; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/v+hhvhlpbRFU1ypmQVtC/vzSGoeg7LOy3Jc13LY9Hw=; b=mDXR/Grap0N+diBJGMEsXGdxReweqSpuk7x/TuOTyS22sTm232gMttE4FbfiCTstZ8 p2w9Lg9vhad4z4/i1FmaoFzhQCNcX2FdYKv2mgb5R8n0j1zU9nGEAlAMCEPCOvPEJFP+ mXqKSIFIKiPVBDY013fUdDUNrypb/ENLQ8snZMkuiRynJQyMyka3KRyHtfyuUEabHqYU V+JPXi1XlcFJJfJYXV1pJDt1yACijL3aSVw+KZVKtl9QtUttpoqyZAS/UTIbxE+NUrfY r6mpH8ONVFJRN8c9UDsitA7WAK1oYK1rmYcH0kuK//ROKOdkLQAMrsqdzNjutzSkA0U/ 40Pg== X-Gm-Message-State: APuU4Z+2fDrfsUxSwDHAxzNSHFyTR4BEDudO7fOFcZ/t8Un+u07cBogh aokBN6worOLP2LiJlKJKDDhbgaHJcIrkoLtut4aO8lmk9gSwl2sg28VCbNWtdrFA X-Gm-Gg: AZFdTZefsesM+upPD1b/QnUmtLlKT+6eq9EQ925PWT3Mg2NgdF3rBbRHzELpnqXLGIF EyBZH0Ygb05AvWoRkwtyMfTQf+lt+mI2FkEm21qQN3ao/tvfl73kdDqcyZzOv7cXN8VZQbqftTe kxI7OpkMN5TmGHbuYxWAgUBH3ObmAK7m9zSQ9SdlaPsqTKNDg1ICYrjTMpP3sNk1Nmhb6ItpEgF LmlyohWA3BitORAlXtmYcj4XufoU8ixHhubA/MJOsrcmcxotL5XBxLPHQ48AJqgldfukOl3gqFx vSysYVyEviL01RyN4j9w+NmvkVoFhS8yN/BNLFtBxD+SFZl44OY2SR1H4YoGhTkTYFKkgGZPLiT UjhcuC3qQ75djoBdVu7xzU3UE6L30otfohXhwwz16ilgJypMRIb9QaJLytrFaZ2akZagF0vn4Cq jr+fk3XqQHnQLTZZRshS4YGmNlP2RnMZ8TPy7LOqye5q7PoWUoDiZjyidxlog7WC4AmlB2fzeO9 PtYOHZPtkIPwkGdSDriG582uglR00VT2xHjE0sL1ga0jnkY4bZTp5pnS0KN10B+FETQMiUySeyd LuYDK3HUrMogfpksCbfu+cqHv7IYHCyHK6maG8lXvQfkzuCjhdIfjvE= X-Received: by 2002:a05:6512:2352:b0:5c1:4fda:a97a with SMTP id 2adb3069b0e04-5c3861768bbmr484169e87.24.1796387707368; Fri, 04 Dec 2026 04:35:07 -0800 (PST) Received: from gentoo ([95.161.223.236]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5c384aa2ad1sm583268e87.64.2026.12.04.04.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 04:35:06 -0800 (PST) From: Alexander Shiyan To: barebox@lists.infradead.org Cc: Alexander Shiyan Subject: [PATCH 0/4] clk: rockchip: Fix RK3588/RK3576 fractional PLL handling Date: Fri, 4 Dec 2026 15:34:54 +0300 Message-ID: <20261204123458.3787582-1-eagle.alexander923@gmail.com> X-Mailer: git-send-email 2.56.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_043515_672939_063A94B1 X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The fractional PLL support for the RK3588 and RK3576 PLLs was ported from Linux but three defects were carried over with it, and a fourth PLL type was half-wired. First, the fractional denominator was off by one. The PLL register field holds values in the range 1..65535 while the reference implementation divides by 65536, so every fractional rate was computed w [...] Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [eagle.alexander923(at)gmail.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [eagle.alexander923(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:131 listed in] [list.dnswl.org] -0.0 DMARC_PASS DMARC pass policy X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-Spamd-Result: default: False [-11.22 / 15.00]; KNOWN_LIST_ID(-5.00)[barebox.lists.infradead.org]; BAYES_HAM(-2.81)[99.20%]; DWL_DNSWL_MED(-2.00)[infradead.org:dkim]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; R_MISSING_CHARSET(0.50)[]; R_SPF_ALLOW(-0.20)[+mx:c]; RCVD_IN_DNSWL_MED(-0.20)[2607:7c80:54:3::133:from]; MAILLIST(-0.20)[mailman]; R_DKIM_ALLOW(-0.20)[lists.infradead.org:s=bombadil.20210309,gmail.com:s=20260707]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_THREE(0.00)[4]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; RECEIVED_HELO_LOCALHOST(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TAGGED_FROM(0.00)[lore=pengutronix.de]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[lists.infradead.org:+,gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::131:received]; RECEIVED_SPAMHAUS_PBL(0.00)[95.161.223.236:received]; MID_RHS_MATCH_FROM(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[barebox@lists.infradead.org]; FROM_HAS_DN(0.00)[]; FROM_NEQ_ENVFROM(0.00)[eaglealexander923@gmail.com,barebox-bounces@lists.infradead.org]; FREEMAIL_CC(0.00)[gmail.com]; NEURAL_HAM(-0.00)[-1.000]; RCVD_VIA_SMTP_AUTH(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; TAGGED_RCPT(0.00)[]; ARC_SIGNED(0.00)[pengutronix.de:s=20260414:i=1]; ASN(0.00)[asn:7247, ipnet:2607:7c80:54::/48, country:US]; FORGED_SENDER_MAILLIST(0.00)[] X-Rspamd-Action: no action X-Rspamd-Queue-Id: 0A953201A3F X-Rspamd-Server: mx1 X-Stat-Signature: kg6df39o645uzjazfcps5ixrarj4dxy3 The fractional PLL support for the RK3588 and RK3576 PLLs was ported from Linux but three defects were carried over with it, and a fourth PLL type was half-wired. First, the fractional denominator was off by one. The PLL register field holds values in the range 1..65535 while the reference implementation divides by 65536, so every fractional rate was computed with a slightly too small denominator. Second, the fractional coefficient k is a signed 16-bit value in two's complement. Barebox declared it unsigned, which made negative coefficients impossible to express, so rates needing a negative correction were recalculated with the wrong sign. Third, the two RK3588/RK3576 fractional rate table entries that need a negative coefficient were written as if the field were unsigned. They are converted to the two's complement representation now that the type allows it. Finally, the RK3576 PPLL is registered with a PLL type that runs at twice the configured rate. The type and its ops existed, but recalc_rate did not apply the factor of two, so PPLL consumers saw half of the real clock. None of the current boards enable fractional PLL rates, and RK3576 PPLL consumers are not enabled in barebox either, so this is a correctness fix without an observable regression risk today. It matters for DisplayPort output (fractional rates) and for PCIe/MPHY reference dividers on RK3576 once those are enabled. Ported from the corresponding Linux commits, listed in each patch. Alexander Shiyan (4): clk: rockchip: Fix the fractional part denominator on RK3588/RK3576 PLLs clk: rockchip: Treat fractional PLL coefficient as two's complement clk: rockchip: Use two's complement coefficients in RK3588/RK3576 PLL tables clk: rockchip: Return twice the configured rate for pll_rk3588_ddr drivers/clk/rockchip/clk-pll.c | 19 ++++++++++++++----- drivers/clk/rockchip/clk-rk3576.c | 4 ++-- drivers/clk/rockchip/clk-rk3588.c | 4 ++-- drivers/clk/rockchip/clk.h | 8 ++++---- 4 files changed, 22 insertions(+), 13 deletions(-) -- 2.56.1