aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSugandha Gupta <sugandha.gupta@ettus.com>2019-11-26 17:45:34 -0800
committerMartin Braun <martin.braun@ettus.com>2019-12-02 21:21:56 -0800
commit58f56fe25b62ab21693c8fd4e32cc2d00da85338 (patch)
treeb78995dfec3deff25197d4f1d1819b681f91084a
parentb8ba43193ab763d3e9e70e0743da08c49c421549 (diff)
downloaduhd-58f56fe25b62ab21693c8fd4e32cc2d00da85338.tar.gz
uhd-58f56fe25b62ab21693c8fd4e32cc2d00da85338.tar.bz2
uhd-58f56fe25b62ab21693c8fd4e32cc2d00da85338.zip
e31x: Fix filter bank and antenna switching for channel 0
The filter bank and antenna switches have different configuration for channel 0 and channel 1. This commit fixes the issue where channel 0 produces only noise due to incorrect switches.
-rw-r--r--host/lib/usrp/dboard/e3xx/e31x_radio_control_impl.cpp37
-rw-r--r--host/lib/usrp/dboard/e3xx/e31x_radio_control_impl.hpp42
-rw-r--r--host/lib/usrp/dboard/e3xx/e3xx_bands.cpp24
3 files changed, 60 insertions, 43 deletions
diff --git a/host/lib/usrp/dboard/e3xx/e31x_radio_control_impl.cpp b/host/lib/usrp/dboard/e3xx/e31x_radio_control_impl.cpp
index 97a90ad5b..8b8daa681 100644
--- a/host/lib/usrp/dboard/e3xx/e31x_radio_control_impl.cpp
+++ b/host/lib/usrp/dboard/e3xx/e31x_radio_control_impl.cpp
@@ -87,6 +87,11 @@ uint32_t e31x_radio_control_impl::get_tx_switches(
UHD_THROW_INVALID_CODE_PATH();
break;
}
+
+ RFNOC_LOG_TRACE("TX band = " << int(band) << "TX SW1 = " << tx_sw1
+ << "TX VCTXRX_SW = " << vctxrx_sw
+ << "TX_BIAS = " << tx_bias);
+
auto tx_regs = 0 |
vctxrx_sw << VCTXRX_SW_SHIFT |
tx_bias << TX_BIAS_SHIFT |
@@ -99,9 +104,7 @@ uint32_t e31x_radio_control_impl::get_rx_switches(
const double freq,
const std::string &ant
){
- RFNOC_LOG_TRACE(
- "Update all RX freq related switches. f=" << freq << " Hz, "
- );
+ RFNOC_LOG_TRACE("Update all E310 RX freq related switches. f=" << freq << " Hz, ");
size_t fe_chan = _fe_swap ? (chan ? 0 : 1): chan;
@@ -110,7 +113,7 @@ uint32_t e31x_radio_control_impl::get_rx_switches(
auto rx_swc = RX_SWC_OFF;
auto rx_swb = RX_SWB_OFF;
auto vctxrx_sw = VCTXRX_SW_OFF;
- auto vcrx_sw = VCRX_SW_LB;
+ auto vcrx_sw = (ant == "TX/RX") ? VCRX_TXRX_SW_LB: VCRX_RX_SW_LB;
if (ant == "TX/RX") {
vctxrx_sw = (fe_chan == 0) ? VCTXRX1_SW_RX: VCTXRX2_SW_RX;
}
@@ -119,40 +122,40 @@ uint32_t e31x_radio_control_impl::get_rx_switches(
switch(band) {
case rx_band::LB_B2:
- rx_sw1 = RX_SW1_LB_B2;
- rx_swc = RX_SWC_LB_B2;
+ rx_sw1 = (fe_chan == 0) ? RX1_SW1_LB_B2: RX2_SW1_LB_B2;
+ rx_swc = (fe_chan == 0) ? RX1_SWC_LB_B2: RX2_SWC_LB_B2;
rx_swb = RX_SWB_OFF;
break;
case rx_band::LB_B3:
- rx_sw1 = RX_SW1_LB_B3;
- rx_swc = RX_SWC_LB_B3;
+ rx_sw1 = (fe_chan == 0) ? RX1_SW1_LB_B3: RX2_SW1_LB_B3;
+ rx_swc = (fe_chan == 0) ? RX1_SWC_LB_B3: RX2_SWC_LB_B3;
rx_swb = RX_SWB_OFF;
break;
case rx_band::LB_B4:
- rx_sw1 = RX_SW1_LB_B4;
- rx_swc = RX_SWC_LB_B4;
+ rx_sw1 = (fe_chan == 0) ? RX1_SW1_LB_B4: RX2_SW1_LB_B4;
+ rx_swc = (fe_chan == 0) ? RX1_SWC_LB_B4: RX2_SWC_LB_B4;
rx_swb = RX_SWB_OFF;
break;
case rx_band::LB_B5:
- rx_sw1 = RX_SW1_LB_B5;
+ rx_sw1 = (fe_chan == 0) ? RX1_SW1_LB_B5: RX2_SW1_LB_B5;
rx_swc = RX_SWC_OFF;
- rx_swb = RX_SWB_LB_B5;
+ rx_swb = (fe_chan == 0) ? RX1_SWB_LB_B5: RX2_SWB_LB_B5;
break;
case rx_band::LB_B6:
- rx_sw1 = RX_SW1_LB_B6;
+ rx_sw1 = (fe_chan == 0) ? RX1_SW1_LB_B6: RX2_SW1_LB_B6;
rx_swc = RX_SWC_OFF;
- rx_swb = RX_SWB_LB_B6;
+ rx_swb = (fe_chan == 0) ? RX1_SWB_LB_B6: RX2_SWB_LB_B6;
break;
case rx_band::LB_B7:
- rx_sw1 = RX_SW1_LB_B7;
+ rx_sw1 = (fe_chan == 0) ? RX1_SW1_LB_B7: RX2_SW1_LB_B7;
rx_swc = RX_SWC_OFF;
- rx_swb = RX_SWB_LB_B7;
+ rx_swb = (fe_chan == 0) ? RX1_SWB_LB_B7: RX2_SWB_LB_B7;
break;
case rx_band::HB:
rx_sw1 = RX_SW1_OFF;
rx_swc = RX_SWC_OFF;
rx_swb = RX_SWB_OFF;
- vcrx_sw = VCRX_SW_HB;
+ vcrx_sw = (ant == "TX/RX") ? VCRX_TXRX_SW_HB: VCRX_RX_SW_HB;
break;
case rx_band::INVALID_BAND:
RFNOC_LOG_ERROR("Cannot map RX frequency to band: " << freq);
diff --git a/host/lib/usrp/dboard/e3xx/e31x_radio_control_impl.hpp b/host/lib/usrp/dboard/e3xx/e31x_radio_control_impl.hpp
index c51d74203..1c37f4077 100644
--- a/host/lib/usrp/dboard/e3xx/e31x_radio_control_impl.hpp
+++ b/host/lib/usrp/dboard/e3xx/e31x_radio_control_impl.hpp
@@ -62,32 +62,46 @@ private:
};
enum rx_sw1_t {
- RX_SW1_LB_B2 = 4,
- RX_SW1_LB_B3 = 2,
- RX_SW1_LB_B4 = 0,
- RX_SW1_LB_B5 = 1,
- RX_SW1_LB_B6 = 3,
- RX_SW1_LB_B7 = 5,
+ RX2_SW1_LB_B2 = 5,
+ RX2_SW1_LB_B3 = 3,
+ RX2_SW1_LB_B4 = 1,
+ RX2_SW1_LB_B5 = 0,
+ RX2_SW1_LB_B6 = 2,
+ RX2_SW1_LB_B7 = 4,
+ RX1_SW1_LB_B2 = 4,
+ RX1_SW1_LB_B3 = 2,
+ RX1_SW1_LB_B4 = 0,
+ RX1_SW1_LB_B5 = 1,
+ RX1_SW1_LB_B6 = 3,
+ RX1_SW1_LB_B7 = 5,
RX_SW1_OFF = 7
};
enum rx_swc_t {
- RX_SWC_LB_B2 = 2,
- RX_SWC_LB_B3 = 3,
- RX_SWC_LB_B4 = 1,
+ RX2_SWC_LB_B2 = 1,
+ RX2_SWC_LB_B3 = 3,
+ RX2_SWC_LB_B4 = 2,
+ RX1_SWC_LB_B2 = 2,
+ RX1_SWC_LB_B3 = 3,
+ RX1_SWC_LB_B4 = 1,
RX_SWC_OFF = 0
};
enum rx_swb_t {
- RX_SWB_LB_B5 = 2,
- RX_SWB_LB_B6 = 3,
- RX_SWB_LB_B7 = 1,
+ RX2_SWB_LB_B5 = 1,
+ RX2_SWB_LB_B6 = 3,
+ RX2_SWB_LB_B7 = 2,
+ RX1_SWB_LB_B5 = 2,
+ RX1_SWB_LB_B6 = 3,
+ RX1_SWB_LB_B7 = 1,
RX_SWB_OFF = 0
};
enum vcrx_sw_t {
- VCRX_SW_LB = 1,
- VCRX_SW_HB = 2,
+ VCRX_RX_SW_LB = 1,
+ VCRX_RX_SW_HB = 2,
+ VCRX_TXRX_SW_LB = 2,
+ VCRX_TXRX_SW_HB = 1,
VCRX_SW_OFF = 0 //or 3
};
diff --git a/host/lib/usrp/dboard/e3xx/e3xx_bands.cpp b/host/lib/usrp/dboard/e3xx/e3xx_bands.cpp
index 83e96b3ec..d3dc99fec 100644
--- a/host/lib/usrp/dboard/e3xx/e3xx_bands.cpp
+++ b/host/lib/usrp/dboard/e3xx/e3xx_bands.cpp
@@ -48,18 +48,18 @@
/*
* E31x frequency bands:
*
- * For RX:
- * Band Freq RX_BSEL-210 RXC_BSEL-10 RXB_BSEL-10 RX2 TX/RX
- * VCRX_V1_V2 VCTXRX_V1_V2
- * chan 1 | chan 2
- * ---------------------------------------------------------------------------------
- * LB_B2: < 450 RF5 100 J2 10 -- 00 01 J2 10 J1 01
- * LB_B3: 450-700 RF3 010 J3 11 -- 00 01 J2 10 J1 01
- * LB_B4: 700-1200 RF1 000 J1 01 -- 00 01 J2 10 J1 01
- * LB_B5: 1200-1800 RF2 001 -- 00 J2 10 01 J2 10 J1 01
- * LB_B6: 1800-2350 RF4 011 -- 00 J3 11 01 J2 10 J1 01
- * LB_B7: 2350-2600 RF6 101 -- 00 J1 01 01 J2 10 J1 01
- * HB: 2600+ --- 111 -- 00 -- 00 10 J2 10 J1 01
+ * For RX: (chan here is fe_chan - swapped)
+ * Band Freq RX_BSEL-210 RXC_BSEL-10 RXB_BSEL-10 RX2 TX/RX
+ * VCRX_V1_V2 VCTXRX_V1_V2
+ * chan1 | chan2 chan1 | chan2 chan1 | chan2 RX ant | TXRX ant chan2 | chan1
+ * ----------------------------------------------------------------------------------------------------
+ * LB_B2: < 450 RF5 100 RF6 101 J2 10 J1 01 -- 00 -- 00 01 10 J2 10 J1 01
+ * LB_B3: 450-700 RF3 010 RF4 011 J3 11 J3 11 -- 00 -- 00 01 10 J2 10 J1 01
+ * LB_B4: 700-1200 RF1 000 RF2 001 J1 01 J2 10 -- 00 -- 00 01 10 J2 10 J1 01
+ * LB_B5: 1200-1800 RF2 001 RF1 000 -- 00 -- 00 J2 10 J1 01 01 10 J2 10 J1 01
+ * LB_B6: 1800-2350 RF4 011 RF3 010 -- 00 -- 00 J3 11 J3 11 01 10 J2 10 J1 01
+ * LB_B7: 2350-2600 RF6 101 RF5 100 -- 00 -- 00 J1 01 J2 10 01 10 J2 10 J1 01
+ * HB: 2600+ --- 111 --- 111 -- 00 -- 00 -- 00 -- 00 10 01 J2 10 J1 01
*
*
* For TX: