/* -----------------------------------------------------------------------
   FUNCTION : C_ite_dbg_PrintGridIron_cmd
   PURPOSE  :
   ------------------------------------------------------------------------ */
CMD_COMPLETION
C_ite_dbg_PrintGridIron_cmd(
int     a_nb_args,
char    **ap_args)
{
    char    mess[256];

    MMTE_TEST_START("PrintGridIron", "/ite_nmf/test_results_nreg/GridIron_tests", "Test PrintGridIronStatus");

    sprintf(mess, "Testing for GridIron");
    mmte_testNext(mess);

    LOS_Log("********************* PRINT GRIDIRON STATUS PAGE **********************\n");
    if (a_nb_args > 1)
    {
        if (0 == strcmp(ap_args[1], "help"))
        {
            CLI_disp_error("Syntax: PrintGridIron , Tests GridIron interface provided by ISP FW \n");
        }
    }
    else
    {
        if (a_nb_args == 1)
        {
            Print_Gridiron_Parameters();
            LOS_Log("GridIron Status Page Printing done\n");
        }
    }


    LOS_Log("**************** PRINT GRIDIRON STATUS PAGE COMPLETE *****************\n");
    MMTE_TEST_PASSED();
    return (0);
}
/* -----------------------------------------------------------------------
FUNCTION : C_ite_dbg_VerifyFlashTriggered_cmd
PURPOSE  : Function to check flash is triggred or not
------------------------------------------------------------------------ */
CMD_COMPLETION
C_ite_dbg_VerifyFlashTriggered_cmd(
int     a_nb_args,
char    **ap_args)
{
    char        mess[256];
    RESULT_te   result = SUCCESS;
    UNUSED(ap_args);

    sprintf(mess, "Testing for VerifyFlashTriggered");
    MMTE_TEST_NEXT(mess);

    if (Flag_e_FALSE == Is_Flash_Supported())
    {   
        MMTE_TEST_SKIPPED();
        return (CMD_COMPLETE);
    }

    if (a_nb_args == 1)
    {
        result |= (Verify_Params_Absorbed(Flag_e_FALSE, Flag_e_TRUE));
    }

    if (SUCCESS == result)
    {
        MMTE_TEST_PASSED();
    }
    else
    {
        MMTE_TEST_FAILED();
    }

    Send_System_Params(Flag_e_FALSE, Flag_e_FALSE);  //cleanup
    return (CMD_COMPLETE);
}
/* -----------------------------------------------------------------------
   FUNCTION : C_ite_dbg_PrintAdsoc_cmd
   PURPOSE  :
   ------------------------------------------------------------------------ */
CMD_COMPLETION
C_ite_dbg_VerifyAdsoc_cmd(
int     a_nb_args,
char    **ap_args)
{
    char    mess[256];

    sprintf(mess, "VerityAdsoc_%d", ( int ) g_u32_counter_adsoc_test);
    g_u32_counter_adsoc_test++;

    MMTE_TEST_START(mess, "/ite_nmf/test_results_nreg/Adsoc_tests", "Test PrintAdsocStatus");

    sprintf(mess, "Verifying Adsoc");
    mmte_testNext(mess);

    LOS_Log("**********************************************************************\n");
    LOS_Log("******************* PRINT Adsoc peaking STATUS PAGE ********************\n");
    LOS_Log("**********************************************************************\n");
    if (a_nb_args > 1)
    {
        if (0 == strcmp(ap_args[1], "help"))
        {
            CLI_disp_error("Syntax: PrintAdsocRP , Tests Adsoc interface provided by ISP FW \n");
        }


        if (0 == strcmp(ap_args[1], "0"))
        {
            Verify_Adsoc_Peaking(0);
            LOS_Log("Adsoc peaking Status Page Printing done for pipe 0\n");
        }
        else if (0 == strcmp(ap_args[1], "1"))
        {
            Verify_Adsoc_Peaking(1);
            LOS_Log("Adsoc peaking Status Page Printing done for pipe 1\n");
        }
    }
    else
    {
        CLI_disp_error("Syntax: PrintAdsoc , Tests Adsoc peaking interface provided by ISP FW \n");
    }


    LOS_Log("**********************************************************************\n");
    LOS_Log("****************** PRINT Adsoc peaking STATUS PAGE COMPLETE *******************\n");
    LOS_Log("**********************************************************************\n");
    MMTE_TEST_PASSED();
    return (CMD_COMPLETE);
}
Example #4
0
/* -----------------------------------------------------------------------
   FUNCTION : C_ite_dbg_focusstatreadytest_cmd
   PURPOSE  :
   ------------------------------------------------------------------------ */
