irene

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROGRAM_RX_DATA_REG uint32 = 0xD0
	PROGRAM_TX_DATA_REG uint32 = 0xD4
	PROGRAM_STATUS_REG  uint32 = 0xD8
	PROGRAM_CTL_REG     uint32 = 0xDC
)
View Source
const (
	PROGRAM_FLASH_SIZE      uint32 = 8 * 1024 * 1024 // 8MB for EPCQ64
	PROGRAM_POF_END_ADDRESS uint32 = 0x180000        // FPGA Nelson said POF will only use that much address
	PROGRAM_PAGE_SIZE       uint32 = 0x100           // We can only read/write/erase 256 byes per opcode
)
View Source
const (
	// cgo may get the SIGSEGV from readFpgaAddr() C.inb(0x700)
	// So we use static FPGA adddress instead
	FPGA_ADDRESS uint32 = uint32(0xfe500000)
)

Variables

View Source
var (
	GpioPin = gpioPinDefine{

		OdpLedSystemLocation: 16,
		OdpLedSystemFault:    17,
		OdpLedSegmentsA1:     8,
		OdpLedSegmentsB1:     9,
		OdpLedSegmentsC1:     10,
		OdpLedSegmentsD1:     11,
		OdpLedSegmentsE1:     12,
		OdpLedSegmentsF1:     13,
		OdpLedSegmentsG1:     14,
		OdpLedSegmentsDP1:    15,
		OdpLedSegmentsA2:     0,
		OdpLedSegmentsB2:     1,
		OdpLedSegmentsC2:     2,
		OdpLedSegmentsD2:     3,
		OdpLedSegmentsE2:     4,
		OdpLedSegmentsF2:     5,
		OdpLedSegmentsG2:     6,
		OdpLedSegmentsDP2:    7,
		OdpButton:            23,

		IomAttDimmAtt: 0,
		IomAttFan1Att: 2,
		IomAttFan2Att: 3,
		IomAttFan3Att: 4,
		IomAttFan4Att: 5,
		IomAttFan5Att: 6,
		IomAttFan6Att: 7,
		IomAttNvme:    14,
		IomAttVbat:    15,

		QsfpP0Present:   0,
		QsfpP1Present:   1,
		QsfpP2Present:   2,
		QsfpP3Present:   3,
		QsfpP4Present:   4,
		QsfpP5Present:   5,
		QsfpP0Interrupt: 8,
		QsfpP1Interrupt: 9,
		QsfpP2Interrupt: 10,
		QsfpP3Interrupt: 11,
		QsfpP4Interrupt: 12,
		QsfpP5Interrupt: 13,

		SsdP0Interrupt:  8,
		SsdP1Interrupt:  9,
		SsdP2Interrupt:  10,
		SsdP3Interrupt:  11,
		SsdP4Interrupt:  12,
		SsdP5Interrupt:  13,
		SsdP6Interrupt:  14,
		SsdP7Interrupt:  15,
		SsdP8Interrupt:  8,
		SsdP9Interrupt:  9,
		SsdP10Interrupt: 10,
		SsdP11Interrupt: 11,
		SsdP12Interrupt: 12,
		SsdP13Interrupt: 13,
		SsdP14Interrupt: 14,
		SsdP15Interrupt: 15,
		SsdP16Interrupt: 8,
		SsdP17Interrupt: 9,
		SsdP18Interrupt: 10,
		SsdP19Interrupt: 11,
		SsdP20Interrupt: 12,
		SsdP21Interrupt: 13,
		SsdP22Interrupt: 14,
		SsdP23Interrupt: 15,

		MiscModuleState:   0,
		MiscModulePresent: 1,
		MiscPsuPresent:    2,
		MiscPsuAlert:      3,
		MiscPsuPson:       4,
		MiscPsuAcOk:       5,
		MiscPsuDcOk:       8,
	}
)

Functions

func GetDimmEntry

func GetDimmEntry() (string, error)

GetDimmEntry is used to get DIMM entry

func GetDongleIoEntry

func GetDongleIoEntry(index uint64, pin int64) (string, error)

GetDongleIoEntry is used to get donle IO entry

func GetFabricoEntry

func GetFabricoEntry(index uint64) (string, error)

GetFabricoEntry is used to get fabrico entry

func GetFanDuty

func GetFanDuty(target string, peer bool) (duty string, pwm string, rpm string, fault string, err error)

GetFanDuty is used to get fan duty

func GetFanEntry

func GetFanEntry(peer bool) (string, string, error)

GetFanEntry is used to get fan entry

func GetFpgaVersion

func GetFpgaVersion() (string, error)

GetFpgaVersion is used to get FPGA version

func GetIomAttLedsEntry

func GetIomAttLedsEntry(pin int64) (string, error)

GetIomAttLedsEntry is used to get Iom LEDs

func GetLed

func GetLed(target string, peer bool) (value string, err error)

GetLed is to get the LED status

func GetMiscIoEntry

