aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-07-06 17:23:14 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-07-20 07:21:41 -0500
commitde68707dd42b55822c2b1fa19003675d03010982 (patch)
tree434a4e8503f43e92d1634e8c5e1e63922a022c42 /host/lib
parent4185493a016eb69e2b78d6fd20101ace7c44064f (diff)
downloaduhd-de68707dd42b55822c2b1fa19003675d03010982.tar.gz
uhd-de68707dd42b55822c2b1fa19003675d03010982.tar.bz2
uhd-de68707dd42b55822c2b1fa19003675d03010982.zip
b200: Move the B200 radio control core into usrp/b200/
This serves two purposes: - This file no longer goes into the compiled DLL if B200 is disabled - Discourage use of this file for new devices, making it clear that this architecture is no longer used The file itself is left untouched, only the class is renamed from radio_ctrl_core_3000 to b200_radio_ctrl_core. Note: In UHD 3, this file was also used by N230.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/b200/CMakeLists.txt1
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp8
-rw-r--r--host/lib/usrp/b200/b200_impl.hpp14
-rw-r--r--host/lib/usrp/b200/b200_io_impl.cpp2
-rw-r--r--host/lib/usrp/b200/b200_radio_ctrl_core.cpp (renamed from host/lib/usrp/cores/radio_ctrl_core_3000.cpp)16
-rw-r--r--host/lib/usrp/b200/b200_radio_ctrl_core.hpp (renamed from host/lib/include/uhdlib/usrp/cores/radio_ctrl_core_3000.hpp)7
-rw-r--r--host/lib/usrp/cores/CMakeLists.txt1
7 files changed, 24 insertions, 25 deletions
diff --git a/host/lib/usrp/b200/CMakeLists.txt b/host/lib/usrp/b200/CMakeLists.txt
index 9ac732c02..3dd26774b 100644
--- a/host/lib/usrp/b200/CMakeLists.txt
+++ b/host/lib/usrp/b200/CMakeLists.txt
@@ -21,5 +21,6 @@ if(ENABLE_B200)
${CMAKE_CURRENT_SOURCE_DIR}/b200_uart.cpp
${CMAKE_CURRENT_SOURCE_DIR}/b200_cores.cpp
${CMAKE_CURRENT_SOURCE_DIR}/b200_mb_eeprom.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/b200_radio_ctrl_core.cpp
)
endif(ENABLE_B200)
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index 65d009e61..2e2ed5a98 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -501,7 +501,7 @@ b200_impl::b200_impl(
////////////////////////////////////////////////////////////////////
// Local control endpoint
////////////////////////////////////////////////////////////////////
- _local_ctrl = radio_ctrl_core_3000::make(false /*lilE*/,
+ _local_ctrl = b200_radio_ctrl_core::make(false /*lilE*/,
_ctrl_transport,
zero_copy_if::sptr() /*null*/,
B200_LOCAL_CTRL_SID);
@@ -868,16 +868,16 @@ void b200_impl::setup_radio(const size_t dspno)
////////////////////////////////////////////////////////////////////
// radio control
////////////////////////////////////////////////////////////////////
- perif.ctrl = radio_ctrl_core_3000::make(
+ perif.ctrl = b200_radio_ctrl_core::make(
false /*lilE*/, _ctrl_transport, zero_copy_if::sptr() /*null*/, sid);
perif.ctrl->hold_task(_async_task);
_async_task_data->radio_ctrl[dspno] = perif.ctrl; // weak
_tree->access<time_spec_t>(mb_path / "time" / "cmd")
.add_coerced_subscriber(std::bind(
- &radio_ctrl_core_3000::set_time, perif.ctrl, std::placeholders::_1));
+ &b200_radio_ctrl_core::set_time, perif.ctrl, std::placeholders::_1));
_tree->access<double>(mb_path / "tick_rate")
.add_coerced_subscriber(std::bind(
- &radio_ctrl_core_3000::set_tick_rate, perif.ctrl, std::placeholders::_1));
+ &b200_radio_ctrl_core::set_tick_rate, perif.ctrl, std::placeholders::_1));
this->register_loopback_self_test(perif.ctrl);
////////////////////////////////////////////////////////////////////
diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp
index 44205f03a..b280bcc87 100644
--- a/host/lib/usrp/b200/b200_impl.hpp
+++ b/host/lib/usrp/b200/b200_impl.hpp
@@ -10,6 +10,7 @@
#include "b200_cores.hpp"
#include "b200_iface.hpp"
+#include "b200_radio_ctrl_core.hpp"
#include "b200_uart.hpp"
#include <uhd/device.hpp>
#include <uhd/property_tree.hpp>
@@ -26,20 +27,19 @@
#include <uhdlib/usrp/common/ad9361_ctrl.hpp>
#include <uhdlib/usrp/common/ad936x_manager.hpp>
#include <uhdlib/usrp/common/adf4001_ctrl.hpp>
+#include <uhdlib/usrp/common/pwr_cal_mgr.hpp>
#include <uhdlib/usrp/common/recv_packet_demuxer_3000.hpp>
#include <uhdlib/usrp/cores/gpio_atr_3000.hpp>
-#include <uhdlib/usrp/cores/radio_ctrl_core_3000.hpp>
#include <uhdlib/usrp/cores/rx_dsp_core_3000.hpp>
#include <uhdlib/usrp/cores/rx_vita_core_3000.hpp>
#include <uhdlib/usrp/cores/time_core_3000.hpp>
#include <uhdlib/usrp/cores/tx_dsp_core_3000.hpp>
#include <uhdlib/usrp/cores/tx_vita_core_3000.hpp>
#include <uhdlib/usrp/cores/user_settings_core_3000.hpp>
-#include <uhdlib/usrp/common/pwr_cal_mgr.hpp>
+#include <unordered_map>
#include <boost/assign.hpp>
#include <memory>
#include <mutex>
-#include <unordered_map>
static const uint8_t B200_FW_COMPAT_NUM_MAJOR = 8;
static const uint8_t B200_FW_COMPAT_NUM_MINOR = 0;
@@ -143,7 +143,7 @@ private:
// controllers
b200_iface::sptr _iface;
- radio_ctrl_core_3000::sptr _local_ctrl;
+ b200_radio_ctrl_core::sptr _local_ctrl;
uhd::usrp::ad9361_ctrl::sptr _codec_ctrl;
uhd::usrp::ad936x_manager::sptr _codec_mgr;
b200_local_spi_core::sptr _spi_iface;
@@ -166,8 +166,8 @@ private:
struct AsyncTaskData
{
std::shared_ptr<async_md_type> async_md;
- std::weak_ptr<radio_ctrl_core_3000> local_ctrl;
- std::weak_ptr<radio_ctrl_core_3000> radio_ctrl[2];
+ std::weak_ptr<b200_radio_ctrl_core> local_ctrl;
+ std::weak_ptr<b200_radio_ctrl_core> radio_ctrl[2];
b200_uart::sptr gpsdo_uart;
};
std::shared_ptr<AsyncTaskData> _async_task_data;
@@ -193,7 +193,7 @@ private:
// perifs in the radio core
struct radio_perifs_t
{
- radio_ctrl_core_3000::sptr ctrl;
+ b200_radio_ctrl_core::sptr ctrl;
uhd::usrp::gpio_atr::gpio_atr_3000::sptr atr;
uhd::usrp::gpio_atr::gpio_atr_3000::sptr fp_gpio;
time_core_3000::sptr time64;
diff --git a/host/lib/usrp/b200/b200_io_impl.cpp b/host/lib/usrp/b200/b200_io_impl.cpp
index a20709497..2433ab2db 100644
--- a/host/lib/usrp/b200/b200_io_impl.cpp
+++ b/host/lib/usrp/b200/b200_io_impl.cpp
@@ -327,7 +327,7 @@ boost::optional<uhd::msg_task::msg_type_t> b200_impl::handle_async_task(
case B200_RESP0_MSG_SID:
case B200_RESP1_MSG_SID:
case B200_LOCAL_RESP_SID: {
- radio_ctrl_core_3000::sptr ctrl;
+ b200_radio_ctrl_core::sptr ctrl;
if (sid == B200_RESP0_MSG_SID)
ctrl = data->radio_ctrl[0].lock();
if (sid == B200_RESP1_MSG_SID)
diff --git a/host/lib/usrp/cores/radio_ctrl_core_3000.cpp b/host/lib/usrp/b200/b200_radio_ctrl_core.cpp
index 6947da3f1..e885bf1b6 100644
--- a/host/lib/usrp/cores/radio_ctrl_core_3000.cpp
+++ b/host/lib/usrp/b200/b200_radio_ctrl_core.cpp
@@ -5,6 +5,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
+#include "b200_radio_ctrl_core.hpp"
#include <uhd/exception.hpp>
#include <uhd/transport/bounded_buffer.hpp>
#include <uhd/transport/vrt_if_packet.hpp>
@@ -12,7 +13,6 @@
#include <uhd/utils/log.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhdlib/usrp/common/async_packet_handler.hpp>
-#include <uhdlib/usrp/cores/radio_ctrl_core_3000.hpp>
#include <boost/format.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
@@ -25,17 +25,17 @@ using namespace uhd::transport;
static const double ACK_TIMEOUT = 2.0; // supposed to be worst case practical timeout
static const double MASSIVE_TIMEOUT = 10.0; // for when we wait on a timed command
-static const size_t SR_READBACK = 32;
+static const size_t SR_READBACK = 32;
-radio_ctrl_core_3000::~radio_ctrl_core_3000(void)
+b200_radio_ctrl_core::~b200_radio_ctrl_core(void)
{
/* NOP */
}
-class radio_ctrl_core_3000_impl : public radio_ctrl_core_3000
+class b200_radio_ctrl_core_impl : public b200_radio_ctrl_core
{
public:
- radio_ctrl_core_3000_impl(const bool big_endian,
+ b200_radio_ctrl_core_impl(const bool big_endian,
uhd::transport::zero_copy_if::sptr ctrl_xport,
uhd::transport::zero_copy_if::sptr resp_xport,
const uint32_t sid,
@@ -60,7 +60,7 @@ public:
this->set_tick_rate(1.0); // something possible but bogus
}
- ~radio_ctrl_core_3000_impl(void) override
+ ~b200_radio_ctrl_core_impl(void) override
{
_timeout = ACK_TIMEOUT; // reset timeout to something small
UHD_SAFE_CALL(
@@ -338,12 +338,12 @@ private:
const size_t _resp_queue_size;
};
-radio_ctrl_core_3000::sptr radio_ctrl_core_3000::make(const bool big_endian,
+b200_radio_ctrl_core::sptr b200_radio_ctrl_core::make(const bool big_endian,
zero_copy_if::sptr ctrl_xport,
zero_copy_if::sptr resp_xport,
const uint32_t sid,
const std::string& name)
{
return sptr(
- new radio_ctrl_core_3000_impl(big_endian, ctrl_xport, resp_xport, sid, name));
+ new b200_radio_ctrl_core_impl(big_endian, ctrl_xport, resp_xport, sid, name));
}
diff --git a/host/lib/include/uhdlib/usrp/cores/radio_ctrl_core_3000.hpp b/host/lib/usrp/b200/b200_radio_ctrl_core.hpp
index c24ee4524..06f2c9fbf 100644
--- a/host/lib/include/uhdlib/usrp/cores/radio_ctrl_core_3000.hpp
+++ b/host/lib/usrp/b200/b200_radio_ctrl_core.hpp
@@ -11,19 +11,18 @@
#include <uhd/types/time_spec.hpp>
#include <uhd/types/wb_iface.hpp>
#include <uhd/utils/msg_task.hpp>
-#include <boost/utility.hpp>
#include <memory>
#include <string>
/*!
* Provide access to peek, poke for the radio ctrl module
*/
-class radio_ctrl_core_3000 : public uhd::timed_wb_iface
+class b200_radio_ctrl_core : public uhd::timed_wb_iface
{
public:
- typedef std::shared_ptr<radio_ctrl_core_3000> sptr;
+ typedef std::shared_ptr<b200_radio_ctrl_core> sptr;
- ~radio_ctrl_core_3000(void) override = 0;
+ ~b200_radio_ctrl_core(void) override = 0;
//! Make a new control object
static sptr make(const bool big_endian,
diff --git a/host/lib/usrp/cores/CMakeLists.txt b/host/lib/usrp/cores/CMakeLists.txt
index 461ef0552..1c20ccc47 100644
--- a/host/lib/usrp/cores/CMakeLists.txt
+++ b/host/lib/usrp/cores/CMakeLists.txt
@@ -25,7 +25,6 @@ LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/dsp_core_utils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gpio_atr_3000.cpp
${CMAKE_CURRENT_SOURCE_DIR}/i2c_core_100_wb32.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/radio_ctrl_core_3000.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rx_dsp_core_3000.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rx_frontend_core_200.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rx_frontend_core_3000.cpp