Documentation ¶
Index ¶
- Constants
- Variables
- func GetDimmEntry() (string, error)
- func GetDongleIoEntry(index uint64, pin int64) (string, error)
- func GetFabricoEntry(index uint64) (string, error)
- func GetFanDuty(target string, peer bool) (duty string, pwm string, rpm string, fault string, err error)
- func GetFanEntry(peer bool) (string, string, error)
- func GetFpgaVersion() (string, error)
- func GetIomAttLedsEntry(pin int64) (string, error)
- func GetLed(target string, peer bool) (value string, err error)
- func GetMiscIoEntry(peer bool, pin int64) (string, error)
- func GetOdpEntry(peer bool) (vpdEntry string, tempEntry string, err error)
- func GetOdpLedsEntry(peer bool, pin int64) (string, error)
- func GetPsuCurrent(index int) (string, error)
- func GetPsuEntry(peer bool) (eepromEntry string, psuEntry string, err error)
- func GetPsuFan(index int) (string, error)
- func GetPsuModel(index int) (string, error)
- func GetPsuPower(index int) (string, error)
- func GetPsuPowerMax(index int) (string, error)
- func GetPsuSerial(index int) (string, error)
- func GetPsuStatus(index int) (int, error)
- func GetPsuTemp(index int) (string, error)
- func GetPsuTempMax(index int) (string, error)
- func GetPsuVersion(index int) (string, error)
- func GetPsuVoltage(index int) (string, error)
- func GetPwrVrEntry() (string, string, string, error)
- func GetQsfpEepromEntry() (string, string, string, string, string, string, error)
- func GetQsfpIoEntry(pin int64) (string, error)
- func GetSfpLowPower(port int) (int, error)
- func GetSysEepromEntry() (string, error)
- func GetTempEntry() (string, error)
- func GetThermalDimm() (string, error)
- func GetThermalOdp(index int) (string, error)
- func GetThermalSsd(index int) (string, error)
- func GetThermalSwm(index int) (string, error)
- func GetVSensorsEntry() (string, string, string, error)
- func IsReseting(port int) (int, error)
- func IsSlotA() (bool, error)
- func ReadFpga(reg uint32, size uint32) ([]int, error)
- func ResetSfp(port int) error
- func SetFanDuty(target string, peer bool, duty string) error
- func SetLed(target string, value string, peer bool) error
- func SetSfpLowPower(port int, lpmode int) error
- func UnprotectSysEeprom() error
- func UpdateFpga(url string, callback func(name string, curProgress int, maxProgress int)) error
- func WriteFpga(reg uint32, val []int) error
- type FpgaUpdater
- func (fu *FpgaUpdater) Deinit() error
- func (fu *FpgaUpdater) DumpFlashAll(file *os.File, callback func(string, int, int)) error
- func (fu *FpgaUpdater) DumpReverseFlashAll(file *os.File, callback func(string, int, int)) error
- func (fu *FpgaUpdater) EraseBulk() error
- func (fu *FpgaUpdater) EraseFlashAll() error
- func (fu *FpgaUpdater) EraseSector(addr int) error
- func (fu *FpgaUpdater) FastRead(addr int, length int) ([]int, error)
- func (fu *FpgaUpdater) Init() error
- func (fu *FpgaUpdater) IsPofValid(pof *os.File) error
- func (fu *FpgaUpdater) ReadBytes(addr int, length int) ([]int, error)
- func (fu *FpgaUpdater) ReadConfig() ([]int, error)
- func (fu *FpgaUpdater) ReadFlashAll(callback func(string, int, int)) ([]int, error)
- func (fu *FpgaUpdater) ReadStatus() ([]int, error)
- func (fu *FpgaUpdater) SeekPofToData(pof *os.File) (dataOffset int, err error)
- func (fu *FpgaUpdater) VerifyFlashAll(pof *os.File, callback func(string, int, int)) error
- func (fu *FpgaUpdater) WriteBytes(addr int, data []int) error
- func (fu *FpgaUpdater) WriteEnable() error
- func (fu *FpgaUpdater) WriteFlashAll(pof *os.File, callback func(string, int, int)) error
- type Gpio
- type IrenePlatform
- func (irene *IrenePlatform) Deinit(c *cli.Context) error
- func (irene *IrenePlatform) GetEntry(c *cli.Context) error
- func (irene *IrenePlatform) GetFan(c *cli.Context) error
- func (irene *IrenePlatform) GetFpga(c *cli.Context) error
- func (irene *IrenePlatform) GetInfo(c *cli.Context) error
- func (irene *IrenePlatform) GetLed(c *cli.Context) error
- func (irene *IrenePlatform) GetPsu(c *cli.Context) error
- func (irene *IrenePlatform) GetSensor(c *cli.Context) error
- func (irene *IrenePlatform) GetSfp(c *cli.Context) error
- func (irene *IrenePlatform) GetSysEeprom(c *cli.Context) error
- func (irene *IrenePlatform) GetThermal(c *cli.Context) error
- func (irene *IrenePlatform) Init(c *cli.Context) error
- func (irene *IrenePlatform) SetFan(c *cli.Context) error
- func (irene *IrenePlatform) SetFpga(c *cli.Context) error
- func (irene *IrenePlatform) SetLed(c *cli.Context) error
- func (irene *IrenePlatform) SetSfp(c *cli.Context) error
- func (irene *IrenePlatform) SetSysEeprom(c *cli.Context) error
- func (irene *IrenePlatform) SyncSysEeprom(c *cli.Context) error
- func (irene *IrenePlatform) Update(c *cli.Context) error
- type SysEepromInfo
Constants ¶
const ( PROGRAM_RX_DATA_REG uint32 = 0xD0 PROGRAM_TX_DATA_REG uint32 = 0xD4 PROGRAM_STATUS_REG uint32 = 0xD8 PROGRAM_CTL_REG uint32 = 0xDC )
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 )
const ( // cgo may get the SIGSEGV from readFpgaAddr() C.inb(0x700) // So we use static FPGA adddress instead FPGA_ADDRESS uint32 = uint32(0xfe500000) )
Variables ¶
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 GetDongleIoEntry ¶
GetDongleIoEntry is used to get donle IO entry
func GetFabricoEntry ¶
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 ¶
GetFanEntry is used to get fan entry
func GetFpgaVersion ¶
GetFpgaVersion is used to get FPGA version
func GetIomAttLedsEntry ¶
GetIomAttLedsEntry is used to get Iom LEDs
func GetMiscIoEntry ¶
GetMiscIoEntry is used to get MISC IO entry
func GetOdpEntry ¶
GetOdpEntry is used to get ODP entry
func GetOdpLedsEntry ¶
GetOdpLedsEntry is used to get ODP Leds entry
func GetPsuCurrent ¶
func GetPsuEntry ¶
GetPsuEntry is used to get PSU entry
func GetPsuPower ¶
func GetPsuPowerMax ¶
func GetPsuSerial ¶
func GetPsuStatus ¶
GetPsuStatus is to check if the PSU status is OK
func GetPsuTemp ¶
func GetPsuTempMax ¶
func GetPsuVersion ¶
func GetPsuVoltage ¶
func GetPwrVrEntry ¶
GetPwrVrEntry is used to get power VR entry
func GetQsfpEepromEntry ¶
GetQsfpEepromEntry is used to get QSFP eeprom entry
func GetQsfpIoEntry ¶
GetQsfoIoEntry is used to get QSFP IO entry
func GetSfpLowPower ¶
GetSfpLowPower is to check if the SFP is in low power mode
func GetSysEepromEntry ¶
GetSysEepromEntry is used the get system eeprom entry
func GetThermalDimm ¶
func GetThermalOdp ¶
func GetThermalSsd ¶
func GetThermalSwm ¶
func GetVSensorsEntry ¶
GetVSensorsEntry is used to get V Sensor entry
func IsReseting ¶
IsResting is used to get the reset status: 0=Idle, 1=Reseting
func SetFanDuty ¶
SetFanDuty is used to set fan duty
func SetSfpLowPower ¶
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 ¶
Types ¶
type FpgaUpdater ¶
type FpgaUpdater struct {
// contains filtered or unexported fields
}
func (*FpgaUpdater) Deinit ¶
func (fu *FpgaUpdater) Deinit() error
func (*FpgaUpdater) DumpFlashAll ¶
func (*FpgaUpdater) DumpReverseFlashAll ¶
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) 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 (*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 (*FpgaUpdater) WriteBytes ¶
func (fu *FpgaUpdater) WriteBytes(addr int, data []int) error
func (*FpgaUpdater) WriteEnable ¶
func (fu *FpgaUpdater) WriteEnable() error
func (*FpgaUpdater) WriteFlashAll ¶
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)