diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2013-01-16 22:57:29 +0100 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2014-06-15 19:30:52 +0200 |
commit | e8b46e15e5b42ab2d5e362c45438bf1900d6819d (patch) | |
tree | f6c73fe261ca08573aea1e3806c4fb9bf03c601d | |
parent | 8069114adac6f798f33001d2fc1f115111887b83 (diff) |
fw/l1/tpu: Add function to open multi slot TX TPU window
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r-- | src/target/firmware/include/layer1/tpu_window.h | 1 | ||||
-rw-r--r-- | src/target/firmware/layer1/tpu_window.c | 45 |
2 files changed, 46 insertions, 0 deletions
diff --git a/src/target/firmware/include/layer1/tpu_window.h b/src/target/firmware/include/layer1/tpu_window.h index 7b146f12..5c9b9ac8 100644 --- a/src/target/firmware/include/layer1/tpu_window.h +++ b/src/target/firmware/include/layer1/tpu_window.h @@ -18,6 +18,7 @@ enum l1_txwin_type { void l1s_win_init(void); void l1s_rx_win_ctrl(uint16_t arfcn, enum l1_rxwin_type wtype, uint8_t tn_ofs); void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr, uint8_t tn_ofs); +void l1s_tx_multi_win_ctrl(uint16_t arfcn, uint8_t pwr, uint8_t tn_ofs, int width); void tpu_end_scenario(void); diff --git a/src/target/firmware/layer1/tpu_window.c b/src/target/firmware/layer1/tpu_window.c index f4e76c16..76b4876a 100644 --- a/src/target/firmware/layer1/tpu_window.c +++ b/src/target/firmware/layer1/tpu_window.c @@ -168,6 +168,51 @@ void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr, uint rffe_mode(gsm_arfcn2band(arfcn), 0); } +void l1s_tx_multi_win_ctrl(uint16_t arfcn, uint8_t pwr, uint8_t tn_ofs, int width) +{ + uint16_t offset; + int wait, i; + + /* TN offset & TA adjust */ + offset = 28; /* ("+ 32" gives a TA of 1) */ + offset += L1_BURST_LENGTH_Q * tn_ofs; + offset -= l1s.ta << 2; + +#ifdef CONFIG_TX_ENABLE + /* window open for TRF6151 */ + trf6151_tx_window(offset, arfcn); +#endif + + /* Window open for ABB */ + twl3025_uplink(1, offset); + +#ifdef CONFIG_TX_ENABLE + /* Window open for RFFE */ + rffe_mode(gsm_arfcn2band(arfcn), 1); +#endif + + /* Multi slot int generation */ + wait = 200; + + for (i=1; i<width; i++) { + tpu_enq_wait(wait); + tpu_enq_dsp_irq(); + wait = tx_burst_duration[L1_TXWIN_NB]; + } + + /* Total width */ + offset += width * tx_burst_duration[L1_TXWIN_NB] + 2; // TODO: "+ 2" + + /* Window close for ABB */ + twl3025_uplink(0, offset); + + /* window close for TRF6151 and RFFE */ + trf6151_set_mode(TRF6151_IDLE); + + /* Window close for RFFE */ + rffe_mode(gsm_arfcn2band(arfcn), 0); +} + void tpu_end_scenario(void) { tpu_enq_sleep(); |