PDK-7626: IPC: Test: Cleanup ex05 test and Make ready for Automation REL.CORESDK.07.02.01.01
authorAngela Stegmaier <angelabaker@ti.com>
Fri, 23 Oct 2020 22:52:10 +0000 (17:52 -0500)
committerSivaraj R <sivaraj@ti.com>
Wed, 16 Dec 2020 07:43:43 +0000 (01:43 -0600)
Cleanup the ex05 test:
- remove Task_sleep between each test
- remove creation of tasks with each test

Also add UART traces so that test can be automated.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
16 files changed:
packages/ti/drv/ipc/examples/common/j7200/linker_r5f_mcu1_0_sysbios.lds
packages/ti/drv/ipc/examples/common/j7200/linker_r5f_mcu1_1_sysbios.lds
packages/ti/drv/ipc/examples/common/j7200/linker_r5f_mcu2_0_sysbios.lds
packages/ti/drv/ipc/examples/common/j7200/linker_r5f_mcu2_1_sysbios.lds
packages/ti/drv/ipc/examples/common/j7200/r5_mpu_ipc.xs
packages/ti/drv/ipc/examples/common/j7200/sysbios_r5f.cfg
packages/ti/drv/ipc/examples/common/j721e/linker_r5f_mcu1_0_sysbios.lds
packages/ti/drv/ipc/examples/common/j721e/linker_r5f_mcu1_1_sysbios.lds
packages/ti/drv/ipc/examples/common/j721e/linker_r5f_mcu2_0_sysbios.lds
packages/ti/drv/ipc/examples/common/j721e/linker_r5f_mcu2_1_sysbios.lds
packages/ti/drv/ipc/examples/common/j721e/linker_r5f_mcu3_0_sysbios.lds
packages/ti/drv/ipc/examples/common/j721e/linker_r5f_mcu3_1_sysbios.lds
packages/ti/drv/ipc/examples/common/j721e/r5_mpu_ipc.xs
packages/ti/drv/ipc/examples/common/j721e/sysbios_r5f.cfg
packages/ti/drv/ipc/examples/ex05_bios_multicore_echo_negative_test/ipc_neg_testsetup.c
packages/ti/drv/ipc/ipc_component.mk

index 52416d32bba2541872faf9c3421c62c420381b4f..795eaee9683be0116ef8d2803ffdaa5e71170a2f 100644 (file)
 #define MCU2_1_R5F_MEM_DATA_BASE (MCU2_1_ALLOCATED_START + 0x00300000)
 #define MCU2_1_DDR_SPACE_BASE    (MCU2_1_ALLOCATED_START + 0x00400000)
 
-#define ATCM_START 0x00000000
-
 -e __VECS_ENTRY_POINT
+--retain="*(.utilsCopyVecsToAtcm)"
 
 /*----------------------------------------------------------------------------*/
 /* Memory Map                                                                 */
 MEMORY
 {
     /* MCU1_R5F_0 local view  */
-    MCU_ATCM (RWX)             : origin=ATCM_START     length=0x8000
     /* MCU1_R5F0_TCMB0 (RWIX)  : origin=0x41010000     length=0x8000 (documented only, to avoid conflict below) */
+    R5F_TCMA_SBL_RSVD(X): ORIGIN = 0x00000000, LENGTH = 0x100
+    RESET_VECTORS(X)    : ORIGIN = 0x41C40000, LENGTH = 0x100
 
     /* MCU1_R5F_0 SoC view  */
     MCU1_R5F0_ATCM (RWIX)      : origin=0x41000000 length=0x8000
@@ -107,19 +107,20 @@ SECTIONS
 {
     .vecs : {
          *(.vecs)
-    } palign(8) > ATCM_START
+    } palign(8) > RESET_VECTORS
     .vecs       : {
         __VECS_ENTRY_POINT = .;
-    } palign(8) > MCU_ATCM
+    } palign(8) > RESET_VECTORS
     .init_text  : {
                      boot.*(.text)
                      *(.text:ti_sysbios_family_arm_MPU_*)
                      *(.text:ti_sysbios_family_arm_v7r_Cache_*)
-                  }  > MCU_ATCM
-    .text:xdc_runtime_Startup_reset__I : {} palign(8) > MCU_ATCM
-    .bootCode          : {} palign(8)          > MCU_ATCM
-    .startupCode       : {} palign(8)          > MCU_ATCM
-    .startupData       : {} palign(8)          > MCU_ATCM, type = NOINIT
+                  }  > MCU1_R5F0_BTCM
+    .text:xdc_runtime_Startup_reset__I : {} palign(8) > MCU1_R5F0_BTCM
+    .utilsCopyVecsToAtcm               : {} palign(8) > MCU1_R5F0_BTCM
+    .bootCode          : {} palign(8)          > MCU1_R5F0_BTCM
+    .startupCode       : {} palign(8)          > MCU1_R5F0_BTCM
+    .startupData       : {} palign(8)          > MCU1_R5F0_BTCM, type = NOINIT
     .text      : {} palign(8)          > MCU1_0_DDR_SPACE
     .const     : {} palign(8)          > MCU1_0_DDR_SPACE
     .cinit     : {} palign(8)          > MCU1_0_DDR_SPACE
index 8e8e8d6da9b7550e740b9ccedb6ab257f73cafa5..b9c67ca870f60484fd1ca7f7446dee80ed6d7103 100644 (file)
@@ -118,6 +118,7 @@ SECTIONS
                   }  > MCU_ATCM
     .text:xdc_runtime_Startup_reset__I : {} palign(8) > MCU_ATCM
     .bootCode          : {} palign(8)          > MCU_ATCM
+    .utilsCopyVecsToAtcm               : {} palign(8) > MCU_ATCM
     .startupCode       : {} palign(8)          > MCU_ATCM
     .startupData       : {} palign(8)          > MCU_ATCM, type = NOINIT
     .text      : {} palign(8)          > MCU1_1_DDR_SPACE
index 039b5561ce530798901f2e60fc4a587834f251c1..eaf9dd08073313337c0e482a9cac7e6defa54b4b 100644 (file)
@@ -119,6 +119,7 @@ SECTIONS
                   }  > MCU_ATCM
     .text:xdc_runtime_Startup_reset__I : {} palign(8) >  MCU_ATCM
     .bootCode          : {} palign(8)          > MCU_ATCM
+    .utilsCopyVecsToAtcm               : {} palign(8) > MCU_ATCM
     .startupCode       : {} palign(8)          > MCU_ATCM
     .startupData       : {} palign(8)          > MCU_ATCM, type = NOINIT
     .text      : {} palign(8)          > MCU2_0_DDR_SPACE
index bd37b4be18b89333fbd3e0998159aa2c34aceff9..1c2544bdc607ced899d8104b30c52c7acba993bb 100644 (file)
@@ -118,6 +118,7 @@ SECTIONS
                   }  > MCU_ATCM
     .text:xdc_runtime_Startup_reset__I : {} palign(8) > MCU_ATCM
     .bootCode          : {} palign(8)          > MCU_ATCM
+    .utilsCopyVecsToAtcm               : {} palign(8) > MCU_ATCM
     .startupCode       : {} palign(8)          > MCU_ATCM
     .startupData       : {} palign(8)          > MCU_ATCM, type = NOINIT
     .text      : {} palign(8)          > MCU2_1_DDR_SPACE
index 9db5e83f63e3990866ac05606a4ceb6cf0e0bcf3..6ffe2c7d03c3f598d1be97eea4b615b957b542aa 100644 (file)
@@ -144,7 +144,7 @@ MPU.setRegionMeta(5, 0x70000000, MPU.RegionSize_8M, attrs);
 attrs.enable = true;
 attrs.bufferable = true;
 attrs.cacheable = true;
