Skip to contentSkip to conversation

Initial device tree support for StarFive JHB100 SoC

PATCH Applied Changhuang Liang 4 participants 12 messages Aug 6 – Aug 10

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v3 cover Initial device tree support for StarFive JHB100 SoC

StarFive JHB100 SoC consists of 4 RISC-V low power Cores (Dubhe-70). It also features various interfaces such as I2C, SPI, CAN, USB, MMC, Uart, etc.

This patch series introduces initial SoC DTSI support for the StarFive JHB100 SoC. The relevant dt-binding documentation has been updated accordingly. Below is the list of IP blocks added in the initial SoC DTSI.

- StarFive Dubhe-70 CPU
- PMU
- PLIC
- CLINT
- UART
- INTC

changes since v2:
- Add a new patch 4

patch 5:
- Remove the 'riscv,isa' property.
- Add 'starfive,jhb100-uart' to the UART node.
- Update bus node name.
- Remove the interrupts-extended property in riscv,pmu

v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/

Changhuang Liang (1):
dt-bindings: serial: snps-dw-apb-uart: Add StarFive JHB100 UART
compatible

Ji Sheng Teoh (1):
dt-bindings: riscv: Add StarFive Dubhe-70 compatibles

Ley Foon Tan (3):
dt-bindings: interrupt-controller: Add StarFive JHB100 plic
dt-bindings: riscv: Add StarFive JHB100 SoC
riscv: dts: starfive: jhb100: Add JHB100 base DT

 .../sifive,plic-1.0.0.yaml                    |   1 +
 .../devicetree/bindings/riscv/cpus.yaml       |   1 +
 .../devicetree/bindings/riscv/starfive.yaml   |   5 +
 .../bindings/serial/snps-dw-apb-uart.yaml     |   1 +
 MAINTAINERS                                   |   6 +
 arch/riscv/boot/dts/starfive/Makefile         |   2 +
 arch/riscv/boot/dts/starfive/jhb100-evb1.dts  |  32 ++
 arch/riscv/boot/dts/starfive/jhb100.dtsi      | 331 ++++++++++++++++++
 8 files changed, 379 insertions(+)
 create mode 100644 arch/riscv/boot/dts/starfive/jhb100-evb1.dts
 create mode 100644 arch/riscv/boot/dts/starfive/jhb100.dtsi

--
2.25.1

#1 lore raw

PATCH v3 1/5 dt-bindings: riscv: Add StarFive Dubhe-70 compatibles

From: Ji Sheng Teoh <[email protected]>

Add new compatible string for Dubhe-70.
Dubhe-70 is a low power RISC-V cpu core from StarFive Technology.

---
 Documentation/devicetree/bindings/riscv/cpus.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/riscv/cpus.yaml +1 -0
index 5feeb2203050..e7eda7a9c345 100644
@@ -63,6 +63,7 @@ properties:
               - sifive,u74-mc
               - spacemit,x100
               - spacemit,x60
+              - starfive,dubhe-70
               - thead,c906
               - thead,c908
               - thead,c910
Signature · 1 line
2.25.1
#2 lore raw

PATCH v3 2/5 dt-bindings: interrupt-controller: Add StarFive JHB100 plic

In reply to Changhuang Liang

From: Ley Foon Tan <[email protected]>

Add compatible string for StarFive JHB100 plic.

---
 .../bindings/interrupt-controller/sifive,plic-1.0.0.yaml         | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml +1 -0
index 78d8cd77b4ec..cde4bb691897 100644
@@ -66,6 +66,7 @@ properties:
               - spacemit,k1-plic
               - starfive,jh7100-plic
               - starfive,jh7110-plic
+              - starfive,jhb100-plic
               - tenstorrent,blackhole-plic
           - const: sifive,plic-1.0.0
       - items:
Signature · 1 line
2.25.1
maintainer Applied
#3 lore raw

Re: [PATCH v3 2/5] dt-bindings: interrupt-controller: Add StarFive JHB100 plic

