aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-03-24 10:41:04 +0100
committerHarald Welte <laforge@gnumonks.org>2017-03-24 16:07:20 +0100
commit628f530b72095421a875502a6c5a11240454f6e1 (patch)
treea0337a6d04f0c688968dadce9eab890ff413df18
parent957843959d4d9046b4eb5beb42cc41dd7bb56bed (diff)
sysmobts: Don't start with 0dBm TRX output power before rampinglaforge/avoid_ramp_spike
In case a system has a high-gain external PA (like a 40dB PA) connected externally, we cannot simply switch the transceiver to 0 dBm in trx_init() only to then start the ramping at much lower levels once the PHJ completes in trx_init_compl_cb(). The result would be a short 0 + 40 dBm spike followed by later ramping. We want to avoid that spike, particularly its associated inrush current, so let's bring up the board with smething very conservative like -50 dBm, and then ramp from there. Change-Id: I0ad91fce64f65e0213c9fcfde3390ace519055db
-rw-r--r--include/osmo-bts/tx_power.h2
-rw-r--r--src/common/tx_power.c15
-rw-r--r--src/osmo-bts-sysmo/oml.c3
-rw-r--r--tests/tx_power/tx_power_test.c8
4 files changed, 27 insertions, 1 deletions
diff --git a/include/osmo-bts/tx_power.h b/include/osmo-bts/tx_power.h
index 8d099bc..21887c7 100644
--- a/include/osmo-bts/tx_power.h
+++ b/include/osmo-bts/tx_power.h
@@ -74,3 +74,5 @@ int get_p_trxout_actual_mdBm_lchan(struct gsm_lchan *lchan);
int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass);
void power_trx_change_compl(struct gsm_bts_trx *trx, int p_trxout_cur_mdBm);
+
+int power_ramp_initial_power_mdBm(struct gsm_bts_trx *trx);
diff --git a/src/common/tx_power.c b/src/common/tx_power.c
index c517918..3dfe1f7 100644
--- a/src/common/tx_power.c
+++ b/src/common/tx_power.c
@@ -289,3 +289,18 @@ int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass)
return 0;
}
+
+/* determine the initial transceiver output power at start-up time */
+int power_ramp_initial_power_mdBm(struct gsm_bts_trx *trx)
+{
+ struct trx_power_params *tpp = &trx->power_params;
+ int pout_mdBm;
+
+ /* this is the maximum initial output on the antenna connector
+ * towards the antenna */
+ pout_mdBm = tpp->ramp.max_initial_pout_mdBm;
+
+ /* use this as input to compute transceiver board power
+ * (reflecting gains in internal/external amplifiers */
+ return get_p_trxout_eff_mdBm(trx, pout_mdBm);
+}
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 01752d1..2847a48 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -389,6 +389,7 @@ static int trx_init(struct gsm_bts_trx *trx)
GsmL1_MphInitReq_t *mi_req;
GsmL1_DeviceParam_t *dev_par;
int femto_band;
+ int initial_mdBm = power_ramp_initial_power_mdBm(trx);
if (!gsm_abis_mo_check_attr(&trx->mo, trx_rqd_attr,
ARRAY_SIZE(trx_rqd_attr))) {
@@ -416,7 +417,7 @@ static int trx_init(struct gsm_bts_trx *trx)
dev_par->fRxPowerLevel = trx_ms_pwr_ctrl_is_osmo(trx)
? 0.0 : btsb->ul_power_target;
- dev_par->fTxPowerLevel = 0.0;
+ dev_par->fTxPowerLevel = ((float) initial_mdBm) / 1000;
LOGP(DL1C, LOGL_NOTICE, "Init TRX (ARFCN %u, TSC %u, RxPower % 2f dBm, "
"TxPower % 2.2f dBm\n", dev_par->u16Arfcn, dev_par->u8NbTsc,
dev_par->fRxPowerLevel, dev_par->fTxPowerLevel);
diff --git a/tests/tx_power/tx_power_test.c b/tests/tx_power/tx_power_test.c
index d657362..268e338 100644
--- a/tests/tx_power/tx_power_test.c
+++ b/tests/tx_power/tx_power_test.c
@@ -44,6 +44,7 @@ static const struct trx_power_params tpp_1002 = {
.nominal_gain_mdB = 0,
},
.ramp = {
+ .max_initial_pout_mdBm = to_mdB(23),
.step_size_mdB = to_mdB(2),
.step_interval_sec = 1,
},
@@ -62,6 +63,7 @@ static const struct trx_power_params tpp_1020 = {
.nominal_gain_mdB = 0,
},
.ramp = {
+ .max_initial_pout_mdBm = to_mdB(23),
.step_size_mdB = to_mdB(2),
.step_interval_sec = 1,
},
@@ -80,6 +82,7 @@ static const struct trx_power_params tpp_1100 = {
.nominal_gain_mdB = 0,
},
.ramp = {
+ .max_initial_pout_mdBm = to_mdB(23),
.step_size_mdB = to_mdB(2),
.step_interval_sec = 1,
},
@@ -98,6 +101,7 @@ static const struct trx_power_params tpp_2050 = {
.nominal_gain_mdB = 0,
},
.ramp = {
+ .max_initial_pout_mdBm = to_mdB(23),
.step_size_mdB = to_mdB(2),
.step_interval_sec = 1,
},
@@ -108,6 +112,7 @@ static void test_sbts1002(struct gsm_bts_trx *trx)
printf("Testing tx_power calculation for sysmoBTS 1002\n");
trx->power_params = tpp_1002;
trx->max_power_red = 0;
+ OSMO_ASSERT(power_ramp_initial_power_mdBm(trx) == to_mdB(23));
OSMO_ASSERT(get_p_max_out_mdBm(trx) == to_mdB(23));
/* at max_power_red = 0, we expect full 23dBm */
OSMO_ASSERT(get_p_nominal_mdBm(trx) == to_mdB(23));
@@ -125,6 +130,7 @@ static void test_sbts1020(struct gsm_bts_trx *trx)
printf("Testing tx_power calculation for sysmoBTS 1020\n");
trx->power_params = tpp_1020;
trx->max_power_red = 0;
+ OSMO_ASSERT(power_ramp_initial_power_mdBm(trx) == to_mdB(13));
OSMO_ASSERT(get_p_max_out_mdBm(trx) == to_mdB(33));
/* at max_power_red = 0, we expect full 33dBm */
OSMO_ASSERT(get_p_nominal_mdBm(trx) == to_mdB(33));
@@ -143,6 +149,7 @@ static void test_sbts1100(struct gsm_bts_trx *trx)
printf("Testing tx_power calculation for sysmoBTS 1100\n");
trx->power_params = tpp_1100;
trx->max_power_red = 0;
+ OSMO_ASSERT(power_ramp_initial_power_mdBm(trx) == to_mdB(6));
OSMO_ASSERT(get_p_max_out_mdBm(trx) == to_mdB(40));
/* at max_power_red = 0, we expect full 33dBm */
OSMO_ASSERT(get_p_nominal_mdBm(trx) == to_mdB(40));
@@ -160,6 +167,7 @@ static void test_sbts2050(struct gsm_bts_trx *trx)
printf("Testing tx_power calculation for sysmoBTS 2050\n");
trx->power_params = tpp_2050;
trx->max_power_red = 0;
+ OSMO_ASSERT(power_ramp_initial_power_mdBm(trx) == to_mdB(23));
OSMO_ASSERT(get_p_max_out_mdBm(trx) == to_mdB(37));
/* at max_power_red = 0, we expect full 37dBm */
OSMO_ASSERT(get_p_nominal_mdBm(trx) == to_mdB(37));