mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Changhuang Liang <changhuang.liang@starfivetech.com>
To: Brian Masney <bmasney@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Emil Renner Berthing <kernel@esmil.dk>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org,
	Hal Feng <hal.feng@starfivetech.com>,
	Changhuang Liang <changhuang.liang@starfivetech.com>
Subject: [PATCH v2 0/6] Add System-0 CRG for JHB100 SoC
Date: Wed, 18 Nov 2026 02:05:17 -0800	[thread overview]
Message-ID: <20261118100523.11395-1-changhuang.liang@starfivetech.com> (raw)

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@starfivetech.com/

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@starfivetech.com/

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

             reply	other threads:[~2026-11-18 10:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 10:05 Changhuang Liang [this message]
2026-11-18 10:05 ` [PATCH v2 1/6] clk: starfive: jh7110-sys: Fix memory leak in reset controller register Changhuang Liang
2026-11-18 10:05 ` [PATCH v2 2/6] clk: starfive: jh71x0: Move reset controller registration to jh71x0 common code Changhuang Liang
2026-11-18 10:05 ` [PATCH v2 3/6] clk: starfive: jh71x0: Add generic CRG probe helper Changhuang Liang
2026-11-18 10:05 ` [PATCH v2 4/6] clk: starfive: Add JHB100 System-0 clock generator driver Changhuang Liang
2026-11-18 10:05 ` [PATCH v2 5/6] reset: starfive: jh71x0: Support discontiguous reset IDs Changhuang Liang
2026-11-18 10:39   ` Philipp Zabel
2026-11-18 10:05 ` [PATCH v2 6/6] reset: starfive: Add StarFive JHB100 System-0 reset driver Changhuang Liang
2026-11-18 10:39   ` Philipp Zabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261118100523.11395-1-changhuang.liang@starfivetech.com \
    --to=changhuang.liang@starfivetech.com \
    --cc=bmasney@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=hal.feng@starfivetech.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=kernel@esmil.dk \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®