Quoted 4 lines · Changhuang Liang

From: Ley Foon Tan <[email protected]>

Add compatible string for StarFive JHB100 plic.

Quoted 8 lines
---
 .../bindings/interrupt-controller/sifive,plic-1.0.0.yaml         | 1 +
 1 file changed, 1 insertion(+)

Applied, thanks!

#4 lore raw

PATCH v3 3/5 dt-bindings: riscv: Add StarFive JHB100 SoC

In reply to Changhuang Liang

From: Ley Foon Tan <[email protected]>

Add device tree bindings for the StarFive JHB100 RISC-V SoC.

---
 Documentation/devicetree/bindings/riscv/starfive.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/riscv/starfive.yaml +5 -0
index 8ba0e10b529a..277618efff6e 100644
@@ -43,6 +43,11 @@ properties:
           - const: starfive,jh7110s
           - const: starfive,jh7110
 
+      - items:
+          - enum:
+              - starfive,jhb100-evb1
+          - const: starfive,jhb100
+
 additionalProperties: true
 
 ...
Signature · 1 line
2.25.1
#5 lore raw

PATCH v3 4/5 dt-bindings: serial: snps-dw-apb-uart: Add StarFive JHB100 UART compatible

In reply to Changhuang Liang

Add "starfive,jhb100-uart" compatible string, with "snps,dw-apb-uart" as the fallback.

---
 Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +1 -0
index c0d0524458c1..f90ba8f3d4f6 100644
@@ -79,6 +79,7 @@ properties:
               - starfive,jh7100-hsuart
               - starfive,jh7100-uart
               - starfive,jh7110-uart
+              - starfive,jhb100-uart
               - ultrarisc,dp1000-uart
           - const: snps,dw-apb-uart
       - const: snps,dw-apb-uart
Signature · 1 line
2.25.1
#6 lore raw

Re: [PATCH v3 4/5] dt-bindings: serial: snps-dw-apb-uart: Add StarFive JHB100 UART compatible

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Missing Compatible String in Conditional Block --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing Compatible String in Conditional Block
--

--- Patch [4]: [PATCH v3 4/5] dt-bindings: serial: snps-dw-apb-uart: Add StarFive JHB100 UART compatible --- commit 58551d4cd9febd373c92800fceea07e37197bb0a
Author: Changhuang Liang <[email protected]>

dt-bindings: serial: snps-dw-apb-uart: Add StarFive JHB100 UART compatible

Add "starfive,jhb100-uart" compatible string, with "snps,dw-apb-uart" as the fallback.

Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml properties: · line 81

Quoted 9 lines
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +1 -0
index 49f51b0028795..bca297c22fda5 100644
@@ -78,6 +78,7 @@ properties:
               - starfive,jh7100-hsuart
               - starfive,jh7100-uart
               - starfive,jh7110-uart
+              - starfive,jhb100-uart

[Severity: Medium]
Does the starfive,jhb100-uart hardware also require 2 resets like the jh7110-uart?

If so, should it be added to the conditional block earlier in this file? Without it, device trees specifying 2 resets for jhb100-uart will fail schema validation because they will fall into the else block which limits resets to a maxItems of 1:

allOf:
[ ... ]
- if:

      properties:
        compatible:
          contains:
            const: starfive,jh7110-uart
    then:
      properties:
        resets:
          minItems: 2
    else:
      properties:
        resets:
          maxItems: 1
Quoted 2 lines
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +0 -0
               - ultrarisc,dp1000-uart
           - const: snps,dw-apb-uart
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#8 lore raw

PATCH v3 5/5 riscv: dts: starfive: jhb100: Add JHB100 base DT

In reply to Changhuang Liang

From: Ley Foon Tan <[email protected]>

Add JHB100 base dtsi and dts. Consist of 4 Dubhe-70 cores, CLINT, PLIC, PMU, UART, INTC and 1GB DDR.

