Eiger: add hardware version (#688)

* eiger: hardwareversion, fix firmware version unable to read version scenarios, check to see if febl, febr and beb have same fw version

* feb versions can be picked up only after feb initialization
This commit is contained in:
Dhanya Thattil
2023-03-16 11:59:06 +01:00
committed by GitHub
parent bc46d0f6ab
commit d23722a4b7
16 changed files with 153 additions and 62 deletions

View File

@ -1742,6 +1742,7 @@ int Feb_Control_WriteRegister_BitMask(uint32_t offset, uint32_t data,
int Feb_Control_ReadRegister_BitMask(uint32_t offset, uint32_t *retval,
uint32_t bitmask) {
uint32_t actualOffset = offset;
char side[2][10] = {"right", "left"};
unsigned int addr[2] = {Feb_Control_rightAddress, Feb_Control_leftAddress};
@ -2206,6 +2207,21 @@ int Feb_Control_GetRightFPGATemp() {
return (int)temperature;
}
int Feb_Control_GetFPGAHardwareVersion(int *retval) {
if (!Feb_Control_activated) {
return 0;
}
unsigned int value = 0;
if (!Feb_Control_ReadRegister_BitMask(FEB_REG_STATUS, &value,
FEB_REG_STATUS_FX30_MSK)) {
LOG(logERROR,
("Trouble reading FEB_REG_STATUS reg to feb hardware version\n"));
return 0;
}
*retval = (value >> FEB_REG_STATUS_FX30_OFST);
return 1;
}
int64_t Feb_Control_GetFrontLeftFirmwareVersion() {
if (!Feb_Control_activated) {
return 0;