#
# Reset and stop the system.
#
stop
wait 5s
reset system
stop
wait 3s

set trust-ro-sections-for-opcodes off

#
# Load the SPL preloader into memory.
#
loadfile "$sdir/../../../Loaders/Arria10/u-boot" 0x0
tbreak _main
set variable $PC=_start
set variable $CPSR=0x000001DF
wait

set trust-ro-sections-for-opcodes off
restore "$sdir/../../../Loaders/Arria10/devicetree.dtb" binary &_end

#
# Delete any existing breakpoints.
#
delete

#
# Set a breakpoint in u-boot to stop once the H/W is initialized
#
tbreak board_init

#
# Wait for the breakpoint.
#
continue
wait 60s

#
# Disable semihosting.
#
set semihosting enabled false

#
# Load the program & set-up PC / mode / run it
#
loadfile "$sdir/BareMetal_Free_AR10_A9_ARMCC.axf" 0x0

#
# Run the target and break at main().
#
delete
tbreak main
set variable $PC=_vector_table
set variable $CPSR=0x000001DF
continue

#EOF
