diff options
author | Josh Blum <josh@joshknows.com> | 2011-06-16 18:47:44 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-06-16 18:47:44 -0700 |
commit | 5f49df7cab3cf4e726771178a87201f884947a6e (patch) | |
tree | 5214de6b9e3a37659596858b8d3aac74d4f24c91 /host/lib/usrp/b100/mboard_impl.cpp | |
parent | 4caf9db3dbe6d04c98236072d562a805afce9085 (diff) | |
download | uhd-5f49df7cab3cf4e726771178a87201f884947a6e.tar.gz uhd-5f49df7cab3cf4e726771178a87201f884947a6e.tar.bz2 uhd-5f49df7cab3cf4e726771178a87201f884947a6e.zip |
b100: support for dual dsp
Diffstat (limited to 'host/lib/usrp/b100/mboard_impl.cpp')
-rw-r--r-- | host/lib/usrp/b100/mboard_impl.cpp | 73 |
1 files changed, 54 insertions, 19 deletions
diff --git a/host/lib/usrp/b100/mboard_impl.cpp b/host/lib/usrp/b100/mboard_impl.cpp index f9807e348..4f7dc8fce 100644 --- a/host/lib/usrp/b100/mboard_impl.cpp +++ b/host/lib/usrp/b100/mboard_impl.cpp @@ -1,5 +1,5 @@ // -// Copyright 2010 Ettus Research LLC +// Copyright 2011 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -90,7 +90,7 @@ void b100_impl::mboard_get(const wax::obj &key_, wax::obj &val){ //handle the get request conditioned on the key switch(key.as<mboard_prop_t>()){ case MBOARD_PROP_NAME: - val = std::string("USRP-B100 mboard"); + val = std::string(_iface->get_cname() + " mboard"); return; case MBOARD_PROP_OTHERS: @@ -116,21 +116,19 @@ void b100_impl::mboard_get(const wax::obj &key_, wax::obj &val){ return; case MBOARD_PROP_RX_DSP: - UHD_ASSERT_THROW(key.name == ""); - val = _rx_ddc_proxy->get_link(); + val = _rx_dsp_proxies[key.name]->get_link(); return; case MBOARD_PROP_RX_DSP_NAMES: - val = prop_names_t(1, ""); + val = _rx_dsp_proxies.keys(); return; case MBOARD_PROP_TX_DSP: - UHD_ASSERT_THROW(key.name == ""); - val = _tx_duc_proxy->get_link(); + val = _tx_dsp_proxies[key.name]->get_link(); return; case MBOARD_PROP_TX_DSP_NAMES: - val = prop_names_t(1, ""); + val = _tx_dsp_proxies.keys(); return; case MBOARD_PROP_CLOCK_CONFIG: @@ -199,22 +197,59 @@ void b100_impl::mboard_set(const wax::obj &key, const wax::obj &val) } return; - case MBOARD_PROP_RX_SUBDEV_SPEC: + case MBOARD_PROP_RX_SUBDEV_SPEC:{ _rx_subdev_spec = val.as<subdev_spec_t>(); verify_rx_subdev_spec(_rx_subdev_spec, _mboard_proxy->get_link()); - UHD_ASSERT_THROW(_rx_subdev_spec.size() == 1); - //set the mux - _iface->poke32(B100_REG_DSP_RX_MUX, dsp_type1::calc_rx_mux_word( - _dboard_manager->get_rx_subdev(_rx_subdev_spec.front().sd_name)[SUBDEV_PROP_CONNECTION].as<subdev_conn_t>() - )); - return; + //sanity check + UHD_ASSERT_THROW(_rx_subdev_spec.size() <= B100_NUM_RX_DSPS); + + //determine frontend swap IQ from the first channel + bool fe_swap_iq = false; + switch(_dboard_manager->get_rx_subdev(_rx_subdev_spec.at(0).sd_name)[SUBDEV_PROP_CONNECTION].as<subdev_conn_t>()){ + case SUBDEV_CONN_COMPLEX_QI: + case SUBDEV_CONN_REAL_Q: + fe_swap_iq = true; + break; + default: fe_swap_iq = false; + } + _iface->poke32(B100_REG_RX_FE_SWAP_IQ, fe_swap_iq? 1 : 0); + + //set the dsp mux for each channel + for (size_t i = 0; i < _rx_subdev_spec.size(); i++){ + bool iq_swap = false, real_mode = false; + switch(_dboard_manager->get_rx_subdev(_rx_subdev_spec.at(i).sd_name)[SUBDEV_PROP_CONNECTION].as<subdev_conn_t>()){ + case SUBDEV_CONN_COMPLEX_IQ: + iq_swap = fe_swap_iq; + real_mode = false; + break; + case SUBDEV_CONN_COMPLEX_QI: + iq_swap = not fe_swap_iq; + real_mode = false; + break; + case SUBDEV_CONN_REAL_I: + iq_swap = fe_swap_iq; + real_mode = true; + break; + case SUBDEV_CONN_REAL_Q: + iq_swap = not fe_swap_iq; + real_mode = true; + break; + } + _iface->poke32(B100_REG_DSP_RX_MUX(i), + (iq_swap? B100_FLAG_DSP_RX_MUX_SWAP_IQ : 0) | + (real_mode? B100_FLAG_DSP_RX_MUX_REAL_MODE : 0) + ); + } + this->update_xport_channel_mapping(); + }return; case MBOARD_PROP_TX_SUBDEV_SPEC: _tx_subdev_spec = val.as<subdev_spec_t>(); verify_tx_subdev_spec(_tx_subdev_spec, _mboard_proxy->get_link()); - UHD_ASSERT_THROW(_tx_subdev_spec.size() == 1); - //set the mux and set the number of tx channels - _iface->poke32(B100_REG_DSP_TX_MUX, dsp_type1::calc_tx_mux_word( + //sanity check + UHD_ASSERT_THROW(_tx_subdev_spec.size() <= B100_NUM_TX_DSPS); + //set the mux + _iface->poke32(B100_REG_TX_FE_MUX, dsp_type1::calc_tx_mux_word( _dboard_manager->get_tx_subdev(_tx_subdev_spec.front().sd_name)[SUBDEV_PROP_CONNECTION].as<subdev_conn_t>() )); return; @@ -239,7 +274,7 @@ void b100_impl::mboard_set(const wax::obj &key, const wax::obj &val) << "See the application notes for USRP-B100 for further instructions.\n" ; _clock_ctrl->set_fpga_clock_rate(val.as<double>()); - update_transport_channel_mapping(); + update_xport_channel_mapping(); return; default: UHD_THROW_PROP_SET_ERROR(); |