* [PATCH v5 1/8] dt-bindings: soc: starfive: Add StarFive JHB100 syscon modules
2026-08-28 9:56 [PATCH v5 0/8] Add StarFive JHB100 syscon modules Changhuang Liang
@ 2026-08-28 9:56 ` Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 2/8] clk: starfive: Add system-0 domain PLL clock driver Changhuang Liang
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Changhuang Liang @ 2026-08-28 9:56 UTC (permalink / raw)
To: Michael Turquette, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, Brian Masney, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Philipp Zabel, Emil Renner Berthing
Cc: Chen Wang, Inochi Amaoto, Alexey Charkov, Thomas Bogendoerfer,
Keguang Zhang, linux-clk, linux-kernel, devicetree, linux-riscv,
Changhuang Liang, Hal Feng
Add documentation to describe StarFive JHB100 SoC System Controller
Registers.
Add the PLL clocks for the sys0, per0, and per1 domains under syscon,
as well as the PCIe RP reset.
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
.../soc/starfive/starfive,jhb100-syscon.yaml | 115 ++++++++++++++++++
MAINTAINERS | 5 +
.../dt-bindings/clock/starfive,jhb100-crg.h | 12 ++
.../dt-bindings/reset/starfive,jhb100-crg.h | 3 +
4 files changed, 135 insertions(+)
create mode 100644 Documentation/devicetree/bindings/soc/starfive/starfive,jhb100-syscon.yaml
diff --git a/Documentation/devicetree/bindings/soc/starfive/starfive,jhb100-syscon.yaml b/Documentation/devicetree/bindings/soc/starfive/starfive,jhb100-syscon.yaml
new file mode 100644
index 000000000000..000f53acab34
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/starfive/starfive,jhb100-syscon.yaml
@@ -0,0 +1,115 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/starfive/starfive,jhb100-syscon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: StarFive JHB100 SoC system controller
+
+maintainers:
+ - Kevin Xie <kevin.xie@starfivetech.com>
+ - Changhuang Liang <changhuang.liang@starfivetech.com>
+
+description:
+ The StarFive JHB100 SoC system controller contains MMIO registers used by
+ other hardware modules (e.g., PLL, eMMC, PCIe). These modules access
+ specific register offsets, bit masks, and shifts within the system
+ controller region for configuration and status.
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - starfive,jhb100-b2h-syscon
+ - starfive,jhb100-gpu-syscon
+ - starfive,jhb100-h2b-syscon
+ - starfive,jhb100-host-syscon
+ - starfive,jhb100-husb-syscon
+ - starfive,jhb100-husbcmn-syscon
+ - starfive,jhb100-husbd-syscon
+ - starfive,jhb100-npu-syscon
+ - starfive,jhb100-pcieep-ecsr-syscon
+ - starfive,jhb100-pcierp-ecsr-syscon
+ - starfive,jhb100-pcierp-syscon
+ - starfive,jhb100-per0-syscon
+ - starfive,jhb100-per1-syscon
+ - starfive,jhb100-per2-syscon
+ - starfive,jhb100-per3-syscon
+ - starfive,jhb100-sfc-filter-syscon
+ - starfive,jhb100-strap-syscon
+ - starfive,jhb100-sys0-syscon
+ - starfive,jhb100-sys1-syscon
+ - starfive,jhb100-sys2-syscon
+ - starfive,jhb100-usb-syscon
+ - starfive,jhb100-vout-syscon
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ '#clock-cells':
+ const: 1
+
+ '#reset-cells':
+ const: 1
+
+required:
+ - compatible
+ - reg
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - starfive,jhb100-per0-syscon
+ - starfive,jhb100-per1-syscon
+ - starfive,jhb100-sys0-syscon
+ then:
+ required:
+ - clocks
+ - '#clock-cells'
+ else:
+ properties:
+ clocks: false
+ '#clock-cells': false
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: starfive,jhb100-pcierp-syscon
+ then:
+ required:
+ - '#reset-cells'
+ else:
+ properties:
+ '#reset-cells': false
+
+additionalProperties: false
+
+examples:
+ - |
+ syscon@13010000 {
+ compatible = "starfive,jhb100-sys0-syscon", "syscon";
+ reg = <0x13010000 0x2000>;
+ clocks = <&osc>;
+ #clock-cells = <1>;
+ };
+
+ syscon@13014000 {
+ compatible = "starfive,jhb100-sys1-syscon", "syscon";
+ reg = <0x13014000 0x4000>;
+ };
+
+ syscon@11719000 {
+ compatible = "starfive,jhb100-pcierp-syscon", "syscon";
+ reg = <0x11719000 0x1000>;
+ #reset-cells = <1>;
+ };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 709600e80951..cecb4f279160 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -26094,6 +26094,11 @@ S: Maintained
F: drivers/reset/starfive/reset-starfive-jhb1*
F: include/dt-bindings/reset/starfive,jhb1*.h
+STARFIVE JHB100 SYSCON
+M: Changhuang Liang <changhuang.liang@starfivetech.com>
+S: Maintained
+F: Documentation/devicetree/bindings/soc/starfive/starfive,jhb100-syscon.yaml
+
STATIC BRANCH/CALL
M: Peter Zijlstra <peterz@infradead.org>
M: Josh Poimboeuf <jpoimboe@kernel.org>
diff --git a/include/dt-bindings/clock/starfive,jhb100-crg.h b/include/dt-bindings/clock/starfive,jhb100-crg.h
index bdf7d628b381..4270bfa532e8 100644
--- a/include/dt-bindings/clock/starfive,jhb100-crg.h
+++ b/include/dt-bindings/clock/starfive,jhb100-crg.h
@@ -8,6 +8,18 @@
#ifndef __DT_BINDINGS_CLOCK_STARFIVE_JHB100_H__
#define __DT_BINDINGS_CLOCK_STARFIVE_JHB100_H__
+/* SYS0PLL clocks */
+#define JHB100_SYS0PLL_PLL2_OUT 0
+#define JHB100_SYS0PLL_PLL3_OUT 1
+#define JHB100_SYS0PLL_PLL4_OUT 2
+#define JHB100_SYS0PLL_PLL5_OUT 3
+
+/* PER0PLL clocks */
+#define JHB100_PER0PLL_PLL6_OUT 0
+
+/* PER1PLL clocks */
+#define JHB100_PER1PLL_PLL7_OUT 0
+
/* SYS0CRG clocks */
#define JHB100_SYS0CLK_BMCPCIERP_NCNOC_MAIN 17
#define JHB100_SYS0CLK_BMCPCIERP_NCNOC_CFG 18
diff --git a/include/dt-bindings/reset/starfive,jhb100-crg.h b/include/dt-bindings/reset/starfive,jhb100-crg.h
index 872a4dd25beb..1489bb01c2bd 100644
--- a/include/dt-bindings/reset/starfive,jhb100-crg.h
+++ b/include/dt-bindings/reset/starfive,jhb100-crg.h
@@ -183,4 +183,7 @@
#define JHB100_PER3RST_MAIN_RSTN_PERIPH3_SENSORS 5
#define JHB100_PER3RST_IOMUX_PRESETN 6
+/* PCIERP SYSCON resets */
+#define JHB100_PCIERP_SYSCONRST_PE2RST_OUT 0
+
#endif /* __DT_BINDINGS_RESET_STARFIVE_JHB100_CRG_H__ */
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v5 2/8] clk: starfive: Add system-0 domain PLL clock driver
2026-08-28 9:56 [PATCH v5 0/8] Add StarFive JHB100 syscon modules Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 1/8] dt-bindings: soc: starfive: " Changhuang Liang
@ 2026-08-28 9:56 ` Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 3/8] clk: starfive: Add peripheral-0 " Changhuang Liang
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Changhuang Liang @ 2026-08-28 9:56 UTC (permalink / raw)
To: Michael Turquette, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, Brian Masney, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Philipp Zabel, Emil Renner Berthing
Cc: Chen Wang, Inochi Amaoto, Alexey Charkov, Thomas Bogendoerfer,
Keguang Zhang, linux-clk, linux-kernel, devicetree, linux-riscv,
Changhuang Liang, Hal Feng
Add system-0 domain PLL clock driver for StarFive JHB100 SoC.
This driver is instantiated either as an MFD cell of the sys0 system
controller (added in a later patch) or by matching the per0/per1 syscon
nodes directly.
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Reviewed-by: Xingyu Wu <xingyu.wu@starfivetech.com>
---
drivers/clk/starfive/Kconfig | 10 +
drivers/clk/starfive/Makefile | 1 +
.../clk/starfive/clk-starfive-jhb100-pll.c | 524 ++++++++++++++++++
3 files changed, 535 insertions(+)
create mode 100644 drivers/clk/starfive/clk-starfive-jhb100-pll.c
diff --git a/drivers/clk/starfive/Kconfig b/drivers/clk/starfive/Kconfig
index 852464949334..2603d054173f 100644
--- a/drivers/clk/starfive/Kconfig
+++ b/drivers/clk/starfive/Kconfig
@@ -117,6 +117,16 @@ config CLK_STARFIVE_JHB100_PER3
Say yes here to support the peripheral-3 clock controller
on the StarFive JHB100 SoC.
+config CLK_STARFIVE_JHB100_PLL
+ bool "StarFive JHB100 PLL clock support"
+ depends on ARCH_STARFIVE || COMPILE_TEST
+ select STARFIVE_JHB100_SOCINFO
+ select MFD_SYSCON
+ default ARCH_STARFIVE
+ help
+ Say yes here to support the PLL clock controller on the
+ StarFive JHB100 SoC.
+
config CLK_STARFIVE_JHB100_SYS0
bool "StarFive JHB100 system-0 clock support"
depends on ARCH_STARFIVE || COMPILE_TEST
diff --git a/drivers/clk/starfive/Makefile b/drivers/clk/starfive/Makefile
index f00690f0cdad..547a8c170728 100644
--- a/drivers/clk/starfive/Makefile
+++ b/drivers/clk/starfive/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_CLK_STARFIVE_JHB100_PER0) += clk-starfive-jhb100-per0.o
obj-$(CONFIG_CLK_STARFIVE_JHB100_PER1) += clk-starfive-jhb100-per1.o
obj-$(CONFIG_CLK_STARFIVE_JHB100_PER2) += clk-starfive-jhb100-per2.o
obj-$(CONFIG_CLK_STARFIVE_JHB100_PER3) += clk-starfive-jhb100-per3.o
+obj-$(CONFIG_CLK_STARFIVE_JHB100_PLL) += clk-starfive-jhb100-pll.o
obj-$(CONFIG_CLK_STARFIVE_JHB100_SYS0) += clk-starfive-jhb100-sys0.o
obj-$(CONFIG_CLK_STARFIVE_JHB100_SYS1) += clk-starfive-jhb100-sys1.o
obj-$(CONFIG_CLK_STARFIVE_JHB100_SYS2) += clk-starfive-jhb100-sys2.o
diff --git a/drivers/clk/starfive/clk-starfive-jhb100-pll.c b/drivers/clk/starfive/clk-starfive-jhb100-pll.c
new file mode 100644
index 000000000000..e23365164497
--- /dev/null
+++ b/drivers/clk/starfive/clk-starfive-jhb100-pll.c
@@ -0,0 +1,524 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * StarFive JHB100 PLL Clock Generator Driver
+ *
+ * Copyright (C) 2024 StarFive Technology Co., Ltd.
+ *
+ * Author: Changhuang Liang <changhuang.liang@starfivetech.com>
+ */
+
+#include <linux/bitfield.h>
+#include <linux/bits.h>
+#include <linux/clk-provider.h>
+#include <linux/debugfs.h>
+#include <linux/device.h>
+#include <linux/kernel.h>
+#include <linux/math64.h>
+#include <linux/mfd/syscon.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/units.h>
+
+#include <dt-bindings/clock/starfive,jhb100-crg.h>
+
+/* this driver expects a 25MHz input frequency from the oscillator */
+#define JHB100_PLL_OSC_RATE (25 * HZ_PER_MHZ)
+
+/* System-0 domain PLL */
+#define JHB100_PLL2_OFFSET 0x00
+#define JHB100_PLL3_OFFSET 0x0c
+#define JHB100_PLL4_OFFSET 0x18
+#define JHB100_PLL5_OFFSET 0x24
+
+#define JHB100_PLL_CFG0_OFFSET 0x0
+#define JHB100_PLL_CFG1_OFFSET 0x4
+#define JHB100_PLL_CFG2_OFFSET 0x8
+
+#define JHB100_PLLX_CFG0(offset) ((offset) + JHB100_PLL_CFG0_OFFSET)
+/* fbdiv value should be 16 to 4095 */
+#define JHB100_PLL_FBDIV GENMASK(13, 2)
+#define JHB100_PLL_FOUTPOSTDIV_EN BIT(14)
+#define JHB100_PLL_FOUTVCOP_EN BIT(16)
+
+#define JHB100_PLLX_CFG1(offset) ((offset) + JHB100_PLL_CFG1_OFFSET)
+/* frac value should be decimals multiplied by 2^24 */
+#define JHB100_PLL_FRAC GENMASK(23, 0)
+#define JHB100_PLL_LOCK BIT(24)
+
+#define JHB100_PLLX_CFG2(offset) ((offset) + JHB100_PLL_CFG2_OFFSET)
+#define JHB100_PLL_PD BIT(13)
+#define JHB100_PLL_POSTDIV GENMASK(15, 14)
+#define JHB100_PLL_REFDIV GENMASK(23, 18)
+
+#define JHB100_PLL_TIMEOUT_US 1000
+#define JHB100_PLL_INTERVAL_US 100
+
+struct jhb100_pll_preset {
+ unsigned long freq;
+ u32 frac; /* frac value should be decimals multiplied by 2^24 */
+ unsigned fbdiv : 12; /* fbdiv value should be 16 to 4095 */
+ unsigned refdiv : 6;
+ unsigned postdiv : 2;
+ unsigned foutpostdiv_en : 1;
+ unsigned foutvcop_en : 1;
+};
+
+struct jhb100_pll_info {
+ const char *name;
+ const struct jhb100_pll_preset *presets;
+ unsigned int npresets;
+ unsigned long flags;
+ u8 offset;
+ bool continuous;
+};
+
+#define _JHB100_PLL(_idx, _name, _presets, _npresets, _offset, _flags, _cont) \
+ [_idx] = { \
+ .name = _name, \
+ .offset = _offset, \
+ .presets = _presets, \
+ .npresets = _npresets, \
+ .flags = _flags, \
+ .continuous = _cont, \
+ }
+
+#define JHB100_PLL(idx, name, presets, npresets, offset, cont) \
+ _JHB100_PLL(idx, name, presets, npresets, offset, 0, cont)
+
+struct jhb100_pll_match_data {
+ const struct jhb100_pll_info *pll_info;
+ int num_pll;
+};
+
+struct jhb100_pll_data {
+ struct clk_hw hw;
+ unsigned int idx;
+};
+
+struct jhb100_pll_priv {
+ struct regmap *regmap;
+ const struct jhb100_pll_match_data *match_data;
+ struct jhb100_pll_data pll[];
+};
+
+struct jhb100_pll_regvals {
+ u32 fbdiv;
+ u32 frac;
+ u32 postdiv;
+ u32 refdiv;
+ bool foutpostdiv_en;
+ bool foutvcop_en;
+};
+
+static struct jhb100_pll_data *jhb100_pll_data_from(struct clk_hw *hw)
+{
+ return container_of(hw, struct jhb100_pll_data, hw);
+}
+
+static struct jhb100_pll_priv *jhb100_pll_priv_from(struct jhb100_pll_data *pll)
+{
+ return container_of(pll, struct jhb100_pll_priv, pll[pll->idx]);
+}
+
+static int jhb100_pll_prepare(struct clk_hw *hw)
+{
+ struct jhb100_pll_data *pll = jhb100_pll_data_from(hw);
+ struct jhb100_pll_priv *priv = jhb100_pll_priv_from(pll);
+ const struct jhb100_pll_info *info = &priv->match_data->pll_info[pll->idx];
+
+ return regmap_update_bits(priv->regmap, JHB100_PLLX_CFG2(info->offset),
+ JHB100_PLL_PD, 0);
+}
+
+static void jhb100_pll_unprepare(struct clk_hw *hw)
+{
+ struct jhb100_pll_data *pll = jhb100_pll_data_from(hw);
+ struct jhb100_pll_priv *priv = jhb100_pll_priv_from(pll);
+ const struct jhb100_pll_info *info = &priv->match_data->pll_info[pll->idx];
+
+ regmap_update_bits(priv->regmap, JHB100_PLLX_CFG2(info->offset),
+ JHB100_PLL_PD, JHB100_PLL_PD);
+}
+
+static int jhb100_pll_is_prepared(struct clk_hw *hw)
+{
+ struct jhb100_pll_data *pll = jhb100_pll_data_from(hw);
+ struct jhb100_pll_priv *priv = jhb100_pll_priv_from(pll);
+ const struct jhb100_pll_info *info = &priv->match_data->pll_info[pll->idx];
+ u32 val;
+ int ret;
+
+ ret = regmap_read(priv->regmap, JHB100_PLLX_CFG2(info->offset), &val);
+ if (ret)
+ return ret;
+
+ return !(val & JHB100_PLL_PD);
+}
+
+static int jhb100_pll_regvals_get(struct regmap *regmap,
+ const struct jhb100_pll_info *info,
+ struct jhb100_pll_regvals *val)
+{
+ u32 value;
+ int ret;
+
+ ret = regmap_read(regmap, JHB100_PLLX_CFG0(info->offset), &value);
+ if (ret)
+ return ret;
+
+ val->fbdiv = FIELD_GET(JHB100_PLL_FBDIV, value);
+ val->foutpostdiv_en = !!FIELD_GET(JHB100_PLL_FOUTPOSTDIV_EN, value);
+ val->foutvcop_en = !!FIELD_GET(JHB100_PLL_FOUTVCOP_EN, value);
+
+ ret = regmap_read(regmap, JHB100_PLLX_CFG1(info->offset), &value);
+ if (ret)
+ return ret;
+
+ val->frac = FIELD_GET(JHB100_PLL_FRAC, value);
+
+ ret = regmap_read(regmap, JHB100_PLLX_CFG2(info->offset), &value);
+ if (ret)
+ return ret;
+
+ val->postdiv = FIELD_GET(JHB100_PLL_POSTDIV, value);
+ val->refdiv = FIELD_GET(JHB100_PLL_REFDIV, value);
+
+ return 0;
+}
+
+static unsigned long jhb100_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
+{
+ struct jhb100_pll_data *pll = jhb100_pll_data_from(hw);
+ struct jhb100_pll_priv *priv = jhb100_pll_priv_from(pll);
+ struct jhb100_pll_regvals val;
+ u32 power = 0;
+ u64 rate;
+ int ret;
+
+ ret = jhb100_pll_regvals_get(priv->regmap, &priv->match_data->pll_info[pll->idx], &val);
+ if (ret)
+ return 0;
+
+ /*
+ *
+ * if (foutvcop_en)
+ * rate = parent * (fbdiv + frac / 2^24) / refdiv
+ *
+ * if (foutpostdiv_en)
+ * rate = parent * (fbdiv + frac / 2^24) / refdiv / 2^(postdiv + 1)
+ *
+ * parent * (fbdiv + frac / 2^24) = parent * fbdiv + parent * frac / 2^24
+ */
+
+ if (!!val.foutvcop_en == !!val.foutpostdiv_en || !val.refdiv)
+ return 0;
+
+ rate = mul_u32_u32(parent_rate, val.frac) >> 24;
+
+ if (val.foutpostdiv_en)
+ power = val.postdiv + 1;
+
+ rate += mul_u32_u32(parent_rate, val.fbdiv);
+ rate = div_u64(rate, (u64)val.refdiv << power);
+
+ return rate;
+}
+
+static int jhb100_pll_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
+{
+ struct jhb100_pll_data *pll = jhb100_pll_data_from(hw);
+ struct jhb100_pll_priv *priv = jhb100_pll_priv_from(pll);
+ const struct jhb100_pll_info *info = &priv->match_data->pll_info[pll->idx];
+ const struct jhb100_pll_preset *selected = &info->presets[0];
+ unsigned int idx;
+
+ /* if the parent rate doesn't match our expectations the presets won't work */
+ if (req->best_parent_rate != JHB100_PLL_OSC_RATE) {
+ req->rate = jhb100_pll_recalc_rate(hw, req->best_parent_rate);
+ return 0;
+ }
+
+ /* continuous means support any rate */
+ if (info->continuous)
+ return 0;
+
+ /* find highest rate lower or equal to the requested rate */
+ for (idx = 1; idx < info->npresets; idx++) {
+ const struct jhb100_pll_preset *val = &info->presets[idx];
+
+ if (req->rate < val->freq)
+ break;
+
+ selected = val;
+ }
+
+ req->rate = selected->freq;
+
+ return 0;
+}
+
+static int jhb100_pll_set_preset(struct clk_hw *hw, const struct jhb100_pll_preset *val)
+{
+ struct jhb100_pll_data *pll = jhb100_pll_data_from(hw);
+ struct jhb100_pll_priv *priv = jhb100_pll_priv_from(pll);
+ const struct jhb100_pll_info *info = &priv->match_data->pll_info[pll->idx];
+ unsigned int value, cfg;
+ int ret;
+
+ cfg = FIELD_PREP(JHB100_PLL_FBDIV, (u32)val->fbdiv) |
+ FIELD_PREP(JHB100_PLL_FOUTPOSTDIV_EN, (u32)val->foutpostdiv_en) |
+ FIELD_PREP(JHB100_PLL_FOUTVCOP_EN, (u32)val->foutvcop_en);
+
+ ret = regmap_update_bits(priv->regmap, JHB100_PLLX_CFG0(info->offset),
+ JHB100_PLL_FBDIV | JHB100_PLL_FOUTPOSTDIV_EN |
+ JHB100_PLL_FOUTVCOP_EN, cfg);
+ if (ret)
+ return ret;
+
+ ret = regmap_update_bits(priv->regmap, JHB100_PLLX_CFG1(info->offset), JHB100_PLL_FRAC,
+ FIELD_PREP(JHB100_PLL_FRAC, val->frac));
+ if (ret)
+ return ret;
+
+ cfg = FIELD_PREP(JHB100_PLL_REFDIV, (u32)val->refdiv) |
+ FIELD_PREP(JHB100_PLL_POSTDIV, (u32)val->postdiv);
+
+ ret = regmap_update_bits(priv->regmap, JHB100_PLLX_CFG2(info->offset),
+ JHB100_PLL_REFDIV | JHB100_PLL_POSTDIV, cfg);
+ if (ret)
+ return ret;
+
+ /* waiting for PLL to lock */
+ return regmap_read_poll_timeout(priv->regmap, JHB100_PLLX_CFG1(info->offset),
+ value, value & JHB100_PLL_LOCK,
+ JHB100_PLL_INTERVAL_US,
+ JHB100_PLL_TIMEOUT_US);
+}
+
+static int jhb100_pll_rate_to_preset(struct clk_hw *hw, unsigned long rate,
+ unsigned long parent_rate)
+{
+ struct jhb100_pll_preset val = {
+ .refdiv = 1,
+ .postdiv = 3,
+ .foutpostdiv_en = 1,
+ .foutvcop_en = 0,
+ };
+ unsigned int power = 0;
+ u64 fbdiv_24, t;
+ u32 fbdiv;
+
+ if (val.foutpostdiv_en)
+ power = val.postdiv + 1;
+
+ t = (u64)val.refdiv << power;
+ t *= rate;
+
+ fbdiv = div64_ul(t, parent_rate);
+ if (fbdiv < 16 || fbdiv > 4095)
+ return -EINVAL;
+ val.fbdiv = fbdiv;
+
+ fbdiv_24 = div64_ul(t << 24, parent_rate);
+ val.frac = fbdiv_24 - ((u64)fbdiv << 24);
+
+ return jhb100_pll_set_preset(hw, &val);
+}
+
+static int jhb100_pll_set_rate(struct clk_hw *hw, unsigned long rate,
+ unsigned long parent_rate)
+{
+ struct jhb100_pll_data *pll = jhb100_pll_data_from(hw);
+ struct jhb100_pll_priv *priv = jhb100_pll_priv_from(pll);
+ const struct jhb100_pll_info *info = &priv->match_data->pll_info[pll->idx];
+ const struct jhb100_pll_preset *val;
+ unsigned int idx;
+
+ /* if the parent rate doesn't match our expectations the presets won't work */
+ if (parent_rate != JHB100_PLL_OSC_RATE)
+ return -EINVAL;
+
+ if (info->continuous)
+ return jhb100_pll_rate_to_preset(hw, rate, parent_rate);
+
+ for (idx = 0, val = &info->presets[0]; idx < info->npresets; idx++, val++) {
+ if (val->freq == rate)
+ return jhb100_pll_set_preset(hw, val);
+ }
+
+ return -EINVAL;
+}
+
+#ifdef CONFIG_DEBUG_FS
+static int jhb100_pll_registers_show(struct seq_file *s, void *unused)
+{
+ struct jhb100_pll_data *pll = s->private;
+ struct jhb100_pll_priv *priv = jhb100_pll_priv_from(pll);
+ struct jhb100_pll_regvals val;
+ int ret;
+
+ ret = jhb100_pll_regvals_get(priv->regmap, &priv->match_data->pll_info[pll->idx], &val);
+ if (ret)
+ return ret;
+
+ seq_printf(s, "fbdiv=%u\n"
+ "frac=%u\n"
+ "refdiv=%u\n"
+ "postdiv=%u\n"
+ "foutpostdiv_en=%u\n"
+ "foutvcop_en=%u\n",
+ val.fbdiv, val.frac, val.refdiv, val.postdiv,
+ val.foutpostdiv_en, val.foutvcop_en);
+
+ return 0;
+}
+
+DEFINE_SHOW_ATTRIBUTE(jhb100_pll_registers);
+
+static void jhb100_pll_debug_init(struct clk_hw *hw, struct dentry *dentry)
+{
+ struct jhb100_pll_data *pll = jhb100_pll_data_from(hw);
+
+ debugfs_create_file("registers", 0400, dentry, pll,
+ &jhb100_pll_registers_fops);
+}
+#else
+#define jhb100_pll_debug_init NULL
+#endif
+
+static const struct clk_ops jhb100_pll_ops = {
+ .prepare = jhb100_pll_prepare,
+ .unprepare = jhb100_pll_unprepare,
+ .is_prepared = jhb100_pll_is_prepared,
+ .recalc_rate = jhb100_pll_recalc_rate,
+ .determine_rate = jhb100_pll_determine_rate,
+ .set_rate = jhb100_pll_set_rate,
+ .debug_init = jhb100_pll_debug_init,
+};
+
+static struct clk_hw *jhb100_pll_get(struct of_phandle_args *clkspec, void *data)
+{
+ struct jhb100_pll_priv *priv = data;
+ unsigned int idx = clkspec->args[0];
+
+ if (idx < priv->match_data->num_pll)
+ return &priv->pll[idx].hw;
+
+ return ERR_PTR(-EINVAL);
+}
+
+static int jhb100_pll_probe(struct platform_device *pdev)
+{
+ const struct jhb100_pll_match_data *match_data;
+ const struct platform_device_id *id;
+ struct device *dev = &pdev->dev;
+ struct jhb100_pll_priv *priv;
+ struct device_node *np;
+ unsigned int idx;
+ int ret;
+
+ id = platform_get_device_id(pdev);
+ if (!id)
+ return dev_err_probe(dev, -EINVAL, "no match data\n");
+
+ /*
+ * Instantiated as an MFD cell of the sys0 system controller,
+ * which owns the DT node describing the PLL registers.
+ */
+ match_data = (const struct jhb100_pll_match_data *)id->driver_data;
+ np = dev_of_node(dev->parent);
+
+ priv = devm_kzalloc(&pdev->dev, struct_size(priv, pll, match_data->num_pll),
+ GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ priv->match_data = match_data;
+ priv->regmap = syscon_node_to_regmap(np);
+ if (IS_ERR(priv->regmap))
+ return dev_err_probe(dev, PTR_ERR(priv->regmap),
+ "failed to get syscon regmap\n");
+
+ for (idx = 0; idx < match_data->num_pll; idx++) {
+ struct clk_parent_data parents = {
+ .index = 0,
+ };
+ struct clk_init_data init = {
+ .name = match_data->pll_info[idx].name,
+ .ops = &jhb100_pll_ops,
+ .parent_data = &parents,
+ .num_parents = 1,
+ .flags = match_data->pll_info[idx].flags,
+ };
+ struct jhb100_pll_data *pll = &priv->pll[idx];
+
+ pll->hw.init = &init;
+ pll->idx = idx;
+
+ ret = devm_clk_hw_register(dev, &pll->hw);
+ if (ret)
+ return ret;
+ }
+
+ return devm_of_clk_add_hw_provider(dev, jhb100_pll_get, priv);
+}
+
+static const struct jhb100_pll_preset jhb100_pll2_presets[] = {
+ {
+ .freq = 903168000,
+ .fbdiv = 72,
+ .frac = 4252017,
+ .refdiv = 1,
+ .postdiv = 0,
+ .foutpostdiv_en = 1,
+ .foutvcop_en = 0,
+ },
+};
+
+static const struct jhb100_pll_preset jhb100_pll3_presets[] = {
+ {
+ .freq = 800000000,
+ .fbdiv = 64,
+ .frac = 0,
+ .refdiv = 1,
+ .postdiv = 0,
+ .foutpostdiv_en = 1,
+ .foutvcop_en = 0,
+ },
+};
+
+static const struct jhb100_pll_info jhb100_sys0_pll_info[] = {
+ JHB100_PLL(JHB100_SYS0PLL_PLL2_OUT, "pll2_out", jhb100_pll2_presets,
+ ARRAY_SIZE(jhb100_pll2_presets), JHB100_PLL2_OFFSET, false),
+ _JHB100_PLL(JHB100_SYS0PLL_PLL3_OUT, "pll3_out", jhb100_pll3_presets,
+ ARRAY_SIZE(jhb100_pll3_presets), JHB100_PLL3_OFFSET,
+ CLK_IS_CRITICAL, false),
+ _JHB100_PLL(JHB100_SYS0PLL_PLL4_OUT, "pll4_out", NULL, 0,
+ JHB100_PLL4_OFFSET, CLK_IGNORE_UNUSED, true),
+ _JHB100_PLL(JHB100_SYS0PLL_PLL5_OUT, "pll5_out", NULL, 0,
+ JHB100_PLL5_OFFSET, CLK_IGNORE_UNUSED, true),
+};
+
+static const struct jhb100_pll_match_data jhb100_sys0_pll = {
+ .pll_info = jhb100_sys0_pll_info,
+ .num_pll = ARRAY_SIZE(jhb100_sys0_pll_info),
+};
+
+static const struct platform_device_id jhb100_pll_ids[] = {
+ {
+ .name = "jhb100-sys0-pll",
+ .driver_data = (unsigned long)&jhb100_sys0_pll,
+ },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(platform, jhb100_pll_ids);
+
+static struct platform_driver jhb100_pll_driver = {
+ .probe = jhb100_pll_probe,
+ .id_table = jhb100_pll_ids,
+ .driver = {
+ .name = "clk-starfive-jhb100-pll",
+ .suppress_bind_attrs = true,
+ },
+};
+builtin_platform_driver(jhb100_pll_driver);
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v5 3/8] clk: starfive: Add peripheral-0 domain PLL clock driver
2026-08-28 9:56 [PATCH v5 0/8] Add StarFive JHB100 syscon modules Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 1/8] dt-bindings: soc: starfive: " Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 2/8] clk: starfive: Add system-0 domain PLL clock driver Changhuang Liang
@ 2026-08-28 9:56 ` Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 4/8] clk: starfive: Add Peripheral-1 " Changhuang Liang
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Changhuang Liang @ 2026-08-28 9:56 UTC (permalink / raw)
To: Michael Turquette, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, Brian Masney, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Philipp Zabel, Emil Renner Berthing
Cc: Chen Wang, Inochi Amaoto, Alexey Charkov, Thomas Bogendoerfer,
Keguang Zhang, linux-clk, linux-kernel, devicetree, linux-riscv,
Changhuang Liang, Hal Feng
Add peripheral-0 domain PLL clock driver support for StarFive JHB100
SoC.
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Reviewed-by: Xingyu Wu <xingyu.wu@starfivetech.com>
---
.../clk/starfive/clk-starfive-jhb100-pll.c | 60 +++++++++++++++----
1 file changed, 50 insertions(+), 10 deletions(-)
diff --git a/drivers/clk/starfive/clk-starfive-jhb100-pll.c b/drivers/clk/starfive/clk-starfive-jhb100-pll.c
index e23365164497..f6ebaaf5aa18 100644
--- a/drivers/clk/starfive/clk-starfive-jhb100-pll.c
+++ b/drivers/clk/starfive/clk-starfive-jhb100-pll.c
@@ -30,6 +30,9 @@
#define JHB100_PLL4_OFFSET 0x18
#define JHB100_PLL5_OFFSET 0x24
+/* Peripheral-0 domain PLL */
+#define JHB100_PLL6_OFFSET 0x00
+
#define JHB100_PLL_CFG0_OFFSET 0x0
#define JHB100_PLL_CFG1_OFFSET 0x4
#define JHB100_PLL_CFG2_OFFSET 0x8
@@ -417,16 +420,21 @@ static int jhb100_pll_probe(struct platform_device *pdev)
unsigned int idx;
int ret;
- id = platform_get_device_id(pdev);
- if (!id)
- return dev_err_probe(dev, -EINVAL, "no match data\n");
-
- /*
- * Instantiated as an MFD cell of the sys0 system controller,
- * which owns the DT node describing the PLL registers.
- */
- match_data = (const struct jhb100_pll_match_data *)id->driver_data;
- np = dev_of_node(dev->parent);
+ match_data = device_get_match_data(dev);
+ if (match_data) {
+ np = dev_of_node(dev);
+ } else {
+ id = platform_get_device_id(pdev);
+ if (!id)
+ return dev_err_probe(dev, -EINVAL, "no match data\n");
+
+ /*
+ * Instantiated as an MFD cell of the sys0 system controller,
+ * which owns the DT node describing the PLL registers.
+ */
+ match_data = (const struct jhb100_pll_match_data *)id->driver_data;
+ np = dev_of_node(dev->parent);
+ }
priv = devm_kzalloc(&pdev->dev, struct_size(priv, pll, match_data->num_pll),
GFP_KERNEL);
@@ -504,6 +512,28 @@ static const struct jhb100_pll_match_data jhb100_sys0_pll = {
.num_pll = ARRAY_SIZE(jhb100_sys0_pll_info),
};
+static const struct jhb100_pll_preset jhb100_pll6_presets[] = {
+ {
+ .freq = 2400000000,
+ .fbdiv = 192,
+ .frac = 0,
+ .refdiv = 1,
+ .postdiv = 0,
+ .foutpostdiv_en = 1,
+ .foutvcop_en = 0,
+ },
+};
+
+static const struct jhb100_pll_info jhb100_per0_pll_info[] = {
+ JHB100_PLL(JHB100_PER0PLL_PLL6_OUT, "pll6_out", jhb100_pll6_presets,
+ ARRAY_SIZE(jhb100_pll6_presets), JHB100_PLL6_OFFSET, false),
+};
+
+static const struct jhb100_pll_match_data jhb100_per0_pll = {
+ .pll_info = jhb100_per0_pll_info,
+ .num_pll = ARRAY_SIZE(jhb100_per0_pll_info),
+};
+
static const struct platform_device_id jhb100_pll_ids[] = {
{
.name = "jhb100-sys0-pll",
@@ -513,11 +543,21 @@ static const struct platform_device_id jhb100_pll_ids[] = {
};
MODULE_DEVICE_TABLE(platform, jhb100_pll_ids);
+static const struct of_device_id jhb100_pll_match[] = {
+ {
+ .compatible = "starfive,jhb100-per0-syscon",
+ .data = &jhb100_per0_pll,
+ },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, jhb100_pll_match);
+
static struct platform_driver jhb100_pll_driver = {
.probe = jhb100_pll_probe,
.id_table = jhb100_pll_ids,
.driver = {
.name = "clk-starfive-jhb100-pll",
+ .of_match_table = jhb100_pll_match,
.suppress_bind_attrs = true,
},
};
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v5 4/8] clk: starfive: Add Peripheral-1 domain PLL clock driver
2026-08-28 9:56 [PATCH v5 0/8] Add StarFive JHB100 syscon modules Changhuang Liang
` (2 preceding siblings ...)
2026-08-28 9:56 ` [PATCH v5 3/8] clk: starfive: Add peripheral-0 " Changhuang Liang
@ 2026-08-28 9:56 ` Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 5/8] reset: starfive: Introduce active_low Changhuang Liang
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Changhuang Liang @ 2026-08-28 9:56 UTC (permalink / raw)
To: Michael Turquette, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, Brian Masney, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Philipp Zabel, Emil Renner Berthing
Cc: Chen Wang, Inochi Amaoto, Alexey Charkov, Thomas Bogendoerfer,
Keguang Zhang, linux-clk, linux-kernel, devicetree, linux-riscv,
Changhuang Liang, Hal Feng
Add Peripheral-1 domain PLL clock driver support for StarFive JHB100 SoC.
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Reviewed-by: Xingyu Wu <xingyu.wu@starfivetech.com>
---
.../clk/starfive/clk-starfive-jhb100-pll.c | 29 +++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/clk/starfive/clk-starfive-jhb100-pll.c b/drivers/clk/starfive/clk-starfive-jhb100-pll.c
index f6ebaaf5aa18..eb91131857f1 100644
--- a/drivers/clk/starfive/clk-starfive-jhb100-pll.c
+++ b/drivers/clk/starfive/clk-starfive-jhb100-pll.c
@@ -33,6 +33,9 @@
/* Peripheral-0 domain PLL */
#define JHB100_PLL6_OFFSET 0x00
+/* Peripheral-1 domain PLL */
+#define JHB100_PLL7_OFFSET 0x40
+
#define JHB100_PLL_CFG0_OFFSET 0x0
#define JHB100_PLL_CFG1_OFFSET 0x4
#define JHB100_PLL_CFG2_OFFSET 0x8
@@ -534,6 +537,28 @@ static const struct jhb100_pll_match_data jhb100_per0_pll = {
.num_pll = ARRAY_SIZE(jhb100_per0_pll_info),
};
+static const struct jhb100_pll_preset jhb100_pll7_presets[] = {
+ {
+ .freq = 1950000000,
+ .fbdiv = 156,
+ .frac = 0,
+ .refdiv = 1,
+ .postdiv = 0,
+ .foutpostdiv_en = 1,
+ .foutvcop_en = 0,
+ },
+};
+
+static const struct jhb100_pll_info jhb100_per1_pll_info[] = {
+ JHB100_PLL(JHB100_PER1PLL_PLL7_OUT, "pll7_out", jhb100_pll7_presets,
+ ARRAY_SIZE(jhb100_pll7_presets), JHB100_PLL7_OFFSET, false),
+};
+
+static const struct jhb100_pll_match_data jhb100_per1_pll = {
+ .pll_info = jhb100_per1_pll_info,
+ .num_pll = ARRAY_SIZE(jhb100_per1_pll_info),
+};
+
static const struct platform_device_id jhb100_pll_ids[] = {
{
.name = "jhb100-sys0-pll",
@@ -548,6 +573,10 @@ static const struct of_device_id jhb100_pll_match[] = {
.compatible = "starfive,jhb100-per0-syscon",
.data = &jhb100_per0_pll,
},
+ {
+ .compatible = "starfive,jhb100-per1-syscon",
+ .data = &jhb100_per1_pll,
+ },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, jhb100_pll_match);
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v5 5/8] reset: starfive: Introduce active_low
2026-08-28 9:56 [PATCH v5 0/8] Add StarFive JHB100 syscon modules Changhuang Liang
` (3 preceding siblings ...)
2026-08-28 9:56 ` [PATCH v5 4/8] clk: starfive: Add Peripheral-1 " Changhuang Liang
@ 2026-08-28 9:56 ` Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 6/8] reset: starfive: Add syscon reset driver support Changhuang Liang
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Changhuang Liang @ 2026-08-28 9:56 UTC (permalink / raw)
To: Michael Turquette, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, Brian Masney, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Philipp Zabel, Emil Renner Berthing
Cc: Chen Wang, Inochi Amaoto, Alexey Charkov, Thomas Bogendoerfer,
Keguang Zhang, linux-clk, linux-kernel, devicetree, linux-riscv,
Changhuang Liang, Hal Feng
The JHB100 SoC supports inverted operations for reset
assertion/deassertion, introducing an active_low field to distinguish
between different operation logics.
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
---
drivers/reset/starfive/reset-starfive-common.c | 6 +++++-
drivers/reset/starfive/reset-starfive-common.h | 6 ++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/reset/starfive/reset-starfive-common.c b/drivers/reset/starfive/reset-starfive-common.c
index 86dbb33bb216..7723520637ca 100644
--- a/drivers/reset/starfive/reset-starfive-common.c
+++ b/drivers/reset/starfive/reset-starfive-common.c
@@ -52,12 +52,16 @@ static int starfive_reset_update(struct reset_controller_dev *rcdev,
unsigned long id, bool assert)
{
struct starfive_reset *data = starfive_reset_from(rcdev);
+ bool active_low = data->info && data->info->active_low;
unsigned long offset, flags;
void __iomem *reg_assert;
void __iomem *reg_status;
u32 mask, done, value;
int ret;
+ if (active_low)
+ assert = !assert;
+
if (data->info && data->info->discontiguous) {
id = starfive_reset_id_to_hw_id(data->info->map, data->info->nr_resets, id);
if (id == STARFIVE_RESET_ID_INVALID)
@@ -70,7 +74,7 @@ static int starfive_reset_update(struct reset_controller_dev *rcdev,
reg_status = data->status + offset * sizeof(u32);
done = data->asserted ? data->asserted[offset] & mask : 0;
- if (!assert)
+ if (active_low == assert)
done ^= mask;
spin_lock_irqsave(&data->lock, flags);
diff --git a/drivers/reset/starfive/reset-starfive-common.h b/drivers/reset/starfive/reset-starfive-common.h
index 0d4e634de58e..c7f80e744700 100644
--- a/drivers/reset/starfive/reset-starfive-common.h
+++ b/drivers/reset/starfive/reset-starfive-common.h
@@ -15,6 +15,12 @@ struct starfive_reset_info {
unsigned int nr_resets;
unsigned int assert_offset;
unsigned int status_offset;
+
+ /* If active_low is false, setting the bit to 1 asserts
+ * the signal while clearing it to 0 deasserts it, and vice
+ * versa.
+ */
+ bool active_low;
bool discontiguous;
const struct starfive_reset_map *map;
};
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v5 6/8] reset: starfive: Add syscon reset driver support
2026-08-28 9:56 [PATCH v5 0/8] Add StarFive JHB100 syscon modules Changhuang Liang
` (4 preceding siblings ...)
2026-08-28 9:56 ` [PATCH v5 5/8] reset: starfive: Introduce active_low Changhuang Liang
@ 2026-08-28 9:56 ` Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 7/8] soc: starfive: Add socinfo driver for JHB100 SoC Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 8/8] riscv: dts: starfive: jhb100: Add syscon nodes Changhuang Liang
7 siblings, 0 replies; 9+ messages in thread
From: Changhuang Liang @ 2026-08-28 9:56 UTC (permalink / raw)
To: Michael Turquette, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, Brian Masney, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Philipp Zabel, Emil Renner Berthing
Cc: Chen Wang, Inochi Amaoto, Alexey Charkov, Thomas Bogendoerfer,
Keguang Zhang, linux-clk, linux-kernel, devicetree, linux-riscv,
Changhuang Liang, Hal Feng
Add syscon reset driver for JHB100 SoC.
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
---
drivers/reset/starfive/Kconfig | 9 +++
drivers/reset/starfive/Makefile | 1 +
.../starfive/reset-starfive-jhb100-syscon.c | 62 +++++++++++++++++++
3 files changed, 72 insertions(+)
create mode 100644 drivers/reset/starfive/reset-starfive-jhb100-syscon.c
diff --git a/drivers/reset/starfive/Kconfig b/drivers/reset/starfive/Kconfig
index ce00495be6ad..d96cfb59f51c 100644
--- a/drivers/reset/starfive/Kconfig
+++ b/drivers/reset/starfive/Kconfig
@@ -28,3 +28,12 @@ config RESET_STARFIVE_JHB100
default ARCH_STARFIVE
help
This enables the reset controller driver for the StarFive JHB100 SoC.
+
+config RESET_STARFIVE_JHB100_SYSCON
+ tristate "StarFive JHB100 SYSCON Reset Driver"
+ depends on ARCH_STARFIVE || COMPILE_TEST
+ select RESET_STARFIVE_COMMON
+ default m if ARCH_STARFIVE
+ help
+ This enables the SYSCON reset controller driver for the StarFive
+ JHB100 SoC.
diff --git a/drivers/reset/starfive/Makefile b/drivers/reset/starfive/Makefile
index 217002302a9f..d5033d723167 100644
--- a/drivers/reset/starfive/Makefile
+++ b/drivers/reset/starfive/Makefile
@@ -4,3 +4,4 @@ obj-$(CONFIG_RESET_STARFIVE_COMMON) += reset-starfive-common.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
+obj-$(CONFIG_RESET_STARFIVE_JHB100_SYSCON) += reset-starfive-jhb100-syscon.o
diff --git a/drivers/reset/starfive/reset-starfive-jhb100-syscon.c b/drivers/reset/starfive/reset-starfive-jhb100-syscon.c
new file mode 100644
index 000000000000..55d84e6ad2a8
--- /dev/null
+++ b/drivers/reset/starfive/reset-starfive-jhb100-syscon.c
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * SYSCON Reset driver for the StarFive JHB100 SoC
+ *
+ * Copyright (C) 2025 StarFive Technology Co., Ltd.
+ */
+
+#include <dt-bindings/reset/starfive,jhb100-crg.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <soc/starfive/reset-starfive-common.h>
+
+#include "reset-starfive-common.h"
+
+static const struct starfive_reset_info jhb100_pcierp_info = {
+ .nr_resets = (JHB100_PCIERP_SYSCONRST_PE2RST_OUT + 1),
+ .assert_offset = 0x14c,
+ .status_offset = 0x14c,
+ .discontiguous = false,
+ .active_low = true,
+};
+
+static int jhb100_syscon_reset_probe(struct platform_device *pdev)
+{
+ struct starfive_reset_info *info;
+ void __iomem *base;
+
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
+ info = (struct starfive_reset_info *)of_device_get_match_data(&pdev->dev);
+ if (!info)
+ return -ENODEV;
+
+ return reset_starfive_register_with_info(&pdev->dev, pdev->dev.of_node,
+ base + info->assert_offset,
+ base + info->status_offset,
+ NULL, info, THIS_MODULE);
+}
+
+static const struct of_device_id jhb100_syscon_reset_dt_ids[] = {
+ {
+ .compatible = "starfive,jhb100-pcierp-syscon",
+ .data = &jhb100_pcierp_info,
+ },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, jhb100_syscon_reset_dt_ids);
+
+static struct platform_driver jhb100_syscon_reset_driver = {
+ .probe = jhb100_syscon_reset_probe,
+ .driver = {
+ .name = "jhb100-syscon-reset",
+ .of_match_table = jhb100_syscon_reset_dt_ids,
+ },
+};
+module_platform_driver(jhb100_syscon_reset_driver);
+
+MODULE_AUTHOR("Changhuang Liang <changhuang.liang@starfivetech.com>");
+MODULE_DESCRIPTION("StarFive JHB100 SYSCON reset driver");
+MODULE_LICENSE("GPL");
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v5 7/8] soc: starfive: Add socinfo driver for JHB100 SoC
2026-08-28 9:56 [PATCH v5 0/8] Add StarFive JHB100 syscon modules Changhuang Liang
` (5 preceding siblings ...)
2026-08-28 9:56 ` [PATCH v5 6/8] reset: starfive: Add syscon reset driver support Changhuang Liang
@ 2026-08-28 9:56 ` Changhuang Liang
2026-08-28 9:56 ` [PATCH v5 8/8] riscv: dts: starfive: jhb100: Add syscon nodes Changhuang Liang
7 siblings, 0 replies; 9+ messages in thread
From: Changhuang Liang @ 2026-08-28 9:56 UTC (permalink / raw)
To: Michael Turquette, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, Brian Masney, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Philipp Zabel, Emil Renner Berthing
Cc: Chen Wang, Inochi Amaoto, Alexey Charkov, Thomas Bogendoerfer,
Keguang Zhang, linux-clk, linux-kernel, devicetree, linux-riscv,
Changhuang Liang, Hal Feng
Add a socinfo driver for the JHB100 SoC, exposing the SoC family, ID and
revision through the SoC bus. It is currently used to distinguish the two
revisions, A0 and A1.
The driver binds to the sys0 system controller node. That region only
contains the PLL controls, this revision ID register and a few debug
registers, so rather than describing an extra child node in the
devicetree, the sys0 PLL device is instantiated from here as an MFD cell.
The PLL driver then picks up the regmap from its parent's DT node.
Note that CONFIG_STARFIVE_JHB100_SOCINFO is therefore a build-time
prerequisite for the sys0 PLL clocks; see CLK_STARFIVE_JHB100_PLL.
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
---
MAINTAINERS | 6 +
drivers/soc/Kconfig | 1 +
drivers/soc/Makefile | 1 +
drivers/soc/starfive/Kconfig | 6 +
drivers/soc/starfive/Makefile | 2 +
drivers/soc/starfive/socinfo/Kconfig | 13 +++
drivers/soc/starfive/socinfo/Makefile | 2 +
drivers/soc/starfive/socinfo/jhb100-socinfo.c | 105 ++++++++++++++++++
8 files changed, 136 insertions(+)
create mode 100644 drivers/soc/starfive/Kconfig
create mode 100644 drivers/soc/starfive/Makefile
create mode 100644 drivers/soc/starfive/socinfo/Kconfig
create mode 100644 drivers/soc/starfive/socinfo/Makefile
create mode 100644 drivers/soc/starfive/socinfo/jhb100-socinfo.c
diff --git a/MAINTAINERS b/MAINTAINERS
index cecb4f279160..90919c672d4d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -26040,6 +26040,7 @@ M: Conor Dooley <conor@kernel.org>
S: Maintained
T: git https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/
F: Documentation/devicetree/bindings/soc/starfive/
+F: drivers/soc/starfive/
STARFIVE STARLINK PMU DRIVER
M: Ji Sheng Teoh <jisheng.teoh@starfivetech.com>
@@ -26094,6 +26095,11 @@ S: Maintained
F: drivers/reset/starfive/reset-starfive-jhb1*
F: include/dt-bindings/reset/starfive,jhb1*.h
+STARFIVE JHB100 SOCINFO DRIVER
+M: Changhuang Liang <changhuang.liang@starfivetech.com>
+S: Maintained
+F: drivers/soc/starfive/socinfo/jhb100-socinfo.c
+
STARFIVE JHB100 SYSCON
M: Changhuang Liang <changhuang.liang@starfivetech.com>
S: Maintained
diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
index a2d65adffb80..b3b01fc38139 100644
--- a/drivers/soc/Kconfig
+++ b/drivers/soc/Kconfig
@@ -24,6 +24,7 @@ source "drivers/soc/renesas/Kconfig"
source "drivers/soc/rockchip/Kconfig"
source "drivers/soc/samsung/Kconfig"
source "drivers/soc/sophgo/Kconfig"
+source "drivers/soc/starfive/Kconfig"
source "drivers/soc/sunxi/Kconfig"
source "drivers/soc/tegra/Kconfig"
source "drivers/soc/ti/Kconfig"
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
index c9e689080ceb..009f85ff891a 100644
--- a/drivers/soc/Makefile
+++ b/drivers/soc/Makefile
@@ -30,6 +30,7 @@ obj-y += renesas/
obj-y += rockchip/
obj-$(CONFIG_SOC_SAMSUNG) += samsung/
obj-y += sophgo/
+obj-y += starfive/
obj-y += sunxi/
obj-$(CONFIG_ARCH_TEGRA) += tegra/
obj-y += ti/
diff --git a/drivers/soc/starfive/Kconfig b/drivers/soc/starfive/Kconfig
new file mode 100644
index 000000000000..04b020083d3e
--- /dev/null
+++ b/drivers/soc/starfive/Kconfig
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0-only
+menu "StarFive SoC (System On Chip) specific Drivers"
+
+source "drivers/soc/starfive/socinfo/Kconfig"
+
+endmenu
diff --git a/drivers/soc/starfive/Makefile b/drivers/soc/starfive/Makefile
new file mode 100644
index 000000000000..ca1e609b8104
--- /dev/null
+++ b/drivers/soc/starfive/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y += socinfo/
diff --git a/drivers/soc/starfive/socinfo/Kconfig b/drivers/soc/starfive/socinfo/Kconfig
new file mode 100644
index 000000000000..64f1b1e04d01
--- /dev/null
+++ b/drivers/soc/starfive/socinfo/Kconfig
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config STARFIVE_JHB100_SOCINFO
+ bool "StarFive JHB100 SoC Information"
+ depends on ARCH_STARFIVE || COMPILE_TEST
+ select SOC_BUS
+ select MFD_CORE
+ select MFD_SYSCON
+ default y
+ help
+ Include support for the SoC bus socinfo for the StarFive JHB100 SoC
+ platforms to provide information about the SoC family and variant
+ to user space.
diff --git a/drivers/soc/starfive/socinfo/Makefile b/drivers/soc/starfive/socinfo/Makefile
new file mode 100644
index 000000000000..26c2bdf1de3b
--- /dev/null
+++ b/drivers/soc/starfive/socinfo/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_STARFIVE_JHB100_SOCINFO) += jhb100-socinfo.o
diff --git a/drivers/soc/starfive/socinfo/jhb100-socinfo.c b/drivers/soc/starfive/socinfo/jhb100-socinfo.c
new file mode 100644
index 000000000000..0a31cae9b4f5
--- /dev/null
+++ b/drivers/soc/starfive/socinfo/jhb100-socinfo.c
@@ -0,0 +1,105 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2025 StarFive Technology Co., Ltd.
+ *
+ * Author: Changhuang Liang <changhuang.liang@starfivetech.com>
+ */
+
+#include <linux/bitfield.h>
+#include <linux/device.h>
+#include <linux/mfd/core.h>
+#include <linux/mfd/syscon.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/sys_soc.h>
+
+#define JHB100_REV_ID 0x38
+#define JHB100_REV_ID_CHAR GENMASK(3, 2)
+#define JHB100_REV_ID_NUM GENMASK(1, 0)
+
+/*
+ * The sys0 system controller region only contains the PLL controls, this
+ * revision ID register and a few debug registers, so instead of describing
+ * a child node in the devicetree the PLL device is instantiated from here.
+ */
+static const struct mfd_cell jhb100_sys0_syscon_cells[] = {
+ { .name = "jhb100-sys0-pll", },
+};
+
+static void jhb100_socinfo_unregister(void *data)
+{
+ soc_device_unregister(data);
+}
+
+static int jhb100_socinfo_probe(struct platform_device *pdev)
+{
+ struct soc_device_attribute *attrs;
+ struct device *dev = &pdev->dev;
+ struct soc_device *soc_dev;
+ struct regmap *regmap;
+ char rev_char;
+ u32 rev_id;
+ int ret;
+
+ regmap = syscon_node_to_regmap(dev->of_node);
+ if (IS_ERR(regmap))
+ return dev_err_probe(dev, PTR_ERR(regmap),
+ "failed to get syscon regmap\n");
+
+ ret = regmap_read(regmap, JHB100_REV_ID, &rev_id);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to read revision ID\n");
+
+ attrs = devm_kzalloc(dev, sizeof(*attrs), GFP_KERNEL);
+ if (!attrs)
+ return -ENOMEM;
+
+ rev_char = FIELD_GET(JHB100_REV_ID_CHAR, rev_id) + 'A';
+
+ attrs->family = "JH";
+ attrs->soc_id = "JHB100";
+ attrs->revision = devm_kasprintf(dev, GFP_KERNEL, "%c%lu", rev_char,
+ FIELD_GET(JHB100_REV_ID_NUM, rev_id));
+ if (!attrs->revision)
+ return -ENOMEM;
+
+ soc_dev = soc_device_register(attrs);
+ if (IS_ERR(soc_dev))
+ return dev_err_probe(dev, PTR_ERR(soc_dev),
+ "failed to register SoC device\n");
+
+ ret = devm_add_action_or_reset(dev, jhb100_socinfo_unregister, soc_dev);
+ if (ret)
+ return ret;
+
+ ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO,
+ jhb100_sys0_syscon_cells,
+ ARRAY_SIZE(jhb100_sys0_syscon_cells),
+ NULL, 0, NULL);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to add mfd cells\n");
+
+ dev_info(dev, "StarFive %s SoC rev(%s)\n", attrs->soc_id, attrs->revision);
+
+ return 0;
+}
+
+static const struct of_device_id jhb100_socinfo_of_match[] = {
+ { .compatible = "starfive,jhb100-sys0-syscon" },
+ { /* sentinel */ }
+};
+
+static struct platform_driver jhb100_socinfo_driver = {
+ .probe = jhb100_socinfo_probe,
+ .driver = {
+ .name = "jhb100-socinfo",
+ .of_match_table = jhb100_socinfo_of_match,
+ },
+};
+
+static int __init jhb100_socinfo_init(void)
+{
+ return platform_driver_register(&jhb100_socinfo_driver);
+}
+subsys_initcall(jhb100_socinfo_init);
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v5 8/8] riscv: dts: starfive: jhb100: Add syscon nodes
2026-08-28 9:56 [PATCH v5 0/8] Add StarFive JHB100 syscon modules Changhuang Liang
` (6 preceding siblings ...)
2026-08-28 9:56 ` [PATCH v5 7/8] soc: starfive: Add socinfo driver for JHB100 SoC Changhuang Liang
@ 2026-08-28 9:56 ` Changhuang Liang
7 siblings, 0 replies; 9+ messages in thread
From: Changhuang Liang @ 2026-08-28 9:56 UTC (permalink / raw)
To: Michael Turquette, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Stephen Boyd, Brian Masney, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Philipp Zabel, Emil Renner Berthing
Cc: Chen Wang, Inochi Amaoto, Alexey Charkov, Thomas Bogendoerfer,
Keguang Zhang, linux-clk, linux-kernel, devicetree, linux-riscv,
Changhuang Liang, Hal Feng
Add syscon nodes for JHB100 RISC-V BMC SoC. They contain
pcieep0_ecsr_syscon | host0_syscon | husb0_syscon | husbd0_syscon |
pcieep1_ecsr_syscon | host1_syscon | husb1_syscon | husbd1_syscon |
gpu0_syscon | gpu1_syscon | husbcmn_syscon | b2h_syscon | h2b_syscon |
vout_syscon | pcierp_ecsr_syscon | pcierp_syscon | usb_syscon |
npu_syscon | per0_syscon | per1_syscon | per2_syscon | per3_syscon |
sys0_syscon | sys1_syscon | sys2_syscon | strap_syscon |
sfc0_filter_syscon | sfc1_filter_syscon | sfc2_filter_syscon.
Also update the references of pll nodes.
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
---
arch/riscv/boot/dts/starfive/jhb100.dtsi | 193 +++++++++++++++++++----
1 file changed, 159 insertions(+), 34 deletions(-)
diff --git a/arch/riscv/boot/dts/starfive/jhb100.dtsi b/arch/riscv/boot/dts/starfive/jhb100.dtsi
index 6b2863fd3fd3..e76cf0f3c380 100644
--- a/arch/riscv/boot/dts/starfive/jhb100.dtsi
+++ b/arch/riscv/boot/dts/starfive/jhb100.dtsi
@@ -282,36 +282,6 @@ pll1: clock-pll1 {
clock-frequency = <1000000000>;
};
- pll2: clock-pll2 {
- compatible = "fixed-clock";
- #clock-cells = <0>;
- clock-frequency = <903168000>;
- };
-
- pll4: clock-pll4 {
- compatible = "fixed-clock";
- #clock-cells = <0>;
- clock-frequency = <100700000>;
- };
-
- pll5: clock-pll5 {
- compatible = "fixed-clock";
- #clock-cells = <0>;
- clock-frequency = <100700000>;
- };
-
- pll6: clock-pll6 {
- compatible = "fixed-clock";
- #clock-cells = <0>;
- clock-frequency = <2400000000>;
- };
-
- pll7: clock-pll7 {
- compatible = "fixed-clock";
- #clock-cells = <0>;
- clock-frequency = <1950000000>;
- };
-
per2_gmac2_rgmii_rx: clock-per2-gmac2-rgmii-rx {
compatible = "fixed-clock";
#clock-cells = <0>;
@@ -393,6 +363,97 @@ bus_nioc: bus {
<0x4 0x00000000 0x4 0x00000000 0x2 0x0>;
ranges;
+ pcieep0_ecsr_syscon: syscon@10511000 {
+ compatible = "starfive,jhb100-pcieep-ecsr-syscon", "syscon";
+ reg = <0x0 0x10511000 0x0 0x1000>;
+ };
+
+ host0_syscon: syscon@10519000 {
+ compatible = "starfive,jhb100-host-syscon", "syscon";
+ reg = <0x0 0x10519000 0x0 0x1000>;
+ };
+
+ husb0_syscon: syscon@10695000 {
+ compatible = "starfive,jhb100-husb-syscon", "syscon";
+ reg = <0x0 0x10695000 0x0 0x800>;
+ };
+
+ husbd0_syscon: syscon@10695800 {
+ compatible = "starfive,jhb100-husbd-syscon", "syscon";
+ reg = <0x0 0x10695800 0x0 0x800>;
+ };
+
+ gpu0_syscon: syscon@10745000 {
+ compatible = "starfive,jhb100-gpu-syscon", "syscon";
+ reg = <0x0 0x10745000 0x0 0x1000>;
+ };
+
+ pcieep1_ecsr_syscon: syscon@10d11000 {
+ compatible = "starfive,jhb100-pcieep-ecsr-syscon", "syscon";
+ reg = <0x0 0x10d11000 0x0 0x1000>;
+ };
+
+ host1_syscon: syscon@10d19000 {
+ compatible = "starfive,jhb100-host-syscon", "syscon";
+ reg = <0x0 0x10d19000 0x0 0x1000>;
+ };
+
+ husb1_syscon: syscon@10e95000 {
+ compatible = "starfive,jhb100-husb-syscon", "syscon";
+ reg = <0x0 0x10e95000 0x0 0x800>;
+ };
+
+ husbd1_syscon: syscon@10e95800 {
+ compatible = "starfive,jhb100-husbd-syscon", "syscon";
+ reg = <0x0 0x10e95800 0x0 0x800>;
+ };
+
+ gpu1_syscon: syscon@10f45000 {
+ compatible = "starfive,jhb100-gpu-syscon", "syscon";
+ reg = <0x0 0x10f45000 0x0 0x1000>;
+ };
+
+ husbcmn_syscon: syscon@11045000 {
+ compatible = "starfive,jhb100-husbcmn-syscon", "syscon";
+ reg = <0x0 0x11045000 0x0 0x1000>;
+ };
+
+ b2h_syscon: syscon@11135000 {
+ compatible = "starfive,jhb100-b2h-syscon", "syscon";
+ reg = <0x0 0x11135000 0x0 0x400>;
+ };
+
+ h2b_syscon: syscon@11135400 {
+ compatible = "starfive,jhb100-h2b-syscon", "syscon";
+ reg = <0x0 0x11135400 0x0 0x200>;
+ };
+
+ vout_syscon: syscon@11135800 {
+ compatible = "starfive,jhb100-vout-syscon", "syscon";
+ reg = <0x0 0x11135800 0x0 0x400>;
+ };
+
+ pcierp_ecsr_syscon: syscon@11711000 {
+ compatible = "starfive,jhb100-pcierp-ecsr-syscon", "syscon";
+ reg = <0x0 0x11711000 0x0 0x1000>;
+ };
+
+ pcierp_syscon: syscon@11719000 {
+ compatible = "starfive,jhb100-pcierp-syscon", "syscon";
+ reg = <0x0 0x11719000 0x0 0x1000>;
+ #reset-cells = <1>;
+ };
+
+ usb_syscon: syscon@11820000 {
+ compatible = "starfive,jhb100-usb-syscon", "syscon";
+ reg = <0x0 0x11820000 0x0 0x10000>;
+ };
+
+ npu_syscon: syscon@118e5000 {
+ compatible = "starfive,jhb100-npu-syscon", "syscon";
+ reg = <0x0 0x118e5000 0x0 0x100>;
+ };
+
uart6: serial@11982000 {
compatible = "starfive,jhb100-uart", "snps,dw-apb-uart";
reg = <0x0 0x11982000 0x0 0x400>;
@@ -410,7 +471,8 @@ uart6: serial@11982000 {
per0crg: clock-controller@11a08000 {
compatible = "starfive,jhb100-per0crg";
reg = <0x0 0x11a08000 0x0 0x1000>;
- clocks = <&osc>, <&pll6>,
+ clocks = <&osc>,
+ <&per0_syscon JHB100_PER0PLL_PLL6_OUT>,
<&sys0crg JHB100_SYS0CLK_BMCPER0_CFG_400>,
<&sys0crg JHB100_SYS0CLK_BMCPER0_CFG_800>,
<&sys0crg JHB100_SYS0CLK_BMCPER0_NCNOC_INIT>,
@@ -422,10 +484,17 @@ per0crg: clock-controller@11a08000 {
#reset-cells = <1>;
};
+ per0_syscon: syscon@11a09000 {
+ compatible = "starfive,jhb100-per0-syscon", "syscon";
+ reg = <0x0 0x11a09000 0x0 0x1000>;
+ clocks = <&osc>;
+ #clock-cells = <1>;
+ };
+
per1crg: clock-controller@11b40000 {
compatible = "starfive,jhb100-per1crg";
reg = <0x0 0x11b40000 0x0 0x1000>;
- clocks = <&pll7>,
+ clocks = <&per1_syscon JHB100_PER1PLL_PLL7_OUT>,
<&sys0crg JHB100_SYS0CLK_BMCPER1_NCNOC_INIT>,
<&sys0crg JHB100_SYS0CLK_BMCPER1_CFG_800>,
<&sys2crg JHB100_SYS2CLK_BMCPER1_NCNOC_TARG>,
@@ -437,6 +506,13 @@ per1crg: clock-controller@11b40000 {
#reset-cells = <1>;
};
+ per1_syscon: syscon@11b41000 {
+ compatible = "starfive,jhb100-per1-syscon", "syscon";
+ reg = <0x0 0x11b41000 0x0 0x1000>;
+ clocks = <&osc>;
+ #clock-cells = <1>;
+ };
+
per2crg: clock-controller@11bc0000 {
compatible = "starfive,jhb100-per2crg";
reg = <0x0 0x11bc0000 0x0 0x1000>;
@@ -458,6 +534,11 @@ per2crg: clock-controller@11bc0000 {
#reset-cells = <1>;
};
+ per2_syscon: syscon@11bc1000 {
+ compatible = "starfive,jhb100-per2-syscon", "syscon";
+ reg = <0x0 0x11bc1000 0x0 0x1000>;
+ };
+
per3crg: clock-controller@11c40000 {
compatible = "starfive,jhb100-per3crg";
reg = <0x0 0x11c40000 0x0 0x1000>;
@@ -477,11 +558,16 @@ per3crg: clock-controller@11c40000 {
#reset-cells = <1>;
};
+ per3_syscon: syscon@11c41000 {
+ compatible = "starfive,jhb100-per3-syscon", "syscon";
+ reg = <0x0 0x11c41000 0x0 0x1000>;
+ };
+
sys0crg: clock-controller@13000000 {
compatible = "starfive,jhb100-sys0crg";
reg = <0x0 0x13000000 0x0 0x4000>;
clocks = <&osc>, <&pll0>, <&pll1>,
- <&pll2>;
+ <&sys0_syscon JHB100_SYS0PLL_PLL2_OUT>;
clock-names = "osc", "pll0", "pll1", "pll2";
#clock-cells = <1>;
#reset-cells = <1>;
@@ -491,7 +577,9 @@ sys1crg: clock-controller@13004000 {
compatible = "starfive,jhb100-sys1crg";
reg = <0x0 0x13004000 0x0 0x4000>;
clocks = <&osc>, <&pll0>, <&pll1>,
- <&pll2>, <&pll4>, <&pll5>,
+ <&sys0_syscon JHB100_SYS0PLL_PLL2_OUT>,
+ <&sys0_syscon JHB100_SYS0PLL_PLL4_OUT>,
+ <&sys0_syscon JHB100_SYS0PLL_PLL5_OUT>,
<&sys0crg JHB100_SYS0CLK_NPU_NCNOC_INIT>;
clock-names = "osc", "pll0", "pll1", "pll2",
"pll4", "pll5", "npu_ncnoc_init";
@@ -511,6 +599,28 @@ sys2crg: clock-controller@13008000 {
#reset-cells = <1>;
};
+ sys0_syscon: syscon@13010000 {
+ compatible = "starfive,jhb100-sys0-syscon", "syscon";
+ reg = <0x0 0x13010000 0x0 0x2000>;
+ clocks = <&osc>;
+ #clock-cells = <1>;
+ };
+
+ sys1_syscon: syscon@13014000 {
+ compatible = "starfive,jhb100-sys1-syscon", "syscon";
+ reg = <0x0 0x13014000 0x0 0x4000>;
+ };
+
+ sys2_syscon: syscon@13018000 {
+ compatible = "starfive,jhb100-sys2-syscon", "syscon";
+ reg = <0x0 0x13018000 0x0 0x2000>;
+ };
+
+ strap_syscon: syscon@1301a000 {
+ compatible = "starfive,jhb100-strap-syscon", "syscon";
+ reg = <0x0 0x1301a000 0x0 0x2000>;
+ };
+
intc: interrupt-controller@13220000 {
compatible = "starfive,jhb100-intc";
reg = <0x0 0x13220000 0x0 0x80>;
@@ -518,6 +628,21 @@ intc: interrupt-controller@13220000 {
interrupt-controller;
#interrupt-cells = <1>;
};
+
+ sfc0_filter_syscon: syscon@14090000 {
+ compatible = "starfive,jhb100-sfc-filter-syscon", "syscon";
+ reg = <0x0 0x14090000 0x0 0x1000>;
+ };
+
+ sfc1_filter_syscon: syscon@14091000 {
+ compatible = "starfive,jhb100-sfc-filter-syscon", "syscon";
+ reg = <0x0 0x14091000 0x0 0x1000>;
+ };
+
+ sfc2_filter_syscon: syscon@14092000 {
+ compatible = "starfive,jhb100-sfc-filter-syscon", "syscon";
+ reg = <0x0 0x14092000 0x0 0x1000>;
+ };
};
};
};
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread