Skip to content

Commit

Permalink
arch: riscv64: smp: get msip base address from dts
Browse files Browse the repository at this point in the history
In most implements, the msip base address is 0x2000000. But the address
is not fixed in all boards.

Signed-off-by: Yang Jialong <[email protected]>
  • Loading branch information
Yang Jialong authored and nashif committed Nov 27, 2024
1 parent 29f7f53 commit 5a3f0b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion arch/riscv/core/ipi_clint.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

#include <zephyr/kernel.h>

#define MSIP_BASE 0x2000000UL
#define CLINT_NODE DT_NODELABEL(clint)
#if !DT_NODE_EXISTS(CLINT_NODE)
#error "Label 'clint' is not defined in the devicetree."
#endif
#define MSIP_BASE DT_REG_ADDR_RAW(CLINT_NODE)
#define MSIP(hartid) ((volatile uint32_t *)MSIP_BASE)[hartid]

static atomic_val_t cpu_pending_ipi[CONFIG_MP_MAX_NUM_CPUS];
Expand Down
2 changes: 1 addition & 1 deletion dts/riscv/qemu/virt-riscv.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
#interrupt-cells = < 0x02 >;
};

clint@2000000 {
clint: clint@2000000 {
compatible = "sifive,clint0";
reg = <0x2000000 0x10000>;
interrupts-extended = <&hlic0 0x03 &hlic0 0x07
Expand Down

0 comments on commit 5a3f0b9

Please sign in to comment.