Added renode board: sifive-hifive-fe310.

+Quicker test
pull/176/head
Daniele Lacamera 2022-02-03 13:42:45 +01:00
parent 402d7b412c
commit 539cc97e73
5 changed files with 58 additions and 35 deletions

View File

@ -25,6 +25,9 @@
#include "hal.h"
#include "wolfboot/wolfboot.h"
/* Change to '1' to enable uart update */
#define UART_UPDATE 0
/* UART API's in hal/hifive1.c */
extern void uart_write(char c);
extern char uart_read(void);
@ -84,6 +87,8 @@ void main(void) {
for (i = 3; i >= 0; i--) {
uart_write(v_array[i]);
}
#if (UART_UPDATE)
while (1) {
r_total = 0;
do {
@ -148,6 +153,7 @@ void main(void) {
break;
}
}
#endif
/* Wait for reboot */
while(1)
;

View File

@ -0,0 +1,39 @@
:name: SiFive-FE310
:description: This script runs wolfboot on SiFive-FE310 platform.
$name?="SiFive-FE310"
using sysbus
mach create $name
machine LoadPlatformDescription @platforms/cpus/sifive-fe310.repl
#showAnalyzer uart0
emulation CreateUartPtyTerminal "term" "/tmp/wolfboot.uart" True
connector Connect uart0 term
sysbus Tag <0x10008000 4> "PRCI_HFROSCCFG" 0xFFFFFFFF
sysbus Tag <0x10008008 4> "PRCI_PLLCFG" 0xFFFFFFFF
cpu PerformanceInMips 320
macro reset
"""
### Load bootloader + signed image
sysbus LoadELF @/tmp/renode-wolfboot.elf
sysbus LoadBinary @/tmp/renode-test-v1.bin 0x20020000
### Uncomment next line to attach gdb
### machine StartGdbServer 3333
### Uncomment next line to print function names at run-time
### sysbus.cpu LogFunctionNames True
### Start system
start
"""
runMacro $reset

View File

@ -43,20 +43,8 @@ macro reset
### Uncomment next line to print function names at run-time
### sysbus.cpu LogFunctionNames True
### Start system for 50 seconds
### Start system
start
sleep 50
pause
### Uncomment next lines to load update package in FLASH
### sysbus LoadBinary @/tmp/renode-test-update.bin 0x08040000
### cpu Reset
### start
### sleep 60
### Goodbye.
quit
"""

View File

@ -25,22 +25,8 @@ macro reset
### Uncomment next line to print function names at run-time
### sysbus.cpu LogFunctionNames True
### Start system for 50 seconds
### Start system
start
sleep 50
pause
### Uncomment next lines to load update package in FLASH
#sysbus LoadELF @/tmp/renode-wolfboot.elf
#sysbus LoadBinary @/tmp/renode-test-v1.bin 0x08020000
#sysbus LoadBinary @/tmp/renode-test-update.bin 0x08080000
#sysbus.cpu Reset
#start
#sleep 60
### Goodbye.
quit
"""

View File

@ -2,8 +2,8 @@ TEST_UPDATE_VERSION?=2
WOLFBOOT_VERSION?=0
RENODE_UART=/tmp/wolfboot.uart
RENODE_PORT=55155
RENODE_OPTIONS=--pid-file=/tmp/renode.pid
RENODE_OPTIONS+=--disable-xwt -P $(RENODE_PORT)
RENODE_OPTIONS=--pid-file=/tmp/renode.pid -P $(RENODE_PORT)
RENODE_OPTIONS+=--disable-xwt
RENODE_CONFIG=tools/renode/stm32f4_discovery_wolfboot.resc
POFF=131067
@ -36,6 +36,10 @@ ifeq ($(TARGET),stm32f7)
POFF=393211
endif
ifeq ($(TARGET),hifive1)
RENODE_CONFIG=tools/renode/sifive_fe310_wolfboot.resc
endif
ifeq ($(SIGN),NONE)
SIGN_ARGS+=--no-sign
endif
@ -72,17 +76,18 @@ endif
#
renode-on: FORCE
@rm -f /tmp/wolfboot.uart
@renode $(RENODE_OPTIONS) $(RENODE_CONFIG)&
@renode $(RENODE_OPTIONS) $(RENODE_CONFIG) &
@while ! (test -e /tmp/wolfboot.uart); do sleep .1; done
@echo "Renode up: uart port activated"
@echo "Renode running: renode has been started."
renode-off: FORCE
@echo "Terminating renode..."
(echo && echo quit o) | nc -q 1 localhost $(RENODE_PORT) > /dev/null
@(echo && echo quit) | nc -q 1 localhost $(RENODE_PORT) > /dev/null
@tail --pid=`cat /tmp/renode.pid` -f /dev/null
@echo "Renode exited."
@killall renode || true
@killall mono || true
@killall renode 2>/dev/null || true
@killall mono 2>/dev/null || true
renode-factory: factory.bin test-app/image.bin FORCE
@ -94,7 +99,6 @@ renode-factory: factory.bin test-app/image.bin FORCE
@printf "pBOOT" >> /tmp/renode-test-update.bin
@cp test-app/image_v1_signed.bin /tmp/renode-test-v1.bin
@cp wolfboot.elf /tmp/renode-wolfboot.elf
@renode $(RENODE_OPTIONS) $(RENODE_CONFIG)&
@make renode-on
@test `$(RENODE_EXPVER)` -eq 1
@make renode-off