summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 44e2ca3)
raw | patch | inline | side by side (parent: 44e2ca3)
author | Ramsey Harris <ramsey@ti.com> | |
Thu, 23 Apr 2015 22:23:25 +0000 (15:23 -0700) | ||
committer | Robert Tivy <rtivy@ti.com> | |
Fri, 24 Apr 2015 20:38:29 +0000 (13:38 -0700) |
On Keystone 2, when loading DSP processors in ad hoc order,
the VirtIO channel assignment is non-deterministic. This
requires a run-time way to update the mapping of processor
to VirtIO channel. When the VirtIO channel assignment becomes
invariant, this new API will be removed.
the VirtIO channel assignment is non-deterministic. This
requires a run-time way to update the mapping of processor
to VirtIO channel. When the VirtIO channel assignment becomes
invariant, this new API will be removed.
diff --git a/linux/include/_lad.h b/linux/include/_lad.h
index b21cec1443672a0cd208537c5972d66b833c72f5..3cffe83a52c14991a06dd9b244c4a68d645694f0 100644 (file)
--- a/linux/include/_lad.h
+++ b/linux/include/_lad.h
typedef enum {
LAD_CONNECT = 0,
LAD_DISCONNECT,
+ LAD_RPROC_SETID,
LAD_IPC_GETCONFIG,
LAD_NAMESERVER_SETUP,
LAD_NAMESERVER_DESTROY,
Char name[LAD_MAXLENGTHFIFONAME];
Char protocol[LAD_MAXLENGTHPROTOVERS];
} connect;
+ struct {
+ Int procId;
+ Int rprocId;
+ } rprocSetId;
struct {
Char name[LAD_MAXENTRYNAMELEN];
NameServer_Params params;
index 0a8435f1d1bacf67e4406ef911fe5746ac634137..015955abed9fac4f6f3d631ebdc2da0fbb40147c 100644 (file)
return;
}
+
+/*
+ * ======== MultiProc_rprocSetId ========
+ */
+Int MultiProc_rprocSetId(UInt16 procId, UInt rprocId)
+{
+ Int status;
+ LAD_ClientHandle handle;
+ struct LAD_CommandObj cmd;
+ union LAD_ResponseObj rsp;
+ UInt16 clusterId;
+
+
+ handle = LAD_findHandle();
+
+ if (handle == LAD_MAXNUMCLIENTS) {
+ PRINTVERBOSE1("MultiProc_rprocSetId: can't find connection to daemon "
+ "for pid %d\n", getpid())
+ return (-1);
+ }
+
+ cmd.cmd = LAD_RPROC_SETID;
+ cmd.clientId = handle;
+ cmd.args.rprocSetId.procId = procId;
+ cmd.args.rprocSetId.rprocId = rprocId;
+
+ if ((status = LAD_putCommand(&cmd)) != LAD_SUCCESS) {
+ PRINTVERBOSE1("MultiProc_rprocSetId: sending LAD command failed, "
+ "status=%d\n", status)
+ return (status);
+ }
+
+ if ((status = LAD_getResponse(handle, &rsp)) != LAD_SUCCESS) {
+ PRINTVERBOSE1("MultiProc_rprocSetId: no LAD response, status=%d\n",
+ status)
+ return (status);
+ }
+ status = rsp.status;
+
+ PRINTVERBOSE2("MultiProc_rprocSetId: got LAD response for client %d, "
+ "status=%d\n", handle, status)
+
+ /* update configuration in api state */
+ clusterId = procId - _MultiProc_cfg.baseIdOfCluster;
+ _MultiProc_cfg.rprocList[clusterId] = rprocId;
+
+ return (status);
+}
index a551a4d3480f1094c42ed51c63fa466cbef1c078..6570996c3760c2b4a5e95dbd3df686ec7ecb594b 100644 (file)
LOG2("\tProcId %d - \"%s\"\n", baseId + i, _MultiProc_cfg.nameList[i]);
}
}
+
+/*
+ * ======== MultiProc_rprocSetId ========
+ */
+Int MultiProc_rprocSetId(UInt16 procId, UInt rprocId)
+{
+ UInt16 clusterId;
+
+
+ if (procId >= _MultiProc_cfg.numProcessors) {
+ return (MultiProc_E_INVALIDARG);
+ }
+
+ if (rprocId >= _MultiProc_cfg.numProcsInCluster) {
+ return (MultiProc_E_INVALIDARG);
+ }
+
+ clusterId = procId - _MultiProc_cfg.baseIdOfCluster;
+ _MultiProc_cfg.rprocList[clusterId] = rprocId;
+ LOG2("MultiProc_rprocSetId: clusterId=%d, rprocId=%d\n", clusterId,
+ _MultiProc_cfg.rprocList[clusterId]);
+
+ return (MultiProc_S_SUCCESS);
+}
diff --git a/linux/src/daemon/lad.c b/linux/src/daemon/lad.c
index 2bff2aced0dd04e6d77707b170a309c17ef7890a..87b326061a1dc2c1ba22efa53d88dcc09411dc97 100644 (file)
--- a/linux/src/daemon/lad.c
+++ b/linux/src/daemon/lad.c
break;
+ case LAD_RPROC_SETID:
+ rsp.status = MultiProc_rprocSetId(cmd.args.rprocSetId.procId,
+ cmd.args.rprocSetId.rprocId);
+ break;
+
case LAD_IPC_GETCONFIG:
Ipc_getConfig(&rsp.ipcConfig);
break;
case LAD_DISCONNECT:
break;
+ case LAD_RPROC_SETID:
case LAD_IPC_GETCONFIG:
case LAD_NAMESERVER_SETUP:
case LAD_NAMESERVER_DESTROY:
index 951b52e6cd5092921c9a8cc4c5900a8b2813ea19..8d4659f36e632e38d1f8cc4cef25ce2c229a99db 100644 (file)
*/
Int MultiProc_setBaseIdOfCluster(UInt16 id);
+/*
+ * ======== MultiProc_rprocSetId ========
+ * Update processor ID mapping at run-time
+ *
+ * Internal use only. This function is temporary and will be
+ * removed in a future build.
+ *
+ * When using remoteproc to load a DSP processor, the VirtIO channel
+ * ID is non-deterministic. This function is part of a larger hack to
+ * update the mapping from ProcID to VirtIO Channel ID each time a DSP
+ * is loaded.
+ */
+Int MultiProc_rprocSetId(UInt16 procId, UInt rprocId);
+
#if defined (__cplusplus)
}
#endif /* defined (__cplusplus) */