Documentation
¶
Overview ¶
CBI corruption detection and repair logic. go/cbi-auto-recovery-dd
Index ¶
- func ContainsCBIMagic(cbi *labapi.Cbi) bool
- func GetCBIContents(ctx context.Context, run components.Runner) (*labapi.Cbi, error)
- func InvalidateCBICache(ctx context.Context, run components.Runner) error
- func ReadCBIContents(ctx context.Context, run components.Runner, cbiLocation *CBILocation) (*labapi.Cbi, error)
- func VerifyRequiredFields(ctx context.Context, run components.Runner) error
- func WriteCBIContents(ctx context.Context, run components.Runner, cbiLocation *CBILocation, ...) error
- type CBILocation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsCBIMagic ¶
ContainsCBIMagic returns true if the rawContents of the CBI proto start with the CBI magic bytes.
func GetCBIContents ¶
GetCBIContents uses GetCBILocation and ReadCBILocation to both locate and and retrieve all CBI contents from the DUT.
func InvalidateCBICache ¶
func InvalidateCBICache(ctx context.Context, run components.Runner) error
InvalidateCBICache clears the CBI contents cache and returns an error if anything unexpected occurs.
func ReadCBIContents ¶
func ReadCBIContents(ctx context.Context, run components.Runner, cbiLocation *CBILocation) (*labapi.Cbi, error)
ReadCBIContents reads all <cbiSize> bytes from the CBI chip on the DUT in <readIncrement> sized reads using the ectool i2cxfer utility and returns a fully formed CBI proto.
func VerifyRequiredFields ¶
func VerifyRequiredFields(ctx context.Context, run components.Runner) error
VerifyRequiredFields returns an error if any of the required fields are invalid or unable to be retrieved.
func WriteCBIContents ¶
func WriteCBIContents(ctx context.Context, run components.Runner, cbiLocation *CBILocation, cbi *labapi.Cbi) error
WriteCBIContents writes the provided CBI contents to the DUT in writeIncrement sized chunks. Propagates any errors from `ectool i2cxfer`.
Types ¶
type CBILocation ¶
type CBILocation struct {
// contains filtered or unexported fields
}
CBILocation stores the port and address needed to reference CBI contents in EEPROM.
func GetCBILocation ¶
func GetCBILocation(ctx context.Context, run components.Runner) (*CBILocation, error)
GetCBILocation uses the `ectool locatechip` utility to get the CBILocation from the DUT. Will return an error if the DUT doesn't support CBI or if it wasn't able to reach the DUT.