aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-10-11 18:04:12 +0200
committerMax <msuraev@sysmocom.de>2017-10-11 18:06:55 +0200
commit8c9bc5c6c70a34c88733f09bd1d8f7735881357b (patch)
treecb37bbb6e2083649c69179aca3f5dcda463bf30d /src
parent3552247ae8d86bddc4e76529eeb8406c5cb470d6 (diff)
sysmo: don't override clock source with defaults
Previously clock source configured via vty was ignored. Check that it wasn't configured and only apply default value in that case. Change-Id: I8de74a12d2096971a8a83946dc6c7cdb9889acd7 Fixes: OS#1944
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bts-sysmo/l1_if.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 3d286443..44ba3de7 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -1640,19 +1640,22 @@ struct femtol1_hdl *l1if_open(struct phy_instance *pinst)
clk_cal_use_eeprom(fl1h);
get_hwinfo_eeprom(fl1h);
#if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(2,1,0)
- if (fl1h->hw_info.model_nr == 2050) {
- /* On the sysmoBTS 2050, we don't have an OCXO but
- * start with the TCXO and will sync it with the PPS
- * of the GPS in case there is a fix. */
- fl1h->clk_src = SuperFemto_ClkSrcId_Tcxo;
- LOGP(DL1C, LOGL_INFO, "Clock source defaulting to GPS 1PPS "
- "on sysmoBTS 2050\n");
- } else {
- /* default clock source: OCXO */
- fl1h->clk_src = SuperFemto_ClkSrcId_Ocxo;
+ if (fl1h->clk_src == SuperFemto_ClkSrcId_None) {
+ if (fl1h->hw_info.model_nr == 2050) {
+ /* On the sysmoBTS 2050, we don't have an OCXO but
+ * start with the TCXO and will sync it with the PPS
+ * of the GPS in case there is a fix. */
+ fl1h->clk_src = SuperFemto_ClkSrcId_Tcxo;
+ LOGP(DL1C, LOGL_INFO, "Clock source defaulting to GPS 1PPS "
+ "on sysmoBTS 2050\n");
+ } else {
+ /* default clock source: OCXO */
+ fl1h->clk_src = SuperFemto_ClkSrcId_Ocxo;
+ }
}
#else
- fl1h->clk_src = SF_CLKSRC_OCXO;
+ if (fl1h->clk_src == SF_CLKSRC_NONE)
+ fl1h->clk_src = SF_CLKSRC_OCXO;
#endif
rc = l1if_transport_open(MQ_SYS_WRITE, fl1h);