util/intelp2m: Provide GPP group slice from each platform
Instead of a pointer to a function for analyzing the pad name, provide GPP group slice with pad names to the parser. This will get rid of some functions and files and make the code cleaner. TEST: - 'make test' = PASS; - 'intelp2m -file parser/testlog/inteltool_test.log' = no errors. Change-Id: I0d7818d3892450a37bffbf1ffd9524888e4675bf Signed-off-by: Maxim Polyakov <max.senia.poliak@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/85769 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: David Hendricks <david.hendricks@gmail.com>
This commit is contained in:
parent
da54bd60af
commit
a4f4dc5769
21 changed files with 96 additions and 178 deletions
|
|
@ -82,15 +82,25 @@ func extractGroup(line string) Entry {
|
|||
return group
|
||||
}
|
||||
|
||||
// checkGPPG() checks whether the desired group is present in the string
|
||||
func checkKeywords(line string, slice []string) bool {
|
||||
for _, key := range slice {
|
||||
if strings.Contains(line, key) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Extract() extracts pad information from a string
|
||||
func Extract(line string) Entry {
|
||||
if included, _ := common.KeywordsCheck(line, "GPIO Community", "GPIO Group"); included {
|
||||
if checkKeywords(line, []string{"GPIO Community", "GPIO Group"}) {
|
||||
return extractGroup(line)
|
||||
}
|
||||
if checkKeyword := platforms.GetKeywordChekingAction(); checkKeyword == nil {
|
||||
logs.Errorf("information extraction error: skip line <%s>", line)
|
||||
if gppg, err := platforms.GetGPPGroups(); err != nil {
|
||||
logs.Errorf("extract error: %v: skip line <%s>", err, line)
|
||||
return Entry{EType: EntryEmpty}
|
||||
} else if checkKeyword(line) {
|
||||
} else if checkKeywords(line, gppg) {
|
||||
pad, err := extractPad(line)
|
||||
if err != nil {
|
||||
logs.Errorf("extract pad info from %s: %v", line, err)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ const (
|
|||
DW1Mask uint32 = 0b11111101111111111100001111111111
|
||||
)
|
||||
|
||||
// "GPP_A", "GPP_B", "GPP_C", "GPP_D", "GPP_E", "GPP_F", "GPP_G",
|
||||
// "GPP_H", "GPP_I", "GPP_J", "GPP_K", "GPP_R", "GPP_S", "GPP_T",
|
||||
// "GPD", "VGPIO_USB", "VGPIO_PCIE"
|
||||
var GPPGroups = []string{"GPP_", "GPD", "VGPIO"}
|
||||
|
||||
var remapping = common.ResetSources{
|
||||
0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
|
||||
0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
package adl
|
||||
|
||||
import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
|
||||
|
||||
// CheckKeyword() parses lines of the configuration file and returns true if the keyword is
|
||||
// contained in the line
|
||||
// "GPP_A", "GPP_B", "GPP_C", "GPP_D", "GPP_E", "GPP_F", "GPP_G",
|
||||
// "GPP_H", "GPP_I", "GPP_J", "GPP_K", "GPP_R", "GPP_S", "GPP_T",
|
||||
// "GPD", "VGPIO_USB", "VGPIO_PCIE"
|
||||
func CheckKeyword(line string) bool {
|
||||
isIncluded, _ := common.KeywordsCheck(line, "GPP_", "GPD", "VGPIO")
|
||||
return isIncluded
|
||||
}
|
||||
|
|
@ -12,6 +12,18 @@ const (
|
|||
DW1Mask uint32 = 0b11111111111111000000000011111111
|
||||
)
|
||||
|
||||
var GPPGroups = []string{
|
||||
"GPIO_", "TCK", "TRST_B", "TMS", "TDI", "CX_PMODE", "CX_PREQ_B", "JTAGX", "CX_PRDY_B",
|
||||
"TDO", "CNV_BRI_DT", "CNV_BRI_RSP", "CNV_RGI_DT", "CNV_RGI_RSP", "SVID0_ALERT_B",
|
||||
"SVID0_DATA", "SVID0_CLK", "PMC_SPI_FS", "PMC_SPI_RXD", "PMC_SPI_TXD", "PMC_SPI_CLK",
|
||||
"PMIC_PWRGOOD", "PMIC_RESET_B", "PMIC_THERMTRIP_B", "PMIC_STDBY", "PROCHOT_B",
|
||||
"PMIC_I2C_SCL", "PMIC_I2C_SDA", "FST_SPI_CLK_FB", "OSC_CLK_OUT_", "PMU_AC_PRESENT",
|
||||
"PMU_BATLOW_B", "PMU_PLTRST_B", "PMU_PWRBTN_B", "PMU_RESETBUTTON_B", "PMU_SLP_S0_B",
|
||||
"PMU_SLP_S3_B", "PMU_SLP_S4_B", "PMU_SUSCLK", "PMU_WAKE_B", "SUS_STAT_B", "SUSPWRDNACK",
|
||||
"SMB_ALERTB", "SMB_CLK", "SMB_DATA", "LPC_ILB_SERIRQ", "LPC_CLKOUT", "LPC_AD", "LPC_CLKRUNB",
|
||||
"LPC_FRAMEB",
|
||||
}
|
||||
|
||||
type BasePlatform struct {
|
||||
common.BasePlatform
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
package apl
|
||||
|
||||
import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
|
||||
|
||||
// CheckKeyword() parses lines of the configuration file and returns true if the keyword is
|
||||
// contained in the line
|
||||
func CheckKeyword(line string) bool {
|
||||
isIncluded, _ := common.KeywordsCheck(line,
|
||||
"GPIO_", "TCK", "TRST_B", "TMS", "TDI", "CX_PMODE", "CX_PREQ_B", "JTAGX", "CX_PRDY_B",
|
||||
"TDO", "CNV_BRI_DT", "CNV_BRI_RSP", "CNV_RGI_DT", "CNV_RGI_RSP", "SVID0_ALERT_B",
|
||||
"SVID0_DATA", "SVID0_CLK", "PMC_SPI_FS", "PMC_SPI_RXD", "PMC_SPI_TXD", "PMC_SPI_CLK",
|
||||
"PMIC_PWRGOOD", "PMIC_RESET_B", "PMIC_THERMTRIP_B", "PMIC_STDBY", "PROCHOT_B",
|
||||
"PMIC_I2C_SCL", "PMIC_I2C_SDA", "FST_SPI_CLK_FB", "OSC_CLK_OUT_", "PMU_AC_PRESENT",
|
||||
"PMU_BATLOW_B", "PMU_PLTRST_B", "PMU_PWRBTN_B", "PMU_RESETBUTTON_B", "PMU_SLP_S0_B",
|
||||
"PMU_SLP_S3_B", "PMU_SLP_S4_B", "PMU_SUSCLK", "PMU_WAKE_B", "SUS_STAT_B", "SUSPWRDNACK",
|
||||
"SMB_ALERTB", "SMB_CLK", "SMB_DATA", "LPC_ILB_SERIRQ", "LPC_CLKOUT", "LPC_AD", "LPC_CLKRUNB",
|
||||
"LPC_FRAMEB")
|
||||
return isIncluded
|
||||
}
|
||||
|
|
@ -15,6 +15,26 @@ const (
|
|||
DW1Mask uint32 = 0b11111101111111111100001111111111
|
||||
)
|
||||
|
||||
var GPPGroups = []string{
|
||||
"GPP_", "GPD", // "GPP_A", "GPP_B", "GPP_G", "GPP_D", "GPP_F", "GPP_H", "GPP_C", "GPP_E"
|
||||
"I2S1_TXD", "CNV_BTEN", "CNV_GNEN", "CNV_WFEN", "CNV_WCEN", "vCNV_GNSS_HOST_WAKE_B",
|
||||
"vSD3_CD_B", "CNV_BT_HOST_WAKE_B", "CNV_BT_IF_SELECT", "vCNV_BT_UART_TXD",
|
||||
"vCNV_BT_UART_RXD", "vCNV_BT_UART_CTS_B", "vCNV_BT_UART_RTS_B", "vCNV_MFUART1_TXD",
|
||||
"vCNV_MFUART1_RXD", "vCNV_MFUART1_CTS_B", "vCNV_MFUART1_RTS_B", "vCNV_GNSS_UART_TXD",
|
||||
"vCNV_GNSS_UART_RXD", "vCNV_GNSS_UART_CTS_B", "vCNV_GNSS_UART_RTS_B", "vUART0_TXD",
|
||||
"vUART0_RXD", "vUART0_CTS_B", "vUART0_RTS_B", "vISH_UART0_TXD", "vISH_UART0_RXD",
|
||||
"vISH_UART0_CTS_B", "vISH_UART0_RTS_B", "vISH_UART1_TXD", "vISH_UART1_RXD",
|
||||
"vISH_UART1_CTS_B", "vISH_UART1_RTS_B", "vCNV_BT_I2S_BCLK", "vCNV_BT_I2S_WS_SYNC",
|
||||
"vCNV_BT_I2S_SDO", "vCNV_BT_I2S_SDI", "vSSP2_SCLK", "vSSP2_SFRM", "vSSP2_TXD",
|
||||
"vSSP2_RXD", "SLP_LAN_B", "SLP_SUS_B", "WAKE_B", "DRAM_RESET_B", "SPI0_IO_2",
|
||||
"SPI0_IO_3", "SPI0_MISO", "SPI0_MOSI", "SPI0_CS2_B", "SPI0_CS0_B", "SPI0_CS1_B",
|
||||
"SPI0_CLK", "SPI0_CLK_LOOPBK", "HDACPU_SDI", "HDACPU_SDO", "HDACPU_SCLK", "PM_SYNC",
|
||||
"PECI", "CPUPWRGD", "THRMTRIP_B", "PLTRST_CPU_B", "PM_DOWN", "TRIGGER_IN",
|
||||
"TRIGGER_OUT", "PCH_TDO", "PCH_JTAGX", "PROC_PRDY_B", "PROC_PREQ_B", "CPU_TRST_B",
|
||||
"PCH_TDI", "PCH_TMS", "PCH_TCK", "ITP_PMODE", "SYS_PWROK", "SYS_RESET_B", "CL_RST_B",
|
||||
"HDA_BCLK", "HDA_RST_B", "HDA_SYNC", "HDA_SDO", "HDA_SDI0", "HDA_SDI1", "I2S1_SFRM",
|
||||
}
|
||||
|
||||
var remapping = common.ResetSources{
|
||||
0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
|
||||
0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
package cnl
|
||||
|
||||
import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
|
||||
|
||||
func CheckKeyword(line string) bool {
|
||||
// "GPP_" : "GPP_A", "GPP_B", "GPP_G", "GPP_D", "GPP_F", "GPP_H", "GPP_C", "GPP_E"
|
||||
included, _ := common.KeywordsCheck(line, "GPP_", "GPD",
|
||||
"I2S1_TXD", "CNV_BTEN", "CNV_GNEN", "CNV_WFEN", "CNV_WCEN", "vCNV_GNSS_HOST_WAKE_B",
|
||||
"vSD3_CD_B", "CNV_BT_HOST_WAKE_B", "CNV_BT_IF_SELECT", "vCNV_BT_UART_TXD",
|
||||
"vCNV_BT_UART_RXD", "vCNV_BT_UART_CTS_B", "vCNV_BT_UART_RTS_B", "vCNV_MFUART1_TXD",
|
||||
"vCNV_MFUART1_RXD", "vCNV_MFUART1_CTS_B", "vCNV_MFUART1_RTS_B", "vCNV_GNSS_UART_TXD",
|
||||
"vCNV_GNSS_UART_RXD", "vCNV_GNSS_UART_CTS_B", "vCNV_GNSS_UART_RTS_B", "vUART0_TXD",
|
||||
"vUART0_RXD", "vUART0_CTS_B", "vUART0_RTS_B", "vISH_UART0_TXD", "vISH_UART0_RXD",
|
||||
"vISH_UART0_CTS_B", "vISH_UART0_RTS_B", "vISH_UART1_TXD", "vISH_UART1_RXD",
|
||||
"vISH_UART1_CTS_B", "vISH_UART1_RTS_B", "vCNV_BT_I2S_BCLK", "vCNV_BT_I2S_WS_SYNC",
|
||||
"vCNV_BT_I2S_SDO", "vCNV_BT_I2S_SDI", "vSSP2_SCLK", "vSSP2_SFRM", "vSSP2_TXD",
|
||||
"vSSP2_RXD", "SLP_LAN_B", "SLP_SUS_B", "WAKE_B", "DRAM_RESET_B", "SPI0_IO_2",
|
||||
"SPI0_IO_3", "SPI0_MISO", "SPI0_MOSI", "SPI0_CS2_B", "SPI0_CS0_B", "SPI0_CS1_B",
|
||||
"SPI0_CLK", "SPI0_CLK_LOOPBK", "HDACPU_SDI", "HDACPU_SDO", "HDACPU_SCLK", "PM_SYNC",
|
||||
"PECI", "CPUPWRGD", "THRMTRIP_B", "PLTRST_CPU_B", "PM_DOWN", "TRIGGER_IN",
|
||||
"TRIGGER_OUT", "PCH_TDO", "PCH_JTAGX", "PROC_PRDY_B", "PROC_PREQ_B", "CPU_TRST_B",
|
||||
"PCH_TDI", "PCH_TMS", "PCH_TCK", "ITP_PMODE", "SYS_PWROK", "SYS_RESET_B", "CL_RST_B",
|
||||
"HDA_BCLK", "HDA_RST_B", "HDA_SYNC", "HDA_SDO", "HDA_SDI0", "HDA_SDI1", "I2S1_SFRM")
|
||||
return included
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package common
|
||||
|
||||
import "strings"
|
||||
|
||||
// KeywordsCheck - check if one of the keyword from the <keywords> group is included in the
|
||||
// <line> string. Returns false if no word was found, or true otherwise and also this word
|
||||
// itself
|
||||
func KeywordsCheck(line string, keywords ...string) (bool, string) {
|
||||
for _, key := range keywords {
|
||||
if strings.Contains(line, key) {
|
||||
return true, key
|
||||
}
|
||||
}
|
||||
return false, ""
|
||||
}
|
||||
|
|
@ -12,6 +12,10 @@ const (
|
|||
DW1Mask = 0b11111101111111111100001111111111
|
||||
)
|
||||
|
||||
// "GPPC_A", "GPPC_B", "GPPC_S", "GPPC_C", "GPP_D", "GPP_E", "GPPC_H", "GPP_J", "GPP_I",
|
||||
// "GPP_L", "GPP_M", "GPP_N"
|
||||
var GPPGroups = []string{"GPP_", "GPPC_"}
|
||||
|
||||
var remapping = common.ResetSources{
|
||||
0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
|
||||
0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
package ebg
|
||||
|
||||
import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
|
||||
|
||||
// Group : "GPPC_A", "GPPC_B", "GPPC_S", "GPPC_C", "GPP_D", "GPP_E", "GPPC_H", "GPP_J",
|
||||
// "GPP_I", "GPP_L", "GPP_M", "GPP_N"
|
||||
|
||||
// CheckKeyword - This function is used to filter parsed lines of the configuration file and
|
||||
// returns true if the keyword is contained in the line.
|
||||
// line : string from the configuration file
|
||||
func CheckKeyword(line string) bool {
|
||||
isIncluded, _ := common.KeywordsCheck(line, "GPP_", "GPPC_")
|
||||
return isIncluded
|
||||
}
|
||||
|
|
@ -14,6 +14,10 @@ const (
|
|||
DW1Mask = 0b11111101111111111100001111111111
|
||||
)
|
||||
|
||||
// "GPP_A", "GPP_B", "GPP_C", "GPP_D", "GPP_E", "GPP_F", "GPP_G", "GPP_H", "GPP_R", "GPP_S",
|
||||
// "GPP_T", "GPD", "HVMOS", "VGPIO5"
|
||||
var GPPGroups = []string{"GPP_", "GPD", "VGPIO"}
|
||||
|
||||
var remapping = common.ResetSources{
|
||||
0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
|
||||
0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
package jsl
|
||||
|
||||
import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
|
||||
|
||||
// Group : "GPP_A", "GPP_B", "GPP_C", "GPP_D", "GPP_E", "GPP_F", "GPP_G", "GPP_H", "GPP_R",
|
||||
// "GPP_S", "GPP_T", "GPD", "HVMOS", "VGPIO5"
|
||||
|
||||
// CheckKeyword - This function is used to filter parsed lines of the configuration file and
|
||||
// returns true if the keyword is contained in the line.
|
||||
// line : string from the configuration file
|
||||
func CheckKeyword(line string) bool {
|
||||
isIncluded, _ := common.KeywordsCheck(line, "GPP_", "GPD", "VGPIO")
|
||||
return isIncluded
|
||||
}
|
||||
|
|
@ -12,6 +12,10 @@ const (
|
|||
DW1Mask uint32 = 0b11111101111111111100001111111111
|
||||
)
|
||||
|
||||
// "GPP_A", "GPP_B", "GPP_F", "GPP_C", "GPP_D", "GPP_E", "GPD", "GPP_I", "GPP_J", "GPP_K",
|
||||
// "GPP_G", "GPP_H", "GPP_L"
|
||||
var GPPGroups = []string{"GPP_", "GPD"}
|
||||
|
||||
var remapping = common.ResetSources{
|
||||
0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
|
||||
0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
package lbg
|
||||
|
||||
import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
|
||||
|
||||
// CheckKeyword() parses lines of the configuration file and returns true if the keyword is
|
||||
// contained in the line
|
||||
// "GPP_A", "GPP_B", "GPP_F", "GPP_C", "GPP_D", "GPP_E", "GPD", "GPP_I", "GPP_J",
|
||||
// "GPP_K", "GPP_G", "GPP_H", "GPP_L"
|
||||
func CheckKeyword(line string) bool {
|
||||
included, _ := common.KeywordsCheck(line, "GPP_", "GPD")
|
||||
return included
|
||||
}
|
||||
|
|
@ -14,6 +14,10 @@ const (
|
|||
DW1Mask = 0b11111101111111111100001111111111
|
||||
)
|
||||
|
||||
// "GPP_V", "GPP_C", "GPP_A", "GPP_E", "GPP_H", "GPP_F", "GPP_S", "GPP_B", "GPP_D", "GPD",
|
||||
// "VGPIO_USB", "VGPIO_PCIE"
|
||||
var GPPGroups = []string{"GPP_", "GPD", "VGPIO"}
|
||||
|
||||
var remapping = common.ResetSources{
|
||||
0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
|
||||
0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
package mtl
|
||||
|
||||
import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
|
||||
|
||||
// Group : "GPP_V", "GPP_C", "GPP_A", "GPP_E", "GPP_H", "GPP_F", "GPP_S", "GPP_B", "GPP_D",
|
||||
// "GPD", "VGPIO_USB", "VGPIO_PCIE"
|
||||
|
||||
// CheckKeyword - This function is used to filter parsed lines of the configuration file and
|
||||
// returns true if the keyword is contained in the line.
|
||||
// line : string from the configuration file
|
||||
func CheckKeyword(line string) bool {
|
||||
isIncluded, _ := common.KeywordsCheck(line, "GPP_", "GPD", "VGPIO")
|
||||
return isIncluded
|
||||
}
|
||||
|
|
@ -4,7 +4,6 @@ import (
|
|||
"fmt"
|
||||
|
||||
"review.coreboot.org/coreboot.git/util/intelp2m/config/p2m"
|
||||
"review.coreboot.org/coreboot.git/util/intelp2m/logs"
|
||||
"review.coreboot.org/coreboot.git/util/intelp2m/platforms/adl"
|
||||
"review.coreboot.org/coreboot.git/util/intelp2m/platforms/apl"
|
||||
"review.coreboot.org/coreboot.git/util/intelp2m/platforms/cnl"
|
||||
|
|
@ -17,10 +16,10 @@ import (
|
|||
"review.coreboot.org/coreboot.git/util/intelp2m/platforms/tgl"
|
||||
)
|
||||
|
||||
type KeywordAction func(line string) bool
|
||||
|
||||
type Constructor func(dw0, dw1 uint32) common.PlatformIf
|
||||
|
||||
var ErrUnregisteredPlatform = fmt.Errorf("unregistered platform type %d", p2m.Config.Platform)
|
||||
|
||||
var platformConstructorMap = map[p2m.PlatformType]Constructor{
|
||||
p2m.Alder: adl.GetPlatform,
|
||||
p2m.Apollo: apl.GetPlatform,
|
||||
|
|
@ -33,30 +32,30 @@ var platformConstructorMap = map[p2m.PlatformType]Constructor{
|
|||
p2m.Lewisburg: lbg.GetPlatform,
|
||||
}
|
||||
|
||||
func GetKeywordChekingAction() KeywordAction {
|
||||
actions := map[p2m.PlatformType]KeywordAction{
|
||||
p2m.Alder: adl.CheckKeyword,
|
||||
p2m.Apollo: apl.CheckKeyword,
|
||||
p2m.Cannon: cnl.CheckKeyword,
|
||||
p2m.Sunrise: snr.CheckKeyword,
|
||||
p2m.Tiger: tgl.CheckKeyword,
|
||||
p2m.Jasper: jsl.CheckKeyword,
|
||||
p2m.Meteor: mtl.CheckKeyword,
|
||||
p2m.Emmitsburg: ebg.CheckKeyword,
|
||||
p2m.Lewisburg: lbg.CheckKeyword,
|
||||
}
|
||||
action, exist := actions[p2m.Config.Platform]
|
||||
if !exist {
|
||||
logs.Errorf("unregistered platform type %d", p2m.Config.Platform)
|
||||
return nil
|
||||
}
|
||||
return action
|
||||
var GppMap = map[p2m.PlatformType][]string{
|
||||
p2m.Alder: adl.GPPGroups,
|
||||
p2m.Apollo: apl.GPPGroups,
|
||||
p2m.Cannon: cnl.GPPGroups,
|
||||
p2m.Sunrise: snr.GPPGroups,
|
||||
p2m.Tiger: tgl.GPPGroups,
|
||||
p2m.Jasper: jsl.GPPGroups,
|
||||
p2m.Meteor: mtl.GPPGroups,
|
||||
p2m.Emmitsburg: ebg.GPPGroups,
|
||||
p2m.Lewisburg: lbg.GPPGroups,
|
||||
}
|
||||
|
||||
func GetConstructor() (Constructor, error) {
|
||||
constructor, exist := platformConstructorMap[p2m.Config.Platform]
|
||||
if !exist {
|
||||
return nil, fmt.Errorf("unregistered platform type %d", p2m.Config.Platform)
|
||||
return nil, ErrUnregisteredPlatform
|
||||
}
|
||||
return constructor, nil
|
||||
}
|
||||
|
||||
func GetGPPGroups() ([]string, error) {
|
||||
groups, exist := GppMap[p2m.Config.Platform]
|
||||
if !exist {
|
||||
return nil, ErrUnregisteredPlatform
|
||||
}
|
||||
return groups, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ const (
|
|||
DW1Mask uint32 = 0b11111101111111111100001111111111
|
||||
)
|
||||
|
||||
// "GPP_A", "GPP_B", "GPP_F", "GPP_C", "GPP_D", "GPP_E", "GPD", "GPP_I", "GPP_J", "GPP_G",
|
||||
// "GPP_H", "GPP_L"
|
||||
var GPPGroups = []string{"GPP_", "GPD"}
|
||||
|
||||
var remapping = common.ResetSources{
|
||||
0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
|
||||
0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
package snr
|
||||
|
||||
import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
|
||||
|
||||
// CheckKeyword() parses lines of the configuration file and returns true if the keyword is
|
||||
// contained in the line
|
||||
// "GPP_A", "GPP_B", "GPP_F", "GPP_C", "GPP_D", "GPP_E", "GPD", "GPP_I", "GPP_J",
|
||||
// "GPP_K", "GPP_G", "GPP_H", "GPP_L"
|
||||
func CheckKeyword(line string) bool {
|
||||
included, _ := common.KeywordsCheck(line, "GPP_", "GPD")
|
||||
return included
|
||||
}
|
||||
|
|
@ -14,6 +14,10 @@ const (
|
|||
DW1Mask = 0b11111101111111111100001111111111
|
||||
)
|
||||
|
||||
// "GPP_A", "GPP_R", "GPP_B", "GPP_D", "GPP_C", "GPP_S", "GPP_G", "GPD", "GPP_E", "GPP_F",
|
||||
// "GPP_H", "GPP_J", "GPP_K", "GPP_I", "VGPIO_USB", "VGPIO_PCIE"
|
||||
var GPPGroups = []string{"GPP_", "GPD", "VGPIO"}
|
||||
|
||||
var remapping = common.ResetSources{
|
||||
0b00: bits.RstCfgRSMRST << bits.DW0PadRstCfg,
|
||||
0b01: bits.RstCfgDEEP << bits.DW0PadRstCfg,
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
package tgl
|
||||
|
||||
import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
|
||||
|
||||
// Group : "GPP_A", "GPP_R", "GPP_B", "GPP_D", "GPP_C", "GPP_S", "GPP_G", "GPD", "GPP_E",
|
||||
// "GPP_F", "GPP_H", "GPP_J", "GPP_K", "GPP_I", "VGPIO_USB", "VGPIO_PCIE"
|
||||
|
||||
// CheckKeyword - This function is used to filter parsed lines of the configuration file
|
||||
// and returns true if the keyword is contained in the line.
|
||||
// line : string from the configuration file
|
||||
func CheckKeyword(line string) bool {
|
||||
isIncluded, _ := common.KeywordsCheck(line, "GPP_", "GPD", "VGPIO")
|
||||
return isIncluded
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue