summaryrefslogtreecommitdiff
path: root/scripts/debugger/a8k
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/debugger/a8k')
-rwxr-xr-xscripts/debugger/a8k/restore_boot.xdb65
-rwxr-xr-xscripts/debugger/a8k/xdb_recovery.xdb26
2 files changed, 91 insertions, 0 deletions
diff --git a/scripts/debugger/a8k/restore_boot.xdb b/scripts/debugger/a8k/restore_boot.xdb
new file mode 100755
index 00000000..4c3f4f6f
--- /dev/null
+++ b/scripts/debugger/a8k/restore_boot.xdb
@@ -0,0 +1,65 @@
+if (@strcmp(@BIN_EXT_ELF_PATH,"EMPTY")==0) then
+ SET VALUE @BIN_EXT_ELF_PATH = @queryinputfile("Select BLE elf file", "All Files (*.*)|*.*|ELF Files (*.afx;*.elf)|*.afx;*.elf||");
+ IF @strlen(@BIN_EXT_ELF_PATH) == 0 then
+ !User hit cancel button
+ print "USER ABORT\n"
+ MESSAGE "Update the path of the binary extension, and reload the script"
+ EXIT
+ END
+end
+
+if (@strcmp(@BI_BIN_PATH,"EMPTY")==0) then
+ set value @BI_BIN_PATH = @queryinputfile("select Boot-image binary file", "all files (*.*)|*.*");
+ if @strlen(BI_BIN_PATH) == 0 then
+ !user hit cancel button
+ print "user abort\n"
+ MESSAGE "Update the path of the Boot-image binary, and reload the script"
+ EXIT
+ end
+end
+
+! Reset the board
+TCI TRESET
+RESTART
+
+IF @flash_empty != 1 THEN
+ ! break at start of bin_ext_run
+ SET BREAKPOINT AT (0xFFE1C048) HARD
+ELSE
+ ! break at UART error of Bootrom
+ SET BREAKPOINT AT (0xFFFF0D14) HARD
+ RUN
+ SET BREAKPOINT AT (0xffff242c) HARD
+END
+
+! Run till the breakpoint
+RUN
+DELETE BREAKPOINT /ALL
+
+IF @flash_empty != 1 THEN
+! load BLE elf file (run from 0xFFE1C048)
+LOAD /SEGMENT /DEBUG /GLOBAL OF @BIN_EXT_ELF_PATH
+ELSE
+! load BLE elf file and update the PC to the start of the BLE
+LOAD /SEGMENT /DEBUG /GLOBAL /INIT="" OF @BIN_EXT_ELF_PATH
+END
+
+! Break at the end of DRAM init before jumping back top BootROM
+SET BREAKPOINT AT (0xFFE1C0B4) HARD
+RUN
+DELETE BREAKPOINT /ALL
+
+! DRAM should be ready now.
+! Jump to BootRom to disable MMU and clean caches
+SET REGISTER X1=0x0
+SET REGISTER PC=0xffff0668
+
+! Before run the BootRom, set breakpoint before jump to image execution
+SET BREAKPOINT AT (0xffff068c) HARD
+RUN
+DELETE BREAKPOINT /ALL
+
+! Load boot-image.bin and run
+SET REGISTER PC=0x4100000
+LOAD /BINARY /ADDRESS=0x4100000 OF @BI_BIN_PATH
+RUN
diff --git a/scripts/debugger/a8k/xdb_recovery.xdb b/scripts/debugger/a8k/xdb_recovery.xdb
new file mode 100755
index 00000000..4aee7741
--- /dev/null
+++ b/scripts/debugger/a8k/xdb_recovery.xdb
@@ -0,0 +1,26 @@
+! The scripts assume that the scripts is located under the ATF scripts directory
+! Need to update the path of the images (With full path)
+set val /size=byte @BI_BIN_PATH="EMPTY"
+set val /size=byte @BIN_EXT_ELF_PATH="EMPTY"
+
+! Set the flash is empty the breakpoints will be changed accordingly.
+set val @flash_empty = 0
+
+! if the flash empty - run the BLE script to load BLE code, ATF code, and U-Boot code.
+define macro /OVERWRITE /button restore_empty_flash "set val @flash_empty = 1; @restore_boot;"
+! restore u-boot with one button
+define macro /OVERWRITE /button restore_flash "@restore_boot;"
+
+define macro restore_boot "batch \"scripts/debugger/a8k/restore_boot.xdb\"\n"
+define macro /OVERWRITE /button help_message "\
+MESSAGE \" HELP MESSAGE\\n\
+This help is relevant for Armada-7k/8k SoC debug and recovery\\n\
+To recovery the board from scratch (empty flash), run empty_flash flash button.\\n\
+- The restore_empty_flash button will run the BootRom until it stuck in boot from UART mode.\\n\
+ then load binary extension, and boot image and run them.\\n\\n\
+To load new image to board.\\n\
+- The restore_flash button will load binary extension, and boot image and run them.\\n\\n\
+\""
+
+! Stop the CPU before run any button
+STOP