CMD_COMPLETION
C_ite_dbg_focusstatreadytest_cmd(
int     a_nb_args,
char    **ap_args)
{
   Result_te result = Result_e_Success;
   char mess[256];
   MMTE_TEST_START("focusstatreadytest","/ite_nmf/test_results_nreg/focus_tests","Testing for focusstatreadytest");
   snprintf(mess,sizeof(mess),"focusstatreadytest");
   MMTE_TEST_NEXT("focusstatreadytest");

    if (a_nb_args > 2)
    {
        if (0 == strcmp(ap_args[1], "help"))
        {
            CLI_disp_error("syntax: fstattest <filename>\n");
            MMTE_TEST_SKIPPED();
        }
    }
    else
    {
        if (a_nb_args == 2)
        {
            ITE_NMF_FocusStatsPrepare();
            result = AFSTatsReadyTest(ap_args[1],
            (t_uint32) (pFocusStatsBuffer->ISPBufferBaseAddress),
            (t_uint32) (pFocusStatsBuffer->logAddress));

            if(result == Result_e_Success)
             {
               MMTE_TEST_PASSED();
             }
            else
             {
              MMTE_TEST_FAILED();
             }
        }
        else
        {
            CLI_disp_error("Not correct command arguments\n");
            MMTE_TEST_SKIPPED();
        }
    }


    return (CMD_COMPLETE);
}
/* -----------------------------------------------------------------------
   FUNCTION : C_ite_dbg_ConfigureAdsoc_cmd
   PURPOSE  :
   ------------------------------------------------------------------------ */
CMD_COMPLETION
C_ite_dbg_ConfigureAdsoc_cmd(
int     a_nb_args,
char    **ap_args)
{
    char    mess[256];

    sprintf(mess, "ConfigureAdsoc_%d", ( int ) g_u32_counter_adsoc_conf);
    g_u32_counter_adsoc_conf++;

    MMTE_TEST_START(mess, "/ite_nmf/test_results_nreg/Adsoc_tests", "Test ConfigureAdsoc");

    sprintf(mess, "Testing for Adsoc peaking");
    mmte_testNext(mess);

    LOS_Log("******************* ADSOC PEAKING CONFIGURATION ****************\n");

    if (a_nb_args > 1)
    {
        if (0 == strcmp(ap_args[1], "help"))
        {
            CLI_disp_error("Syntax: ConfigureAdsoc , Configures Adsoc interface provided by ISP FW \n");
        }


        if (0 == strcmp(ap_args[1], "0"))
        {
            Configure_Adsoc_Peaking(0);
            Enable_Adsoc(0, Flag_e_TRUE);
            LOS_Log("Adsoc peaking configuration done for pipe 0\n");
        }
        else if (0 == strcmp(ap_args[1], "1"))
        {
            Configure_Adsoc_Peaking(1);
            Enable_Adsoc(1, Flag_e_TRUE);
            LOS_Log("Adsoc peaking configuration done for pipe 1\n");
        }
    }


    LOS_Log("************************* ADSOC PEAKING TEST END**********************\n");
    MMTE_TEST_PASSED();
    return (CMD_COMPLETE);
}
/* -----------------------------------------------------------------------
FUNCTION : C_ite_dbg_TestFlashSupport_cmd
PURPOSE  :  Function to check the flash is supported or not
------------------------------------------------------------------------ */
CMD_COMPLETION
C_ite_dbg_TestFlashSupport_cmd(
int     a_nb_args,
char    **ap_args)
{
    char    mess[256];
    UNUSED(ap_args);
    MMTE_TEST_START("TestFlashSupport", "/ite_nmf/test_results_nreg/flash_tests", "Testing for Flash_SUPPORT");

    sprintf(mess, "Testing for Flash_SUPPORT");
    MMTE_TEST_NEXT(mess);
    if (a_nb_args != 1)
    {
        CLI_disp_error("TestFlashSupport: Checks whether Flash is suppported by the firmware \n");
        CLI_disp_error("TestFlashSupport[Command]: TestFlashSupport \n\n");
        CLI_disp_error("Not correct command arguments\n");
        MMTE_TEST_SKIPPED();

        return (CMD_ERR_ARGS);
    }


    if (Flag_e_FALSE == Is_Flash_Supported())
    {
        snprintf(mess, sizeof(mess), "Flash NOT Supported by the device! \n");
        MMTE_TEST_COMMENT(mess);


        MMTE_TEST_SKIPPED();
    }
    else
    {
        snprintf(mess, sizeof(mess), "Flash Supported by the device! \n");
        MMTE_TEST_COMMENT(mess);


        MMTE_TEST_PASSED();
    }


    return (CMD_COMPLETE);
}
/* -----------------------------------------------------------------------
   FUNCTION : C_ite_dbg_VerityAdsocRP_cmd
   PURPOSE  :
   ------------------------------------------------------------------------ */
