]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - qnx/src/ipc3x_dev/ti/syslink/family/omap5430/Platform.c
Add support for loading to IPU internal memory on QNX OMAP5
[ipc/ipcdev.git] / qnx / src / ipc3x_dev / ti / syslink / family / omap5430 / Platform.c
index 9af6aa2ee05c8f22815f5db54bce3be440f6156c..9bcd6ee85bab40183f8133b952cf0fbe53c79222 100644 (file)
@@ -3,12 +3,9 @@
  *
  *  @brief      Implementation of Platform initialization logic.
  *
- *
- *  @ver        02.00.00.46_alpha1
- *
  *  ============================================================================
  *
- *  Copyright (c) 2010-2011, Texas Instruments Incorporated
+ *  Copyright (c) 2010-2013, Texas Instruments Incorporated
  *
  *  Redistribution and use in source and binary forms, with or without
  *  modification, are permitted provided that the following conditions
@@ -82,6 +79,7 @@
 
 #include <ti/ipc/Ipc.h>
 #include <_Ipc.h>
+#include <_MultiProc.h>
 #include <IpcKnl.h>
 #include <ipu_pm.h>
 #include <GateHWSpinlock.h>
@@ -106,6 +104,12 @@ extern "C" {
 #define HWSPINLOCK_SIZE             0x1000
 #define HWSPINLOCK_OFFSET           0x800
 
+#ifndef SYSLINK_SYSBIOS_SMP
+#define CORE0 "CORE0"
+#else
+#define CORE0 "IPU"
+#endif
+
 /** ============================================================================
  *  Application specific configuration, please change these value according to
  *  your application's need.
@@ -238,9 +242,15 @@ extern unsigned int syslink_dsp_mem_size;
 
 /*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;";
@@ -369,41 +379,20 @@ Platform_overrideConfig (Platform_Config * config, Ipc_Config * cfg)
 
         _ProcMgr_saveParams(cfg->params, String_len(cfg->params));
 
-#ifdef SYSLINK_SYSBIOS_SMP
-        /* Override the gatepeterson default config */
-        config->multiProcConfig.numProcessors = 3;
-        config->multiProcConfig.id            = 0;
-
-        String_cpy (config->multiProcConfig.nameList [0],
-                    "HOST");
-        String_cpy (config->multiProcConfig.nameList [1],
-                    "CORE0");
-        String_cpy (config->multiProcConfig.nameList [2],
-                    "DSP");
-#else
-        /* Override the gatepeterson default config */
-        config->multiProcConfig.numProcessors = 4;
-        config->multiProcConfig.id            = 0;
-
-        String_cpy (config->multiProcConfig.nameList [0],
-                    "HOST");
-        String_cpy (config->multiProcConfig.nameList [1],
-                    "CORE0");
-        String_cpy (config->multiProcConfig.nameList [2],
-                    "CORE1");
-        String_cpy (config->multiProcConfig.nameList [3],
-                    "DSP");
-#endif
+        /* Set the MultiProc config as defined in SystemCfg.c */
+        config->multiProcConfig = _MultiProc_cfg;
 
         /* Override the PROCMGR default config */
 
         /* Override the MessageQCopy default config */
-        config->MQCopyConfig.intId = 58;
+        config->MQCopyConfig.intId[1] = 58;
+        config->MQCopyConfig.intId[2] = 58;
+        config->MQCopyConfig.intId[3] = 58;
 
         config->ipu_pm_config.int_id = 58;
 #ifdef SYSLINK_SYSBIOS_SMP
         config->ipu_pm_config.num_procs = 2;
-        config->ipu_pm_config.proc_ids[0] = 1; // CORE0 is set as 1 above
+        config->ipu_pm_config.proc_ids[0] = 1; // IPU is set as 1 above
         config->ipu_pm_config.proc_ids[1] = 2; // DSP is set as 2 above
 #else
         config->ipu_pm_config.num_procs = 3;
@@ -853,7 +842,7 @@ _Platform_setup (Ipc_Config * cfg)
     GT_0trace (curTrace, GT_ENTER, "_Platform_setup");
 
     /* Get MultiProc ID by name. */
-    procId = MultiProc_getId ("CORE0");
+    procId = MultiProc_getId (CORE0);
 
     handle = &Platform_objects [procId];
 
@@ -871,15 +860,7 @@ _Platform_setup (Ipc_Config * cfg)
         /* Create an instance of the Processor object for
          * OMAP5430 */
         OMAP5430BENELLIPROC_Params_init (NULL, &ipu0ProcParams, procId);
-        pa = cfg->pAddr;
-        va = cfg->vAddr;
-        memEntries = ipu0ProcParams.memEntries;
-        for (i = 0; i < ipu0ProcParams.numMemEntries; i++) {
-            memEntries[i].addr[ProcMgr_AddrType_MasterPhys] = pa;
-            memEntries[i].addr[ProcMgr_AddrType_MasterKnlVirt] = va;
-            pa += memEntries[i].size;
-            va += memEntries[i].size;
-        }
+
         handle->sHandles.ipu0.pHandle = OMAP5430BENELLIPROC_create (
                                                       procId,
                                                       &ipu0ProcParams);
@@ -945,15 +926,7 @@ _Platform_setup (Ipc_Config * cfg)
             /* Create an instance of the Processor object for
              * OMAP5430 */
             OMAP5430BENELLIPROC_Params_init(NULL, &ipu1ProcParams,procId);
-            pa = cfg->pAddr;
-            va = cfg->vAddr;
-            memEntries = ipu1ProcParams.memEntries;
-            for (i = 0; i < ipu1ProcParams.numMemEntries; i++) {
-                memEntries[i].addr[ProcMgr_AddrType_MasterPhys] = pa;
-                memEntries[i].addr[ProcMgr_AddrType_MasterKnlVirt] = va;
-                pa += memEntries[i].size;
-                va += memEntries[i].size;
-            }
+
             handle->sHandles.ipu1.pHandle = OMAP5430BENELLIPROC_create(procId,
                                                           &ipu1ProcParams);
 
@@ -1008,15 +981,7 @@ _Platform_setup (Ipc_Config * cfg)
             /* Create an instance of the Processor object for
                        * OMAP5430 */
             OMAP5430BENELLIPROC_Params_init (NULL, &dspProcParams, procId);
-            pa = cfg->pAddr_dsp;
-            va = cfg->vAddr_dsp;
-            memEntries = dspProcParams.memEntries;
-            for (i = 0; i < dspProcParams.numMemEntries; i++) {
-                memEntries[i].addr[ProcMgr_AddrType_MasterPhys] = pa;
-                memEntries[i].addr[ProcMgr_AddrType_MasterKnlVirt] = va;
-                pa += memEntries[i].size;
-                va += memEntries[i].size;
-            }
+
             handle->sHandles.dsp.pHandle = OMAP5430BENELLIPROC_create (
                                                           procId,
                                                           &dspProcParams);
@@ -1079,7 +1044,8 @@ _Platform_setup (Ipc_Config * cfg)
             OMAP5430BENELLIPROC_destroy(procId);
 #endif
 
-        procId = MultiProc_getId ("CORE0");
+        procId = MultiProc_getId (CORE0);
+
         handle = &Platform_objects [procId];
         if (handle->pmHandle) {
             ProcMgr_delete(&handle->pmHandle);
@@ -1186,7 +1152,7 @@ _Platform_destroy (void)
 #endif
 
     /* ------------------------- ipu0 cleanup ------------------------------- */
-    handle = &Platform_objects [MultiProc_getId ("CORE0")];
+    handle = &Platform_objects [MultiProc_getId (CORE0)];
     if (handle->pmHandle != NULL) {
         tmpStatus = ProcMgr_delete (&handle->pmHandle);
         GT_assert (curTrace, (tmpStatus >= 0));
@@ -1234,7 +1200,7 @@ _Platform_destroy (void)
         }
     }
 
-    tmpStatus = OMAP5430BENELLIPROC_destroy (MultiProc_getId ("CORE0"));
+    tmpStatus = OMAP5430BENELLIPROC_destroy (MultiProc_getId (CORE0));
     GT_assert (curTrace, (tmpStatus >= 0));
     if ((status >= 0) && (tmpStatus < 0)) {
         status = tmpStatus;