summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-09-15 14:58:44 -0700
committerNick Foster <nick@nerdnetworks.org>2010-09-15 14:58:44 -0700
commited245848df8cc011ae8fe30833ecc28049139db5 (patch)
treeda03d37de541826df734e8ab87e0b6114595afc8 /host/lib/usrp/usrp2
parent44ac4461407aae3e26b218a1ab1bd27f893c5e96 (diff)
parent72646d1960b0c979afec225e741d7d89a827c7d0 (diff)
downloaduhd-ed245848df8cc011ae8fe30833ecc28049139db5.tar.gz
uhd-ed245848df8cc011ae8fe30833ecc28049139db5.tar.bz2
uhd-ed245848df8cc011ae8fe30833ecc28049139db5.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp2p
Conflicts: host/lib/usrp/usrp2/CMakeLists.txt host/lib/usrp/usrp2/mboard_impl.cpp host/lib/usrp/usrp2/usrp2_regs.hpp
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r--host/lib/usrp/usrp2/CMakeLists.txt65
-rw-r--r--host/lib/usrp/usrp2/codec_ctrl.cpp4
-rw-r--r--host/lib/usrp/usrp2/fw_common.h2
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp4
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp11
-rw-r--r--host/lib/usrp/usrp2/usrp2_regs.hpp1
6 files changed, 54 insertions, 33 deletions
diff --git a/host/lib/usrp/usrp2/CMakeLists.txt b/host/lib/usrp/usrp2/CMakeLists.txt
index 47d74cec8..f7984fce5 100644
--- a/host/lib/usrp/usrp2/CMakeLists.txt
+++ b/host/lib/usrp/usrp2/CMakeLists.txt
@@ -17,25 +17,46 @@
#This file will be included by cmake, use absolute paths!
-LIBUHD_APPEND_SOURCES(
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/clock_ctrl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/clock_ctrl.hpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/codec_ctrl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/codec_ctrl.hpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/codec_impl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/dboard_impl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/dboard_iface.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/dsp_impl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/gps_ctrl.hpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/gps_ctrl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/io_impl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/mboard_impl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/serdes_ctrl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/serdes_ctrl.hpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_iface.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_iface.hpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_impl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_impl.hpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_regs.hpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_regs.cpp
-)
+########################################################################
+# Conditionally configure the USRP2 support
+########################################################################
+MESSAGE(STATUS "Configuring USRP2 support...")
+
+IF(DEFINED ENABLE_USRP2)
+ IF(ENABLE_USRP2)
+ MESSAGE(STATUS "USRP2 support enabled by configure flag")
+ ELSE(ENABLE_USRP2)
+ MESSAGE(STATUS "USRP2 support disabled by configure flag")
+ ENDIF(ENABLE_USRP2)
+ELSE(DEFINED ENABLE_USRP2) #not defined: automatic enabling of component
+ SET(ENABLE_USRP2 TRUE)
+ENDIF(DEFINED ENABLE_USRP2)
+SET(ENABLE_USRP2 ${ENABLE_USRP2} CACHE BOOL "enable USRP2 support")
+
+IF(ENABLE_USRP2)
+ MESSAGE(STATUS " Building USRP2 support.")
+ LIBUHD_APPEND_SOURCES(
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/clock_ctrl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/clock_ctrl.hpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/codec_ctrl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/codec_ctrl.hpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/codec_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/dboard_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/dboard_iface.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/dsp_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/gps_ctrl.hpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/gps_ctrl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/io_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/mboard_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/serdes_ctrl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/serdes_ctrl.hpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_iface.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_iface.hpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_impl.cpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_impl.hpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_regs.hpp
+ ${CMAKE_SOURCE_DIR}/lib/usrp/usrp2/usrp2_regs.cpp
+ )
+ELSE(ENABLE_USRP2)
+ MESSAGE(STATUS " Skipping USRP2 support.")
+ENDIF(ENABLE_USRP2)
diff --git a/host/lib/usrp/usrp2/codec_ctrl.cpp b/host/lib/usrp/usrp2/codec_ctrl.cpp
index e5be62205..22a892f02 100644
--- a/host/lib/usrp/usrp2/codec_ctrl.cpp
+++ b/host/lib/usrp/usrp2/codec_ctrl.cpp
@@ -66,8 +66,8 @@ public:
this->send_ads62p44_reg(0x00); //issue a reset to the ADC
//everything else should be pretty much default, i think
// _ads62p44_regs.decimation = DECIMATION_DECIMATE_1;
-
-
+ _ads62p44_regs.power_down = ads62p44_regs_t::POWER_DOWN_NORMAL;
+ this->send_ads62p44_reg(0x14);
}
}
diff --git a/host/lib/usrp/usrp2/fw_common.h b/host/lib/usrp/usrp2/fw_common.h
index 4d3b62d6b..12ff1a76f 100644
--- a/host/lib/usrp/usrp2/fw_common.h
+++ b/host/lib/usrp/usrp2/fw_common.h
@@ -33,7 +33,7 @@ extern "C" {
#endif
//fpga and firmware compatibility numbers
-#define USRP2_FPGA_COMPAT_NUM 1
+#define USRP2_FPGA_COMPAT_NUM 2
#define USRP2_FW_COMPAT_NUM 6
//used to differentiate control packets over data port
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index c67bd02fd..94ff5c2ce 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -113,7 +113,7 @@ void usrp2_impl::io_impl::recv_pirate_loop(
metadata.event_code = vrt_packet_handler::get_context_code<async_metadata_t::event_code_t>(vrt_hdr, if_packet_info);
//print the famous U, and push the metadata into the message queue
- if (metadata.event_code & underflow_flags) std::cerr << "U";
+ if (metadata.event_code & underflow_flags) std::cerr << "U" << std::flush;
async_msg_fifo->push_with_pop_on_full(metadata);
continue;
}
@@ -121,7 +121,7 @@ void usrp2_impl::io_impl::recv_pirate_loop(
//handle the packet count / sequence number
if (if_packet_info.packet_count != next_packet_seq){
//std::cerr << "S" << (if_packet_info.packet_count - next_packet_seq)%16;
- std::cerr << "O"; //report overflow (drops in the kernel)
+ std::cerr << "O" << std::flush; //report overflow (drops in the kernel)
}
next_packet_seq = (if_packet_info.packet_count+1)%16;
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index b5a8ebc53..2669df9bc 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -77,12 +77,16 @@ usrp2_mboard_impl::usrp2_mboard_impl(
_allowed_decim_and_interp_rates.push_back(i);
}
+ //Issue a stop streaming command (in case it was left running).
+ //Since this command is issued before the networking is setup,
+ //most if not all junk packets will never make it to the socket.
+ this->issue_ddc_stream_cmd(stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
+
//setup the vrt rx registers
_iface->poke32(_iface->regs.rx_ctrl_nsamps_per_pkt, _io_helper.get_max_recv_samps_per_packet());
_iface->poke32(_iface->regs.rx_ctrl_nchannels, 1);
_iface->poke32(_iface->regs.rx_ctrl_clear_overrun, 1); //reset
_iface->poke32(_iface->regs.rx_ctrl_vrt_header, 0
-
| (0x1 << 28) //if data with stream id
| (0x1 << 26) //has trailer
| (0x3 << 22) //integer time other
@@ -116,11 +120,6 @@ usrp2_mboard_impl::usrp2_mboard_impl(
//set default subdev specs
(*this)[MBOARD_PROP_RX_SUBDEV_SPEC] = subdev_spec_t();
(*this)[MBOARD_PROP_TX_SUBDEV_SPEC] = subdev_spec_t();
-
- //Issue a stop streaming command (in case it was left running).
- //Since this command is issued before the networking is setup,
- //most if not all junk packets will never make it to the socket.
- this->issue_ddc_stream_cmd(stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
}
usrp2_mboard_impl::~usrp2_mboard_impl(void){
diff --git a/host/lib/usrp/usrp2/usrp2_regs.hpp b/host/lib/usrp/usrp2/usrp2_regs.hpp
index 0a171d20c..f74c78b7b 100644
--- a/host/lib/usrp/usrp2/usrp2_regs.hpp
+++ b/host/lib/usrp/usrp2/usrp2_regs.hpp
@@ -211,6 +211,7 @@ usrp2_regs_t usrp2_get_regs(int hw_rev);
* </pre>
*/
+
/////////////////////////////////////////////////
// DSP RX Regs
////////////////////////////////////////////////