summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-09-30 23:16:35 +0200
committerHarald Welte <laforge@gnumonks.org>2017-01-15 21:33:56 +0100
commit6973d5c0109f7a155b69c40efc4965ceda0031b1 (patch)
treed33adf067971c609fc128c2b544815c58cfb042e
parent908683eadeaed05fca35526c0e9a5a53e336d713 (diff)
target/fw/dsp: Add & load the dsp sniffer patch
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--src/target/firmware/calypso/dsp.c8
-rw-r--r--src/target/firmware/calypso/dsp_sniffcode.c42
2 files changed, 48 insertions, 2 deletions
diff --git a/src/target/firmware/calypso/dsp.c b/src/target/firmware/calypso/dsp.c
index c37ca829..65454c1d 100644
--- a/src/target/firmware/calypso/dsp.c
+++ b/src/target/firmware/calypso/dsp.c
@@ -85,6 +85,7 @@ struct dsp_section {
#include "dsp_params.c"
#include "dsp_bootcode.c"
#include "dsp_dumpcode.c"
+#include "dsp_sniffcode.c"
struct dsp_api dsp_api = {
.ndb = (T_NDB_MCU_DSP *) BASE_API_NDB,
@@ -204,7 +205,8 @@ static void dsp_set_params(int16_t *param_tab, int param_size)
/* Start DSP up to bootloader */
dsp_pre_boot(dsp_bootcode);
- /* FIXME: Implement Patch download, if any */
+ dputs("Installing DSP sniff patch\n");
+ dsp_bl_upload_sections(dsp_sniffcode);
dputs("Setting some dsp_api.ndb values\n");
dsp_api.ndb->d_background_enable = 0;
@@ -225,7 +227,9 @@ static void dsp_set_params(int16_t *param_tab, int param_size)
dputs("Setting API NDB parameters\n");
for (i = 0; i < param_size; i ++)
*param_ptr++ = param_tab[i];
-
+
+ dsp_api.param->d_gprs_install_address = DSP_SNIFF_PATCH_START;
+
dsp_dump_version();
dputs("Finishing download phase\n");
diff --git a/src/target/firmware/calypso/dsp_sniffcode.c b/src/target/firmware/calypso/dsp_sniffcode.c
new file mode 100644
index 00000000..865ce815
--- /dev/null
+++ b/src/target/firmware/calypso/dsp_sniffcode.c
@@ -0,0 +1,42 @@
+/* Generated from src/target_dsp/calypso/dsp_sniff.bin */
+
+#define _SA_DECL (const uint16_t *)&(const uint16_t [])
+
+static const struct dsp_section dsp_sniffcode[] = {
+ {
+ .addr = 0x015c,
+ .size = 0x0051,
+ .data = _SA_DECL {
+ 0x76f8, 0x3f6b, 0x0160, 0xfc00,
+ 0x76f8, 0x439e, 0x0164, 0xfc00,
+ 0x7711, 0x2000, 0x61f8, 0x3fb0,
+ 0x0001, 0xf820, 0x016d, 0x7711,
+ 0x208a, 0x7311, 0x2114, 0x7699,
+ 0x0000, 0x6d91, 0x7311, 0x2115,
+ 0xf020, 0xb12c, 0xf074, 0xaac3,
+ 0x7211, 0x2114, 0xf495, 0xf495,
+ 0x1281, 0xf845, 0x018a, 0xf010,
+ 0x0001, 0x8081, 0xf074, 0xb74c,
+ 0xf020, 0x018b, 0xf074, 0xaa9f,
+ 0xf073, 0x0178, 0xfc00, 0xe834,
+ 0xf074, 0xa9ea, 0x7213, 0x2115,
+ 0xf495, 0xf495, 0x7093, 0x3fa4,
+ 0x7093, 0x3fa5, 0x7093, 0x3fa7,
+ 0x7093, 0x3fa6, 0x7093, 0x0cce,
+ 0x7712, 0x0ccf, 0x7711, 0x001c,
+ 0x47f8, 0x0011, 0xe589, 0x7313,
+ 0x2115, 0x7211, 0x2114, 0xf495,
+ 0xf495, 0x6be1, 0x0001, 0x0001,
+ 0xfc00,
+ },
+ },
+ { /* Guard */
+ .addr = 0,
+ .size = 0,
+ .data = NULL,
+ },
+};
+
+#undef _SA_DECL
+
+#define DSP_SNIFF_PATCH_START 0x015c