Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
lerwys committed Jun 27, 2017
2 parents 80637f2 + 4004bd8 commit c244c6a
Show file tree
Hide file tree
Showing 21 changed files with 110 additions and 60 deletions.
7 changes: 5 additions & 2 deletions core/dev_io/src/dev_io/c/dev_io_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ devio_t * devio_new (char *name, uint32_t id, char *endpoint_dev,
int err = llio_open (self->llio, NULL);
ASSERT_TEST(err==0, "Error opening device!", err_llio_open);

/* Specifically ask to reset the device */
llio_reset (self->llio);

/* We can free llio_name now, as llio copies the string */
free (llio_name);
llio_name = NULL; /* Avoid double free error */
Expand Down Expand Up @@ -1126,8 +1129,8 @@ static devio_err_e _devio_register_all_sm_raw (devio_t *self)
*
* Using a more brute-force solution we do the following:
*
* 1) We reset the endpoint here (not done here as most of
* our endpoints need to recreate its SMCH instances to be
* 1) We reset the endpoint here (not done here as most of
* our endpoints need to recreate its SMCH instances to be
* able to communicate and we don't do that on reconfigure,
* only on create)
* 2) Tell the SMIOs to reconfigure themselves
Expand Down
6 changes: 3 additions & 3 deletions core/revision/include/revision.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

/* HALCS version macros for compile-time API detection */

#define HALCS_VERSION_MAJOR 0
#define HALCS_VERSION_MINOR 5
#define HALCS_VERSION_PATCH 1
#define HALCS_VERSION_MAJOR 1
#define HALCS_VERSION_MINOR 0
#define HALCS_VERSION_PATCH 0

#define HALCS_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
Expand Down
1 change: 0 additions & 1 deletion foreign/libsdbfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ ENDIAN := $(shell ./check-endian $(CC))

override CFLAGS += -Wall -ggdb -O2
override CFLAGS += -Iinclude
override CFLAGS += -Iinclude/linux # for <sdb.h>
override CFLAGS += -ffunction-sections -fdata-sections
override CFLAGS += -Wno-pointer-sign
override CFLAGS += $(ENDIAN) $(LINUXINCLUDE)
Expand Down
40 changes: 40 additions & 0 deletions foreign/libsdbfs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,45 @@ model {
}
}
}
gensdbfs(NativeExecutableSpec) {
sources {
c {
lib library: 'sdbfs'
source.srcDir 'tools'
source.include 'gensdbfs.c'
}
}
}
sdb_extract(NativeExecutableSpec) {
sources {
c {
lib library: 'sdbfs'
source.srcDir 'tools'
source.include 'sdb-extract.c'
}
}
}
sdb_read(NativeExecutableSpec) {
sources {
c {
lib library: 'sdbfs'
source.srcDir 'tools'
source.include 'sdb-read.c'
}
}
}
sdb_read_lnls(NativeExecutableSpec) {
sources {
c {
lib project: ':libs:convc', library: 'convc'
lib project: ':libs:errhand', library: 'errhand'
lib project: ':libs:llio', library: 'llio'

lib library: 'sdbfs'
source.srcDir 'tools'
source.include 'sdb-read-lnls.c'
}
}
}
}
}
2 changes: 1 addition & 1 deletion foreign/libsdbfs/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ERRHAND_MIN_LEVEL ?= DBG_LVL_ERR
ERRHAND_SUBSYS_ON ?= "(DBG_DEV_MNGR | DBG_DEV_IO | DBG_SM_IO | DBG_LIB_CLIENT | DBG_SM_PR | DBG_SM_CH | DBG_LL_IO | DBG_HAL_UTILS)"

override CFLAGS += -Wall -ggdb
override CFLAGS += -I.. -I../include -I../include/linux
override CFLAGS += -I.. -I../include
CFLAGS_LNLS = -DERRHAND_DBG=$(ERRHAND_DBG) -DERRHAND_MIN_LEVEL=$(ERRHAND_MIN_LEVEL) \
-DERRHAND_SUBSYS_ON=$(ERRHAND_SUBSYS_ON)
override LDFLAGS += -L.. -lsdbfs
Expand Down
6 changes: 3 additions & 3 deletions foreign/libsdbfs/tools/gensdbfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <sys/types.h>
#include <arpa/inet.h>

#include <sdb.h>
#include <linux/sdb.h>
#include "gensdbfs.h"

