Article View: linux.kernel.netdev
Article #22892Re: [PATCH v7 4/8] clk: sunxi-ng: a733: Add PLL clocks support
From: "Junhui Liu"
Date: Thu, 26 Nov 2026 03:37
Date: Thu, 26 Nov 2026 03:37
66 lines
12053 bytes
12053 bytes
Hi Alastair,
On Wed Nov 25, 2026 at 8:24 PM CST, Alastair D'Silva wrote:
> Hi Junhui,
>
> On Thu, 12 Nov 2026, Junhui Liu wrote:
>> static struct ccu_nkmp pll_ref_clk = {
>> ...
>> };
>> ...
>> static CLK_FIXED_FACTOR_HWS(sys_24M_clk, "sys-24M", pll_ref_hws, 1, 1, 0);
>
> While testing this v7 series on the OrangePi 4 Pro (24 MHz HOSC), ttyS0
Before ordering an Orange Pi 4 Pro to investigate this, I checked its
schematic, "OPI 4 PRO V1_3_2_20260109.pdf". Y1 is marked
"26M-20pF-10ppm", with a "USE 26M" note, and the CK-SEL resistors are
configured for 26 MHz.
Could you double check the crystal frequency on your board?
> switches from earlycon to garbled output with:
>
> 2500000.serial: ttyS0 MMIO32:0x0000000002500000 (irq = 414, base_baud = 1384615) is a 16550A
>
> Because the hardware bypasses pll-ref (0x02002000) when HOSC is 24 MHz,
> sys-24M physically runs at 24 MHz from HOSC, while pll-ref remains
> disabled with reset/unprogrammed N=12, M=13 fields. Since
> ccu_nkmp_ops.recalc_rate() computes parent_rate * N / M regardless of
> the enable bit, pll-ref reports 24000000 * 12 / 13 = 22153846 Hz.
I also noticed that your DTS in your U-Boot patch sets sets the
oscillator frequency to 24 MHz. If the board actually uses a 26 MHz
crystal, but the DTB used by Linux declares 24 MHz, the PLL_REF N/M
ratio of 12/13 would give:
Actual: 26000000 * 12 / 13 = 24000000 Hz
Reported: 24000000 * 12 / 13 = 22153846 Hz
This would also explain the reported rate and UART baud error.
Could you check the oscillator frequency in the DTB Linux is using and
share the raw values of PLL_REF_CTRL (0x02002000) and RTC_XO_CTRL0
(0x07090160)? That should help distinguish these possibilities.
>
> sys-24M, apb-uart, and bus-uart0 inherit 22153846 Hz instead of
> 24000000 Hz, so 8250_dw calculates base_baud = 1384615 (instead of
> 1500000) and programs divisor 12 instead of 13 (+8.3% baud error).
>
> If pll-ref is disabled/bypassed (or if sys-24M is physically fixed at
> 24 MHz as the comment describes), either pll_ref_clk needs a recalc_rate
> that returns 24 MHz when disabled/bypassed, or sys_24M_clk should not
> inherit an unenabled pll-ref N/M ratio.
>
> Tested on OrangePi 4 Pro (Allwinner A733).
>
> Thanks,
> Alastair
--
Best regards,
Junhui Liu
Technical Details
Message-ID:
<DN4TUQIL3J9N.XYYN5MTODT2C@pigmoral.tech>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371861-linux-kernel-netdev=dewy.ruReferences:
<20261112-a733-clk-v7-4-db7c5451ffa2@pigmoral.tech> <20261125122452.3966873-1-alastair@d-silva.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371861-linux-kernel-netdev=dewy.ru
From: junhui.liu@pigmoral.tech ("Junhui Liu")
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v7 4/8] clk: sunxi-ng: a733: Add PLL clocks support
Date: Thu, 26 Nov 2026 11:37:34 +0800
Organization: Usenet Network
Message-ID: <DN4TUQIL3J9N.XYYN5MTODT2C@pigmoral.tech>
References: <20261112-a733-clk-v7-4-db7c5451ffa2@pigmoral.tech>
<20261125122452.3966873-1-alastair@d-silva.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="373581"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:2/OKsrw9iu7Hc8JHovF7jnfRfT4= sha256:dNdgAi2PMHt53QnWk/x/aztI+zhYd0Dg43dN5AlsxWc=
sha1:JbmjegPpvtGYhFpFG0PEQV3G/mE= sha256:PFUn7Oi2iJ/MCAah5Wnr9HPgdlql1hqP+htGeE5MC74=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 04BB7125EAF; Thu, 26 Nov 2026 06:39:12 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.651
X-Spam-Status: No, score=-1.651 tagged_above=-9999 required=6.31
tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1,
DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=fail (1024-bit key)
reason="fail (message has been altered)" header.d=pigmoral.tech
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id Tp4MsRshGdnW;
Thu, 26 Nov 2026 06:39:07 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-371861-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=pigmoral.tech
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 5C9B1125EAD; Thu, 26 Nov 2026 06:38:57 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 6A23941663; Thu, 26 Nov 2026 03:38:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795664334;
b=kBaF4OSDbdXkE4LI2zR1TKaSdXRLlNUarcRqLi3Yu8z0j6sIQAsUyTc2Q4HHsiGR6jei
vcrom81VhAyfvgP1clQ2eRXK49tKe3Hy7whKJMzqxaIaQoJwdoLfd+jU6FpNngvzeWiBe
NFIxWVbLsrzVG7seO8ZI3AlHxTIgppHaWtvDmv3Gh67odtdyPBOW5+AnVln+XYANOgLWk
RNWJwVtKlWm5aXrX3N9mzMt4C1fpz8S/533qkPwhzwr1hgmk4riZGm7Y3F0/CMTBsu8LR
L8PkCDHa8p+7dtXexIUdz0XL698lcTNsdpvFK20OcxzqlKtzX0w4gYPr503jcx/Ib3Q==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795664334;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:Mime-Version:
Content-Transfer-Encoding:Content-Type:Date:Message-Id:Cc:Subject:
From:To:X-Mailer:References:In-Reply-To:X-ZohoMailClient;
bh=4FiZB15xhKIOJGy2ZwbI3s6k8WVaPRsBBgY+WA+DbhU=;
b=bQp0z46rjuzjUxPHgF12+GOgZ//AgawD31XUB/XSH74OKOFA+6ORG60I1aFgXVMkqbGz
EwO0pUkqmWI3OiUHcCHebhJDL7od1sKQhVAq/UDBF0oxE84rmwrUsT5OzUCBUzQJ1boXX
YDIPCy+0Pa3GSSl0b3eupxdP1Tbuog02DAWPVRCAQQ6nmdlCzYWPI0AvQ7YG2m+7EVeJc
WzhJFtarDklFaJbYq6nE1fc2P7Xq+T/jq5l3GRBTPsHkr/NxpKDq3P4ZMuDvD0sqDiVG0
613ApwH2Ey3g5iu8htiOHvKebxi0U0I3pz48RrpC+M2aBoftU844P5j9++pIDGuZGew==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org;
dkim=fail reason="signature verification failed" header.d=pigmoral.tech header.i=@pigmoral.tech header.a=rsa-sha256 header.s=zmail header.b=EQ9IfgrN;
dmarc=none header.from=pigmoral.tech;
spf=pass smtp.mailfrom=pigmoral.tech;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BD80606A32C;
Thu, 26 Nov 2026 03:38:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=fail reason="signature verification failed" (1024-bit key) header.d=pigmoral.tech header.i=@pigmoral.tech header.a=rsa-sha256 header.s=zmail header.b=EQ9IfgrN
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.120
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795664328;
b=fvk1Kdz+E0Ai/1jk0CqGFGswK99k/IkMcALGzgNb3Mxwz0WSVVUlaD/MRHjAYqVl75/d
dVkJCkV2S37v89onuKBSVDfqUSZ6X4mx2rNJS7GnU0n4gDcHMKi8VjtU0AGXTBr2GJrmt
Od1qwt3tV4jRDLQJ4wMKFXeP/u4HJcoayVGx1QQ0KtE9odEJciV1TrGqfla/OnXzGjzsR
9GdJXZecizEqrvZatprk14w3f8o5E+PDl6l1E1Iu1r0EYC8IBtL8pTBGx/fyfSIh9Skbi
UwlG6/yIgX654RG//sZ+6Okm/fKynB6zAEEH/kCJWb1BTVWdPs1D2hcLd4WXAIoEO6g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795664328;
h=DMARC-Filter:DKIM-Signature:Received:Mime-Version:
Content-Transfer-Encoding:Content-Type:Date:Message-Id:Cc:Subject:
From:To:X-Mailer:References:In-Reply-To:X-ZohoMailClient;
bh=4FiZB15xhKIOJGy2ZwbI3s6k8WVaPRsBBgY+WA+DbhU=;
b=1E7wzQUVjEuyWckeH6RV4RecjP1DDFren9hTjuEUltpe7b1KvIudT2FWjlAv6uJ4A81d
lyLZJdofdcVcGX9q7bSA8krQ303JpYwK0Ca7y37Y3CAnFM+WIeMiktKokJJL3MGoejJyX
HpaSuIZDkKrpWZuosalceYZwTojSBWOAH8AymbeefoAu/x7M8IEJWJ3YtdNHzx5BHEcmT
fcTtMC3vk9pnv73rN7Rsrsdu2YPnfDYzkZ19Wy6RiJx9iwsEBXXzHR90fyBvz8oUHHxzg
MmGuYt07bvMHC9rP+ideEuWjF0iF2ogJVxK6fw1vDMAO9jqXhzU1iqkozJv7zsmAyhw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=none header.from=pigmoral.tech;
spf=pass smtp.mailfrom=pigmoral.tech;
dkim=pass header.d=pigmoral.tech header.i=@pigmoral.tech header.a=rsa-sha256 header.s=zmail header.b=EQ9IfgrN;
arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.120
X-Received: from sender5-pp-g120.zoho.com (sender5-pp-g120.zoho.com [165.173.182.120])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA8AF606A321;
Thu, 26 Nov 2026 03:38:47 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DA8AF606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pigmoral.tech
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pigmoral.tech
X-ARC-Seal: i=1; a=rsa-sha256; t=1795664266; cv=none;
d=zohomail.com; s=zohoarc;
b=DCST9ByL27Upx2hl0RzcqKcwt9Z7EVBalVed5KTX5p0dqKgovEq5o1KKe0YRBS+WcivtXbO2HcSsag7nrcXRTvRkdF4ReXXxt9iz1s9PoVOFQmi11LbzT9r9B/kIjmriAHMWtZhI0m0IKdtNWOgQqyyY7Juu1hLpt/ZwF3YvN7A=
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc;
t=1795664266; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To;
bh=4FiZB15xhKIOJGy2ZwbI3s6k8WVaPRsBBgY+WA+DbhU=;
b=lf8eHZZofR8MSZAryQsfxNMzo5nZCqRPrbimNdazOKSxaVgEnEWR/uLPY3JABWWMxEx00UTdHuMZsxS+SSV4W6jOFX1Pi4Acpks+U4XjEI1LxRRFyOdmOv9gBhq8shkdbZAH5IRd82yXsBpFzdPm5yALBN6RiHDsEb5EArE4SAE=
X-ARC-Authentication-Results: i=1; mx.zohomail.com;
dkim=pass header.i=pigmoral.tech;
spf=pass smtp.mailfrom=junhui.liu@pigmoral.tech;
dmarc=pass header.from=<junhui.liu@pigmoral.tech>
X-DKIM-Signature: a=rsa-sha256; b=EQ9IfgrNgxR+Fh8LE3AvioVr5xbMX20L/NC1Z/s6ccpmAAcOkqIZk9M8kr1WRakP3rPB+5QW3B8Um0A1PiQPrZg5YshCazvMMtRztBSlhCuqO5kYenDFYKWtlDV8c8ZnJ9wfsjd94X0fu1WcsaTvBvnW5SygE1tQv93AXACAkOg=; c=relaxed/relaxed; s=zmail; d=pigmoral.tech; v=1; bh=4FiZB15xhKIOJGy2ZwbI3s6k8WVaPRsBBgY+WA+DbhU=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc;
X-Received: by smtp.zohomail.com with SMTPS id 1795664265088521.0475713937745;
Wed, 25 Nov 2026 19:37:45 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Cc: <linux-clk@vger.kernel.org>, <linux-sunxi@lists.linux.dev>,
<linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
"Andre Przywara" <andre.przywara@arm.com>, <netdev@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-riscv@lists.infradead.org>, "Jerome
Brunet" <jbrunet@baylibre.com>, "Enzo Adriano"
<enzo.adriano.code@gmail.com>, "Norman Herms" <dockseed@proton.me>,
"Vinicius Pedrosa" <vinicius.eduardo.pedrosa@gmail.com>
X-Mailer: aerc 0.22.0
X-In-Reply-To: <20261125122452.3966873-1-alastair@d-silva.org>
X-ZohoMailClient: External