cbi

package
v0.0.0-...-b6ab735 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

CBI corruption detection and repair logic. go/cbi-auto-recovery-dd

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsCBIMagic

func ContainsCBIMagic(cbi *labapi.Cbi) bool

ContainsCBIMagic returns true if the rawContents of the CBI proto start with the CBI magic bytes.

func GetCBIContents

func GetCBIContents(ctx context.Context, run components.Runner) (*labapi.Cbi, error)

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.

Jump to

Keyboard shortcuts

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