/*
Expand All @@ -46,7 +46,7 @@ static inline unsigned long SDB_ALIGN(unsigned long x)
static void __fill_product(struct sdb_product *p, char *name, time_t t,
int record_type)
{
int len = strlen(name);
size_t len = strlen(name);

if (len > sizeof(p->name)) {
fprintf(stderr, "%s: truncating filename \"%s\"\n",
Expand All @@ -58,7 +58,7 @@ static void __fill_product(struct sdb_product *p, char *name, time_t t,
memcpy(&p->device_id, p->name, sizeof(p->device_id));
p->vendor_id = DEFAULT_VENDOR; /* changed by config, possibly */
p->version = htonl(1); /* FIXME: version of gensdbfs */
/* FIXME: date */
(void)(t); /* FIXME: date */
p->record_type = record_type;
}

Expand Down
5 changes: 3 additions & 2 deletions foreign/libsdbfs/tools/sdb-extract.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -52,9 +53,9 @@ static int create_file(struct sdbfs *fs, struct sdb_device *d, FILE *cfgf)
name[strlen(name) - 1] = '\0';

/* Print cfgfile information */
fprintf(cfgf, "%s\n" "\tvendor = 0x%016llx\n" "\tdevice = 0x%08x\n",
fprintf(cfgf, "%s\n" "\tvendor = 0x%016" PRIx64 "\n" "\tdevice = 0x%08x\n",
name, ntohll(p->vendor_id), ntohl(p->device_id));
fprintf(cfgf, "\tposition = 0x%llx\n", ntohll(c->addr_first));
fprintf(cfgf, "\tposition = 0x%" PRIx64 "\n", ntohll(c->addr_first));
if (ntohl(d->bus_specific) & SDB_DATA_WRITE) {
fprintf(cfgf, "\twrite = 1\n");
mode |= 0222;
Expand Down
15 changes: 8 additions & 7 deletions foreign/libsdbfs/tools/sdb-read-lnls.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <sys/stat.h>
#include <sys/mman.h>
#include <ll_io.h>
#include <pcie_regs.h>
#include <hw/pcie_regs.h>

#include "libsdbfs.h"

Expand Down Expand Up @@ -69,6 +69,7 @@ static int list_device(struct sdb_device *d, int depth, int base)
static int warned;
char *warn;
int i, ret;
unsigned int ui;

c = &d->sdb_component;
p = &c->product;
Expand Down Expand Up @@ -131,8 +132,8 @@ static int list_device(struct sdb_device *d, int depth, int base)
return 0;
printf("synthesis-name: %.16s\n", s->syn_name);
printf(" commit-id: ");
for (i = 0; i < sizeof(s->commit_id); i++)
printf("%02x", s->commit_id[i]);
for (ui = 0; ui < sizeof(s->commit_id); ui++)
printf("%02x", s->commit_id[ui]);
printf("\n");

/* Some of the following fields are sometimes empty */
Expand Down Expand Up @@ -172,11 +173,11 @@ static int list_device(struct sdb_device *d, int depth, int base)
/* long listing of unknown record */
printf("Unknown-record:\n");
data = (void *)d;
for (i = 0; i < sizeof(struct sdb_empty); i++)
for (ui = 0; ui < sizeof(struct sdb_empty); ui++)
printf("%s%02x%c",
(i & 0xf) == 0 ? " " : "",
data[i],
(i & 0xf) == 0xf ? '\n' : ' ');
(ui & 0xf) == 0 ? " " : "",
data[ui],
(ui & 0xf) == 0xf ? '\n' : ' ');
return ret;
}

Expand Down
15 changes: 8 additions & 7 deletions foreign/libsdbfs/tools/sdb-read.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ static int list_device(struct sdb_device *d, int depth, int base)
static int warned;
char *warn;
int i, ret;
unsigned int ui;

c = &d->sdb_component;
p = &c->product;
Expand Down Expand Up @@ -140,8 +141,8 @@ static int list_device(struct sdb_device *d, int depth, int base)
return 0;
printf("synthesis-name: %.16s\n", s->syn_name);
printf(" commit-id: ");
for (i = 0; i < sizeof(s->commit_id); i++)
printf("%02x", s->commit_id[i]);
for (ui = 0; ui < sizeof(s->commit_id); ui++)
printf("%02x", s->commit_id[ui]);
printf("\n");

