1LOCAL_DIR := $(GET_LOCAL_DIR)
2
3MODULE := $(LOCAL_DIR)
4
5ARCH := riscv
6SUBARCH ?= 32
7VARIANT ?= sifive_e
8
9MODULE_DEPS += dev/gpio
10MODULE_DEPS += lib/cbuf
11
12MODULE_SRCS += $(LOCAL_DIR)/platform.c
13MODULE_SRCS += $(LOCAL_DIR)/plic.c
14MODULE_SRCS += $(LOCAL_DIR)/uart.c
15MODULE_SRCS += $(LOCAL_DIR)/gpio.c
16
17ROMBASE ?= 0x20400000 # if running from rom, start here
18MEMBASE ?= 0x80000000
19MEMSIZE ?= 0x00100000 # default to 1MB
20
21ifeq ($(VARIANT),sifive_e)
22# uses a two segment layout, select the appropriate linker script
23ARCH_RISCV_TWOSEGMENT := 1
24# sets a few options in the riscv arch
25ARCH_RISCV_EMBEDDED := 1
26
27# disable WFI during idle. Have trouble breaking into a WFIed board
28# with openocd.
29GLOBAL_DEFINES += RISCV_DISABLE_WFI=1
30endif
31
32# sifive_e or _u?
33GLOBAL_DEFINES += PLATFORM_${VARIANT}=1
34
35include make/module.mk
36