summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2013-01-16 22:59:13 +0100
committerSylvain Munaut <tnt@246tNt.com>2014-06-15 19:30:52 +0200
commit3e3b13712bbae52f16b7e89f9ab147a36a146861 (patch)
treec5dc8d67ab6c5cce3c66e26b37074d916ca6a1b4
parent7e9ff0bb561d6e0ae0eb413e87b09f9c29f2f86c (diff)
fw/calypso/dsp: Import and load DSP extension patch
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--src/target/firmware/calypso/dsp.c12
-rw-r--r--src/target/firmware/calypso/dsp_extcode.c190
2 files changed, 199 insertions, 3 deletions
diff --git a/src/target/firmware/calypso/dsp.c b/src/target/firmware/calypso/dsp.c
index 1daecb2d..8c9f23cb 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_extcode.c"
struct dsp_api dsp_api = {
.ndb = (T_NDB_MCU_DSP *) BASE_API_NDB,
@@ -204,8 +205,11 @@ 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 */
+ /* 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");
dsp_api.ndb->d_background_enable = 0;
dsp_api.ndb->d_background_abort = 0;
@@ -225,9 +229,11 @@ 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_dump_version();
+ /* Init address for the extensions */
+ dsp_api.param->d_gprs_install_address = DSP_EXT_START;
+
+ /* Perform actual boot */
dputs("Finishing download phase\n");
dsp_bl_start_at(DSP_START);
diff --git a/src/target/firmware/calypso/dsp_extcode.c b/src/target/firmware/calypso/dsp_extcode.c
new file mode 100644
index 00000000..585769b4
--- /dev/null
+++ b/src/target/firmware/calypso/dsp_extcode.c
@@ -0,0 +1,190 @@
+/* Generated from dsp_ext.coff */
+
+#define _SA_DECL (const uint16_t *)&(const uint16_t [])
+
+static const struct dsp_section dsp_extcode[] = {
+ {
+ .addr = 0x015c,
+ .size = 0x02a4,
+ .data = _SA_DECL {
+ 0x76f8, 0x3f6b, 0x0160, 0xfc00,
+ 0x76f8, 0x439e, 0x0173, 0x76f8,
+ 0x4391, 0x0265, 0x76f8, 0x00f4,
+ 0x731e, 0x76f8, 0x00f5, 0x3fcf,
+ 0x76f8, 0x00f6, 0xf880, 0x76f8,
+ 0x00f7, 0x03b5, 0xfc00, 0x61f8,
+ 0x2400, 0x0001, 0xfc20, 0xf074,
+ 0x03f4, 0x10f8, 0x2402, 0xf000,
+ 0x0010, 0x80f8, 0x2404, 0xf020,
+ 0xb12c, 0xf074, 0xaac3, 0xf074,
+ 0xb74c, 0x7210, 0x2404, 0xf020,
+ 0x0191, 0x0080, 0x8810, 0xf495,
+ 0xf495, 0x1080, 0xf074, 0xaa9f,
+ 0xfc00, 0x0194, 0x0195, 0x01b6,
+ 0xfc00, 0x7713, 0x0e4e, 0x7712,
+ 0x0cce, 0xec7f, 0xe589, 0x10f8,
+ 0x2402, 0xf000, 0x0042, 0x8813,
+ 0x7712, 0x0cce, 0xf070, 0x012d,
+ 0xe589, 0xf074, 0x76b9, 0x7210,
+ 0x2404, 0xf495, 0xf495, 0x81e0,
+ 0x0001, 0xf074, 0x023c, 0x7210,
+ 0x2404, 0x10f8, 0x240f, 0x80e0,
+ 0x0002, 0xfc00, 0x10f8, 0x2401,
+ 0x80f8, 0x3fa8, 0xe834, 0xf074,
+ 0xa9ea, 0x10f8, 0x2402, 0xf000,
+ 0x0042, 0x8813, 0xf495, 0xf495,
+ 0x7093, 0x3fa4, 0x7093, 0x3fa5,
+ 0x7093, 0x3fa7, 0x7093, 0x3fa6,
+ 0x7093, 0x0cce, 0x7712, 0x0ccf,
+ 0x7711, 0x001c, 0x47f8, 0x0011,
+ 0xe589, 0xfc00, 0x0400, 0xfc00,
+ 0x0400, 0x0400, 0xfc00, 0x0400,
+ 0xfc00, 0xfc00, 0x0400, 0xfc00,
+ 0xfc00, 0xfc00, 0xfc00, 0xfc00,
+ 0xfc00, 0xfc00, 0xfc00, 0x0400,
+ 0x0400, 0xfc00, 0xfc00, 0x0400,
+ 0x0400, 0xfc00, 0xfc00, 0x0400,
+ 0xfc00, 0x0400, 0xfc00, 0x0400,
+ 0xfc00, 0x0400, 0x0400, 0x0400,
+ 0xfc00, 0xfc00, 0xfc00, 0xfc00,
+ 0x0400, 0x0400, 0x0400, 0xf7b9,
+ 0xf7b6, 0x7719, 0x0000, 0x771a,
+ 0x0047, 0x7712, 0x01d6, 0xf272,
+ 0x0215, 0x7710, 0xffd8, 0xa489,
+ 0xec26, 0xb089, 0xb0cd, 0x8295,
+ 0xa48a, 0xec26, 0xb08a, 0xb0ce,
+ 0x8296, 0xa09a, 0xfe00, 0xf6b6,
+ 0xf6b9, 0xf7b9, 0xf6b6, 0x771a,
+ 0x0047, 0xf272, 0x0223, 0x7714,
+ 0x2be4, 0x2692, 0x3893, 0x4e94,
+ 0xf6b9, 0xe800, 0xe900, 0x8810,
+ 0x8811, 0x7712, 0x2be4, 0x771a,
+ 0x0040, 0xf272, 0x0237, 0x7713,
+ 0x2bf2, 0x5093, 0x5492, 0xf586,
+ 0x6d90, 0xf495, 0xfd08, 0xe701,
+ 0x4811, 0xfe00, 0x80f8, 0x240f,
+ 0x770e, 0x00ac, 0x771a, 0x0097,
+ 0x7712, 0x0cce, 0x7715, 0x0e4c,
+ 0xf274, 0x81a5, 0x45f8, 0x0c43,
+ 0x7712, 0x0cce, 0x7713, 0x2a00,
+ 0x7714, 0x2ac0, 0x7715, 0x0e4c,
+ 0xf274, 0x81c8, 0x771a, 0x0025,
+ 0x7713, 0x2a00, 0x7714, 0x2ac0,
+ 0x7715, 0x2c80, 0xf274, 0x01ff,
+ 0x7716, 0x2cd0, 0x7712, 0x2c80,
+ 0xf274, 0x0219, 0x7713, 0x2cd0,
+ 0xfc00, 0xf020, 0x026a, 0xf074,
+ 0xaac3, 0xfc00, 0x61f8, 0x2400,
+ 0x0001, 0xf820, 0xa9f1, 0xf074,
+ 0x03f4, 0x10f8, 0x2402, 0x80f8,
+ 0x2403, 0xf074, 0x027b, 0x69f8,
+ 0x3fb1, 0x0002, 0xfc00, 0x10f8,
+ 0x2403, 0x8810, 0xf000, 0x0002,
+ 0x80f8, 0x2403, 0xf020, 0x028d,
+ 0x0080, 0x8811, 0xf495, 0xf495,
+ 0x1081, 0xf4e3, 0x7311, 0x43ae,
+ 0xfc00, 0x02ab, 0x0293, 0x0296,
+ 0x029b, 0x02ab, 0x029e, 0x7711,
+ 0x0316, 0xfc00, 0xf074, 0x02ae,
+ 0x7711, 0x0329, 0xfc00, 0x7711,
+ 0x031a, 0xfc00, 0x10f8, 0x2401,
+ 0x80f8, 0x3fa8, 0x10e0, 0x0001,
+ 0x00f8, 0x2402, 0x80f8, 0x2405,
+ 0x7711, 0x0373, 0xfc00, 0x7711,
+ 0xdead, 0xfc00, 0x4a06, 0x4a07,
+ 0xea00, 0xed00, 0xf6b9, 0xf6b8,
+ 0xf6b7, 0xf6b6, 0x7210, 0x2402,
+ 0x7712, 0x2406, 0x6de8, 0x0020,
+ 0x771a, 0x0018, 0x1090, 0xf272,
+ 0x02c4, 0x4588, 0xf2a0, 0xf490,
+ 0xf591, 0xf3e7, 0x4f82, 0xf02f,
+ 0xba80, 0x771a, 0x0018, 0xf072,
+ 0x02d1, 0xf3e1, 0xf495, 0xf495,
+ 0xfd0c, 0xf1c0, 0xf365, 0xffc0,
+ 0x6d92, 0x4482, 0xf3f7, 0xf1a0,
+ 0x8392, 0x818a, 0x6d8a, 0x7715,
+ 0x3f8a, 0x7714, 0x2409, 0xf274,
+ 0x8eb0, 0x7711, 0x0002, 0x8a07,
+ 0x8a06, 0xfc00, 0xb962, 0x040f,
+ 0x2d45, 0x761b, 0xfb76, 0x0a4e,
+ 0x0910, 0x1f1c, 0x5c5c, 0x574a,
+ 0x3339, 0xe9f1, 0x2fa8, 0x7fff,
+ 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x7fff, 0xf7b8, 0xf6b6,
+ 0xf6b9, 0xf6be, 0xea7b, 0xf162,
+ 0x07f8, 0x7647, 0x0010, 0x6ff8,
+ 0x08d7, 0x0c59, 0xf030, 0x000f,
+ 0xf000, 0x0004, 0xf030, 0x000f,
+ 0xf000, 0x0012, 0x8046, 0x7717,
+ 0x8605, 0xfc00, 0x7713, 0x02f4,
+ 0xf073, 0x031c, 0x7713, 0x02ea,
+ 0xf074, 0x02fe, 0xf020, 0x0323,
+ 0x8049, 0xf073, 0x85ff, 0x1093,
+ 0x7647, 0x0000, 0xfe00, 0x6b49,
+ 0xfffc, 0xf074, 0x02fe, 0xf020,
+ 0x033e, 0x8049, 0x7715, 0x02e6,
+ 0x7714, 0x3dca, 0xec03, 0xe5ba,
+ 0x7713, 0x3f8a, 0x7714, 0x3dca,
+ 0x7716, 0x3dce, 0x7086, 0xa0dc,
+ 0xf073, 0x85ff, 0x1093, 0xfe00,
+ 0x7647, 0x0000, 0x1093, 0xfe00,
+ 0x7647, 0x0000, 0x1083, 0xfe00,
+ 0x7647, 0x0009, 0x1094, 0xfe00,
+ 0x7647, 0x0000, 0x1094, 0xfe00,
+ 0x7647, 0x0000, 0x1094, 0xfe00,
+ 0x7647, 0x0000, 0x1094, 0xfe00,
+ 0x7647, 0x0000, 0x9497, 0xfe00,
+ 0x7647, 0x0007, 0x1093, 0xfe00,
+ 0x7647, 0x0000, 0x1093, 0xfe00,
+ 0x7647, 0x0002, 0x1086, 0xfe00,
+ 0x7647, 0x0000, 0xf495, 0xfe00,
+ 0xf495, 0xf495, 0xf495, 0xfe00,
+ 0xf495, 0xf495, 0xfc00, 0xf074,
+ 0x02fe, 0xf020, 0x0380, 0x8049,
+ 0x7215, 0x2405, 0x7714, 0x3f8a,
+ 0xec07, 0xe5ba, 0xf073, 0x85d6,
+ 0x1093, 0xfe00, 0x7647, 0x0000,
+ 0x1093, 0xfe00, 0x7647, 0x0000,
+ 0x1093, 0xfe00, 0x7647, 0x0000,
+ 0x1083, 0xfe00, 0x7647, 0x0006,
+ 0x1094, 0xfe00, 0x7647, 0x0000,
+ 0x1084, 0xfe00, 0x7647, 0x0006,
+ 0x949a, 0xfe00, 0x7647, 0x000a,
+ 0x1093, 0xfe00, 0x7647, 0x0000,
+ 0x1093, 0xfe00, 0x7647, 0x0000,
+ 0x1093, 0xfe00, 0x7647, 0x0000,
+ 0x1083, 0xfe00, 0x7647, 0x000c,
+ 0x1086, 0xfe00, 0x7647, 0x0000,
+ 0xf495, 0xfe00, 0xf495, 0xf495,
+ 0xfc00, 0xf074, 0x013b, 0x7707,
+ 0x2900, 0x7706, 0x1800, 0x68f8,
+ 0x001d, 0xfffc, 0xf074, 0x03c3,
+ 0xf7bb, 0xf073, 0x0100, 0xf074,
+ 0x027b, 0xf020, 0x3cbb, 0x80f8,
+ 0x3fb6, 0x80f8, 0x3fb7, 0x8812,
+ 0xe827, 0xf074, 0xa9ea, 0x7692,
+ 0x0014, 0x7692, 0x5814, 0x7692,
+ 0xf814, 0x7692, 0xf814, 0x7692,
+ 0xf814, 0x7692, 0xc014, 0x7692,
+ 0x0014, 0x7692, 0x0014, 0x7692,
+ 0x0254, 0x7692, 0x0494, 0x7692,
+ 0x0654, 0x7692, 0x07d4, 0x7692,
+ 0x0794, 0x7692, 0x03d4, 0x7692,
+ 0x0014, 0x7692, 0x0014, 0x7692,
+ 0x31d2, 0xf074, 0xb55f, 0xfc00,
+ 0x76f8, 0x2402, 0x2000, 0x61f8,
+ 0x3fb0, 0x0001, 0xf820, 0x03ff,
+ 0x76f8, 0x2402, 0x2200, 0xfc00
+ },
+ },
+ { /* Guard */
+ .addr = 0,
+ .size = 0,
+ .data = NULL,
+ },
+};
+
+#undef _SA_DECL
+
+#define DSP_EXT_START 0x015c