diff options
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp')
-rw-r--r-- | host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp | 82 |
1 files changed, 32 insertions, 50 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp index 5b0eb60d1..f89b26de2 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp @@ -120,16 +120,10 @@ void magnesium_radio_ctrl_impl::_init_peripherals() fs_path tx_lo_path = _root_path.branch_path() / str(boost::format("Radio_%d") % ((get_block_id().get_block_count()/2)*2)) / "tx_lo"; - // TODO: When we move back to 2 chans per RFNoC block, this needs to be - // non-conditional, and the else-branch goes away: - if (_master) { - UHD_LOG_TRACE(unique_id(), "Initializing SPI core..."); - _spi = spi_core_3000::make(_get_ctrl(0), - radio_ctrl_impl::regs::sr_addr(radio_ctrl_impl::regs::SPI), - radio_ctrl_impl::regs::RB_SPI); - } else { - UHD_LOG_TRACE(unique_id(), "Not a master radio, no SPI core."); - } + UHD_LOG_TRACE(unique_id(), "Initializing SPI core..."); + _spi = spi_core_3000::make(_get_ctrl(0), + radio_ctrl_impl::regs::sr_addr(radio_ctrl_impl::regs::SPI), + radio_ctrl_impl::regs::RB_SPI); UHD_LOG_TRACE(unique_id(), "Initializing CPLD..."); UHD_LOG_TRACE(unique_id(), "CPLD path: " << cpld_path); @@ -170,37 +164,32 @@ void magnesium_radio_ctrl_impl::_init_peripherals() _cpld = _tree->access<magnesium_cpld_ctrl::sptr>(cpld_path).get(); } - // TODO: Same comment as above applies - if (_master) { - UHD_LOG_TRACE(unique_id(), "Initializing TX LO..."); - _tx_lo = adf435x_iface::make_adf4351( - [this](const std::vector<uint32_t> transactions){ - for (const uint32_t transaction: transactions) { - this->_spi->write_spi( - SEN_TX_LO, - spi_config_t::EDGE_RISE, - transaction, - 32 - ); - } + UHD_LOG_TRACE(unique_id(), "Initializing TX LO..."); + _tx_lo = adf435x_iface::make_adf4351( + [this](const std::vector<uint32_t> transactions){ + for (const uint32_t transaction: transactions) { + this->_spi->write_spi( + SEN_TX_LO, + spi_config_t::EDGE_RISE, + transaction, + 32 + ); } - ); - UHD_LOG_TRACE(unique_id(), "Initializing RX LO..."); - _rx_lo = adf435x_iface::make_adf4351( - [this](const std::vector<uint32_t> transactions){ - for (const uint32_t transaction: transactions) { - this->_spi->write_spi( - SEN_RX_LO, - spi_config_t::EDGE_RISE, - transaction, - 32 - ); - } + } + ); + UHD_LOG_TRACE(unique_id(), "Initializing RX LO..."); + _rx_lo = adf435x_iface::make_adf4351( + [this](const std::vector<uint32_t> transactions){ + for (const uint32_t transaction: transactions) { + this->_spi->write_spi( + SEN_RX_LO, + spi_config_t::EDGE_RISE, + transaction, + 32 + ); } - ); - } else { - UHD_LOG_TRACE(unique_id(), "Not a master radio, no LOs."); - } + } + ); _gpio.clear(); // Following the as-if rule, this can get optimized out for (size_t radio_idx = 0; radio_idx < _get_num_radios(); radio_idx++) { @@ -744,17 +733,10 @@ void magnesium_radio_ctrl_impl::_init_frontend_subtree( void magnesium_radio_ctrl_impl::_init_prop_tree() { const fs_path fe_base = fs_path("dboards") / _radio_slot; - this->_init_frontend_subtree(_tree->subtree(fe_base), 0); - // TODO: When we go to one radio per dboard, the above if statement goes - // away, and instead we have something like this: - /* - *for (chan_idx = 0; chan_idx < MAGNESIUM_NUM_CHANS; chan_idx++) { - * this->_init_frontend_subtree( - * _tree->get_subtree(fe_base), chan_idx); - *} - */ - - + for (size_t chan_idx = 0; chan_idx < MAGNESIUM_NUM_CHANS; chan_idx++) { + this->_init_frontend_subtree( + _tree->subtree(fe_base), chan_idx); + } // EEPROM paths subject to change FIXME _tree->create<eeprom_map_t>(_root_path / "eeprom") |