mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-20 19:30:42 +02:00
fix bug in blackfin read access to firmware registers
This commit is contained in:
parent
0d5d851585
commit
9051dae787
@ -15,6 +15,7 @@
|
|||||||
#include "loadPattern.h"
|
#include "loadPattern.h"
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h> // usleep
|
#include <unistd.h> // usleep
|
||||||
@ -93,6 +94,7 @@ void basictests() {
|
|||||||
LOG(logINFOBLUE, ("********* Chip Test Board Virtual Server *********\n"));
|
LOG(logINFOBLUE, ("********* Chip Test Board Virtual Server *********\n"));
|
||||||
#else
|
#else
|
||||||
LOG(logINFOBLUE, ("************* Chip Test Board Server *************\n"));
|
LOG(logINFOBLUE, ("************* Chip Test Board Server *************\n"));
|
||||||
|
enableBlackfinAMCExternalAccessExtension();
|
||||||
initError = defineGPIOpins(initErrorMessage);
|
initError = defineGPIOpins(initErrorMessage);
|
||||||
if (initError == FAIL) {
|
if (initError == FAIL) {
|
||||||
return;
|
return;
|
||||||
@ -438,6 +440,33 @@ uint32_t getDetectorIP() {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void enableBlackfinAMCExternalAccessExtension() {
|
||||||
|
unsigned int value;
|
||||||
|
const char *file_path = "/sys/kernel/debug/blackfin/ebiu_amc/EBIU_AMBCTL1";
|
||||||
|
|
||||||
|
FILE *file = fopen(file_path, "r");
|
||||||
|
if (!file) {
|
||||||
|
LOG(logERROR, ("Failed to read EBIU_AMBCTL1\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fscanf(file, "%x", &value);
|
||||||
|
fclose(file);
|
||||||
|
|
||||||
|
// enable support for ARDY signal on interface to FPGA
|
||||||
|
// needed to properly translate avalon_mm_waitrequest in the CTB firmware
|
||||||
|
// https://www.analog.com/media/en/dsp-documentation/processor-manuals/bf537_hwr_Rev3.2.pdf
|
||||||
|
// page 274
|
||||||
|
value |= 0x3;
|
||||||
|
|
||||||
|
file = fopen(file_path, "w");
|
||||||
|
if (!file) {
|
||||||
|
LOG(logERROR, ("Failed to enable blackfin AMC access extension\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fprintf(file, "0x%x", value);
|
||||||
|
fclose(file);
|
||||||
|
}
|
||||||
|
|
||||||
/* initialization */
|
/* initialization */
|
||||||
|
|
||||||
void initControlServer() {
|
void initControlServer() {
|
||||||
|
@ -135,6 +135,7 @@ void setupDetector();
|
|||||||
#if defined(CHIPTESTBOARDD)
|
#if defined(CHIPTESTBOARDD)
|
||||||
int updateDatabytesandAllocateRAM();
|
int updateDatabytesandAllocateRAM();
|
||||||
void updateDataBytes();
|
void updateDataBytes();
|
||||||
|
void enableBlackfinAMCExternalAccessExtension();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD)
|
#if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user