summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 123b926)
raw | patch | inline | side by side (parent: 123b926)
author | vwan@ti.com <vwan@ti.com> | |
Fri, 7 Mar 2014 21:26:11 +0000 (13:26 -0800) | ||
committer | Chris Ring <cring@ti.com> | |
Thu, 13 Mar 2014 15:40:54 +0000 (08:40 -0700) |
This commit changes Syslink_Override_Params in Platform.c to an empty
string. It removes the need to specify carveouts in the string, which
was only used for verification purposes when there is a slave-side MMU.
Code associated with the verification of the resource table entries
against these carveouts is removed.
This commit also changes the default for mmuEnable to TRUE, since that
is currently the only mode we support.
This addresses CQ SDOCM00105667.
Signed-off-by: VW <vwan@ti.com>
string. It removes the need to specify carveouts in the string, which
was only used for verification purposes when there is a slave-side MMU.
Code associated with the verification of the resource table entries
against these carveouts is removed.
This commit also changes the default for mmuEnable to TRUE, since that
is currently the only mode we support.
This addresses CQ SDOCM00105667.
Signed-off-by: VW <vwan@ti.com>
12 files changed:
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayudsp/VAYUDspProc.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayudsp/VAYUDspProc.c
index 5dea43f7fa694dbd23aeb706d547785ef9f24b47..33c90656d4eda05417f32cb40b4a29f02e422b14 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2013, Texas Instruments Incorporated
+ * Copyright (c) 2013-2014, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#define AddrTable_SIZE 32
/* config param for dsp mmu */
-#define PARAMS_MAX_NAMELENGTH 64
#define PARAMS_mmuEnable "ProcMgr.proc[DSP1].mmuEnable="
-#define PARAMS_carveoutAddr "ProcMgr.proc[DSP1].carveoutAddr"
-#define PARAMS_carveoutSize "ProcMgr.proc[DSP1].carveoutSize"
/*!
.isSetup = FALSE,
.configSize = sizeof(VAYUDSPPROC_Config),
.gateHandle = NULL,
- .defInstParams.mmuEnable = FALSE,
+ .defInstParams.mmuEnable = TRUE,
.defInstParams.numMemEntries = AddrTable_STATIC_COUNT
};
Int status = PROCESSOR_SUCCESS;
Processor_Object * procHandle = (Processor_Object *)handle;
- VAYUDSPPROC_Object * object = NULL;
+ VAYUDSPPROC_Object * object = NULL;
UInt32 i = 0;
UInt32 index = 0;
ProcMgr_AddrInfo * me;
SysLink_MemEntry * entry;
SysLink_MemEntry_Block memBlock;
- Char prop[PARAMS_MAX_NAMELENGTH];
- Char configProp[PARAMS_MAX_NAMELENGTH];
- UInt32 numCarveouts = 0;
VAYUDSP_HalMmuCtrlArgs_Enable mmuEnableArgs;
VAYUDSP_HalParams halParams;
Cfg_propBool(PARAMS_mmuEnable, ProcMgr_sysLinkCfgParams,
&(object->params.mmuEnable));
- /* check for carveout params override */
- for (i = 0; i < ProcMgr_MAX_MEMORY_REGIONS; i++) {
- snprintf (prop, PARAMS_MAX_NAMELENGTH, PARAMS_carveoutAddr"%d", i);
- strcat(prop, "=");
- if (!Cfg_prop(prop, ProcMgr_sysLinkCfgParams, configProp))
- break;
- object->params.carveoutAddr[i] = strtoul(configProp, 0, 16);
- snprintf (prop, PARAMS_MAX_NAMELENGTH, PARAMS_carveoutSize"%d", i);
- strcat(prop, "=");
- if (!Cfg_prop(prop, ProcMgr_sysLinkCfgParams, configProp))
- break;
- object->params.carveoutSize[i] = strtoul(configProp, 0, 16);
- numCarveouts++;
- }
-
object->pmHandle = params->pmHandle;
GT_0trace(curTrace, GT_1CLASS,
"VAYUDSPPROC_attach: Mapping memory regions");
/* search for dsp memory map */
status = RscTable_process(procHandle->procId, object->params.mmuEnable,
- numCarveouts,
- (Ptr)object->params.carveoutAddr,
- object->params.carveoutSize, TRUE,
+ TRUE,
&memBlock.numEntries);
if (status < 0 || memBlock.numEntries > SYSLINK_MAX_MEMENTRIES) {
/*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/vayucore0/VAYUIpuCore0Proc.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/vayucore0/VAYUIpuCore0Proc.c
index c11ac58aeee105c51fc0a3285f4e688dde97dfbf..a66f497dc40540c55ce2cbb90dd9e9749092d6d5 100644 (file)
#define PROCID_TO_IPU(procId) (procId == VAYUIPUCORE0PROC_state.ipu1ProcId ?\
0 : 1)
-#define PARAMS_MAX_NAMELENGTH 64
/* Config param for L2MMU. This is not a typo, we are using the
* same name (IPU1) because both Benelli M4 processors use the
* same L2MMU. The docs expose IPUx but not the IPUx Core1 processor.
*/
#define PARAMS_mmuEnable1 "ProcMgr.proc[IPU1].mmuEnable="
-#define PARAMS_carveoutAddr1 "ProcMgr.proc[IPU1].carveoutAddr"
-#define PARAMS_carveoutSize1 "ProcMgr.proc[IPU1].carveoutSize"
#define PARAMS_mmuEnable2 "ProcMgr.proc[IPU2].mmuEnable="
-#define PARAMS_carveoutAddr2 "ProcMgr.proc[IPU2].carveoutAddr"
-#define PARAMS_carveoutSize2 "ProcMgr.proc[IPU2].carveoutSize"
/*!
.isSetup = FALSE,
.configSize = sizeof(VAYUIPUCORE0PROC_Config),
.gateHandle = NULL,
- .defInstParams.mmuEnable = FALSE,
+ .defInstParams.mmuEnable = TRUE,
.defInstParams.numMemEntries = AddrTable_STATIC_COUNT,
};
ProcMgr_AddrInfo * me;
SysLink_MemEntry * entry;
SysLink_MemEntry_Block memBlock;
- Char prop[PARAMS_MAX_NAMELENGTH];
- Char configProp[PARAMS_MAX_NAMELENGTH];
- UInt32 numCarveouts = 0;
VAYUIPU_HalMmuCtrlArgs_Enable mmuEnableArgs;
VAYUIPU_HalParams halParams;
&(object->params.mmuEnable));
}
- /* check for carveout params override */
- for (i = 0; i < ProcMgr_MAX_MEMORY_REGIONS; i++) {
- if (VAYUIPUCORE0PROC_state.ipu1ProcId == procHandle->procId) {
- snprintf (prop, PARAMS_MAX_NAMELENGTH, PARAMS_carveoutAddr1"%d", i);
- }
- else {
- snprintf (prop, PARAMS_MAX_NAMELENGTH, PARAMS_carveoutAddr2"%d", i);
- }
- strcat(prop, "=");
- if (!Cfg_prop(prop, ProcMgr_sysLinkCfgParams, configProp))
- break;
- object->params.carveoutAddr[i] = strtoul(configProp, 0, 16);
- if (VAYUIPUCORE0PROC_state.ipu1ProcId == procHandle->procId) {
- snprintf (prop, PARAMS_MAX_NAMELENGTH, PARAMS_carveoutSize1"%d", i);
- }
- else {
- snprintf (prop, PARAMS_MAX_NAMELENGTH, PARAMS_carveoutSize2"%d", i);
- }
- strcat(prop, "=");
- if (!Cfg_prop(prop, ProcMgr_sysLinkCfgParams, configProp))
- break;
- object->params.carveoutSize[i] = strtoul(configProp, 0, 16);
- numCarveouts++;
- }
-
object->pmHandle = params->pmHandle;
GT_0trace(curTrace, GT_1CLASS,
"VAYUIPUCORE0PROC_attach: Mapping memory regions");
/* search for dsp memory map */
status = RscTable_process(procHandle->procId, object->params.mmuEnable,
- numCarveouts,
- (Ptr)object->params.carveoutAddr,
- object->params.carveoutSize, TRUE,
+ TRUE,
&memBlock.numEntries);
if (status < 0 || memBlock.numEntries > SYSLINK_MAX_MEMENTRIES) {
/*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/vayucore1/VAYUIpuCore1Proc.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/vayucore1/VAYUIpuCore1Proc.c
index 2433986b9ef1d9a01b91183f1ab6c5cc6950950d..56fbf4d8a04abc19d9e9f0686fa27fd4d8c03c3f 100644 (file)
#define PROCID_TO_IPU(procId) (procId == VAYUIPUCORE1PROC_state.ipu1ProcId ?\
0 : 1)
-#define PARAMS_MAX_NAMELENGTH 64
/* Config param for L2MMU. This is not a typo, we are using the
* same name (IPU1) because both Benelli M4 processors use the
* same L2MMU. The docs expose IPUx but not the IPUx Core1 processor.
*/
#define PARAMS_mmuEnable1 "ProcMgr.proc[IPU1].mmuEnable="
-#define PARAMS_carveoutAddr1 "ProcMgr.proc[IPU1].carveoutAddr"
-#define PARAMS_carveoutSize1 "ProcMgr.proc[IPU1].carveoutSize"
#define PARAMS_mmuEnable2 "ProcMgr.proc[IPU2].mmuEnable="
-#define PARAMS_carveoutAddr2 "ProcMgr.proc[IPU2].carveoutAddr"
-#define PARAMS_carveoutSize2 "ProcMgr.proc[IPU2].carveoutSize"
/*!
.isSetup = FALSE,
.configSize = sizeof (VAYUIPUCORE1PROC_Config),
.gateHandle = NULL,
- .defInstParams.mmuEnable = FALSE,
+ .defInstParams.mmuEnable = TRUE,
.defInstParams.numMemEntries = AddrTable_STATIC_COUNT,
};
ProcMgr_AddrInfo * me;
SysLink_MemEntry * entry;
SysLink_MemEntry_Block memBlock;
- Char prop[PARAMS_MAX_NAMELENGTH];
- Char configProp[PARAMS_MAX_NAMELENGTH];
- UInt32 numCarveouts = 0;
VAYUIPU_HalMmuCtrlArgs_Enable mmuEnableArgs;
VAYUIPU_HalParams halParams;
&(object->params.mmuEnable));
}
- /* check for carveout params override */
- for (i = 0; i < ProcMgr_MAX_MEMORY_REGIONS; i++) {
- if (VAYUIPUCORE1PROC_state.ipu1ProcId == procHandle->procId) {
- snprintf (prop, PARAMS_MAX_NAMELENGTH, PARAMS_carveoutAddr1"%d", i);
- }
- else {
- snprintf (prop, PARAMS_MAX_NAMELENGTH, PARAMS_carveoutAddr2"%d", i);
- }
- strcat(prop, "=");
- if (!Cfg_prop(prop, ProcMgr_sysLinkCfgParams, configProp))
- break;
- object->params.carveoutAddr[i] = strtoul(configProp, 0, 16);
- if (VAYUIPUCORE1PROC_state.ipu1ProcId == procHandle->procId) {
- snprintf (prop, PARAMS_MAX_NAMELENGTH, PARAMS_carveoutSize1"%d", i);
- }
- else {
- snprintf (prop, PARAMS_MAX_NAMELENGTH, PARAMS_carveoutSize2"%d", i);
- }
- strcat(prop, "=");
- if (!Cfg_prop(prop, ProcMgr_sysLinkCfgParams, configProp))
- break;
- object->params.carveoutSize[i] = strtoul(configProp, 0, 16);
- numCarveouts++;
- }
-
object->pmHandle = params->pmHandle;
GT_0trace(curTrace, GT_1CLASS,
"VAYUIPUCORE1PROC_attach: Mapping memory regions");
/* search for dsp memory map */
status = RscTable_process(procHandle->procId, object->params.mmuEnable,
- numCarveouts,
- (Ptr)object->params.carveoutAddr,
- object->params.carveoutSize, TRUE,
+ TRUE,
&memBlock.numEntries);
if (status < 0 || memBlock.numEntries > SYSLINK_MAX_MEMENTRIES) {
/*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
/* if not found in static entries, check in dynamic entries */
if (!found) {
- for (j = AddrTable_STATIC_COUNT; j < AddrTable_count; j++) {
- ai = &AddrTable[j];
+ for (j = AddrTable_STATIC_COUNT;
+ j < AddrTable_count[PROCID_TO_IPU(procHandle->procId)]; j++) {
+ ai = &AddrTable[PROCID_TO_IPU(procHandle->procId)][j];
if (ai->isMapped == TRUE) {
startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/Platform.c b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/Platform.c
index 9bcd6ee85bab40183f8133b952cf0fbe53c79222..00772bdb784ed7bd98803cc7a16e2ecb996b41dc 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2010-2013, Texas Instruments Incorporated
+ * Copyright (c) 2010-2014, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
extern unsigned int syslink_ipu_mem_size;
extern unsigned int syslink_dsp_mem_size;
-#define MAX_SIZE_OVERRIDE_PARAMS 500
-
-/*Char Syslink_Override_Params[MAX_SIZE_OVERRIDE_PARAMS];*/
-
-#ifndef SYSLINK_SYSBIOS_SMP
-String Syslink_Override_Params = "ProcMgr.proc[CORE0].mmuEnable=TRUE;"
- "ProcMgr.proc[CORE0].carveoutAddr0=0xBA300000;"
- "ProcMgr.proc[CORE0].carveoutSize0=0x5A00000;"
-#else
-String Syslink_Override_Params = "ProcMgr.proc[IPU].mmuEnable=TRUE;"
- "ProcMgr.proc[IPU].carveoutAddr0=0xBA300000;"
- "ProcMgr.proc[IPU].carveoutSize0=0x5A00000;"
-#endif
- "ProcMgr.proc[DSP].mmuEnable=TRUE;"
- "ProcMgr.proc[DSP].carveoutAddr0=0xBA300000;"
- "ProcMgr.proc[DSP].carveoutSize0=0x5A00000;";
+/*
+ * Variable used to override default parameters
+ * Use a string of form
+ * String Syslink_Override_Params = "ProcMgr.proc[DSP].mmuEnable=TRUE;"
+ * "ProcMgr.proc[IPU].mmuEnable=TRUE;";
+ */
+String Syslink_Override_Params = "";
/** ============================================================================
}
else {
#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-/*
- String_cpy(Syslink_Override_Params,
- "ProcMgr.proc[CORE0].mmuEnable=TRUE;");
- String_hexToStr(hexString, cfg->pAddr);
- String_cat(Syslink_Override_Params,
- "ProcMgr.proc[CORE0].carveoutAddr0=");
- String_cat(Syslink_Override_Params, hexString);
- String_cat(Syslink_Override_Params, ";");
- String_hexToStr(hexString, syslink_ipu_mem_size);
- String_cat(Syslink_Override_Params,
- "ProcMgr.proc[CORE0].carveoutSize0=");
- String_cat(Syslink_Override_Params, hexString);
- String_cat(Syslink_Override_Params, ";");
- String_cat(Syslink_Override_Params,
- "ProcMgr.proc[DSP].mmuEnable=TRUE;");
- String_hexToStr(hexString, cfg->pAddr_dsp);
- String_cat(Syslink_Override_Params,
- "ProcMgr.proc[DSP].carveoutAddr0=");
- String_cat(Syslink_Override_Params, hexString);
- String_cat(Syslink_Override_Params, ";");
- String_hexToStr(hexString, syslink_dsp_mem_size);
- String_cat(Syslink_Override_Params,
- "ProcMgr.proc[DSP].carveoutSize0=");
- String_cat(Syslink_Override_Params, hexString);
- String_cat(Syslink_Override_Params, ";");
-*/
cfg->params = Memory_alloc(NULL,
String_len(Syslink_Override_Params) + 1, 0,
NULL);
OMAP5430BENELLIPROC_Params ipu1ProcParams;
#endif
OMAP5430BENELLIPROC_Params dspProcParams;
- ProcMgr_AddrInfo * memEntries;
ElfLoader_Params elfLoaderParams;
ElfLoader_Handle ldrHandle;
UInt16 procId;
Platform_Handle handle;
- UInt32 pa, va;
- UInt32 i = 0;
Bool core0Setup = FALSE;
#ifndef SYSLINK_SYSBIOS_SMP
Bool core1Setup = FALSE;
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliProc.c b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliProc.c
index 6dfecb74b4e5048dba45400a9187723e694c9b8e..130ab9109db47ad21544ac9940355fc316235c13 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2010-2013, Texas Instruments Incorporated
+ * Copyright (c) 2010-2014, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
/* config param for core0 mmu */
#ifndef SYSLINK_SYSBIOS_SMP
#define PARAMS_mmuEnable "ProcMgr.proc[CORE0].mmuEnable="
-#define PARAMS_carveoutAddr0 "ProcMgr.proc[CORE0].carveoutAddr0="
-#define PARAMS_carveoutSize0 "ProcMgr.proc[CORE0].carveoutSize0="
-#define PARAMS_carveoutAddr1 "ProcMgr.proc[CORE0].carveoutAddr1="
-#define PARAMS_carveoutSize1 "ProcMgr.proc[CORE0].carveoutSize1="
#else
#define PARAMS_mmuEnable "ProcMgr.proc[IPU].mmuEnable="
-#define PARAMS_carveoutAddr0 "ProcMgr.proc[IPU].carveoutAddr0="
-#define PARAMS_carveoutSize0 "ProcMgr.proc[IPU].carveoutSize0="
-#define PARAMS_carveoutAddr1 "ProcMgr.proc[IPU].carveoutAddr1="
-#define PARAMS_carveoutSize1 "ProcMgr.proc[IPU].carveoutSize1="
#endif
#define PARAMS_mmuEnableDSP "ProcMgr.proc[DSP].mmuEnable="
-#define PARAMS_carveoutAddr0DSP "ProcMgr.proc[DSP].carveoutAddr0="
-#define PARAMS_carveoutSize0DSP "ProcMgr.proc[DSP].carveoutSize0="
-#define PARAMS_carveoutAddr1DSP "ProcMgr.proc[DSP].carveoutAddr1="
-#define PARAMS_carveoutSize1DSP "ProcMgr.proc[DSP].carveoutSize1="
/*!
UInt32 index = 0;
SysLink_MemEntry * entry;
SysLink_MemEntry_Block memBlock;
- Char configProp[SYSLINK_MAX_NAMELENGTH];
ProcMgr_AddrInfo * pMemRegn = NULL;
UInt32 * AddrTable_count = NULL;
GT_2CLASS,
" OMAP5430BENELLIPROC_attach: Mapping memory regions");
- /* check for carveout params override */
- if (procHandle->procId == PROCTYPE_DSP) {
- Cfg_prop(PARAMS_carveoutAddr0DSP, ProcMgr_sysLinkCfgParams, configProp);
- object->params.carveoutAddr[0] = strtoul(configProp, 0, 16);
- Cfg_prop(PARAMS_carveoutSize0DSP, ProcMgr_sysLinkCfgParams, configProp);
- object->params.carveoutSize[0] = strtoul(configProp, 0, 16);
- }
- else {
- Cfg_prop(PARAMS_carveoutAddr0, ProcMgr_sysLinkCfgParams, configProp);
- object->params.carveoutAddr[0] = strtoul(configProp, 0, 16);
- Cfg_prop(PARAMS_carveoutSize0, ProcMgr_sysLinkCfgParams, configProp);
- object->params.carveoutSize[0] = strtoul(configProp, 0, 16);
- }
-
object->pmHandle = params->pmHandle;
GT_0trace(curTrace, GT_1CLASS,
"OMAP5430BENELLIPROC_attach: Mapping memory regions");
/* search for dsp memory map */
- status = RscTable_process(procHandle->procId, TRUE, NumCarveouts,
- (Ptr)object->params.carveoutAddr,
- object->params.carveoutSize, TRUE,
- &memBlock.numEntries);
+ status = RscTable_process(procHandle->procId, TRUE,
+ TRUE, &memBlock.numEntries);
if (status < 0 || memBlock.numEntries > SYSLINK_MAX_MEMENTRIES) {
/*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
status = PROCESSOR_E_INVALIDARG;
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/Platform.c b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/Platform.c
index 946d91a6b7176085f7f00fe10b3494ac0a7c47bd..899c0ebad558566670d9fb1b7ea2b1b9bfc26c4a 100644 (file)
extern String ProcMgr_sysLinkCfgParams;
-String Syslink_Override_Params = "ProcMgr.proc[DSP1].mmuEnable=TRUE;"
- "ProcMgr.proc[DSP1].carveoutAddr0=0xBA300000;"
- "ProcMgr.proc[DSP1].carveoutSize0=0x5A00000;"
- "ProcMgr.proc[IPU1].mmuEnable=TRUE;"
- "ProcMgr.proc[IPU1].carveoutAddr0=0xBA300000;"
- "ProcMgr.proc[IPU1].carveoutSize0=0x5A00000;"
- "ProcMgr.proc[IPU2].mmuEnable=TRUE;"
- "ProcMgr.proc[IPU2].carveoutAddr0=0xBA300000;"
- "ProcMgr.proc[IPU2].carveoutSize0=0x5A00000;";
+/*
+ * Variable used to override default parameters
+ * Use a string of form
+ * String Syslink_Override_Params = "ProcMgr.proc[DSP1].mmuEnable=TRUE;"
+ * "ProcMgr.proc[IPU1].mmuEnable=TRUE;";
+ */
+String Syslink_Override_Params = "";
+
/** ============================================================================
* APIs.
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/OMAP5430BenelliProc.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/OMAP5430BenelliProc.h
index d3d55834a9fbd3f303e2717e2f4a6ecfb8dd66be..f9dafcb6094f9cb46a840bc91a807c172beab508 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2010-2011, Texas Instruments Incorporated
+ * Copyright (c) 2010-2014, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
ProcMgr_AddrInfo memEntries [ProcMgr_MAX_MEMORY_REGIONS];
/*!< Array of information structures for memory regions to be configured. */
Processor_Handle procHandle;
- UInt32 carveoutAddr [ProcMgr_MAX_MEMORY_REGIONS];
- /*!< The address of the carveout for shared mem */
- UInt32 carveoutSize [ProcMgr_MAX_MEMORY_REGIONS];
- /*!< The length of the carveout for shared mem */
} OMAP5430BENELLIPROC_Params;
/*!
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/VAYUDspProc.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/VAYUDspProc.h
index 03669f40afc0517955728edabc6c473524a30a96..c719d0a57a5d6c7b3d5c2e897d5cff84af7dbcfb 100644 (file)
/*
* ============================================================================
*
- * Copyright (c) 2013, Texas Instruments Incorporated
+ * Copyright (c) 2013-2014, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
/*!< Number of memory regions to be configured. */
ProcMgr_AddrInfo memEntries[ProcMgr_MAX_MEMORY_REGIONS];
/*!< Array of information structures for memory regions to be configured. */
- UInt32 carveoutAddr[ProcMgr_MAX_MEMORY_REGIONS];
- /*!< The address of the carveout for shared mem */
- UInt32 carveoutSize[ProcMgr_MAX_MEMORY_REGIONS];
- /*!< The length of the carveout for shared mem */
} VAYUDSPPROC_Params;
/*!
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/VAYUIpuCore0Proc.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/VAYUIpuCore0Proc.h
index 8c89104cb374a5a4675733f209fbe8c64c221943..ee4ca612f5a83d58a24a45b52646758f91f6f630 100644 (file)
/*
* ============================================================================
*
- * Copyright (c) 2013, Texas Instruments Incorporated
+ * Copyright (c) 2013-2014, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
/*!< Number of memory regions to be configured. */
ProcMgr_AddrInfo memEntries[ProcMgr_MAX_MEMORY_REGIONS];
/*!< Array of information structures for memory regions to be configured. */
- UInt32 carveoutAddr[ProcMgr_MAX_MEMORY_REGIONS];
- /*!< The address of the carveout for shared mem */
- UInt32 carveoutSize[ProcMgr_MAX_MEMORY_REGIONS];
- /*!< The length of the carveout for shared mem */
} VAYUIPUCORE0PROC_Params;
/*!
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/VAYUIpuCore1Proc.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/VAYUIpuCore1Proc.h
index ff1f1a53eac96e79a5dd24588917b645dbcfdf5c..84ab2c096af1940bcacffa38b70827cd0e298012 100644 (file)
/*
* ============================================================================
*
- * Copyright (c) 2013, Texas Instruments Incorporated
+ * Copyright (c) 2013-2014, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
/*!< Number of memory regions to be configured. */
ProcMgr_AddrInfo memEntries[ProcMgr_MAX_MEMORY_REGIONS];
/*!< Array of information structures for memory regions to be configured. */
- UInt32 carveoutAddr[ProcMgr_MAX_MEMORY_REGIONS];
- /*!< The address of the carveout for shared mem */
- UInt32 carveoutSize[ProcMgr_MAX_MEMORY_REGIONS];
- /*!< The length of the carveout for shared mem */
} VAYUIPUCORE1PROC_Params;
/*!
diff --git a/qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c b/qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c
index 90cbf6dfaff7fae02c964eb8c1bd8bd52889de65..946328bd09673e9e4ce09f72006013996c713f7e 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2012, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
UInt32 size;
} Carveout_Elem;
-typedef struct Carveout_Object_tag {
- UInt32 addr;
- UInt32 size;
- List_Handle freeBlocks;
-} Carveout_Object;
-
/*!
* @brief RscTable Header
*/
/*!< Resource table length. */
UInt32 rscTableDA;
/*!< Resource table device address. */
- Carveout_Object * carveout[SYSLINK_MAX_MEMENTRIES];
- /*!< Carveouts for this table. */
- UInt32 numCarveouts;
- /*!< Carveouts for this table. */
SysLink_MemEntry memEntries[SYSLINK_MAX_MEMENTRIES];
/*!< Memory Entries for the remote processor. */
UInt32 numMemEntries;
return (RscTable_Handle)obj;
}
-/* Helper functions for processing carveout */
-Int Carveout_register (RscTable_Object *obj, UInt32 id, Ptr carveOut,
- UInt32 carveOutLen)
-{
- Int status = 0;
- Carveout_Object * cout = NULL;
- List_Params params;
-
- cout = Memory_alloc(NULL, sizeof(Carveout_Object), 0, NULL);
- if (cout) {
- cout->addr = (UInt32)carveOut;
- cout->size = carveOutLen;
- List_Params_init(¶ms);
- cout->freeBlocks = List_create(¶ms);
- if (cout->freeBlocks == NULL) {
- status = RSCTABLE_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Carveout_register",
- status,
- "Unable to create free list");
- Memory_free(NULL, cout, sizeof(Carveout_Object));
- cout = NULL;
- }
- else {
- // Add the whole of the memory to the free list
- Carveout_Elem * elem = Memory_alloc(NULL, sizeof(Carveout_Elem),
- 0, NULL);
- if (elem) {
- elem->addr = cout->addr;
- elem->size = cout->size;
- List_put(cout->freeBlocks, (List_Elem *)elem);
- }
- else {
- status = RSCTABLE_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Carveout_register",
- status,
- "Unable to allocate elem");
- List_delete(&cout->freeBlocks);
- Memory_free(NULL, cout, sizeof(Carveout_Object));
- cout = NULL;
- }
- }
- }
- else {
- status = RSCTABLE_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Carveout_register",
- status,
- "Unable to allocate carveout structure");
- }
-
- obj->carveout[id] = cout;
- obj->numCarveouts++;
- return status;
-}
-
-Int Carveout_unregister (RscTable_Object *obj, UInt32 id)
-{
- Int status = 0;
- List_Elem * elem = NULL;
-
- if (obj->carveout[id]) {
- if (obj->carveout[id]->freeBlocks) {
- while ((elem = List_get(obj->carveout[id]->freeBlocks)))
- Memory_free(NULL, elem, sizeof(Carveout_Elem));
- List_delete(&obj->carveout[id]->freeBlocks);
- }
-
- Memory_free(NULL, obj->carveout[id], sizeof(Carveout_Object));
- obj->carveout[id] = NULL;
- obj->numCarveouts--;
- }
- else {
- status = RSCTABLE_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Carveout_unregister",
- status,
- "No carveout associated with obj");
- }
-
- return status;
-}
-
// allocate any addr
Int Chunk_allocate (RscTable_Object *obj, UInt32 size, UInt32 * pa)
{
return status;
}
-// allocate any addr from a specified carveout
-Int Carveout_allocate (RscTable_Object *obj, UInt32 size, UInt32 * pa)
-{
- Int status = 0;
- Carveout_Object * cout = NULL;
- List_Elem * elem = NULL;
- Bool found = FALSE;
- UInt i = 0;
-
- if (!pa || !obj || !obj->numCarveouts) {
- status = RSCTABLE_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Carveout_allocate",
- status,
- "Invalid arg passed");
- }
- else {
- for (i = 0; i < obj->numCarveouts; i++) {
- *pa = 0;
- cout = obj->carveout[i];
-
- // search for a free block with sufficient size
- List_traverse(elem, cout->freeBlocks) {
- if (((Carveout_Elem *)elem)->size >= size) {
- found = TRUE;
- break;
- }
- }
- if (found) {
- UInt32 rem = 0;
- UInt32 addr = 0;
-
- // found a spot for our request
- addr = ((Carveout_Elem *)elem)->addr;
- rem = ((Carveout_Elem *)elem)->size - size;
- if (rem) {
- ((Carveout_Elem *)elem)->addr += size;
- ((Carveout_Elem *)elem)->size = rem;
- }
- else {
- List_remove(cout->freeBlocks, elem);
- Memory_free (NULL, elem, sizeof(Carveout_Elem));
- }
- *pa = addr;
- break;
- }
- }
- if (i == obj->numCarveouts) {
- status = RSCTABLE_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Carveout_allocate",
- status,
- "Not enough room in carveout");
- }
- }
- return status;
-}
-
-// allocate specific addr
-Int Carveout_reserve (RscTable_Object *obj, UInt32 size, UInt32 pa)
-{
- Int status = 0;
- Carveout_Object * cout = NULL;
- List_Elem * elem = NULL;
- Bool found = FALSE;
- UInt i = 0;
-
- if (!pa || !obj || !obj->numCarveouts) {
- status = RSCTABLE_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Carveout_reserve",
- status,
- "Invalid arg passed");
- }
- else {
- for (i = 0; i < obj->numCarveouts; i++) {
- cout = obj->carveout[i];
-
- // search for a free block with sufficient size
- List_traverse(elem, cout->freeBlocks) {
- if ((((Carveout_Elem *)elem)->addr <= pa) &&
- ((((Carveout_Elem *)elem)->addr +
- ((Carveout_Elem *)elem)->size) >= (pa + size))) {
- found = TRUE;
- break;
- }
- }
- if (found) {
- UInt32 rem_start = 0;
- UInt32 rem_end = 0;
-
- // found a spot for our request
- if (((Carveout_Elem *)elem)->addr < pa) {
- // there is free mem at the beginning of the block
- rem_start = pa - ((Carveout_Elem *)elem)->addr;
- }
- if (((Carveout_Elem *)elem)->addr + ((Carveout_Elem *)elem)->size >
- (pa + size)) {
- // there is free mem at the end of the block
- rem_end = ((Carveout_Elem *)elem)->addr +
- ((Carveout_Elem *)elem)->size - (pa + size);
- }
- // now carve up the block
- if (rem_start) {
- ((Carveout_Elem *)elem)->size = rem_start;
- }
- else if (rem_end) {
- ((Carveout_Elem *)elem)->size = rem_end;
- ((Carveout_Elem *)elem)->addr = pa + size;
- }
- else {
- List_remove(cout->freeBlocks, elem);
- Memory_free (NULL, elem, sizeof(Carveout_Elem));
- }
- if (rem_start && rem_end) {
- Carveout_Elem * c_elem = NULL;
- c_elem = Memory_alloc (NULL, sizeof(Carveout_Elem), 0, NULL);
- if (c_elem) {
- c_elem->size = rem_end;
- c_elem->addr = pa + size;
- List_insert(cout->freeBlocks, (List_Elem *)&c_elem->elem,
- elem->next);
- }
- else {
- /* add mem back to free block */
- ((Carveout_Elem *)elem)->size += (size + rem_end);
- status = RSCTABLE_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Carveout_reserve",
- status,
- "Unable to allocate elem");
- }
- }
- break;
- }
- }
- if (i == obj->numCarveouts) {
- status = RSCTABLE_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Carveout_reserve",
- status,
- "Specified addr/size not available");
-
- }
- }
- return status;
-}
-
Int
-RscTable_process (UInt16 procId, Bool mmuEnabled, UInt32 numCarveouts,
- Ptr carveOut[], UInt32 carveOutLen[], Bool tryAlloc,
+RscTable_process (UInt16 procId, Bool mmuEnabled, Bool tryAlloc,
UInt32 * numBlocks)
{
Int status = 0;
obj->numMemEntries = 0;
- // Register carveout mem regions if provided
- if (numCarveouts && carveOut && carveOutLen) {
- for (i = 0; i < numCarveouts; i++) {
- status = Carveout_register(obj, i, carveOut[i], carveOutLen[i]);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "RscTable_process",
- status,
- "Carveout_register failed");
- return status;
- }
- }
- }
-
// TODO: Check the version
printf("RscTable_process: RscTable version is [%d]\n", table->ver);
// TODO: need to allocate this mem from carveout
struct fw_rsc_carveout * cout = (struct fw_rsc_carveout *)entry;
UInt32 pa = 0;
- if (cout->pa == 0)
- if (mmuEnabled)
+ if (cout->pa == 0) {
+ if (mmuEnabled) {
ret = Chunk_allocate (obj, cout->len, &pa);
+ }
else {
- ret = Carveout_reserve (obj, cout->len, cout->da);
pa = cout->da;
}
- else
- ret = Carveout_reserve (obj, cout->len, cout->pa);
+ }
if (!ret) {
cout->pa = pa;
if (obj->numMemEntries == SYSLINK_MAX_MEMENTRIES) {
{
// only care about mem in DDR for now
struct fw_rsc_devmem * dmem = (struct fw_rsc_devmem *)entry;
- UInt32 pa = 0;
if (dmem->pa >= DDR_MEM) {
// HACK: treat vring mem specially, vring is always the
// first devmem entry, may change in future
dmem->pa = obj->vringPa;
}
}
- else {
- ret = Carveout_reserve (obj, dmem->len, dmem->pa);
- if (ret && mmuEnabled && tryAlloc) {
- ret = Carveout_allocate (obj, dmem->len, &pa);
- if (!ret) dmem->pa = pa;
- }
- }
}
if (!ret) {
if (obj->numMemEntries == SYSLINK_MAX_MEMENTRIES) {
vr_size += ROUND_UP(MessageQCopy_RINGSIZE, 0x4000);
vr_bufs_size += (vring->num) * RPMSG_BUF_SIZE;
}
- if (!ret)
+ if (!ret) {
// HACK: round up to multiple of 1MB, because we know this
// is the size of the remote entry
- if (mmuEnabled)
+ if (mmuEnabled) {
ret = Chunk_allocate(obj,
ROUND_UP(vr_size + vr_bufs_size, 0x100000),
&pa);
- else
- ret = Carveout_allocate(obj,
- ROUND_UP(vr_size + vr_bufs_size, 0x100000),
- &pa);
+ }
+ else {
+ /*
+ * TBD: if mmu is disabled, we need a way to specify
+ * shared memory from which to allocate the vrings
+ */
+ }
+ }
else if (obj->vrings) {
Memory_free (NULL, obj->vrings,
sizeof(*vring) * obj->numVrings);
obj->numMemEntries = 0;
}
*numBlocks = obj->numMemEntries;
- // Can un-register the carveout now? Don't need it anymore?
- for (i = 0; i < numCarveouts; i++)
- Carveout_unregister(obj, i);
return status;
}
diff --git a/qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.h b/qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.h
index 18df3d200c7d1516fce89bfaebd2adc647af2065..fdd0bfef73ea34a33c329f547ecaa5ee6bfec0d9 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2012, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Int RscTable_free (RscTable_Handle * handle);
-Int RscTable_process (UInt16 procId, Bool mmuEnabled, UInt32 numCarveouts,
- Ptr carveOut[], UInt32 carveOutLen[], Bool tryAlloc,
+Int RscTable_process (UInt16 procId, Bool mmuEnabled, Bool tryAlloc,
UInt32 * numBlocks);
Int RscTable_getMemEntries (UInt16 procId, SysLink_MemEntry * memEntries,