266 std::stringstream ss;
268 TLOG() <<
"DeviceInterface: trying to connect to " << boost::asio::ip::address_v4(
fDeviceId).to_string();
285 unsigned int pdts_status = 0;
286 unsigned int pdts_control = 0;
287 unsigned int dsp_clock_control = 0;
290 TLOG() <<
"The pdts_status read back as 0x" << std::hex << pdts_status << std::dec << std::endl;
292 TLOG() <<
"The pdts_control read back as 0x" << std::hex << pdts_control << std::dec << std::endl;
294 TLOG() <<
"The dsp_clock_control read back as 0x" << std::hex << dsp_clock_control << std::dec << std::endl;
296 unsigned int presentTimingAddress = (pdts_control >> 16) & 0xFF;
297 unsigned int presentTimingPartition = pdts_control & 0x3;
299 TLOG() <<
"SSP HW presently on partition " << presentTimingPartition <<
", address 0x" << std::hex
300 << presentTimingAddress <<
" with endpoint status 0x" << (pdts_status & 0xF) <<
" and dsp_clock_control at 0x"
301 << dsp_clock_control << std::dec << std::endl;
305 if ((pdts_status & 0xF) >= 0x6 && (pdts_status & 0xF) <= 0x8 && presentTimingAddress ==
fTimingAddress &&
307 (dsp_clock_control & 0xF) ==
311 TLOG() <<
"Clock already looks ok... skipping endpoint reset." << std::endl;
314 TLOG() <<
"Syncing SSP LED Calib to PDTS (partition " <<
fPartitionNumber <<
", endpoint address 0x" << std::hex
317 unsigned int nTries = 0;
321 TLOG() <<
"The dsp_clock_control was set to 0x" << std::hex << 0x30 << std::dec
324 TLOG() <<
"The pdts_control value was set to 0x" << std::hex
329 TLOG() <<
"The pdts_status read back as 0x" << std::hex << pdts_status << std::dec << std::endl;
331 TLOG() <<
"The pdts_control read back as 0x" << std::hex << pdts_control << std::dec << std::endl;
333 TLOG() <<
"The dsp_clock_control read back as 0x" << std::hex << dsp_clock_control << std::dec << std::endl;
336 TLOG() <<
"The pdts_status value was set to 0x" << std::hex
341 TLOG() <<
"The dsp_clock_control was set to 0x" << std::hex << 0x31 << std::dec << std::endl;
344 TLOG() <<
"The pdts_status read back as 0x" << std::hex << pdts_status << std::dec << std::endl;
345 if ((pdts_status & 0xF) >= 0x6 && (pdts_status & 0xF) <= 0x8)
347 TLOG() <<
"Timing endpoint sync failed (try " << nTries <<
")" << std::endl;
351 if ((pdts_status & 0xF) >= 0x6 && (pdts_status & 0xF) <= 0x8) {
352 TLOG() <<
"The pdts_status value is 0x" << std::hex << pdts_status <<
" and the 0xF bit masked value is 0x"
353 << (pdts_status & 0xF) << std::dec << std::endl;
354 TLOG() <<
"Timing endpoint synced!" << std::endl;
356 TLOG() <<
"The pdts_status value is 0x" << std::hex << pdts_status <<
" and the 0xF bit masked value is 0x"
357 << (pdts_status & 0xF) << std::dec << std::endl;
358 TLOG() <<
"Giving up on endpoint sync after 5 tries. Value of pdts_status register was 0x" << std::hex
359 << pdts_status << std::dec << std::endl;
363 TLOG() <<
"Woke up from 2 seconds of sleep and Waiting for endpoint to reach status 0x8..." << std::endl;
365 if ((pdts_status & 0xF) != 0x8) {
366 TLOG() <<
"Waiting for endpoint to reach status 0x8..." << std::endl;
367 TLOG() <<
"The pdts_status value is 0x" << std::hex << pdts_status <<
" and the 0xF bit masked value is 0x"
368 << (pdts_status & 0xF) << std::dec << std::endl;
371 while ((pdts_status & 0xF) != 0x8) {
373 TLOG() <<
"Wrong PDTS status!" << std::endl;
374 throw DeviceInterfacePDTSStatus(
ERS_HERE);
377 TLOG() <<
"Woke up from 2 seconds of sleep and Waiting for endpoint to reach status 0x8..." << std::endl;
379 TLOG() <<
"The pdts_status value is 0x" << std::hex << pdts_status <<
" and the 0xF bit masked value is 0x"
380 << (pdts_status & 0xF) << std::dec << std::endl;
384 TLOG() <<
"Endpoint is in running state, continuing with configuration!" << std::endl;
385 TLOG() <<
"SSP LED Calib Device Interface Configured complete.";