summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Peiffer <pierre.peiffer@stericsson.com>2011-07-18 18:35:30 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:06:57 +0200
commitc853743a6bb48a1049791c1e8a8f9ae0dd6d06bd (patch)
tree55cc49f87ebf7c3de2e1db6ec9bb8726072c4fdc
parent29857a2c55f4d50d411ddcedd5346e3942880ce9 (diff)
U8500 NMF-CM: add support for component preloading
Provide support for pre-loading some NMF components, used to pre-load some components that are on a time critical path. Having such components already pre-loaded decreases the time required to instantiate and deploy them. ST-Ericsson ID: 352754 ST-Ericsson Linux next: - ST-Ericsson FOSS-OUT ID: Trivial Depends-On: If8e129163e6c94b7c239c84af667b16d7a1b56ac, I73416c15f75afce61a056f318a448a034182acb2, Id40225d1ce93f2c9cfc085744717dc091add74c4 Signed-off-by: Pierre Peiffer <pierre.peiffer@stericsson.com> Change-Id: I4aecce1bcc63e6d4b04e251e821c8896ed63ba54
-rw-r--r--drivers/staging/nmf-cm/cm/engine/api/repository_mgt_engine.h7
-rw-r--r--drivers/staging/nmf-cm/cm/engine/configuration/inc/configuration.h3
-rw-r--r--drivers/staging/nmf-cm/cm/engine/configuration/src/configuration.c41
-rw-r--r--drivers/staging/nmf-cm/cm/engine/repository_mgt/inc/repository_type.h1
-rw-r--r--drivers/staging/nmf-cm/cm/engine/repository_mgt/src/repository_mgt.c20
-rw-r--r--drivers/staging/nmf-cm/cm_dma.h2
-rw-r--r--drivers/staging/nmf-cm/cmioctl.h2
-rw-r--r--drivers/staging/nmf-cm/cmld.c7
-rw-r--r--drivers/staging/nmf-cm/inc/nmf-def.h2
-rw-r--r--drivers/staging/nmf-cm/osal-kernel.c7
10 files changed, 34 insertions, 58 deletions
diff --git a/drivers/staging/nmf-cm/cm/engine/api/repository_mgt_engine.h b/drivers/staging/nmf-cm/cm/engine/api/repository_mgt_engine.h
index 3520f974be6..b63c60d85eb 100644
--- a/drivers/staging/nmf-cm/cm/engine/api/repository_mgt_engine.h
+++ b/drivers/staging/nmf-cm/cm/engine/api/repository_mgt_engine.h
@@ -83,4 +83,11 @@ PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_PushComponent(const char *name, const
*/
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_ReleaseComponent (const char *name);
+/*!
+ * \brief Check if the CM Component Cache is empty.
+ *
+ * \return a boolean value TRUE or FALSE.
+ * \ingroup CM_ENGINE_API
+ */
+PUBLIC IMPORT_SHARED t_bool CM_ENGINE_IsComponentCacheEmpty(void);
#endif /*REPOSITORY_MGT_ENGINE_H_*/
diff --git a/drivers/staging/nmf-cm/cm/engine/configuration/inc/configuration.h b/drivers/staging/nmf-cm/cm/engine/configuration/inc/configuration.h
index 7156769bb2d..98d22bba743 100644
--- a/drivers/staging/nmf-cm/cm/engine/configuration/inc/configuration.h
+++ b/drivers/staging/nmf-cm/cm/engine/configuration/inc/configuration.h
@@ -34,7 +34,4 @@ PUBLIC t_cm_error cm_CFG_CheckMpcStatus(t_nmf_core_id coreId);
void cm_CFG_ReleaseMpc(t_nmf_core_id coreId);
-PUBLIC t_cm_error cm_CFG_GetRequiredExecutiveEngineComponentNames(
- char fileList[][MAX_INTERFACE_TYPE_NAME_LENGTH], t_uint32 listSize);
-
#endif /* __INC_CONFIGURATION_H_ */
diff --git a/drivers/staging/nmf-cm/cm/engine/configuration/src/configuration.c b/drivers/staging/nmf-cm/cm/engine/configuration/src/configuration.c
index f3242af5da8..f092c7061b4 100644
--- a/drivers/staging/nmf-cm/cm/engine/configuration/src/configuration.c
+++ b/drivers/staging/nmf-cm/cm/engine/configuration/src/configuration.c
@@ -170,44 +170,3 @@ void cm_CFG_ReleaseMpc(t_nmf_core_id coreId)
cfgMpcDescArray[coreId].EEmemoryCount = 0; // For debug purpose
}
}
-
-/****************************************************************************/
-/* NAME: cm_CFG_GetRequiredExecutiveEngineComponentNames( */
-/* char *fileList[], */
-/* t_uint32 *listSize */
-/* ) */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: retrieves the names of the required Executive Engine */
-/* component(s) to load. */
-/****************************************************************************/
-PUBLIC t_cm_error cm_CFG_GetRequiredExecutiveEngineComponentNames(
- char fileList[][MAX_INTERFACE_TYPE_NAME_LENGTH],
- t_uint32 listSize)
-{
- t_nmf_core_id coreId;
- t_uint32 nb=0;
-
- for (coreId = ARM_CORE_ID; coreId <= LAST_CORE_ID; coreId++)
- {
- if ((cm_DSP_GetState(coreId)->state == MPC_STATE_BOOTABLE)
- && (cm_REP_lookupComponent(cfgMpcDescArray[coreId].eeName, NULL) != CM_OK))
- {
- /* Check if we didn't already register this name in the list */
- int j, present=0;
- for (j=0; j<nb; j++) {
- if (cm_StringCompare(cfgMpcDescArray[coreId].eeName, fileList[j], MAX_EE_NAME_LENGTH) == 0) {
- present = 1;
- break;
- }
- }
- if (present)
- continue;
- if (nb >= listSize)
- return CM_NO_MORE_MEMORY;
- cm_StringCopy(fileList[nb], cfgMpcDescArray[coreId].eeName, MAX_EE_NAME_LENGTH);
- nb++;
- }
- }
- return CM_OK;
-}
-
diff --git a/drivers/staging/nmf-cm/cm/engine/repository_mgt/inc/repository_type.h b/drivers/staging/nmf-cm/cm/engine/repository_mgt/inc/repository_type.h
index 7c41fe1bedb..59abc269236 100644
--- a/drivers/staging/nmf-cm/cm/engine/repository_mgt/inc/repository_type.h
+++ b/drivers/staging/nmf-cm/cm/engine/repository_mgt/inc/repository_type.h
@@ -18,7 +18,6 @@
typedef enum
{
- GET_EE_NAME,
BIND_ASYNC,
BIND_TRACE,
BIND_FROMUSER,
diff --git a/drivers/staging/nmf-cm/cm/engine/repository_mgt/src/repository_mgt.c b/drivers/staging/nmf-cm/cm/engine/repository_mgt/src/repository_mgt.c
index c972783db4b..176a965be22 100644
--- a/drivers/staging/nmf-cm/cm/engine/repository_mgt/src/repository_mgt.c
+++ b/drivers/staging/nmf-cm/cm/engine/repository_mgt/src/repository_mgt.c
@@ -137,11 +137,6 @@ PUBLIC EXPORT_SHARED t_cm_error CM_ENGINE_GetRequiredComponentFiles(
compServer = cm_lookupComponent(server);
switch(action)
{
- case GET_EE_NAME:
- /* Get Executive Engine names */
- error = cm_CFG_GetRequiredExecutiveEngineComponentNames(fileList, listSize);
- break;
-
case BIND_FROMUSER:{
t_interface_provide_description itfProvide;
@@ -309,3 +304,18 @@ PUBLIC EXPORT_SHARED t_cm_error CM_ENGINE_ReleaseComponent (const char *name)
return err;
}
+
+PUBLIC EXPORT_SHARED t_bool CM_ENGINE_IsComponentCacheEmpty(void)
+{
+ int i;
+
+ OSAL_LOCK_API();
+ for(i = 0; i < NHASH; i++) {
+ if (componentCaches[i] != NULL) {
+ OSAL_UNLOCK_API();
+ return FALSE;
+ }
+ }
+ OSAL_UNLOCK_API();
+ return TRUE;
+}
diff --git a/drivers/staging/nmf-cm/cm_dma.h b/drivers/staging/nmf-cm/cm_dma.h
index 92f67b05c77..4fccef03830 100644
--- a/drivers/staging/nmf-cm/cm_dma.h
+++ b/drivers/staging/nmf-cm/cm_dma.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) ST-Ericsson SA 2010
- * License terms: GNU General Public License (GPL), version 2, with
+ * License terms: GNU General Public License (GPL), version 2, with
* user space exemption described in the top-level COPYING file in
* the Linux kernel source tree.
*/
diff --git a/drivers/staging/nmf-cm/cmioctl.h b/drivers/staging/nmf-cm/cmioctl.h
index 15de0e50ca4..e1ef2bcb025 100644
--- a/drivers/staging/nmf-cm/cmioctl.h
+++ b/drivers/staging/nmf-cm/cmioctl.h
@@ -585,9 +585,9 @@ typedef struct{
#define CM_PRIVGETMPCMEMORYDESC _IOWR('c', 100, CM_PrivGetMPCMemoryDesc_t)
#define CM_PRIVRESERVEMEMORY _IOW('c', 101, unsigned int)
#define CM_PRIV_GETBOARDVERSION _IOR('c', 102, unsigned int)
+#define CM_PRIV_ISCOMPONENTCACHEEMPTY _IO('c', 103)
enum board_version {
- U8500_V1,
U8500_V2
};
#endif
diff --git a/drivers/staging/nmf-cm/cmld.c b/drivers/staging/nmf-cm/cmld.c
index 158524ddcb4..d01949c8673 100644
--- a/drivers/staging/nmf-cm/cmld.c
+++ b/drivers/staging/nmf-cm/cmld.c
@@ -29,7 +29,7 @@
#include "cm_service.h"
#include "cm_dma.h"
-#define CMDRIVER_PATCH_VERSION 106
+#define CMDRIVER_PATCH_VERSION 109
#define O_FLUSH 0x1000000
static int cmld_major;
@@ -690,6 +690,11 @@ static long cmld_control_ctl(struct file *file, unsigned int cmd, unsigned long
return copy_to_user((void*)arg, &v, sizeof(v));
} else
return -EINVAL;
+ case CM_PRIV_ISCOMPONENTCACHEEMPTY:
+ if (CM_ENGINE_IsComponentCacheEmpty())
+ return 0;
+ else
+ return -ENOENT;
default: {
pr_err("CM(%s): unsupported command %i\n", __func__, cmd);
diff --git a/drivers/staging/nmf-cm/inc/nmf-def.h b/drivers/staging/nmf-cm/inc/nmf-def.h
index 345c8256212..1acfc870304 100644
--- a/drivers/staging/nmf-cm/inc/nmf-def.h
+++ b/drivers/staging/nmf-cm/inc/nmf-def.h
@@ -21,7 +21,7 @@
*
* \ingroup NMF_VERSION
*/
-#define NMF_VERSION ((2 << 16) | (10 << 8) | (106))
+#define NMF_VERSION ((2 << 16) | (10 << 8) | (109))
/*!
* \brief Get NMF major version corresponding to NMF version number
diff --git a/drivers/staging/nmf-cm/osal-kernel.c b/drivers/staging/nmf-cm/osal-kernel.c
index f215f730a9a..37e680a87a4 100644
--- a/drivers/staging/nmf-cm/osal-kernel.c
+++ b/drivers/staging/nmf-cm/osal-kernel.c
@@ -18,7 +18,6 @@
#include <linux/timer.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
-#include <mach/prcmu.h>
#include <trace/stm.h>
@@ -383,7 +382,7 @@ t_nmf_osal_sync_handle OSAL_CreateLock(void)
void OSAL_Lock(t_nmf_osal_sync_handle handle)
{
// unfortunately there is no return value to this function
- // so we cannot use 'down_interruptible()'
+ // so we cannot use 'mutex_lock_killable()'
mutex_lock((struct mutex*)handle);
}
@@ -833,8 +832,8 @@ void OSAL_DisablePwrRessource(t_nmf_power_resource resource, t_uint32 firstParam
}
/* Stop the DMA (normally done on DSP side, but be safe) */
- if (firstParam == SIA_CORE_ID)
- cmdma_stop_dma();
+ if (firstParam == SIA_CORE_ID)
+ cmdma_stop_dma();
/* Stop the DSP */
if (regulator_disable(osalEnv.mpc[idx].mmdsp_regulator) < 0)