Commit 23f81be6 authored by Federico Vaga's avatar Federico Vaga

sw: get version compatibility from git

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent aa1ec6f4
......@@ -21,7 +21,6 @@
#define SVEC_META_BOM_END_MASK 0xFFFF0000
#define SVEC_META_BOM_VER_MASK 0x0000FFFF
#define SVEC_META_VERSION_MASK 0xFFFF0000
#define SVEC_META_VERSION_1_4 0x01040000
#ifndef BIT
#define BIT(_b) (1 << _b)
......
......@@ -8,9 +8,12 @@ endif
# add versions of used submodules
VER_MAJ := $(shell echo $(subst v,,$(VERSION)) | cut -d '.' -f 1)
VER_MIN := $(shell echo $(subst v,,$(VERSION)) | cut -d '.' -f 2)
SVEC_META_VERSION_COMPAT := $(shell printf "0x%02x%02x0000" $(VER_MAJ) $(VER_MIN))
ccflags-y += -DADDITIONAL_VERSIONS="$(SUBMODULE_VERSIONS)"
ccflags-y += -DVERSION=\"$(VERSION)\"
ccflags-y += -DSVEC_META_VERSION_COMPAT=$(SVEC_META_VERSION_COMPAT)
ccflags-y += -Wall -Werror
ccflags-y += -I$(VMEBRIDGE_ABS)/include
......
......@@ -18,6 +18,11 @@
#include "svec.h"
#include "svec-core-fpga.h"
static int version_ignore = 0;
module_param(version_ignore, int, 0644);
MODULE_PARM_DESC(version_ignore,
"Ignore the version declared in the FPGA and force the driver to load all components (default 0)");
enum svec_fpga_irq_lines {
SVEC_FPGA_IRQ_FMC_I2C = 0,
SVEC_FPGA_IRQ_SPI,
......@@ -830,12 +835,15 @@ static bool svec_fpga_is_valid(struct svec_dev *svec_dev,
return false;
}
if ((meta->version & SVEC_META_VERSION_MASK) != SVEC_META_VERSION_1_4) {
if (!version_ignore &&
(meta->version & SVEC_META_VERSION_MASK) != SVEC_META_VERSION_COMPAT) {
dev_err(&svec_dev->dev,
"Unknow version: %08x\n", meta->version);
"Unknow version: %08x, expected: %08x\n",
meta->version, SVEC_META_VERSION_COMPAT);
return false;
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment