[PATCH v2 0/6] Add System-0 CRG for JHB100 SoC

From: Changhuang Liang

Date: Wed Nov 18 2026 - 05:06:03 EST


The JHB100 SoC includes CRG (Clock and Reset Generator) for multiple
subsystems:

The JHB100 SoC is divided into multiple subsystems, and basically
each subsystem includes a CRG(Clock and Reset Generator):
- sys0crg/sys1crg/sys2crg/
- per0crg/per1crg/per2crg/per3crg/
- voutcrg
- vcecrg
- gpu0crg/gpu1crg
- cpucrg
- usbcrg
- host0crg/host1crg
- pcierpcrg
- husb0crg/husb1crg
- husbcmncrg
- husbd0crg/husbd1crg
- npucrg

[1]: https://lore.kernel.org/all/20261008123338.11081-1-changhuang.liang@xxxxxxxxxxxxxxxx/

This is a split of the previously sent large series [1].
The original series had too many patches, and there was a lot of
similar logic among the patches. To reduce the burden of repeating
similar comments and reviews, the original series of patches was
split up and a new series was established.

This series is based on the clk-next branch.

changes since v1:

patch 2:
- Rename struct jh71x0_reset_adev to struct jh71x0_reset_platform_data
- Use devm_kzalloc_obj() to allocate the platform data.
- Add Acked-by from Philipp Zabel.

patch 3:
- Describe each clock parent with a struct jh71x0_parent_data. The clock
table is now made of struct jh71x0_crg_clk_data entries, filled with
JH71X0_EXT_PARENT() and JH71X0_INT_PARENT().
- Drop JH71X0_EXT_CLK_FLAG, JH71X0_EXT_CLK() and the ext_clk/num_ext_clk
members of struct jh71x0_crg_domain_info.
- Use devm_kzalloc_flex() to allocate the private data.

patch 4:
- Describe the parents with JH71X0_EXT_PARENT() and JH71X0_INT_PARENT().
- Drop the external clock name table and the static_assert() on the
size of the clock table.

patch 5:
- Translate the reset ID to the hardware reset line once, in a custom
fwnode_xlate callback.
- Index the map by reset ID and make it a plain array of hardware reset
lines. Drop struct jh71x0_reset_map.
- Drop jh71x0_reset_info::discontiguous, JH71X0_RESET_ID_INVALID and
jh71x0_reset::info. A non-NULL map already tells that the controller
needs the translation.
- Use devm_kzalloc_obj() to allocate the reset data.

patch 6 (in v2):
- Index the reset map by reset ID and drop .discontiguous.
- Depend on ARCH_STARFIVE || COMPILE_TEST instead of CLK_STARFIVE_JH71X0
and drop "default ARCH_STARFIVE", the clock driver implies this driver.
- Use struct jh71x0_reset_platform_data.

v1: https://lore.kernel.org/all/20261013102707.9207-1-changhuang.liang@xxxxxxxxxxxxxxxx/

Changhuang Liang (6):
clk: starfive: jh7110-sys: Fix memory leak in reset controller
register
clk: starfive: jh71x0: Move reset controller registration to jh71x0
common code
clk: starfive: jh71x0: Add generic CRG probe helper
clk: starfive: Add JHB100 System-0 clock generator driver
reset: starfive: jh71x0: Support discontiguous reset IDs
reset: starfive: Add StarFive JHB100 System-0 reset driver

MAINTAINERS | 13 ++
drivers/clk/starfive/Kconfig | 12 +-
drivers/clk/starfive/Makefile | 2 +
.../clk/starfive/clk-starfive-jh7110-aon.c | 2 +-
.../clk/starfive/clk-starfive-jh7110-isp.c | 2 +-
.../clk/starfive/clk-starfive-jh7110-stg.c | 2 +-
.../clk/starfive/clk-starfive-jh7110-sys.c | 57 +-------
.../clk/starfive/clk-starfive-jh7110-vout.c | 2 +-
drivers/clk/starfive/clk-starfive-jh7110.h | 4 -
drivers/clk/starfive/clk-starfive-jh71x0.c | 116 ++++++++++++++-
drivers/clk/starfive/clk-starfive-jh71x0.h | 36 +++++
.../clk/starfive/clk-starfive-jhb100-sys0.c | 137 ++++++++++++++++++
drivers/reset/starfive/Kconfig | 8 +
drivers/reset/starfive/Makefile | 1 +
.../reset/starfive/reset-starfive-jh7110.c | 19 ++-
.../reset/starfive/reset-starfive-jh71x0.c | 60 ++++++++
.../reset/starfive/reset-starfive-jh71x0.h | 24 +++
.../reset/starfive/reset-starfive-jhb100.c | 74 ++++++++++
include/soc/starfive/reset-starfive-jh71x0.h | 12 +-
19 files changed, 498 insertions(+), 85 deletions(-)
create mode 100644 drivers/clk/starfive/clk-starfive-jhb100-sys0.c
create mode 100644 drivers/reset/starfive/reset-starfive-jhb100.c


base-commit: 59841a2d8757b951e8d93f92ffdfaa8c9503435f
--
2.25.1