-attrs.shareable = true;
+attrs.shareable = false;
 attrs.noExecute = false;
 attrs.accPerm = 0x3;          /* RW at PL1 & PL2 */
 attrs.tex = 1;
index dbc36ce70d1daa63b7289a8e6c219749d9f51386..7a3398dcd279baa85445550613eb31e904c3f57c 100644 (file)
@@ -190,6 +190,9 @@ if((coreId=="mcu2_0") || (coreId=="mcu2_1"))
     Hwi.vimBaseAddress = 0x0ff80000;
 }
 
+var Reset = xdc.useModule("xdc.runtime.Reset");
+Reset.fxns[Reset.fxns.length++] = "&utilsCopyVecs2ATcm";
+
 /*
  * Initialize MPU and enable it
  *
index ebc53b82ca71bab867dbcb7659810f095e732c26..d0c8e9e10f2205fc5d56dc4cf03255fa45cd0caf 100644 (file)
 #define MCU2_1_R5F_MEM_DATA_BASE (MCU2_1_ALLOCATED_START + 0x00300000)
 #define MCU2_1_DDR_SPACE_BASE    (MCU2_1_ALLOCATED_START + 0x00400000)
 
-#define ATCM_START 0x00000000
-
 -e __VECS_ENTRY_POINT
+--retain="*(.utilsCopyVecsToAtcm)"
 
 /*----------------------------------------------------------------------------*/
 /* Memory Map                                                                 */
 MEMORY
 {
     /* MCU1_R5F_0 local view  */
-    MCU_ATCM (RWX)             : origin=ATCM_START     length=0x8000
     /* MCU1_R5F0_TCMB0 (RWIX)  : origin=0x41010000     length=0x8000 (documented only, to avoid conflict below) */
+    R5F_TCMA_SBL_RSVD(X): ORIGIN = 0x00000000, LENGTH = 0x100
+    RESET_VECTORS(X)    : ORIGIN = 0x41C40000, LENGTH = 0x100
 
     /* MCU1_R5F_0 SoC view  */
     MCU1_R5F0_ATCM (RWIX)      : origin=0x41000000 length=0x8000
@@ -107,19 +107,20 @@ SECTIONS
 {
     .vecs : {
          *(.vecs)
-    } palign(8) > ATCM_START
+    } palign(8) > RESET_VECTORS
     .vecs       : {
         __VECS_ENTRY_POINT = .;
-    } palign(8) > MCU_ATCM
+    } palign(8) > RESET_VECTORS
     .init_text  : {
                      boot.*(.text)
                      *(.text:ti_sysbios_family_arm_MPU_*)
                      *(.text:ti_sysbios_family_arm_v7r_Cache_*)
-                  }  > MCU_ATCM
-    .text:xdc_runtime_Startup_reset__I : {} palign(8) > MCU_ATCM
-    .bootCode          : {} palign(8)          > MCU_ATCM
-    .startupCode       : {} palign(8)          > MCU_ATCM
-    .startupData       : {} palign(8)          > MCU_ATCM, type = NOINIT
+                  }  > MCU1_R5F0_BTCM
+    .text:xdc_runtime_Startup_reset__I : {} palign(8) > MCU1_R5F0_BTCM
+    .utilsCopyVecsToAtcm               : {} palign(8) > MCU1_R5F0_BTCM
+    .bootCode          : {} palign(8)          > MCU1_R5F0_BTCM
+    .startupCode       : {} palign(8)          > MCU1_R5F0_BTCM
+    .startupData       : {} palign(8)          > MCU1_R5F0_BTCM, type = NOINIT
     .text      : {} palign(8)          > MCU1_0_DDR_SPACE
     .const     : {} palign(8)          > MCU1_0_DDR_SPACE
     .cinit     : {} palign(8)          > MCU1_0_DDR_SPACE
index c4fa5c24c25566b629869e4af06a71a0eee2b96f..5f703f001e0847725ebb34f7db15ce7ca618d7c5 100644 (file)
@@ -118,6 +118,7 @@ SECTIONS
                   }  > MCU_ATCM
     .text:xdc_runtime_Startup_reset__I : {} palign(8) > MCU_ATCM
     .bootCode          : {} palign(8)          > MCU_ATCM
+    .utilsCopyVecsToAtcm               : {} palign(8) > MCU_ATCM
     .startupCode       : {} palign(8)          > MCU_ATCM
     .startupData       : {} palign(8)          > MCU_ATCM, type = NOINIT
     .text      : {} palign(8)          > MCU1_1_DDR_SPACE
index d3acf1db8928a0ed837c875238bb446faedd2ca7..32581cbe46c6046dd5e78a2d610b8cf45634a053 100644 (file)
@@ -119,6 +119,7 @@ SECTIONS
                   }  > MCU_ATCM
     .text:xdc_runtime_Startup_reset__I : {} palign(8) >  MCU_ATCM
     .bootCode          : {} palign(8)          > MCU_ATCM
+    .utilsCopyVecsToAtcm               : {} palign(8) > MCU_ATCM
     .startupCode       : {} palign(8)          > MCU_ATCM
     .startupData       : {} palign(8)          > MCU_ATCM, type = NOINIT
     .text      : {} palign(8)          > MCU2_0_DDR_SPACE
index 8e3bc28ea746a8d863b97b29403c461853a0159d..b83f8d8414efe8a308a41cda3d106e1243024f92 100644 (file)
@@ -118,6 +118,7 @@ SECTIONS
                   }  > MCU_ATCM
     .text:xdc_runtime_Startup_reset__I : {} palign(8) > MCU_ATCM
     .bootCode          : {} palign(8)          > MCU_ATCM
+    .utilsCopyVecsToAtcm               : {} palign(8) > MCU_ATCM
     .startupCode       : {} palign(8)          > MCU_ATCM
     .startupData       : {} palign(8)          > MCU_ATCM, type = NOINIT
     .text      : {} palign(8)          > MCU2_1_DDR_SPACE
index a54c2f986a49849e493d181ca7c6c4c3e67c385d..5575ebf91d3c56c3d48d257502339dd90533bd1f 100644 (file)
@@ -140,6 +140,7 @@ SECTIONS
                   }  > MCU_ATCM
     .text:xdc_runtime_Startup_reset__I : {} palign(8) > MCU_ATCM
     .bootCode          : {} palign(8)          > MCU_ATCM
+    .utilsCopyVecsToAtcm               : {} palign(8) > MCU_ATCM
     .startupCode       : {} palign(8)          > MCU_ATCM
     .startupData       : {} palign(8)          > MCU_ATCM, type = NOINIT
     .text      : {} palign(8)          > MCU3_0_DDR_SPACE
index 60cb1511c5c738030f54344da0389f986359183c..df2b194ff1ae8e194a80ee00742ce0f28e0f6273 100644 (file)
@@ -139,6 +139,7 @@ SECTIONS
                   }  > MCU_ATCM
     .text:xdc_runtime_Startup_reset__I : {} palign(8) > MCU_ATCM
     .bootCode          : {} palign(8)          > MCU_ATCM
+    .utilsCopyVecsToAtcm               : {} palign(8) > MCU_ATCM
     .startupCode       : {} palign(8)          > MCU_ATCM
     .startupData       : {} palign(8)          > MCU_ATCM, type = NOINIT
     .text      : {} palign(8)          > MCU3_1_DDR_SPACE
index e25eb2fabed11774fd07e0f5fa84d895a3517c9d..4e540476c284f7141df2b2bf6297608529fce7f8 100644 (file)
@@ -144,7 +144,7 @@ MPU.setRegionMeta(5, 0x70000000, MPU.RegionSize_8M, attrs);
 attrs.enable = true;
 attrs.bufferable = true;
 attrs.cacheable = true;
