From a3891701bffb1acac9f01841ea0ab4029a616e81 Mon Sep 17 00:00:00 2001 From: rhong Date: Fri, 14 Jun 2024 10:43:19 -0500 Subject: [PATCH] Add the FLASH IO for the vme300 boards --- evgMrmApp/src/evgMrm.cpp | 4 ++-- evrMrmApp/src/drvem.cpp | 4 ++-- mrfCommon/src/flashiocsh.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/evgMrmApp/src/evgMrm.cpp b/evgMrmApp/src/evgMrm.cpp index fb295060..49ae228f 100644 --- a/evgMrmApp/src/evgMrm.cpp +++ b/evgMrmApp/src/evgMrm.cpp @@ -194,7 +194,7 @@ evgMrm::evgMrm(const std::string& id, scanIoInit(&ioScanTimestamp); - if((busConfig.busType==busType_pci) || (info.board==MRF_VME_EVM300_BID)) + if(busConfig.busType==busType_pci || (busConfig.busType==busType_vme && version()>=MRFVersion(2, 0, 0))) mrf::SPIDevice::registerDev(id+":FLASH", mrf::SPIDevice(this, 1)); if((pciDevice->id.sub_device==PCI_DEVICE_ID_MRF_MTCA_EVM_300) || (info.board==MRF_VME_EVM300_BID)) { @@ -210,7 +210,7 @@ evgMrm::evgMrm(const std::string& id, } evgMrm::~evgMrm() { - if(getBusConfiguration()->busType==busType_pci) + if(getBusConfiguration()->busType==busType_pci || (getBusConfiguration()->busType==busType_vme && version()>=MRFVersion(2, 0, 0))) mrf::SPIDevice::unregisterDev(name()+":FLASH"); for(size_t i = 0; i < m_trigEvt.size(); i++) diff --git a/evrMrmApp/src/drvem.cpp b/evrMrmApp/src/drvem.cpp index 818209ae..8ec852b8 100644 --- a/evrMrmApp/src/drvem.cpp +++ b/evrMrmApp/src/drvem.cpp @@ -353,7 +353,7 @@ try{ drain_fifo_task.start(); - if(busConfig.busType==busType_pci) + if(busConfig.busType==busType_pci || (busConfig.busType==busType_vme && version()>=MRFVersion(2, 0, 0))) mrf::SPIDevice::registerDev(n+":FLASH", mrf::SPIDevice(this, 1)); #ifndef DBR_UTAG @@ -369,7 +369,7 @@ try{ EVRMRM::~EVRMRM() { - if(getBusConfiguration()->busType==busType_pci) + if(getBusConfiguration()->busType==busType_pci || (getBusConfiguration()->busType==busType_vme && version()>=MRFVersion(2, 0, 0))) mrf::SPIDevice::unregisterDev(name()+":FLASH"); cleanup(); } diff --git a/mrfCommon/src/flashiocsh.cpp b/mrfCommon/src/flashiocsh.cpp index 0fab6794..2d6e920b 100644 --- a/mrfCommon/src/flashiocsh.cpp +++ b/mrfCommon/src/flashiocsh.cpp @@ -165,7 +165,7 @@ void flashwrite(const char *name, int addrraw, const char *infile) std::ifstream strm(infile, std::ios_base::in|std::ios_base::binary); if(strm.fail()) - throw std::runtime_error("Unable to open output file"); + throw std::runtime_error("Unable to open input file"); strm.seekg(0, std::ios_base::end); const long fsize = strm.tellg();