Skip to contentSkip to conversation

JH7100 Monitor Core

RFC In review Conor Dooley 3 participants 6 messages Jul 10, 2022 – Jul 11, 2022

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

cover JH7100 Monitor Core

From: Conor Dooley <[email protected]>

Hey Emil,

Had a go at adding that E24, made it an RFC b/c I am not sure if I got the cache setup anywhere close to correct. I had a look in the SiFive E24 docs & in [0] which said "16KB I-cache with 32 Byte cache line". Didn't have anything else to go on, so I kept the same ratio between lines/sets/size as other SiFive monitor cores, but since they're not 32 bit I dunno if that's correct (IOW it is a wild guess).

Hopefully you know better than I do..
Thanks,
Conor.

0: https://github.com/starfive-tech/JH7100_Docs/blob/main/JH7100%20Data%20Sheet%20V01.01.04-EN%20(4-21-2021).pdf

Conor Dooley (2):
dt-bindings: riscv: document the sifive e24
riscv: dts: starfive: add the missing monitor core

 .../devicetree/bindings/riscv/cpus.yaml       |  2 ++
 arch/riscv/boot/dts/starfive/jh7100.dtsi      | 20 +++++++++++++++++++
 2 files changed, 22 insertions(+)
Signature · 7 lines
2.37.0


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

RFC 1/2 dt-bindings: riscv: document the sifive e24

From: Conor Dooley <[email protected]>

The SiFive E24 is a 32 bit monitor core present on the JH7100.

---
 Documentation/devicetree/bindings/riscv/cpus.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/riscv/cpus.yaml +2 -0
index d632ac76532e..195e762094a8 100644
@@ -29,6 +29,7 @@ properties:
           - enum:
               - sifive,rocket0
               - sifive,bullet0
+              - sifive,e24
               - sifive,e5
               - sifive,e7
               - sifive,e71
@@ -75,6 +76,7 @@ properties:
       lowercase to simplify parsing.
     $ref: "/schemas/types.yaml#/definitions/string"
     enum:
+      - rv32imafc
       - rv64imac
       - rv64imafdc
 
Signature · 7 lines
2.37.0


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

RFC 2/2 riscv: dts: starfive: add the missing monitor core

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

The JH7100 has a 32 bit monitor core that is missing from the device tree. Add it (and its cpu-map entry) to more accurately reflect the actual topology of the SoC.

---
 arch/riscv/boot/dts/starfive/jh7100.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/riscv/boot/dts/starfive/jh7100.dtsi +20 -0
index c617a61e26e2..840875fcb633 100644
@@ -67,6 +67,22 @@ cpu1_intc: interrupt-controller {
 			};
 		};
 
+		E24: cpu@2 {
+			compatible = "sifive,e24", "riscv";
+			device_type = "cpu";
+			i-cache-block-size = <32>;
+			i-cache-sets = <256>;
+			i-cache-size = <16384>;
+			reg = <0x2>;
+			riscv,isa = "rv32imafc";
+			status = "disabled";
+			cpu2_intc: interrupt-controller {
+				#interrupt-cells = <1>;
+				compatible = "riscv,cpu-intc";
+				interrupt-controller;
+			};
+		};
+
 		cpu-map {
 			cluster0 {
 				core0 {
@@ -76,6 +92,10 @@ core0 {
 				core1 {
 					cpu = <&U74_1>;
 				};
+
+				core2 {
+					cpu = <&E24>;
+				};
 			};
 		};
 	};
Signature · 7 lines
2.37.0


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

Re: [RFC 2/2] riscv: dts: starfive: add the missing monitor core

Quoted 25 lines · Conor Dooley

From: Conor Dooley <[email protected]>

The JH7100 has a 32 bit monitor core that is missing from the device tree. Add it (and its cpu-map entry) to more accurately reflect the actual topology of the SoC.

---
 arch/riscv/boot/dts/starfive/jh7100.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/riscv/boot/dts/starfive/jh7100.dtsi +5 -0
index c617a61e26e2..840875fcb633 100644
@@ -67,6 +67,22 @@ cpu1_intc: interrupt-controller {
                        };
                };
 
