Exemplo n.º 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);
    }
}
Exemplo n.º 2
0
/*!
 *  ======== MultiProcSetup_init ========
 */     
Void MultiProcSetup_init()
{
    extern cregister volatile UInt DNUM;
    UInt16 procId;

    /* Skip if the procId has already been set */
    if (MultiProc_self() != MultiProc_INVALIDID) {
        return;
    }

    procId = MultiProcSetup_getProcId(DNUM);
    
    /* 
     *  Assert that image is being loaded onto a core that was included in the 
     *  MultiProc name list (via setConfig)
     */
    Assert_isTrue(procId != MultiProc_INVALIDID, 
            MultiProcSetup_A_invalidProcessor);
    
    /* Set the local ID */
    MultiProc_setLocalId(procId);
}
/**
 *  @b Description
 *  @n  
 *      Utility function that is required by the IPC module to set the proc Id.
 *      The proc Id is set via this function instead of hard coding it in the .cfg file
 *
 *  @retval
 *      Not Applicable.
 */
Void myStartupFxn (Void)
{
	MultiProc_setLocalId (CSL_chipReadReg (CSL_CHIP_DNUM));
}