diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index 26fd6c725..cdec4ff2a 100755 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer differ diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index 04b651d5c..7f63555d6 100755 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -1537,7 +1537,7 @@ int configureMAC(){ // start addr uint32_t addr = RXR_ENDPOINT_START_REG; // get struct memory - udp_header *udp = (udp_header*) (Blackfin_getBaseAddress() + addr * 2); + udp_header *udp = (udp_header*) (Blackfin_getBaseAddress() + addr / 2); memset(udp, 0, sizeof(udp_header)); // mac addresses diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer index 5a9bdfa5e..e810b2d0e 100755 Binary files a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer and b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer differ diff --git a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c index 14202567a..dd8883bc6 100755 --- a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c @@ -1326,7 +1326,7 @@ int configureMAC() { FILE_LOG(logDEBUG1, ("\tWrite back released. MultiPurpose reg: 0x%x\n", bus_r(addr))); FILE_LOG(logDEBUG1, ("\tConfiguring MAC CONF\n")); - mac_conf *mac_conf_regs = (mac_conf*)(Blackfin_getBaseAddress() + ENET_CONF_REG * 2); // direct write + mac_conf *mac_conf_regs = (mac_conf*)(Blackfin_getBaseAddress() + ENET_CONF_REG / 2); // direct write mac_conf_regs->mac.mac_dest_mac1 = ((destmac >> (8 * 5)) & 0xFF); mac_conf_regs->mac.mac_dest_mac2 = ((destmac >> (8 * 4)) & 0xFF); mac_conf_regs->mac.mac_dest_mac3 = ((destmac >> (8 * 3)) & 0xFF); @@ -1364,7 +1364,7 @@ int configureMAC() { mac_conf_regs->udp.udp_chksum = 0x0000; FILE_LOG(logDEBUG1, ("\tConfiguring TSE\n")); - tse_conf *tse_conf_regs = (tse_conf*)(Blackfin_getBaseAddress() + TSE_CONF_REG * 2); // direct write + tse_conf *tse_conf_regs = (tse_conf*)(Blackfin_getBaseAddress() + TSE_CONF_REG / 2); // direct write tse_conf_regs->rev = 0xA00; tse_conf_regs->scratch = 0xCCCCCCCC; tse_conf_regs->command_config = 0xB; diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index 78316b51a..5491e1518 100755 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer and b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer differ diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index e513855a1..8b83cd5a9 100755 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -994,7 +994,7 @@ void setupHeader(int iRxEntry, enum interfaceType type, uint32_t destip, uint64_ // calculate rxr endpoint offset addr += (iRxEntry * RXR_ENDPOINT_OFST); // get struct memory - udp_header *udp = (udp_header*) (Blackfin_getBaseAddress() + addr * 2); + udp_header *udp = (udp_header*) (Blackfin_getBaseAddress() + addr / 2); memset(udp, 0, sizeof(udp_header)); // mac addresses diff --git a/slsDetectorServers/slsDetectorServer/include/blackfin.h b/slsDetectorServers/slsDetectorServer/include/blackfin.h index 8bdcafd64..1e91e1361 100755 --- a/slsDetectorServers/slsDetectorServer/include/blackfin.h +++ b/slsDetectorServers/slsDetectorServer/include/blackfin.h @@ -98,7 +98,7 @@ u_int32_t writeRegister16(u_int32_t offset, u_int32_t data); /** * Get base address for memory copy */ -uint64_t Blackfin_getBaseAddress(); +uint32_t* Blackfin_getBaseAddress(); /** * Map FPGA */ diff --git a/slsDetectorServers/slsDetectorServer/src/blackfin.c b/slsDetectorServers/slsDetectorServer/src/blackfin.c index 31afb8955..b6276b05d 100755 --- a/slsDetectorServers/slsDetectorServer/src/blackfin.c +++ b/slsDetectorServers/slsDetectorServer/src/blackfin.c @@ -8,32 +8,32 @@ #include // mmap /* global variables */ -u_int64_t CSP0BASE = 0; +u_int32_t* csp0base = 0; #define CSP0 0x20200000 #define MEM_SIZE 0x100000 void bus_w16(u_int32_t offset, u_int16_t data) { volatile u_int16_t *ptr1; - ptr1=(u_int16_t*)(CSP0BASE+offset*2); + ptr1=(u_int16_t*)(csp0base + offset / 2); *ptr1=data; } u_int16_t bus_r16(u_int32_t offset){ volatile u_int16_t *ptr1; - ptr1=(u_int16_t*)(CSP0BASE+offset*2); + ptr1=(u_int16_t*)(csp0base + offset / 2); return *ptr1; } void bus_w(u_int32_t offset, u_int32_t data) { volatile u_int32_t *ptr1; - ptr1=(u_int32_t*)(CSP0BASE+offset*2); + ptr1=(u_int32_t*)(csp0base + offset / 2); *ptr1=data; } u_int32_t bus_r(u_int32_t offset) { volatile u_int32_t *ptr1; - ptr1=(u_int32_t*)(CSP0BASE+offset*2); + ptr1=(u_int32_t*)(csp0base + offset / 2); return *ptr1; } @@ -93,11 +93,11 @@ u_int32_t writeRegister16(u_int32_t offset, u_int32_t data) { int mapCSP0(void) { // if not mapped - if (CSP0BASE == 0) { + if (csp0base == 0) { FILE_LOG(logINFO, ("Mapping memory\n")); #ifdef VIRTUAL - CSP0BASE = malloc(MEM_SIZE); - if (CSP0BASE == NULL) { + csp0base = malloc(MEM_SIZE); + if (csp0base == NULL) { FILE_LOG(logERROR, ("Could not allocate virtual memory.\n")); return FAIL; } @@ -110,15 +110,14 @@ int mapCSP0(void) { return FAIL; } FILE_LOG(logDEBUG1, ("/dev/mem opened\n")); - CSP0BASE = mmap(0, MEM_SIZE, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, CSP0); - if (CSP0BASE == MAP_FAILED) { + csp0base = mmap(0, MEM_SIZE, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, CSP0); + if (csp0base == MAP_FAILED) { FILE_LOG(logERROR, ("Can't map memmory area\n")); return FAIL; } #endif - FILE_LOG(logINFO, ("CSPOBASE mapped from 0x%llx to 0x%llx\n", - (long long unsigned int)CSP0BASE, - (long long unsigned int)(CSP0BASE+MEM_SIZE))); + FILE_LOG(logINFO, ("csp0base mapped from %p to %p\n", + csp0base, (csp0base + MEM_SIZE))); FILE_LOG(logINFO, ("Status Register: %08x\n", bus_r(STATUS_REG))); }else FILE_LOG(logINFO, ("Memory already mapped before\n")); @@ -126,6 +125,6 @@ int mapCSP0(void) { } -uint64_t Blackfin_getBaseAddress() { - return CSP0BASE; +uint32_t* Blackfin_getBaseAddress() { + return csp0base; } \ No newline at end of file diff --git a/slsSupportLib/include/versionAPI.h b/slsSupportLib/include/versionAPI.h index c0356b1cd..e0d66833f 100644 --- a/slsSupportLib/include/versionAPI.h +++ b/slsSupportLib/include/versionAPI.h @@ -5,8 +5,8 @@ #define APIGUI 0x190723 #define APIMOENCH 0x190820 #define APIEIGER 0x191111 +#define APIGOTTHARD2 0x191127 +#define APIMYTHEN3 0x191127 #define APICTB 0x191127 #define APIGOTTHARD 0x191127 -#define APIGOTTHARD2 0x191127 #define APIJUNGFRAU 0x191127 -#define APIMYTHEN3 0x191127