[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250216-kona-bus-clock-v1-0-e8779d77a6f2@gmail.com>
Date: Sun, 16 Feb 2025 17:12:35 +0100
From: Artur Weber <aweber.kernel@...il.com>
To: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Ray Jui <rjui@...adcom.com>, Scott Branden <sbranden@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Cc: Alex Elder <elder@...nel.org>,
Stanislav Jakubek <stano.jakubek@...il.com>, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
~postmarketos/upstreaming@...ts.sr.ht,
Artur Weber <aweber.kernel@...il.com>, Alex Elder <elder@...nel.org>
Subject: [RFC PATCH 0/5] clk: bcm: kona: Add bus clock support and
prerequisite clocks
This patchset does the following:
- Introduce support for bus clocks. These are fairly similar to
peripheral clocks, but only implement policy, gate and hyst.
- Introduce support for prerequisite clocks; this way we can
make peripheral clocks automatically enable their corresponding
bus clocks.
- Add matching bus clocks for BCM21664 peripheral clocks and update
device tree bindings to match.
The prerequisite clock portion of this patchset is adapted from an
older attempt to add bus clocks[1], submitted by Alex Elder. I've
retained his authorship on that commit.
Notably, Alex's patchset moved clock initialization to the prepare
function. This seems to be incorrect; the prepare function gets called
before the enable function, but not before "set rate"/"set parent"
functions; thus, while clocks enabled fine, any configuration done
before they were first enabled was broken. I ignored that part of
the patchset and only kept the prerequisite clocks.
I would appreciate feedback on the prerequisite clock patch, hence
why this patchset is marked as RFC.
I wasn't able to find any other driver that does something like this,
so I'm not sure if it's correct (especially since I had to switch from
non-locking __clk_prepare and __clk_enable to the regular locking
versions, as the non-locking versions are no longer public - they
appear to have been replaced by clk_core counterparts, but those
functions are not exported anywhere AFAICT).
An alternative way to do this dependency would be to wrap every
component with a relevant bus clock in a "simple-pm-bus" node
with the bus clock in DT, but this seems rather unwieldy.
[1] https://lore.kernel.org/lkml/1402926007-4436-1-git-send-email-elder@linaro.org/
Signed-off-by: Artur Weber <aweber.kernel@...il.com>
---
Alex Elder (1):
clk: bcm281xx: implement prerequisite clocks
Artur Weber (4):
dt-bindings: clock: brcm,kona-ccu: Add BCM21664 bus clocks
clk: bcm: kona: Add support for bus clocks
clk: bcm21664: Add matching bus clocks for peripheral clocks
ARM: dts: bcm2166x-common: Add matching bus clocks for peripheral clocks
.../devicetree/bindings/clock/brcm,kona-ccu.yaml | 18 ++-
arch/arm/boot/dts/broadcom/bcm2166x-common.dtsi | 28 +++--
drivers/clk/bcm/clk-bcm21664.c | 107 ++++++++++++++++--
drivers/clk/bcm/clk-kona-setup.c | 116 +++++++++++++++++++
drivers/clk/bcm/clk-kona.c | 124 ++++++++++++++++++++-
drivers/clk/bcm/clk-kona.h | 30 ++++-
include/dt-bindings/clock/bcm21664.h | 19 +++-
7 files changed, 411 insertions(+), 31 deletions(-)
---
base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04
change-id: 20250212-kona-bus-clock-4297eefae940
Best regards,
--
Artur Weber <aweber.kernel@...il.com>
Powered by blists - more mailing lists