aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/mboard_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-24 21:27:08 -0800
committerJosh Blum <josh@joshknows.com>2010-12-11 18:43:10 -0800
commit8af031ad8957817c5e93a2da41ca569dcd088a6f (patch)
tree79485a9af7512a41e17768156d87af5ec6125b43 /host/lib/usrp/usrp2/mboard_impl.cpp
parent5f651c29913e3ae2616569ea6aef24d7a2f3f9d6 (diff)
downloaduhd-8af031ad8957817c5e93a2da41ca569dcd088a6f.tar.gz
uhd-8af031ad8957817c5e93a2da41ca569dcd088a6f.tar.bz2
uhd-8af031ad8957817c5e93a2da41ca569dcd088a6f.zip
usrp-n: configure clocking over the serdes cable
added status to register to readback master/slave mode removed mimo enum from clock config, its not relevant added serdes clock config to the update clock config method
Diffstat (limited to 'host/lib/usrp/usrp2/mboard_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index deb43bb13..20404635a 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -154,7 +154,6 @@ void usrp2_mboard_impl::update_clock_config(void){
//translate pps source enums
switch(_clock_config.pps_source){
case clock_config_t::PPS_SMA: pps_flags |= U2_FLAG_TIME64_PPS_SMA; break;
- case clock_config_t::PPS_MIMO: pps_flags |= U2_FLAG_TIME64_PPS_MIMO; break;
default: throw std::runtime_error("unhandled clock configuration pps source");
}
@@ -175,7 +174,6 @@ void usrp2_mboard_impl::update_clock_config(void){
switch(_clock_config.ref_source){
case clock_config_t::REF_INT : _iface->poke32(_iface->regs.misc_ctrl_clock, 0x12); break;
case clock_config_t::REF_SMA : _iface->poke32(_iface->regs.misc_ctrl_clock, 0x1C); break;
- case clock_config_t::REF_MIMO: _iface->poke32(_iface->regs.misc_ctrl_clock, 0x15); break;
default: throw std::runtime_error("unhandled clock configuration reference source");
}
_clock_ctrl->enable_external_ref(true); //USRP2P has an internal 10MHz TCXO
@@ -186,7 +184,6 @@ void usrp2_mboard_impl::update_clock_config(void){
switch(_clock_config.ref_source){
case clock_config_t::REF_INT : _iface->poke32(_iface->regs.misc_ctrl_clock, 0x10); break;
case clock_config_t::REF_SMA : _iface->poke32(_iface->regs.misc_ctrl_clock, 0x1C); break;
- case clock_config_t::REF_MIMO: _iface->poke32(_iface->regs.misc_ctrl_clock, 0x15); break;
default: throw std::runtime_error("unhandled clock configuration reference source");
}
_clock_ctrl->enable_external_ref(_clock_config.ref_source != clock_config_t::REF_INT);
@@ -194,6 +191,16 @@ void usrp2_mboard_impl::update_clock_config(void){
case usrp2_iface::USRP_NXXX: break;
}
+
+ //Handle the serdes clocking based on master/slave mode:
+ // - Masters always drive the clock over serdes.
+ // - Slaves always lock to this serdes clock.
+ // - Slaves lock their time over the serdes.
+ const bool master_mode = bool(_iface->peek32(_iface->regs.status) & (1 << 8));
+ _clock_ctrl->enable_mimo_clock_out(master_mode);
+ if (not master_mode) _iface->poke32(_iface->regs.misc_ctrl_clock, 0x15);
+ //TODO slaves lock time over the serdes...
+
}
void usrp2_mboard_impl::set_time_spec(const time_spec_t &time_spec, bool now){