summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorMegan Wachs <megan@sifive.com>2017-01-11 14:36:30 -0800
committerGitHub <noreply@github.com>2017-01-11 14:36:30 -0800
commit3d19e53e38d0e3f3785f159dd08668ab50e11e5a (patch)
treeb65372a7a157ae0ce68c8740754ba9e33be53478 /bsp
parent57983086991b12a0c8caf707e5f0b810c3a49647 (diff)
parentc7f7bec992d3d6787cf001892a24d0660ce192b1 (diff)
Merge pull request #45 from sifive/double_tap_dontboot
Add the 'bootloader' which ships on HiFive1 Boards.
Diffstat (limited to 'bsp')
-rw-r--r--bsp/env/freedom-e300-arty/init.c3
-rw-r--r--bsp/env/freedom-e300-hifive1/init.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/bsp/env/freedom-e300-arty/init.c b/bsp/env/freedom-e300-arty/init.c
index 35b1104..a6f4b39 100644
--- a/bsp/env/freedom-e300-arty/init.c
+++ b/bsp/env/freedom-e300-arty/init.c
@@ -73,14 +73,15 @@ uintptr_t handle_trap(uintptr_t mcause, uintptr_t epc)
void _init()
{
+ #ifndef NO_INIT
uart_init(115200);
printf("core freq at %d Hz\n", get_cpu_freq());
write_csr(mtvec, &trap_entry);
+ #endif
}
-
void _fini()
{
}
diff --git a/bsp/env/freedom-e300-hifive1/init.c b/bsp/env/freedom-e300-hifive1/init.c
index 71e1659..de046cc 100644
--- a/bsp/env/freedom-e300-hifive1/init.c
+++ b/bsp/env/freedom-e300-hifive1/init.c
@@ -214,9 +214,10 @@ uintptr_t handle_trap(uintptr_t mcause, uintptr_t epc)
return epc;
}
-
void _init()
{
+
+ #ifndef NO_INIT
use_default_clocks();
use_pll(0, 0, 1, 31, 1);
uart_init(115200);
@@ -228,6 +229,8 @@ void _init()
write_csr(mstatus, MSTATUS_FS); // allow FPU instructions without trapping
write_csr(fcsr, 0); // initialize rounding mode, undefined at reset
}
+ #endif
+
}
void _fini()