summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b100
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-02-14 12:03:52 -0800
committerJosh Blum <josh@joshknows.com>2012-02-14 12:03:52 -0800
commit8bd255c5f6ed586603727ffaa56d1eeb325458af (patch)
tree341223ed711ee8d226179d6abc1c4ecaaf30b013 /host/lib/usrp/b100
parent2f21932ae1e8f7cc584eff791dcd67a8ea2ca144 (diff)
downloaduhd-8bd255c5f6ed586603727ffaa56d1eeb325458af.tar.gz
uhd-8bd255c5f6ed586603727ffaa56d1eeb325458af.tar.bz2
uhd-8bd255c5f6ed586603727ffaa56d1eeb325458af.zip
b100: added transport flushes and moved around reset code
Diffstat (limited to 'host/lib/usrp/b100')
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp15
-rw-r--r--host/lib/usrp/b100/b100_impl.hpp2
2 files changed, 4 insertions, 13 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 4c9f93249..af10590ac 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -181,9 +181,9 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
//load FPGA image, gpif is disabled while loading
this->enable_gpif(false);
_fx2_ctrl->usrp_load_fpga(b100_fpga_image);
+ _fx2_ctrl->usrp_fpga_reset(false); //active low reset
+ _fx2_ctrl->usrp_fpga_reset(true);
this->enable_gpif(true);
- this->set_reset_fpga(1);
- this->set_reset_fpga(0);
//create the control transport
device_addr_t ctrl_xport_args;
@@ -198,12 +198,12 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
3, 4, //interface, endpoint
ctrl_xport_args
);
+ while (_ctrl_transport->get_recv_buff(0.0)){} //flush ctrl xport
////////////////////////////////////////////////////////////////////
// Initialize FPGA wishbone communication
////////////////////////////////////////////////////////////////////
_fpga_ctrl = b100_ctrl::make(_ctrl_transport);
- this->reset_gpif(6); //always reset first to ensure communication
_fpga_ctrl->poke32(B100_REG_GLOBAL_RESET, 0); //global fpga reset
this->check_fpga_compat(); //check after reset and making control
@@ -234,6 +234,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
),
B100_MAX_PKT_BYTE_LIMIT
);
+ while (_data_transport->get_recv_buff(0.0)){} //flush data xport
////////////////////////////////////////////////////////////////////
// Initialize the properties tree
@@ -515,10 +516,6 @@ void b100_impl::update_clock_source(const std::string &source){
}
////////////////// some GPIF preparation related stuff /////////////////
-void b100_impl::reset_gpif(const boost::uint16_t ep) {
- _fx2_ctrl->usrp_control_write(VRQ_RESET_GPIF, ep, ep, 0, 0);
-}
-
void b100_impl::enable_gpif(const bool en) {
_fx2_ctrl->usrp_control_write(VRQ_ENABLE_GPIF, en ? 1 : 0, 0, 0, 0);
}
@@ -527,10 +524,6 @@ void b100_impl::clear_fpga_fifo(void) {
_fx2_ctrl->usrp_control_write(VRQ_CLEAR_FPGA_FIFO, 0, 0, 0, 0);
}
-void b100_impl::set_reset_fpga(const bool en) {
- _fx2_ctrl->usrp_control_write(VRQ_FPGA_SET_RESET, en ? 0 : 1, 0, 0, 0);
-}
-
sensor_value_t b100_impl::get_ref_locked(void){
const bool lock = _clock_ctrl->get_locked();
return sensor_value_t("Ref", lock, "locked", "unlocked");
diff --git a/host/lib/usrp/b100/b100_impl.hpp b/host/lib/usrp/b100/b100_impl.hpp
index b71b65562..eab9c750b 100644
--- a/host/lib/usrp/b100/b100_impl.hpp
+++ b/host/lib/usrp/b100/b100_impl.hpp
@@ -123,10 +123,8 @@ private:
void update_rx_subdev_spec(const uhd::usrp::subdev_spec_t &);
void update_tx_subdev_spec(const uhd::usrp::subdev_spec_t &);
void update_clock_source(const std::string &);
- void reset_gpif(const boost::uint16_t);
void enable_gpif(const bool);
void clear_fpga_fifo(void);
- void set_reset_fpga(const bool en);
void handle_async_message(uhd::transport::managed_recv_buffer::sptr);
uhd::sensor_value_t get_ref_locked(void);
void set_rx_fe_corrections(const double);