diff options
| -rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 20 | ||||
| -rw-r--r-- | host/lib/usrp/b200/b200_impl.hpp | 4 | 
2 files changed, 19 insertions, 5 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 273153c16..84153309e 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -266,16 +266,30 @@ b200_impl::b200_impl(const device_addr_t &device_addr) :          _b200_type = B200;      } -    //set up frontend mapping +    //////////////////////////////////////////////////////////////////// +    // Set up frontend mapping +    //////////////////////////////////////////////////////////////////// +    // Explanation: The AD9361 has 2 frontends, FE1 and FE2. +    // On the B210 FE1 maps to the B-side (or radio 1), and FE2 maps +    // to the A-side (or radio 0). So, logically, the radios are swapped +    // between the host side and the AD9361-side. +    // B200 is more complicated: On Revs <= 4, the A-side is connected, +    // which means FE2 is used (like B210). On Revs >= 5, the left side +    // ("B-side") is connected, because these revs use an AD9364, which +    // does not have an FE2, so we don't swap FEs. + +    // Swapped setup:      _fe1 = 1;      _fe2 = 0; +    _gpio_state.swap_atr = 1; +    // Unswapped setup:      if (_b200_type == B200 and          not mb_eeprom["revision"].empty() and          boost::lexical_cast<size_t>(mb_eeprom["revision"]) >= 5)      {          _fe1 = 0;                   //map radio0 to FE1          _fe2 = 1;                   //map radio1 to FE2 -        _gpio_state.atr_sel = 1;    //map radio0 ATR pins to FE2 +        _gpio_state.swap_atr = 0;    //map radio0 ATR pins to FE2      }      //////////////////////////////////////////////////////////////////// @@ -916,7 +930,7 @@ void b200_impl::update_bandsel(const std::string& which, double freq)  void b200_impl::update_gpio_state(void)  {      const boost::uint32_t misc_word = 0 -        | (_gpio_state.atr_sel << 8) +        | (_gpio_state.swap_atr << 8)          | (_gpio_state.tx_bandsel_a << 7)          | (_gpio_state.tx_bandsel_b << 6)          | (_gpio_state.rx_bandsel_a << 5) diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp index 318b35947..f3d3d0e98 100644 --- a/host/lib/usrp/b200/b200_impl.hpp +++ b/host/lib/usrp/b200/b200_impl.hpp @@ -177,7 +177,7 @@ private:      void handle_overflow(const size_t radio_index);      struct gpio_state { -        boost::uint32_t  tx_bandsel_a, tx_bandsel_b, rx_bandsel_a, rx_bandsel_b, rx_bandsel_c, codec_arst, mimo, ref_sel, atr_sel; +        boost::uint32_t  tx_bandsel_a, tx_bandsel_b, rx_bandsel_a, rx_bandsel_b, rx_bandsel_c, codec_arst, mimo, ref_sel, swap_atr;          gpio_state() {              tx_bandsel_a = 0; @@ -188,7 +188,7 @@ private:              codec_arst = 0;              mimo = 0;              ref_sel = 0; -            atr_sel = 0; +            swap_atr = 0;          }      } _gpio_state;  | 
