summaryrefslogtreecommitdiff
path: root/scripts/debugger/xdb_scripts
diff options
context:
space:
mode:
authorKonstantin Porotchkin <kostap@marvell.com>2017-03-23 17:22:55 +0200
committerKonstantin Porotchkin <kostap@marvell.com>2017-04-02 17:38:13 +0300
commit80316c829d0c56b67eb60c39fe3fd6266b314860 (patch)
tree31d825c679a52aaef0abd4bab3e7d4367a1af66d /scripts/debugger/xdb_scripts
parent3cbd96a876a00eb4c30af69ce827307a1dbf455c (diff)
scripts: Add XDB debugger scripts for A7K/A8K platformsHEADatf-v1.3-17.04
Add XDB scripts for A7K/A8K platforms Change-Id: I43577d83fe252a0a72f98df8bbd224a5091b189f Signed-off-by: Haim Boot <hayim@marvell.com> Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/37919
Diffstat (limited to 'scripts/debugger/xdb_scripts')
-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/binary_extension.xdb60
-rw-r--r--scripts/debugger/xdb_scripts/bootloader.xdb28
4 files changed, 146 insertions, 0 deletions
diff --git a/scripts/debugger/xdb_scripts/atf.xdb b/scripts/debugger/xdb_scripts/atf.xdb
new file mode 100644
index 00000000..2c8a4cdc
--- /dev/null
+++ b/scripts/debugger/xdb_scripts/atf.xdb
@@ -0,0 +1,53 @@
+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
new file mode 100644
index 00000000..a95aae34
--- /dev/null
+++ b/scripts/debugger/xdb_scripts/axi-dap-a8k.xdb
@@ -0,0 +1,5 @@
+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/binary_extension.xdb b/scripts/debugger/xdb_scripts/binary_extension.xdb
new file mode 100644
index 00000000..7de2155c
--- /dev/null
+++ b/scripts/debugger/xdb_scripts/binary_extension.xdb
@@ -0,0 +1,60 @@
+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
+
+! Set value bin_ext_run = 1 if the user run this script
+set val @bin_ext_run = 1
+
+! 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
+ 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
+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 bin_ext_run before jumping back top BootROM
+SET BREAKPOINT AT (0xFFE1C08C) 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
diff --git a/scripts/debugger/xdb_scripts/bootloader.xdb b/scripts/debugger/xdb_scripts/bootloader.xdb
new file mode 100644
index 00000000..9cc912ee
--- /dev/null
+++ b/scripts/debugger/xdb_scripts/bootloader.xdb
@@ -0,0 +1,28 @@
+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