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 v1 6/6] reset: starfive: Add StarFive JHB100 System-0 reset driver
Date: Tue, 13 Oct 2026 03:27:07 -0700 [thread overview]
Message-ID: <20261013102707.9207-7-changhuang.liang@starfivetech.com> (raw)
In-Reply-To: <20261013102707.9207-1-changhuang.liang@starfivetech.com>
Add the auxiliary reset driver for the StarFive JHB100 SoC. It binds to
the auxiliary devices registered by the JHB100 clock generator drivers
and uses the register base handed over as platform data.
Start with the System-0 clock and reset generator (SYS0CRG). Its reset
IDs do not map one-to-one to the hardware reset bits, so the controller
is registered with a reset ID map.
The other JHB100 reset controllers are added by follow-up patches, each
right after the clock driver of the same CRG.
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
---
MAINTAINERS | 6 ++
drivers/reset/starfive/Kconfig | 9 +++
drivers/reset/starfive/Makefile | 1 +
.../reset/starfive/reset-starfive-jhb100.c | 75 +++++++++++++++++++
4 files changed, 91 insertions(+)
create mode 100644 drivers/reset/starfive/reset-starfive-jhb100.c
diff --git a/MAINTAINERS b/MAINTAINERS
index dff8b819f83e..2d05cf52ea69 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -26230,6 +26230,12 @@ S: Supported
F: Documentation/devicetree/bindings/interrupt-controller/starfive,jhb100-intc.yaml
F: drivers/irqchip/irq-starfive-jhb100-intc.c
+STARFIVE JHB100 RESET CONTROLLER DRIVERS
+M: Changhuang Liang <changhuang.liang@starfivetech.com>
+S: Supported
+F: drivers/reset/starfive/reset-starfive-jhb1*
+F: include/dt-bindings/reset/starfive,jhb1*.h
+
STATIC BRANCH/CALL
M: Peter Zijlstra <peterz@infradead.org>
M: Josh Poimboeuf <jpoimboe@kernel.org>
diff --git a/drivers/reset/starfive/Kconfig b/drivers/reset/starfive/Kconfig
index d832339f61bc..84baefbaee14 100644
--- a/drivers/reset/starfive/Kconfig
+++ b/drivers/reset/starfive/Kconfig
@@ -19,3 +19,12 @@ config RESET_STARFIVE_JH7110
default ARCH_STARFIVE
help
This enables the reset controller driver for the StarFive JH7110 SoC.
+
+config RESET_STARFIVE_JHB100
+ bool "StarFive JHB100 Reset Driver"
+ depends on CLK_STARFIVE_JH71X0 || COMPILE_TEST
+ select AUXILIARY_BUS
+ select RESET_STARFIVE_JH71X0
+ default ARCH_STARFIVE
+ help
+ This enables the reset controller driver for the StarFive JHB100 SoC.
diff --git a/drivers/reset/starfive/Makefile b/drivers/reset/starfive/Makefile
index 7a44b66fb9d5..d781103355d3 100644
--- a/drivers/reset/starfive/Makefile
+++ b/drivers/reset/starfive/Makefile
@@ -3,3 +3,4 @@ obj-$(CONFIG_RESET_STARFIVE_JH71X0) += reset-starfive-jh71x0.o
obj-$(CONFIG_RESET_STARFIVE_JH7100) += reset-starfive-jh7100.o
obj-$(CONFIG_RESET_STARFIVE_JH7110) += reset-starfive-jh7110.o
+obj-$(CONFIG_RESET_STARFIVE_JHB100) += reset-starfive-jhb100.o
diff --git a/drivers/reset/starfive/reset-starfive-jhb100.c b/drivers/reset/starfive/reset-starfive-jhb100.c
new file mode 100644
index 000000000000..129e5e8af251
--- /dev/null
+++ b/drivers/reset/starfive/reset-starfive-jhb100.c
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Reset driver for the StarFive JHB100 SoC
+ *
+ * Copyright (C) 2024 StarFive Technology Co., Ltd.
+ *
+ * Author: Changhuang Liang <changhuang.liang@starfivetech.com>
+ */
+
+#include <dt-bindings/reset/starfive,jhb100-crg.h>
+#include <linux/auxiliary_bus.h>
+#include <soc/starfive/reset-starfive-jh71x0.h>
+
+#include "reset-starfive-jh71x0.h"
+
+static const struct jh71x0_reset_map jhb100_sys0_map[] = {
+ { JHB100_SYS0RST_RESOURCE_ARB, 0 },
+ { JHB100_SYS0RST_SYS0_IOMUX_PRESETN, 3 },
+ { JHB100_SYS0RST_SYS0H_IOMUX_PRESETN, 4 },
+ { JHB100_SYS0RST_RST_ADAPTOR_TIMEOUT_RSTN, 5 },
+ { JHB100_SYS0RST_BMCPCIERP_RSTN_BUS, 14 },
+ { JHB100_SYS0RST_BMCPCIERP_RSTN_CRG, 15 },
+ { JHB100_SYS0RST_HOSTSS0_RSTN_BUS_ESPI, 16 },
+ { JHB100_SYS0RST_HOSTSS0_RSTN_BUS_PCIE, 17 },
+ { JHB100_SYS0RST_HOSTSS0_RSTN_CRG, 18 },
+ { JHB100_SYS0RST_BMCPERIPH2_RSTN_CRG, 19 },
+ { JHB100_SYS0RST_BMCPERIPH2_RSTN_BUS, 20 },
+ { JHB100_SYS0RST_VCE_RSTN_CRG, 21 },
+ { JHB100_SYS0RST_VCE_RSTN_BUS, 22 },
+ { JHB100_SYS0RST_BMCUSB_RSTN_BUS, 23 },
+ { JHB100_SYS0RST_BMCUSB_RSTN_CRG, 24 },
+};
+
+static const struct jh71x0_reset_info jhb100_sys0_info = {
+ .nr_resets = ARRAY_SIZE(jhb100_sys0_map),
+ .assert_offset = 0x12c,
+ .status_offset = 0x130,
+ .discontiguous = true,
+ .map = jhb100_sys0_map,
+};
+
+static int jhb100_reset_probe(struct auxiliary_device *adev,
+ const struct auxiliary_device_id *id)
+{
+ const struct jh71x0_reset_info *info =
+ (const struct jh71x0_reset_info *)(id->driver_data);
+ struct jh71x0_reset_adev *rdev = dev_get_platdata(&adev->dev);
+
+ if (!info || !rdev || !rdev->base)
+ return -ENODEV;
+
+ return reset_starfive_jh71x0_register_with_info(&adev->dev, adev->dev.parent->of_node,
+ rdev->base + info->assert_offset,
+ rdev->base + info->status_offset,
+ NULL, info, NULL);
+}
+
+static const struct auxiliary_device_id jhb100_reset_ids[] = {
+ {
+ .name = "clk_starfive_jh71x0.jhb100-r-sys0",
+ .driver_data = (kernel_ulong_t)&jhb100_sys0_info,
+ },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(auxiliary, jhb100_reset_ids);
+
+static struct auxiliary_driver jhb100_reset_driver = {
+ .probe = jhb100_reset_probe,
+ .id_table = jhb100_reset_ids,
+};
+module_auxiliary_driver(jhb100_reset_driver);
+
+MODULE_AUTHOR("Changhuang Liang <changhuang.liang@starfivetech.com>");
+MODULE_DESCRIPTION("StarFive JHB100 reset driver");
+MODULE_LICENSE("GPL");
--
2.25.1
prev parent reply other threads:[~2026-10-13 10:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 10:27 [PATCH v1 0/6] Add System-0 CRG for JHB100 SoC Changhuang Liang
2026-10-13 10:27 ` [PATCH v1 1/6] clk: starfive: jh7110-sys: Fix memory leak in reset controller register Changhuang Liang
2026-10-13 10:27 ` [PATCH v1 2/6] clk: starfive: jh71x0: Move reset controller registration to jh71x0 common code Changhuang Liang
2026-10-13 10:27 ` [PATCH v1 3/6] clk: starfive: jh71x0: Add generic CRG probe helper Changhuang Liang
2026-10-13 10:27 ` [PATCH v1 4/6] clk: starfive: Add JHB100 System-0 clock generator driver Changhuang Liang
2026-10-13 10:27 ` [PATCH v1 5/6] reset: starfive: jh71x0: Support discontiguous reset IDs Changhuang Liang
2026-10-13 10:27 ` Changhuang Liang [this message]
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=20261013102707.9207-7-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®