Debian Codegraph @

util/intelp2m/platforms/mtl/mtl.go

raw symbols SCIP
1 package mtl
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 = (0b1 << 27) | (0b1 << 24) | (0b11 << 21) | (0b1111 << 16) | 0b11111100
14 DW1Mask = 0b11111101111111111100001111111111
15 )
16
17 // "GPP_V", "GPP_C", "GPP_A", "GPP_E", "GPP_H", "GPP_F", "GPP_S", "GPP_B", "GPP_D", "GPD",
18 // "VGPIO_USB", "VGPIO_PCIE"
19 var GPPGroups = []string{"GPP_", "GPD", "VGPIO"}
20
21 var remapping = common.ResetSources{
22 0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
23 0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
24 0b10: bits.RstCfgPLTRST << bits.DW0PadRstCfg,
25 0b11: bits.RstCfgPWROK << bits.RstCfgPWROK,
26 }
27
28 type BasePlatform struct {
29 // based on the Cannon Lake platform
30 cnl.BasePlatform
31 }
32
33 func InitBasePlatform(dw0, dw0mask uint32, dw1, dw1mask uint32) BasePlatform {
34 return BasePlatform{cnl.InitBasePlatform(dw0, dw0mask, dw1, dw1mask)}
35 }
36
37 func GetPlatform(dw0, dw1 uint32) common.PlatformIf {
38 p := InitBasePlatform(dw0, DW0Mask, dw1, DW1Mask)
39 return &p
40 }
41
42 // Override BasePlatform.RemapResetSource()
43 func (p *BasePlatform) RemapResetSource(m *common.Macro) {
44 if strings.Contains(m.GetPadId(), "GPD") {
45 // See reset map for the MeteorLake GPD group at
46 // https://github.com/coreboot/coreboot/blob/master/src/soc/intel/meteorlake/gpio.c#L10
47 // remmap is not required because it is the same as common.
48 return
49 }
50 if err := p.UpdateResetSource(remapping); err != nil {
51 logs.Errorf("remap reset source for %s: %v", m.GetPadId(), err)
52 }
53 }