summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--Makefile13
-rw-r--r--bsp/coreip-e31-arty/mee.h13
-rw-r--r--bsp/coreip-e31/mee.h2
-rw-r--r--bsp/coreip-s51-arty/mee.h13
-rw-r--r--bsp/coreip-s51/mee.h2
-rw-r--r--bsp/freedom-e310-arty/mee.h1
-rw-r--r--bsp/sifive-hifive1/mee.h1
m---------freedom-mee0
m---------software/local-interrupt0
10 files changed, 43 insertions, 5 deletions
diff --git a/.gitmodules b/.gitmodules
index 6041cd3..1845590 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -16,3 +16,6 @@
[submodule "software/timer-interrupt"]
path = software/timer-interrupt
url = git@github.com:sifive/example-timer-interrupt.git
+[submodule "software/local-interrupt"]
+ path = software/local-interrupt
+ url = git@github.com:sifive/example-local-interrupt.git
diff --git a/Makefile b/Makefile
index 491a3dd..4efa50c 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,9 @@ BOARD ?= sifive-hifive1
endif # $(BSP)
+BOARD_ROOT ?= $(abspath .)
+PROGRAM_ROOT ?= $(abspath .)
+
# Variables the user probably shouldn't override.
#############################################################
# BSP Loading
@@ -40,7 +43,7 @@ endif # $(BSP)
# Finds the directory in which this BSP is located, ensuring that there is
# exactly one.
-board_dir := $(wildcard bsp/$(BSP_SUBDIR)/$(BOARD))
+board_dir := $(wildcard $(BOARD_ROOT)/bsp/$(BSP_SUBDIR)/$(BOARD))
ifeq ($(words $(board_dir)),0)
$(error Unable to find BSP for $(BOARD), expected to find either "bsp/$(BOARD)" or "bsp-addons/$(BOARD)")
endif
@@ -151,7 +154,7 @@ endif
#############################################################
ifeq ($(BSP),mee)
MEE_SOURCE_PATH ?= freedom-mee
-MEE_BSP_PATH = bsp/$(BOARD)
+MEE_BSP_PATH = $(BOARD_ROOT)/bsp/$(BOARD)
MEE_LDSCRIPT = $(MEE_BSP_PATH)/mee.lds
MEE_HEADER = $(MEE_BSP_PATH)/mee.h
@@ -218,8 +221,8 @@ clean: clean-elf2hex
#############################################################
# This Section is for Software Compilation
#############################################################
-PROGRAM_ELF = software/$(PROGRAM)/$(PROGRAM)
-PROGRAM_HEX = software/$(PROGRAM)/$(PROGRAM).hex
+PROGRAM_ELF = $(PROGRAM_ROOT)/software/$(PROGRAM)/$(PROGRAM)
+PROGRAM_HEX = $(PROGRAM_ROOT)/software/$(PROGRAM)/$(PROGRAM).hex
ifeq ($(BSP),mee)
.PHONY: software
@@ -230,7 +233,7 @@ software: $(PROGRAM_HEX)
endif
$(PROGRAM_ELF): \
- $(addprefix software/$(PROGRAM)/,$(shell git -C software/$(PROGRAM) ls-files)) \
+ $(addprefix $(PROGRAM_ROOT)/software/$(PROGRAM)/,$(shell git -C $(PROGRAM_ROOT)/software/$(PROGRAM) ls-files)) \
$(MEE_BSP_PATH)/install/lib/libmee.a \
$(MEE_BSP_PATH)/install/lib/libmee-gloss.a \
$(MEE_BSP_PATH)/mee.lds
diff --git a/bsp/coreip-e31-arty/mee.h b/bsp/coreip-e31-arty/mee.h
index 0c1a366..b482d73 100644
--- a/bsp/coreip-e31-arty/mee.h
+++ b/bsp/coreip-e31-arty/mee.h
@@ -172,6 +172,7 @@ struct __mee_driver_riscv_clint0 __mee_dt_clint_2000000 = {
struct __mee_driver_sifive_local_external_interrupts0 __mee_dt_local_external_interrupts_0 = {
.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0,
.irc.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0.local0_vtable,
+ .init_done = 0,
/* From interrupt_controller */
.interrupt_parent = &__mee_dt_interrupt_controller.controller,
.num_interrupts = MEE_MAX_LOCAL_EXT_INTERRUPTS,
@@ -222,6 +223,7 @@ struct __mee_driver_riscv_plic0 __mee_dt_interrupt_controller_c000000 = {
struct __mee_driver_sifive_global_external_interrupts0 __mee_dt_global_external_interrupts = {
.vtable = &__mee_driver_vtable_sifive_global_external_interrupts0,
.irc.vtable = &__mee_driver_vtable_sifive_global_external_interrupts0.global0_vtable,
+ .init_done = 0,
/* From interrupt_controller@c000000 */
.interrupt_parent = &__mee_dt_interrupt_controller_c000000.plic0,
.num_interrupts = MEE_MAX_GLOBAL_EXT_INTERRUPTS,
@@ -280,6 +282,7 @@ struct __mee_driver_sifive_uart0 __mee_dt_serial_20000000 = {
/* From led@0red */
struct __mee_driver_sifive_gpio_led __mee_dt_led_0red = {
.vtable = &__mee_driver_vtable_sifive_led,
+ .led.vtable = &__mee_driver_vtable_sifive_led.led_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 0UL,
@@ -289,6 +292,7 @@ struct __mee_driver_sifive_gpio_led __mee_dt_led_0red = {
/* From led@0green */
struct __mee_driver_sifive_gpio_led __mee_dt_led_0green = {
.vtable = &__mee_driver_vtable_sifive_led,
+ .led.vtable = &__mee_driver_vtable_sifive_led.led_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 1UL,
@@ -298,6 +302,7 @@ struct __mee_driver_sifive_gpio_led __mee_dt_led_0green = {
/* From led@0blue */
struct __mee_driver_sifive_gpio_led __mee_dt_led_0blue = {
.vtable = &__mee_driver_vtable_sifive_led,
+ .led.vtable = &__mee_driver_vtable_sifive_led.led_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 2UL,
@@ -307,6 +312,7 @@ struct __mee_driver_sifive_gpio_led __mee_dt_led_0blue = {
/* From button@0 */
struct __mee_driver_sifive_gpio_button __mee_dt_button_0 = {
.vtable = &__mee_driver_vtable_sifive_button,
+ .button.vtable = &__mee_driver_vtable_sifive_button.button_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 4UL,
@@ -319,6 +325,7 @@ struct __mee_driver_sifive_gpio_button __mee_dt_button_0 = {
/* From button@1 */
struct __mee_driver_sifive_gpio_button __mee_dt_button_1 = {
.vtable = &__mee_driver_vtable_sifive_button,
+ .button.vtable = &__mee_driver_vtable_sifive_button.button_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 5UL,
@@ -331,6 +338,7 @@ struct __mee_driver_sifive_gpio_button __mee_dt_button_1 = {
/* From button@2 */
struct __mee_driver_sifive_gpio_button __mee_dt_button_2 = {
.vtable = &__mee_driver_vtable_sifive_button,
+ .button.vtable = &__mee_driver_vtable_sifive_button.button_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 6UL,
@@ -343,6 +351,7 @@ struct __mee_driver_sifive_gpio_button __mee_dt_button_2 = {
/* From button@3 */
struct __mee_driver_sifive_gpio_button __mee_dt_button_3 = {
.vtable = &__mee_driver_vtable_sifive_button,
+ .button.vtable = &__mee_driver_vtable_sifive_button.button_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 7UL,
@@ -355,6 +364,7 @@ struct __mee_driver_sifive_gpio_button __mee_dt_button_3 = {
/* From switch@0 */
struct __mee_driver_sifive_gpio_switch __mee_dt_switch_0 = {
.vtable = &__mee_driver_vtable_sifive_switch,
+ .flip.vtable = &__mee_driver_vtable_sifive_switch.switch_vtable,
/* From global_external_interrupts */
.interrupt_parent = &__mee_dt_global_external_interrupts.irc,
.interrupt_line = 0UL,
@@ -364,6 +374,7 @@ struct __mee_driver_sifive_gpio_switch __mee_dt_switch_0 = {
/* From switch@1 */
struct __mee_driver_sifive_gpio_switch __mee_dt_switch_1 = {
.vtable = &__mee_driver_vtable_sifive_switch,
+ .flip.vtable = &__mee_driver_vtable_sifive_switch.switch_vtable,
/* From global_external_interrupts */
.interrupt_parent = &__mee_dt_global_external_interrupts.irc,
.interrupt_line = 1UL,
@@ -373,6 +384,7 @@ struct __mee_driver_sifive_gpio_switch __mee_dt_switch_1 = {
/* From switch@2 */
struct __mee_driver_sifive_gpio_switch __mee_dt_switch_2 = {
.vtable = &__mee_driver_vtable_sifive_switch,
+ .flip.vtable = &__mee_driver_vtable_sifive_switch.switch_vtable,
/* From global_external_interrupts */
.interrupt_parent = &__mee_dt_global_external_interrupts.irc,
.interrupt_line = 2UL,
@@ -382,6 +394,7 @@ struct __mee_driver_sifive_gpio_switch __mee_dt_switch_2 = {
/* From switch@3 */
struct __mee_driver_sifive_gpio_switch __mee_dt_switch_3 = {
.vtable = &__mee_driver_vtable_sifive_switch,
+ .flip.vtable = &__mee_driver_vtable_sifive_switch.switch_vtable,
/* From local_external_interrupts_0 */
.interrupt_parent = &__mee_dt_local_external_interrupts_0.irc,
.interrupt_line = 3UL,
diff --git a/bsp/coreip-e31/mee.h b/bsp/coreip-e31/mee.h
index b261a48..421f6c6 100644
--- a/bsp/coreip-e31/mee.h
+++ b/bsp/coreip-e31/mee.h
@@ -97,6 +97,7 @@ struct __mee_driver_riscv_clint0 __mee_dt_clint_2000000 = {
struct __mee_driver_sifive_local_external_interrupts0 __mee_dt_local_external_interrupts_0 = {
.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0,
.irc.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0.local0_vtable,
+ .init_done = 0,
/* From interrupt_controller */
.interrupt_parent = &__mee_dt_interrupt_controller.controller,
.num_interrupts = MEE_MAX_LOCAL_EXT_INTERRUPTS,
@@ -147,6 +148,7 @@ struct __mee_driver_riscv_plic0 __mee_dt_interrupt_controller_c000000 = {
struct __mee_driver_sifive_global_external_interrupts0 __mee_dt_global_external_interrupts = {
.vtable = &__mee_driver_vtable_sifive_global_external_interrupts0,
.irc.vtable = &__mee_driver_vtable_sifive_global_external_interrupts0.global0_vtable,
+ .init_done = 0,
/* From interrupt_controller@c000000 */
.interrupt_parent = &__mee_dt_interrupt_controller_c000000.plic0,
.num_interrupts = MEE_MAX_GLOBAL_EXT_INTERRUPTS,
diff --git a/bsp/coreip-s51-arty/mee.h b/bsp/coreip-s51-arty/mee.h
index 1042cfe..c87f9a6 100644
--- a/bsp/coreip-s51-arty/mee.h
+++ b/bsp/coreip-s51-arty/mee.h
@@ -172,6 +172,7 @@ struct __mee_driver_riscv_clint0 __mee_dt_clint_2000000 = {
struct __mee_driver_sifive_local_external_interrupts0 __mee_dt_local_external_interrupts_0 = {
.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0,
.irc.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0.local0_vtable,
+ .init_done = 0,
/* From interrupt_controller */
.interrupt_parent = &__mee_dt_interrupt_controller.controller,
.num_interrupts = MEE_MAX_LOCAL_EXT_INTERRUPTS,
@@ -222,6 +223,7 @@ struct __mee_driver_riscv_plic0 __mee_dt_interrupt_controller_c000000 = {
struct __mee_driver_sifive_global_external_interrupts0 __mee_dt_global_external_interrupts = {
.vtable = &__mee_driver_vtable_sifive_global_external_interrupts0,
.irc.vtable = &__mee_driver_vtable_sifive_global_external_interrupts0.global0_vtable,
+ .init_done = 0,
/* From interrupt_controller@c000000 */
.interrupt_parent = &__mee_dt_interrupt_controller_c000000.plic0,
.num_interrupts = MEE_MAX_GLOBAL_EXT_INTERRUPTS,
@@ -280,6 +282,7 @@ struct __mee_driver_sifive_uart0 __mee_dt_serial_20000000 = {
/* From led@0red */
struct __mee_driver_sifive_gpio_led __mee_dt_led_0red = {
.vtable = &__mee_driver_vtable_sifive_led,
+ .led.vtable = &__mee_driver_vtable_sifive_led.led_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 0UL,
@@ -289,6 +292,7 @@ struct __mee_driver_sifive_gpio_led __mee_dt_led_0red = {
/* From led@0green */
struct __mee_driver_sifive_gpio_led __mee_dt_led_0green = {
.vtable = &__mee_driver_vtable_sifive_led,
+ .led.vtable = &__mee_driver_vtable_sifive_led.led_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 1UL,
@@ -298,6 +302,7 @@ struct __mee_driver_sifive_gpio_led __mee_dt_led_0green = {
/* From led@0blue */
struct __mee_driver_sifive_gpio_led __mee_dt_led_0blue = {
.vtable = &__mee_driver_vtable_sifive_led,
+ .led.vtable = &__mee_driver_vtable_sifive_led.led_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 2UL,
@@ -307,6 +312,7 @@ struct __mee_driver_sifive_gpio_led __mee_dt_led_0blue = {
/* From button@0 */
struct __mee_driver_sifive_gpio_button __mee_dt_button_0 = {
.vtable = &__mee_driver_vtable_sifive_button,
+ .button.vtable = &__mee_driver_vtable_sifive_button.button_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 4UL,
@@ -319,6 +325,7 @@ struct __mee_driver_sifive_gpio_button __mee_dt_button_0 = {
/* From button@1 */
struct __mee_driver_sifive_gpio_button __mee_dt_button_1 = {
.vtable = &__mee_driver_vtable_sifive_button,
+ .button.vtable = &__mee_driver_vtable_sifive_button.button_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 5UL,
@@ -331,6 +338,7 @@ struct __mee_driver_sifive_gpio_button __mee_dt_button_1 = {
/* From button@2 */
struct __mee_driver_sifive_gpio_button __mee_dt_button_2 = {
.vtable = &__mee_driver_vtable_sifive_button,
+ .button.vtable = &__mee_driver_vtable_sifive_button.button_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 6UL,
@@ -343,6 +351,7 @@ struct __mee_driver_sifive_gpio_button __mee_dt_button_2 = {
/* From button@3 */
struct __mee_driver_sifive_gpio_button __mee_dt_button_3 = {
.vtable = &__mee_driver_vtable_sifive_button,
+ .button.vtable = &__mee_driver_vtable_sifive_button.button_vtable,
/* From gpio@20002000 */
.gpio = &__mee_dt_gpio_20002000,
.pin = 7UL,
@@ -355,6 +364,7 @@ struct __mee_driver_sifive_gpio_button __mee_dt_button_3 = {
/* From switch@0 */
struct __mee_driver_sifive_gpio_switch __mee_dt_switch_0 = {
.vtable = &__mee_driver_vtable_sifive_switch,
+ .flip.vtable = &__mee_driver_vtable_sifive_switch.switch_vtable,
/* From global_external_interrupts */
.interrupt_parent = &__mee_dt_global_external_interrupts.irc,
.interrupt_line = 0UL,
@@ -364,6 +374,7 @@ struct __mee_driver_sifive_gpio_switch __mee_dt_switch_0 = {
/* From switch@1 */
struct __mee_driver_sifive_gpio_switch __mee_dt_switch_1 = {
.vtable = &__mee_driver_vtable_sifive_switch,
+ .flip.vtable = &__mee_driver_vtable_sifive_switch.switch_vtable,
/* From global_external_interrupts */
.interrupt_parent = &__mee_dt_global_external_interrupts.irc,
.interrupt_line = 1UL,
@@ -373,6 +384,7 @@ struct __mee_driver_sifive_gpio_switch __mee_dt_switch_1 = {
/* From switch@2 */
struct __mee_driver_sifive_gpio_switch __mee_dt_switch_2 = {
.vtable = &__mee_driver_vtable_sifive_switch,
+ .flip.vtable = &__mee_driver_vtable_sifive_switch.switch_vtable,
/* From global_external_interrupts */
.interrupt_parent = &__mee_dt_global_external_interrupts.irc,
.interrupt_line = 2UL,
@@ -382,6 +394,7 @@ struct __mee_driver_sifive_gpio_switch __mee_dt_switch_2 = {
/* From switch@3 */
struct __mee_driver_sifive_gpio_switch __mee_dt_switch_3 = {
.vtable = &__mee_driver_vtable_sifive_switch,
+ .flip.vtable = &__mee_driver_vtable_sifive_switch.switch_vtable,
/* From local_external_interrupts_0 */
.interrupt_parent = &__mee_dt_local_external_interrupts_0.irc,
.interrupt_line = 3UL,
diff --git a/bsp/coreip-s51/mee.h b/bsp/coreip-s51/mee.h
index c650aad..3e0f535 100644
--- a/bsp/coreip-s51/mee.h
+++ b/bsp/coreip-s51/mee.h
@@ -97,6 +97,7 @@ struct __mee_driver_riscv_clint0 __mee_dt_clint_2000000 = {
struct __mee_driver_sifive_local_external_interrupts0 __mee_dt_local_external_interrupts_0 = {
.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0,
.irc.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0.local0_vtable,
+ .init_done = 0,
/* From interrupt_controller */
.interrupt_parent = &__mee_dt_interrupt_controller.controller,
.num_interrupts = MEE_MAX_LOCAL_EXT_INTERRUPTS,
@@ -147,6 +148,7 @@ struct __mee_driver_riscv_plic0 __mee_dt_interrupt_controller_c000000 = {
struct __mee_driver_sifive_global_external_interrupts0 __mee_dt_global_external_interrupts = {
.vtable = &__mee_driver_vtable_sifive_global_external_interrupts0,
.irc.vtable = &__mee_driver_vtable_sifive_global_external_interrupts0.global0_vtable,
+ .init_done = 0,
/* From interrupt_controller@c000000 */
.interrupt_parent = &__mee_dt_interrupt_controller_c000000.plic0,
.num_interrupts = MEE_MAX_GLOBAL_EXT_INTERRUPTS,
diff --git a/bsp/freedom-e310-arty/mee.h b/bsp/freedom-e310-arty/mee.h
index b97bd23..45da0e8 100644
--- a/bsp/freedom-e310-arty/mee.h
+++ b/bsp/freedom-e310-arty/mee.h
@@ -112,6 +112,7 @@ struct __mee_driver_riscv_clint0 __mee_dt_clint_2000000 = {
struct __mee_driver_sifive_local_external_interrupts0 __mee_dt_local_external_interrupts_0 = {
.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0,
.irc.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0.local0_vtable,
+ .init_done = 0,
/* From interrupt_controller */
.interrupt_parent = &__mee_dt_interrupt_controller.controller,
.num_interrupts = MEE_MAX_LOCAL_EXT_INTERRUPTS,
diff --git a/bsp/sifive-hifive1/mee.h b/bsp/sifive-hifive1/mee.h
index 87d90ad..28868b5 100644
--- a/bsp/sifive-hifive1/mee.h
+++ b/bsp/sifive-hifive1/mee.h
@@ -154,6 +154,7 @@ struct __mee_driver_riscv_clint0 __mee_dt_clint_2000000 = {
struct __mee_driver_sifive_local_external_interrupts0 __mee_dt_local_external_interrupts_0 = {
.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0,
.irc.vtable = &__mee_driver_vtable_sifive_local_external_interrupts0.local0_vtable,
+ .init_done = 0,
/* From interrupt_controller */
.interrupt_parent = &__mee_dt_interrupt_controller.controller,
.num_interrupts = MEE_MAX_LOCAL_EXT_INTERRUPTS,
diff --git a/freedom-mee b/freedom-mee
-Subproject 4cb6abd908c9b1a1466ce9f5288d96ac9189828
+Subproject fdb41ae7f9c2bbae0b912b31aec3f9626e6cd76
diff --git a/software/local-interrupt b/software/local-interrupt
new file mode 160000
+Subproject 9aba96b134311137c38e0e6f4e028076cee7c6c