summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte2010-02-23 01:34:47 +0100
committerHarald Welte2010-03-01 23:48:44 +0100
commit330fe01d803655c395676cf030e8f12087c8835d (patch)
treedb30ffd969446f271762284c79bd7a8e7a0124fe
parentTRF6151: Add new trf6151_tx_window() function (diff)
downloadosmocom-330fe01d803655c395676cf030e8f12087c8835d.tar.gz
osmocom-330fe01d803655c395676cf030e8f12087c8835d.tar.xz
osmocom-330fe01d803655c395676cf030e8f12087c8835d.zip
Uplink: Use TPU window driven model
This means we can even send and receive in the same TDMA frame, provided we keep the usual 3 timeslot distance between DL and UL.
-rw-r--r--src/target/firmware/abb/twl3025.c12
-rw-r--r--src/target/firmware/layer1/tpu_window.c7
2 files changed, 16 insertions, 3 deletions
diff --git a/src/target/firmware/abb/twl3025.c b/src/target/firmware/abb/twl3025.c
index 24149a7..0181713 100644
--- a/src/target/firmware/abb/twl3025.c
+++ b/src/target/firmware/abb/twl3025.c
@@ -245,6 +245,9 @@ void twl3025_downlink(int on, int16_t at)
}
}
+/* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY - BULON_TO_BULCAL - TSP_DELAY */
+#define UPLINK_DELAY (3 * TSP_DELAY + BULCAL_DURATION + BULON_TO_BULCAL + 35)
+
void twl3025_uplink(int on, int16_t at)
{
int16_t bul_ena = at - TSP_DELAY - 6;
@@ -252,12 +255,19 @@ void twl3025_uplink(int on, int16_t at)
if (bul_ena < 0)
printf("BULENA time negative (%d)\n", bul_ena);
if (on) {
- /* FIXME: calibration should be done just before BULENA */
+ /* calibration should be done just before BULENA */
+ tpu_enq_at(bul_ena - UPLINK_DELAY);
+ /* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY - BULON_TO_BULCAL - TSP_DELAY */
twl3025_tsp_write(BULON);
+ /* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY - BULON_TO_BULCAL */
tpu_enq_wait(BULON_TO_BULCAL - TSP_DELAY);
+ /* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY */
twl3025_tsp_write(BULON | BULCAL);
+ /* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION */
tpu_enq_wait(BULCAL_DURATION - TSP_DELAY);
+ /* bdl_ena - 35 - TSP_DELAY */
twl3025_tsp_write(BULON);
+ /* bdl_ena - 35 */
tpu_enq_wait(35); /* minimum time required to bring the ramp up (really needed?) */
tpu_enq_at(bul_ena);
twl3025_tsp_write(BULON | BULENA);
diff --git a/src/target/firmware/layer1/tpu_window.c b/src/target/firmware/layer1/tpu_window.c
index b6cbf1f..5a4595e 100644
--- a/src/target/firmware/layer1/tpu_window.c
+++ b/src/target/firmware/layer1/tpu_window.c
@@ -101,7 +101,9 @@ void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr)
/* uplink is three TS after downlink ( "+ 32" gives a TA of 1) */
uint16_t offset = (L1_BURST_LENGTH_Q * 3) + 28;
- /* FIXME: window open for TRF6151 and RFFE */
+ /* window open for TRF6151 and RFFE */
+ rffe_mode(gsm_arfcn2band(arfcn), 1);
+ trf6151_tx_window(offset, arfcn);
/* Window open for ABB */
twl3025_uplink(1, offset);
@@ -109,7 +111,8 @@ void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr)
/* Window close for ABB */
twl3025_uplink(0, tx_burst_duration[wtype] + offset + 2); // TODO: "+ 2"
- /* FIXME: window close for TRF6151 and RFFE */
+ /* window close for TRF6151 and RFFE */
+ trf6151_set_mode(TRF6151_IDLE);
}
void tpu_end_scenario(void)