-attrs.shareable = true;
+attrs.shareable = false;
 attrs.noExecute = false;
 attrs.accPerm = 0x3;          /* RW at PL1 & PL2 */
 attrs.tex = 1;
index 59b3cc9f0d09f472489efb1880f0cabffa7447ff..35bdbb9d9c8e90e853e7242c6c7f970255f4a260 100644 (file)
@@ -1,6 +1,6 @@
 
 /* =============================================================================
- *   Copyright (c) Texas Instruments Incorporated 2018
+ *   Copyright (c) Texas Instruments Incorporated 2020
  *
  *  Redistribution and use in source and binary forms, with or without
  *  modification, are permitted provided that the following conditions
@@ -203,6 +203,9 @@ if((coreId=="mcu2_0") || (coreId=="mcu2_1") || (coreId=="mcu3_0") || (coreId=="m
     Hwi.vimBaseAddress = 0x0ff80000;
 }
 
+var Reset = xdc.useModule("xdc.runtime.Reset");
+Reset.fxns[Reset.fxns.length++] = "&utilsCopyVecs2ATcm";
+
 /*
  * Initialize MPU and enable it
  *
index 07fe9716dfa3151faf42f821fc7c20718a9aea0e..137b02144f9fb7fb4f9ab54cb09e13e46174de01 100644 (file)
 #include <ti/drv/ipc/examples/common/src/ipc_setup.h>
 #include <ti/drv/ipc/examples/ex05_bios_multicore_echo_negative_test/ipc_neg_setup.h>
 #include <ti/osal/osal.h>
+#include <ti/drv/uart/UART.h>
+#include <ti/drv/uart/UART_stdio.h>
 
 #define MSGSIZE  256U
 #define SERVICE  "ti.ipc4.ping-pong"
+#define FAKE_SERVICE "negative-test"
 #define ENDPT1   13U
 #define ENDPT2   14U
 #define NUMMSGS  10000 /* number of message sent per task */
@@ -105,22 +108,56 @@ uint32_t rpmsgNegDataSize = RPMSG_DATA_SIZE;
 static uint32_t        RecvEndPt = 0;
 #endif
 
-static bool test_rpmsg_pkt_large_than_vring_buf_flag = 0;
-static bool test_virtio_init_param_null_flag = 0;
-static bool test_rpmsg_init_param_null_flag = 0;
-static bool test_rpmsg_create_null_endpnt_flag = 0;
-static bool test_rpmsg_snd_null_data_flag = 0;
-static bool test_rpmsg_snd_unpair_core_flag = 0;
-static bool test_rpmsg_rcv_hndl_null_flag = 0;
-static bool test_rpmsg_snd_hndl_null_flag = 0;
-static bool test_virtio_param_vqbuf_size_zero_flag = 0;
-static bool test_virtio_param_vringbuf_size_zero_flag = 0;
-static bool test_rpmsg_param_buf_null_flag = 0;
-static bool test_rpmsg_param_buf_size_zero_flag = 0;
-static bool test_rpmsg_param_stkbuf_null_flag = 0;
-static bool test_rpmsg_param_stk_size_zero_flag = 0;
-static bool test_rpmsg_rcv_timeout_flag = 0;
-static bool test_rpmsg_remote_end_timeout_flag = 0;
+static uint32_t gTotalTests = 0;
+static uint32_t gTotalTestsPassed = 0;
+static uint32_t gTotalTestsFailed = 0;
+
+typedef enum Ipc_NegTestId_e {
+    TEST_RPMSG_PKT_LARGE_THAN_VRING_BUF,
+    TEST_VIRTIO_INIT_PARAM_NULL,
+    TEST_RPMSG_INIT_PARAM_NULL,
+    TEST_RPMSG_CREATE_NULL_ENDPNT,
+    TEST_RPMSG_SND_NULL_DATA,
+    TEST_RPMSG_SND_UNPAIR_CORE,
+    TEST_RPMSG_RCV_HNDL_NULL,
+    TEST_RPMSG_SND_HNDL_NULL,
+    TEST_VIRTIO_PARAM_VQBUF_SIZE_ZERO,
+    TEST_VIRTIO_PARAM_VRINGBUF_SIZE_ZERO,
+    TEST_RPMSG_PARAM_BUF_NULL,
+    TEST_RPMSG_PARAM_BUF_SIZE_ZERO,
+    TEST_RPMSG_PARAM_STKBUF_NULL,
+    TEST_RPMSG_PARAM_STK_SIZE_ZERO,
+    TEST_RPMSG_RCV_TIMEOUT,
+    TEST_RPMSG_REMOTE_END_TIMEOUT,
+    TEST_END
+} Ipc_NegTestId;
+
+typedef struct Ipc_NegTestParams_s
+{
+    uint32_t  testId;
+    char     *testName;
+} Ipc_TestParams;
+
+Ipc_TestParams negTestCases[] =
+{
+    { TEST_RPMSG_PKT_LARGE_THAN_VRING_BUF, "test_rpmsg_pkt_large_than_vring_buf" },
+    { TEST_VIRTIO_INIT_PARAM_NULL, "test_virtio_init_param_null" },
+    { TEST_RPMSG_INIT_PARAM_NULL, "test_rpmsg_init_param_null" },
+    { TEST_RPMSG_CREATE_NULL_ENDPNT, "test_rpmsg_create_null_endpnt" },
+    { TEST_RPMSG_SND_NULL_DATA, "test_rpmsg_snd_null_data" },
+    { TEST_RPMSG_SND_UNPAIR_CORE, "test_rpmsg_snd_unpair_core" },
+    { TEST_RPMSG_RCV_HNDL_NULL, "test_rpmsg_rcv_hndl_null" },
+    { TEST_RPMSG_SND_HNDL_NULL, "test_rpmsg_snd_hndl_null" },
+    { TEST_VIRTIO_PARAM_VQBUF_SIZE_ZERO, "test_virtio_param_vqbuf_size_zero" },
+    { TEST_VIRTIO_PARAM_VRINGBUF_SIZE_ZERO, "test_virtio_param_vringbuf_size_zero" },
+    { TEST_RPMSG_PARAM_BUF_NULL, "test_rpmsg_param_buf_null" },
+    { TEST_RPMSG_PARAM_BUF_SIZE_ZERO, "test_rpmsg_param_buf_size_zero" },
+    { TEST_RPMSG_PARAM_STKBUF_NULL, "test_rpmsg_param_stkbuf_null" },
+    { TEST_RPMSG_PARAM_STK_SIZE_ZERO, "test_rpmsg_param_stk_size_zero" },
+    { TEST_RPMSG_RCV_TIMEOUT, "test_rpmsg_rcv_timeout" },
+    { TEST_RPMSG_REMOTE_END_TIMEOUT, "test_rpmsg_remote_end_timeout" },
+    { TEST_END, NULL },
+};
 
 //#define DEBUG_PRINT
 
@@ -131,11 +168,28 @@ void rpmsg_neg_exit_responseTask()
     g_neg_exitRespTsk = 1;
 }
 
+void Ipc_reportResult(uint32_t id, int32_t result)
+{
+    gTotalTests++;
+    if (result == IPC_SOK)
+    {
+        System_printf("[%s] [%s] : [TEST_PASS]\n", Ipc_mpGetSelfName(), negTestCases[id].testName);
+        UART_printf("[%s] [%s] : [TEST_PASS]\n", Ipc_mpGetSelfName(), negTestCases[id].testName);
+        gTotalTestsPassed++;
+    }
+    else
+    {
+        System_printf("[%s] [%s] : [TEST_FAIL]\n", Ipc_mpGetSelfName(), negTestCases[id].testName);
+        UART_printf("[%s] [%s] : [TEST_FAIL]\n", Ipc_mpGetSelfName(), negTestCases[id].testName);
+        gTotalTestsFailed++;
+    }
+}
+
 /*
  * This "Task" waits for a "ping" message from any processor
  * then replies with a "pong" message.
  */
