PASDK-71:Add System Stream code to handle PFP alpha commands on DSP.
authorFrank Livingston <frank-livingston@ti.com>
Tue, 2 May 2017 01:27:18 +0000 (20:27 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Tue, 2 May 2017 01:27:18 +0000 (20:27 -0500)
Also change System Initialization Task to use location in locally defined global array to
determine when System Stream Task is initialized. System Stream Task sets
array location to 1 upon completion of initialization.

pasdk/paf
pasdk/test_dsp/.cproject
pasdk/test_dsp/framework/itopo/system.c
pasdk/test_dsp/framework/systemInit.c
pasdk/test_dsp/framework/systemInit.h [new file with mode: 0644]
pasdk/test_dsp/framework/systemStream.c
pasdk/test_dsp/framework/systemStream.h
pasdk/test_dsp/mib/mib.c
tools

index e352faba0631317c09f856151e3805c5df4521dd..253538d76feb38fd26e08c2d21258173ce33d6f0 160000 (submodule)
--- a/pasdk/paf
+++ b/pasdk/paf
@@ -1 +1 @@
-Subproject commit e352faba0631317c09f856151e3805c5df4521dd
+Subproject commit 253538d76feb38fd26e08c2d21258173ce33d6f0
index c2f63ab12f64575dc4944e58088a24ad7419fb4f..2ee1e794dd85accbc034e3a857cd6f8881694bcf 100644 (file)
@@ -11,8 +11,8 @@
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_02/psdk_cust/pdk_k2g_1_0_1_1_eng/packages"/>
+                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CPPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
                                                        <tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1719272350" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.798429122"/>
                                                </toolChain>
                                        </folderInfo>
+                                       <fileInfo id="com.ti.ccstudio.buildDefinitions.C6000.Debug.2083839127.306988467" name="pfp.c" rcbsApplicability="disable" resourcePath="common/pfp/pfp.c" toolsToInvoke="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.compilerDebug.1649133737.1081035954">
+                                               <tool id="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.compilerDebug.1649133737.1081035954" name="C6000 Compiler" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.exe.compilerDebug.1649133737">
+                                                       <option id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.OPT_LEVEL.984837934" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.C6000_8.1.compilerID.OPT_LEVEL.3" valueType="enumerated"/>
+                                                       <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__C_SRCS.1106558214" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__C_SRCS"/>
+                                                       <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__CPP_SRCS.671738493" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__CPP_SRCS"/>
+                                                       <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM_SRCS.1794515377" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM_SRCS"/>
+                                                       <inputType id="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM2_SRCS.1637314368" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.C6000_8.1.compiler.inputType__ASM2_SRCS"/>
+                                               </tool>
+                                       </fileInfo>
                                        <sourceEntries>
                                                <entry excluding="sio/dap|sio/dbgDob.c|framework/fwkSim.c|application/app_pkgs.cmd|boards|src|application/src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
                                        </sourceEntries>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_02/psdk_cust/pdk_k2g_1_0_1_1_eng/packages"/>
+                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CPPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_02/psdk_cust/pdk_k2g_1_0_1_1_eng/packages"/>
                                        <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_02/psdk_cust/pdk_k2g_1_0_1_1_eng/packages"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_02/psdk_cust/pdk_k2g_1_0_1_1_eng/packages"/>
+                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CPPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_02/psdk_cust/pdk_k2g_1_0_1_1_eng/packages"/>
                                        <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_02/psdk_cust/pdk_k2g_1_0_1_1_eng/packages"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
index 748b3e2e0b2c1b1e88f34dd859bb0ebe5521457c..d1101e730c1240df59b8ca6cc149545983976c3a 100644 (file)
@@ -143,7 +143,10 @@ PAF_SystemStatus systemStreamStatus[1] = {
         0,                              // pfpDisableMask
         0,                              // pfpEnableMask
         PFP_ENABLE_MASK,                // pfpEnabledBf
-        0                               // pfpResetStatsMask
+        0,                              // pfpLatchStatsMask
+        0,                              // pfpResetStatsMask
+        0,                              // pfpAlphaUpdateMask
+        -1.0,                           // pfpAlphaUpdate
     },
 };
 
index a9206aec80dab3a593ce9c590874d4f440663f21..7665f275ec7ddb07cca78bcd5dc2e44e00312207 100644 (file)
@@ -55,12 +55,26 @@ All rights reserved.
 #include "audioStreamProc_common.h" // ASIT/ASOT/ASDT config
 #include "audioStreamInpProc.h"
 #include "audioStreamOutProc.h"
