File tree Expand file tree Collapse file tree 5 files changed +26
-1
lines changed
Expand file tree Collapse file tree 5 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -738,6 +738,10 @@ Both _PDA_ packages can also be installed from source as described on the next s
738738
739739For the _CRU firmware_ see the [gitlab](https://gitlab.cern.ch/alice-cru/cru-fw) repo.
740740
741+ Note: The CRU firmware compatibility table has lower precedence to an (optionally present) firmware compatibility json file, which
742+ is always searched for in `/etc/o2.d/readoutcard/o2-roc-fw-list.json`. This is a flat json map, as seen in the example file
743+ [o2-roc-fw-list.json](o2-roc-fw-list.json).
744+
741745### PDA
742746The module depends on the PDA (Portable Driver Architecture) library and driver.
743747If PDA is not detected on the system, only a dummy implementation of the interface will be compiled.
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class FirmwareChecker
4141 void checkFirmwareCompatibilityWrapped (Parameters::CardIdType cardId);
4242 std::string getFirmwareCompatibilityList ();
4343 std::unordered_map<std::string, std::string> mCompatibleFirmwareList ;
44+ static constexpr char kFirmwareListFile [] = " json:///etc/o2.d/readoutcard/o2-roc-fw-list.json" ;
4445};
4546
4647} // namespace roc
Original file line number Diff line number Diff line change 1+ {
2+ "14ccd414" : " v3.14.1" ,
3+ "2058c933" : " v3.14.0" ,
4+ "ed43b5d" : " free string"
5+ }
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ class ProgramListCards : public Program
7070 pt::ptree root;
7171
7272 auto cardsFound = o2::roc::RocPciDevice::findSystemDevices ();
73+ auto firmwareChecker = FirmwareChecker ();
7374
7475 int i = 0 ;
7576 for (const auto & card : cardsFound) {
@@ -85,7 +86,7 @@ class ProgramListCards : public Program
8586 userLogicVersion = std::dynamic_pointer_cast<CruBar>(bar2)->getUserLogicVersion ().value_or (na);
8687 }
8788 // Check if the firmware is tagged
88- firmware = FirmwareChecker () .resolveFirmwareTag (firmware);
89+ firmware = firmwareChecker .resolveFirmwareTag (firmware);
8990 } catch (const Exception& e) {
9091 std::cerr << " Error parsing card information through BAR\n "
9192 << boost::diagnostic_information (e) << ' \n ' ;
Original file line number Diff line number Diff line change 1616
1717#include " ReadoutCard/FirmwareChecker.h"
1818#include " ExceptionInternal.h"
19+ #include < Configuration/ConfigurationFactory.h>
1920
2021namespace o2
2122{
@@ -49,6 +50,19 @@ FirmwareChecker::FirmwareChecker() : mCompatibleFirmwareList({
4950 { "72cdb92", "v2.4.1" }*/
5051 })
5152{
53+ std::unordered_map<std::string, std::string> parsedList;
54+ try {
55+ auto conf = configuration::ConfigurationFactory::getConfiguration (kFirmwareListFile );
56+ parsedList = conf->getRecursiveMap ();
57+ } catch (const std::runtime_error& e) {
58+ /* on error bail out */
59+ return ;
60+ }
61+
62+ // if the parsed list is not empty update the compatible fimrware list
63+ if (!parsedList.empty ()) {
64+ mCompatibleFirmwareList = parsedList;
65+ }
5266}
5367
5468FirmwareChecker::~FirmwareChecker ()
You can’t perform that action at this time.
0 commit comments