2020-03-10 08:41:07 +00:00
|
|
|
# Boot Renode Script (boot.resc)
|
|
|
|
|
|
2022-02-23 13:44:01 +00:00
|
|
|
|
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-06-25 15:55:50 +00:00
|
|
|
i @peripherals/ABRTCMC.cs
|
2021-08-30 04:36:04 +00:00
|
|
|
i @peripherals/BetrustedEcI2C.cs
|
2021-08-30 07:12:13 +00:00
|
|
|
i @peripherals/BetrustedSocI2C.cs
|
2022-02-17 10:03:45 +00:00
|
|
|
i @peripherals/BetrustedSpinor.cs
|
2021-08-30 04:36:04 +00:00
|
|
|
i @peripherals/BetrustedWatchdog.cs
|
2021-09-27 11:42:04 +00:00
|
|
|
i @peripherals/BQ24157.cs
|
2021-08-30 04:36:04 +00:00
|
|
|
i @peripherals/BQ27421.cs
|
2022-02-23 13:44:01 +00:00
|
|
|
i @peripherals/BtEvents.cs
|
2022-02-18 01:07:13 +00:00
|
|
|
i @peripherals/ComConnector.cs
|
2022-10-20 14:19:40 +00:00
|
|
|
EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.SPI.Betrusted.IComPeripheral"
|
|
|
|
|
EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.SPI.Betrusted.IComController"
|
2022-02-18 01:07:13 +00:00
|
|
|
i @peripherals/ComEc.cs
|
|
|
|
|
i @peripherals/ComSoC.cs
|
2022-10-20 14:19:40 +00:00
|
|
|
i @peripherals/EcPower.cs
|
2022-02-23 13:44:01 +00:00
|
|
|
i @peripherals/EcWifi.cs
|
2021-07-18 04:31:29 +00:00
|
|
|
i @peripherals/engine.cs
|
2022-04-23 13:29:06 +00:00
|
|
|
i @peripherals/Jtag.cs
|
2021-04-25 06:32:02 +00:00
|
|
|
i @peripherals/keyboard.cs
|
2021-07-18 04:31:29 +00:00
|
|
|
i @peripherals/keyrom.cs
|
2023-01-30 03:23:16 +00:00
|
|
|
i @peripherals/LiteX_Timer_32.cs
|
2021-09-27 11:42:04 +00:00
|
|
|
i @peripherals/LM3509.cs
|
|
|
|
|
i @peripherals/LSM6DS3.cs
|
2020-03-17 02:27:03 +00:00
|
|
|
i @peripherals/memlcd.cs
|
2022-02-17 10:03:45 +00:00
|
|
|
i @peripherals/MXIC_MX66UM1G45G.cs
|
2021-06-28 13:35:17 +00:00
|
|
|
i @peripherals/sha512.cs
|
2021-08-02 09:10:10 +00:00
|
|
|
i @peripherals/spinor_soft_int.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
|
2022-04-21 03:42:02 +00:00
|
|
|
i @peripherals/TLV320AIC3100.cs
|
2021-09-27 11:42:04 +00:00
|
|
|
i @peripherals/TUSB320LAI.cs
|
2022-02-23 13:44:01 +00:00
|
|
|
i @peripherals/WF200.cs
|
2021-08-02 09:10:10 +00:00
|
|
|
i @peripherals/wfi.cs
|
2020-03-10 04:04:17 +00:00
|
|
|
|
2022-02-17 10:03:45 +00:00
|
|
|
EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.VexRiscv"
|
|
|
|
|
i @peripherals/vexriscv-aes.cs
|
|
|
|
|
|
2022-10-20 14:19:40 +00:00
|
|
|
EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.Timers.Betrusted.TickTimer"
|
2022-04-21 02:19:02 +00:00
|
|
|
i @peripherals/susres.cs
|
|
|
|
|
|
2022-02-14 04:28:40 +00:00
|
|
|
# Create the COM SPI bus
|
|
|
|
|
emulation CreateComConnector "com"
|
|
|
|
|
|
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-07-18 04:31:29 +00:00
|
|
|
# sysbus LogPeripheralAccess engine true
|
|
|
|
|
# sysbus LogPeripheralAccess sha512 true
|
2021-08-30 07:12:13 +00:00
|
|
|
# sysbus LogPeripheralAccess i2c true
|
2021-07-18 04:31:29 +00:00
|
|
|
# sysbus LogPeripheralAccess trng_kernel true
|
|
|
|
|
|
2021-04-23 05:58:40 +00:00
|
|
|
sysbus Tag <0xB0000000, 0xB0006000> "Framebuffer"
|
|
|
|
|
|
|
|
|
|
# logLevel -1 keyboard
|
2021-03-22 14:23:53 +00:00
|
|
|
# logLevel -1 ticktimer
|
2021-07-18 04:31:29 +00:00
|
|
|
# logLevel -1 engine
|
|
|
|
|
# logLevel -1 i2c
|
2021-08-30 07:12:13 +00:00
|
|
|
# logLevel -1 i2c.abracom_rtc
|
2021-07-18 04:31:29 +00:00
|
|
|
# logLevel -1 sha512
|
2022-02-17 10:03:45 +00:00
|
|
|
# logLevel -1 sysbus.spinor.flash
|
|
|
|
|
# sysbus LogPeripheralAccess spinor true
|
2021-06-25 15:55:50 +00:00
|
|
|
|
2022-02-14 08:37:33 +00:00
|
|
|
# Silence GPIO
|
|
|
|
|
sysbus SilenceRange <0xf0003000, 0xF0003FFF>
|
2022-02-17 10:03:45 +00:00
|
|
|
# Silence POWER
|
|
|
|
|
sysbus SilenceRange <0xF0014000 100>
|
2020-03-30 08:07:58 +00:00
|
|
|
|
2022-06-24 07:39:56 +00:00
|
|
|
# Attach the flash backing to the filesystem
|
|
|
|
|
sysbus.spinor.flash BackingFile $ORIGIN/../tools/pddb-images/renode.bin
|
|
|
|
|
|
2021-08-30 05:32:41 +00:00
|
|
|
# Load the SPI flash into RAM
|
2022-09-27 10:32:30 +00:00
|
|
|
sysbus LoadBinary @../utralib/renode/soc_csr.bin 0x20000000
|
2021-08-30 05:32:41 +00:00
|
|
|
|
2022-02-14 04:28:40 +00:00
|
|
|
# Connect the SoC to the SPI bus
|
|
|
|
|
connector Connect sysbus.com com
|
|
|
|
|
|
2020-03-10 04:04:17 +00:00
|
|
|
# The macro `reset` gets called implicitly when running `machine Reset`
|
|
|
|
|
macro reset
|
|
|
|
|
"""
|
2022-02-23 13:44:01 +00:00
|
|
|
#sysbus LoadBinary @flash-formatted.bin 0x20000000
|
2022-04-21 02:19:02 +00:00
|
|
|
sysbus LoadBinary @../target/riscv32imac-unknown-xous-elf/release/loader.bin 0x20500000
|
2021-08-04 02:14:56 +00:00
|
|
|
sysbus LoadBinary @../target/riscv32imac-unknown-xous-elf/release/xous.img 0x20980000
|
2020-03-10 04:04:17 +00:00
|
|
|
# Set $a0 to point at the args binary
|
2021-08-02 10:16:01 +00:00
|
|
|
cpu SetRegisterUnsafe 10 0x20980000
|
2022-04-21 02:19:02 +00:00
|
|
|
cpu PC 0x20501000
|
2020-03-10 04:04:17 +00:00
|
|
|
"""
|
|
|
|
|
|
2021-06-21 06:11:58 +00:00
|
|
|
# Connect the serial port to an Ethernet port
|
2022-02-23 13:44:01 +00:00
|
|
|
emulation CreateServerSocketTerminal 8888 "kernel" False
|
2021-06-21 06:11:58 +00:00
|
|
|
connector Connect sysbus.uart kernel
|
|
|
|
|
|
2024-03-11 06:01:37 +00:00
|
|
|
# Connect the `app_uart` port -- which is the port on which
|
|
|
|
|
# the Xous gdbserver runs -- to TCP port 3456, to allow for
|
|
|
|
|
# application-aware debugging
|
|
|
|
|
emulation CreateServerSocketTerminal 3456 "gdb" False
|
|
|
|
|
connector Connect sysbus.app_uart gdb
|
|
|
|
|
|
2020-03-10 04:04:17 +00:00
|
|
|
runMacro $reset
|
2021-06-01 12:01:43 +00:00
|
|
|
|
2021-04-25 06:32:02 +00:00
|
|
|
mach clear
|
|
|
|
|
|
|
|
|
|
############### Define the Betrusted EC ###############
|
|
|
|
|
mach create "EC"
|
|
|
|
|
machine LoadPlatformDescription @ec/betrusted-ec.repl
|
2021-08-30 07:12:13 +00:00
|
|
|
|
2021-09-27 11:42:04 +00:00
|
|
|
# logLevel -1 i2c
|
2021-08-30 07:12:13 +00:00
|
|
|
# logLevel -1 i2c.bq27421
|
2022-02-23 13:44:01 +00:00
|
|
|
# logLevel -1 wifi
|
2022-06-24 07:39:56 +00:00
|
|
|
# logLevel 0 wifi.wf200
|
2022-02-23 13:44:01 +00:00
|
|
|
# sysbus LogPeripheralAccess wifi true
|
2021-08-30 07:12:13 +00:00
|
|
|
|
2022-02-14 04:28:40 +00:00
|
|
|
machine StartGdbServer 3334 true
|
2021-04-25 06:32:02 +00:00
|
|
|
showAnalyzer uart
|
2021-09-27 11:42:04 +00:00
|
|
|
|
2022-02-14 04:28:40 +00:00
|
|
|
# Connect the EC to the SPI bus
|
|
|
|
|
connector Connect sysbus.com com
|
2021-09-27 11:42:04 +00:00
|
|
|
|
2021-04-25 06:32:02 +00:00
|
|
|
macro reset
|
|
|
|
|
"""
|
2022-02-14 04:28:40 +00:00
|
|
|
sysbus LoadBinary @ec/bt-ec.bin 0x20000000
|
2022-02-23 13:44:01 +00:00
|
|
|
sysbus LoadBinary @ec/wf200_fw.bin 0x2009C000
|
2022-02-14 04:28:40 +00:00
|
|
|
sysbus LoadBinary @ec/loader.bin 0x00000000
|
|
|
|
|
cpu PC 0
|
|
|
|
|
cpu SP 0x1001FFFC
|
2021-04-25 06:32:02 +00:00
|
|
|
"""
|
|
|
|
|
runMacro $reset
|
|
|
|
|
|
|
|
|
|
mach clear
|
|
|
|
|
|
2020-03-10 04:04:17 +00:00
|
|
|
start
|