Debian Codegraph @

util/intelp2m/platforms/adl/adl.go

raw symbols SCIP
1 package adl
2
3 import (
4 "strings"
5
6 "review.coreboot.org/coreboot.git/util/intelp2m/logs"
7 "review.coreboot.org/coreboot.git/util/intelp2m/platforms/cnl"
8 "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
9 "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common/register/bits"
10 )
11
12 const (
13 DW0Mask uint32 = (0b1 << 27) | (0b1 << 24) | (0b11 << 21) | (0b1111 << 16) | 0b11111100
14 DW1Mask uint32 = 0b11111101111111111100001111111111
15 )
16
17 // "GPP_A", "GPP_B", "GPP_C", "GPP_D", "GPP_E", "GPP_F", "GPP_G",
18 // "GPP_H", "GPP_I", "GPP_J", "GPP_K", "GPP_R", "GPP_S", "GPP_T",
19 // "GPD", "VGPIO_USB", "VGPIO_PCIE"
20 var GPPGroups = []string{"GPP_", "GPD", "VGPIO"}
21
22 var remapping = common.ResetSources{
23 0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
24 0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
25 0b10: bits.RstCfgPLTRST << bits.DW0PadRstCfg,
26 0b11: bits.RstCfgPWROK << bits.DW0PadRstCfg,
27 }
28
29 type BasePlatform struct {
30 // based on the Cannon Lake platform
31 cnl.BasePlatform
32 }
33
34 func InitBasePlatform(dw0, dw0mask uint32, dw1, dw1mask uint32) BasePlatform {
35 return BasePlatform{cnl.InitBasePlatform(dw0, dw0mask, dw1, dw1mask)}
36 }
37
38 func GetPlatform(dw0, dw1 uint32) common.PlatformIf {
39 p := InitBasePlatform(dw0, DW0Mask, dw1, DW1Mask)
40 return &p
41 }
42
43 // Override BasePlatform.RemapResetSource()
44 func (p *BasePlatform) RemapResetSource(m *common.Macro) {
45 if strings.Contains(m.GetPadId(), "GPD") {
46 // See reset map for the Alderlake GPD Group in the Community 2:
47 // https://github.com/coreboot/coreboot/blob/master/src/soc/intel/alderlake/gpio.c#L21
48 // remmap is not required because it is the same as common.
49 return
50 }
51 if err := p.UpdateResetSource(remapping); err != nil {
52 logs.Errorf("remap reset source for %s: %v", m.GetPadId(), err)
53 }
54 }