index e8cd70af2c6e537c2629eef9b7ae608182aeec68..a7567d1685d895961c9138ba2e92c6451442fb98 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
/*
* ======== IpcMgr.c ========
+ * Various IPC stack backplane startup fxns.
*/
#include <xdc/std.h>
#include <ti/ipc/Ipc.h>
#include <ti/ipc/MultiProc.h>
#include <ti/ipc/namesrv/NameServerRemoteRpmsg.h>
-#include <ti/ipc/transports/TransportVirtioSetup.h>
+#include <ti/ipc/transports/TransportRpmsgSetup.h>
+#include <ti/ipc/rpmsg/_RPMessage.h>
+
+#ifdef IpcMgr_USEDEH
+#include <ti/deh/Watchdog.h>
+#ifdef IpcMgr_DSP
+#include <ti/sysbios/family/c64p/Exception.h>
+#elif IpcMgr_IPU
+#include <ti/sysbios/family/arm/m3/Hwi.h>
+#endif
+#endif
+
+#include "IpcMgr.h"
+
+
+/*
+ * ======== IpcMgr_rpmsgStartup ========
+ * Initialize the RPMSG module. This calls VirtQueue_startup().
+ *
+ * Use for stacks built on RPMessage only.
+ */
+Void IpcMgr_rpmsgStartup(Void)
+{
+ Assert_isTrue(MultiProc_self() != MultiProc_getId("HOST"), 0);
+ RPMessage_init(MultiProc_getId("HOST"));
+
+#ifdef IpcMgr_USEDEH
+ /*
+ * When using DEH, initialize the Watchdog timers if not already done
+ * (i.e. late-attach)
+ */
+#ifdef IpcMgr_DSP
+ Watchdog_init((Void (*)(Void))ti_sysbios_family_c64p_Exception_handler);
+#elif IpcMgr_IPU
+ Watchdog_init(ti_sysbios_family_arm_m3_Hwi_excHandlerAsm__I);
+#endif
+#endif
+}
/*
* ======== IpcMgr_ipcStartup ========
+ * Initialize MessageQ Transport stack built over RPMSG.
+ * This ends up calling RPMessage_init().
+ *
+ * Use for stacks built on MessageQ/TransportRpmsg only.
*/
-Void IpcMgr_ipcStartup()
+Void IpcMgr_ipcStartup(Void)
{
UInt procId = MultiProc_getId("HOST");
Int status;
- /* TransportVirtioSetup will busy wait until host kicks ready to recv: */
- status = TransportVirtioSetup_attach(procId, 0);
+ /* TransportRpmsgSetup will busy wait until host kicks ready to recv: */
+ status = TransportRpmsgSetup_attach(procId, 0);
Assert_isTrue(status >= 0, NULL);
- /* Sets up to comminicate with host's NameServer: */
+ /* Sets up to communicate with host's NameServer: */
status = NameServerRemoteRpmsg_attach(procId, 0);
Assert_isTrue(status >= 0, NULL);
+
+#ifdef IpcMgr_USEDEH
+ /*
+ * When using DEH, initialize the Watchdog timers if not already done
+ * (i.e. late-attach)
+ */
+#ifdef IpcMgr_DSP
+ Watchdog_init((Void (*)(Void))ti_sysbios_family_c64p_Exception_handler);
+#elif IpcMgr_IPU
+ Watchdog_init(ti_sysbios_family_arm_m3_Hwi_excHandlerAsm__I);
+#endif
+#endif
}
/*
* ======== IpcMgr_callIpcStart ========
- * Calls the Ipc_start command. This must be done
- * after IpcMgr_ipcStartup().
+ * Initialize standard IPC module, which may use the RPMSG protocol as well.
+ *
+ * Calls the Ipc_start command. This must be done after IpcMgr_ipcStartup().
+ *
+ * Use for stacks using a combination of TransportRpmsg and other Transports.
*/
Void IpcMgr_callIpcStart()
{