Support mp lk start on RISC-V. Several changes throughout were required: - Add signal in asm start to force secondary harts to wait for bss to be cleared. - Use mhartid in arch_curr_cpu_num, PLIC, and CLINT - Use tp register as thread pointer instead of global variable. - Support sending IPIs between harts using CLINT - Add spinlock implementation
22 lines
535 B
Makefile
22 lines
535 B
Makefile
LOCAL_DIR := $(GET_LOCAL_DIR)
|
|
MODULE := $(LOCAL_DIR)
|
|
|
|
PLATFORM := sifive
|
|
VARIANT := sifive_u
|
|
|
|
WITH_SMP := 1
|
|
SMP_MAX_CPUS := 5
|
|
|
|
GLOBAL_DEFINES += SIFIVE_FREQ=500000000 # 500 MHz
|
|
|
|
MEMBASE ?= 0x080000000
|
|
MEMSIZE ?= 0x200000000 # 8 GiB
|
|
|
|
MODULE_SRCS := $(LOCAL_DIR)/target.c
|
|
# set some global defines based on capability
|
|
GLOBAL_DEFINES += TARGET_HAS_DEBUG_LED=1
|
|
GLOBAL_DEFINES += PLATFORM_HAS_DYNAMIC_TIMER=1
|
|
GLOBAL_DEFINES += ARCH_RISCV_CLINT_BASE=0x02000000
|
|
GLOBAL_DEFINES += ARCH_RISCV_MTIME_RATE=1000000 # 1 MHz
|
|
|
|
include make/module.mk |