func GetMiscIoEntry(peer bool, pin int64) (string, error)

GetMiscIoEntry is used to get MISC IO entry

func GetOdpEntry

func GetOdpEntry(peer bool) (vpdEntry string, tempEntry string, err error)

GetOdpEntry is used to get ODP entry

func GetOdpLedsEntry

func GetOdpLedsEntry(peer bool, pin int64) (string, error)

GetOdpLedsEntry is used to get ODP Leds entry

func GetPsuCurrent

func GetPsuCurrent(index int) (string, error)

func GetPsuEntry

func GetPsuEntry(peer bool) (eepromEntry string, psuEntry string, err error)

GetPsuEntry is used to get PSU entry

func GetPsuFan

func GetPsuFan(index int) (string, error)

func GetPsuModel

func GetPsuModel(index int) (string, error)

GetPsuModel is to get PSU model

func GetPsuPower

func GetPsuPower(index int) (string, error)

func GetPsuPowerMax

func GetPsuPowerMax(index int) (string, error)

func GetPsuSerial

func GetPsuSerial(index int) (string, error)

func GetPsuStatus

func GetPsuStatus(index int) (int, error)

GetPsuStatus is to check if the PSU status is OK

func GetPsuTemp

func GetPsuTemp(index int) (string, error)

func GetPsuTempMax

func GetPsuTempMax(index int) (string, error)

func GetPsuVersion

func GetPsuVersion(index int) (string, error)

func GetPsuVoltage

func GetPsuVoltage(index int) (string, error)

func GetPwrVrEntry

func GetPwrVrEntry() (string, string, string, error)

GetPwrVrEntry is used to get power VR entry

func GetQsfpEepromEntry

func GetQsfpEepromEntry() (string, string, string, string, string, string, error)

GetQsfpEepromEntry is used to get QSFP eeprom entry

func GetQsfpIoEntry

func GetQsfpIoEntry(pin int64) (string, error)

GetQsfoIoEntry is used to get QSFP IO entry

func GetSfpLowPower

func GetSfpLowPower(port int) (int, error)

GetSfpLowPower is to check if the SFP is in low power mode

func GetSysEepromEntry

func GetSysEepromEntry() (string, error)

GetSysEepromEntry is used the get system eeprom entry

func GetTempEntry

func GetTempEntry() (string, error)

GetTempEntry is used to get temp entry

func GetThermalDimm

func GetThermalDimm() (string, error)

func GetThermalOdp

func GetThermalOdp(index int) (string, error)

func GetThermalSsd

func GetThermalSsd(index int) (string, error)

func GetThermalSwm

func GetThermalSwm(index int) (string, error)

func GetVSensorsEntry

func GetVSensorsEntry() (string, string, string, error)

GetVSensorsEntry is used to get V Sensor entry

func IsReseting

func IsReseting(port int) (int, error)

IsResting is used to get the reset status: 0=Idle, 1=Reseting

func IsSlotA

func IsSlotA() (bool, error)

IsSlotA is used to check the PCM at Slot A or Slot B

func ReadFpga

func ReadFpga(reg uint32, size uint32) ([]int, error)

ReadFpga returns the value read from the register (reg)

func ResetSfp

func ResetSfp(port int) error

ResetSfp is used to reset SFP

func SetFanDuty

func SetFanDuty(target string, peer bool, duty string) error

SetFanDuty is used to set fan duty

func SetLed

func SetLed(target string, value string, peer bool) error

SetLed is to get the LED status

func SetSfpLowPower

func SetSfpLowPower(port int, lpmode int) error

SetSfpLowPower is to check if the SFP is in low power mode

func UnprotectSysEeprom

func UnprotectSysEeprom() error

UnprotectSysEeprom is to make the system eeprom writable

func UpdateFpga

func UpdateFpga(url string, callback func(name string, curProgress int, maxProgress int)) error

func WriteFpga

func WriteFpga(reg uint32, val []int) error

WriteFpga returns the value read from the register (reg)

Types

type FpgaUpdater

type FpgaUpdater struct {
	// contains filtered or unexported fields
}

func (*FpgaUpdater) Deinit

func (fu *FpgaUpdater) Deinit() error

func (*FpgaUpdater) DumpFlashAll

func (fu *FpgaUpdater) DumpFlashAll(file *os.File, callback func(string, int, int)) error

func (*FpgaUpdater) DumpReverseFlashAll

func (fu *FpgaUpdater) DumpReverseFlashAll(file *os.File, callback func(string, int, int)) error

func (*FpgaUpdater) EraseBulk

func (fu *FpgaUpdater) EraseBulk() error

func (*FpgaUpdater) EraseFlashAll

func (fu *FpgaUpdater) EraseFlashAll() error

func (*FpgaUpdater) EraseSector

func (fu *FpgaUpdater) EraseSector(addr int) error

func (*FpgaUpdater) FastRead

func (fu *FpgaUpdater) FastRead(addr int, length int) ([]int, error)

