aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b100
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-22 17:33:12 -0800
committerJosh Blum <josh@joshknows.com>2011-11-22 17:33:12 -0800
commit71810ad1fc9a3612b4673a674e64be5782681c18 (patch)
treeaa5b1d4ebb8ed3ae72069719b5d6c678c4fe260e /host/lib/usrp/b100
parent2bb08f3f70cdf8c7184f4f6b5dcf03b3b20449d5 (diff)
downloaduhd-71810ad1fc9a3612b4673a674e64be5782681c18.tar.gz
uhd-71810ad1fc9a3612b4673a674e64be5782681c18.tar.bz2
uhd-71810ad1fc9a3612b4673a674e64be5782681c18.zip
b100: tweaks for fpga resets on init
Diffstat (limited to 'host/lib/usrp/b100')
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 7674a0fcf..b7ab8c28a 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -167,7 +167,11 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
this->check_fw_compat(); //check after making fx2
//-- setup clock after making fx2 and before loading fpga --//
_clock_ctrl = b100_clock_ctrl::make(_fx2_ctrl, device_addr.cast<double>("master_clock_rate", B100_DEFAULT_TICK_RATE));
+
+ //load FPGA image, gpif is disabled while loading
+ this->enable_gpif(false);
_fx2_ctrl->usrp_load_fpga(b100_fpga_image);
+ this->enable_gpif(true);
//create the control transport
device_addr_t ctrl_xport_args;
@@ -184,19 +188,12 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
);
////////////////////////////////////////////////////////////////////
- // Create controller objects
+ // Initialize FPGA wishbone communication
////////////////////////////////////////////////////////////////////
_fpga_ctrl = b100_ctrl::make(_ctrl_transport);
- this->enable_gpif(true); //TODO best place to put this?
- this->check_fpga_compat(); //check after making control
-
- ////////////////////////////////////////////////////////////////////
- // Reset buffers in data path
- ////////////////////////////////////////////////////////////////////
- _fpga_ctrl->poke32(B100_REG_GLOBAL_RESET, 0);
- _fpga_ctrl->poke32(B100_REG_CLEAR_RX, 0);
- _fpga_ctrl->poke32(B100_REG_CLEAR_TX, 0);
- this->reset_gpif(6);
+ 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
////////////////////////////////////////////////////////////////////
// Initialize peripherals after reset