/* Some of the following fields are sometimes empty */
Expand Down Expand Up @@ -181,11 +182,11 @@ static int list_device(struct sdb_device *d, int depth, int base)
/* long listing of unknown record */
printf("Unknown-record:\n");
data = (void *)d;
for (i = 0; i < sizeof(struct sdb_empty); i++)
for (ui = 0; ui < sizeof(struct sdb_empty); ui++)
printf("%s%02x%c",
(i & 0xf) == 0 ? " " : "",
data[i],
(i & 0xf) == 0xf ? '\n' : ' ');
(ui & 0xf) == 0 ? " " : "",
data[ui],
(ui & 0xf) == 0xf ? '\n' : ' ');
return ret;
}

Expand Down Expand Up @@ -302,7 +303,7 @@ int main(int argc, char **argv)
stbuf.st_size += pagesize - 1;
stbuf.st_size &= ~(pagesize - 1);
mapaddr = mmap(0,
opt_memsize ? opt_memsize : stbuf.st_size,
opt_memsize ? opt_memsize : (size_t)stbuf.st_size,
PROT_READ, MAP_PRIVATE, fileno(f),
opt_memaddr /* 0 by default */);
if (mapaddr == MAP_FAILED)
Expand Down
3 changes: 3 additions & 0 deletions gradle_update_ver_macros.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

./gradlew updateVersionMacros
6 changes: 3 additions & 3 deletions libs/acqclient/include/acq_client_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

/* version macros for compile-time API detection */

#define ACQ_CLIENT_VERSION_MAJOR 0
#define ACQ_CLIENT_VERSION_MINOR 5
#define ACQ_CLIENT_VERSION_PATCH 1
#define ACQ_CLIENT_VERSION_MAJOR 1
#define ACQ_CLIENT_VERSION_MINOR 0
#define ACQ_CLIENT_VERSION_PATCH 0

#define ACQ_CLIENT_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
Expand Down
6 changes: 3 additions & 3 deletions libs/bpmclient/include/bpm_client_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

/* version macros for compile-time API detection */

#define BPM_CLIENT_VERSION_MAJOR 0
#define BPM_CLIENT_VERSION_MINOR 5
#define BPM_CLIENT_VERSION_PATCH 1
#define BPM_CLIENT_VERSION_MAJOR 1
#define BPM_CLIENT_VERSION_MINOR 0
#define BPM_CLIENT_VERSION_PATCH 0

#define BPM_CLIENT_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
Expand Down
6 changes: 3 additions & 3 deletions libs/convc/include/convc_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

/* version macros for compile-time API detection */

#define CONVC_VERSION_MAJOR 0
#define CONVC_VERSION_MINOR 5
#define CONVC_VERSION_PATCH 1
#define CONVC_VERSION_MAJOR 1
#define CONVC_VERSION_MINOR 0
#define CONVC_VERSION_PATCH 0

#define CONVC_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
Expand Down
6 changes: 3 additions & 3 deletions libs/disptable/include/disptable_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

/* version macros for compile-time API detection */

#define DISPTABLE_VERSION_MAJOR 0
#define DISPTABLE_VERSION_MINOR 5
#define DISPTABLE_VERSION_PATCH 1
#define DISPTABLE_VERSION_MAJOR 1
#define DISPTABLE_VERSION_MINOR 0
#define DISPTABLE_VERSION_PATCH 0

#define DISPTABLE_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
Expand Down
6 changes: 3 additions & 3 deletions libs/errhand/include/errhand_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

/* version macros for compile-time API detection */

#define ERRHAND_VERSION_MAJOR 0
#define ERRHAND_VERSION_MINOR 5
#define ERRHAND_VERSION_PATCH 1
#define ERRHAND_VERSION_MAJOR 1
#define ERRHAND_VERSION_MINOR 0
#define ERRHAND_VERSION_PATCH 0

#define ERRHAND_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
Expand Down
6 changes: 3 additions & 3 deletions libs/halcsclient/include/halcs_client_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

/* HALCS version macros for compile-time API detection */

#define HALCS_CLIENT_VERSION_MAJOR 0
#define HALCS_CLIENT_VERSION_MINOR 5
#define HALCS_CLIENT_VERSION_PATCH 1
#define HALCS_CLIENT_VERSION_MAJOR 1
#define HALCS_CLIENT_VERSION_MINOR 0
#define HALCS_CLIENT_VERSION_PATCH 0

#define HALCS_CLIENT_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
Expand Down
6 changes: 3 additions & 3 deletions libs/hutils/include/hutils_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