-#include "systemStream.h"
+#include "systemInit.h"
 
-extern Void ACP_main_cus(Void);     // (*** ?) FL: revisit -- check method of patching alpha codes
-extern Void taskSystemStreamFxn(Void);  // (*** ?) FL: revisit -- shouldn't need to call this from system init
+// FL: debug
+#include "evmc66x_pinmux.h"
+#include "evmc66x_gpio_dbg.h"
 
-const PAFHJT_t *pafhjt;
+
+#define __TASK_NAME__  "TaskSysInit"
+
+#define TASK_AFP_PRI        ( 2 )
+#define TASK_AIP_PRI        ( 3 )
+#define TASK_SSP_PRI        ( 1 )
+#define TASK_ASIP_PRI       ( 5 ) //( 4 )
+#define TASK_ASOP_PRI       ( 4 )
+
+#define SYS_INIT_SLEEP      ( 100 )
+
+
+extern Void ACP_main_cus(Void);     // (*** ?) FL: revisit -- check method of patching alpha codes
+//extern Void taskSystemStreamFxn(Void);  // (*** ?) FL: revisit -- shouldn't need to call this from system init
 
 #define RAM_REPORT
 #ifdef RAM_REPORT
@@ -70,19 +84,15 @@ extern PAF_ASIT_Fxns PAF_ASIT_params_fxns;
 extern PAF_ASOT_Fxns PAF_ASOT_params_fxns;
 #endif
 
-#define TASK_AFP_PRI        ( 2 )
-#define TASK_AIP_PRI        ( 3 )
-#define TASK_SSP_PRI        ( 1 )
-#define TASK_ASIP_PRI       ( 5 ) //( 4 )
-#define TASK_ASOP_PRI       ( 4 )
-
-#define __TASK_NAME__  "TaskSysInit"
+// Task initialization flag array.
+// Each flag indicates whether Task has been initialized.
+//   0: uninitialized
+//   1: initialized
+Int gTaskInitFlag[NUM_SYS_TASKS];
 
-#define SYS_INIT_SLEEP  100
+// PAF Hidden Jump Table (HJT) pointer
+const PAFHJT_t *pafhjt;
 
-// FL: debug
-#include "evmc66x_pinmux.h"
-#include "evmc66x_gpio_dbg.h"
 
 
 /*
@@ -199,10 +209,11 @@ Void taskSysInitFxn(Void)
     
     /* This is required to use SYS alpha codes in atboot? */
     Log_info0("taskSysInitFxn:TaskSystemStream resume");
+    gTaskInitFlag[TASK_SSP_INIT_FLAG_IDX] = 0;
     Task_setPri(TaskSystemStream, TASK_SSP_PRI);
     // Wait until Execution of TaskSystemStream is complete
     // once.
-    while (gSysStreamInit == 0)  // gSysStreamInit is set to 1 in TaskSystemStream
+    while (gTaskInitFlag[TASK_SSP_INIT_FLAG_IDX] == 0)  // System Stream initialization flag is set to 1 in TaskSystemStream
     {
        Task_sleep(SYS_INIT_SLEEP);
     }
diff --git a/pasdk/test_dsp/framework/systemInit.h b/pasdk/test_dsp/framework/systemInit.h
new file mode 100644 (file)
index 0000000..13012c4
--- /dev/null
@@ -0,0 +1,57 @@
+
+/*
+Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/
+All rights reserved.
+
+* Redistribution and use in source and binary forms, with or without 
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of Texas Instruments Incorporated nor the names of
+* its contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+/*
+ *  ======== systemInit.h ========
+ */
+
+#ifndef _SYS_INIT_H_
+#define _SYS_INIT_H_
+
+#define NUM_SYS_TASKS   ( 5 )
+
+#define TASK_SSP_INIT_FLAG_IDX  ( 0 )
+#define TASK_AFP_INIT_FLAG_IDX  ( 1 )
+#define TASK_AIP_INIT_FLAG_IDX  ( 2 )
+#define TASK_ASIP_INIT_FLAG_IDX ( 3 )
+#define TASK_ASOP_INIT_FLAG_IDX ( 4 )
+
+// Task initialization flag array.
+// Each flag indicates whether Task has been initialized.
+//   0: uninitialized
+//   1: initialized
+extern Int gTaskInitFlag[NUM_SYS_TASKS];
+
+#endif // _SYS_INIT_H_
index 835aa6b5aceaec2682f8d565bab63ec824c00753..a593fd2d6f7328ec35e1d3ac5055647219a61ead 100644 (file)
@@ -57,21 +57,23 @@ All rights reserved.
 #include <ti/sysbios/utils/Load.h>
 
 #include <paftyp.h>
