File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -373,6 +373,9 @@ static constexpr Register C_CSR(0x00000010);
373373// At bit 13
374374static constexpr uint32_t LINK_DOWN (0x00002000 );
375375
376+ static constexpr IntervalRegister OPT_POWER_QSFP0 (0x00000144 , 0x4 );
377+ static constexpr IntervalRegister OPT_POWER_QSFP1 (0x00000158 , 0x4 );
378+
376379} // namespace Registers
377380} // namespace Crorc
378381
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ void CrorcBar::configure(bool /*force*/)
7878Crorc::ReportInfo CrorcBar::report ()
7979{
8080 std::map<int , Crorc::Link> linkMap = initializeLinkMap ();
81+ getOpticalPowers (linkMap);
8182 Crorc::ReportInfo reportInfo = {
8283 linkMap,
8384 getCrorcId (),
@@ -137,5 +138,19 @@ bool CrorcBar::getDynamicOffsetEnabled()
137138 return (readRegister (Crorc::Registers::CFG_CONTROL.index ) & 0x1 );
138139}
139140
141+ void CrorcBar::getOpticalPowers (std::map<int , Crorc::Link>& linkMap)
142+ {
143+ for (auto & el : linkMap) {
144+ auto linkNo = el.first ;
145+ auto & link = el.second ;
146+ if (linkNo < 4 ) {
147+ link.opticalPower = readRegister (Crorc::Registers::OPT_POWER_QSFP0.get (linkNo).index ) & 0xffff ;
148+ } else {
149+ link.opticalPower = readRegister (Crorc::Registers::OPT_POWER_QSFP1.get (linkNo % 4 ).index ) & 0xffff ;
150+ }
151+ link.opticalPower /= 10 ;
152+ }
153+ }
154+
140155} // namespace roc
141156} // namespace AliceO2
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ class CrorcBar final : public BarInterfaceBase
6060 bool getDynamicOffsetEnabled ();
6161 void setCrorcId (uint16_t cruId);
6262 uint16_t getCrorcId ();
63+ void getOpticalPowers (std::map<int , Crorc::Link>& linkMap);
6364
6465 uint16_t mCrorcId ;
6566 bool mDynamicOffset ;
You can’t perform that action at this time.
0 commit comments