Debian Codegraph @

util/intelp2m/platforms/ebg/ebg.go

raw symbols SCIP
1 package ebg
2
3 import (
4 "review.coreboot.org/coreboot.git/util/intelp2m/logs"
5 "review.coreboot.org/coreboot.git/util/intelp2m/platforms/cnl"
6 "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
7 "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common/register/bits"
8 )
9
10 const (
11 DW0Mask = (0b1 << 27) | (0b1 << 24) | (0b11 << 21) | (0b1111 << 16) | 0b11111100
12 DW1Mask = 0b11111101111111111100001111111111
13 )
14
15 // "GPPC_A", "GPPC_B", "GPPC_S", "GPPC_C", "GPP_D", "GPP_E", "GPPC_H", "GPP_J", "GPP_I",
16 // "GPP_L", "GPP_M", "GPP_N"
17 var GPPGroups = []string{"GPP_", "GPPC_"}
18
19 var remapping = common.ResetSources{
20 0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
21 0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
22 0b10: bits.RstCfgPLTRST << bits.DW0PadRstCfg,
23 }
24
25 type BasePlatform struct {
26 // based on the Cannon Lake platform
27 cnl.BasePlatform
28 }
29
30 func InitBasePlatform(dw0, dw0mask uint32, dw1, dw1mask uint32) BasePlatform {
31 return BasePlatform{cnl.InitBasePlatform(dw0, dw0mask, dw1, dw1mask)}
32 }
33
34 func GetPlatform(dw0, dw1 uint32) common.PlatformIf {
35 p := InitBasePlatform(dw0, DW0Mask, dw1, DW1Mask)
36 return &p
37 }
38
39 // Override BasePlatform.RemapResetSource()
40 func (p *BasePlatform) RemapResetSource(m *common.Macro) {
41 if err := p.UpdateResetSource(remapping); err != nil {
42 logs.Errorf("remap reset source for %s: %v", m.GetPadId(), err)
43 }
44 }