[arch][riscv] Expose RISC-V mp kernel start

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
This commit is contained in:
Elliot Berman
2019-12-04 09:08:57 -08:00
committed by Travis Geiselbrecht
parent d239adf839
commit acfe991c7f
16 changed files with 243 additions and 61 deletions

View File

@@ -25,3 +25,4 @@
#define GPIO_REG_IOF_EN 14
#define GPIO_REG_IOF_SEL 15
#define PLIC_HART_IDX(hart) 0

View File

@@ -20,3 +20,5 @@
#define PWM0_BASE 0x10020000
#define PWM1_BASE 0x10021000
#define GPIO_BASE 0x10060000
#define PLIC_HART_IDX(hart) ((hart) ? ((2 * (hart)) - 1) : 0)

View File

@@ -4,6 +4,9 @@ MODULE := $(LOCAL_DIR)
PLATFORM := sifive
VARIANT := sifive_u
WITH_SMP := 1
SMP_MAX_CPUS := 5
GLOBAL_DEFINES += SIFIVE_FREQ=500000000 # 500 MHz
MEMBASE ?= 0x080000000