summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sniatkiwicz <davidsn@marvell.com>2017-06-11 14:11:33 +0300
committerKostya Porotchkin <kostap@marvell.com>2017-06-19 14:16:17 +0300
commitf56b8c7721b6c5cd0023d638b9028088927eda84 (patch)
tree6aa2d8a5fa22deccea9972e19173853b4e0d1269
parent2538698f34b41caa85e74304a793da8c55c067a6 (diff)
fix: xdb: a80x0: a70x0: update xdb recovery script
update xdb recovery script for a80x0 and a70x0 bootloader recovery. Remove Armada-80x0-RZ support from XDB scripts Remove BLx & U-Boot debug option, the XDB scripts will be used for recovery only. Change-Id: Icb176691f05855440411ddcf908ea63c5bc4c33f Signed-off-by: David Sniatkiwicz <davidsn@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/40363 Reviewed-by: Hanna Hawa <hannah@marvell.com> Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Kostya Porotchkin <kostap@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/40590
-rwxr-xr-x[-rw-r--r--]scripts/debugger/a8k/restore_boot.xdb (renamed from scripts/debugger/xdb_scripts/binary_extension.xdb)35
-rwxr-xr-xscripts/debugger/a8k/xdb_recovery.xdb26
-rw-r--r--scripts/debugger/xdb_debug.xdb53
-rw-r--r--scripts/debugger/xdb_scripts/atf.xdb53
-rw-r--r--scripts/debugger/xdb_scripts/axi-dap-a8k.xdb5
-rw-r--r--scripts/debugger/xdb_scripts/bootloader.xdb28
6 files changed, 46 insertions, 154 deletions
diff --git a/scripts/debugger/xdb_scripts/binary_extension.xdb b/scripts/debugger/a8k/restore_boot.xdb
index 7de2155c..4c3f4f6f 100644..100755
--- a/scripts/debugger/xdb_scripts/binary_extension.xdb
+++ b/scripts/debugger/a8k/restore_boot.xdb
@@ -8,8 +8,15 @@ if (@strcmp(@BIN_EXT_ELF_PATH,"EMPTY")==0) then
END
end
-! Set value bin_ext_run = 1 if the user run this script
-set val @bin_ext_run = 1
+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
@@ -20,23 +27,15 @@ IF @flash_empty != 1 THEN
SET BREAKPOINT AT (0xFFE1C048) HARD
ELSE
! break at UART error of Bootrom
- IF @armada_8040_rz != 1 THEN
- ! not Armada-8040-RZ(include AP-806-Z)
- SET BREAKPOINT AT (0xFFFF0D14) HARD
- RUN
- SET BREAKPOINT AT (0xffff23d4) HARD
- ELSE
- SET BREAKPOINT AT (0xffff2270) HARD
- RUN
- SET BREAKPOINT AT (0xffff3244) HARD
- END
+ 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
@@ -45,8 +44,8 @@ ELSE
LOAD /SEGMENT /DEBUG /GLOBAL /INIT="" OF @BIN_EXT_ELF_PATH
END
-! Break at the end of bin_ext_run before jumping back top BootROM
-SET BREAKPOINT AT (0xFFE1C08C) HARD
+! Break at the end of DRAM init before jumping back top BootROM
+SET BREAKPOINT AT (0xFFE1C0B4) HARD
RUN
DELETE BREAKPOINT /ALL
@@ -58,3 +57,9 @@ 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
diff --git a/scripts/debugger/xdb_debug.xdb b/scripts/debugger/xdb_debug.xdb
deleted file mode 100644
index 3baf6934..00000000
--- a/scripts/debugger/xdb_debug.xdb
+++ /dev/null
@@ -1,53 +0,0 @@
-! 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 @ATF_FIB_BIN_PATH="EMPTY"
-set val /size=byte @ATF_BL1_ELF_PATH="EMPTY"
-set val /size=byte @BIN_EXT_ELF_PATH="EMPTY"
-set val /size=byte @BL_ELF_PATH="EMPTY"
-
-! Init bin_ext_run variable to check if the user run BLE init or not (the BLE script update the value to 1)
-! if not, when run the ATF init, the script will stop at the beginning of ATF code
-set val @bin_ext_run = 0
-
-! Init atf_run variable to check if the user run ATF init or not (the ATF script update the value to 1)
-! if not, when run the U-Boot init, the script will stop at the beginning of the U-Boot code
-set val @atf_run = 0
-
-! 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, then ATF code, and U-Boot code.
-define macro /OVERWRITE /button restore_empty_flash "set val @flash_empty = 1; @binary_extension; @atf; @bootloader;"
-! restore u-boot with one button
-define macro /OVERWRITE /button restore_flash "@binary_extension; @atf; @bootloader;"
-
-define macro /OVERWRITE /button binary_extension "batch \"scripts/debugger/xdb_scripts/binary_extension.xdb\"\n"
-define macro /OVERWRITE /button atf "batch \"scripts/debugger/xdb_scripts/atf.xdb\"\n"
-define macro /OVERWRITE /button bootloader "batch \"scripts/debugger/xdb_scripts/bootloader.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 empty_flash button will run the BootRom until it stuck in boot from UART mode.\\n\
- then load binary extension, ATF, and bootloader images and run them.\\n\\n\
-To debug the Binary extension, ATF, and Bootloader need to run the buttons separately:\\n\
-- binary_extension:\\n\
- will stop at the beginning of the binary extension,\\n\
- load the binary extension code and stop at the end of it,\\n\
- jump back to BootRom to clean the flash and MMU\\n\
-- atf:\\n\
- if the binary_extension not run, the button will reset the SoC\\n\
- stop at the beginning of the ATF,\\n\
- load the fib binary and BL1 elf file\\n\
-- Bootloader:\\n\
- if the atf not run, the button will reset the SoC\\n\
- stop at the beginning of the Bootloader\\n\
- load the Bootloader elf image and stop\\n\
-\\n\
-Please note - if you run Armda-8040-RZ board, need to press on Armada-8040-RZ button\\n\
-\""
-
-define macro /OVERWRITE /button armada_8040_rz "set val @armada_8040_rz = 1;"
-
-! Stop the CPU before run any button
-STOP
diff --git a/scripts/debugger/xdb_scripts/atf.xdb b/scripts/debugger/xdb_scripts/atf.xdb
deleted file mode 100644
index 2c8a4cdc..00000000
--- a/scripts/debugger/xdb_scripts/atf.xdb
+++ /dev/null
@@ -1,53 +0,0 @@
-if (@strcmp(@ATF_FIB_BIN_PATH,"EMPTY")==0) then
- set value @ATF_FIB_BIN_PATH = @queryinputfile("select FIB bin file", "all files (*.*)|*.*");
- if @strlen(@bin_ext_elf_path) == 0 then
- !user hit cancel button
- print "user abort\n"
- MESSAGE "Update the path of the ATF FIB binary, and reload the script"
- EXIT
- end
-end
-if (@strcmp(@ATF_BL1_ELF_PATH,"EMPTY")==0) then
- set value @ATF_BL1_ELF_PATH = @queryinputfile("select BL1 ELF file", "all files (*.*)|*.*|elf files (*.afx;*.elf)|*.afx;*.elf||");
- if @strlen(@ATF_BL1_ELF_PATH) == 0 then
- !user hit cancel button
- print "user abort\n"
- MESSAGE "Update the path of the BL1 ELF, and reload the script"
- EXIT
- end
-end
-
-! Set value atf_run = 1 if the user run this script
-set val @atf_run = 1
-
-! if the bin_ext script is not run, reset the board and stop at 0xffff0000
-IF @bin_ext_run != 1 THEN
-TCI TRESET
-RESTART
-END
-
-DELETE BREAKPOINT /ALL
-! break at bl1
-SET BREAKPOINT AT (0x4100000) HARD
-
-! If the SPL script run, it already run the bootrom code.
-IF @bin_ext_run != 1 THEN
-RUN
-END
-
-! load fip.bin (loaded by BL1 from 0x4120000)
-LOAD /BINARY /ADDRESS=0x4120000 OF @ATF_FIB_BIN_PATH
-
-! load BL1.elf (run from 0x4100000)
-LOAD /SEGMENT /DEBUG /GLOBAL /INIT="" OF @ATF_BL1_ELF_PATH
-
-! break at call to bl2_main function
-SET BREAKPOINT AT (0x4017000) HARD
-
-! break at bl31 function
-SET BREAKPOINT AT (0x4023000) HARD
-
-! break at U-Boot
-SET BREAKPOINT AT (0x0) HARD
-
-RUN
diff --git a/scripts/debugger/xdb_scripts/axi-dap-a8k.xdb b/scripts/debugger/xdb_scripts/axi-dap-a8k.xdb
deleted file mode 100644
index a95aae34..00000000
--- a/scripts/debugger/xdb_scripts/axi-dap-a8k.xdb
+++ /dev/null
@@ -1,5 +0,0 @@
-define macro /button /overwrite axi_dap_enable "custom \"lowlevel=on\";TCI APSCAN /SELECT=0 4\n"
-define macro /button /overwrite axi_dap_disable "tci apscan /select=1 4; custom \"lowlevel=off\"\n"
-define macro /button /overwrite axi_dap_read "TCI AP /silent 0x4=@1;TCI AP 0xC\n"
-define macro /button /overwrite axi_dap_write "TCI AP /silent 0x4=@1;TCI AP 0xC=@2\n"
-define macro /button /overwrite axi_dap_read_loop "for @idx =0 to @2 step 4 then TCI AP /silent 0x4=@1+@idx;TCI AP 0xC end"
diff --git a/scripts/debugger/xdb_scripts/bootloader.xdb b/scripts/debugger/xdb_scripts/bootloader.xdb
deleted file mode 100644
index 9cc912ee..00000000
--- a/scripts/debugger/xdb_scripts/bootloader.xdb
+++ /dev/null
@@ -1,28 +0,0 @@
-if (@strcmp(@BL_ELF_PATH,"EMPTY")==0) then
- set value @BL_ELF_PATH = @queryinputfile("select Bootloader binary file", "all files (*.*)|*.*");
- if @strlen(BL_ELF_PATH) == 0 then
- !user hit cancel button
- print "user abort\n"
- MESSAGE "Update the path of the Bootloader binary, and reload the script"
- EXIT
- end
-end
-
-! if the ATF script is not run, reset the board and stop at 0xffff0000
-IF @atf_run != 1 THEN
-TCI TRESET
-RESTART
-END
-
-DELETE BREAKPOINT /ALL
-! break at U-Boot
-SET BREAKPOINT AT (0x0) HARD
-! Run till the U-boot
-RUN
-
-DELETE BREAKPOINT /ALL
-
-! load U-Boot ELF image
-LOAD /SEGMENT /DEBUG /GLOBAL /INIT="" OF @BL_ELF_PATH
-
-! RUN