Debian Codegraph @

util/qualcomm/scripts/cmm/debug_cb_trogdor.cmm

raw
1 ;============================================================================
2 ;## SPDX-License-Identifier: GPL-2.0-only
3 ;============================================================================
4 ; Name:
5 ; debug_cb_trogdor.cmm
6 ;
7 ; Description:
8 ; Debug coreboot trogdor front-end
9 ;============================================================================
10
11 ;============================================================================
12 ; CMM script variables
13 ;============================================================================
14
15 LOCAL &TargetPkg
16
17 GLOBAL &BBEntryAddr // Bootblock Entry
18 GLOBAL &BBExitAddr // Bootblock Exit to Xbl-Sec
19 GLOBAL &VEREntryAddr // Verstage Entry
20 GLOBAL &ROMEntryAddr // Romstage Entry
21 GLOBAL &QCLEntryAddr // QCLstage Entry
22 GLOBAL &RAMEntryAddr // Ramstage Entry
23 GLOBAL &BL31EntryAddr // BL31 Entry
24 GLOBAL &DCEntryAddr // Depthcharge Entry
25
26 GLOBAL &PreRamConsoleAddr
27 GLOBAL &RamConsoleAddr
28 GLOBAL &PreRamCbfsCache
29 GLOBAL &VBoot2Work
30 GLOBAL &Stack
31 GLOBAL &Ttb
32 GLOBAL &Timestamp
33 GLOBAL &CbmemTop
34 GLOBAL &PostRamCbfsCache
35
36 GLOBAL &CBTablePtr
37
38 ;============================================================================
39
40 ;---------------------------------------------------
41 ; Entry point
42 ;---------------------------------------------------
43 ENTRY &ImageName &RegAddress
44
45 // Later these can be parameterized
46 &TargetPkg="trogdorPkg"
47
48 // These settings come from .../src/soc/qualcomm/sc7180/include/soc/memlayout.ld
49 &BBEntryAddr=0x14815000
50 &VEREntryAddr=0x14680000
51 &ROMEntryAddr=0x14680000
52 &QCLEntryAddr=0x1486c950
53 &RAMEntryAddr=0xA0800000
54 &BL31EntryAddr=0x80C00000
55 &DCEntryAddr=0xF1000000
56 &KernelEntryAddr=0xD0000000
57
58 &PreRamConsoleAddr=0x14830800
59 &VBoot2Work=0x1484B000
60 &Stack=0x14847000
61 &Ttb=0x14839000
62 &Timestamp=0x14838800
63 &PreRamCbfsCache=0x1481F000
64 &CbmemTop=0x280000000
65 &PostRamCbfsCache=0x9F800000
66 // End of memlayout.ld settings
67
68 // Common commands irrespective of &Mode
69 PATH
70 &CwDir=os.pwd()
71 PATH + &CwDir
72
73 // position at top of coreboot tree
74 // find depth count for source loading
75 cd ..\..\..\..
76 &srcpath=os.pwd()
77
78
79 ;---------------------------------------------------
80 ; Setup area and log
81 ;---------------------------------------------------
82 area.clear
83 area.reset
84 area.create CB_Logs 1000. 8192.
85 area.select CB_Logs
86
87 area.view CB_Logs
88
89 PRINT %String "Source Path: &srcpath"
90
91 symbol.sourcepath.setbasedir &srcpath\src
92
93 // Make parsing simple, upper-case parameters
94 &ImageName=STRING.UPR("&ImageName")
95 if (STR.CP("&ImageName","0X*"))
96 (
97 &RegAddress=&ImageName
98 &ImageName=""
99 )
100 &RegAddress=STRING.UPR("&RegAddress")
101
102 PRINT %String "ImageName: &ImageName"
103 PRINT %String "RegAddress: &RegAddress"
104
105 sys.d
106 sys.up
107 b.d
108 y.reset
109
110 if (STR.CP("&RegAddress","0X*"))
111 D.S EZAXI:&RegAddress %LE %Long 0x80000000
112
113 go &BBEntryAddr
114 wait !run()
115
116 DO debug_cb_common.cmm &TargetPkg &srcpath &xblsrcpath &ImageName
117
118 enddo