summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/include
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2012-10-19 23:07:39 +0200
committerSylvain Munaut <tnt@246tNt.com>2012-11-14 20:18:22 +0100
commit08bc45147bb58700236c4d455080cdeea9cc27a8 (patch)
treea36d1bcf740e924528e6b57d1184641f9d3beb84 /src/target/firmware/include
parentee18c7b84241b67827c52f166d62cb187532a268 (diff)
target: Add support for IQ swap when required
Operation in GSM850 band requires IQ swap because of the offset PLL used in the TRF causing spectrum reversal. Thanks to Dieter Spaar for noticing the issue and the original patch Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'src/target/firmware/include')
-rw-r--r--src/target/firmware/include/calypso/dsp.h9
-rw-r--r--src/target/firmware/include/rf/trf6151.h3
-rw-r--r--src/target/firmware/include/rffe.h3
3 files changed, 15 insertions, 0 deletions
diff --git a/src/target/firmware/include/calypso/dsp.h b/src/target/firmware/include/calypso/dsp.h
index e4801cbf..4f391a7a 100644
--- a/src/target/firmware/include/calypso/dsp.h
+++ b/src/target/firmware/include/calypso/dsp.h
@@ -2,6 +2,7 @@
#define _CALYPSO_DSP_H
#include <calypso/dsp_api.h>
+#include <rffe.h>
#define CAL_DSP_TGT_BB_LVL 80
@@ -38,4 +39,12 @@ void dsp_end_scenario(void);
void dsp_load_rx_task(uint16_t task, uint8_t burst_id, uint8_t tsc);
void dsp_load_tx_task(uint16_t task, uint8_t burst_id, uint8_t tsc);
+static inline uint16_t
+dsp_task_iq_swap(uint16_t dsp_task, uint16_t band_arfcn, int tx)
+{
+ if (rffe_iq_swapped(band_arfcn, tx))
+ dsp_task |= 0x8000;
+ return dsp_task;
+}
+
#endif
diff --git a/src/target/firmware/include/rf/trf6151.h b/src/target/firmware/include/rf/trf6151.h
index c1eaf3b2..6a23d8ac 100644
--- a/src/target/firmware/include/rf/trf6151.h
+++ b/src/target/firmware/include/rf/trf6151.h
@@ -48,4 +48,7 @@ void trf6151_tx_window(int16_t start_qbits, uint16_t arfcn);
* dBm, configure the RF Frontend with the respective gain */
void trf6151_compute_gain(int16_t exp_inp, int16_t target_bb);
+/* Need for IQ swap */
+int trf6151_iq_swapped(uint16_t band_arfcn, int tx);
+
#endif /* TRF6151_H */
diff --git a/src/target/firmware/include/rffe.h b/src/target/firmware/include/rffe.h
index 63a3a4b5..02fc1fda 100644
--- a/src/target/firmware/include/rffe.h
+++ b/src/target/firmware/include/rffe.h
@@ -25,6 +25,9 @@ enum rffe_port
uint32_t rffe_get_rx_ports(void);
uint32_t rffe_get_tx_ports(void);
+/* IQ swap requirements */
+int rffe_iq_swapped(uint16_t band_arfcn, int tx);
+
/* get current gain of RF frontend (anything between antenna and baseband in dBm */
uint8_t rffe_get_gain(void);