+               E24: cpu@2 {
+                       compatible = "sifive,e24", "riscv";
+                       device_type = "cpu";
+                       i-cache-block-size = <32>;
+                       i-cache-sets = <256>;

arch/riscv/boot/dts/starfive/jh7100.dtsi cpu1_intc: interrupt-controller { · line 84

Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7100.dtsi +10 -0
+                       i-cache-size = <16384>;
+                       reg = <0x2>;
+                       riscv,isa = "rv32imafc";
+                       status = "disabled";
+                       cpu2_intc: interrupt-controller {
+                               #interrupt-cells = <1>;
+                               compatible = "riscv,cpu-intc";
+                               interrupt-controller;
+                       };
+               };

Maybe you could make this look a bit more like the nodes above, so

compatible
reg
<the rest sorted>
<blank line>
cpu2_intc: interrupt-controller {
<entries sorted like the other interrupt controllers>
}

/Emil

Quoted 15 lines
arch/riscv/boot/dts/starfive/jh7100.dtsi +4 -1
                cpu-map {
                        cluster0 {
                                core0 {
@@ -76,6 +92,10 @@ core0 {
                                core1 {
                                        cpu = <&U74_1>;
                                };
+
+                               core2 {
+                                       cpu = <&E24>;
+                               };
                        };
                };
        };
--
Quoted 2 lines

2.37.0

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

#4 lore raw

Re: [RFC 2/2] riscv: dts: starfive: add the missing monitor core

Quoted 30 lines · Emil Renner Berthing
Quoted 29 lines · Conor Dooley

From: Conor Dooley <[email protected]>

The JH7100 has a 32 bit monitor core that is missing from the device tree. Add it (and its cpu-map entry) to more accurately reflect the actual topology of the SoC.

---
  arch/riscv/boot/dts/starfive/jh7100.dtsi | 20 ++++++++++++++++++++
  1 file changed, 20 insertions(+)
arch/riscv/boot/dts/starfive/jh7100.dtsi +9 -0
index c617a61e26e2..840875fcb633 100644
@@ -67,6 +67,22 @@ cpu1_intc: interrupt-controller {
                         };
                 };
 
+               E24: cpu@2 {
+                       compatible = "sifive,e24", "riscv";
+                       device_type = "cpu";
+                       i-cache-block-size = <32>;
+                       i-cache-sets = <256>;
+                       i-cache-size = <16384>;
+                       reg = <0x2>;
+                       riscv,isa = "rv32imafc";
+                       status = "disabled";
Quoted 8 lines

arch/riscv/boot/dts/starfive/jh7100.dtsi cpu1_intc: interrupt-controller { · line 84

Quoted 6 lines
arch/riscv/boot/dts/starfive/jh7100.dtsi +6 -0
+                       cpu2_intc: interrupt-controller {
+                               #interrupt-cells = <1>;
+                               compatible = "riscv,cpu-intc";
+                               interrupt-controller;
+                       };
+               };

Maybe you could make this look a bit more like the nodes above

Sure. I'll send a proper patch to all the lists etc later with the order fixed.

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

#5 lore raw
In reply to Conor Dooley
Quoted 5 lines · Conor Dooley

From: Conor Dooley <[email protected]>

Hey Emil,

Quoted 8 lines

Had a go at adding that E24, made it an RFC b/c I am not sure if I got the cache setup anywhere close to correct. I had a look in the SiFive E24 docs & in [0] which said "16KB I-cache with 32 Byte cache line". Didn't have anything else to go on, so I kept the same ratio between lines/sets/size as other SiFive monitor cores, but since they're not 32 bit I dunno if that's correct (IOW it is a wild guess).

Hopefully you know better than I do..

Hi Conor,

Thanks for the patch! Unfortunately I don't know any more, but I'm fine with adding this data for now.

/Emil

1: https://sifive.cdn.prismic.io/sifive/dc408861-94ce-4d82-a704-caddec98609d_e24_core_complex_manual_21G3.pdf

Quoted 9 lines

Thanks,
Conor.

0: https://github.com/starfive-tech/JH7100_Docs/blob/main/JH7100%20Data%20Sheet%20V01.01.04-EN%20(4-21-2021).pdf

Conor Dooley (2):
dt-bindings: riscv: document the sifive e24
riscv: dts: starfive: add the missing monitor core

Quoted 7 lines
 .../devicetree/bindings/riscv/cpus.yaml       |  2 ++
 arch/riscv/boot/dts/starfive/jh7100.dtsi      | 20 +++++++++++++++++++
 2 files changed, 22 insertions(+)

--
2.37.0

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