/* version macros for compile-time API detection */

#define HUTILS_VERSION_MAJOR 0
#define HUTILS_VERSION_MINOR 5
#define HUTILS_VERSION_PATCH 1
#define HUTILS_VERSION_MAJOR 1
#define HUTILS_VERSION_MINOR 0
#define HUTILS_VERSION_PATCH 0

#define HUTILS_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
Expand Down
11 changes: 9 additions & 2 deletions libs/llio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ $(LIBNAME)_CODE_HEADERS = \
$(INCLUDE_DIR)/ll_io_endpoint.h \
$(INCLUDE_DIR)/ll_io_pcie.h \
$(INCLUDE_DIR)/ll_io_eth_utils.h \
$(INCLUDE_DIR)/ll_io_eth.h \
$(INCLUDE_DIR)/hw/pcie_regs.h
$(INCLUDE_DIR)/ll_io_eth.h

$(LIBNAME)_HEADERS = $($(LIBNAME)_CODE_HEADERS)

$(LIBNAME)_HW_HEADERS = \
$(INCLUDE_DIR)/hw/pcie_regs.h

OBJS_all = $(common_OBJS) $($(LIBNAME)_OBJS)

# Libraries suffixes
Expand Down Expand Up @@ -176,6 +178,8 @@ install:
$(foreach lib,$(TARGET_SHARED),ln -sf $(lib).$(LIB_VER) $(PREFIX)/lib/$(lib).$(LIB_VER_MAJOR) $(CMDSEP))
$(foreach lib,$(TARGET_STATIC),install -m 755 $(lib) $(PREFIX)/lib $(CMDSEP))
$(foreach header,$($(LIBNAME)_HEADERS),install -m 755 $(header) $(PREFIX)/include $(CMDSEP))
mkdir -p $(PREFIX)/include/hw
$(foreach header,$($(LIBNAME)_HW_HEADERS),install -m 755 $(header) $(PREFIX)/include/hw $(CMDSEP))

uninstall:
$(foreach lib,$(TARGET_SHARED),rm -f $(PREFIX)/lib/$(lib).$(LIB_VER) $(CMDSEP))
Expand All @@ -184,6 +188,9 @@ uninstall:
$(foreach lib,$(TARGET_STATIC),rm -f $(PREFIX)/lib/$(lib) $(CMDSEP))
$(foreach header,$(notdir $($(LIBNAME)_HEADERS)),rm -f \
$(PREFIX)/include/$(header) $(CMDSEP))
$(foreach header,$(notdir $($(LIBNAME)_HW_HEADERS)),rm -f \
$(PREFIX)/include/hw/$(header) $(CMDSEP))
rmdir --ignore-fail-on-non-empty $(PREFIX)/include/hw

clean:
rm -f $(OBJS_all) $(OBJS_all:.o=.d)
Expand Down
6 changes: 3 additions & 3 deletions libs/llio/include/ll_io_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

/* HALCS version macros for compile-time API detection */

#define LL_IO_VERSION_MAJOR 0
#define LL_IO_VERSION_MINOR 5
#define LL_IO_VERSION_PATCH 1
#define LL_IO_VERSION_MAJOR 1
#define LL_IO_VERSION_MINOR 0
#define LL_IO_VERSION_PATCH 0

#define LL_IO_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
Expand Down
5 changes: 0 additions & 5 deletions libs/llio/src/llio/c/ops/ll_io_pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,6 @@ static int pcie_open (llio_t *self, llio_endpoint_t *endpoint)
/* Set SDB prefix adress */
llio_set_sdb_prefix_addr (self, BAR4_ADDR);

/* Reset FPGA */
_pcie_reset_fpga (self);
/* Reset PCIe Timeout */
_pcie_timeout_reset (self);

return err;

err_dev_handler_alloc:
Expand Down
6 changes: 3 additions & 3 deletions libs/sdbutils/include/sdbutils_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

/* version macros for compile-time API detection */

#define SDBUTILS_VERSION_MAJOR 0
#define SDBUTILS_VERSION_MINOR 5
#define SDBUTILS_VERSION_PATCH 1
#define SDBUTILS_VERSION_MAJOR 1
#define SDBUTILS_VERSION_MINOR 0
#define SDBUTILS_VERSION_PATCH 0

#define SDBUTILS_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
Expand Down

0 comments on commit c244c6a

Please sign in to comment.