Skip to content

Redo PolarFire SoC's mailbox/clock devicestrees and related code

Conor Dooley linux-clk linux-devicetree linux-riscv lkml 7 versions – In review

Get series with b4
b4 am 20251110-zookeeper-femur-68a0ae346397@spud

Versions newest first · linked by author and title

  1. v7 Latest5 patches 3 repliesIn review
  2. v67 patches 6 repliesApplied
  3. v59 patches 10 repliesApplied
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v49 patches2 repliesApplied
v39 patches4 repliesSuperseded
v2 RFC9 patches8 repliesSuperseded
v111 patches17 repliesApplied

Changes in v7 from the cover letter

- move reset driver entirely to regmap
- use clear_bits/set_bits instead of update_bits in reset
- drop clock patches that Claudiu applied

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5reset: mpfs: add non-auxiliary bus probingdrivers/clk/microchip/clk-mpfs.c drivers/reset/Kconfig drivers/reset/reset-mpfs.c +1 more+61 -393 replies
2/5riscv: dts: microchip: fix mailbox descriptionarch/riscv/boot/dts/microchip/mpfs.dtsi+12 -30 replies
3/5riscv: dts: microchip: convert clock and reset to use sysconarch/riscv/boot/dts/microchip/mpfs.dtsi+12 -70 replies
4/5MAINTAINERS: add new soc drivers to Microchip RISC-V entryMAINTAINERS+2 -00 replies
5/5MAINTAINERS: rename Microchip RISC-V entryMAINTAINERS+1 -10 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchPhilipp Zabel
1/5R-b A-b
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/5] Redo PolarFire SoC's mailbox/clock devicestrees and related code

From: Conor Dooley <[email protected]>

Hey folks,

Here's another version with the reset stuff moved completely to regmap as you requested Philipp. I think it looks better this way.

Claudiu, I think you're going to "have" to take the reset bits with an ack, because they now depend on changes to the clock driver (and contain some further changes to the regmap config and aux bus portion).

Cheers,
Conor.

v7:
- move reset driver entirely to regmap
- use clear_bits/set_bits instead of update_bits in reset
- drop clock patches that Claudiu applied

v6:
- make reset depend on MFD_SYSCON
- return regmap_update_bits() result directly instead of an additional return 0 in reset
- use regmap_update_bits() instead of regmap_read() -> regmap_write() RMW sequences in clock
- drop clock driver specific lock, since regmap has internal locking, from !msspll clocks
- implement determine_rate instead of round_rate
- drop patch 1 & 2 (soc bits) since I applied them as a pre-req for pinctrl work

v5:
- drop mfd patch applied by Lee
- remove attempt at common regmap divider/gate clocks, and replace it with a return to how the code used to look, before it started using the non-regmap versions of the common divider/gate, with the readl()/writel()s replaced by their regmap equivalents.

v4:
- unify both regmap clk implementations under one option
- change map_offset to a u32, after Gabriel pointed out that u8 was too restrictive.
- remove locking from regmap portion of reset driver, relying on inherent regmap lock

v3 changes:
- drop simple-mfd (for now) from syscon node

v5/6 cover letter:

In v5 the only real change is that I removed the attempt at a common implementation of regmap-based divider/gate clocks. The series hasn't managed to receive feedback on my approach in 2025, despite sending several revisions and bumps, and it is blocking support for both new drivers (gpio interrupt support, pinctrl and hwmon off the top of my head) and a new platform so I have decided to strip out the attempt at making something common in exchange for something that can be merged through the clk-microchip tree without relying on feedback from the clock maintainers.

Currently the driver uses the common gate and divider clocks, but the driver used to use its own custom clock types. Reprising this version of the code allows me to use regmap accessors in the driver without any wider impact, or attempting to create something that works for any other user. It has the advantage that it has already been tested in that prior for, and all that is done to the clock implementations is replacing readl()s and writel()s with their regmap equivalents.

v2 cover letter:

Here's something that I've been mulling over for a while, since I started to understand how devicetree stuff was "meant" to be done. There'd been little reason to actually press forward with it, because it is fairly disruptive. I've finally opted to do it, because a user has come along with a hwmon driver that needs to access the same register region as the mailbox and the author is not keen on using the aux bus, and because I do not want the new pic64gx SoC that's based on PolarFire SoC to use bindings etc that I know to be incorrect.

Given backwards compatibility needs to be maintained, this patch series isn't the prettiest thing I have ever written. The reset driver needs to retain support for the auxiliary bus, which looks a bit mess, but not much can be done there. The mailbox and clock drivers both have to have an "old probe" function to handle the old layout. Thankfully in the clock driver, regmap support can be used to identically handle both old and new devicetree formats - but using a regmap in the mailbox driver was only really possible for the new format, so the code there is unfortunately a bit of an if/else mess that I'm both not proud of, nor really sure is worth "improving".

The series should be pretty splitable per subsystem, only the dts change has some sort of dependency, but I'll not be applying that till everything else is in Linus' tree, so that's not a big deal.

I don't really want this stuff in stable, hence a lack of cc: stable anywhere here, since what's currently in the tree works fine for the currently supported hardware.

AFAIK, the only other project affected here is U-Boot, which I have already modified to support the new format.

I previously submitted this as an RFC, only to Lee and the dt list, in order to get some feedback on the syscon/mfd bindings:
https://lore.kernel.org/all/20240815-shindig-bunny-fd42792d638a@spud/
I'm not really going to bother with a proper changelog, since that was submitted with lots of WIP code to get answers to some questions. The main change was "removing" some of the child nodes of the syscons.

And as a "real" series where discussion lead to me dropping use of the amlogic clk-regmap support:
https://lore.kernel.org/linux-clk/20241002-private-unequal-33cfa6101338@spud/
As a result of that, I've implemented what I think Stephen was asking for - but I'm not at all sure that it is..

CC Conor Dooley <[email protected]>
CC Daire McNamara <[email protected]>
CC Michael Turquette <[email protected]>
CC Stephen Boyd <[email protected]>
CC Rob Herring <[email protected]>
CC Krzysztof Kozlowski <[email protected]>
CC Philipp Zabel <[email protected]>

Conor Dooley (5):
reset: mpfs: add non-auxiliary bus probing
riscv: dts: microchip: fix mailbox description
riscv: dts: microchip: convert clock and reset to use syscon
MAINTAINERS: add new soc drivers to Microchip RISC-V entry
MAINTAINERS: rename Microchip RISC-V entry

 MAINTAINERS                             |  4 +-
 arch/riscv/boot/dts/microchip/mpfs.dtsi | 34 ++++++---
 drivers/clk/microchip/clk-mpfs.c        |  4 +-
 drivers/reset/Kconfig                   |  1 +
 drivers/reset/reset-mpfs.c              | 92 +++++++++++++++----------
 include/soc/microchip/mpfs.h            |  3 +-
 6 files changed, 88 insertions(+), 50 deletions(-)
Signature · 1 line
2.51.0