CMD_COMPLETION
C_ite_dbg_VerityAdsocRP_cmd(
int     a_nb_args,
char    **ap_args)
{
    char    mess[256];

    sprintf(mess, "VerityAdsoc_Radial_Peaking_%d", ( int ) g_u32_counter_RP_test);
    g_u32_counter_RP_test++;

    MMTE_TEST_START(mess, "/ite_nmf/test_results_nreg/Adsoc_tests", "Test VerifyAdsocRP");

    sprintf(mess, "Verifying AdsocRP configuration");
    mmte_testNext(mess);

    LOS_Log("********************* Verify Adsoc radial peaking STATUS PAGE **********************\n");
    if (a_nb_args != 2)
    {
        CLI_disp_error("Syntax: VerifyAdsocRP <pipe_number> \n");
        return (CMD_ERR_ARGS);
    }


    if (0 == Verify_Adsoc_Radial_Peaking(atoi(ap_args[1])))
    {
        snprintf(mess, sizeof(mess), "Adsoc radial peaking test successfull for pipe <%d>\n", atoi(ap_args[1]));
        MMTE_TEST_COMMENT(mess);
        MMTE_TEST_PASSED();
        return (CMD_COMPLETE);
    }
    else
    {
        snprintf(mess, sizeof(mess), "Adsoc radial peaking test failed for pipe <%d>\n", atoi(ap_args[1]));
        MMTE_TEST_COMMENT(mess);
        MMTE_TEST_FAILED();
        return (CMD_COMPLETE);
    }


    LOS_Log("**************** Verify Adsoc radial peaking STATUS PAGE COMPLETE *****************\n");
    return (CMD_COMPLETE);
}
/* -----------------------------------------------------------------------
   FUNCTION : C_ite_dbg_ConfigureAdsocRP_cmd
   PURPOSE  :
   ------------------------------------------------------------------------ */
CMD_COMPLETION
C_ite_dbg_ConfigureAdsocRP_cmd(
int     a_nb_args,
char    **ap_args)
{
    char    mess[256];

    sprintf(mess, "ConfigureAdsoc_Radial_Peaking_%d", ( int ) g_u32_counter_RP_conf);
    g_u32_counter_RP_conf++;

    MMTE_TEST_START(mess, "/ite_nmf/test_results_nreg/AdsocRP_tests", "Test ConfigureAdsocRP");

    sprintf(mess, "Testing for Adsoc peaking");
    mmte_testNext(mess);

    LOS_Log("************* ADSOC RADIAL PEAKING CONFIGURATION TEST ****************\n");
    if (a_nb_args != 2)
    {
        CLI_disp_error("Syntax: ConfigureAdsocRP , Configures Adsoc interface provided by ISP FW \n");
        return (CMD_ERR_ARGS);
    }


    if (0 == Configure_Adsoc_Radial_Peaking(atoi(ap_args[1])))
    {
        Enable_Adsoc_Radial_Peaking(atoi(ap_args[1]), Flag_e_TRUE);
        LOS_Log("Adsoc radial peaking configuration done for pipe <%d>\n", atoi(ap_args[1]));
    }
    else
    {
        snprintf(mess, sizeof(mess), "Adsoc radial peaking configuration failed for pipe <%d>\n", atoi(ap_args[1]));
        MMTE_TEST_COMMENT(mess);
        MMTE_TEST_FAILED();
        return (CMD_COMPLETE);
    }


    LOS_Log("********************* ADSOC RADIAL PEAKING TEST END*******************\n");
    MMTE_TEST_PASSED();
    return (CMD_COMPLETE);
}
/* -----------------------------------------------------------------------
   FUNCTION : C_ite_dbg_TestGridIronLiveCast_cmd
   PURPOSE  :
   ------------------------------------------------------------------------ */