---
 MAINTAINERS                                  |   6 +
 arch/riscv/boot/dts/starfive/Makefile        |   2 +
 arch/riscv/boot/dts/starfive/jhb100-evb1.dts |  32 ++
 arch/riscv/boot/dts/starfive/jhb100.dtsi     | 331 +++++++++++++++++++
 4 files changed, 371 insertions(+)
 create mode 100644 arch/riscv/boot/dts/starfive/jhb100-evb1.dts
 create mode 100644 arch/riscv/boot/dts/starfive/jhb100.dtsi
MAINTAINERS +6 -0
index 56b337a06447..ce97de46e610 100644
@@ -26069,6 +26069,12 @@ F:	Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yaml
 F:	drivers/phy/starfive/phy-jh7110-pcie.c
 F:	drivers/phy/starfive/phy-jh7110-usb.c
 
+STARFIVE JHB100 DEVICETREES
+M:	Changhuang Liang <[email protected]>
+L:	[email protected]
+S:	Supported
+F:	arch/riscv/boot/dts/starfive/jhb100*
+
 STARFIVE JHB100 EXTERNAL INTERRUPT CONTROLLER DRIVER
 M:	Changhuang Liang <[email protected]>
 S:	Supported
arch/riscv/boot/dts/starfive/Makefile +2 -0
index 3dd1f05283f7..42841942fe54 100644
@@ -18,3 +18,5 @@ dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-lite.dtb
 dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-lite-emmc.dtb
 dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb
 dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb
+
+dtb-$(CONFIG_ARCH_STARFIVE) += jhb100-evb1.dtb
arch/riscv/boot/dts/starfive/jhb100-evb1.dts new file +32 -0
new file mode 100644
index 000000000000..462b6fb7953b
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0 OR MIT
+/*
+ * Copyright (c) 2024-2026 StarFive Technology Co., Ltd.
+ */
+
+#include "jhb100.dtsi"
+
+/ {
+	model = "StarFive JHB100 EVB-1";
+	compatible = "starfive,jhb100-evb1", "starfive,jhb100";
+
+	aliases {
+		serial6 = &uart6;
+	};
+
+	chosen {
+		stdout-path = "serial6:115200n8";
+	};
+
+	cpus {
+		timebase-frequency = <5000000>;
+	};
+
+	memory@40000000 {
+		device_type = "memory";
+		reg = <0x0 0x40000000 0x0 0x40000000>;	/* 1GB */
+	};
+};
+
+&uart6 {
+	status = "okay";
+};
arch/riscv/boot/dts/starfive/jhb100.dtsi new file +331 -0

331 lines not on this page · raw message

Signature · 1 line
2.25.1
#9 lore raw

Re: [PATCH v3 5/5] riscv: dts: starfive: jhb100: Add JHB100 base DT

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Overlapping child address ranges in the `dma-ranges` property of `bus_nioc`. - [Medium] Incorrect…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Overlapping child address ranges in the dma-ranges property of bus_nioc.
- [Medium] Incorrect variant bitmask for PMU Event ID 34 in riscv,raw-event-to-mhpmcounters. --

--- Patch [5]: [PATCH v3 5/5] riscv: dts: starfive: jhb100: Add JHB100 base DT --- commit 6747fd56a0417ce034668e51d45ea97227861dc1
Author: Ley Foon Tan <[email protected]>

riscv: dts: starfive: jhb100: Add JHB100 base DT

This commit adds the base device tree sources for the StarFive JHB100 SoC and the corresponding EVB-1 board. It introduces support for 4 Dubhe-70 cores, along with basic peripherals including PMU, CLINT, PLIC, and UART.

Quoted 6 lines
arch/riscv/boot/dts/starfive/jhb100.dtsi new file +0 -0
new file mode 100644
index 0000000000000..14ab83ed4482a
@@ -0,0 +1,331 @@

[ ... ]

