Debian Codegraph @

util/intelp2m/platforms/tgl/tgl.go

raw symbols SCIP
1 package tgl
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_A", "GPP_R", "GPP_B", "GPP_D", "GPP_C", "GPP_S", "GPP_G", "GPD", "GPP_E", "GPP_F",
18 // "GPP_H", "GPP_J", "GPP_K", "GPP_I", "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 }
26
27 type BasePlatform struct {
28 // based on the Cannon Lake platform
29 cnl.BasePlatform
30 }
31
32 func InitBasePlatform(dw0, dw0mask uint32, dw1, dw1mask uint32) BasePlatform {
33 return BasePlatform{cnl.InitBasePlatform(dw0, dw0mask, dw1, dw1mask)}
34 }
35
36 func GetPlatform(dw0, dw1 uint32) common.PlatformIf {
37 p := InitBasePlatform(dw0, DW0Mask, dw1, DW1Mask)
38 return &p
39 }
40
41 // Override BasePlatform.RemapResetSource()
42 func (p *BasePlatform) RemapResetSource(m *common.Macro) {
43 if strings.Contains(m.GetPadId(), "GPD") {
44 // See reset map for the TigerLake Community 2:
45 // https://github.com/coreboot/coreboot/blob/master/src/soc/intel/tigerlake/gpio.c#L21
46 // remmap is not required because it is the same as common.
47 return
48 }
49 if err := p.UpdateResetSource(remapping); err != nil {
50 logs.Errorf("remap reset source for %s: %v", m.GetPadId(), err)
51 }
52 }