2020-03-10 08:41:07 +00:00
|
|
|
# Boot Renode Script (boot.resc)
|
|
|
|
|
|
2020-03-12 05:33:37 +00:00
|
|
|
# Add this script's path to the global path, so
|
|
|
|
|
# we can include files relative to ourselves.
|
|
|
|
|
path add $ORIGIN
|
|
|
|
|
|
2020-03-10 04:04:17 +00:00
|
|
|
using sysbus
|
|
|
|
|
|
2020-03-10 08:41:07 +00:00
|
|
|
# Add peripherals that are defined in C#. You must restart Renode
|
|
|
|
|
# if you modify these files.
|
2021-04-25 06:32:02 +00:00
|
|
|
i @peripherals/keyboard.cs
|
2020-03-10 08:41:07 +00:00
|
|
|
i @peripherals/LiteX_Timer_32.cs
|
2020-03-17 02:27:03 +00:00
|
|
|
i @peripherals/memlcd.cs
|
2020-10-15 03:56:41 +00:00
|
|
|
i @peripherals/ticktimer.cs
|
2020-12-23 14:12:28 +00:00
|
|
|
i @peripherals/trng_kernel.cs
|
|
|
|
|
i @peripherals/trng_server.cs
|
2020-03-10 04:04:17 +00:00
|
|
|
|
2021-04-25 06:32:02 +00:00
|
|
|
############### Define the Betrusted SoC ###############
|
|
|
|
|
mach create "SoC"
|
|
|
|
|
machine LoadPlatformDescription @soc/betrusted-soc.repl
|
2020-03-10 08:41:07 +00:00
|
|
|
|
|
|
|
|
machine StartGdbServer 3333 true
|
|
|
|
|
showAnalyzer uart
|
2021-04-23 05:58:40 +00:00
|
|
|
showAnalyzer console
|
|
|
|
|
# showAnalyzer app_uart
|
|
|
|
|
showAnalyzer memlcd
|
2020-03-10 04:04:17 +00:00
|
|
|
|
2021-04-23 05:58:40 +00:00
|
|
|
sysbus Tag <0xB0000000, 0xB0006000> "Framebuffer"
|
|
|
|
|
|
|
|
|
|
# Silence WDT
|
|
|
|
|
sysbus SilenceRange <0xF001F000, 0xF001FFFF>
|
|
|
|
|
|
|
|
|
|
# Silence I2C
|
|
|
|
|
sysbus SilenceRange <0xF000D000, 0xF000DFFF>
|
|
|
|
|
|
|
|
|
|
# logLevel -1 keyboard
|
2021-03-22 14:23:53 +00:00
|
|
|
# logLevel -1 ticktimer
|
2020-03-30 08:07:58 +00:00
|
|
|
|
2020-03-10 04:04:17 +00:00
|
|
|
# The macro `reset` gets called implicitly when running `machine Reset`
|
|
|
|
|
macro reset
|
|
|
|
|
"""
|
2020-08-18 09:00:19 +00:00
|
|
|
sysbus LoadELF @../loader/target/riscv32imac-unknown-none-elf/release/loader
|
2020-08-17 12:01:26 +00:00
|
|
|
sysbus LoadBinary @../target/riscv32imac-unknown-none-elf/release/args.bin 0x40800000
|
2020-03-10 04:04:17 +00:00
|
|
|
# Set $a0 to point at the args binary
|
|
|
|
|
cpu SetRegisterUnsafe 10 0x40800000
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
runMacro $reset
|
2021-06-01 12:01:43 +00:00
|
|
|
sysbus.cpu InstallCustomInstructionHandlerFromFile "00ss0fdbbbbbaaaaa000ddddd0001011" @vexriscv-aes.py
|
|
|
|
|
|
2021-04-25 06:32:02 +00:00
|
|
|
mach clear
|
|
|
|
|
|
|
|
|
|
############### Define the Betrusted EC ###############
|
|
|
|
|
mach create "EC"
|
|
|
|
|
machine LoadPlatformDescription @ec/betrusted-ec.repl
|
|
|
|
|
showAnalyzer uart
|
|
|
|
|
macro reset
|
|
|
|
|
"""
|
|
|
|
|
sysbus LoadBinary @ec/kernel.bin 0x10000000
|
|
|
|
|
cpu PC 0x10000000
|
|
|
|
|
"""
|
|
|
|
|
runMacro $reset
|
|
|
|
|
|
|
|
|
|
# Silence I2C for now while we work on the driver
|
|
|
|
|
sysbus SilenceRange <0xB0000000, 0xB000FFFF>
|
|
|
|
|
|
|
|
|
|
mach clear
|
|
|
|
|
|
2020-03-10 04:04:17 +00:00
|
|
|
start
|