coreboot/util/intelp2m/fields/fields.go
Maxim Polyakov 5fe0b88b15 util/intelp2m/config: Rework configuration package
- Reduce the number of methods for updating settings and redefine types
  to make the code cleaner and more readable.
- Move the configuration to the p2m package to add settings from new
  utilities based on the intelp2m code.
- Make some code style fixes.

TEST: make test = PASS

Change-Id: Ia1b19ae3122bcf6ec740ae4683d62f31570670b1
Signed-off-by: Maxim Polyakov <max.senia.poliak@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70308
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2025-03-03 21:40:03 +00:00

21 lines
726 B
Go

package fields
import (
"review.coreboot.org/coreboot.git/util/intelp2m/config/p2m"
"review.coreboot.org/coreboot.git/util/intelp2m/fields/cb"
"review.coreboot.org/coreboot.git/util/intelp2m/fields/fsp"
"review.coreboot.org/coreboot.git/util/intelp2m/fields/raw"
"review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
)
// InterfaceSet - set the interface for decoding configuration
// registers DW0 and DW1.
func InterfaceGet() common.Fields {
var fldstylemap = map[p2m.FieldType]common.Fields{
p2m.NoFlds: cb.FieldMacros{}, // analyze fields using cb macros
p2m.CbFlds: cb.FieldMacros{},
p2m.FspFlds: fsp.FieldMacros{},
p2m.RawFlds: raw.FieldMacros{},
}
return fldstylemap[p2m.Config.Field]
}