@@ -40,10 +40,9 @@ namespace roc
4040{
4141
4242CrorcDmaChannel::CrorcDmaChannel (const Parameters& parameters)
43- : DmaChannelPdaBase(parameters, allowedChannels()), //
44- mPageSize (parameters.getDmaPageSize().get_value_or(DMA_PAGE_SIZE)), // 8 kB default for uniformity with CRU
45- mInitialResetLevel(ResetLevel::Internal), // It's good to reset at least the card channel in general
46- mSTBRD(parameters.getStbrdEnabled().get_value_or(false )), // TODO: Set as a parameter
43+ : DmaChannelPdaBase(parameters, allowedChannels()),
44+ mPageSize (parameters.getDmaPageSize().get_value_or(DMA_PAGE_SIZE)), // 8 kB default for uniformity with CRU
45+ mSTBRD(parameters.getStbrdEnabled().get_value_or(false )),
4746 mUseFeeAddress(false ), // Not sure
4847 mDataSource(parameters.getDataSource().get_value_or(DataSource::Internal)) // Internal loopback by default
4948{
@@ -95,7 +94,11 @@ CrorcDmaChannel::CrorcDmaChannel(const Parameters& parameters)
9594 getReadyFifoUser ()->reset ();
9695 mDmaBufferUserspace = getBufferProvider ().getAddress ();
9796
98- deviceResetChannel ();
97+ if (mDataSource == DataSource::Fee || mDataSource == DataSource::Siu) {
98+ deviceResetChannel (ResetLevel::InternalSiu);
99+ } else {
100+ deviceResetChannel (ResetLevel::Internal);
101+ }
99102}
100103
101104auto CrorcDmaChannel::allowedChannels () -> AllowedChannels
@@ -150,7 +153,7 @@ void CrorcDmaChannel::startPendingDma()
150153 getBar ()->assertLinkUp ();
151154
152155 // RDYRX command to FEE
153- uint32_t command = (mRDYRX ) ? Fee:: RDYRX : Fee ::STBRD;
156+ uint32_t command = (mRDYRX ) ? Crorc::Registers:: RDYRX : Crorc::Registers ::STBRD;
154157 getBar ()->startTrigger (command);
155158 }
156159 }
@@ -191,7 +194,9 @@ void CrorcDmaChannel::deviceResetChannel(ResetLevel::type resetLevel)
191194 if (resetLevel == ResetLevel::Nothing) {
192195 return ;
193196 }
194- getBar ()->resetDevice ();
197+
198+ bool resetSiu = (resetLevel == ResetLevel::InternalSiu) ? true : false ;
199+ getBar ()->resetDevice (resetSiu);
195200}
196201
197202void CrorcDmaChannel::startDataGenerator () // TODO: Update this
@@ -207,7 +212,7 @@ void CrorcDmaChannel::startDataGenerator() //TODO: Update this
207212 getCrorc ().setSiuLoopback (mDiuConfig );
208213 std::this_thread::sleep_for (100ms); // XXX Why???
209214 getCrorc ().assertLinkUp ();
210- getCrorc ().siuCommand (Ddl::RandCIFST);
215+ getCrorc ().siuCommand (Ddl::RandCIFST); // TODO: To be removed
211216 getCrorc ().diuCommand (Ddl::RandCIFST);
212217 }
213218
0 commit comments