diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2013-12-27 19:27:43 +0100 |
---|---|---|
committer | Steve Markgraf <steve@steve-m.de> | 2021-10-23 18:51:19 +0200 |
commit | 6116aae8b26b52ec9c87156e62b3420b81860811 (patch) | |
tree | 8e9a0ee4d955c1b441b96dc113f199c3d5689ace | |
parent | 1df0b450c19073753c85fea60aad699a53384207 (diff) |
fw/calypso/dsp: Make dsp_extcode only load with trx app
As dsp_extcode breaks power measurement and eventually other things,
dsp_excode is only loaded with trx app, not with layer1 nor rssi.
-rw-r--r-- | src/target/firmware/apps/layer1/main.c | 2 | ||||
-rw-r--r-- | src/target/firmware/apps/rssi/main.c | 2 | ||||
-rw-r--r-- | src/target/firmware/apps/trx/main.c | 4 | ||||
-rw-r--r-- | src/target/firmware/calypso/dsp.c | 20 | ||||
-rw-r--r-- | src/target/firmware/include/calypso/dsp.h | 2 | ||||
-rw-r--r-- | src/target/firmware/include/layer1/sync.h | 2 | ||||
-rw-r--r-- | src/target/firmware/layer1/init.c | 4 |
7 files changed, 20 insertions, 16 deletions
diff --git a/src/target/firmware/apps/layer1/main.c b/src/target/firmware/apps/layer1/main.c index b2e66e2c..001acfb9 100644 --- a/src/target/firmware/apps/layer1/main.c +++ b/src/target/firmware/apps/layer1/main.c @@ -108,7 +108,7 @@ int main(void) atrLength = calypso_sim_powerup(atr); read_factory_rf_calibration(); - layer1_init(); + layer1_init(0); tpu_frame_irq_en(1, 1); diff --git a/src/target/firmware/apps/rssi/main.c b/src/target/firmware/apps/rssi/main.c index b04fe28d..e7ee894c 100644 --- a/src/target/firmware/apps/rssi/main.c +++ b/src/target/firmware/apps/rssi/main.c @@ -1530,7 +1530,7 @@ int main(void) sercomm_register_rx_cb(SC_DLCI_L1A_L23, l1a_l23_rx_cb); read_factory_rf_calibration(); - layer1_init(); + layer1_init(0); l1a_l23_tx_cb = l1a_l23_tx; // display_unset_attr(DISP_ATTR_INVERT); diff --git a/src/target/firmware/apps/trx/main.c b/src/target/firmware/apps/trx/main.c index dfca4337..9b072a37 100644 --- a/src/target/firmware/apps/trx/main.c +++ b/src/target/firmware/apps/trx/main.c @@ -130,8 +130,8 @@ int main(void) /* Init TRX */ trx_init(); - /* Init layer 1 */ - layer1_init(); + /* Init layer 1 with dsp_extcpde */ + layer1_init(1); tpu_frame_irq_en(1, 1); diff --git a/src/target/firmware/calypso/dsp.c b/src/target/firmware/calypso/dsp.c index 21bd5e98..a1d8db54 100644 --- a/src/target/firmware/calypso/dsp.c +++ b/src/target/firmware/calypso/dsp.c @@ -197,7 +197,7 @@ static void dsp_pre_boot(const struct dsp_section *bootcode) dsp_bl_wait_ready(); } -static void dsp_set_params(int16_t *param_tab, int param_size) +static void dsp_set_params(int16_t *param_tab, int param_size, int load_extcode) { int i; int16_t *param_ptr = (int16_t *) BASE_API_PARAM; @@ -205,9 +205,11 @@ static void dsp_set_params(int16_t *param_tab, int param_size) /* Start DSP up to bootloader */ dsp_pre_boot(dsp_bootcode); - /* Load our DSP extensions */ - dputs("Installing DSP extensions patch\n"); - dsp_bl_upload_sections(dsp_extcode); + if (load_extcode) { + /* Load our DSP extensions */ + dputs("Installing DSP extensions patch\n"); + dsp_bl_upload_sections(dsp_extcode); + } /* Configure API params */ dputs("Setting some dsp_api.ndb values\n"); @@ -230,8 +232,10 @@ static void dsp_set_params(int16_t *param_tab, int param_size) for (i = 0; i < param_size; i ++) *param_ptr++ = param_tab[i]; - /* Init address for the extensions */ - dsp_api.param->d_gprs_install_address = DSP_EXT_START; + if (load_extcode) { + /* Init address for the extensions */ + dsp_api.param->d_gprs_install_address = DSP_EXT_START; + } /* Perform actual boot */ dputs("Finishing download phase\n"); @@ -450,12 +454,12 @@ static void dsp_db_init(void) dsp_api_memset((uint16_t *)BASE_API_R_PAGE_1, sizeof(T_DB_DSP_TO_MCU)); } -void dsp_power_on(void) +void dsp_power_on(int load_extcode) { /* probably a good idea to initialize the whole API area to a known value */ dsp_api_memset((uint16_t *)BASE_API_RAM, API_SIZE * 2); // size is in words - dsp_set_params((int16_t *)&dsp_params, sizeof(dsp_params)/2); + dsp_set_params((int16_t *)&dsp_params, sizeof(dsp_params)/2, load_extcode); dsp_ndb_init(); dsp_db_init(); dsp_api.frame_ctr = 0; diff --git a/src/target/firmware/include/calypso/dsp.h b/src/target/firmware/include/calypso/dsp.h index 4f391a7a..3f039934 100644 --- a/src/target/firmware/include/calypso/dsp.h +++ b/src/target/firmware/include/calypso/dsp.h @@ -21,7 +21,7 @@ struct dsp_api { extern struct dsp_api dsp_api; -void dsp_power_on(void); +void dsp_power_on(int load_extcode); void dsp_dump_version(void); void dsp_dump(void); void dsp_checksum_task(void); diff --git a/src/target/firmware/include/layer1/sync.h b/src/target/firmware/include/layer1/sync.h index 14fb877d..ea939125 100644 --- a/src/target/firmware/include/layer1/sync.h +++ b/src/target/firmware/include/layer1/sync.h @@ -198,7 +198,7 @@ void l1s_init(void); void l1s_reset(void); /* init.c */ -void layer1_init(void); +void layer1_init(int load_extcode); /* A debug macro to print every TDMA frame */ #ifdef DEBUG_EVERY_TDMA diff --git a/src/target/firmware/layer1/init.c b/src/target/firmware/layer1/init.c index e7fde232..f4cdb1d6 100644 --- a/src/target/firmware/layer1/init.c +++ b/src/target/firmware/layer1/init.c @@ -36,7 +36,7 @@ #include <layer1/async.h> #include <layer1/l23_api.h> -void layer1_init(void) +void layer1_init(int load_extcode) { #ifndef CONFIG_TX_ENABLE printf("\n\nTHIS FIRMWARE WAS COMPILED WITHOUT TX SUPPORT!!!\n\n"); @@ -47,7 +47,7 @@ void layer1_init(void) /* initialize TDMA Frame IRQ driven synchronous L1 */ l1s_init(); /* power up the DSP */ - dsp_power_on(); + dsp_power_on(load_extcode); /* Initialize TPU, TSP and TRF drivers */ tpu_init(); |