diff options
author | Trung N Tran <trung.tran@ettus.com> | 2018-01-11 10:57:07 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-01-12 16:21:15 -0800 |
commit | 7ffea3746be77cf926db946987ee83d48a33c798 (patch) | |
tree | 6266671108fc9c5fad0e75bf4325fe056972d1ab | |
parent | b3e0f60a7b41359e8f7806dc77c402468bf7f444 (diff) | |
download | uhd-7ffea3746be77cf926db946987ee83d48a33c798.tar.gz uhd-7ffea3746be77cf926db946987ee83d48a33c798.tar.bz2 uhd-7ffea3746be77cf926db946987ee83d48a33c798.zip |
mpm: mg: Pass deserializer_lane_xbar to ad937x_config
Slot A and Slot B are different in how the JESD lanes are connected.
We now pass in different deserializer_lane_xbar config values for each slot.
Reviewed-by: Martin Braun <martin.braun@ettus.com>
Reviewed-by: Daniel Jepson <daniel.jepson@ettus.com>
Reviewed-by: Mark Meserve <mark.meserve@ni.com>
-rw-r--r-- | mpm/include/mpm/ad937x/ad937x_ctrl.hpp | 1 | ||||
-rw-r--r-- | mpm/include/mpm/dboards/magnesium_manager.hpp | 5 | ||||
-rw-r--r-- | mpm/lib/dboards/magnesium_manager.cpp | 5 | ||||
-rw-r--r-- | mpm/lib/mykonos/ad937x_ctrl.cpp | 6 | ||||
-rw-r--r-- | mpm/lib/mykonos/ad937x_device.cpp | 3 | ||||
-rw-r--r-- | mpm/lib/mykonos/ad937x_device.hpp | 1 | ||||
-rw-r--r-- | mpm/lib/mykonos/config/ad937x_config_t.cpp | 4 | ||||
-rw-r--r-- | mpm/lib/mykonos/config/ad937x_config_t.hpp | 2 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/dboard_manager/magnesium.py | 8 |
9 files changed, 25 insertions, 10 deletions
diff --git a/mpm/include/mpm/ad937x/ad937x_ctrl.hpp b/mpm/include/mpm/ad937x/ad937x_ctrl.hpp index c8a787e49..6b863efdb 100644 --- a/mpm/include/mpm/ad937x/ad937x_ctrl.hpp +++ b/mpm/include/mpm/ad937x/ad937x_ctrl.hpp @@ -92,6 +92,7 @@ public: */ static sptr make( std::shared_ptr<std::mutex> spi_mutex, + const size_t deserializer_lane_xbar, mpm::types::regs_iface::sptr iface, mpm::ad937x::gpio::gain_pins_t gain_pins); virtual ~ad937x_ctrl(void) {} diff --git a/mpm/include/mpm/dboards/magnesium_manager.hpp b/mpm/include/mpm/dboards/magnesium_manager.hpp index db86618fc..dba56f6a8 100644 --- a/mpm/include/mpm/dboards/magnesium_manager.hpp +++ b/mpm/include/mpm/dboards/magnesium_manager.hpp @@ -17,7 +17,8 @@ namespace mpm { namespace dboards { { public: magnesium_manager( - const std::string &mykonos_spidev + const std::string &mykonos_spidev, + const size_t deserializer_lane_xbar ); /*! Return a reference to the SPI mutex @@ -43,7 +44,7 @@ namespace mpm { namespace dboards { void export_magnesium(){ LIBMPM_BOOST_PREAMBLE("dboards") using namespace mpm::dboards; - bp::class_<mpm::dboards::magnesium_manager>("magnesium_manager", bp::init<std::string>()) + bp::class_<mpm::dboards::magnesium_manager>("magnesium_manager", bp::init<std::string,size_t>()) .def("get_spi_lock", &mpm::dboards::magnesium_manager::get_spi_lock) .def("get_radio_ctrl", &mpm::dboards::magnesium_manager::get_radio_ctrl) ; diff --git a/mpm/lib/dboards/magnesium_manager.cpp b/mpm/lib/dboards/magnesium_manager.cpp index b130d62ad..2d12712ab 100644 --- a/mpm/lib/dboards/magnesium_manager.cpp +++ b/mpm/lib/dboards/magnesium_manager.cpp @@ -11,15 +11,16 @@ using namespace mpm::dboards; using namespace mpm::chips; magnesium_manager::magnesium_manager( - const std::string &mykonos_spidev + const std::string &mykonos_spidev, + const size_t deserializer_lane_xbar ) : _spi_mutex(std::make_shared<std::mutex>()) , _spi_lock(mpm::types::lockable::make(_spi_mutex)) , _mykonos_ctrl(ad937x_ctrl::make( _spi_mutex, + deserializer_lane_xbar, make_ad937x_iface(mykonos_spidev), mpm::ad937x::gpio::gain_pins_t() )) { - } diff --git a/mpm/lib/mykonos/ad937x_ctrl.cpp b/mpm/lib/mykonos/ad937x_ctrl.cpp index 729d3a6f3..ecb328fc8 100644 --- a/mpm/lib/mykonos/ad937x_ctrl.cpp +++ b/mpm/lib/mykonos/ad937x_ctrl.cpp @@ -172,10 +172,11 @@ class ad937x_ctrl_impl : public ad937x_ctrl public: ad937x_ctrl_impl( std::shared_ptr<std::mutex> spi_mutex, + const size_t deserializer_lane_xbar, mpm::types::regs_iface::sptr iface, mpm::ad937x::gpio::gain_pins_t gain_pins) : spi_mutex(spi_mutex), - device(iface.get(), gain_pins), + device(iface.get(), deserializer_lane_xbar, gain_pins), _iface(iface) { /* nop */ @@ -550,10 +551,11 @@ private: ad937x_ctrl::sptr ad937x_ctrl::make( std::shared_ptr<std::mutex> spi_mutex, + const size_t deserializer_lane_xbar, mpm::types::regs_iface::sptr iface, mpm::ad937x::gpio::gain_pins_t gain_pins ) { - return std::make_shared<ad937x_ctrl_impl>(spi_mutex, iface, gain_pins); + return std::make_shared<ad937x_ctrl_impl>(spi_mutex, deserializer_lane_xbar, iface, gain_pins); } diff --git a/mpm/lib/mykonos/ad937x_device.cpp b/mpm/lib/mykonos/ad937x_device.cpp index 31fe7a459..e6941b52d 100644 --- a/mpm/lib/mykonos/ad937x_device.cpp +++ b/mpm/lib/mykonos/ad937x_device.cpp @@ -257,9 +257,10 @@ Initialization functions ad937x_device::ad937x_device( mpm::types::regs_iface* iface, + const size_t deserializer_lane_xbar, const gain_pins_t gain_pins) : full_spi_settings(iface), - mykonos_config(&full_spi_settings.spi_settings), + mykonos_config(&full_spi_settings.spi_settings, deserializer_lane_xbar), gain_ctrl(gain_pins) { } diff --git a/mpm/lib/mykonos/ad937x_device.hpp b/mpm/lib/mykonos/ad937x_device.hpp index 9219cbf8c..26bb01685 100644 --- a/mpm/lib/mykonos/ad937x_device.hpp +++ b/mpm/lib/mykonos/ad937x_device.hpp @@ -45,6 +45,7 @@ public: ad937x_device( mpm::types::regs_iface* iface, + const size_t deserializer_lane_xbar, mpm::ad937x::gpio::gain_pins_t gain_pins ); diff --git a/mpm/lib/mykonos/config/ad937x_config_t.cpp b/mpm/lib/mykonos/config/ad937x_config_t.cpp index c8e50c33d..b707400c8 100644 --- a/mpm/lib/mykonos/config/ad937x_config_t.cpp +++ b/mpm/lib/mykonos/config/ad937x_config_t.cpp @@ -45,7 +45,7 @@ const int16_t ad937x_config_t::DEFAULT_SNIFFER_FIR_15366[DEFAULT_RX_FIR_SIZE] = -3988, -4942,-3512, 958, 8118,16519,23993,28395,28395,23993,16519, 8118, 958,-3512,-4942,-3988, -1871, 198, 1444, 1683, 1192, 440, -175, -466, -456, -283, -92, 30, 71, 59, 31, 10 }; -ad937x_config_t::ad937x_config_t(spiSettings_t* sps) : +ad937x_config_t::ad937x_config_t(spiSettings_t* sps, const size_t deserializer_lane_xbar) : _rx(DEFAULT_RX_SETTINGS), _rxProfile(DEFAULT_RX_PROFILE), _framer(DEFAULT_FRAMER), @@ -57,7 +57,6 @@ ad937x_config_t::ad937x_config_t(spiSettings_t* sps) : _tx(DEFAULT_TX_SETTINGS), _txProfile(DEFAULT_TX_PROFILE), _deframer(DEFAULT_DEFRAMER), - // TODO: Remove if ADI ever fixes this // The TX bring up requires a valid ORX profile // https://github.com/EttusResearch/uhddev/blob/f0f8f58471c3fed94279c32f00e9f8da7db40efd/mpm/lib/mykonos/adi/mykonos.c#L16590 @@ -89,6 +88,7 @@ ad937x_config_t::ad937x_config_t(spiSettings_t* sps) : _sniffer_rx_fir_config(DEFAULT_RX_FIR_GAIN, std::vector<int16_t>(DEFAULT_SNIFFER_FIR, DEFAULT_SNIFFER_FIR + DEFAULT_RX_FIR_SIZE)) { _device.spiSettings = sps; + _deframer.deserializerLaneCrossbar = deserializer_lane_xbar; _init_pointers(); diff --git a/mpm/lib/mykonos/config/ad937x_config_t.hpp b/mpm/lib/mykonos/config/ad937x_config_t.hpp index c50f5f774..93b08a1df 100644 --- a/mpm/lib/mykonos/config/ad937x_config_t.hpp +++ b/mpm/lib/mykonos/config/ad937x_config_t.hpp @@ -13,7 +13,7 @@ class ad937x_config_t : public boost::noncopyable { public: - ad937x_config_t(spiSettings_t* sps); + ad937x_config_t(spiSettings_t* sps, const size_t deserializer_lane_xbar); mykonosDevice_t * device; ad937x_fir rx_fir_config; diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py index 1c46d134b..24a728ba1 100644 --- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py +++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py @@ -352,8 +352,16 @@ class Magnesium(DboardManagerBase): self._port_expander = TCA6408(self._get_i2c_dev(self.slot_idx)) self._power_on() self.log.debug("Loading C++ drivers...") + + # The Mykonos TX DeFramer lane crossbar requires configuration on a per-slot + # basis due to motherboard MGT lane swapping. + # The RX framer lane crossbar configuration + # is identical for both slots and is hard-coded within the Mykonos API. + deserializer_lane_xbar = 0xD2 if self.slot_idx == 0 else 0x72 + self._device = lib.dboards.magnesium_manager( self._spi_nodes['mykonos'], + deserializer_lane_xbar ) self.mykonos = self._device.get_radio_ctrl() self.spi_lock = self._device.get_spi_lock() |