Exemplo n.º 1
0
void MstarSysInit(void)
{
    uint u32Tmp;
    extern MS_BOOL MDrv_MIU_SetIOMapBase(void);
    extern MS_BOOL MDrv_SEM_Init(void);

    MsOS_Init();
    MDrv_MMIO_Init();
    MDrv_MMIO_GetBASE((MS_U32 *)&MS_RIU_MAP, (MS_U32 *)&u32Tmp, MS_MODULE_PM);
    MDrv_SEM_Init();
    MDrv_MIU_SetIOMapBase();
    MsOS_CPU_EnableInterrupt();
#if (ENABLE_MODULE_ENV_IN_SERIAL==1)
    puts ("SPI:  ");
    {
        extern int spi_init (void);
        spi_init();		/* go init the SPI */
    }
    #if (CONFIG_MSTAR_BD_MST028B_10AFX_EAGLE||CONFIG_MSTAR_BD_MST038B_10AHT_EAGLE)
        MDrv_SERFLASH_SetWPInfo(TRUE);
    #else
    ms_Flash_SetHWWP_CB pCB = msFlash_ActiveFlash_Set_HW_WP;
    MDrv_SERFLASH_SetFlashWPCallBack(pCB);
    #endif
#else
    #if(ENABLE_BOOTING_FROM_EXT_EMMC_WITH_CPU==0)
        MDrv_SERFLASH_Init();
    #endif
#endif
    mdrv_gpio_init();
    run_command("init_raw_io" , 0);
    run_command("config_raw_io" , 0);

}
Exemplo n.º 2
0
static int spi_flash_init(void)
{
    if(spiInitFlag == 0)
    {
       MDrv_SERFLASH_Init();
       spiInitFlag = 1;
       printf("initialization done!\n");
    }
    return 0;
}
Exemplo n.º 3
0
void MstarSysInit(void)
{
    uint u32Tmp;
    /*set up Mstar IRQ handler*/
    extern void mhal_fiq_merge(void);
    extern void MAsm_CPU_TimerStart(void);
    extern void dcache_init(void);
    extern void l2_cache_init(void);
    mhal_fiq_merge();
    MsOS_Init();
#ifdef CONFIG_SYS_DCACHE
    dcache_init();
#endif

#ifndef CONFIG_L2_OFF
    l2_cache_init();
#endif
#if defined(CONFIG_TIMER_TEST)
    MDrv_Timer_ISR_Register();
#endif
    MsOS_CPU_EnableInterrupt();
    MAsm_CPU_TimerStart();


    MDrv_MMIO_Init();
    MDrv_MMIO_GetBASE((MS_U32 *)&MS_RIU_MAP, (MS_U32 *)&u32Tmp, MS_MODULE_PM);
#if (ENABLE_MODULE_ENV_IN_SERIAL==1)
    puts ("SPI:  ");
    {
        extern int spi_init (void);
        spi_init();		/* go init the SPI */
    }

    #if (CONFIG_MSTAR_BD_MST028B_10AFX_EAGLE||CONFIG_MSTAR_BD_MST038B_10AHT_EAGLE)
    MDrv_SERFLASH_SetWPInfo(TRUE);
    #else
    ms_Flash_SetHWWP_CB pCB = msFlash_ActiveFlash_Set_HW_WP;
    MDrv_SERFLASH_SetFlashWPCallBack(pCB);
    FlashSetHWWPCB = FlashSetHWWPCB;
    McuChipSelectCB = McuChipSelectCB;
    #endif
#else
    #if(ENABLE_BOOTING_FROM_EXT_EMMC_WITH_CPU==0)
        MDrv_SERFLASH_Init();
    #endif
#endif

    mdrv_gpio_init();
    MDrv_BDMA_Init(MIU_INTERVAL);

    run_command("init_raw_io" , 0);
    run_command("config_raw_io" , 0);
}