| Message ID | 20260906-sunxi-clk-no-p-v1-0-cbde21c9fe69@pigmoral.tech (mailing list archive) |
|---|---|
| Headers |
Return-Path: <linux-sunxi+bounces-25630-sunxi=pue.re@lists.linux.dev> X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id D9B341C075F for <noreply@patchwork.local>; Sun, 6 Sep 2026 09:07:45 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=pigmoral.tech; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-25630-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-25630-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id A0AC230953 for <noreply@patchwork.local>; Sun, 6 Sep 2026 07:07:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9988130BBBF; Sun, 6 Sep 2026 07:07:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=pigmoral.tech header.i=junhui.liu@pigmoral.tech header.b="Y037Dvrw" X-Original-To: linux-sunxi@lists.linux.dev Received: from sender5-op-o15.zoho.com (sender5-op-o15.zoho.com [165.173.182.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C2502116F4 for <linux-sunxi@lists.linux.dev>; Sun, 6 Sep 2026 07:07:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.182.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788678448; cv=pass; b=RViw/0gfMj2SsMM5QNDPuPlvbTTnMoXsTHMXGFRAZNWEhofEgIP+B18Mhuz/qiV2PQbN5MINt61IWy7h9pMhz2Vf2WdfcjNUBKTduWy9MkJzabIpjEOQ+COxEcif2Ci8rqZVd/zeY6Wx4OfBIYJ7ZwoCdVMByvv27fx1Mu+oOA4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788678448; c=relaxed/simple; bh=iKacs7dw+/b845xjJsLw2XuiPPAnkyl59zLiFFJQOGk=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=kFD8w6603FKMAz2eL1tjQKoViKNGf+R3GPUohAeEM5mqAcYwKTL2wgdJRJlNfCh1VWeJ4weogpGnQgXFy/TgJIce+y1JwHr2jGVukydY/5HRmNF2vh5el5FXYoCFDDZC/HDtjCHdR3vGgnOwGTtHqpH027iCkqsZRap08IGkZ3I= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pigmoral.tech; spf=pass smtp.mailfrom=pigmoral.tech; dkim=pass (1024-bit key) header.d=pigmoral.tech header.i=junhui.liu@pigmoral.tech header.b=Y037Dvrw; arc=pass smtp.client-ip=165.173.182.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pigmoral.tech Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pigmoral.tech ARC-Seal: i=1; a=rsa-sha256; t=1788678429; cv=none; d=zohomail.com; s=zohoarc; b=GU8Gw3pgmv5ENNEAPoh9K5f5gUMs2yTtMoZ24Vu2oIfXyiivo9utKhkzdMujzBf34Ldtsln8uN/PSbEEWxGroSnCvECwaQVwoAc8R+8E9UcJIKTpL7XGEFv4JZ4VmOPE8Y8y1uo27mT4XZCt9z5E74uEsq7DCl7fPvR++wc0CQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788678429; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=gefUybkzcJMt8GUfplUl0JMUrxgfiEae4tnmk2w8Y4A=; b=TZyhfMyKLQIKizNMdn1JCFzYd/Tc0WoNmmLZAJZ+Bo7MG3mcEmAIYNEN/dEfYgZKtC0ljMkcQByNzQ0wfCMhEp8kvEEDKog/Hnutuidi5aDLAydKE62vLIV61F5o1LHd4d4ZpMxp7WxJ96ijeezYrl1YwQSMUcGHdQP1XdF4EhQ= 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> DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1788678429; s=zmail; d=pigmoral.tech; i=junhui.liu@pigmoral.tech; h=From:From:Subject:Subject:Date:Date:Message-Id:Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding:To:To:Cc:Cc:Reply-To; bh=gefUybkzcJMt8GUfplUl0JMUrxgfiEae4tnmk2w8Y4A=; b=Y037DvrwqTN5toJhjziaJ/7FRQq2TAxLR/eKe1KKfQDh8xEQYGa0TGqrZ7sR763/ PkYM+/PXwZKObE4Rzo5XlcOiJ2wfA5NWnUhUtMKoeOz+QRfDJksb3C3R383q+D+LT8K uAtkqYA/ccvP9mJ7Fe0LJvPHoABug0ID3f9qDIGg= Received: by mx.zohomail.com with SMTPS id 1788678426986262.3131105999689; Sun, 6 Sep 2026 00:07:06 -0700 (PDT) From: Junhui Liu <junhui.liu@pigmoral.tech> Subject: [PATCH 0/4] clk: sunxi-ng: a523: Fix single-divider clocks Date: Sun, 06 Sep 2026 15:06:37 +0800 Message-Id: <20260906-sunxi-clk-no-p-v1-0-cbde21c9fe69@pigmoral.tech> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: <linux-sunxi.lists.linux.dev> List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzMDSwMz3eLSvIpM3eScbN28fN0C3ZRUY1Nzk1RTCyPjRCWgpoKi1LTMCrC B0bEQfnFpUlZqcgnIFKXaWgAkAhN5cgAAAA== X-Change-ID: 20260906-sunxi-clk-no-p-de3574e5823a To: Stephen Boyd <sboyd@kernel.org>, Brian Masney <bmasney+clk@redhat.com>, Jerome Brunet <jbrunet+clk@baylibre.com>, Chen-Yu Tsai <wens@kernel.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Andre Przywara <andre.przywara@arm.com> Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Junhui Liu <junhui.liu@pigmoral.tech> X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2495; i=junhui.liu@pigmoral.tech; h=from:subject:message-id; bh=iKacs7dw+/b845xjJsLw2XuiPPAnkyl59zLiFFJQOGk=; b=owGbwMvMwCWWvDb1VEXc8j+Mp9WSGLLmCrK0Z2RuORfzuqfXZbOq5v8wY8eCVQtE+9mcW6wXZ UlpPW7pKGVhEONikBVTZOHyF/9nrcPz7YhA632YOaxMIEMYuDgFYCIGTxj+KZw4mdunZRVYFLtU L3vmDr+0XJ2dxabrC7Mnn9eSYZivzshw8sIG7v+bGQ0mmOzddjKlOrlB0843a0Ob9KU/y/YWyC/ nAgA= X-Developer-Key: i=junhui.liu@pigmoral.tech; a=openpgp; fpr=15B30CC69C4BF0CC3C08F85A2A90CDC122DF37BF X-ZohoMailClient: External X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; TAGGED_RCPT(0.00)[clk]; DMARC_NA(0.00)[pigmoral.tech]; ARC_ALLOW(0.00)[zohomail.com:s=zohoarc:i=2]; DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:rdns,sea.lore.kernel.org:helo]; RCPT_COUNT_TWELVE(0.00)[12]; FROM_HAS_DN(0.00)[]; R_DKIM_ALLOW(0.00)[pigmoral.tech:s=zmail]; RCVD_COUNT_FIVE(0.00)[5]; FREEMAIL_TO(0.00)[kernel.org,redhat.com,baylibre.com,gmail.com,sholland.org,arm.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; DKIM_TRACE(0.00)[pigmoral.tech:+]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; FORGED_SENDER_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[junhui.liu@pigmoral.tech,linux-sunxi@lists.linux.dev]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; TAGGED_FROM(0.00)[bounces-25630-noreply=patchwork.local]; TO_DN_SOME(0.00)[] X-Rspamd-Queue-Id: D9B341C075F X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= |
| Series |
clk: sunxi-ng: a523: Fix single-divider clocks
|
|
Message
Junhui Liu
Sept. 6, 2026, 7:06 a.m. UTC
Sashiko pointed out two issues in my series adding clock driver support
for the Allwinner A733 SoC [1][2].
First, ccu_mp_set_rate() generates an invalid mask when an MP clock is
defined with a zero-width P divider, clearing unrelated register fields.
Second, ccu_mp_set_rate() does not handle CCU_FEATURE_UPDATE_BIT, so
divider changes are not latched by the hardware.
The affected A733 clocks were modeled after the existing A523 MBUS,
IOMMU, and DRAM clocks, which have the same issues. According to the
hardware description, these clocks only contain an M divider and should
be modeled as M-only clocks.
The A523 high-speed and PRCM timer clocks have the opposite problem.
They only contain a P divider but are modeled as MP clocks with a
zero-width M divider.
Add a feature-capable variant of the M-only clock macro and migrate the
affected A523 clocks to it. Convert the timer clocks to the existing
P-only clock type. The affected A733 clocks will use the new M-only
macro in the next revision of the A733 CCU series.
Tested on Radxa Cubie A5E with CLOCK_ALLOW_WRITE_DEBUGFS enabled:
# cat /sys/kernel/debug/clk/mbus/clk_rate
600000000
# devmem 0x02001540 32
0xC0000003
# echo 300000000 > /sys/kernel/debug/clk/mbus/clk_rate
Results without this series:
# cat /sys/kernel/debug/clk/mbus/clk_rate
600000000
# devmem 0x02001540 32
0x00000003
Results with this series:
# cat /sys/kernel/debug/clk/mbus/clk_rate
300000000
# devmem 0x02001540 32
0xC0000007
Link: https://lore.kernel.org/r/20260905164854.57BEF1F00A3A@smtp.kernel.org [1]
Link: https://lore.kernel.org/r/20260905164855.57E751F00A3D@smtp.kernel.org [2]
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
Junhui Liu (4):
clk: sunxi-ng: div: Add feature support to M clock macro
clk: sunxi-ng: sun55i-a523-ccu: Use M-only clocks for MBUS, IOMMU and DRAM
clk: sunxi-ng: sun55i-a523-ccu: Use P-only clocks for high-speed timers
clk: sunxi-ng: sun55i-a523-r-ccu: Use P-only clocks for timers
drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c | 37 ++++-----
drivers/clk/sunxi-ng/ccu-sun55i-a523.c | 128 ++++++++++++++-----------------
drivers/clk/sunxi-ng/ccu_div.h | 18 ++++-
3 files changed, 88 insertions(+), 95 deletions(-)
---
base-commit: 4d7d9486c04d917265f64c55bd23b2cc4fe7749c
change-id: 20260906-sunxi-clk-no-p-de3574e5823a
Best regards,
--
Junhui Liu <junhui.liu@pigmoral.tech>