summaryrefslogtreecommitdiffstats
path: root/src/target/firmware
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-03-02 20:42:39 +0100
committerHarald Welte <laforge@gnumonks.org>2010-03-02 20:42:39 +0100
commit6944437bf492d46f8c39b4dadcd0ff55b7581eda (patch)
tree3a40dcdf690d36e8bd030327343c54fddde62cfb /src/target/firmware
parentd43fadf410e66934ce266cd1a5f96b89d56a9e90 (diff)
Introduce CONFIG_TX_ENABLE and disable Tx support by default
Tx support is considered experimental and potentially dangerous. Thus, the default build of the firmware does not have Tx support enabled. If you want Tx support, compile with -DCONFIG_TX_ENABLE by uncommenting the apropriate line in Makefile.inc
Diffstat (limited to 'src/target/firmware')
-rw-r--r--src/target/firmware/Makefile.inc3
-rw-r--r--src/target/firmware/board/common/rffe_compal_dualband.c2
-rw-r--r--src/target/firmware/layer1/init.c4
-rw-r--r--src/target/firmware/layer1/tpu_window.c2
-rw-r--r--src/target/firmware/rf/trf6151.c2
5 files changed, 13 insertions, 0 deletions
diff --git a/src/target/firmware/Makefile.inc b/src/target/firmware/Makefile.inc
index ff29340c..a130cd79 100644
--- a/src/target/firmware/Makefile.inc
+++ b/src/target/firmware/Makefile.inc
@@ -14,6 +14,9 @@ CFLAGS += -Wa,-adhlns=$(subst $(suffix $<),.lst,$<)
CFLAGS += -Os -ffunction-sections
CFLAGS += -g$(DEBUGF)
+# Uncomment this line if you want to enable Tx (Transmit) Support.
+#CFLAGS += -DCONFIG_TX_ENABLE
+
# some older toolchains don't support this, ignore it for now
#ASFLAGS=-Wa,-adhlns=$(<:.S=.lst),--g$(DEBUGF) $(INCLUDES) -D__ASSEMBLY__
ASFLAGS=-Wa,-adhlns=$(<:.S=.lst) $(INCLUDES) -D__ASSEMBLY__
diff --git a/src/target/firmware/board/common/rffe_compal_dualband.c b/src/target/firmware/board/common/rffe_compal_dualband.c
index ddf7f933..0c1b20f4 100644
--- a/src/target/firmware/board/common/rffe_compal_dualband.c
+++ b/src/target/firmware/board/common/rffe_compal_dualband.c
@@ -26,6 +26,7 @@ void rffe_mode(enum gsm_band band, int tx)
tspact &= ~PA_ENABLE;
tspact |= TRENA | GSM_TXEN; /* low-active */
+#ifdef CONFIG_TX_ENABLE
/* Then we selectively set the bits on, if required */
if (tx) {
tspact &= ~TRENA;
@@ -33,6 +34,7 @@ void rffe_mode(enum gsm_band band, int tx)
tspact &= ~GSM_TXEN;
tspact |= PA_ENABLE; /* Dieter: TODO */
}
+#endif /* TRANSMIT_SUPPORT */
tsp_act_update(tspact);
}
diff --git a/src/target/firmware/layer1/init.c b/src/target/firmware/layer1/init.c
index 601b1a2d..cad94f2f 100644
--- a/src/target/firmware/layer1/init.c
+++ b/src/target/firmware/layer1/init.c
@@ -40,6 +40,10 @@ void layer1_init(void)
{
struct msgb *msg;
+#ifndef CONFIG_TX_ENABLE
+ printf("\n\nTHIS FIRMWARE WAS COMPILED WITHOUT TX SUPPORT!!!\n\n");
+#endif
+
/* initialize asynchronous part of L1 */
l1a_init();
/* initialize TDMA Frame IRQ driven synchronous L1 */
diff --git a/src/target/firmware/layer1/tpu_window.c b/src/target/firmware/layer1/tpu_window.c
index 5a4595e4..c36fd827 100644
--- a/src/target/firmware/layer1/tpu_window.c
+++ b/src/target/firmware/layer1/tpu_window.c
@@ -101,9 +101,11 @@ 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;
+#ifdef CONFIG_TX_ENABLE
/* window open for TRF6151 and RFFE */
rffe_mode(gsm_arfcn2band(arfcn), 1);
trf6151_tx_window(offset, arfcn);
+#endif
/* Window open for ABB */
twl3025_uplink(1, offset);
diff --git a/src/target/firmware/rf/trf6151.c b/src/target/firmware/rf/trf6151.c
index a95fa9a0..de80ba98 100644
--- a/src/target/firmware/rf/trf6151.c
+++ b/src/target/firmware/rf/trf6151.c
@@ -446,6 +446,7 @@ void trf6151_rx_window(int16_t start_qbits, uint16_t arfcn, uint8_t vga_dbm, int
/* prepare a Tx window with the TRF6151 finished at time 'start' (in qbits) */
void trf6151_tx_window(int16_t start_qbits, uint16_t arfcn)
{
+#ifdef CONFIG_TX_ENABLE
int16_t start_pll_qbits;
/* power up at the right time _before_ the 'start_qbits' point in time */
@@ -456,4 +457,5 @@ void trf6151_tx_window(int16_t start_qbits, uint16_t arfcn)
trf6151_set_mode(TRF6151_TX);
/* FIXME: power down at the right time again */
+#endif
}