func (*FpgaUpdater) Init

func (fu *FpgaUpdater) Init() error

func (*FpgaUpdater) IsPofValid

func (fu *FpgaUpdater) IsPofValid(pof *os.File) error

func (*FpgaUpdater) ReadBytes

func (fu *FpgaUpdater) ReadBytes(addr int, length int) ([]int, error)

func (*FpgaUpdater) ReadConfig

func (fu *FpgaUpdater) ReadConfig() ([]int, error)

func (*FpgaUpdater) ReadFlashAll

func (fu *FpgaUpdater) ReadFlashAll(callback func(string, int, int)) ([]int, error)

func (*FpgaUpdater) ReadStatus

func (fu *FpgaUpdater) ReadStatus() ([]int, error)

func (*FpgaUpdater) SeekPofToData

func (fu *FpgaUpdater) SeekPofToData(pof *os.File) (dataOffset int, err error)

func (*FpgaUpdater) VerifyFlashAll

func (fu *FpgaUpdater) VerifyFlashAll(pof *os.File, callback func(string, int, int)) error

func (*FpgaUpdater) WriteBytes

func (fu *FpgaUpdater) WriteBytes(addr int, data []int) error

func (*FpgaUpdater) WriteEnable

func (fu *FpgaUpdater) WriteEnable() error

func (*FpgaUpdater) WriteFlashAll

func (fu *FpgaUpdater) WriteFlashAll(pof *os.File, callback func(string, int, int)) error

type Gpio

type Gpio struct {
	// contains filtered or unexported fields
}

Gpio define the pin behavior

type IrenePlatform

type IrenePlatform struct {
}

IrenePlatform is implemented for Irene

func (*IrenePlatform) Deinit

func (irene *IrenePlatform) Deinit(c *cli.Context) error

Deinit is to deinit platform for Irene

func (*IrenePlatform) GetEntry

func (irene *IrenePlatform) GetEntry(c *cli.Context) error

GetEntry is to get the driver entry for debugging

func (*IrenePlatform) GetFan

func (irene *IrenePlatform) GetFan(c *cli.Context) error

GetFan is to get fan duty for Irene

func (*IrenePlatform) GetFpga

func (irene *IrenePlatform) GetFpga(c *cli.Context) error

GetFpga is to get FPGA register for Irene

func (*IrenePlatform) GetInfo

func (irene *IrenePlatform) GetInfo(c *cli.Context) error

GetInfo is to get information

func (*IrenePlatform) GetLed

func (irene *IrenePlatform) GetLed(c *cli.Context) error

GetLed is to get LED status for Irene

func (*IrenePlatform) GetPsu

func (irene *IrenePlatform) GetPsu(c *cli.Context) error

GetPsu is to get PSU for Irene

func (*IrenePlatform) GetSensor

func (irene *IrenePlatform) GetSensor(c *cli.Context) error

GetSensor is to get sensors

func (*IrenePlatform) GetSfp

func (irene *IrenePlatform) GetSfp(c *cli.Context) error

GetSfp is to get SFP for Irene

func (*IrenePlatform) GetSysEeprom

func (irene *IrenePlatform) GetSysEeprom(c *cli.Context) error

GetSysEeprom is to get system eeprom for Irene

func (*IrenePlatform) GetThermal

func (irene *IrenePlatform) GetThermal(c *cli.Context) error

GetThermal is to get thermal for Irene

func (*IrenePlatform) Init

func (irene *IrenePlatform) Init(c *cli.Context) error

Init is to init platform for Irene

func (*IrenePlatform) SetFan

func (irene *IrenePlatform) SetFan(c *cli.Context) error

SetFan is to set fan duty for Irene

func (*IrenePlatform) SetFpga

func (irene *IrenePlatform) SetFpga(c *cli.Context) error

SetFpga is to set FPGA register for Irene

func (*IrenePlatform) SetLed

func (irene *IrenePlatform) SetLed(c *cli.Context) error

SetLed is to set LED status for Irene

func (*IrenePlatform) SetSfp

func (irene *IrenePlatform) SetSfp(c *cli.Context) error

SetSfp is to set SFP for Irene

func (*IrenePlatform) SetSysEeprom

func (irene *IrenePlatform) SetSysEeprom(c *cli.Context) error

SetSysEeprom is to set system eeprom for Irene

func (*IrenePlatform) SyncSysEeprom

func (irene *IrenePlatform) SyncSysEeprom(c *cli.Context) error

SyncSysEeprom is to sync system eeprom from diag eeprom

func (*IrenePlatform) Update

func (irene *IrenePlatform) Update(c *cli.Context) error

Update is to update device FW

type SysEepromInfo

type SysEepromInfo struct {
	ProductName    string
	PartNumber     string
	SerialNumber   string
	ProductVersion string
	Manufacturer   string
}

func GetSysEepromInfo

func GetSysEepromInfo(path string) (SysEepromInfo, error)

Jump to

Keyboard shortcuts

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