# Boot Renode Script (boot.resc) # Add this script's path to the global path, so # we can include files relative to ourselves. path add $ORIGIN using sysbus # Add peripherals that are defined in C#. You must restart Renode # if you modify these files. i @peripherals/ABRTCMC.cs i @peripherals/BetrustedEcI2C.cs i @peripherals/BetrustedSocI2C.cs i @peripherals/BetrustedWatchdog.cs i @peripherals/BQ24157.cs i @peripherals/BQ27421.cs i @peripherals/engine.cs i @peripherals/keyboard.cs i @peripherals/keyrom.cs i @peripherals/LiteX_Timer_32.cs i @peripherals/LM3509.cs i @peripherals/LSM6DS3.cs i @peripherals/memlcd.cs i @peripherals/sha512.cs i @peripherals/spinor_soft_int.cs i @peripherals/ticktimer.cs i @peripherals/trng_kernel.cs i @peripherals/trng_server.cs i @peripherals/TUSB320LAI.cs i @peripherals/wfi.cs ############### Define the Betrusted SoC ############### mach create "SoC" machine LoadPlatformDescription @soc/betrusted-soc.repl machine StartGdbServer 3333 true showAnalyzer uart showAnalyzer console # showAnalyzer app_uart showAnalyzer memlcd # sysbus LogPeripheralAccess engine true # sysbus LogPeripheralAccess sha512 true # sysbus LogPeripheralAccess i2c true # sysbus LogPeripheralAccess trng_kernel true sysbus Tag <0xB0000000, 0xB0006000> "Framebuffer" # logLevel -1 keyboard # logLevel -1 ticktimer # logLevel -1 engine # logLevel -1 i2c # logLevel -1 i2c.abracom_rtc # logLevel -1 sha512 # Silence COM and WDT and WFI # sysbus SilenceRange <0xF000D000, 0xF000DFFF> # sysbus SilenceRange <0xF0021000, 0xF0021FFF> # sysbus SilenceRange <0xF0023000, 0xF0023FFF> # Load the SPI flash into RAM sysbus LoadBinary @precursors/soc_csr.bin 0x20000000 # The macro `reset` gets called implicitly when running `machine Reset` macro reset """ sysbus LoadELF @../loader/target/riscv32imac-unknown-xous-elf/release/loader sysbus LoadBinary @../target/riscv32imac-unknown-xous-elf/release/xous.img 0x20980000 # Set $a0 to point at the args binary cpu SetRegisterUnsafe 10 0x20980000 """ # Connect the serial port to an Ethernet port mach set 0 emulation CreateServerSocketTerminal 9999 "kernel" False connector Connect sysbus.uart kernel runMacro $reset sysbus.cpu InstallCustomInstructionHandlerFromFile "00ss0fdbbbbbaaaaa000ddddd0001011" @vexriscv-aes.py mach clear ############### Define the Betrusted EC ############### mach create "EC" machine LoadPlatformDescription @ec/betrusted-ec.repl # logLevel -1 i2c # logLevel -1 i2c.bq27421 machine StartGdbServer 2222 true showAnalyzer uart # Silence the COM bus, which is currently unimplemented sysbus SilenceRange <0xE0005800, 0xE0005FFF> macro reset """ sysbus LoadBinary @ec/kernel.bin 0x10000000 cpu PC 0x10000000 """ runMacro $reset mach clear start