summaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-08-05 02:52:42 +0200
committerUros Majstorovic <majstor@majstor.org>2020-08-05 02:52:42 +0200
commit0894a1e7664504312a9cdfc826eef89030aaaa1b (patch)
tree51e37e46d7862437583dbe02e6ebf03997a664be /code
parentdff71bc297b744856e303ad9a175de92c9acae0d (diff)
new directory sructure for fe310 fw
Diffstat (limited to 'code')
-rw-r--r--code/fe310/Makefile2
-rw-r--r--code/fe310/bsp/default.lds (renamed from code/fe310/default.lds)0
-rw-r--r--code/fe310/bsp/drivers/Makefile (renamed from code/fe310/drivers/Makefile)2
-rw-r--r--code/fe310/bsp/drivers/plic_driver.c (renamed from code/fe310/drivers/plic_driver.c)0
-rw-r--r--code/fe310/bsp/drivers/plic_driver.h (renamed from code/fe310/drivers/plic_driver.h)0
-rw-r--r--code/fe310/bsp/drivers/prci_driver.c (renamed from code/fe310/drivers/prci_driver.c)0
-rw-r--r--code/fe310/bsp/drivers/prci_driver.h (renamed from code/fe310/drivers/prci_driver.h)0
-rw-r--r--code/fe310/bsp/gloss/Makefile (renamed from code/fe310/gloss/Makefile)2
-rw-r--r--code/fe310/bsp/gloss/crt0.S (renamed from code/fe310/gloss/crt0.S)0
-rw-r--r--code/fe310/bsp/gloss/sys_access.c (renamed from code/fe310/gloss/sys_access.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_chdir.c (renamed from code/fe310/gloss/sys_chdir.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_chmod.c (renamed from code/fe310/gloss/sys_chmod.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_chown.c (renamed from code/fe310/gloss/sys_chown.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_close.c (renamed from code/fe310/gloss/sys_close.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_execve.c (renamed from code/fe310/gloss/sys_execve.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_exit.c (renamed from code/fe310/gloss/sys_exit.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_faccessat.c (renamed from code/fe310/gloss/sys_faccessat.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_fork.c (renamed from code/fe310/gloss/sys_fork.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_fstat.c (renamed from code/fe310/gloss/sys_fstat.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_fstatat.c (renamed from code/fe310/gloss/sys_fstatat.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_ftime.c (renamed from code/fe310/gloss/sys_ftime.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_getcwd.c (renamed from code/fe310/gloss/sys_getcwd.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_getpid.c (renamed from code/fe310/gloss/sys_getpid.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_isatty.c (renamed from code/fe310/gloss/sys_isatty.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_kill.c (renamed from code/fe310/gloss/sys_kill.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_link.c (renamed from code/fe310/gloss/sys_link.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_lseek.c (renamed from code/fe310/gloss/sys_lseek.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_lstat.c (renamed from code/fe310/gloss/sys_lstat.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_open.c (renamed from code/fe310/gloss/sys_open.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_openat.c (renamed from code/fe310/gloss/sys_openat.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_read.c (renamed from code/fe310/gloss/sys_read.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_sbrk.c (renamed from code/fe310/gloss/sys_sbrk.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_stat.c (renamed from code/fe310/gloss/sys_stat.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_sysconf.c (renamed from code/fe310/gloss/sys_sysconf.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_unlink.c (renamed from code/fe310/gloss/sys_unlink.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_utime.c (renamed from code/fe310/gloss/sys_utime.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_wait.c (renamed from code/fe310/gloss/sys_wait.c)0
-rw-r--r--code/fe310/bsp/gloss/sys_write.c (renamed from code/fe310/gloss/sys_write.c)0
-rw-r--r--code/fe310/bsp/include/encoding.h (renamed from code/fe310/include/encoding.h)0
-rw-r--r--code/fe310/bsp/include/platform.h (renamed from code/fe310/include/platform.h)0
-rw-r--r--code/fe310/bsp/include/sifive/bits.h (renamed from code/fe310/include/sifive/bits.h)0
-rw-r--r--code/fe310/bsp/include/sifive/const.h (renamed from code/fe310/include/sifive/const.h)0
-rw-r--r--code/fe310/bsp/include/sifive/devices/aon.h (renamed from code/fe310/include/sifive/devices/aon.h)0
-rw-r--r--code/fe310/bsp/include/sifive/devices/clint.h (renamed from code/fe310/include/sifive/devices/clint.h)0
-rw-r--r--code/fe310/bsp/include/sifive/devices/gpio.h (renamed from code/fe310/include/sifive/devices/gpio.h)0
-rw-r--r--code/fe310/bsp/include/sifive/devices/otp.h (renamed from code/fe310/include/sifive/devices/otp.h)0
-rw-r--r--code/fe310/bsp/include/sifive/devices/plic.h (renamed from code/fe310/include/sifive/devices/plic.h)0
-rw-r--r--code/fe310/bsp/include/sifive/devices/prci.h (renamed from code/fe310/include/sifive/devices/prci.h)0
-rw-r--r--code/fe310/bsp/include/sifive/devices/pwm.h (renamed from code/fe310/include/sifive/devices/pwm.h)0
-rw-r--r--code/fe310/bsp/include/sifive/devices/spi.h (renamed from code/fe310/include/sifive/devices/spi.h)0
-rw-r--r--code/fe310/bsp/include/sifive/devices/uart.h (renamed from code/fe310/include/sifive/devices/uart.h)0
-rw-r--r--code/fe310/bsp/metal/Makefile (renamed from code/fe310/metal/Makefile)2
-rw-r--r--code/fe310/bsp/metal/entry.S (renamed from code/fe310/metal/entry.S)0
-rw-r--r--code/fe310/bsp/metal/metal.c (renamed from code/fe310/metal/metal.c)0
-rw-r--r--code/fe310/bsp/openocd.cfg (renamed from code/fe310/openocd.cfg)0
-rwxr-xr-xcode/fe310/bsp/upload (renamed from code/fe310/scripts/upload)0
-rw-r--r--code/fe310/common.mk4
-rw-r--r--code/fe310/eos/Makefile2
-rw-r--r--code/fe310/eos/eve/Makefile2
-rw-r--r--code/fe310/eos/eve/screen/Makefile2
-rw-r--r--code/fe310/eos/eve/widget/Makefile2
-rwxr-xr-xcode/fe310/scripts/start.sh5
62 files changed, 11 insertions, 14 deletions
diff --git a/code/fe310/Makefile b/code/fe310/Makefile
index 89ab01b..f1430fb 100644
--- a/code/fe310/Makefile
+++ b/code/fe310/Makefile
@@ -2,7 +2,7 @@ include common.mk
CFLAGS += -I./include
-subdirs = drivers gloss metal eos eos/eve eos/eve/screen eos/eve/widget
+subdirs = bsp/drivers bsp/gloss bsp/metal eos eos/eve eos/eve/screen eos/eve/widget
all: libeos.a
diff --git a/code/fe310/default.lds b/code/fe310/bsp/default.lds
index cabcf01..cabcf01 100644
--- a/code/fe310/default.lds
+++ b/code/fe310/bsp/default.lds
diff --git a/code/fe310/drivers/Makefile b/code/fe310/bsp/drivers/Makefile
index fc5366f..14fed05 100644
--- a/code/fe310/drivers/Makefile
+++ b/code/fe310/bsp/drivers/Makefile
@@ -1,4 +1,4 @@
-include ../common.mk
+include ../../common.mk
CFLAGS += -I../include -include sys/cdefs.h
%.o: %.c
diff --git a/code/fe310/drivers/plic_driver.c b/code/fe310/bsp/drivers/plic_driver.c
index 27b9d2c..27b9d2c 100644
--- a/code/fe310/drivers/plic_driver.c
+++ b/code/fe310/bsp/drivers/plic_driver.c
diff --git a/code/fe310/drivers/plic_driver.h b/code/fe310/bsp/drivers/plic_driver.h
index 98b2bdd..98b2bdd 100644
--- a/code/fe310/drivers/plic_driver.h
+++ b/code/fe310/bsp/drivers/plic_driver.h
diff --git a/code/fe310/drivers/prci_driver.c b/code/fe310/bsp/drivers/prci_driver.c
index c2df2c9..c2df2c9 100644
--- a/code/fe310/drivers/prci_driver.c
+++ b/code/fe310/bsp/drivers/prci_driver.c
diff --git a/code/fe310/drivers/prci_driver.h b/code/fe310/bsp/drivers/prci_driver.h
index 14e1370..14e1370 100644
--- a/code/fe310/drivers/prci_driver.h
+++ b/code/fe310/bsp/drivers/prci_driver.h
diff --git a/code/fe310/gloss/Makefile b/code/fe310/bsp/gloss/Makefile
index a937a53..4376dce 100644
--- a/code/fe310/gloss/Makefile
+++ b/code/fe310/bsp/gloss/Makefile
@@ -1,4 +1,4 @@
-include ../common.mk
+include ../../common.mk
CFLAGS += -I../include
src = sys_access.c sys_chdir.c sys_chmod.c sys_chown.c sys_close.c sys_execve.c sys_exit.c sys_faccessat.c sys_fork.c sys_fstat.c sys_fstatat.c sys_ftime.c sys_getcwd.c sys_getpid.c \
diff --git a/code/fe310/gloss/crt0.S b/code/fe310/bsp/gloss/crt0.S
index 920ee4b..920ee4b 100644
--- a/code/fe310/gloss/crt0.S
+++ b/code/fe310/bsp/gloss/crt0.S
diff --git a/code/fe310/gloss/sys_access.c b/code/fe310/bsp/gloss/sys_access.c
index c0bc153..c0bc153 100644
--- a/code/fe310/gloss/sys_access.c
+++ b/code/fe310/bsp/gloss/sys_access.c
diff --git a/code/fe310/gloss/sys_chdir.c b/code/fe310/bsp/gloss/sys_chdir.c
index f33d26a..f33d26a 100644
--- a/code/fe310/gloss/sys_chdir.c
+++ b/code/fe310/bsp/gloss/sys_chdir.c
diff --git a/code/fe310/gloss/sys_chmod.c b/code/fe310/bsp/gloss/sys_chmod.c
index 67412bf..67412bf 100644
--- a/code/fe310/gloss/sys_chmod.c
+++ b/code/fe310/bsp/gloss/sys_chmod.c
diff --git a/code/fe310/gloss/sys_chown.c b/code/fe310/bsp/gloss/sys_chown.c
index 302952e..302952e 100644
--- a/code/fe310/gloss/sys_chown.c
+++ b/code/fe310/bsp/gloss/sys_chown.c
diff --git a/code/fe310/gloss/sys_close.c b/code/fe310/bsp/gloss/sys_close.c
index 26dd6a5..26dd6a5 100644
--- a/code/fe310/gloss/sys_close.c
+++ b/code/fe310/bsp/gloss/sys_close.c
diff --git a/code/fe310/gloss/sys_execve.c b/code/fe310/bsp/gloss/sys_execve.c
index 9ae9f7e..9ae9f7e 100644
--- a/code/fe310/gloss/sys_execve.c
+++ b/code/fe310/bsp/gloss/sys_execve.c
diff --git a/code/fe310/gloss/sys_exit.c b/code/fe310/bsp/gloss/sys_exit.c
index 1502b3e..1502b3e 100644
--- a/code/fe310/gloss/sys_exit.c
+++ b/code/fe310/bsp/gloss/sys_exit.c
diff --git a/code/fe310/gloss/sys_faccessat.c b/code/fe310/bsp/gloss/sys_faccessat.c
index 873d52c..873d52c 100644
--- a/code/fe310/gloss/sys_faccessat.c
+++ b/code/fe310/bsp/gloss/sys_faccessat.c
diff --git a/code/fe310/gloss/sys_fork.c b/code/fe310/bsp/gloss/sys_fork.c
index 64e6756..64e6756 100644
--- a/code/fe310/gloss/sys_fork.c
+++ b/code/fe310/bsp/gloss/sys_fork.c
diff --git a/code/fe310/gloss/sys_fstat.c b/code/fe310/bsp/gloss/sys_fstat.c
index fedc289..fedc289 100644
--- a/code/fe310/gloss/sys_fstat.c
+++ b/code/fe310/bsp/gloss/sys_fstat.c
diff --git a/code/fe310/gloss/sys_fstatat.c b/code/fe310/bsp/gloss/sys_fstatat.c
index f2f43bd..f2f43bd 100644
--- a/code/fe310/gloss/sys_fstatat.c
+++ b/code/fe310/bsp/gloss/sys_fstatat.c
diff --git a/code/fe310/gloss/sys_ftime.c b/code/fe310/bsp/gloss/sys_ftime.c
index 65c1563..65c1563 100644
--- a/code/fe310/gloss/sys_ftime.c
+++ b/code/fe310/bsp/gloss/sys_ftime.c
diff --git a/code/fe310/gloss/sys_getcwd.c b/code/fe310/bsp/gloss/sys_getcwd.c
index 82e8404..82e8404 100644
--- a/code/fe310/gloss/sys_getcwd.c
+++ b/code/fe310/bsp/gloss/sys_getcwd.c
diff --git a/code/fe310/gloss/sys_getpid.c b/code/fe310/bsp/gloss/sys_getpid.c
index 589ad11..589ad11 100644
--- a/code/fe310/gloss/sys_getpid.c
+++ b/code/fe310/bsp/gloss/sys_getpid.c
diff --git a/code/fe310/gloss/sys_isatty.c b/code/fe310/bsp/gloss/sys_isatty.c
index 70aec43..70aec43 100644
--- a/code/fe310/gloss/sys_isatty.c
+++ b/code/fe310/bsp/gloss/sys_isatty.c
diff --git a/code/fe310/gloss/sys_kill.c b/code/fe310/bsp/gloss/sys_kill.c
index 9003f26..9003f26 100644
--- a/code/fe310/gloss/sys_kill.c
+++ b/code/fe310/bsp/gloss/sys_kill.c
diff --git a/code/fe310/gloss/sys_link.c b/code/fe310/bsp/gloss/sys_link.c
index 40d5912..40d5912 100644
--- a/code/fe310/gloss/sys_link.c
+++ b/code/fe310/bsp/gloss/sys_link.c
diff --git a/code/fe310/gloss/sys_lseek.c b/code/fe310/bsp/gloss/sys_lseek.c
index d28a781..d28a781 100644
--- a/code/fe310/gloss/sys_lseek.c
+++ b/code/fe310/bsp/gloss/sys_lseek.c
diff --git a/code/fe310/gloss/sys_lstat.c b/code/fe310/bsp/gloss/sys_lstat.c
index 97a4585..97a4585 100644
--- a/code/fe310/gloss/sys_lstat.c
+++ b/code/fe310/bsp/gloss/sys_lstat.c
diff --git a/code/fe310/gloss/sys_open.c b/code/fe310/bsp/gloss/sys_open.c
index a59f627..a59f627 100644
--- a/code/fe310/gloss/sys_open.c
+++ b/code/fe310/bsp/gloss/sys_open.c
diff --git a/code/fe310/gloss/sys_openat.c b/code/fe310/bsp/gloss/sys_openat.c
index 206de3b..206de3b 100644
--- a/code/fe310/gloss/sys_openat.c
+++ b/code/fe310/bsp/gloss/sys_openat.c
diff --git a/code/fe310/gloss/sys_read.c b/code/fe310/bsp/gloss/sys_read.c
index 1857fc6..1857fc6 100644
--- a/code/fe310/gloss/sys_read.c
+++ b/code/fe310/bsp/gloss/sys_read.c
diff --git a/code/fe310/gloss/sys_sbrk.c b/code/fe310/bsp/gloss/sys_sbrk.c
index ce10c90..ce10c90 100644
--- a/code/fe310/gloss/sys_sbrk.c
+++ b/code/fe310/bsp/gloss/sys_sbrk.c
diff --git a/code/fe310/gloss/sys_stat.c b/code/fe310/bsp/gloss/sys_stat.c
index 3c2e419..3c2e419 100644
--- a/code/fe310/gloss/sys_stat.c
+++ b/code/fe310/bsp/gloss/sys_stat.c
diff --git a/code/fe310/gloss/sys_sysconf.c b/code/fe310/bsp/gloss/sys_sysconf.c
index 452a252..452a252 100644
--- a/code/fe310/gloss/sys_sysconf.c
+++ b/code/fe310/bsp/gloss/sys_sysconf.c
diff --git a/code/fe310/gloss/sys_unlink.c b/code/fe310/bsp/gloss/sys_unlink.c
index b369d20..b369d20 100644
--- a/code/fe310/gloss/sys_unlink.c
+++ b/code/fe310/bsp/gloss/sys_unlink.c
diff --git a/code/fe310/gloss/sys_utime.c b/code/fe310/bsp/gloss/sys_utime.c
index 33d557a..33d557a 100644
--- a/code/fe310/gloss/sys_utime.c
+++ b/code/fe310/bsp/gloss/sys_utime.c
diff --git a/code/fe310/gloss/sys_wait.c b/code/fe310/bsp/gloss/sys_wait.c
index 9d459f1..9d459f1 100644
--- a/code/fe310/gloss/sys_wait.c
+++ b/code/fe310/bsp/gloss/sys_wait.c
diff --git a/code/fe310/gloss/sys_write.c b/code/fe310/bsp/gloss/sys_write.c
index 2095940..2095940 100644
--- a/code/fe310/gloss/sys_write.c
+++ b/code/fe310/bsp/gloss/sys_write.c
diff --git a/code/fe310/include/encoding.h b/code/fe310/bsp/include/encoding.h
index 35e0f9f..35e0f9f 100644
--- a/code/fe310/include/encoding.h
+++ b/code/fe310/bsp/include/encoding.h
diff --git a/code/fe310/include/platform.h b/code/fe310/bsp/include/platform.h
index 5178d86..5178d86 100644
--- a/code/fe310/include/platform.h
+++ b/code/fe310/bsp/include/platform.h
diff --git a/code/fe310/include/sifive/bits.h b/code/fe310/bsp/include/sifive/bits.h
index bfe656f..bfe656f 100644
--- a/code/fe310/include/sifive/bits.h
+++ b/code/fe310/bsp/include/sifive/bits.h
diff --git a/code/fe310/include/sifive/const.h b/code/fe310/bsp/include/sifive/const.h
index 8dcffbb..8dcffbb 100644
--- a/code/fe310/include/sifive/const.h
+++ b/code/fe310/bsp/include/sifive/const.h
diff --git a/code/fe310/include/sifive/devices/aon.h b/code/fe310/bsp/include/sifive/devices/aon.h
index 63f1db3..63f1db3 100644
--- a/code/fe310/include/sifive/devices/aon.h
+++ b/code/fe310/bsp/include/sifive/devices/aon.h
diff --git a/code/fe310/include/sifive/devices/clint.h b/code/fe310/bsp/include/sifive/devices/clint.h
index cd3e0c7..cd3e0c7 100644
--- a/code/fe310/include/sifive/devices/clint.h
+++ b/code/fe310/bsp/include/sifive/devices/clint.h
diff --git a/code/fe310/include/sifive/devices/gpio.h b/code/fe310/bsp/include/sifive/devices/gpio.h
index f7f0acb..f7f0acb 100644
--- a/code/fe310/include/sifive/devices/gpio.h
+++ b/code/fe310/bsp/include/sifive/devices/gpio.h
diff --git a/code/fe310/include/sifive/devices/otp.h b/code/fe310/bsp/include/sifive/devices/otp.h
index 93833e2..93833e2 100644
--- a/code/fe310/include/sifive/devices/otp.h
+++ b/code/fe310/bsp/include/sifive/devices/otp.h
diff --git a/code/fe310/include/sifive/devices/plic.h b/code/fe310/bsp/include/sifive/devices/plic.h
index e1ca5d6..e1ca5d6 100644
--- a/code/fe310/include/sifive/devices/plic.h
+++ b/code/fe310/bsp/include/sifive/devices/plic.h
diff --git a/code/fe310/include/sifive/devices/prci.h b/code/fe310/bsp/include/sifive/devices/prci.h
index 1a3de58..1a3de58 100644
--- a/code/fe310/include/sifive/devices/prci.h
+++ b/code/fe310/bsp/include/sifive/devices/prci.h
diff --git a/code/fe310/include/sifive/devices/pwm.h b/code/fe310/bsp/include/sifive/devices/pwm.h
index 067889a..067889a 100644
--- a/code/fe310/include/sifive/devices/pwm.h
+++ b/code/fe310/bsp/include/sifive/devices/pwm.h
diff --git a/code/fe310/include/sifive/devices/spi.h b/code/fe310/bsp/include/sifive/devices/spi.h
index 47b4693..47b4693 100644
--- a/code/fe310/include/sifive/devices/spi.h
+++ b/code/fe310/bsp/include/sifive/devices/spi.h
diff --git a/code/fe310/include/sifive/devices/uart.h b/code/fe310/bsp/include/sifive/devices/uart.h
index 71bea6f..71bea6f 100644
--- a/code/fe310/include/sifive/devices/uart.h
+++ b/code/fe310/bsp/include/sifive/devices/uart.h
diff --git a/code/fe310/metal/Makefile b/code/fe310/bsp/metal/Makefile
index f4d0992..32acfd2 100644
--- a/code/fe310/metal/Makefile
+++ b/code/fe310/bsp/metal/Makefile
@@ -1,4 +1,4 @@
-include ../common.mk
+include ../../common.mk
CFLAGS += -I../include -I../drivers
%.o: %.c
diff --git a/code/fe310/metal/entry.S b/code/fe310/bsp/metal/entry.S
index 97da3fd..97da3fd 100644
--- a/code/fe310/metal/entry.S
+++ b/code/fe310/bsp/metal/entry.S
diff --git a/code/fe310/metal/metal.c b/code/fe310/bsp/metal/metal.c
index 00849b9..00849b9 100644
--- a/code/fe310/metal/metal.c
+++ b/code/fe310/bsp/metal/metal.c
diff --git a/code/fe310/openocd.cfg b/code/fe310/bsp/openocd.cfg
index 1205cbd..1205cbd 100644
--- a/code/fe310/openocd.cfg
+++ b/code/fe310/bsp/openocd.cfg
diff --git a/code/fe310/scripts/upload b/code/fe310/bsp/upload
index a52fc0a..a52fc0a 100755
--- a/code/fe310/scripts/upload
+++ b/code/fe310/bsp/upload
diff --git a/code/fe310/common.mk b/code/fe310/common.mk
index d9e3746..e468289 100644
--- a/code/fe310/common.mk
+++ b/code/fe310/common.mk
@@ -3,4 +3,6 @@ AR = $(RISCV_HOME)/bin/riscv64-unknown-elf-ar
RANLIB = $(RISCV_HOME)/bin/riscv64-unknown-elf-ranlib
CFLAGS = -march=rv32imac -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections --specs=nano.specs -O3
-LDFLAGS = $(CFLAGS) -L$(FE310_HOME) -Wl,--gc-sections -nostartfiles -nostdlib -Wl,--start-group -lc -lm -lgcc -leos -Wl,--end-group -T$(FE310_HOME)/default.lds
+LDFLAGS = $(CFLAGS) -L$(FE310_HOME) -Wl,--gc-sections -nostartfiles -nostdlib -Wl,--start-group -lc -lm -lgcc -leos -Wl,--end-group -T$(FE310_HOME)/bsp/default.lds
+
+UPARGS = --openocd $(RISCV_OPENOCD_HOME)/bin/openocd --gdb $(RISCV_HOME)/bin/riscv64-unknown-elf-gdb --openocd-config $(FE310_HOME)/bsp/openocd.cfg
diff --git a/code/fe310/eos/Makefile b/code/fe310/eos/Makefile
index 71465a4..301a30e 100644
--- a/code/fe310/eos/Makefile
+++ b/code/fe310/eos/Makefile
@@ -1,6 +1,6 @@
include ../common.mk
-CFLAGS += -I../include -I../drivers
+CFLAGS += -I../bsp/include -I../bsp/drivers
obj = trap_entry.o eos.o msgq.o event.o interrupt.o timer.o power.o i2s.o uart.o spi.o spi_dev.o net.o wifi.o cell.o sock.o unicode.o
diff --git a/code/fe310/eos/eve/Makefile b/code/fe310/eos/eve/Makefile
index 0a737cc..d700b30 100644
--- a/code/fe310/eos/eve/Makefile
+++ b/code/fe310/eos/eve/Makefile
@@ -1,6 +1,6 @@
include ../../common.mk
-CFLAGS += -I.. -I../../include
+CFLAGS += -I.. -I../../bsp/include
obj = eve.o eve_touch.o eve_track.o eve_kbd.o eve_text.o eve_platform.o
diff --git a/code/fe310/eos/eve/screen/Makefile b/code/fe310/eos/eve/screen/Makefile
index f6115df..b6cb393 100644
--- a/code/fe310/eos/eve/screen/Makefile
+++ b/code/fe310/eos/eve/screen/Makefile
@@ -1,6 +1,6 @@
include ../../../common.mk
-CFLAGS += -I. -I.. -I../..
+CFLAGS += -I.. -I../..
obj = font.o screen.o window.o kbdwin.o page.o form.o
diff --git a/code/fe310/eos/eve/widget/Makefile b/code/fe310/eos/eve/widget/Makefile
index 065cab0..160db72 100644
--- a/code/fe310/eos/eve/widget/Makefile
+++ b/code/fe310/eos/eve/widget/Makefile
@@ -1,6 +1,6 @@
include ../../../common.mk
-CFLAGS += -I. -I.. -I../..
+CFLAGS += -I.. -I../..
obj = clipb.o label.o widget.o pagew.o strw.o textw.o
diff --git a/code/fe310/scripts/start.sh b/code/fe310/scripts/start.sh
deleted file mode 100755
index c5dc990..0000000
--- a/code/fe310/scripts/start.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-export RISCV_HOME=/opt/my/riscv/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-apple-darwin
-export RISCV_OPENOCD_HOME=/opt/my/riscv/riscv-openocd-0.10.0-2019.08.2-x86_64-apple-darwin
-export FE310_HOME=/Volumes/ecp/repo/code/fe310