gotthard2, mythen3: firmware type check added, others: minor print

This commit is contained in:
maliakal_d 2020-03-10 16:25:07 +01:00
parent 1d2f4a8af0
commit 2cb09a590a
13 changed files with 9 additions and 9 deletions

View File

@ -192,7 +192,7 @@ int checkType() {
uint32_t expectedType = (((FPGA_VERSION_DTCTR_TYP_CTB_VAL) & FPGA_VERSION_DTCTR_TYP_MSK) >> FPGA_VERSION_DTCTR_TYP_OFST); uint32_t expectedType = (((FPGA_VERSION_DTCTR_TYP_CTB_VAL) & FPGA_VERSION_DTCTR_TYP_MSK) >> FPGA_VERSION_DTCTR_TYP_OFST);
if (type != expectedType) { if (type != expectedType) {
FILE_LOG(logERROR, ("(Type Fail) - This is not a Chip Test Board Server (read %d, expected %d)\n", FILE_LOG(logERROR, ("(Type Fail) - This is not a Chip Test Board firmware (read %d, expected %d)\n",
type, expectedType)); type, expectedType));
return FAIL; return FAIL;
} }

View File

@ -85,7 +85,7 @@ void basictests() {
return; return;
} }
// does check only if flag is 0 (by default), set by command line // does check only if flag is 0 (by default), set by command line
if ((!debugflag) && ((testFpga() == FAIL) || (testBus() == FAIL))) { if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL) || (testBus() == FAIL))) {
sprintf(initErrorMessage, sprintf(initErrorMessage,
"Could not pass basic tests of FPGA and bus. Dangerous to continue. (Firmware version:0x%llx) \n", getFirmwareVersion()); "Could not pass basic tests of FPGA and bus. Dangerous to continue. (Firmware version:0x%llx) \n", getFirmwareVersion());
FILE_LOG(logERROR, ("%s\n\n", initErrorMessage)); FILE_LOG(logERROR, ("%s\n\n", initErrorMessage));
@ -172,7 +172,7 @@ int checkType() {
#endif #endif
u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST); u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
if (type != GOTTHARD2){ if (type != GOTTHARD2){
FILE_LOG(logERROR, ("This is not a Gotthard2 Server (read %d, expected %d)\n", type, GOTTHARD2)); FILE_LOG(logERROR, ("This is not a Gotthard2 firmware (read %d, expected %d)\n", type, GOTTHARD2));
return FAIL; return FAIL;
} }
return OK; return OK;

View File

@ -127,7 +127,7 @@ int checkType() {
#endif #endif
u_int32_t type = ((bus_r(BOARD_REVISION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST); u_int32_t type = ((bus_r(BOARD_REVISION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
if (type == DETECTOR_TYPE_MOENCH_VAL){ if (type == DETECTOR_TYPE_MOENCH_VAL){
FILE_LOG(logERROR, ("This is not a Gotthard Server (read %d, expected ?)\n", type)); FILE_LOG(logERROR, ("This is not a Gotthard firmware (read %d, expected ?)\n", type));
return FAIL; return FAIL;
} }
return OK; return OK;

View File

@ -169,7 +169,7 @@ int checkType() {
#endif #endif
u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST); u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
if (type != JUNGFRAU){ if (type != JUNGFRAU){
FILE_LOG(logERROR, ("This is not a Jungfrau Server (read %d, expected %d)\n", type, JUNGFRAU)); FILE_LOG(logERROR, ("This is not a Jungfrau firmware (read %d, expected %d)\n", type, JUNGFRAU));
return FAIL; return FAIL;
} }

View File

@ -187,7 +187,7 @@ int checkType() {
uint32_t expectedType = (((FPGA_VERSION_DTCTR_TYP_MOENCH_VAL) & FPGA_VERSION_DTCTR_TYP_MSK) >> FPGA_VERSION_DTCTR_TYP_OFST); uint32_t expectedType = (((FPGA_VERSION_DTCTR_TYP_MOENCH_VAL) & FPGA_VERSION_DTCTR_TYP_MSK) >> FPGA_VERSION_DTCTR_TYP_OFST);
if (type != expectedType) { if (type != expectedType) {
FILE_LOG(logERROR, ("(Type Fail) - This is not a Moench Detector Server (read %d, expected %d)\n", FILE_LOG(logERROR, ("(Type Fail) - This is not a Moench Detector firmware (read %d, expected %d)\n",
type, expectedType)); type, expectedType));
return FAIL; return FAIL;
} }

View File

@ -72,7 +72,7 @@ void basictests() {
return; return;
} }
// does check only if flag is 0 (by default), set by command line // does check only if flag is 0 (by default), set by command line
if ((!debugflag) && ((testFpga() == FAIL)|| (testBus() == FAIL))) { if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL)|| (testBus() == FAIL))) {
strcpy(initErrorMessage, strcpy(initErrorMessage,
"Could not pass basic tests of FPGA and bus. Dangerous to continue.\n"); "Could not pass basic tests of FPGA and bus. Dangerous to continue.\n");
FILE_LOG(logERROR, ("%s\n\n", initErrorMessage)); FILE_LOG(logERROR, ("%s\n\n", initErrorMessage));
@ -160,7 +160,7 @@ int checkType() {
#endif #endif
u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST); u_int32_t type = ((bus_r(FPGA_VERSION_REG) & DETECTOR_TYPE_MSK) >> DETECTOR_TYPE_OFST);
if (type != MYTHEN3){ if (type != MYTHEN3){
FILE_LOG(logERROR, ("This is not a Mythen3 Server (read %d, expected %d)\n", type, MYTHEN3)); FILE_LOG(logERROR, ("This is not a Mythen3 firmware (read %d, expected %d)\n", type, MYTHEN3));
return FAIL; return FAIL;
} }

View File

@ -3,10 +3,10 @@
#define APILIB 0x200227 #define APILIB 0x200227
#define APIRECEIVER 0x200227 #define APIRECEIVER 0x200227
#define APIGUI 0x200227 #define APIGUI 0x200227
#define APIEIGER 0x200310
#define APICTB 0x200310 #define APICTB 0x200310
#define APIGOTTHARD 0x200310 #define APIGOTTHARD 0x200310
#define APIGOTTHARD2 0x200310 #define APIGOTTHARD2 0x200310
#define APIJUNGFRAU 0x200310 #define APIJUNGFRAU 0x200310
#define APIMYTHEN3 0x200310 #define APIMYTHEN3 0x200310
#define APIMOENCH 0x200310 #define APIMOENCH 0x200310
#define APIEIGER 0x200310