+#include <pafsys.h>
 #include <pafsys_a.h>
 #include <pafcc.h>
 //#include "alg.h"
 #include "logp.h"
 
-#include "identify.h"
-#include "system.h"
-#include "systemStream.h"
-
 #include <acp.h>
 #include <acp_mds.h>
 #include <acptype.h>
 #include <acpbeta.h>
 #include <acperr.h>
 
+#include "identify.h"
+#include "system.h"
+#include "systemStream.h"
+#include "systemInit.h"
+
 //#include "pafhjt.h"
 //
 //#ifdef RAM_REPORT
@@ -86,16 +88,10 @@ All rights reserved.
 #endif
 
 #include "pfp/pfp.h"
-#include "pfp_app.h"        /* contains all PFP ID's */
 
 // Minimum time between invocation of system stream processing
 #define SYSTEM_STREAM_PROC_INTERVAL ( 1000 )    // in msec.
 
-// Indicates whether system stream initialized.
-// 0: uninitialized
-// 1: initialized
-Int gSysStreamInit=0;
-
 //
 // systemStream : audio stream control function (main)
 //
@@ -103,6 +99,19 @@ Int gSysStreamInit=0;
 LINNO_DEFN (systemStreamMain);
 ERRNO_DEFN (systemStreamMain);
 
+#if 0 //Integer only PFP alpha interface
+//
+// Copy latched PFP status to System PFP stats.
+// PFP stats contain only integer values (fixed-point format as required)
+// for transport of statistics over alpha command interface.
+//
+static void copyPfpStats(
+    pfpStats_t *pPfpStats, 
+    PAF_SystemStatus_PfpStats *pSsPfpStats
+);
+#endif
+
+
 Void
 systemStreamMain(
     const PAF_SST_Params *pP, 
@@ -704,7 +713,10 @@ systemStream5Compute(
     PAF_SystemStatus *pStatus = pC->pStatus;
     Load_Stat stat;
     UInt32 pfpDisableMask, pfpEnableMask;
+    UInt32 pfpLatchStatsMask;
     UInt32 pfpResetStatsMask;
+    UInt32 pfpAlphaUpdateMask;
+    pfpStats_t pfpStats;
     UInt8 i;
 
     Load_getTaskLoad(Task_getIdleTask(), &stat);
@@ -790,7 +802,30 @@ systemStream5Compute(
         pStatus->pfpEnableMask = 0;
     }
 
-    // Apply PFP reset mask
+    // Apply PFP latch statistics mask
+    // NOTE: This can be interrupted by higher priority threads, so latching PFP statis is currently not simultaneous.
+    //       Can change this by disabling preemption for this section of code (e.g. use SYS/BIOS GateAll).
+    if (pStatus->pfpLatchStatsMask != 0)
+    {
+        pfpLatchStatsMask = pStatus->pfpLatchStatsMask;
+        i = 0;
+        while ((pfpLatchStatsMask != 0) && (i < PFP_PPCNT_MAX))
+        {
+            if (pfpLatchStatsMask & 1)
+            {
+                pfpGetStats(i, &pStatus->ssPfpStats[i]);
+#if 0 //Integer only PFP alpha interface          
+                //pfpGetStats(i, &pfpStats);
+                //copyPfpStats(&pfpStats, (PAF_SystemStatus_PfpStats *)&pStatus->ssPfpStats[i]);
+#endif
+            }
+            pfpLatchStatsMask >>= 1;
+            i++;
+        }
+        pStatus->pfpLatchStatsMask = 0;
+    }    
+
+    // Apply PFP reset statistics mask
     if (pStatus->pfpResetStatsMask != 0)
     {
         pfpResetStatsMask = pStatus->pfpResetStatsMask;
@@ -805,7 +840,27 @@ systemStream5Compute(
             i++;
         }
         pStatus->pfpResetStatsMask = 0;
-    }    
+    }
+    
+    // Apply PFP alpha update mask
+    if ((pStatus->pfpAlphaUpdateMask != 0) &&
+       (pStatus->pfpAlphaUpdate >= 0.0) && 
+       (pStatus->pfpAlphaUpdate < 1.0))
+    {
+        pfpAlphaUpdateMask = pStatus->pfpAlphaUpdateMask;
+        i = 0;
+        while ((pfpAlphaUpdateMask != 0) && (i < PFP_PPCNT_MAX))
+        {
+            if (pfpAlphaUpdateMask & 1)
+            {
+                pfpSetAlpha(i, pStatus->pfpAlphaUpdate);
+            }
+            pfpAlphaUpdateMask >>= 1;
+            i++;
+        }
+        pStatus->pfpAlphaUpdateMask = 0;
+        pStatus->pfpAlphaUpdate = -1.0;
+    }
     
     // FL: debug
     gCpuLoad = pStatus->cpuLoad>>8;
@@ -834,6 +889,31 @@ systemStream5Transmit(
     return 0;
 }
 
+#if 0 //Integer only PFP alpha interface
+// Scaling factor for float to unsigned fixed-point conversion
+#define F2UINT32_SCALE  (float)(0xFFFFFFFF)
+
+//
+// Copy latched PFP status to System PFP stats.
+// PFP stats contain only integer values (fixed-point format as required)
+// for transport of statistics over alpha command interface.
+//
+static void copyPfpStats(
+    pfpStats_t *pPfpStats, 
+    PAF_SystemStatus_PfpStats *pSsPfpStats
+)
+{
+    pSsPfpStats->c_total = pPfpStats->c_total;
+    pSsPfpStats->n_count = pPfpStats->n_count;
+    pSsPfpStats->c_min = pPfpStats->c_min;
+    pSsPfpStats->c_max = pPfpStats->c_max;
+    pSsPfpStats->c_average = _spint(pPfpStats->c_average);                      // U32Q0
+    pSsPfpStats->alpha = (UInt32)(_spint(F2UINT32_SCALE*pPfpStats->alpha));     // U32Q32
+    //pSsPfpStats->c_average = pPfpStats->c_average;
+    //pSsPfpStats->alpha = pPfpStats->alpha;
+}
+#endif
+
 // FL: debug
 //#define MAX_CAP_CUR_TIME ( 100 )
 //UInt32 gCurTime[MAX_CAP_CUR_TIME];
@@ -890,9 +970,10 @@ Void taskSystemStreamFxn()
                 (&systemStreamParams[i], &systemStreamConfig[i]);            
         }
 