-void rpmsg_neg_responderFxn(UArg arg0, UArg arg1)
+int32_t rpmsg_neg_responderFxn(uint32_t testId)
 {
     RPMessage_Handle    handle;
     RPMessage_Handle    handleTimeout;
@@ -145,19 +199,35 @@ void rpmsg_neg_responderFxn(UArg arg0, UArg arg1)
     uint32_t        remoteEndPt;
     uint32_t        remoteProcId;
     uint16_t        len;
-    int32_t         n;
     int32_t         status = 0;
     void            *buf;
     void            *buf2;
 
     uint32_t            bufSize = rpmsgNegDataSize;
     char                str[MSGSIZE];
+    char                test_buf[RP_MSG_TEST_BUF_SIZE + 1];
+
 
     buf = pRecvTaskBuf;
-    if(buf == NULL)
+    if (buf == NULL)
     {
         System_printf("RecvTask: buffer allocation failed\n");
-        return;
+        return IPC_EFAIL;
+    }
+
+    /* Testing TEST_RPMSG_REMOTE_END_TIMEOUT */
+    {
+        status = RPMessage_getRemoteEndPt(IPC_MCU1_0, FAKE_SERVICE, &remoteProcId,
+                &remoteEndPt, 1000);
+        if (status != IPC_SOK)
+        {
+            Ipc_reportResult(TEST_RPMSG_REMOTE_END_TIMEOUT, IPC_SOK);
+        }
+        else
+        {
+            Ipc_reportResult(TEST_RPMSG_REMOTE_END_TIMEOUT, IPC_EFAIL);
+            return IPC_EFAIL;
+        }
     }
 
     RPMessageParams_init(&params);
@@ -165,11 +235,26 @@ void rpmsg_neg_responderFxn(UArg arg0, UArg arg1)
     params.buf = buf;
     params.bufSize = bufSize;
 
+    /* Testing TEST_RPMSG_CREATE_NULL_ENDPNT */
+    {
+        System_printf("RPMessage_create NULL Endpt\n");
+        handle = RPMessage_create(&params, NULL);
+        if (!handle)
+        {
+            Ipc_reportResult(TEST_RPMSG_CREATE_NULL_ENDPNT, IPC_SOK);
+        }
+        else
+        {
+            Ipc_reportResult(TEST_RPMSG_CREATE_NULL_ENDPNT, IPC_EFAIL);
+            return IPC_EFAIL;
+        }
+    }
+
     handle = RPMessage_create(&params, &myEndPt);
-    if(!handle)
+    if (!handle)
     {
         System_printf("RecvTask: Failed to create endpoint\n");
-        return;
+        return IPC_EFAIL;
     }
     buf2 = pTimeoutBuf;
     params.requestedEndpt = ENDPT2;
@@ -179,455 +264,131 @@ void rpmsg_neg_responderFxn(UArg arg0, UArg arg1)
     if (!handleTimeout)
     {
         System_printf("RecvTask: Failed to create timeout endpoint\n");
-        return;
+        RPMessage_delete(&handle);
+        return IPC_EFAIL;
     }
 
 #if !defined(BUILD_MPU1_0) && defined(A72_LINUX_OS) && defined(A72_LINUX_OS_IPC_ATTACH)
     RecvEndPt = myEndPt;
 #endif
 
-    if(test_rpmsg_snd_hndl_null_flag || test_rpmsg_rcv_hndl_null_flag ||
-            test_rpmsg_pkt_large_than_vring_buf_flag || test_rpmsg_snd_null_data_flag
-            || test_rpmsg_snd_unpair_core_flag || test_rpmsg_remote_end_timeout_flag)
-    {
+#if defined (BUILD_MPU1_0)
+    remoteProcId = IPC_MCU1_0;
+#else
+    remoteProcId = IPC_MPU1_0;
+#endif
 
-    }
-    else
+    /* Testing TEST_RPMSG_PKT_LARGE_THAN_VRING_BUF */
     {
-        status = RPMessage_announce(RPMESSAGE_ALL, myEndPt, SERVICE);
-        if(status != IPC_SOK)
-        {
-            System_printf("RecvTask: RPMessage_announce() failed\n");
-            return;
-        }
-    }
+        /* Send data to remote endPt: */
+        memset(test_buf, 0, RP_MSG_TEST_BUF_SIZE);
 
-    while(!g_neg_exitRespTsk)
-    {
+        len = snprintf(test_buf, RP_MSG_TEST_BUF_SIZE, "ping %d", 0);
 
-        if(test_rpmsg_rcv_hndl_null_flag)
-        {
-            test_rpmsg_rcv_hndl_null_flag = 0;
-            status = RPMessage_recv(NULL, (Ptr)str, &len, &remoteEndPt, &remoteProcId,
-                    IPC_RPMESSAGE_TIMEOUT_FOREVER);
-            if(status != IPC_SOK)
-            {
-                System_printf("[%s] [test_rpmsg_rcv_hndl_null_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-                return;
-            }
-            else
-            {
-                System_printf("[%s] [test_rpmsg_rcv_hndl_null_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
-                return;
-            }
-        }
-        else if(test_rpmsg_rcv_timeout_flag)
-        {
-            test_rpmsg_rcv_timeout_flag = 0;
-            System_printf("[%s] calling RPMessage_recv with timeout 100...\n", Ipc_mpGetSelfName());
-            status = RPMessage_recv(handleTimeout, (Ptr)str, &len, &remoteEndPt, &remoteProcId, 100);
-            if(status != IPC_ETIMEOUT)
-            {
-                System_printf("[%s] [test_rpmsg_rcv_timeout_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
-                return;
-            }
-            else
-            {
-                System_printf("[%s] [test_rpmsg_rcv_timeout_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-                return;
-            }
-        }
-        else
-        {
-            status = RPMessage_recv(handle, (Ptr)str, &len, &remoteEndPt, &remoteProcId,
-                    IPC_RPMESSAGE_TIMEOUT_FOREVER);
-        }
-        if(status != IPC_SOK)
-        {
-            System_printf("RecvTask: failed with code %d\n", status);
-        }
-        else
+        if(len > RP_MSG_TEST_BUF_SIZE)
         {
-            /* NULL terminated string */
-            str[len] = '\0';
-#ifdef DEBUG_PRINT
-            System_printf("RecvTask: Revcvd msg \"%s\" len %d from %s\n",
-                    str, len, Ipc_mpGetName(remoteProcId));
-#endif
+            System_printf("SendTask%d: snprintf failed, len %d\n", remoteProcId, len);
+            len = RP_MSG_TEST_BUF_SIZE;
         }
 
-        status = sscanf(str, "ping %d", &n);
-        if(status == 1)
+        len = RP_MSG_TEST_BUF_SIZE;
+        test_buf[len++] = '\0';
+
+        status = RPMessage_send(handle, remoteProcId, ENDPT1, myEndPt, (Ptr)test_buf, len);
+        if (status != IPC_SOK)
         {
-            memset(str, 0, MSGSIZE);
-            len = snprintf(str, 255, "pong %d", n);
-            if(len > 255)
-            {
-                System_printf("RecvTask: snprintf failed, len %d\n", len);
-                len = 255;
-            }
-            str[len++] = '\0';
+            Ipc_reportResult(TEST_RPMSG_PKT_LARGE_THAN_VRING_BUF, IPC_SOK);
         }
         else
         {
-            /* If this is not ping/pong message, just print the message */
-            System_printf("%s <--> %s : %s recvd\n",
-                    Ipc_mpGetSelfName(),
-                    Ipc_mpGetName(remoteProcId),
-                    str);
-        }
-#ifdef DEBUG_PRINT
-        System_printf("RecvTask: Sending msg \"%s\" len %d from %s to %s\n",
-                str, len, Ipc_mpGetSelfName(),
-                Ipc_mpGetName(remoteProcId));
-#endif
-        status = RPMessage_send(handle, remoteProcId, remoteEndPt, myEndPt, str, len);
-        if (status != IPC_SOK)
-        {
-            System_printf("RecvTask: Sending msg \"%s\" len %d from %s to %s failed!!!\n",
-                str, len, Ipc_mpGetSelfName(),
-                Ipc_mpGetName(remoteProcId));
+            Ipc_reportResult(TEST_RPMSG_PKT_LARGE_THAN_VRING_BUF, IPC_EFAIL);
+            return IPC_EFAIL;
         }
     }
 
-    System_printf("%s responder task exiting ...\n",
-                    Ipc_mpGetSelfName());
-}
-
-void rpmsg_neg_senderFxn(UArg arg0, UArg arg1)
-{
-    RPMessage_Handle    handle;
-    RPMessage_Params    params;
-    uint32_t            myEndPt = 0;
-    uint32_t            remoteEndPt;
-    uint32_t            remoteProcId;
-    uint16_t            dstProc;
-    uint16_t            len;
-    int32_t             i;
-    int32_t             status = 0;
-    char                test_buf[RP_MSG_TEST_BUF_SIZE + 1];
-    char                buf[256];
-    uint8_t            *buf1;
-
-    uint32_t            cntPing = 0;
-    uint32_t            cntPong = 0;
-
-    buf1 = &pSendTaskBuf[rpmsgNegDataSize * arg1];
-    dstProc = arg0;
-
-    /* Create the endpoint for receiving. */
-    RPMessageParams_init(&params);
-    params.numBufs = 2;
-    params.buf = buf1;
-    params.bufSize = rpmsgNegDataSize;
-
-    if(test_rpmsg_create_null_endpnt_flag)
+    /* Testing TEST_RPMSG_SND_NULL_DATA */
     {
-        test_rpmsg_create_null_endpnt_flag = 0;
-        handle = RPMessage_create(&params, NULL);
-        if(!handle)
+        status = RPMessage_send(handle, remoteProcId, ENDPT1, myEndPt, NULL, len);
+
+        if (status != IPC_SOK)
         {
-            System_printf("[%s] [test_rpmsg_create_null_endpnt_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-            return;
+            Ipc_reportResult(TEST_RPMSG_SND_NULL_DATA, IPC_SOK);
         }
         else
         {
-            System_printf("[%s] [test_rpmsg_create_null_endpnt_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
-            return;
+            Ipc_reportResult(TEST_RPMSG_SND_NULL_DATA, IPC_EFAIL);
+            return IPC_EFAIL;
         }
     }
-    else
-    {
-        handle = RPMessage_create(&params, &myEndPt);
-    }
 
-    if(!handle)
+    /* Testing TEST_RPMSG_SND_UNPAIR_CORE */
     {
-        System_printf("SendTas %d: Failed to create message endpoint\n",
-                dstProc);
-        return;
-    }
+#ifdef BUILD_C66X_1
+        remoteProcId = IPC_C66X_1; // todo: what should dstProc be??
+#endif
+        status = RPMessage_send(handle, remoteProcId, ENDPT1, myEndPt, (Ptr)buf, len);
 
-    if(test_rpmsg_remote_end_timeout_flag)
-    {
-        test_rpmsg_remote_end_timeout_flag = 0;
-        status = RPMessage_getRemoteEndPt(dstProc, SERVICE, &remoteProcId,
-                &remoteEndPt, 1000);
-        if(status != IPC_SOK)
+        if (status != IPC_SOK)
         {
-            System_printf("[%s] [test_rpmsg_remote_end_timeout_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-            return;
+            Ipc_reportResult(TEST_RPMSG_SND_UNPAIR_CORE, IPC_SOK);
         }
         else
         {
-            System_printf("[%s] [test_rpmsg_remote_end_timeout_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
-            return;
+            Ipc_reportResult(TEST_RPMSG_SND_UNPAIR_CORE, IPC_EFAIL);
+            return IPC_EFAIL;
         }
     }
-    else
+
+    /* Testing TEST_RPMSG_SND_HNDL_NULL */
     {
-        if(test_rpmsg_pkt_large_than_vring_buf_flag || test_rpmsg_snd_null_data_flag
-                || test_rpmsg_snd_unpair_core_flag || test_rpmsg_snd_hndl_null_flag)
+        status = RPMessage_send(NULL, remoteProcId, ENDPT1, myEndPt, (Ptr)buf, len);
+        if (status != IPC_SOK)
         {
-
+            Ipc_reportResult(TEST_RPMSG_SND_HNDL_NULL, IPC_SOK);
         }
         else
         {
-            status = RPMessage_getRemoteEndPt(dstProc, SERVICE, &remoteProcId,
-                    &remoteEndPt, BIOS_WAIT_FOREVER);
-            if(dstProc != remoteProcId)
-            {
-                System_printf("SendTask%d: RPMessage_getRemoteEndPt() malfunctioned, status %d\n",
-                        dstProc, status);
-                return;
-            }
+            Ipc_reportResult(TEST_RPMSG_SND_HNDL_NULL, IPC_EFAIL);
+            return IPC_EFAIL;
         }
     }
 
-    for (i = 0; i < NUMMSGS; i++)
+    /* Testing TEST_RPMSG_RCV_HNDL_NULL */
     {
-
-        if(test_rpmsg_pkt_large_than_vring_buf_flag)
+        status = RPMessage_recv(NULL, (Ptr)str, &len, &remoteEndPt, &remoteProcId,
+                    IPC_RPMESSAGE_TIMEOUT_FOREVER);
+        if (status != IPC_SOK)
         {
-
-            test_rpmsg_pkt_large_than_vring_buf_flag = 0;
-            /* Send data to remote endPt: */
-            memset(test_buf, 0, RP_MSG_TEST_BUF_SIZE);
-
-            len = snprintf(test_buf, RP_MSG_TEST_BUF_SIZE, "ping %d", i);
-
-            if(len > RP_MSG_TEST_BUF_SIZE)
-            {
-                System_printf("SendTask%d: snprintf failed, len %d\n", dstProc, len);
-                len = RP_MSG_TEST_BUF_SIZE;
-            }
-
-            len = RP_MSG_TEST_BUF_SIZE;
-            test_buf[len++] = '\0';
-
-            /* Increase the Ping Counter */
-            cntPing++;
-
-            status = RPMessage_send(handle, dstProc, ENDPT1, myEndPt, (Ptr)test_buf, len);
-            if (status != IPC_SOK)
-            {
-                System_printf("[%s] [test_rpmsg_pkt_large_than_vring_buf_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-
-                /* Delete the RPMesg object now */
-                RPMessage_delete(&handle);
-                return;
-            }
-            else
-            {
-                System_printf("[%s] [test_rpmsg_pkt_large_than_vring_buf_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
-
-                /* Delete the RPMesg object now */
-                RPMessage_delete(&handle);
-                return;
-            }
+            Ipc_reportResult(TEST_RPMSG_RCV_HNDL_NULL, IPC_SOK);
         }
         else
         {
-            /* Send data to remote endPt: */
-            memset(buf, 0, 256);
-
-            len = snprintf(buf, 255, "ping %d", i);
-
-            if(len > 255)
-            {
-                System_printf("SendTask%d: snprintf failed, len %d\n", dstProc, len);
-                len = 255;
-            }
-
-            buf[len++] = '\0';
-
-#ifdef DEBUG_PRINT
-            System_printf("SendTask%d: Sending \"%s\" from %s to %s...\n", dstProc,
-                    buf, Ipc_mpGetSelfName(),
-                    Ipc_mpGetName(dstProc));
-#endif
-            /* Increase the Ping Counter */
-            cntPing++;
-
-            if(test_rpmsg_snd_null_data_flag)
-            {
-                test_rpmsg_snd_null_data_flag = 0;
-                status = RPMessage_send(handle, dstProc, ENDPT1, myEndPt, NULL, len);
-                if (status != IPC_SOK)
-                {
-                    System_printf("[%s] [test_rpmsg_snd_null_data_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-                    /* Delete the RPMesg object now */
-                    RPMessage_delete(&handle);
-                    return;
-                }
-                else
-                {
-                    System_printf("[%s] [test_rpmsg_snd_null_data_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
-                    /* Delete the RPMesg object now */
-                    RPMessage_delete(&handle);
-                    return;
-                }
-            }
-            else if(test_rpmsg_snd_unpair_core_flag)
-            {
-                test_rpmsg_snd_unpair_core_flag = 0;
-#ifdef BUILD_C66X_1
-                dstProc = IPC_C66X_1;
-#endif
-                status = RPMessage_send(handle, dstProc, ENDPT1, myEndPt, (Ptr)buf, len);
-                if (status != IPC_SOK)
-                {
-                    System_printf("[%s] [test_rpmsg_snd_unpair_core_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-                    /* Delete the RPMesg object now */
-                    RPMessage_delete(&handle);
-                    return;
-                }
-                else
-                {
-                    System_printf("[%s] [test_rpmsg_snd_unpair_core_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
-                    /* Delete the RPMesg object now */
-                    RPMessage_delete(&handle);
-                    return;
-                }
-            }
-            else if(test_rpmsg_snd_hndl_null_flag)
-            {
-                test_rpmsg_snd_hndl_null_flag = 0;
-                status = RPMessage_send(NULL, dstProc, ENDPT1, myEndPt, (Ptr)buf, len);
-                if (status != IPC_SOK)
-                {
-                    System_printf("[%s] [test_rpmsg_snd_hndl_null_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-                    /* Delete the RPMesg object now */
-                    RPMessage_delete(&handle);
-                    return;
-                }
-                else
-                {
-                    System_printf("[%s] [test_rpmsg_snd_hndl_null_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
-                    /* Delete the RPMesg object now */
-                    RPMessage_delete(&handle);
-                    return;
-                }
-            }
-            else
-            {
-                status = RPMessage_send(handle, dstProc, ENDPT1, myEndPt, (Ptr)buf, len);
-                if (status != IPC_SOK)
-                {
-                    System_printf("SendTask%d: RPMessage_send Failed Msg-> \"%s\" from %s to %s...\n",
-                            dstProc,
-                            buf, Ipc_mpGetSelfName(),
-                            Ipc_mpGetName(dstProc));
-                    break;
-                }
-            }
-        }
-
-        /* wait a for a response message: */
-        status = RPMessage_recv(handle, (Ptr)buf, &len, &remoteEndPt,
-                &remoteProcId, IPC_RPMESSAGE_TIMEOUT_FOREVER);
-
-        if(status != IPC_SOK)
-        {
-            System_printf("SendTask%d: RPMessage_recv failed with code %d\n",
-                    dstProc, status);
-            break;
+            Ipc_reportResult(TEST_RPMSG_RCV_HNDL_NULL, IPC_EFAIL);
+            return IPC_EFAIL;
         }
+    }
+
+    /* Testing TEST_RPMSG_RCV_TIMEOUT */
+    {
+        System_printf("[%s] calling RPMessage_recv with timeout 100...\n", Ipc_mpGetSelfName());
+        status = RPMessage_recv(handleTimeout, (Ptr)str, &len, &remoteEndPt, &remoteProcId, 100);
 
-        /* Make it NULL terminated string */
-        if(len >= MSGSIZE)
+        if (status != IPC_ETIMEOUT)
         {
-            buf[MSGSIZE-1] = '\0';
+            Ipc_reportResult(TEST_RPMSG_RCV_TIMEOUT, IPC_EFAIL);
+            return IPC_EFAIL;
         }
         else
         {
-            buf[len] = '\0';
-        }
-#ifdef DEBUG_PRINT
-        System_printf("SendTask%d: Received \"%s\" len %d from %s endPt %d \n",
-                dstProc, buf, len, Ipc_mpGetName(remoteProcId),
-                remoteEndPt);
-#endif
-        cntPong++;
-        if((i+1)%50 == 0)
-        {
-            //System_printf("%s <--> %s, ping/pong iteration %d ...\n",
-            //        Ipc_mpGetSelfName(), Ipc_mpGetName(dstProc), i);
+            Ipc_reportResult(TEST_RPMSG_RCV_TIMEOUT, IPC_SOK);
         }
     }
 
-    System_printf("%s <--> %s, Ping- %d, pong - %d completed\n",
-            Ipc_mpGetSelfName(),
-            Ipc_mpGetName(dstProc),
-            cntPing, cntPong);
-
-    /* Delete the RPMesg object now */
-    RPMessage_delete(&handle);
-}
-
-/*
- * This "Task" waits for Linux vdev ready, and late create the vrings
- *
- */
-#if !defined(BUILD_MPU1_0) && defined(A72_LINUX_OS) && defined(A72_LINUX_OS_IPC_ATTACH)
-void rpmsg_neg_vdevMonitorFxn(UArg arg0, UArg arg1)
-{
-    int32_t status;
-
-    /* Wait for Linux VDev ready... */
-    while(!Ipc_isRemoteReady(IPC_MPU1_0))
-    {
-        Task_sleep(10);
-    }
-
-    /* Create the VRing now ... */
-    status = Ipc_lateVirtioCreate(IPC_MPU1_0);
-    if(status != IPC_SOK)
-    {
-        System_printf("%s: Ipc_lateVirtioCreate failed\n", __func__);
-        return;
-    }
-
-    status = RPMessage_lateInit(IPC_MPU1_0);
-    if(status != IPC_SOK)
-    {
-        System_printf("%s: RPMessage_lateInit failed\n", __func__);
-        return;
-    }
-
-    status = RPMessage_announce(IPC_MPU1_0, RecvEndPt, SERVICE);
-    if(status != IPC_SOK)
-    {
-        System_printf("rpmsg_neg_vdevMonitorFxn: RPMessage_announce() failed\n");
-    }
+    return IPC_SOK;
 }
-#endif /* !defined(BUILD_MPU1_0) && defined(A72_LINUX_OS) && defined(A72_LINUX_OS_IPC_ATTACH)*/
 
-
-
-void clear_all_test_flags(void)
-{
-    test_rpmsg_pkt_large_than_vring_buf_flag = 0;
-    test_virtio_init_param_null_flag = 0;
-    test_rpmsg_init_param_null_flag = 0;
-    test_rpmsg_create_null_endpnt_flag = 0;
-    test_rpmsg_snd_null_data_flag = 0;
-    test_rpmsg_snd_unpair_core_flag = 0;
-    test_rpmsg_rcv_hndl_null_flag = 0;
-    test_rpmsg_snd_hndl_null_flag = 0;
-    test_virtio_param_vqbuf_size_zero_flag = 0;
-    test_virtio_param_vringbuf_size_zero_flag = 0;
-    test_rpmsg_param_buf_null_flag = 0;
-    test_rpmsg_param_buf_size_zero_flag = 0;
-    test_rpmsg_param_stkbuf_null_flag = 0;
-    test_rpmsg_param_stk_size_zero_flag = 0;
-    test_rpmsg_rcv_timeout_flag = 0;
-    test_rpmsg_remote_end_timeout_flag = 0;
-}
-int32_t ipc_neg_test(void)
+int32_t ipc_neg_test(uint32_t testId)
 {
-    uint32_t          t;
-    Task_Params       params;
     uint32_t          numProc = gNumRemoteProc;
     Ipc_VirtIoParams  vqParam;
     uint32_t          index = 0;
@@ -641,29 +402,6 @@ int32_t ipc_neg_test(void)
 
     Ipc_init(NULL);
 
-    //System_printf("Required Local memory for Virtio_Object = %d\r\n",
-    //   numProc * Ipc_getVqObjMemoryRequiredPerCore());
-
-#if !defined(BUILD_MPU1_0) && defined(A72_LINUX_OS)
-    /* If A72 remote core is running Linux OS, then
-     * load resource table
-     */
-
-    Ipc_loadResourceTable((void*)&ti_ipc_remoteproc_ResourceTable);
-
-#if !defined(A72_LINUX_OS_IPC_ATTACH)
-    /* Wait for Linux VDev ready... */
-    for(t = 0; t < numProc; t++)
-    {
-        while(!Ipc_isRemoteReady(pRemoteProcArray[t]))
-        {
-            Task_sleep(10);
-        }
-    }
-    //System_printf("Linux VDEV ready now .....\n");
-#endif
-#endif
-
     /* Step2 : Initialize Virtio */
     vqParam.vqObjBaseAddr = (void*)pSysVqBuf;
     vqParam.vqBufSize     = numProc * Ipc_getVqObjMemoryRequiredPerCore();
@@ -671,350 +409,179 @@ int32_t ipc_neg_test(void)
     vqParam.vringBufSize  = IPC_VRING_BUFFER_SIZE;
     vqParam.timeoutCnt    = 100;  /* Wait for counts */
 
-    if(test_virtio_init_param_null_flag)
+    /* Testing TEST_VIRTIO_INIT_PARAM_NULL */
     {
-        memset(&vqParam, 0, sizeof(vqParam));
         status = Ipc_initVirtIO( NULL );
         if(status != IPC_SOK)
         {
-            System_printf("[%s] [test_virtio_init_param_null_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-            return IPC_EFAIL;
+            Ipc_reportResult(TEST_VIRTIO_INIT_PARAM_NULL, IPC_SOK);
         }
         else
         {
-            System_printf("[%s] [test_virtio_init_param_null_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
+            Ipc_reportResult(TEST_VIRTIO_INIT_PARAM_NULL, IPC_EFAIL);
             return IPC_EFAIL;
         }
     }
-    else if(test_virtio_param_vqbuf_size_zero_flag)
+
+    /* Testing TEST_VIRTIO_PARAM_VQBUF_SIZE_ZERO */
     {
         vqParam.vqBufSize     = 0;
 
         status = Ipc_initVirtIO(&vqParam);
         if(status != IPC_SOK)
         {
-            System_printf("[%s] [test_virtio_param_vqbuf_size_zero_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-            return IPC_EFAIL;
+            Ipc_reportResult(TEST_VIRTIO_PARAM_VQBUF_SIZE_ZERO, IPC_SOK);
         }
         else
         {
-            System_printf("[%s] [test_virtio_param_vqbuf_size_zero_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
+            Ipc_reportResult(TEST_VIRTIO_PARAM_VQBUF_SIZE_ZERO, IPC_EFAIL);
             return IPC_EFAIL;
         }
     }
-    else if(test_virtio_param_vringbuf_size_zero_flag)
+
+    /* Testing TEST_VIRTIO_PARAM_VRINGBUF_SIZE_ZERO */
     {
+        vqParam.vqBufSize     = numProc * Ipc_getVqObjMemoryRequiredPerCore();
         vqParam.vringBufSize  = 0;
 
         status = Ipc_initVirtIO(&vqParam);
         if(status != IPC_SOK)
         {
-            System_printf("[%s] [test_virtio_param_vringbuf_size_zero_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-            return IPC_EFAIL;
+            Ipc_reportResult(TEST_VIRTIO_PARAM_VRINGBUF_SIZE_ZERO, IPC_SOK);
         }
         else
         {
-            System_printf("[%s] [test_virtio_param_vringbuf_size_zero_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
+            Ipc_reportResult(TEST_VIRTIO_PARAM_VRINGBUF_SIZE_ZERO, IPC_EFAIL);
             return IPC_EFAIL;
         }
     }
-    else
+
+
+    System_printf("Ipc_initVirtIO\n");
+    vqParam.vringBufSize  = IPC_VRING_BUFFER_SIZE;
+    status = Ipc_initVirtIO(&vqParam);
+    if (status != IPC_SOK)
     {
-        status = Ipc_initVirtIO(&vqParam);
-        if (status != IPC_SOK)
-        {
-            System_printf("[%s] Ipc_initVirtIO failed\n");
-            return IPC_EFAIL;
-        }
+        System_printf("[%s] Ipc_initVirtIO failed\n");
+        return IPC_EFAIL;
     }
+
     /* Step 3: Initialize RPMessage */
     RPMessage_Params cntrlParam;
 
-    //System_printf("Required Local memory for RPMessage Object = %d\n",
-    //   RPMessage_getObjMemRequired());
-
     /* Initialize the param */
     RPMessageParams_init(&cntrlParam);
 
     /* Set memory for HeapMemory for control task */
     cntrlParam.buf         = pCntrlBuf;
     cntrlParam.bufSize     = rpmsgNegDataSize;
-    cntrlParam.stackBuffer = &pTaskBuf[index++ * IPC_TASK_STACKSIZE];
+    cntrlParam.stackBuffer = &pTaskBuf[index * IPC_TASK_STACKSIZE];
     cntrlParam.stackSize   = IPC_TASK_STACKSIZE;
 
-    if(test_rpmsg_init_param_null_flag)
+    /* Testing TEST_RPMSG_INIT_PARAM_NULL */
     {
         status = RPMessage_init(NULL);
         if(status != IPC_SOK)
         {
-            System_printf("[%s] [test_rpmsg_init_param_null_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-            return IPC_EFAIL;
+            Ipc_reportResult(TEST_RPMSG_INIT_PARAM_NULL, IPC_SOK);
         }
         else
         {
-            System_printf("[%s] [test_rpmsg_init_param_null_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
+            Ipc_reportResult(TEST_RPMSG_INIT_PARAM_NULL, IPC_EFAIL);
             return IPC_EFAIL;
         }
     }
-    else if(test_rpmsg_param_buf_null_flag)
+
+    /* Testing TEST_RPMSG_PARAM_BUF_NULL */
     {
         cntrlParam.buf =  NULL;
 
         status = RPMessage_init(&cntrlParam);
         if(status != IPC_SOK)
         {
-            System_printf("[%s] [test_rpmsg_param_buf_null_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-            return IPC_EFAIL;
+            Ipc_reportResult(TEST_RPMSG_PARAM_BUF_NULL, IPC_SOK);
         }
         else
         {
-            System_printf("[%s] [test_rpmsg_param_buf_null_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
+            Ipc_reportResult(TEST_RPMSG_PARAM_BUF_NULL, IPC_EFAIL);
             return IPC_EFAIL;
         }
     }
-    else if(test_rpmsg_param_buf_size_zero_flag)
+
+    /* Testing TEST_RPMSG_PARAM_BUF_SIZE_ZERO */
     {
+        cntrlParam.buf = pCntrlBuf;
         cntrlParam.bufSize = 0;
 
         status = RPMessage_init(&cntrlParam);
         if(status != IPC_SOK)
         {
-            System_printf("[%s] [test_rpmsg_param_buf_size_zero_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-            return IPC_EFAIL;
+            Ipc_reportResult(TEST_RPMSG_PARAM_BUF_SIZE_ZERO, IPC_SOK);
         }
         else
         {
-            System_printf("[%s] [test_rpmsg_param_buf_size_zero_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
+            Ipc_reportResult(TEST_RPMSG_PARAM_BUF_SIZE_ZERO, IPC_EFAIL);
             return IPC_EFAIL;
         }
     }
 #ifndef IPC_EXCLUDE_CTRL_TASKS
-    else if(test_rpmsg_param_stkbuf_null_flag)
+    /* Testing TEST_RPMSG_PARAM_STKBUF_NULL */
     {
+        cntrlParam.bufSize     = rpmsgNegDataSize;
         cntrlParam.stackBuffer = NULL;
 
         status = RPMessage_init(&cntrlParam);
         if(status != IPC_SOK)
         {
-            System_printf("[%s] [test_rpmsg_param_stkbuf_null_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-            return IPC_EFAIL;
+            Ipc_reportResult(TEST_RPMSG_PARAM_STKBUF_NULL, IPC_SOK);
         }
         else
         {
-            System_printf("[%s] [test_rpmsg_param_stkbuf_null_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
+            Ipc_reportResult(TEST_RPMSG_PARAM_STKBUF_NULL, IPC_EFAIL);
             return IPC_EFAIL;
         }
     }
-    else if(test_rpmsg_param_stk_size_zero_flag)
+    /* Testing TEST_RPMSG_PARAM_STK_SIZE_ZERO */
     {
+        cntrlParam.stackBuffer = &pTaskBuf[index * IPC_TASK_STACKSIZE];
         cntrlParam.stackSize = 0;
 
         status = RPMessage_init(&cntrlParam);
         if(status != IPC_SOK)
         {
-            System_printf("[%s] [test_rpmsg_param_stk_size_zero_flag] : [TEST_PASS]\n", Ipc_mpGetSelfName());
-            return IPC_EFAIL;
+            Ipc_reportResult(TEST_RPMSG_PARAM_STK_SIZE_ZERO, IPC_SOK);
         }
         else
         {
-            System_printf("[%s] [test_rpmsg_param_stk_size_zero_flag] : [TEST_FAIL]\n", Ipc_mpGetSelfName());
+            Ipc_reportResult(TEST_RPMSG_PARAM_STK_SIZE_ZERO, IPC_EFAIL);
             return IPC_EFAIL;
         }
     }
 #endif /* IPC_EXCLUDE_CTRL_TASKS */
-    else
-    {
-        status = RPMessage_init(&cntrlParam);
-        if (status != IPC_SOK)
-        {
-            System_printf("[%s] RPMessage_init failed\n", Ipc_mpGetSelfName());
-            return IPC_EFAIL;
-        }
-    }
-
-    /* Respond to messages coming in to endPt ENDPT1 */
-    Task_Params_init(&params);
-    params.priority   = 3;
-    params.stack      = &pTaskBuf[index++ * IPC_TASK_STACKSIZE];
-    params.stackSize  = IPC_TASK_STACKSIZE;
-    params.arg0       = 0;
-    Task_create(rpmsg_neg_responderFxn, &params, NULL);
 
-    for(t = 0; t < numProc; t++, index++)
+    System_printf("RPMessage_init\n");
+    cntrlParam.stackSize   = IPC_TASK_STACKSIZE;
+    status = RPMessage_init(&cntrlParam);
+    if (status != IPC_SOK)
     {
-#if !defined(BUILD_MPU1_0) && defined(A72_LINUX_OS)
-        /* Linux does not have a responder func running */
-        if(pRemoteProcArray[t] == IPC_MPU1_0)
-            continue;
-#endif
-        /* send messages to peer(s) on ENDPT1 */
-        Task_Params_init(&params);
-        params.priority  = 3;
-        params.stack     = &pTaskBuf[index * IPC_TASK_STACKSIZE];
-        params.stackSize = IPC_TASK_STACKSIZE;
-        params.arg0      = pRemoteProcArray[t];
-        params.arg1      = t;
-        Task_create(rpmsg_neg_senderFxn, &params, NULL);
-
+        System_printf("[%s] RPMessage_init failed\n", Ipc_mpGetSelfName());
+        return IPC_EFAIL;
     }
 
-#if !defined(BUILD_MPU1_0) && defined(A72_LINUX_OS) && defined(A72_LINUX_OS_IPC_ATTACH)
-    /* Respond to messages coming in to endPt ENDPT1 */
-    Task_Params_init(&params);
-    params.priority = 3;
-    params.stackSize = 0x1000;
-    params.arg0 = 0;
-    Task_create(rpmsg_neg_vdevMonitorFxn, &params, NULL);
-#endif /* !defined(BUILD_MPU1_0) && defined(A72_LINUX_OS) && defined(A72_LINUX_OS_IPC_ATTACH) */
-
-    return 1;
+    return rpmsg_neg_responderFxn(testId);
 }
 
 int32_t Ipc_echo_neg_test(void)
 {
-    /* RPMessage_Recv timeout set to 1ms for timeout test */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_rcv_timeout_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* set vqBufSize to zero as init param for virtIO */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_virtio_param_vqbuf_size_zero_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* set vringBufSize to zero as init param for virtIO */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_virtio_param_vringbuf_size_zero_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* set bufSize to zero as init param for RPmessage */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_param_buf_size_zero_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* set buf to NULL as init param for RPmessage */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_param_buf_null_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-#ifndef IPC_EXCLUDE_CTRL_TASKS
-    /* set stackSize to zero as init param for RPmessage */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_param_stk_size_zero_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* set stackBuffer to NULL as init param for RPmessage */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_param_stkbuf_null_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-#endif /* IPC_EXCLUDE_CTRL_TASKS */
+    uint32_t i = 0;
 
-    /* send NULL params as part of init virtIO */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_virtio_init_param_null_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* send NULL params as part of init RPMessage */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_init_param_null_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* send RPmessage packet size larger than vring buffer size */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_pkt_large_than_vring_buf_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* send NULL handle as part of RPMessag receive */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_rcv_hndl_null_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* RPMessage_getRemoteEndPt timeout set to 1000 ticks for timeout */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_remote_end_timeout_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* send RPMessage create end point as NULL */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_create_null_endpnt_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* send NULL handle as part of RPMessag send */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_snd_hndl_null_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* send NULL data as part of RPMessag send */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_snd_null_data_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
-
-    Task_sleep(20000);
-
-    /* send NULL data as part of RPMessag send */
-    g_neg_exitRespTsk = 0;
-    clear_all_test_flags();
-    test_rpmsg_snd_unpair_core_flag = 1;
-    ipc_neg_test();
-    rpmsg_neg_exit_responseTask();
+    ipc_neg_test(i);
 
+    UART_printf("Tests finished\n");
+    UART_printf("Total tests: %d Passed: %d Failed %d\n", gTotalTests, gTotalTestsPassed, gTotalTestsFailed);
+    if (gTotalTests == gTotalTestsPassed)
+    {
+        UART_printf("All tests have passed.\n\n\n");
+    }
     return 0;
 }
index ddc08f9277c85ca693aa28cf2cdb18481218b9e3..1e3123abd6a52fdab199ff109dd4cbd372cbaebe 100644 (file)
@@ -301,6 +301,7 @@ export ex05_bios_multicore_echo_negative_test_BOARDLIST
 ex05_bios_multicore_echo_negative_test_$(SOC)_CORELIST = $(drvipc_$(SOC)_TIRTOS_CORELIST)
 export ex05_bios_multicore_echo_negative_test_$(SOC)_CORELIST
 ipc_EXAMPLE_LIST += ex05_bios_multicore_echo_negative_test
+export ex05_bios_multicore_echo_negative_test_SBL_APPIMAGEGEN = yes
 
 # IPC ex02_bios_multicore_echo_testb - use R5F BTCM
 ex02_bios_multicore_echo_testb_COMP_LIST = ex02_bios_multicore_echo_testb