Example #1
0
/*************************************************************************
 *  @b EVM_init()
 * 
 *  @n
 * 		
 *  Initializes the platform hardware. This routine is configured to start in 
 * 	the evm.cfg configuration file. It is the first routine that BIOS 
 * 	calls and is executed before Main is called. If you are debugging within
 *  CCS the default option in your target configuration file may be to execute 
 *  all code up until Main as the image loads. To debug this you should disable
 *  that option. 
 *
 *  @param[in]  None
 * 
 *  @retval
 *      None
 ************************************************************************/
void EVM_init()
{
	platform_init_flags  	sFlags;
	platform_init_config 	sConfig;
	/* Status of the call to initialize the platform */
	int32_t pform_status;
    /* Platform Information - we will read it form the Platform Library */
    platform_info    sPlatformInfo;
    int core;

	/* 
	 * You can choose what to initialize on the platform by setting the following 
	 * flags. Things like the DDR, PLL, etc should have been set by the boot loader.
	*/
	memset( (void *) &sFlags,  0, sizeof(platform_init_flags));
	memset( (void *) &sConfig, 0, sizeof(platform_init_config));

	sFlags.pll  = 0;	/* PLLs for clocking  	*/
	sFlags.ddr  = 0;   	/* External memory 		*/
    sFlags.tcsl = 1;	/* Time stamp counter 	*/
    sFlags.phy  = 1;	/* Ethernet 			*/	//ToDo: Shouldn't this better be 0 ?
  	sFlags.ecc  = 0;	/* Memory ECC 			*/

    sConfig.pllm = 0;	/* Use libraries default clock divisor */

	pform_status = platform_init(&sFlags, &sConfig);

    /* If we initialized the platform okay */
    if (pform_status == Platform_EOK) {
        /* Get information about the platform so we can use it in various places */
        memset( (void *) &sPlatformInfo, 0, sizeof(platform_info));
        platform_get_info(&sPlatformInfo);
        number_of_cores = sPlatformInfo.cpu.core_count;
        MultiProc_setLocalId((Uint16) platform_get_coreid());
    } else {
        /* Initialization of the platform failed... die */
        logout("Platform failed to initialize. Error code %d \n", pform_status);
		while (1) {
			(void) platform_led(1, PLATFORM_LED_ON, PLATFORM_USER_LED_CLASS);
			(void) platform_delay(50000);
			(void) platform_led(1, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
			(void) platform_delay(50000);
		}
    }

    /* Unlock the chip registers */
    CSL_BootCfgUnlockKicker();

    /* wake up the other core to run slave part */
    for (core = 1; core < CORE_AMOUNT; core++)
    {
        /* IPC interrupt other cores */
        DEVICE_REG32_W(IPCGR(core), 1);
        platform_delay(1000);
    }
}
Example #2
0
void EVM_init()
{
    platform_init_flags sFlags;
    platform_init_config sConfig;
    int32_t pform_status;
    platform_info    sPlatformInfo;

    /* Initialise the UART
     * You can choose what to initialise on the platform by setting the following
     * flags. Things like the DDR, PLL, etc should have been set by the boot loader.
     */
    memset( (void *) &sFlags, 0, sizeof(platform_init_flags));
    memset( (void *) &sConfig, 0, sizeof(platform_init_config));

    sFlags.pll = 0; /* PLLs for clocking */
    sFlags.ddr = 1; /* External memory */
    sFlags.tcsl = 1; /* Time stamp counter */
    sFlags.phy = 1; /* Ethernet */
    sFlags.ecc = 0; /* Memory ECC */
    sConfig.pllm = 0; /* Use libraries default clock divisor */

    pform_status = platform_init(&sFlags, &sConfig);

    /* If we initialised the platform okay */
    if (pform_status != Platform_EOK) {
        /* Initialisation of the platform failed... die */
        platform_write("Platform failed to initialise. Error code %d \n", pform_status);
        platform_write("We will die in an infinite loop... \n");
        while (1) {
            (void) platform_led(1, PLATFORM_LED_ON, PLATFORM_USER_LED_CLASS);
            (void) platform_delay(50000);
            (void) platform_led(1, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
            (void) platform_delay(50000);
        }
    }

    memset( (void *) &sPlatformInfo, 0, sizeof(platform_info));
    memset( (void *) &gPlatformInfo, 0, sizeof(platform_info));
    platform_get_info(&sPlatformInfo);

       //platform_get_info(&sPlatformInfo);
    platform_get_info(&gPlatformInfo);
    number_of_cores = gPlatformInfo.cpu.core_count;

    //MultiProc_setLocalId((Uint16) platform_get_coreid());
    platform_uart_init();
    platform_uart_set_baudrate(115200);
    platform_write_configure (PLATFORM_WRITE_ALL);
    platform_write("Board Name %s \n",sPlatformInfo.board_name);
    //write_uart("\r\n\r\nBooting Hello World image from NAND flash via IBL over I2C 0x51 ...");

    //MultiProc_setLocalId((Uint16) platform_get_coreid());
    //CSL_init();
    //Uint16 eventId0;
    //IRQ_clear(eventId0);
    //eventId0 = TIMER_getEventId(timer0Handle);
    //IRQ_enable(eventId0);
    //IRQ_globalEnable();

    return;
}
Example #3
0
//
// Initialize QMSS and CPPI
//
//RBE TODO: DO WE NEED QMSS AND CPPI ???
//If not also delete resourcemgr.c and in client.cfg the Program.sectMap-entries named .resmgr*
//
int Init_QMSS_CPPI()
{
    int				  i;
    QMSS_CFG_T      qmss_cfg;
    CPPI_CFG_T      cppi_cfg;

	/* Get information about the platform so we can use it in various places */
	memset( (void *) &gPlatformInfo, 0, sizeof(platform_info));
	(void) platform_get_info(&gPlatformInfo);

	(void) platform_uart_init();
	(void) platform_uart_set_baudrate(115200);
	(void) platform_write_configure(PLATFORM_WRITE_ALL);

	/* Clear the state of the User LEDs to OFF */
	for (i=0; i < gPlatformInfo.led[PLATFORM_USER_LED_CLASS].count; i++) {
		(void) platform_led(i, PLATFORM_LED_OFF, PLATFORM_USER_LED_CLASS);
	}

    /* Initialize the components required to run this application:
     *  (1) QMSS
     *  (2) CPPI
     *  (3) Packet Accelerator
     */
    /* Initialize QMSS */
    if (platform_get_coreid() == 0)
    {
        qmss_cfg.master_core        = 1;
    }
    else
    {
        qmss_cfg.master_core        = 0;
    }
    qmss_cfg.max_num_desc       = MAX_NUM_DESC;
    qmss_cfg.desc_size          = MAX_DESC_SIZE;
    qmss_cfg.mem_region         = Qmss_MemRegion_MEMORY_REGION0;
    if (res_mgr_init_qmss (&qmss_cfg) != 0)
    {
        logout ("Failed to initialize the QMSS subsystem \n");
        goto main_exit;
    }
    else
    {
    	logout ("QMSS successfully initialized \n");
    }

    /* Initialize CPPI */

    if (platform_get_coreid() == 0)
    {
        cppi_cfg.master_core        = 1;
    }
    else
    {
        cppi_cfg.master_core        = 0;
    }
    cppi_cfg.dma_num            = Cppi_CpDma_PASS_CPDMA;
    cppi_cfg.num_tx_queues      = NUM_PA_TX_QUEUES;
    cppi_cfg.num_rx_channels    = NUM_PA_RX_CHANNELS;
    if (res_mgr_init_cppi (&cppi_cfg) != 0)
    {
        logout ("Failed to initialize CPPI subsystem \n");
        goto main_exit;
    }
    else
    {
    	logout ("CPPI successfully initialized \n");
    }

main_exit:
    return(0);
}