1LOCAL_DIR := $(GET_LOCAL_DIR)
2
3MODULE := $(LOCAL_DIR)
4
5ARCH := riscv
6SUBARCH ?= 32
7RISCV_MODE ?= machine
8WITH_SMP ?= true
9SMP_MAX_CPUS ?= 8
10LK_HEAP_IMPLEMENTATION ?= dlmalloc
11RISCV_FPU ?= true
12RISCV_EXTENSION_LIST ?= zba zbb zbc zbs
13
14ifeq ($(RISCV_MODE),supervisor)
15ifeq ($(SUBARCH),32)
16RISCV_MMU ?= sv32
17else
18RISCV_MMU ?= sv48
19endif
20endif
21
22MODULE_DEPS += lib/cbuf
23MODULE_DEPS += lib/fdt
24MODULE_DEPS += lib/fdtwalk
25MODULE_DEPS += dev/bus/pci
26MODULE_DEPS += dev/bus/pci/drivers
27MODULE_DEPS += dev/interrupt/riscv_plic
28MODULE_DEPS += dev/virtio/block
29MODULE_DEPS += dev/virtio/gpu
30MODULE_DEPS += dev/virtio/net
31
32MODULE_SRCS += $(LOCAL_DIR)/platform.c
33MODULE_SRCS += $(LOCAL_DIR)/uart.c
34
35MEMBASE ?= 0x80000000
36MEMSIZE ?= 0x01000000 # default to 16MB
37ifeq ($(RISCV_MODE),supervisor)
38# offset the kernel to account for OpenSBI using the bottom
39KERNEL_LOAD_OFFSET ?= 0x00200000 # kernel load offset
40endif
41
42# set some global defines based on capability
43GLOBAL_DEFINES += ARCH_RISCV_CLINT_BASE=0x02000000
44GLOBAL_DEFINES += ARCH_RISCV_MTIME_RATE=10000000
45
46# we're going to read the default memory map from a FDT
47GLOBAL_DEFINES += NOVM_DEFAULT_ARENA=0
48
49# we can revert to a poll based uart spin routine
50GLOBAL_DEFINES += PLATFORM_SUPPORTS_PANIC_SHELL=1
51
52# do not need to implement any cache ops
53# (for now, since there are no hw accellerated qemu machines)
54GLOBAL_DEFINES += RISCV_NO_CACHE_OPS=1
55
56include make/module.mk
57