summaryrefslogtreecommitdiff
path: root/util/qualcomm/scripts/cmm/debug_chroot_common.cmm
diff options
context:
space:
mode:
authorashk <ashk@codeaurora.org>2019-08-06 19:00:25 +0530
committerJulius Werner <jwerner@chromium.org>2020-02-06 01:46:17 +0000
commita547584445c086fdcd0833bbbe649a11019fcd11 (patch)
treed876ec35f751c521ab7dae132def2f683243ded0 /util/qualcomm/scripts/cmm/debug_chroot_common.cmm
parentc34ebab4108965c824de4e1271c3f15598567fc5 (diff)
downloadcoreboot-a547584445c086fdcd0833bbbe649a11019fcd11.tar.xz
trogdor: Add T32 scripts for full boot chain
Change-Id: I4ec1d4f722523f240fa293dd79235ab4e32e4489 Signed-off-by: Ashwin Kumar <ashk@codeaurora.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35505 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'util/qualcomm/scripts/cmm/debug_chroot_common.cmm')
-rw-r--r--util/qualcomm/scripts/cmm/debug_chroot_common.cmm210
1 files changed, 210 insertions, 0 deletions
diff --git a/util/qualcomm/scripts/cmm/debug_chroot_common.cmm b/util/qualcomm/scripts/cmm/debug_chroot_common.cmm
new file mode 100644
index 0000000000..0e1d58baf5
--- /dev/null
+++ b/util/qualcomm/scripts/cmm/debug_chroot_common.cmm
@@ -0,0 +1,210 @@
+;============================================================================
+;##
+;## This file is part of the coreboot project.
+;##
+;## Copyright (C) 2018, The Linux Foundation. All rights reserved.
+;##
+;## This program is free software; you can redistribute it and/or modify
+;## it under the terms of the GNU General Public License version 2 and
+;## only version 2 as published by the Free Software Foundation.
+;##
+;## This program is distributed in the hope that it will be useful,
+;## but WITHOUT ANY WARRANTY; without even the implied warranty of
+;## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;## GNU General Public License for more details.
+;##
+;============================================================================
+; Name:
+; debug_chroot_common.cmm
+;
+; Description:
+; Debug chroot coreboot Environment
+;============================================================================
+
+;============================================================================
+; CMM script variables
+;============================================================================
+
+LOCAL &BBStage // Bootblock Stage stop?
+LOCAL &VERStage // Verify Stage stop?
+LOCAL &ROMStage // Rom Stage stop?
+LOCAL &QCLStage // QCL Stage stop?
+LOCAL &RAMStage // Ram Stage stop?
+LOCAL &BL31Stage // BL31 Stage stop?
+LOCAL &DCStage // Depthcharge Stage stop?
+
+LOCAL &RAMLoad // T32 Load Code?
+
+;============================================================================
+
+;---------------------------------------------------
+; Entry point
+;---------------------------------------------------
+ENTRY &TargetPkg &srcpath &xblsrcpath &ImageName
+
+ // Parse for RAMLoad first
+ if (STR.CP("&ImageName","LOAD,*"))
+ (
+ &RAMLoad=TRUE()
+ &ImageName=STR.CUT("&ImageName",5)
+ )
+ else
+ &RAMLoad=FALSE()
+
+ // Parse &ImageName the easy way
+ if (STR.CP("&ImageName","*ALL*"))
+ (
+ &BBStage=TRUE()
+ &VERStage=TRUE()
+ &ROMStage=TRUE()
+ &QCLStage=TRUE()
+ &RAMStage=TRUE()
+ ;&BL31Stage=TRUE()
+ &DCStage=TRUE()
+ )
+ else
+ (
+ &BBStage=STRING.CP("&ImageName","*BB*")
+ &VERStage=STRING.CP("&ImageName","*VER*")
+ &ROMStage=STRING.CP("&ImageName","*ROM*")
+ &QCLStage=STRING.CP("&ImageName","*QCL*")
+ &RAMStage=STRING.CP("&ImageName","*RAM*")
+ ;&BL31Stage=STRING.CP("&ImageName","*BL31*")
+ &DCStage=STRING.CP("&ImageName","*DC*")
+ )
+
+ PRINT %String "Debug Script: debug_chroot_common.cmm"
+ PRINT %String "Images to debug: &ImageName"
+ PRINT %String "RAMLoad Requested: &RAMLoad"
+ PRINT %String "BootBlock Entry Addr: &BBEntryAddr"
+ PRINT %String "VerStage Entry Addr: &VEREntryAddr"
+ PRINT %String "RomStage Entry Addr: &ROMEntryAddr"
+ PRINT %String "QCLStage Entry Addr: &QCLEntryAddr"
+ PRINT %String "RamStage Entry Addr: &RAMEntryAddr"
+ PRINT %String "BL31 Entry Addr: &BL31EntryAddr"
+ PRINT %String "DepthCharge Entry Addr: &DCEntryAddr"
+ PRINT %String "Kernel Entry Addr: &KernelEntryAddr"
+ PRINT %String "PreRamCbfsCache: &PreRamCbfsCache"
+ PRINT %String "PreRamConsoleAddr: &PreRamConsoleAddr"
+ PRINT %String "VBoot2Work: &VBoot2Work"
+ PRINT %String "Stack: &Stack"
+ PRINT %String "Ttb: &Ttb"
+ PRINT %String "Timestamp &Timestamp"
+ PRINT %String "RamConsoleAddr &RamConsoleAddr"
+ PRINT %String "CbmemTop &CbmemTop"
+ PRINT %String "PostRamCbfsCache &PostRamCbfsCache"
+
+ // HW at BB entry, first stop: bootblock
+ ////////////////////////////////////////
+
+ if &BBStage
+ (
+ &imgpath="build-trogdor\cbfs\fallback\bootblock.raw.elf"
+ if (&RAMLoad)
+ d.load.elf &imgpath /strippart 9 /sourcepath &srcpath
+ else
+ d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /nocode
+
+ d.l
+
+ print %String "Now the control is in BootBlock, press enter after debugging to go to next stage"
+ print %String "Press enter to go to next stage"
+ enter
+ )
+
+ go &VEREntryAddr
+ wait !run()
+
+ if &VERStage
+ (
+ &imgpath="build-trogdor\cbfs\fallback\verstage.elf"
+ if (&RAMLoad)
+ d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /noclear
+ else
+ d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /nocode /noclear
+
+ print %String "Now the control is in VERStage, press enter after debugging to go to next stage"
+ print %String "Press enter to go to next stage"
+ enter
+ )
+
+ go &ROMEntryAddr
+ wait !run()
+
+ if &ROMStage
+ (
+ &imgpath="build-trogdor\cbfs\fallback\romstage.elf"
+ if (&RAMLoad)
+ d.load.elf &imgpath /strippart 9 /sourcepath &srcpath
+ else
+ d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /nocode
+
+ print %String "Now the control is in ROMStage, press enter after debugging to go to next stage"
+ print %String "Press enter to go to next stage"
+ enter
+ )
+
+;;;; START OF COMMENTED OUT CODE TO SKIP QCLIB DEBUG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; go &QCLEntryAddr
+; wait !run()
+
+; if &QCLStage
+; (
+
+; if (&RAMLoad)
+; d.load ...\QcLib.dll
+; else
+; d.load ...\QcLib.dll
+
+
+; print %String "Now the control is in QCLStage, press enter after debugging to go to next stage"
+; print %String "Press enter to go to next stage"
+; enter
+; )
+
+;;;; END OF QCLIB COMMENTED OUT CODE
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ go &RAMEntryAddr
+ wait !run()
+
+ if &RAMStage
+ (
+ &imgpath="build-trogdor\cbfs\fallback\ramstage.elf"
+ if (&RAMLoad)
+ d.load.elf &imgpath /strippart 9 /sourcepath &srcpath
+ else
+ d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /nocode
+
+ print %String "Now the control is in RAMStage, press enter after debugging to go to next stage"
+ print %String "Press enter to go to next stage"
+ enter
+ )
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;; BL31 DEBUG CODE WOULD BE ADDED HERE
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ go &DCEntryAddr
+ wait !run()
+
+ if &DCStage
+ (
+ &srcpath="..\..\..\depthcharge-9999\work\depthcharge-9999\src"
+ &imgpath="..\..\..\depthcharge-9999\work\depthcharge-9999\trogdor\depthcharge.elf"
+ symbol.sourcepath.setbasedir &srcpath
+ if (&RAMLoad)
+ d.load.elf &imgpath /strippart 9 /sourcepath &srcpath
+ else
+ d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /nocode
+
+ print %String "Now the control is in depthcharge, end of script"
+ d.l
+ ;b.s main
+ ;Execute this command in T32 if you start debugging vboot code, e.g. vboot_select_and_load_kernel()
+ ;y.spath.sbd 3rdparty\vboot\firmware
+ )
+
+ enddo