From e8b46e15e5b42ab2d5e362c45438bf1900d6819d Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Wed, 16 Jan 2013 22:57:29 +0100 Subject: fw/l1/tpu: Add function to open multi slot TX TPU window Signed-off-by: Sylvain Munaut --- src/target/firmware/include/layer1/tpu_window.h | 1 + src/target/firmware/layer1/tpu_window.c | 45 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) 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