changeset 28:d465d2510d28

TCS211 versions of l1_{dis,en}able_DSP_trace() functions reconstructed
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Thu, 22 Oct 2015 23:34:08 +0000
parents 8abeb95e9766
children 000bf2b7521e
files chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_afunc.c chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_async.c
diffstat 2 files changed, 46 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_afunc.c	Thu Oct 22 22:35:35 2015 +0000
+++ b/chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_afunc.c	Thu Oct 22 23:34:08 2015 +0000
@@ -410,6 +410,50 @@
   }
 }
 
+/*
+ * TCS211 had l1_disable_DSP_trace() and l1_enable_DSP_trace() functions
+ * implemented here in the l1_dyn_dwl code.  The LoCosto version of L1
+ * has l1_{dis,en}able_dsp_trace() instead (note the case difference)
+ * implemented in the l1_trace.c module.  The LoCosto versions of these
+ * functions implement more complex logic with nesting, and use more
+ * state variables than are provided in TCS211 L1 data structures which
+ * we cannot change at this early phase of deblobbing.  Therefore,
+ * we are going to recreate the simpler logic of the older
+ * l1_{dis,en}able_DSP_trace() functions from disassembly.
+ */
+
+void l1_disable_DSP_trace()
+{
+#if (CODE_VERSION != SIMULATION)
+  T_NDB_MCU_DSP* dsp_ndb_ptr = (T_NDB_MCU_DSP *) NDB_ADR;
+#else
+  T_NDB_MCU_DSP* dsp_ndb_ptr = l1s_dsp_com.dsp_ndb_ptr;
+#endif
+
+  if (dsp_ndb_ptr->d_debug_trace_type != 0x0000)
+  {
+    l1a.dyn_dwnld.dsp_trace_level_copy = dsp_ndb_ptr->d_debug_trace_type;
+    dsp_ndb_ptr->d_debug_trace_type = (API)0x8000;	/* 0x9000 in LoCosto */
+    l1a.dyn_dwnld.trace_flag_blocked = TRUE;
+  }
+}
+
+void l1_enable_DSP_trace()
+{
+#if (CODE_VERSION != SIMULATION)
+  T_NDB_MCU_DSP* dsp_ndb_ptr = (T_NDB_MCU_DSP *) NDB_ADR;
+#else
+  T_NDB_MCU_DSP* dsp_ndb_ptr = l1s_dsp_com.dsp_ndb_ptr;
+#endif
+
+  if ((l1a.dyn_dwnld.trace_flag_blocked == TRUE) && (dsp_ndb_ptr->d_debug_trace_type == 0x0000))
+  {
+    l1a.dyn_dwnld.trace_flag_blocked = FALSE;
+
+    dsp_ndb_ptr->d_debug_trace_type = (API)l1a.dyn_dwnld.dsp_trace_level_copy | 0x8000;
+    l1a.dyn_dwnld.dsp_trace_level_copy = 0x0000;
+  }
+}
 
 /*---------------------------------------------------------- */
 /* l1_push_Primitive                                         */
--- a/chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_async.c	Thu Oct 22 22:35:35 2015 +0000
+++ b/chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_async.c	Thu Oct 22 23:34:08 2015 +0000
@@ -388,7 +388,7 @@
 
 #if ((TRACE_TYPE == 1) || (TRACE_TYPE == 4))
   // Disable trace DSP upon Dynamic Download activation
-  l1_disable_dsp_trace();
+  l1_disable_DSP_trace();
 #endif
           
   // Reset API variables
@@ -677,7 +677,7 @@
               {
 #if ((TRACE_TYPE == 1) || (TRACE_TYPE == 4))
                 // Enable trace DSP upon Dynamic Download deactivation
-                l1_enable_dsp_trace();
+                l1_enable_DSP_trace();
                 //Trace_dsp_dump();
 #endif  // omaps00090550 #14-D removal
                 l1a_l1s_com.dyn_dwnld_task.stop=TRUE;