CMD_COMPLETION
C_ite_dbg_TestGridIronLiveCast_cmd(
int     a_nb_args,
char    **ap_args)
{
    char    mess[256];
    UNUSED(ap_args);

    sprintf(mess, "TestGridIron_%d", ( int ) g_u32_counter_gridiron_test);
    g_u32_counter_gridiron_test++;

    MMTE_TEST_START(mess, "/ite_nmf/test_results_nreg/GridIron_tests", "TestGridIron");

    sprintf(mess, "Testing for GridIron");
    mmte_testNext(mess);

    if (a_nb_args > 1)
    {
        CLI_disp_error("Syntax:=>   TestGridIron   \n");
    }
    else
    {
        if (a_nb_args == 1)
        {
            if (0 == TestGridironLiveCast())
            {
                sprintf(mess, "GridIron live cast testing completed successfully\n");
                mmte_testComment(mess);
                MMTE_TEST_PASSED();
                return (0);
            }
        }
    }


    sprintf(mess, "GridIron live cast testing not done\n");
    mmte_testComment(mess);
    MMTE_TEST_FAILED();
    return (0);
}
CMD_COMPLETION
C_ite_dbg_Configure_GrabMode_cmd(
int     a_nb_args,
char    **ap_args)
{
    char    mess[256];

    sprintf(mess, "Forced_Grab_Mode_%d", (int)g_u32_grabok_counter_config);
    g_u32_grabok_counter_config++;

    MMTE_TEST_START(
    mess,
    "/ite_nmf/test_results_nreg/Forced_Grab_Mode",
    "Forced_Grab_Mode");

    sprintf(mess, "Configuring begin point for grab ok mechanism");
    mmte_testNext(mess);    
    
    switch(a_nb_args)
    {       
        case 2:                 // configureForcedGrabMode  <forced_grab_mode>
        {                              
            ConfigureForcedGrabMode(atoi(ap_args[1]));                
            break;
        }

        default:     // wrong syntax : print on stdout how to use test framework for grabOK testing
        {
            LOS_Log("syntax : configureForcedGrabMode  <forced_grab_mode> \n"); 
            break;            
        }                     
    }

    sprintf(mess, "Configuration of forced grab mode mechanism done\n");
    mmte_testComment(mess);
    MMTE_TEST_PASSED();          

    return 0;
}
/* -----------------------------------------------------------------------
   FUNCTION : C_ite_dbg_ConfigureGridIron_StaticPrams_cmd
   PURPOSE  :
   ------------------------------------------------------------------------ */
