fsp

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package fsp implements FSP info header parsing

Index

Constants

View Source
const (
	// size of the shared part of the header across FSP spec revisions
	FixedInfoHeaderLength = 12
	HeaderV3Length        = 72
	HeaderV4Length        = 72
	HeaderV5Length        = 76
	HeaderV6Length        = 80
	// FSP 2.0
	CurrentSpecVersion = SpecVersion(0x20)
	HeaderMinRevision  = 3
	HeaderMaxRevision  = 6
	// FSP 3.0
	UnsupportedSpecVersion = SpecVersion(0x30)
)

constants from the FSP 2.0 spec

Variables

View Source
var (
	Signature = [4]byte{'F', 'S', 'P', 'H'}
)

values from the FSP 2.0 spec

Functions

This section is empty.

Types

type CommonInfoHeader added in v1.2.0

type CommonInfoHeader struct {
	Signature                      [4]byte
	HeaderLength                   uint32
	SpecVersion                    SpecVersion
	HeaderRevision                 uint8
	ImageRevision                  ImageRevision
	ImageID                        [8]byte
	ImageSize                      uint32
	ImageBase                      uint32
	ImageAttribute                 ImageAttribute
	ComponentAttribute             ComponentAttribute
	CfgRegionOffset                uint32
	CfgRegionSize                  uint32
	TempRAMInitEntryOffset         uint32
	NotifyPhaseEntryOffset         uint32
	FSPMemoryInitEntryOffset       uint32
	TempRAMExitEntryOffset         uint32
	FSPSiliconInitEntryOffset      uint32
	FspMultiPhaseSiInitEntryOffset uint32
	ExtendedImageRevision          uint16
}

CommonInfoHeader represents the FSP_INFO_HEADER structure revision independent

func NewInfoHeader

func NewInfoHeader(b []byte) (*CommonInfoHeader, error)

NewInfoHeader creates an CommonInfoHeader from a byte buffer.

func (CommonInfoHeader) Summary added in v1.2.0

func (ih CommonInfoHeader) Summary() string

Summary prints a multi-line summary of the header's content.

type ComponentAttribute

type ComponentAttribute uint16

ComponentAttribute represents the component attribute.

func (ComponentAttribute) IsDebugBuild

func (ca ComponentAttribute) IsDebugBuild() bool

IsDebugBuild returns true if the FSP build is a debug build, and false if it's a release build.

func (ComponentAttribute) IsTestRelease

func (ca ComponentAttribute) IsTestRelease() bool

IsTestRelease returns true if the release is a test release, and false if it's an official release.

func (ComponentAttribute) String

func (ca ComponentAttribute) String() string

func (ComponentAttribute) Type

func (ca ComponentAttribute) Type() Type

Type returns the FSP type.

type FixedInfoHeader

type FixedInfoHeader struct {
	Signature      [4]byte
	HeaderLength   uint32
	Reserved1      [2]uint8
	SpecVersion    SpecVersion
	HeaderRevision uint8
}

FixedInfoHeader is the common header among the various revisions of the FSP info header.

type ImageAttribute

type ImageAttribute uint16

ImageAttribute represents the image attributes.

func (ImageAttribute) IsDispatchModeSupported added in v1.2.0

func (ia ImageAttribute) IsDispatchModeSupported() bool

IsDispatchModeSupported returns true if FSP supports Dispatch mode.

func (ImageAttribute) IsGraphicsDisplaySupported

func (ia ImageAttribute) IsGraphicsDisplaySupported() bool

IsGraphicsDisplaySupported returns true if FSP supports enabling graphics display.

func (ImageAttribute) String

func (ia ImageAttribute) String() string

type ImageRevision

type ImageRevision uint64

ImageRevision is the image revision field of the FSP info header.

func DecodeImageRevision added in v1.2.0

func DecodeImageRevision(HeaderRevision uint8, Revision uint32, ExtendedRevision uint16) ImageRevision

func (ImageRevision) String

func (ir ImageRevision) String() string

type InfoHeaderRev3

type InfoHeaderRev3 struct {
	FixedInfoHeader
	ImageRevisionLowBytes     uint32
	ImageID                   [8]byte
	ImageSize                 uint32
	ImageBase                 uint32
	ImageAttribute            ImageAttribute
	ComponentAttribute        ComponentAttribute
	CfgRegionOffset           uint32
	CfgRegionSize             uint32
	Reserved2                 [4]byte
	TempRAMInitEntryOffset    uint32
	Reserved3                 [4]byte
	NotifyPhaseEntryOffset    uint32
	FSPMemoryInitEntryOffset  uint32
	TempRAMExitEntryOffset    uint32
	FSPSiliconInitEntryOffset uint32
}

InfoHeaderRev3 represents the FSP_INFO_HEADER structure revision 3 + 4 (FSP 2.0) as defined by Intel.

type InfoHeaderRev5 added in v1.2.0

type InfoHeaderRev5 struct {
	InfoHeaderRev3
	FspMultiPhaseSiInitEntryOffset uint32
}

InfoHeaderRev5 represents the FSP_INFO_HEADER structure revision 5 (FSP 2.0) as defined by Intel.

type InfoHeaderRev6 added in v1.2.0

type InfoHeaderRev6 struct {
	InfoHeaderRev5
	ExtendedImageRevision uint16
	Reserved4             uint16
}

InfoHeaderRev6 represents the FSP_INFO_HEADER structure revision 6 (FSP 2.0) as defined by Intel.

type SpecVersion

type SpecVersion uint8

SpecVersion represents the spec version as a packed BCD two-digit, dot-separated unsigned integer.

func (SpecVersion) String

func (sv SpecVersion) String() string

type Type

type Type uint8

Type identifies the FSP type.

var (
	TypeT Type = 1
	TypeM Type = 2
	TypeS Type = 3
	TypeO Type = 8
	// TypeReserved is a fake type that represents a reserved FSP type.
	TypeReserved Type
)

FSP types. All the other values are reserved.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL