1 ;============================================================================
2 ;## SPDX-License-Identifier: GPL-2.0-only
3 ;============================================================================
8 ; Debug 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_cb_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\cbfs\fallback\bootblock.raw.elf"
91 d.load.elf &imgpath /strippart "coreboot" /sourcepath &srcpath
93 d.load.elf &imgpath /strippart "coreboot" /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\cbfs\fallback\verstage.elf"
109 d.load.elf &imgpath /strippart "coreboot" /sourcepath &srcpath /noclear
111 d.load.elf &imgpath /strippart "coreboot" /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\cbfs\fallback\romstage.elf"
125 d.load.elf &imgpath /strippart "coreboot" /sourcepath &srcpath
127 d.load.elf &imgpath /strippart "coreboot" /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\cbfs\fallback\ramstage.elf"
164 d.load.elf &imgpath /strippart "coreboot" /sourcepath &srcpath
166 d.load.elf &imgpath /strippart "coreboot" /sourcepath &srcpath /nocode
167 print %String "Now the control is in RAMStage, press enter after debugging to go to next stage"
168 print %String "Press enter to go to next stage"
172 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
173 ;;;;; BL31 DEBUG CODE WOULD BE ADDED HERE
174 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
181 &imgpath="payloads\external\depthcharge\depthcharge\build\depthcharge.elf"
182 symbol.sourcepath.setbasedir &srcpath\payloads
183 y.spath.srd payloads\external\depthcharge\depthcharge\src
185 d.load.elf &imgpath /strippart "payloads" /sourcepath &srcpath
187 d.load.elf &imgpath /strippart "payloads" /sourcepath &srcpath /nocode
188 print %String "Now the control is in depthcharge, end of script"
191 ;Execute this command in T32 if you start debugging vboot code, e.g. vboot_select_and_load_kernel()
192 ;y.spath.srd 3rdparty\vboot\firmware