CMD_COMPLETION
C_ite_dbg_ConfigureGridIron_StaticPrams_cmd(
int     a_nb_args,
char    **ap_args)
{
    char    mess[256];

    sprintf(mess, "ConfigureGridIron_%d", ( int ) g_u32_counter_gridiron_conf);
    g_u32_counter_gridiron_conf++;

    MMTE_TEST_START(mess, "/ite_nmf/test_results_nreg/GridIron_tests", "Test ConfigureGridIronStatic");

    sprintf(mess, "Testing for GridIron");
    mmte_testNext(mess);

    LOS_Log("******************* GRIDIRON STATIC CONFIGURATION START **********************\n");

    if (a_nb_args != 3)
    {
        if (0 == strcmp(ap_args[1], "help"))
        {
            CLI_disp_error("Syntax: ConfigureGridIronStatic , Configures GridIron interface provided by ISP FW \n");
        }
    }
    else
    {
        Configure_Gridiron_StaticPrarams(ap_args[1][0] - '0', ap_args[2][0] - '0');
        Enable_Gridiron(Flag_e_TRUE);
        LOS_Log("GridIron configuration done\n");
    }


    LOS_Log("**************************** GRIDIRON STATIC CONFIGURATION END************************\n");

    MMTE_TEST_PASSED();
    return (0);
}
CMD_COMPLETION
C_ite_dbg_Test_Forced_GrabOK_cmd(
int     a_nb_args,
char    **ap_args)
{
    char    mess[256];
    char    test_name_string[50];
    t_uint32 u32_test_name_id = 0;

    switch(a_nb_args)
    {       
        case 2:                 // TestForcedGrabMode <forced_grab_mode>
        {
            if(GrabMode_e_FORCE_OK == atoi(ap_args[1]))
            {
                LOS_Log("setting test name to Forced_GrabMode_OK\n");
                strcpy(test_name_string, "Test_Forced_GrabMode_OK");
                u32_test_name_id = GrabMode_e_FORCE_OK;
            }    
            else if(GrabMode_e_FORCE_NOK == atoi(ap_args[1]))
            {
                LOS_Log("setting test name to Forced_GrabMode_NOK\n");
                strcpy(test_name_string, "Test_Forced_GrabMode_NOK");    
                u32_test_name_id = GrabMode_e_FORCE_NOK;
            }
            else
            {
                LOS_Log("bad arguments\n");
                return CMD_ERR_ARGS;            
            }
         }
        default:     // wrong syntax : print on stdout how to use test framework for grabOK testing
        {
            LOS_Log("syntax : TestForcedGrabMode <forced_grab_mode>\n"); 
            break;  
         }
         return 0;
     }
    

           

    sprintf(mess, "%s_%d", test_name_string, (int)g_u32_grabok_counter_config);
    g_u32_grabok_counter_config++;

    MMTE_TEST_START(
    mess,
    "/ite_nmf/test_results_nreg/Forced_Grab_Mode",
    "Forced_Grab_Mode");

    sprintf(mess, "Testing grab OK mechanism");
    mmte_testNext(mess);    
                            
    if(GrabMode_e_FORCE_OK == u32_test_name_id)            
    {
        if(0 != TestForcedGrabMode_OK())    
        {
            LOS_Log("Testing of forced grab mode OK mechanism failed\n");
            sprintf(mess, "Testing of forced grab mode OK mechanism failed\n");
            mmte_testComment(mess);
            MMTE_TEST_FAILED();       
            return (CMD_ERR_ARGS);
        }
    }
    else if(GrabMode_e_FORCE_NOK == u32_test_name_id)            
    {
        if(0 != TestForcedGrabMode_NOK())    
        {
            LOS_Log("Testing of forced grab mode NOK mechanism failed\n");
            sprintf(mess, "Testing of forced grab mode NOK mechanism failed\n");
            mmte_testComment(mess);
            MMTE_TEST_FAILED();       
            return (CMD_ERR_ARGS);
        }
     }              
    else
    {      
        while(1)
        {
            LOS_Log("Invalid condition\n");
        }
    }

    sprintf(mess, "Testing of force grab ok mechanism done\n");
    mmte_testComment(mess);
    MMTE_TEST_PASSED();          

    return 0;
}
static RESULT_te Flash_enable_pre_streaming(char* datapath)
{
    t_uint32    frameCount=0;
    char        comment[256],fname[256],pathname[256],mess[256];  
    sprintf(fname, "Flash_pre_streaming");
      
    memset(g_out_path,0,KlogDirectoryLentgh*sizeof(char));
    sprintf(pathname,"/ite_nmf/test_results_nreg/flash_tests");

    MMTE_TEST_START(fname, pathname,"Testing for Flash_configure");
  
    Send_System_Params(Flag_e_FALSE, Flag_e_TRUE);  //set flashmode to TRUE
    
    if (0 == strcmp(datapath,"LR"))
    {
        ITE_LR_Prepare(&usecase, INFINITY);
        ITE_LR_Start(INFINITY);
    }
    else if (0 == strcmp(datapath,"HR"))
    { 
        ITE_HR_Prepare(&usecase, INFINITY);
        ITE_HR_Start(INFINITY);
    }
    else if (0 == strcmp(datapath,"BMS"))
    { 
        ITE_BMS_Prepare(&usecase, INFINITY);
        ITE_BMS_Start(INFINITY);
    }
    else  //LRHR
    {
        ITE_LRHR_Prepare(&usecase, INFINITY);
        ITE_LRHR_Start(INFINITY);
    }

    sprintf(mess, "Testing for Flash_pre_streaming_%s\n",datapath);
    MMTE_TEST_NEXT(mess);

    //let first few frames pass..
    LOS_Sleep(1000);

    //currently the implementation in firmware is such that this pe will be updated
    //iff the first frame is a flashlit frame, for this usecase.
    frameCount = ITE_readPE(FlashStatus_u8_FlashFiredFrameCount_Byte0);

    if (0 < frameCount)
    {
        sprintf(comment, "Flash Fired in first Frame!!\n");
        MMTE_TEST_COMMENT(comment);

        if (0 == strcmp(datapath,"BMS"))
        {
          sprintf(comment, "DMA Grab Notify Frame ID:%d\n", (int)ITE_readPE(GrabNotify_u32_DMA_GRAB_Frame_Id_Byte0) );
          MMTE_TEST_COMMENT(comment);
        }

        MMTE_TEST_PASSED();
    }
    else
    {
        sprintf(comment, "Test will fail because first frame is not flash lit.\n");
        MMTE_TEST_COMMENT(comment);
        MMTE_TEST_FAILED();
    }
    
     
    if (0 == strcmp(datapath,"LR"))
    {
        ITE_LR_Stop();
        ITE_LR_Free();
    }
    else if (0 == strcmp(datapath,"HR"))
    { 
        ITE_HR_Stop();
        ITE_HR_Free();
    }
    else if (0 == strcmp(datapath,"BMS"))
    { 
        ITE_BMS_Stop();
        ITE_BMS_Free();
    }
    else  //LRHR
    {
        ITE_LRHR_Stop();
        ITE_LRHR_Free();
    }

    Send_System_Params(Flag_e_FALSE, Flag_e_FALSE);  //cleanup
    return (CMD_COMPLETE);

}