Debian Codegraph @

util/intelp2m/platforms/jsl/jsl.go

raw symbols SCIP
1 package jsl
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 << 18) | (0b00111111 << 11) | (0b00111111 << 2) | (0b1 << 1)
14 DW1Mask = 0b11111101111111111100001111111111
15 )
16
17 // "GPP_A", "GPP_B", "GPP_C", "GPP_D", "GPP_E", "GPP_F", "GPP_G", "GPP_H", "GPP_R", "GPP_S",
18 // "GPP_T", "GPD", "HVMOS", "VGPIO5"
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(), "GPP_F") ||
44 strings.Contains(m.GetPadId(), "GPP_B") ||
45 strings.Contains(m.GetPadId(), "GPP_A") ||
46 strings.Contains(m.GetPadId(), "GPP_S") ||
47 strings.Contains(m.GetPadId(), "GPP_R") {
48 // See reset map for the Jasper Lake Community 0:
49 // https://github.com/coreboot/coreboot/blob/master/src/soc/intel/jasperlake/gpio.c#L21
50 // remmap is not required because it is the same as common.
51 return
52 }
53 if err := p.UpdateResetSource(remapping); err != nil {
54 logs.Errorf("remap reset source for %s: %v", m.GetPadId(), err)
55 }
56 }