-        if (gSysStreamInit == 0)
+        
+        if (gTaskInitFlag[TASK_SSP_INIT_FLAG_IDX] == 0)
         {
-            gSysStreamInit = 1;  // Indicate system stream initialized
+            gTaskInitFlag[TASK_SSP_INIT_FLAG_IDX] = 1;  // Indicate System Stream initialized
         }
     }
 }
index 6df16fa39f0fd00508af75b56722e1db6cbb79b7..8c451961e3aac46a59e0a157d1f0be7b088aec95 100644 (file)
@@ -102,6 +102,4 @@ extern PAF_SST_FxnsTransmit systemStream4Transmit;
 extern PAF_SST_FxnsCompute  systemStream5Compute;
 extern PAF_SST_FxnsTransmit systemStream5Transmit;
 
-extern Int gSysStreamInit;
-
 #endif /* _SYSTEM_STREAM_H_ */
index 08c4ba815bd13d19e5bd6997a4e3f43e107be43f..8c54ff77daf8bd01fc8b864ef79e8014df519004 100644 (file)
@@ -979,7 +979,7 @@ Int DIB_getSync (DEV2_Handle device, PAF_InpBufConfig *pBufConfig )
             if (status)
                 return status;
 
-#if 0 // (***) FL: shows timing of Input Rx SIO reclaim during autodet
+#if 1 // (***) FL: shows timing of Input Rx SIO reclaim during autodet
             // (***) debug // B5
             {
                 static Uint8 toggleState = 0;
diff --git a/tools b/tools
index eb970f3f4a5b4262db7fd21ddb36f14e387aa3f8..dac738cfffa68ea9b3a504875e53822ec0e1eec9 160000 (submodule)
--- a/tools
+++ b/tools
@@ -1 +1 @@
-Subproject commit eb970f3f4a5b4262db7fd21ddb36f14e387aa3f8
+Subproject commit dac738cfffa68ea9b3a504875e53822ec0e1eec9