From f55b475f7e9fc89ab5c691bbdb62e4431e5d6bda Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 Oct 2023 08:23:36 +0200 Subject: [PATCH] add new addrs --- common/config/eive/definitions.h | 3 +++ linux/ipcore/PdecHandler.cpp | 8 +++++--- linux/ipcore/PdecHandler.h | 9 +++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index b51eefdb..033d703f 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -115,6 +115,9 @@ static constexpr float SCHED_BLOCK_10_PERIOD = } // namespace spiSched +namespace pdec { +static constexpr uint32_t PDEC_CONFIG_BASE_ADDR_LEGACY = 0x24000000; +} } // namespace config #endif /* COMMON_CONFIG_DEFINITIONS_H_ */ diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index d5f45ae7..d9065314 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -31,6 +31,8 @@ PdecHandler::PdecHandler(object_id_t objectId, object_id_t tcDestinationId, gpioComIF(gpioComIF), pdecReset(pdecReset), actionHelper(this, nullptr), + cfgMemBaseAddr(cfgMemPhyAddr), + pdecRamBaseAddr(pdecRamPhyAddr), uioNames(names), paramHelper(this) { auto mqArgs = MqArgs(objectId, static_cast(this)); @@ -68,7 +70,7 @@ ReturnValue_t PdecHandler::initialize() { }; memoryBaseAddress = static_cast( mmap(0, PDEC_CFG_MEM_SIZE, static_cast(UioMapper::Permissions::READ_WRITE), MAP_SHARED, - fd, PDEC_CFG_MEM_PHY_ADDR)); + fd, cfgMemBaseAddr)); if (memoryBaseAddress == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } @@ -76,7 +78,7 @@ ReturnValue_t PdecHandler::initialize() { ramBaseAddress = static_cast(mmap(0, PDEC_RAM_SIZE, static_cast(UioMapper::Permissions::READ_WRITE), - MAP_SHARED, fd, PDEC_RAM_PHY_ADDR)); + MAP_SHARED, fd, pdecRamBaseAddr)); if (ramBaseAddress == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } @@ -646,7 +648,7 @@ void PdecHandler::handleNewTc() { } ReturnValue_t PdecHandler::readTc(uint32_t& tcLength) { - uint32_t tcOffset = (*(registerBaseAddress + PDEC_BPTR_OFFSET) - PHYSICAL_RAM_BASE_ADDRESS) / 4; + uint32_t tcOffset = (*(registerBaseAddress + PDEC_BPTR_OFFSET) - pdecRamBaseAddr) / 4; #if OBSW_DEBUG_PDEC_HANDLER == 1 sif::debug << "PdecHandler::readTc: TC offset: 0x" << std::hex << tcOffset << std::endl; diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index 3a802cdd..1119999c 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 }; @@ -146,8 +146,6 @@ class PdecHandler : public SystemObject, LinuxLibgpioIF* gpioComIF = nullptr; - uint32_t cfgMemBaseAddr = 0x0; - uint32_t pdecRamBaseAddr = 0x0; uint32_t interruptCounter = 0; Countdown interruptWindowCd = Countdown(1000); @@ -191,6 +189,9 @@ class PdecHandler : public SystemObject, MessageQueueId_t commandedBy = MessageQueueIF::NO_QUEUE; bool ptmeResetWithReinitializationPending = false; + uint32_t cfgMemBaseAddr; + uint32_t pdecRamBaseAddr; + UioNames uioNames; ParameterHelper paramHelper;