diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index ca75e123..41dab3e6 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -163,8 +163,8 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_CCSDS_IP_CORES == 1 CcsdsIpCoreHandler* ipCoreHandler = nullptr; CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, - &ipCoreHandler); - createCcsdsIpComponentsAddTmRouting(ccsdsArgs); + &ipCoreHandler, 0, 0); + createCcsdsIpComponentsWrapper(ccsdsArgs); #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ /* Test Task */ diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index e4a61124..b154ac52 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -115,8 +115,8 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_CCSDS_IP_CORES == 1 CcsdsIpCoreHandler* ipCoreHandler = nullptr; CcsdsComponentArgs ccsdsArgs(*gpioComIF, *ipcStore, *tmStore, stores, *pusFunnel, *cfdpFunnel, - &ipCoreHandler); - createCcsdsIpComponentsAddTmRouting(ccsdsArgs); + &ipCoreHandler, 0, 0); + createCcsdsIpComponentsWrapper(ccsdsArgs); #endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */ #if OBSW_ADD_SCEX_DEVICE == 1 diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index c8e6f555..552eb6a6 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -834,9 +834,9 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) { uioNames.configMemory = q7s::UIO_PDEC_CONFIG_MEMORY; uioNames.ramMemory = q7s::UIO_PDEC_RAM; uioNames.registers = q7s::UIO_PDEC_REGISTERS; - uioNames.irq = q7s::UIO_PDEC_IRQ; + uint32_t cfgMemAddr = config::pdec::PDEC_CONFIG_BASE_ADDR_LEGACY; new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, &args.gpioComIF, - gpioIds::PDEC_RESET, uioNames); + gpioIds::PDEC_RESET, uioNames, args.pdecCfgMemBaseAddr, args.pdecRamBaseAddr); GpioCookie* gpioRS485Chip = new GpioCookie; gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver", Direction::OUT, Levels::LOW); @@ -1062,7 +1062,13 @@ ReturnValue_t ObjectFactory::readFirmwareVersion() { return returnvalue::OK; } -ReturnValue_t ObjectFactory::createCcsdsIpComponentsAddTmRouting(CcsdsComponentArgs& ccsdsArgs) { +ReturnValue_t ObjectFactory::createCcsdsIpComponentsWrapper(CcsdsComponentArgs& ccsdsArgs) { + ccsdsArgs.pdecCfgMemBaseAddr = config::pdec::PDEC_CONFIG_BASE_ADDR; + ccsdsArgs.pdecRamBaseAddr = config::pdec::PDEC_RAM_ADDR; + if (core::FW_VERSION_MAJOR < 6) { + ccsdsArgs.pdecCfgMemBaseAddr = config::pdec::PDEC_CONFIG_BASE_ADDR_LEGACY; + ccsdsArgs.pdecRamBaseAddr = config::pdec::PDEC_RAM_ADDR_LEGACY; + } ReturnValue_t result = createCcsdsComponents(ccsdsArgs); #if OBSW_TM_TO_PTME == 1 if (ccsdsArgs.normalLiveTmDest != MessageQueueIF::NO_QUEUE) { diff --git a/bsp_q7s/objectFactory.h b/bsp_q7s/objectFactory.h index 223031e6..b3dfa83b 100644 --- a/bsp_q7s/objectFactory.h +++ b/bsp_q7s/objectFactory.h @@ -31,14 +31,17 @@ namespace ObjectFactory { struct CcsdsComponentArgs { CcsdsComponentArgs(LinuxLibgpioIF& gpioIF, StorageManagerIF& ipcStore, StorageManagerIF& tmStore, PersistentTmStores& stores, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel, - CcsdsIpCoreHandler** ipCoreHandler) + CcsdsIpCoreHandler** ipCoreHandler, uint32_t pdecCfgMemBaseAddr, + uint32_t pdecRamBaseAddr) : gpioComIF(gpioIF), ipcStore(ipcStore), tmStore(tmStore), stores(stores), pusFunnel(pusFunnel), cfdpFunnel(cfdpFunnel), - ipCoreHandler(ipCoreHandler) {} + ipCoreHandler(ipCoreHandler), + pdecCfgMemBaseAddr(pdecCfgMemBaseAddr), + pdecRamBaseAddr(pdecRamBaseAddr) {} LinuxLibgpioIF& gpioComIF; StorageManagerIF& ipcStore; StorageManagerIF& tmStore; @@ -46,6 +49,8 @@ struct CcsdsComponentArgs { PusTmFunnel& pusFunnel; CfdpTmFunnel& cfdpFunnel; CcsdsIpCoreHandler** ipCoreHandler; + uint32_t pdecCfgMemBaseAddr; + uint32_t pdecRamBaseAddr; MessageQueueId_t normalLiveTmDest = MessageQueueIF::NO_QUEUE; MessageQueueId_t cfdpLiveTmDest = MessageQueueIF::NO_QUEUE; }; @@ -75,7 +80,7 @@ void createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher, GpioIF& gp void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher); void createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF& pwrSwitcher); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher); -ReturnValue_t createCcsdsIpComponentsAddTmRouting(CcsdsComponentArgs& args); +ReturnValue_t createCcsdsIpComponentsWrapper(CcsdsComponentArgs& args); ReturnValue_t createCcsdsComponents(CcsdsComponentArgs& args); ReturnValue_t readFirmwareVersion(); void createMiscComponents(); diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 033d703f..0b63a017 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -116,8 +116,17 @@ static constexpr float SCHED_BLOCK_10_PERIOD = } // namespace spiSched namespace pdec { + +// Pre FW v6.0.0 static constexpr uint32_t PDEC_CONFIG_BASE_ADDR_LEGACY = 0x24000000; -} +static constexpr uint32_t PDEC_RAM_ADDR_LEGACY = 0x26000000; + +// Post FW v6.0.0 +static constexpr uint32_t PDEC_CONFIG_BASE_ADDR = 0x4000000; +static constexpr uint32_t PDEC_RAM_ADDR = 0x7000000; + +} // namespace pdec + } // namespace config #endif /* COMMON_CONFIG_DEFINITIONS_H_ */ diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index 1119999c..c2badb62 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -52,9 +52,9 @@ class PdecHandler : public SystemObject, public: static constexpr dur_millis_t IRQ_TIMEOUT_MS = 500; static constexpr uint32_t PDEC_CFG_MEM_SIZE = 0x1000; - //static constexpr uint32_t PDEC_CFG_MEM_PHY_ADDR = 0x24000000; + // static constexpr uint32_t PDEC_CFG_MEM_PHY_ADDR = 0x24000000; static constexpr uint32_t PDEC_RAM_SIZE = 0x10000; - //static constexpr uint32_t PDEC_RAM_PHY_ADDR = 0x26000000; + // static constexpr uint32_t PDEC_RAM_PHY_ADDR = 0x26000000; enum class Modes { POLLED, IRQ }; diff --git a/tmtc b/tmtc index 8f8bcde9..97f99415 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8f8bcde90e3b9113388cfedc47775426888d0781 +Subproject commit 97f99415d6be40d35bf9c373fea40b41c8457386