1 ;============================================================================
2 ;## SPDX-License-Identifier: GPL-2.0-only
3 ;============================================================================
5 ; debug_chroot_common.cmm
8 ; Debug chroot coreboot Environment
9 ;============================================================================
11 ;============================================================================
12 ; CMM script variables
13 ;============================================================================
15 LOCAL &BBStage // Bootblock Stage stop?
16 LOCAL &VERStage // Verify Stage stop?
17 LOCAL &ROMStage // Rom Stage stop?
18 LOCAL &QCLStage // QCL Stage stop?
19 LOCAL &RAMStage // Ram Stage stop?
20 LOCAL &BL31Stage // BL31 Stage stop?
21 LOCAL &DCStage // Depthcharge Stage stop?
23 LOCAL &RAMLoad // T32 Load Code?
25 ;============================================================================
27 ;---------------------------------------------------
29 ;---------------------------------------------------
30 ENTRY &TargetPkg &srcpath &xblsrcpath &ImageName
32 // Parse for RAMLoad first
33 if (STR.CP("&ImageName","LOAD,*"))
36 &ImageName=STR.CUT("&ImageName",5)
41 // Parse &ImageName the easy way
42 if (STR.CP("&ImageName","*ALL*"))
54 &BBStage=STRING.CP("&ImageName","*BB*")
55 &VERStage=STRING.CP("&ImageName","*VER*")
56 &ROMStage=STRING.CP("&ImageName","*ROM*")
57 &QCLStage=STRING.CP("&ImageName","*QCL*")
58 &RAMStage=STRING.CP("&ImageName","*RAM*")
59 ;&BL31Stage=STRING.CP("&ImageName","*BL31*")
60 &DCStage=STRING.CP("&ImageName","*DC*")
63 PRINT %String "Debug Script: debug_chroot_common.cmm"
64 PRINT %String "Images to debug: &ImageName"
65 PRINT %String "RAMLoad Requested: &RAMLoad"
66 PRINT %String "BootBlock Entry Addr: &BBEntryAddr"
67 PRINT %String "VerStage Entry Addr: &VEREntryAddr"
68 PRINT %String "RomStage Entry Addr: &ROMEntryAddr"
69 PRINT %String "QCLStage Entry Addr: &QCLEntryAddr"
70 PRINT %String "RamStage Entry Addr: &RAMEntryAddr"
71 PRINT %String "BL31 Entry Addr: &BL31EntryAddr"
72 PRINT %String "DepthCharge Entry Addr: &DCEntryAddr"
73 PRINT %String "Kernel Entry Addr: &KernelEntryAddr"
74 PRINT %String "PreRamCbfsCache: &PreRamCbfsCache"
75 PRINT %String "PreRamConsoleAddr: &PreRamConsoleAddr"
76 PRINT %String "VBoot2Work: &VBoot2Work"
77 PRINT %String "Stack: &Stack"
78 PRINT %String "Ttb: &Ttb"
79 PRINT %String "Timestamp &Timestamp"
80 PRINT %String "RamConsoleAddr &RamConsoleAddr"
81 PRINT %String "CbmemTop &CbmemTop"
82 PRINT %String "PostRamCbfsCache &PostRamCbfsCache"
84 // HW at BB entry, first stop: bootblock
85 ////////////////////////////////////////
89 &imgpath="build-trogdor\cbfs\fallback\bootblock.raw.elf"
91 d.load.elf &imgpath /strippart 9 /sourcepath &srcpath
93 d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /nocode
97 print %String "Now the control is in BootBlock, press enter after debugging to go to next stage"
98 print %String "Press enter to go to next stage"
107 &imgpath="build-trogdor\cbfs\fallback\verstage.elf"
109 d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /noclear
111 d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /nocode /noclear
113 print %String "Now the control is in VERStage, press enter after debugging to go to next stage"
114 print %String "Press enter to go to next stage"
123 &imgpath="build-trogdor\cbfs\fallback\romstage.elf"
125 d.load.elf &imgpath /strippart 9 /sourcepath &srcpath
127 d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /nocode
129 print %String "Now the control is in ROMStage, press enter after debugging to go to next stage"
130 print %String "Press enter to go to next stage"
134 ;;;; START OF COMMENTED OUT CODE TO SKIP QCLIB DEBUG
135 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
144 ; d.load ...\QcLib.dll
146 ; d.load ...\QcLib.dll
149 ; print %String "Now the control is in QCLStage, press enter after debugging to go to next stage"
150 ; print %String "Press enter to go to next stage"
154 ;;;; END OF QCLIB COMMENTED OUT CODE
155 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
162 &imgpath="build-trogdor\cbfs\fallback\ramstage.elf"
164 d.load.elf &imgpath /strippart 9 /sourcepath &srcpath
166 d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /nocode
168 print %String "Now the control is in RAMStage, press enter after debugging to go to next stage"
169 print %String "Press enter to go to next stage"
173 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
174 ;;;;; BL31 DEBUG CODE WOULD BE ADDED HERE
175 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
182 &srcpath="..\..\..\depthcharge-9999\work\depthcharge-9999\src"
183 &imgpath="..\..\..\depthcharge-9999\work\depthcharge-9999\trogdor\depthcharge.elf"
184 symbol.sourcepath.setbasedir &srcpath
186 d.load.elf &imgpath /strippart 9 /sourcepath &srcpath
188 d.load.elf &imgpath /strippart 9 /sourcepath &srcpath /nocode
190 print %String "Now the control is in depthcharge, end of script"
193 ;Execute this command in T32 if you start debugging vboot code, e.g. vboot_select_and_load_kernel()
194 ;y.spath.sbd 3rdparty\vboot\firmware