Quoted 2 lines
arch/riscv/boot/dts/starfive/jhb100.dtsi new file +2 -0
+	pmu {
+		compatible = "riscv,pmu";

[ ... ]

arch/riscv/boot/dts/starfive/jhb100.dtsi line 262

Quoted 4 lines
arch/riscv/boot/dts/starfive/jhb100.dtsi new file +4 -0
+		riscv,raw-event-to-mhpmcounters =
+			<0x00 0x00 0xFFFFFFFF 0xFFFFFFE0 0x00007FF8>,	/* Event ID 1-31 */
+			<0x00 0x20 0xFFFFFFFF 0xFFFFFFFE 0x00007FF8>,	/* Event ID 32-33 */
+			<0x00 0x22 0xFFFFFFFF 0xFFFFFF22 0x00007FF8>;	/* Event ID 34 */

[Severity: Medium]
Is the variant mask 0xFFFFFF22 correct for Event ID 34?

This mask appears to allow several bits (7, 6, 4, 3, 2, and 0) to vary, which could cause other hardware PMU events to incorrectly match this rule and route to the counters designated for Event 34.

Quoted 1 line
arch/riscv/boot/dts/starfive/jhb100.dtsi new file +1 -0
+	};

[ ... ]

arch/riscv/boot/dts/starfive/jhb100.dtsi line 307

Quoted 7 lines
arch/riscv/boot/dts/starfive/jhb100.dtsi new file +7 -0
+		bus_nioc: bus {
+			compatible = "simple-bus";
+			#address-cells = <2>;
+			#size-cells = <2>;
+			dma-noncoherent;
+			dma-ranges = <0x4 0x00000000 0x0 0x40000000 0x2 0x0>,
+				     <0x4 0x00000000 0x4 0x00000000 0x2 0x0>;

[Severity: High]
Does this dma-ranges property incorrectly define overlapping child addresses?

Both entries define the exact same child DMA address space (<0x4 0x00000000> with a size of <0x2 0x0>).

When parsed, standard OF translation matches the first entry, which entirely shadows the second entry and could make its parent physical memory range unreachable for DMA from this bus.

Quoted 1 line
arch/riscv/boot/dts/starfive/jhb100.dtsi new file +1 -0
+			ranges;

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
maintainer
#10 lore raw

Re: [PATCH v3 5/5] riscv: dts: starfive: jhb100: Add JHB100 base DT

In reply to Changhuang Liang

arch/riscv/boot/dts/starfive/jhb100.dtsi line 269

Quoted 6 lines · Changhuang Liang
arch/riscv/boot/dts/starfive/jhb100.dtsi new file +6 -0
+
+	clk_uart: clock-uart {
+		compatible = "fixed-clock"; /* Initial clock handler for UART */
+		#clock-cells = <0>;
+		clock-frequency = <25000000>;
+	};

I can pick this series up on a provisional basis for you to work on top of, but I won't be sending a PR for anything that contains temporary fixed clocks.

Cheers,
Conor.

#11 lore raw

Re: [PATCH v3 5/5] riscv: dts: starfive: jhb100: Add JHB100 base DT

Hi, Conor

Thanks for the review.

Quoted 10 lines · Changhuang Liang

arch/riscv/boot/dts/starfive/jhb100.dtsi line 269

Quoted 6 lines
arch/riscv/boot/dts/starfive/jhb100.dtsi new file +6 -0
+
+	clk_uart: clock-uart {
+		compatible = "fixed-clock"; /* Initial clock handler for UART */
+		#clock-cells = <0>;
+		clock-frequency = <25000000>;
+	};

I can pick this series up on a provisional basis for you to work on top of, but I won't be sending a PR for anything that contains temporary fixed clocks.

That's great.

Once my other two series are also ready:

Add basic clocks and resets for JHB100 SoC
Add StarFive JHB100 syscon modules

I can squash these three device tree into a single patch and send it out, so there won't be any temporarily used clk_uart and PLL nodes.

Best Regards,
Changhuang

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv