Skip to content

Booting Linux with 2 cores - VCU128 #311

@LorenzoCarletti

Description

@LorenzoCarletti

I recently tried getting both CVA6 cores running at the same time under Linux, by changing the carfield_soc dtsi file.

Changes I implemented:

diff --git a/sw/boot/carfield_soc.dtsi b/sw/boot/carfield_soc.dtsi
index a8fd8a3..51bf185 100644
--- a/sw/boot/carfield_soc.dtsi
+++ b/sw/boot/carfield_soc.dtsi
@@ -24,6 +24,7 @@
       riscv,isa = "rv64imafdc";
       mmu-type = "riscv,sv39";
       tlb-split;
+      //Address: 0x08000000 -  0x00040000
       reg = <0>;
       CPU0_intc: interrupt-controller {
         #address-cells = <0>;
@@ -32,6 +33,23 @@
         compatible = "riscv,cpu-intc";
       };
     };
+    CPU1: cpu@1 {
+      device_type = "cpu";
+      status = "okay";
+      compatible = "eth,ariane", "riscv";
+      clock-frequency = <50000000>; // 50 MHz
+      riscv,isa = "rv64imafdc";
+      mmu-type = "riscv,sv39";
+      tlb-split;
+      //Address: 0x08040000 - 0x00040000
+      reg = <1>;
+      CPU1_intc: interrupt-controller {
+        #address-cells = <0>;
+        #interrupt-cells = <1>;
+        interrupt-controller;
+        compatible = "riscv,cpu-intc";
+      };
+    };
   };
 
   sysclk: virt_50mhz {
@@ -105,7 +123,7 @@
     };
     clint@2040000 {
       compatible = "riscv,clint0";
-      interrupts-extended = <&CPU0_intc 3 &CPU0_intc 7>;
+      interrupts-extended = <&CPU0_intc 3 &CPU0_intc 7 &CPU1_intc 3 &CPU1_intc 7>;
       reg-names = "control";
       reg = <0x0 0x2040000 0x0 0x040000>;
     };
@@ -114,7 +132,7 @@
       #address-cells = <0>;
       #interrupt-cells = <1>;
       interrupt-controller;
-      interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9>;
+      interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9 &CPU1_intc 11 &CPU1_intc 9>;
       riscv,max-priority = <7>;
       riscv,ndev = <51>;
       reg = <0x0 0x4000000 0x0 0x4000000>;

However, I now get the following error during the boot process:

[    0.411142] smp: Bringing up secondary CPUs ...
[    0.502259] CPU1: failed to start
[    0.504497] smp: Brought up 1 node, 1 CPU

I looked into it some more, and it seems to be related to the IPI_WAKEUP interrupt not being received by CPU 1 (or CPU 1 not signaling back). Related Linux kernel line: https://github.com/torvalds/linux/blob/cec1e6e5d1ab33403b809f79cd20d6aff124ccfe/arch/openrisc/kernel/smp.c#L103

Any clues what I am currently missing to get the second CPU online? Or what mistake I made with the above configuration change?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions