summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0c4e757)
raw | patch | inline | side by side (parent: 0c4e757)
author | vwan@ti.com <vwan@ti.com> | |
Mon, 19 May 2014 17:20:20 +0000 (10:20 -0700) | ||
committer | Robert Tivy <rtivy@ti.com> | |
Tue, 20 May 2014 22:30:24 +0000 (15:30 -0700) |
This commit adds support for the new INTMEM resource type (SDOCM00107479).
For this resource type, we map the entry only for the loader on the host,
without mapping it to the slave MMU.
This commit also removes support of the hard-coded static entries defined
in the address translation table, which was originally there to ensure
slave internal memories are always mapped. To match up with the Linux
implementation we'll now rely on the INTMEM resource type instead.
Note that this does break compatibility with slave executables that were
previously built without the INTMEM resource entries but were relying
on the hard-coded internal memory definitions in the ipc resource manager.
Signed-off-by: VW <vwan@ti.com>
For this resource type, we map the entry only for the loader on the host,
without mapping it to the slave MMU.
This commit also removes support of the hard-coded static entries defined
in the address translation table, which was originally there to ensure
slave internal memories are always mapped. To match up with the Linux
implementation we'll now rely on the INTMEM resource type instead.
Note that this does break compatibility with slave executables that were
previously built without the INTMEM resource entries but were relying
on the hard-coded internal memory definitions in the ipc resource manager.
Signed-off-by: VW <vwan@ti.com>
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 e3e264553a3624f3146b2013a6f99a54c01a7993..c968b59c3cd5338a859317e1500cfec13225b50b 100644 (file)
* =============================================================================
*/
-/*!
- * @brief Number of static entries in address translation table.
- */
-#define AddrTable_STATIC_COUNT 3
/*!
* @brief Max entries in address translation table.
} VAYUDSPPROC_ModuleObject;
/* Default memory regions */
-static UInt32 AddrTable_count = AddrTable_STATIC_COUNT;
+static UInt32 AddrTable_count = 0;
-/* static memory regions
- * CAUTION: AddrTable_STATIC_COUNT must match number of entries below.
+/*
+ * Address translation table
*/
-static ProcMgr_AddrInfo AddrTable[AddrTable_SIZE] =
- {
- /* L2 RAM */
- {
- .addr[ProcMgr_AddrType_MasterKnlVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterUsrVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterPhys] = 0x40800000u,
- .addr[ProcMgr_AddrType_SlaveVirt] = 0x800000u,
- .addr[ProcMgr_AddrType_SlavePhys] = -1u,
- .size = 0x40000u,
- .isCached = FALSE,
- .mapMask = ProcMgr_SLAVEVIRT,
- .isMapped = TRUE,
- .refCount = 0u /* refCount set to 0 for static entry */
- },
-
- /* L1P RAM */
- {
- .addr[ProcMgr_AddrType_MasterKnlVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterUsrVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterPhys] = 0x40E00000u,
- .addr[ProcMgr_AddrType_SlaveVirt] = 0xE00000u,
- .addr[ProcMgr_AddrType_SlavePhys] = -1u,
- .size = 0x8000u,
- .isCached = FALSE,
- .mapMask = ProcMgr_SLAVEVIRT,
- .isMapped = TRUE,
- .refCount = 0u /* refCount set to 0 for static entry */
- },
-
- /* L1D RAM */
- {
- .addr[ProcMgr_AddrType_MasterKnlVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterUsrVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterPhys] = 0x40F00000u,
- .addr[ProcMgr_AddrType_SlaveVirt] = 0xF00000u,
- .addr[ProcMgr_AddrType_SlavePhys] = -1u,
- .size = 0x8000u,
- .isCached = FALSE,
- .mapMask = ProcMgr_SLAVEVIRT,
- .isMapped = TRUE,
- .refCount = 0u /* refCount set to 0 for static entry */
- },
- };
+static ProcMgr_AddrInfo AddrTable[AddrTable_SIZE];
/* =============================================================================
* Globals
.isSetup = FALSE,
.configSize = sizeof(VAYUDSPPROC_Config),
.gateHandle = NULL,
- .defInstParams.numMemEntries = AddrTable_STATIC_COUNT
+ .defInstParams.numMemEntries = 0
};
/* config override specified in SysLinkCfg.c, defined in ProcMgr.c */
ai->isMapped = FALSE;
}
- /* initialize refCount for all entries - both static and dynamic */
+ /* initialize refCount for all entries */
for(i = 0; i < AddrTable_SIZE; i++) {
AddrTable[i].refCount = 0u;
}
#endif
/* delete all dynamically added entries */
- for (i = AddrTable_STATIC_COUNT; i < AddrTable_count; i++) {
+ for (i = 0; i < AddrTable_count; i++) {
ai = &AddrTable[i];
ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
ai->isMapped = FALSE;
ai->refCount = 0u;
}
- object->params.numMemEntries = AddrTable_STATIC_COUNT;
- AddrTable_count = AddrTable_STATIC_COUNT;
+ object->params.numMemEntries = 0;
+ AddrTable_count = 0;
//No need to reset.. that will be done in STOP
/*tmpStatus = VAYUDSP_halResetCtrl(object->halObject,
UInt32 i;
UInt32 j;
ProcMgr_AddrInfo * ai = NULL;
- VAYUDSP_HalMmuCtrlArgs_AddEntry addEntryArgs;
GT_4trace (curTrace, GT_ENTER, "VAYUDSPPROC_map",
handle, dstAddr, nSegs, sglist);
* is required. Add the entry only if the range does not exist
* in the translation table.
*/
-
- /* check in static entries first */
- for (j = 0; j < AddrTable_STATIC_COUNT; j++) {
+ for (j = 0; j < AddrTable_count; j++) {
ai = &AddrTable [j];
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)) {
- found = TRUE;
-
- /* refCount does not need to be incremented for static entries */
- break;
- }
- }
+ if (ai->isMapped == TRUE) {
+ startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
+ endAddr = startAddr + ai->size;
- /* if not found in static entries, check in dynamic entries */
- if (!found) {
- for (j = AddrTable_STATIC_COUNT; j < AddrTable_count; j++) {
- ai = &AddrTable [j];
-
- if (ai->isMapped == TRUE) {
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)
- && ((*dstAddr + sglist[i].size) <= endAddr)) {
- found = TRUE;
- ai->refCount++;
- break;
- }
+ if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)
+ && ((*dstAddr + sglist[i].size) <= endAddr)) {
+ found = TRUE;
+ ai->refCount++;
+ break;
}
}
}
ai->size = sglist[i].size;
ai->isCached = sglist[i].isCached;
ai->refCount++;
+ ai->isMapped = TRUE;
AddrTable_count++;
}
"AddrTable_SIZE reached!");
}
}
-
- /* if new entry, map into dsp mmu */
- if ((ai != NULL) && (ai->refCount == 1) && (status >= 0)) {
- ai->isMapped = TRUE;
-
- /* Add entry to Dsp mmu */
- addEntryArgs.masterPhyAddr = sglist [i].paddr;
- addEntryArgs.size = sglist [i].size;
- addEntryArgs.slaveVirtAddr = (UInt32)*dstAddr;
- /* TBD: elementSize, endianism, mixedSized are
- * hard coded now, must be configurable later
- */
- addEntryArgs.elementSize = ELEM_SIZE_16BIT;
- addEntryArgs.endianism = LITTLE_ENDIAN;
- addEntryArgs.mixedSize = MMU_TLBES;
- status = VAYUDSP_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_AddEntry, &addEntryArgs);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "VAYUDSPPROC_map", status,
- "Processor_MmuCtrlCmd_AddEntry failed");
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "VAYUDSPPROC_map", status,
- "DSP MMU configuration failed");
- }
-#endif
}
#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
}
object = (VAYUDSPPROC_Object *) procHandle->object;
GT_assert (curTrace, (object != NULL));
- /* Delete dynamically added non-default entries from translation
+ /* Delete entries from translation
* table only in last unmap called on that entry
*/
- for (i = AddrTable_STATIC_COUNT; i < AddrTable_count; i++) {
+ for (i = 0; i < AddrTable_count; i++) {
ai = &AddrTable[i];
if (!ai->isMapped) {
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 adab529ed3143c9e36ce050b8612803ab1442459..f2ba037154f4ea998e02ce91d587875f218c71e3 100644 (file)
* =============================================================================
*/
-/*!
- * @brief Number of static entries in address translation table.
- */
-#define AddrTable_STATIC_COUNT 1
-
/*!
* @brief Max entries in address translation table.
*/
/* Memory region counters */
static UInt32 AddrTable_count[NUM_IPUS] = {
- AddrTable_STATIC_COUNT,
- AddrTable_STATIC_COUNT,
+ 0,
+ 0
};
-/* static memory regions
- * CAUTION: AddrTable_STATIC_COUNT must match number of entries below.
+/*
+ * Address translation tables
*/
-static ProcMgr_AddrInfo AddrTable_IPU1[AddrTable_SIZE] =
-{
- /* L2 RAM */
- {
- .addr[ProcMgr_AddrType_MasterKnlVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterUsrVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterPhys] = 0x55020000u,
- .addr[ProcMgr_AddrType_SlaveVirt] = 0x20000000u,
- .addr[ProcMgr_AddrType_SlavePhys] = -1u,
- .size = 0x10000u,
- .isCached = FALSE,
- .mapMask = ProcMgr_SLAVEVIRT,
- .isMapped = TRUE,
- .refCount = 0u /* refCount set to 0 for static entry */
- },
-};
-
-static ProcMgr_AddrInfo AddrTable_IPU2[AddrTable_SIZE] =
-{
- /* L2 RAM */
- {
- .addr[ProcMgr_AddrType_MasterKnlVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterUsrVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterPhys] = 0x55020000u,
- .addr[ProcMgr_AddrType_SlaveVirt] = 0x20000000u,
- .addr[ProcMgr_AddrType_SlavePhys] = -1u,
- .size = 0x10000u,
- .isCached = FALSE,
- .mapMask = ProcMgr_SLAVEVIRT,
- .isMapped = TRUE,
- .refCount = 0u /* refCount set to 0 for static entry */
- },
-};
+static ProcMgr_AddrInfo AddrTable_IPU1[AddrTable_SIZE];
+static ProcMgr_AddrInfo AddrTable_IPU2[AddrTable_SIZE];
static ProcMgr_AddrInfo * AddrTable[NUM_IPUS] =
{
.isSetup = FALSE,
.configSize = sizeof(VAYUIPUCORE0PROC_Config),
.gateHandle = NULL,
- .defInstParams.numMemEntries = AddrTable_STATIC_COUNT,
+ .defInstParams.numMemEntries = 0,
};
/* config override specified in SysLinkCfg.c, defined in ProcMgr.c */
/*
* initialize refCount for all entries
- * both static and dynamic
*/
for (i = 0; i < AddrTable_SIZE; i++) {
AddrTable[PROCID_TO_IPU(procId)][i].refCount = 0u;
#endif
/* delete all dynamically added entries */
- for (i = AddrTable_STATIC_COUNT; i <
+ for (i = 0; i <
AddrTable_count[PROCID_TO_IPU(procHandle->procId)]; i++) {
ai = &AddrTable[PROCID_TO_IPU(procHandle->procId)][i];
ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
ai->isMapped = FALSE;
ai->refCount = 0u;
}
- object->params.numMemEntries = AddrTable_STATIC_COUNT;
- AddrTable_count[PROCID_TO_IPU(procHandle->procId)] =
- AddrTable_STATIC_COUNT;
+ object->params.numMemEntries = 0;
+ AddrTable_count[PROCID_TO_IPU(procHandle->procId)] = 0;
//No need to reset.. that will be done in STOP
/*tmpStatus = VAYUIPUCORE0_halResetCtrl(object->halObject,
UInt32 i;
UInt32 j;
ProcMgr_AddrInfo * ai = NULL;
- VAYUIPU_HalMmuCtrlArgs_AddEntry addEntryArgs;
GT_4trace(curTrace, GT_ENTER, "VAYUIPUCORE0PROC_map:",
handle, *dstAddr, nSegs, sglist);
* is required. Add the entry only if the range does not exist
* in the translation table.
*/
-
- /* check in static entries first */
- for (j = 0; j < AddrTable_STATIC_COUNT; j++) {
+ for (j = 0;
+ j < AddrTable_count[PROCID_TO_IPU(procHandle->procId)]; j++) {
ai = &AddrTable[PROCID_TO_IPU(procHandle->procId)][j];
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)) {
- found = TRUE;
- /* refCount does not need to be incremented for static entries */
- break;
- }
- }
+ if (ai->isMapped == TRUE) {
+ startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
+ endAddr = startAddr + ai->size;
- /* if not found in static entries, check in dynamic entries */
- if (!found) {
- 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];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)
- && ((*dstAddr + sglist[i].size) <= endAddr)) {
- found = TRUE;
- ai->refCount++;
- break;
- }
+ if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)
+ && ((*dstAddr + sglist[i].size) <= endAddr)) {
+ found = TRUE;
+ ai->refCount++;
+ break;
}
}
}
ai->size = sglist[i].size;
ai->isCached = sglist[i].isCached;
ai->refCount++;
+ ai->isMapped = TRUE;
AddrTable_count[PROCID_TO_IPU(procHandle->procId)]++;
}
"AddrTable_SIZE reached!");
}
}
-
- /* if new entry, map into dsp mmu */
- if ((ai != NULL) && (ai->refCount == 1) && (status >= 0)) {
- ai->isMapped = TRUE;
-
- /* add entry to L2 MMU */
- addEntryArgs.masterPhyAddr = sglist [i].paddr;
- addEntryArgs.size = sglist [i].size;
- addEntryArgs.slaveVirtAddr = (UInt32)*dstAddr;
- /* TBD: elementSize, endianism, mixedSized are
- * hard coded now, must be configurable later
- */
- addEntryArgs.elementSize = ELEM_SIZE_16BIT;
- addEntryArgs.endianism = LITTLE_ENDIAN;
- addEntryArgs.mixedSize = MMU_TLBES;
-
- status = VAYUIPU_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_AddEntry, &addEntryArgs);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "VAYUIPUCORE0PROC_map", status,
- "Processor_MmuCtrlCmd_AddEntry failed");
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "VAYUIPUCORE0PROC_map", status,
- "IPUCORE0 MMU configuration failed");
- }
-#endif
}
#if !defined(SYSLINK_BUILD_OPTIMIZE)
}
object = (VAYUIPUCORE0PROC_Object *) procHandle->object;
GT_assert (curTrace, (object != NULL));
- /* Delete dynamically added non-default entries from translation
+ /* Delete added entries from translation
* table only in last unmap called on that entry
*/
- for (i = AddrTable_STATIC_COUNT;
+ for (i = 0;
i < AddrTable_count[PROCID_TO_IPU(procHandle->procId)]; i++) {
ai = &AddrTable[PROCID_TO_IPU(procHandle->procId)][i];
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 9cc0046a724813253903787b197893ba3157c5d3..9a67d1823c4b97dbb26d8f3eb8330211025bd658 100644 (file)
* =============================================================================
*/
-/*!
- * @brief Number of static entries in address translation table.
- */
-#define AddrTable_STATIC_COUNT 1
-
/*!
* @brief Max entries in address translation table.
*/
/* Memory region counters */
static UInt32 AddrTable_count[NUM_IPUS] = {
- AddrTable_STATIC_COUNT,
- AddrTable_STATIC_COUNT,
+ 0,
+ 0,
};
-/* static memory regions
- * CAUTION: AddrTable_STATIC_COUNT must match number of entries below.
- */
-static ProcMgr_AddrInfo AddrTable_IPU1[AddrTable_SIZE] =
-{
- /* L2 RAM */
- {
- .addr[ProcMgr_AddrType_MasterKnlVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterUsrVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterPhys] = 0x55020000u,
- .addr[ProcMgr_AddrType_SlaveVirt] = 0x20000000u,
- .addr[ProcMgr_AddrType_SlavePhys] = -1u,
- .size = 0x10000u,
- .isCached = FALSE,
- .mapMask = ProcMgr_SLAVEVIRT,
- .isMapped = TRUE,
- .refCount = 0u /* refCount set to 0 for static entry */
- },
-};
-
-static ProcMgr_AddrInfo AddrTable_IPU2[AddrTable_SIZE] =
-{
- /* L2 RAM */
- {
- .addr[ProcMgr_AddrType_MasterKnlVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterUsrVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterPhys] = 0x55020000u,
- .addr[ProcMgr_AddrType_SlaveVirt] = 0x20000000u,
- .addr[ProcMgr_AddrType_SlavePhys] = -1u,
- .size = 0x10000u,
- .isCached = FALSE,
- .mapMask = ProcMgr_SLAVEVIRT,
- .isMapped = TRUE,
- .refCount = 0u /* refCount set to 0 for static entry */
- },
-};
+/* Address translation table */
+static ProcMgr_AddrInfo AddrTable_IPU1[AddrTable_SIZE];
+static ProcMgr_AddrInfo AddrTable_IPU2[AddrTable_SIZE];
static ProcMgr_AddrInfo * AddrTable[NUM_IPUS] =
{
.isSetup = FALSE,
.configSize = sizeof (VAYUIPUCORE1PROC_Config),
.gateHandle = NULL,
- .defInstParams.numMemEntries = AddrTable_STATIC_COUNT,
+ .defInstParams.numMemEntries = 0,
};
/* config override specified in SysLinkCfg.c, defined in ProcMgr.c */
/*
* initialize refCount for all entries
- * both static and dynamic
*/
for (i = 0; i < AddrTable_SIZE; i++) {
AddrTable[PROCID_TO_IPU(procId)][i].refCount = 0u;
#endif
/* delete all dynamically added entries */
- for (i = AddrTable_STATIC_COUNT; i <
+ for (i = 0; i <
AddrTable_count[PROCID_TO_IPU(procHandle->procId)]; i++) {
ai = &AddrTable[PROCID_TO_IPU(procHandle->procId)][i];
ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
ai->isMapped = FALSE;
ai->refCount = 0u;
}
- object->params.numMemEntries = AddrTable_STATIC_COUNT;
- AddrTable_count[PROCID_TO_IPU(procHandle->procId)] =
- AddrTable_STATIC_COUNT;
+ object->params.numMemEntries = 0;
+ AddrTable_count[PROCID_TO_IPU(procHandle->procId)] = 0;
//No need to reset.. that will be done in STOP
/*tmpStatus = VAYUIPUCORE1_halResetCtrl(object->halObject,
UInt32 i;
UInt32 j;
ProcMgr_AddrInfo * ai = NULL;
- VAYUIPU_HalMmuCtrlArgs_AddEntry addEntryArgs;
GT_4trace(curTrace, GT_ENTER, "VAYUIPUCORE1PROC_map:",
handle, *dstAddr, nSegs, sglist);
* is required. Add the entry only if the range does not exist
* in the translation table.
*/
-
- /* check in static entries first */
- for (j = 0; j < AddrTable_STATIC_COUNT; j++) {
+ for (j = 0;
+ j < AddrTable_count[PROCID_TO_IPU(procHandle->procId)]; j++) {
ai = &AddrTable[PROCID_TO_IPU(procHandle->procId)][j];
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)) {
- found = TRUE;
- /* refCount does not need to be incremented for static entries */
- break;
- }
- }
+ if (ai->isMapped == TRUE) {
+ startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
+ endAddr = startAddr + ai->size;
- /* if not found in static entries, check in dynamic entries */
- if (!found) {
- 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];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)
- && ((*dstAddr + sglist[i].size) <= endAddr)) {
- found = TRUE;
- ai->refCount++;
- break;
- }
+ if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)
+ && ((*dstAddr + sglist[i].size) <= endAddr)) {
+ found = TRUE;
+ ai->refCount++;
+ break;
}
}
}
ai->size = sglist[i].size;
ai->isCached = sglist[i].isCached;
ai->refCount++;
+ ai->isMapped = TRUE;
AddrTable_count[PROCID_TO_IPU(procHandle->procId)]++;
}
"AddrTable_SIZE reached!");
}
}
-
- /* if new entry, map into dsp mmu */
- if ((ai != NULL) && (ai->refCount == 1) && (status >= 0)) {
- ai->isMapped = TRUE;
-
- /* add entry to L2 MMU */
- addEntryArgs.masterPhyAddr = sglist [i].paddr;
- addEntryArgs.size = sglist [i].size;
- addEntryArgs.slaveVirtAddr = (UInt32)*dstAddr;
- /* TBD: elementSize, endianism, mixedSized are
- * hard coded now, must be configurable later
- */
- addEntryArgs.elementSize = ELEM_SIZE_16BIT;
- addEntryArgs.endianism = LITTLE_ENDIAN;
- addEntryArgs.mixedSize = MMU_TLBES;
-
- status = VAYUIPU_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_AddEntry, &addEntryArgs);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "VAYUIPUCORE1PROC_map", status,
- "Processor_MmuCtrlCmd_AddEntry failed");
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "VAYUIPUCORE1PROC_map", status,
- "IPUCORE1 MMU configuration failed");
- }
-#endif
}
#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
}
object = (VAYUIPUCORE1PROC_Object *) procHandle->object;
GT_assert (curTrace, (object != NULL));
- /* Delete dynamically added non-default entries from translation
+ /* Delete entries from translation
* table only in last unmap called on that entry
*/
- for (i = AddrTable_STATIC_COUNT;
+ for (i = 0;
i < AddrTable_count[PROCID_TO_IPU(procHandle->procId)]; i++) {
ai = &AddrTable[PROCID_TO_IPU(procHandle->procId)][i];
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 1c2cb7d411628ceb9233bb27a2f0d7f3d73130f2..a8aaf884bea466ced0fca26f143b77f97b5bad7c 100644 (file)
#define IS_RANGE_VALID(x,min,max) (((x) < (max)) && ((x) >= (min)))
-/*!
- * @brief Number of static entries in address translation table.
- */
-#define AddrTable_IPU_STATIC_COUNT 1
-#define AddrTable_DSP_STATIC_COUNT 0
-
/*!
* @brief max entries in translation table.
*/
}OMAP5430TESLAPROC_ModuleObject;
-/* Default memory regions */
-static UInt32 AddrTable_IPU_count = AddrTable_IPU_STATIC_COUNT;
-static UInt32 AddrTable_DSP_count = AddrTable_DSP_STATIC_COUNT;
+/* Number of memory regions */
+static UInt32 AddrTable_IPU_count = 0;
+static UInt32 AddrTable_DSP_count = 0;
-/* Default memory regions */
-static ProcMgr_AddrInfo OMAP5430BENELLIPROC_defaultMemRegions [AddrTable_SIZE] =
-{
- /* L2 RAM */
- {
- .addr[ProcMgr_AddrType_MasterKnlVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterUsrVirt] = -1u,
- .addr[ProcMgr_AddrType_MasterPhys] = 0x55020000u,
- .addr[ProcMgr_AddrType_SlaveVirt] = 0x20000000u,
- .addr[ProcMgr_AddrType_SlavePhys] = -1u,
- .size = 0x10000u,
- .isCached = FALSE,
- .mapMask = ProcMgr_SLAVEVIRT,
- .isMapped = TRUE,
- .refCount = 0u /* refCount set to 0 for static entry */
- },
-};
+/* Address translation table for IPU */
+static ProcMgr_AddrInfo OMAP5430BENELLIPROC_addrTable[AddrTable_SIZE];
-/* Default memory regions for DSP */
-static ProcMgr_AddrInfo OMAP5430TESLAPROC_defaultMemRegions [AddrTable_SIZE] =
-{
-};
+/* Address translation table for DSP */
+static ProcMgr_AddrInfo OMAP5430TESLAPROC_addrTable[AddrTable_SIZE];
/* =============================================================================
* Globals
OMAP5430BENELLIPROC_ModuleObject OMAP5430IPU0PROC_state =
{
.config_size = sizeof (OMAP5430BENELLIPROC_Config),
- .defInstParams.numMemEntries = AddrTable_IPU_STATIC_COUNT,
+ .defInstParams.numMemEntries = 0,
.isSetup = FALSE,
.procHandle = NULL,
.gateHandle = NULL
OMAP5430BENELLIPROC_ModuleObject OMAP5430IPU1PROC_state =
{
.config_size = sizeof (OMAP5430BENELLIPROC_Config),
- .defInstParams.numMemEntries = AddrTable_IPU_STATIC_COUNT,
+ .defInstParams.numMemEntries = 0,
.isSetup = FALSE,
.procHandle = NULL,
.gateHandle = NULL
OMAP5430TESLAPROC_ModuleObject OMAP5430DSPPROC_state =
{
.config_size = sizeof (OMAP5430TESLAPROC_Config),
- .defInstParams.numMemEntries = AddrTable_DSP_STATIC_COUNT,
+ .defInstParams.numMemEntries = 0,
.isSetup = FALSE,
.procHandle = NULL,
.gateHandle = NULL
switch(ProcType)
{
case PROCTYPE_IPU0:
- pMemRegn = OMAP5430BENELLIPROC_defaultMemRegions;
+ pMemRegn = OMAP5430BENELLIPROC_addrTable;
numMemEntries = AddrTable_IPU_count;
break;
#ifndef SYSLINK_SYSBIOS_SMP
case PROCTYPE_IPU1:
- pMemRegn = OMAP5430BENELLIPROC_defaultMemRegions;
+ pMemRegn = OMAP5430BENELLIPROC_addrTable;
numMemEntries = AddrTable_IPU_count;
break;
#endif
case PROCTYPE_DSP:
- pMemRegn = OMAP5430TESLAPROC_defaultMemRegions;
+ pMemRegn = OMAP5430TESLAPROC_addrTable;
numMemEntries = AddrTable_DSP_count;
break;
}
{
case PROCTYPE_IPU0:
pState = &OMAP5430IPU0PROC_state;
- pMemRegn = OMAP5430BENELLIPROC_defaultMemRegions;
+ pMemRegn = OMAP5430BENELLIPROC_addrTable;
AddrTable_count = &AddrTable_IPU_count;
break;
#ifndef SYSLINK_SYSBIOS_SMP
case PROCTYPE_IPU1:
pState = &OMAP5430IPU1PROC_state;
- pMemRegn = OMAP5430BENELLIPROC_defaultMemRegions;
+ pMemRegn = OMAP5430BENELLIPROC_addrTable;
AddrTable_count = &AddrTable_IPU_count;
break;
#endif
case PROCTYPE_DSP:
pState = (OMAP5430BENELLIPROC_ModuleObject *)&OMAP5430DSPPROC_state;
- pMemRegn = OMAP5430TESLAPROC_defaultMemRegions;
+ pMemRegn = OMAP5430TESLAPROC_addrTable;
AddrTable_count = &AddrTable_DSP_count;
break;
}
Int i = 0;
ProcMgr_AddrInfo * ai;
ProcMgr_AddrInfo * pMemRegn = NULL;
- UInt32 staticCount = 0;
UInt32 * AddrTable_count = NULL;
GT_1trace (curTrace, GT_ENTER, "OMAP5430BENELLIPROC_detach", handle);
switch(procHandle->procId)
{
case PROCTYPE_IPU0:
- pMemRegn = OMAP5430BENELLIPROC_defaultMemRegions;
- staticCount = AddrTable_IPU_STATIC_COUNT;
+ pMemRegn = OMAP5430BENELLIPROC_addrTable;
AddrTable_count = &AddrTable_IPU_count;
break;
#ifndef SYSLINK_SYSBIOS_SMP
case PROCTYPE_IPU1:
- pMemRegn = OMAP5430BENELLIPROC_defaultMemRegions;
- staticCount = AddrTable_IPU_STATIC_COUNT;
+ pMemRegn = OMAP5430BENELLIPROC_addrTable;
AddrTable_count = &AddrTable_IPU_count;
break;
#endif
case PROCTYPE_DSP:
- pMemRegn = OMAP5430TESLAPROC_defaultMemRegions;
- staticCount = AddrTable_DSP_STATIC_COUNT;
+ pMemRegn = OMAP5430TESLAPROC_addrTable;
AddrTable_count = &AddrTable_DSP_count;
break;
}
}
/* delete all dynamically added entries */
- for (i = staticCount; i < *AddrTable_count; i++) {
+ for (i = 0; i < *AddrTable_count; i++) {
ai = &pMemRegn[i];
ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
ai->isMapped = FALSE;
ai->refCount = 0u;
}
- object->params.numMemEntries = staticCount;
- *AddrTable_count = staticCount;
+ object->params.numMemEntries = 0;
+ *AddrTable_count = 0;
//No need to reset.. that will be done in STOP
/* tmpStatus = OMAP5430BENELLI_halResetCtrl (object->halObject,
object = (OMAP5430BENELLIPROC_Object *) procHandle->object;
GT_assert (curTrace, (object != NULL));
- pMemRegn = object->params.memEntries;
- nRegions = object->params.numMemEntries;
+ switch(procHandle->procId)
+ {
+ case PROCTYPE_IPU0:
+ pMemRegn = OMAP5430BENELLIPROC_addrTable;
+ nRegions = AddrTable_IPU_count;
+ break;
+#ifndef SYSLINK_SYSBIOS_SMP
+ case PROCTYPE_IPU1:
+ pMemRegn = OMAP5430BENELLIPROC_addrTable;
+ nRegions = AddrTable_IPU_count;
+ break;
+#endif
+ case PROCTYPE_DSP:
+ pMemRegn = OMAP5430TESLAPROC_addrTable;
+ nRegions = AddrTable_DSP_count;
+ break;
+ }
+
*dstAddr = -1u;
for (i = 0;i < nRegions;i++)
Int status = PROCESSOR_SUCCESS ;
Processor_Object * procHandle = (Processor_Object *) handle;
OMAP5430BENELLIPROC_Object * object = NULL;
- UInt32 i;
- OMAP5430BENELLI_HalMmuCtrlArgs_AddEntry addEntryArgs;
+ UInt32 i, j;
+ UInt32 startAddr;
+ UInt32 endAddr;
+ Bool found = FALSE;
+ ProcMgr_AddrInfo * pMemRegn = NULL;
+ UInt32 * pNumRegions = NULL;
+ ProcMgr_AddrInfo * ai = NULL;
GT_4trace (curTrace, GT_ENTER, "OMAP5430BENELLIPROC_map",
handle, dstAddr, nSegs, sglist);
#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
object = (OMAP5430BENELLIPROC_Object *) procHandle->object;
GT_assert (curTrace, (object != NULL));
+
+ switch(procHandle->procId)
+ {
+ case PROCTYPE_IPU0:
+ pMemRegn = OMAP5430BENELLIPROC_addrTable;
+ pNumRegions = &AddrTable_IPU_count;
+ break;
+#ifndef SYSLINK_SYSBIOS_SMP
+ case PROCTYPE_IPU1:
+ pMemRegn = OMAP5430BENELLIPROC_addrTable;
+ pNumRegions = &ddrTable_IPU_count;
+ break;
+#endif
+ case PROCTYPE_DSP:
+ pMemRegn = OMAP5430TESLAPROC_addrTable;
+ pNumRegions = &AddrTable_DSP_count;
+ break;
+ }
+
/* Program the mmu with the sglist */
/* Program the DSP MMU also */
for (i = 0; (i < nSegs) && (status >= 0); i++)
{
- addEntryArgs.masterPhyAddr = sglist [i].paddr;
- addEntryArgs.size = sglist [i].size;
- addEntryArgs.slaveVirtAddr = (UInt32)*dstAddr;
- /*TBD : elementSize, endianism, mixedSized are hard coded now,
- * must be configurable later*/
- addEntryArgs.elementSize = ELEM_SIZE_16BIT;
- addEntryArgs.endianism = LITTLE_ENDIAN;
- addEntryArgs.mixedSize = MMU_TLBES;
- addEntryArgs.slaveVirtAddr = get_BenelliVirtAdd(object->halObject,
- addEntryArgs.masterPhyAddr);
- *(dstAddr) = addEntryArgs.slaveVirtAddr;
- if(addEntryArgs.slaveVirtAddr == 0) {
- status = OMAP5430BENELLI_halMmuCtrl (object->halObject,
- Processor_MmuCtrlCmd_AddEntry,
- &addEntryArgs);
-
+ /* Update the translation table with entries for which mapping
+ * is required. Add the entry only if the range does not exist
+ * in the translation table.
+ */
+ for (j = 0;
+ j < *pNumRegions; j++) {
+ ai = &pMemRegn[j];
+
+ if (ai->isMapped == TRUE) {
+ startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
+ endAddr = startAddr + ai->size;
+
+ if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)
+ && ((*dstAddr + sglist[i].size) <= endAddr)) {
+ found = TRUE;
+ ai->refCount++;
+ break;
+ }
+ }
}
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "OMAP5430BENELLIPROC_map",
- status,
- "DSP MMU configuration failed");
+
+ /* If not found, add new entry to table. If mmu is disabled,
+ * the assumption is that the ammu will be used.
+ */
+ if (!found) {
+ if (*pNumRegions != AddrTable_SIZE) {
+ ai = &pMemRegn[*pNumRegions];
+ ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
+ ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
+ ai->addr[ProcMgr_AddrType_MasterPhys] = sglist[i].paddr;
+ ai->addr[ProcMgr_AddrType_SlaveVirt] = *dstAddr;
+ ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
+ ai->size = sglist[i].size;
+ ai->isCached = sglist[i].isCached;
+ ai->refCount++;
+ ai->isMapped = TRUE;
+
+ (*pNumRegions)++;
+ }
+ else {
+ status = PROCESSOR_E_FAIL;
+ GT_setFailureReason(curTrace, GT_4CLASS,
+ "OMAP5430BENELLIPROC_map", status,
+ "AddrTable_SIZE reached!");
+ }
}
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
+
+ *(dstAddr) = get_BenelliVirtAdd(object->halObject,
+ sglist[i].paddr);
}
#if !defined(SYSLINK_BUILD_OPTIMIZE)
}
diff --git a/qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c b/qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c
index d805116b546a1860f8b04353a81435434f2a347c..ba812c2867495ac564d7f2d2ace9cb1bdf9d8263 100644 (file)
printf ("RscTable_process: carveout [%s] @ da [0x%08x] pa [0x%08x] len [0x%x]\n", cout->name, cout->da, cout->pa, cout->len);
break;
}
+ case TYPE_INTMEM :
+ {
+ struct fw_rsc_carveout * cout = (struct fw_rsc_carveout *)entry;
+
+ if (obj->numMemEntries == SYSLINK_MAX_MEMENTRIES) {
+ ret = -1;
+ }
+ else {
+ obj->memEntries[obj->numMemEntries].slaveVirtAddr =
+ cout->da;
+ obj->memEntries[obj->numMemEntries].masterPhysAddr =
+ cout->pa;
+ obj->memEntries[obj->numMemEntries].size = cout->len;
+ /* do not map to slave MMU */
+ obj->memEntries[obj->numMemEntries].map = FALSE;
+ obj->memEntries[obj->numMemEntries].mapMask =
+ ProcMgr_SLAVEVIRT;
+ obj->memEntries[obj->numMemEntries].isCached = FALSE;
+ obj->memEntries[obj->numMemEntries].isValid = TRUE;
+ obj->numMemEntries++;
+ }
+ printf ("RscTable_process: intmem [%s] @ da [0x%08x]"
+ " pa [0x%08x] len [0x%x]\n", cout->name, cout->da,
+ cout->pa, cout->len);
+ break;
+ }
case TYPE_DEVMEM :
{
// only care about mem in DDR for now
}
break;
}
- case TYPE_CRASHDUMP :
- // what to do with this?
- break;
default :
break;
}
diff --git a/qnx/src/ipc3x_dev/ti/syslink/resources/rsc_types.h b/qnx/src/ipc3x_dev/ti/syslink/resources/rsc_types.h
index b8b9e2e7be93707feb148b130aeb30d284a131bc..1e32a27e9554f024e51920aa4e5e19e638498db9 100644 (file)
/*
- * Copyright (c) 2011-2012, Texas Instruments Incorporated
+ * Copyright (c) 2011-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#define TYPE_DEVMEM 1
#define TYPE_TRACE 2
#define TYPE_VDEV 3
-#define TYPE_CRASHDUMP 4
+#define TYPE_INTMEM 4
/* Common Resource Structure Types */
struct fw_rsc_carveout {