summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-22 17:33:12 -0800
committerJosh Blum <josh@joshknows.com>2011-12-16 10:51:41 -0800
commit38be7bc800f4f017f84895a65266f95bf52a8328 (patch)
treeb0f5a04e185d4e468fd0e49c52259f6cca0b08cf
parent8288ab3924b9504d973377be61b1048a6411196d (diff)
downloaduhd-38be7bc800f4f017f84895a65266f95bf52a8328.tar.gz
uhd-38be7bc800f4f017f84895a65266f95bf52a8328.tar.bz2
uhd-38be7bc800f4f017f84895a65266f95bf52a8328.zip
b100: tweaks for fpga resets on init
-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 98c5cab8c..af82616a1 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -165,7 +165,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;
@@ -182,19 +186,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